Commit 20a62718 authored by yangguo@chromium.org's avatar yangguo@chromium.org

Rename debug API methods.

R=yurys@chromium.org

Review URL: https://codereview.chromium.org/281733002

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@21295 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 2ea755fc
...@@ -137,7 +137,10 @@ class V8_EXPORT Debug { ...@@ -137,7 +137,10 @@ class V8_EXPORT Debug {
* A EventCallback2 does not take possession of the event data, * A EventCallback2 does not take possession of the event data,
* and must not rely on the data persisting after the handler returns. * and must not rely on the data persisting after the handler returns.
*/ */
typedef void (*EventCallback2)(const EventDetails& event_details); typedef void (*EventCallback)(const EventDetails& event_details);
// TODO(yangguo) Deprecate this.
typedef EventCallback EventCallback2;
/** /**
* Debug message callback function. * Debug message callback function.
...@@ -147,15 +150,24 @@ class V8_EXPORT Debug { ...@@ -147,15 +150,24 @@ class V8_EXPORT Debug {
* A MessageHandler2 does not take possession of the message data, * A MessageHandler2 does not take possession of the message data,
* and must not rely on the data persisting after the handler returns. * and must not rely on the data persisting after the handler returns.
*/ */
typedef void (*MessageHandler2)(const Message& message); typedef void (*MessageHandler)(const Message& message);
// TODO(yangguo) Deprecate this.
typedef MessageHandler MessageHandler2;
/** /**
* Callback function for the host to ensure debug messages are processed. * Callback function for the host to ensure debug messages are processed.
*/ */
typedef void (*DebugMessageDispatchHandler)(); typedef void (*DebugMessageDispatchHandler)();
static bool SetDebugEventListener(EventCallback that,
Handle<Value> data = Handle<Value>());
// TODO(yangguo) Deprecate this.
static bool SetDebugEventListener2(EventCallback2 that, static bool SetDebugEventListener2(EventCallback2 that,
Handle<Value> data = Handle<Value>()); Handle<Value> data = Handle<Value>()) {
return SetDebugEventListener(that, data);
}
// Schedule a debugger break to happen when JavaScript code is run // Schedule a debugger break to happen when JavaScript code is run
// in the given isolate. // in the given isolate.
...@@ -178,7 +190,12 @@ class V8_EXPORT Debug { ...@@ -178,7 +190,12 @@ class V8_EXPORT Debug {
} }
// Message based interface. The message protocol is JSON. // Message based interface. The message protocol is JSON.
static void SetMessageHandler2(MessageHandler2 handler); static void SetMessageHandler(MessageHandler handler);
// TODO(yangguo) Deprecate this.
static void SetMessageHandler2(MessageHandler2 handler) {
SetMessageHandler(handler);
}
static void SendCommand(Isolate* isolate, static void SendCommand(Isolate* isolate,
const uint16_t* command, int length, const uint16_t* command, int length,
......
...@@ -6778,10 +6778,10 @@ Local<Value> Exception::Error(v8::Handle<v8::String> raw_message) { ...@@ -6778,10 +6778,10 @@ Local<Value> Exception::Error(v8::Handle<v8::String> raw_message) {
// --- D e b u g S u p p o r t --- // --- D e b u g S u p p o r t ---
bool Debug::SetDebugEventListener2(EventCallback2 that, Handle<Value> data) { bool Debug::SetDebugEventListener(EventCallback that, Handle<Value> data) {
i::Isolate* isolate = i::Isolate::Current(); i::Isolate* isolate = i::Isolate::Current();
EnsureInitializedForIsolate(isolate, "v8::Debug::SetDebugEventListener2()"); EnsureInitializedForIsolate(isolate, "v8::Debug::SetDebugEventListener()");
ON_BAILOUT(isolate, "v8::Debug::SetDebugEventListener2()", return false); ON_BAILOUT(isolate, "v8::Debug::SetDebugEventListener()", return false);
ENTER_V8(isolate); ENTER_V8(isolate);
i::HandleScope scope(isolate); i::HandleScope scope(isolate);
i::Handle<i::Object> foreign = isolate->factory()->undefined_value(); i::Handle<i::Object> foreign = isolate->factory()->undefined_value();
...@@ -6811,7 +6811,7 @@ void Debug::DebugBreakForCommand(Isolate* isolate, ClientData* data) { ...@@ -6811,7 +6811,7 @@ void Debug::DebugBreakForCommand(Isolate* isolate, ClientData* data) {
} }
void Debug::SetMessageHandler2(v8::Debug::MessageHandler2 handler) { void Debug::SetMessageHandler(v8::Debug::MessageHandler handler) {
i::Isolate* isolate = i::Isolate::Current(); i::Isolate* isolate = i::Isolate::Current();
EnsureInitializedForIsolate(isolate, "v8::Debug::SetMessageHandler"); EnsureInitializedForIsolate(isolate, "v8::Debug::SetMessageHandler");
ENTER_V8(isolate); ENTER_V8(isolate);
......
...@@ -797,7 +797,7 @@ void Shell::InstallUtilityScript(Isolate* isolate) { ...@@ -797,7 +797,7 @@ void Shell::InstallUtilityScript(Isolate* isolate) {
// Start the in-process debugger if requested. // Start the in-process debugger if requested.
if (i::FLAG_debugger && !i::FLAG_debugger_agent) { if (i::FLAG_debugger && !i::FLAG_debugger_agent) {
v8::Debug::SetDebugEventListener2(HandleDebugEvent); v8::Debug::SetDebugEventListener(HandleDebugEvent);
} }
} }
#endif // !V8_SHARED #endif // !V8_SHARED
......
...@@ -3180,7 +3180,7 @@ void Debugger::SetEventListener(Handle<Object> callback, ...@@ -3180,7 +3180,7 @@ void Debugger::SetEventListener(Handle<Object> callback,
} }
void Debugger::SetMessageHandler(v8::Debug::MessageHandler2 handler) { void Debugger::SetMessageHandler(v8::Debug::MessageHandler handler) {
LockGuard<RecursiveMutex> with(&debugger_access_); LockGuard<RecursiveMutex> with(&debugger_access_);
message_handler_ = handler; message_handler_ = handler;
......
...@@ -782,7 +782,7 @@ class Debugger { ...@@ -782,7 +782,7 @@ class Debugger {
Handle<JSObject> event_data, Handle<JSObject> event_data,
bool auto_continue); bool auto_continue);
void SetEventListener(Handle<Object> callback, Handle<Object> data); void SetEventListener(Handle<Object> callback, Handle<Object> data);
void SetMessageHandler(v8::Debug::MessageHandler2 handler); void SetMessageHandler(v8::Debug::MessageHandler handler);
void SetDebugMessageDispatchHandler( void SetDebugMessageDispatchHandler(
v8::Debug::DebugMessageDispatchHandler handler, v8::Debug::DebugMessageDispatchHandler handler,
bool provide_locker); bool provide_locker);
...@@ -889,7 +889,7 @@ class Debugger { ...@@ -889,7 +889,7 @@ class Debugger {
bool ignore_debugger_; // Are we temporarily ignoring the debugger? bool ignore_debugger_; // Are we temporarily ignoring the debugger?
bool live_edit_enabled_; // Enable LiveEdit. bool live_edit_enabled_; // Enable LiveEdit.
bool never_unload_debugger_; // Can we unload the debugger? bool never_unload_debugger_; // Can we unload the debugger?
v8::Debug::MessageHandler2 message_handler_; v8::Debug::MessageHandler message_handler_;
bool debugger_unload_pending_; // Was message handler cleared? bool debugger_unload_pending_; // Was message handler cleared?
Mutex dispatch_handler_access_; // Mutex guarding dispatch handler. Mutex dispatch_handler_access_; // Mutex guarding dispatch handler.
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment