Deprecate some debugger methods

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

BUG=None
R=loislo@chromium.org, yangguo@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@15708 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
yurys@chromium.org 2013-07-17 09:20:16 +00:00
parent b75063bea8
commit 16bb1dc210
5 changed files with 14 additions and 13 deletions

View File

@ -245,8 +245,9 @@ class EXPORT Debug {
typedef void (*DebugMessageDispatchHandler)(); typedef void (*DebugMessageDispatchHandler)();
// Set a C debug event listener. // Set a C debug event listener.
static bool SetDebugEventListener(EventCallback that, V8_DEPRECATED(static bool SetDebugEventListener(
Handle<Value> data = Handle<Value>()); EventCallback that,
Handle<Value> data = Handle<Value>()));
static bool SetDebugEventListener2(EventCallback2 that, static bool SetDebugEventListener2(EventCallback2 that,
Handle<Value> data = Handle<Value>()); Handle<Value> data = Handle<Value>());
@ -274,8 +275,9 @@ class EXPORT Debug {
// Message based interface. The message protocol is JSON. NOTE the message // Message based interface. The message protocol is JSON. NOTE the message
// handler thread is not supported any more parameter must be false. // handler thread is not supported any more parameter must be false.
static void SetMessageHandler(MessageHandler handler, V8_DEPRECATED(static void SetMessageHandler(
bool message_handler_thread = false); MessageHandler handler,
bool message_handler_thread = false));
static void SetMessageHandler2(MessageHandler2 handler); static void SetMessageHandler2(MessageHandler2 handler);
// If no isolate is provided the default isolate is // If no isolate is provided the default isolate is

View File

@ -50,14 +50,12 @@ void PrintPrompt() {
} }
void HandleDebugEvent(DebugEvent event, void HandleDebugEvent(const Debug::EventDetails& event_details) {
Handle<Object> exec_state,
Handle<Object> event_data,
Handle<Value> data) {
// TODO(svenpanne) There should be a way to retrieve this in the callback. // TODO(svenpanne) There should be a way to retrieve this in the callback.
Isolate* isolate = Isolate::GetCurrent(); Isolate* isolate = Isolate::GetCurrent();
HandleScope scope(isolate); HandleScope scope(isolate);
DebugEvent event = event_details.GetEvent();
// Check for handled event. // Check for handled event.
if (event != Break && event != Exception && event != AfterCompile) { if (event != Break && event != Exception && event != AfterCompile) {
return; return;
@ -67,6 +65,7 @@ void HandleDebugEvent(DebugEvent event,
// Get the toJSONProtocol function on the event and get the JSON format. // Get the toJSONProtocol function on the event and get the JSON format.
Local<String> to_json_fun_name = String::New("toJSONProtocol"); Local<String> to_json_fun_name = String::New("toJSONProtocol");
Handle<Object> event_data = event_details.GetEventData();
Local<Function> to_json_fun = Local<Function> to_json_fun =
Local<Function>::Cast(event_data->Get(to_json_fun_name)); Local<Function>::Cast(event_data->Get(to_json_fun_name));
Local<Value> event_json = to_json_fun->Call(event_data, 0, NULL); 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. // Get the debug command processor.
Local<String> fun_name = String::New("debugCommandProcessor"); 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<Function> fun = Local<Function>::Cast(exec_state->Get(fun_name));
Local<Object> cmd_processor = Local<Object> cmd_processor =
Local<Object>::Cast(fun->Call(exec_state, 0, NULL)); Local<Object>::Cast(fun->Call(exec_state, 0, NULL));

View File

@ -36,10 +36,7 @@
namespace v8 { namespace v8 {
void HandleDebugEvent(DebugEvent event, void HandleDebugEvent(const Debug::EventDetails& event_details);
Handle<Object> exec_state,
Handle<Object> event_data,
Handle<Value> data);
// Start the remove debugger connecting to a V8 debugger agent on the specified // Start the remove debugger connecting to a V8 debugger agent on the specified
// port. // port.

View File

@ -810,7 +810,7 @@ void Shell::InstallUtilityScript(Isolate* isolate) {
#ifdef ENABLE_DEBUGGER_SUPPORT #ifdef ENABLE_DEBUGGER_SUPPORT
// 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::SetDebugEventListener(HandleDebugEvent); v8::Debug::SetDebugEventListener2(HandleDebugEvent);
} }
#endif // ENABLE_DEBUGGER_SUPPORT #endif // ENABLE_DEBUGGER_SUPPORT
} }

View File

@ -29,6 +29,7 @@
#include <stdlib.h> #include <stdlib.h>
#define V8_DISABLE_DEPRECATIONS 1
#include "v8.h" #include "v8.h"
#include "api.h" #include "api.h"
@ -39,6 +40,7 @@
#include "platform.h" #include "platform.h"
#include "stub-cache.h" #include "stub-cache.h"
#include "utils.h" #include "utils.h"
#undef V8_DISABLE_DEPRECATIONS
using ::v8::internal::EmbeddedVector; using ::v8::internal::EmbeddedVector;