Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(446)

Side by Side Diff: src/api.cc

Issue 2642253005: [debugger api] remove legacy JSON debug protocol. (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/api.h" 5 #include "src/api.h"
6 6
7 #include <string.h> // For memcpy, strlen. 7 #include <string.h> // For memcpy, strlen.
8 #ifdef V8_USE_ADDRESS_SANITIZER 8 #ifdef V8_USE_ADDRESS_SANITIZER
9 #include <sanitizer/asan_interface.h> 9 #include <sanitizer/asan_interface.h>
10 #endif // V8_USE_ADDRESS_SANITIZER 10 #endif // V8_USE_ADDRESS_SANITIZER
(...skipping 8878 matching lines...) Expand 10 before | Expand all | Expand 10 after
8889 internal_isolate->stack_guard()->ClearDebugBreak(); 8889 internal_isolate->stack_guard()->ClearDebugBreak();
8890 } 8890 }
8891 8891
8892 8892
8893 bool Debug::CheckDebugBreak(Isolate* isolate) { 8893 bool Debug::CheckDebugBreak(Isolate* isolate) {
8894 i::Isolate* internal_isolate = reinterpret_cast<i::Isolate*>(isolate); 8894 i::Isolate* internal_isolate = reinterpret_cast<i::Isolate*>(isolate);
8895 return internal_isolate->stack_guard()->CheckDebugBreak(); 8895 return internal_isolate->stack_guard()->CheckDebugBreak();
8896 } 8896 }
8897 8897
8898 8898
8899 void Debug::SetMessageHandler(Isolate* isolate,
8900 v8::Debug::MessageHandler handler) {
8901 i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate);
8902 ENTER_V8(i_isolate);
8903 i_isolate->debug()->SetMessageHandler(handler);
8904 }
8905
8906
8907 void Debug::SendCommand(Isolate* isolate,
8908 const uint16_t* command,
8909 int length,
8910 ClientData* client_data) {
8911 i::Isolate* internal_isolate = reinterpret_cast<i::Isolate*>(isolate);
8912 internal_isolate->debug()->EnqueueCommandMessage(
8913 i::Vector<const uint16_t>(command, length), client_data);
8914 }
8915
8916
8917 MaybeLocal<Value> Debug::Call(Local<Context> context, 8899 MaybeLocal<Value> Debug::Call(Local<Context> context,
8918 v8::Local<v8::Function> fun, 8900 v8::Local<v8::Function> fun,
8919 v8::Local<v8::Value> data) { 8901 v8::Local<v8::Value> data) {
8920 PREPARE_FOR_EXECUTION(context, Debug, Call, Value); 8902 PREPARE_FOR_EXECUTION(context, Debug, Call, Value);
8921 i::Handle<i::Object> data_obj; 8903 i::Handle<i::Object> data_obj;
8922 if (data.IsEmpty()) { 8904 if (data.IsEmpty()) {
8923 data_obj = isolate->factory()->undefined_value(); 8905 data_obj = isolate->factory()->undefined_value();
8924 } else { 8906 } else {
8925 data_obj = Utils::OpenHandle(*data); 8907 data_obj = Utils::OpenHandle(*data);
8926 } 8908 }
(...skipping 19 matching lines...) Expand all
8946 const int kArgc = 1; 8928 const int kArgc = 1;
8947 v8::Local<v8::Value> argv[kArgc] = {obj}; 8929 v8::Local<v8::Value> argv[kArgc] = {obj};
8948 Local<Value> result; 8930 Local<Value> result;
8949 has_pending_exception = 8931 has_pending_exception =
8950 !v8_fun->Call(context, Utils::ToLocal(debug), kArgc, argv) 8932 !v8_fun->Call(context, Utils::ToLocal(debug), kArgc, argv)
8951 .ToLocal(&result); 8933 .ToLocal(&result);
8952 RETURN_ON_FAILED_EXECUTION(Value); 8934 RETURN_ON_FAILED_EXECUTION(Value);
8953 RETURN_ESCAPED(result); 8935 RETURN_ESCAPED(result);
8954 } 8936 }
8955 8937
8956 void Debug::ProcessDebugMessages(Isolate* isolate) {
8957 reinterpret_cast<i::Isolate*>(isolate)->debug()->ProcessDebugMessages(true);
8958 }
8959
8960 8938
8961 Local<Context> Debug::GetDebugContext(Isolate* isolate) { 8939 Local<Context> Debug::GetDebugContext(Isolate* isolate) {
8962 return debug::GetDebugContext(isolate); 8940 return debug::GetDebugContext(isolate);
8963 } 8941 }
8964 8942
8965 8943
8966 MaybeLocal<Context> Debug::GetDebuggedContext(Isolate* isolate) { 8944 MaybeLocal<Context> Debug::GetDebuggedContext(Isolate* isolate) {
8967 i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate); 8945 i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate);
8968 ENTER_V8(i_isolate); 8946 ENTER_V8(i_isolate);
8969 if (!i_isolate->debug()->in_debug_scope()) return MaybeLocal<Context>(); 8947 if (!i_isolate->debug()->in_debug_scope()) return MaybeLocal<Context>();
(...skipping 1051 matching lines...) Expand 10 before | Expand all | Expand 10 after
10021 Address callback_address = 9999 Address callback_address =
10022 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 10000 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
10023 VMState<EXTERNAL> state(isolate); 10001 VMState<EXTERNAL> state(isolate);
10024 ExternalCallbackScope call_scope(isolate, callback_address); 10002 ExternalCallbackScope call_scope(isolate, callback_address);
10025 callback(info); 10003 callback(info);
10026 } 10004 }
10027 10005
10028 10006
10029 } // namespace internal 10007 } // namespace internal
10030 } // namespace v8 10008 } // namespace v8
OLDNEW
« no previous file with comments | « include/v8-debug.h ('k') | src/debug/debug.h » ('j') | src/debug/debug.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698