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

Side by Side Diff: src/api.cc

Issue 2423713003: [inspector] introduce debug-interface.h (Closed)
Patch Set: move impl to api.cc Created 4 years, 2 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
« no previous file with comments | « BUILD.gn ('k') | src/debug/debug.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 8728 matching lines...) Expand 10 before | Expand all | Expand 10 after
8739 Local<Value> value) { 8739 Local<Value> value) {
8740 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(v8_isolate); 8740 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(v8_isolate);
8741 ENTER_V8(isolate); 8741 ENTER_V8(isolate);
8742 i::Handle<i::Object> val = Utils::OpenHandle(*value); 8742 i::Handle<i::Object> val = Utils::OpenHandle(*value);
8743 i::Handle<i::JSArray> result; 8743 i::Handle<i::JSArray> result;
8744 if (!i::Runtime::GetInternalProperties(isolate, val).ToHandle(&result)) 8744 if (!i::Runtime::GetInternalProperties(isolate, val).ToHandle(&result))
8745 return MaybeLocal<Array>(); 8745 return MaybeLocal<Array>();
8746 return Utils::ToLocal(result); 8746 return Utils::ToLocal(result);
8747 } 8747 }
8748 8748
8749 bool DebugInterface::SetDebugEventListener(Isolate* isolate,
8750 DebugInterface::EventCallback that,
8751 Local<Value> data) {
8752 i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate);
8753 ENTER_V8(i_isolate);
8754 i::HandleScope scope(i_isolate);
8755 i::Handle<i::Object> foreign = i_isolate->factory()->undefined_value();
8756 if (that != NULL) {
8757 foreign = i_isolate->factory()->NewForeign(FUNCTION_ADDR(that));
8758 }
8759 i_isolate->debug()->SetEventListener(foreign, Utils::OpenHandle(*data, true));
8760 return true;
8761 }
8762
8763 Local<Context> DebugInterface::GetDebugContext(Isolate* isolate) {
8764 return Debug::GetDebugContext(isolate);
8765 }
8766
8767 MaybeLocal<Value> DebugInterface::Call(Local<Context> context,
8768 v8::Local<v8::Function> fun,
8769 v8::Local<v8::Value> data) {
8770 return Debug::Call(context, fun, data);
8771 }
8772
8773 void DebugInterface::SetLiveEditEnabled(Isolate* isolate, bool enable) {
8774 Debug::SetLiveEditEnabled(isolate, enable);
8775 }
8776
8777 void DebugInterface::DebugBreak(Isolate* isolate) {
8778 Debug::DebugBreak(isolate);
8779 }
8780
8781 void DebugInterface::CancelDebugBreak(Isolate* isolate) {
8782 Debug::CancelDebugBreak(isolate);
8783 }
8784
8785 MaybeLocal<Array> DebugInterface::GetInternalProperties(Isolate* isolate,
8786 Local<Value> value) {
8787 return Debug::GetInternalProperties(isolate, value);
8788 }
8749 8789
8750 Local<String> CpuProfileNode::GetFunctionName() const { 8790 Local<String> CpuProfileNode::GetFunctionName() const {
8751 const i::ProfileNode* node = reinterpret_cast<const i::ProfileNode*>(this); 8791 const i::ProfileNode* node = reinterpret_cast<const i::ProfileNode*>(this);
8752 i::Isolate* isolate = node->isolate(); 8792 i::Isolate* isolate = node->isolate();
8753 const i::CodeEntry* entry = node->entry(); 8793 const i::CodeEntry* entry = node->entry();
8754 i::Handle<i::String> name = 8794 i::Handle<i::String> name =
8755 isolate->factory()->InternalizeUtf8String(entry->name()); 8795 isolate->factory()->InternalizeUtf8String(entry->name());
8756 if (!entry->has_name_prefix()) { 8796 if (!entry->has_name_prefix()) {
8757 return ToApiHandle<String>(name); 8797 return ToApiHandle<String>(name);
8758 } else { 8798 } else {
(...skipping 669 matching lines...) Expand 10 before | Expand all | Expand 10 after
9428 Address callback_address = 9468 Address callback_address =
9429 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 9469 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
9430 VMState<EXTERNAL> state(isolate); 9470 VMState<EXTERNAL> state(isolate);
9431 ExternalCallbackScope call_scope(isolate, callback_address); 9471 ExternalCallbackScope call_scope(isolate, callback_address);
9432 callback(info); 9472 callback(info);
9433 } 9473 }
9434 9474
9435 9475
9436 } // namespace internal 9476 } // namespace internal
9437 } // namespace v8 9477 } // namespace v8
OLDNEW
« no previous file with comments | « BUILD.gn ('k') | src/debug/debug.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698