Reviewers: Yang, loislo,

Message:
Committed patchset #1 manually as r15769 (presubmit successful).

Description:
Deprecate some debugger methods

These methods have been superceeded by equivalents accepting object arguments
exposing more details.

This is exactly the same change as r15708 which was reverted in r15710 due to pending Blink changes. Now that Blink is rolled to 154493 it should be safe to
land this (required Blink change is 154386).

BUG=None
TBR=yang...@chromium.org

Committed: https://code.google.com/p/v8/source/detail?r=15769

Please review this at https://codereview.chromium.org/19541005/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files:
  M include/v8-debug.h
  M src/d8-debug.h
  M src/d8-debug.cc
  M src/d8.cc
  M test/cctest/test-debug.cc


Index: include/v8-debug.h
diff --git a/include/v8-debug.h b/include/v8-debug.h
index f432de0be85f7d17a433fbc754a39265b4d1efc2..e488aaa8891e707cd4cb61a5e48bca121e073095 100755
--- a/include/v8-debug.h
+++ b/include/v8-debug.h
@@ -245,8 +245,9 @@ class EXPORT Debug {
   typedef void (*DebugMessageDispatchHandler)();

   // Set a C debug event listener.
-  static bool SetDebugEventListener(EventCallback that,
-                                    Handle<Value> data = Handle<Value>());
+  V8_DEPRECATED(static bool SetDebugEventListener(
+      EventCallback that,
+      Handle<Value> data = Handle<Value>()));
   static bool SetDebugEventListener2(EventCallback2 that,
                                      Handle<Value> data = Handle<Value>());

@@ -274,8 +275,9 @@ class EXPORT Debug {

// Message based interface. The message protocol is JSON. NOTE the message
   // handler thread is not supported any more parameter must be false.
-  static void SetMessageHandler(MessageHandler handler,
-                                bool message_handler_thread = false);
+  V8_DEPRECATED(static void SetMessageHandler(
+      MessageHandler handler,
+      bool message_handler_thread = false));
   static void SetMessageHandler2(MessageHandler2 handler);

   // If no isolate is provided the default isolate is
Index: src/d8-debug.cc
diff --git a/src/d8-debug.cc b/src/d8-debug.cc
index aac7aab156d6745fba4a2c85b6763e2eee9a6cbe..9a72518f4cbe2b28493668fee394d795317d16d9 100644
--- a/src/d8-debug.cc
+++ b/src/d8-debug.cc
@@ -50,14 +50,12 @@ void PrintPrompt() {
 }


-void HandleDebugEvent(DebugEvent event,
-                      Handle<Object> exec_state,
-                      Handle<Object> event_data,
-                      Handle<Value> data) {
+void HandleDebugEvent(const Debug::EventDetails& event_details) {
// TODO(svenpanne) There should be a way to retrieve this in the callback.
   Isolate* isolate = Isolate::GetCurrent();
   HandleScope scope(isolate);

+  DebugEvent event = event_details.GetEvent();
   // Check for handled event.
   if (event != Break && event != Exception && event != AfterCompile) {
     return;
@@ -67,6 +65,7 @@ void HandleDebugEvent(DebugEvent event,

   // Get the toJSONProtocol function on the event and get the JSON format.
   Local<String> to_json_fun_name = String::New("toJSONProtocol");
+  Handle<Object> event_data = event_details.GetEventData();
   Local<Function> to_json_fun =
       Local<Function>::Cast(event_data->Get(to_json_fun_name));
   Local<Value> event_json = to_json_fun->Call(event_data, 0, NULL);
@@ -91,6 +90,7 @@ void HandleDebugEvent(DebugEvent event,

   // Get the debug command processor.
   Local<String> fun_name = String::New("debugCommandProcessor");
+  Handle<Object> exec_state = event_details.GetExecutionState();
   Local<Function> fun = Local<Function>::Cast(exec_state->Get(fun_name));
   Local<Object> cmd_processor =
       Local<Object>::Cast(fun->Call(exec_state, 0, NULL));
Index: src/d8-debug.h
diff --git a/src/d8-debug.h b/src/d8-debug.h
index a6cea2a81bdb7a007fcac73ef16ffcb8084ff4eb..2386b6bd6c4690a9f8c37d7f1ac08977a6ef0db0 100644
--- a/src/d8-debug.h
+++ b/src/d8-debug.h
@@ -36,10 +36,7 @@
 namespace v8 {


-void HandleDebugEvent(DebugEvent event,
-                      Handle<Object> exec_state,
-                      Handle<Object> event_data,
-                      Handle<Value> data);
+void HandleDebugEvent(const Debug::EventDetails& event_details);

// Start the remove debugger connecting to a V8 debugger agent on the specified
 // port.
Index: src/d8.cc
diff --git a/src/d8.cc b/src/d8.cc
index 3ac8db09625b76b67dcaefc59b0901c91c815911..e576e9cb3708e1c096ec52a5ecbdffb7b9bae436 100644
--- a/src/d8.cc
+++ b/src/d8.cc
@@ -810,7 +810,7 @@ void Shell::InstallUtilityScript(Isolate* isolate) {
 #ifdef ENABLE_DEBUGGER_SUPPORT
   // Start the in-process debugger if requested.
   if (i::FLAG_debugger && !i::FLAG_debugger_agent) {
-    v8::Debug::SetDebugEventListener(HandleDebugEvent);
+    v8::Debug::SetDebugEventListener2(HandleDebugEvent);
   }
 #endif  // ENABLE_DEBUGGER_SUPPORT
 }
Index: test/cctest/test-debug.cc
diff --git a/test/cctest/test-debug.cc b/test/cctest/test-debug.cc
index 0f31c14ad6d0767d165bd2c45fb456b66a4c0592..484eb8e3fb1aabef97521f31bbb3dc113e3fd0ac 100644
--- a/test/cctest/test-debug.cc
+++ b/test/cctest/test-debug.cc
@@ -29,6 +29,7 @@

 #include <stdlib.h>

+#define V8_DISABLE_DEPRECATIONS 1
 #include "v8.h"

 #include "api.h"
@@ -39,6 +40,7 @@
 #include "platform.h"
 #include "stub-cache.h"
 #include "utils.h"
+#undef V8_DISABLE_DEPRECATIONS


 using ::v8::internal::EmbeddedVector;


--
--
v8-dev mailing list
v8-dev@googlegroups.com
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to