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

Side by Side Diff: src/api.cc

Issue 2785293002: [inspector] move console to builtins (Closed)
Patch Set: use console helper Created 3 years, 8 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 9562 matching lines...) Expand 10 before | Expand all | Expand 10 after
9573 break; 9573 break;
9574 } 9574 }
9575 i::Handle<i::Code> call_code(isolate->builtins()->builtin(name)); 9575 i::Handle<i::Code> call_code(isolate->builtins()->builtin(name));
9576 i::Handle<i::JSFunction> fun = 9576 i::Handle<i::JSFunction> fun =
9577 isolate->factory()->NewFunctionWithoutPrototype( 9577 isolate->factory()->NewFunctionWithoutPrototype(
9578 isolate->factory()->empty_string(), call_code, false); 9578 isolate->factory()->empty_string(), call_code, false);
9579 fun->shared()->DontAdaptArguments(); 9579 fun->shared()->DontAdaptArguments();
9580 return Utils::ToLocal(handle_scope.CloseAndEscape(fun)); 9580 return Utils::ToLocal(handle_scope.CloseAndEscape(fun));
9581 } 9581 }
9582 9582
9583 void debug::SetConsoleDelegate(Isolate* v8_isolate, ConsoleDelegate* delegate) {
9584 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(v8_isolate);
9585 ENTER_V8(isolate);
9586 isolate->set_console_delegate(delegate);
9587 }
9588
9583 MaybeLocal<debug::Script> debug::GeneratorObject::Script() { 9589 MaybeLocal<debug::Script> debug::GeneratorObject::Script() {
9584 i::Handle<i::JSGeneratorObject> obj = Utils::OpenHandle(this); 9590 i::Handle<i::JSGeneratorObject> obj = Utils::OpenHandle(this);
9585 i::Object* maybe_script = obj->function()->shared()->script(); 9591 i::Object* maybe_script = obj->function()->shared()->script();
9586 if (!maybe_script->IsScript()) return MaybeLocal<debug::Script>(); 9592 if (!maybe_script->IsScript()) return MaybeLocal<debug::Script>();
9587 i::Handle<i::Script> script(i::Script::cast(maybe_script), obj->GetIsolate()); 9593 i::Handle<i::Script> script(i::Script::cast(maybe_script), obj->GetIsolate());
9588 return ToApiHandle<debug::Script>(script); 9594 return ToApiHandle<debug::Script>(script);
9589 } 9595 }
9590 9596
9591 Local<Function> debug::GeneratorObject::Function() { 9597 Local<Function> debug::GeneratorObject::Function() {
9592 i::Handle<i::JSGeneratorObject> obj = Utils::OpenHandle(this); 9598 i::Handle<i::JSGeneratorObject> obj = Utils::OpenHandle(this);
(...skipping 747 matching lines...) Expand 10 before | Expand all | Expand 10 after
10340 Address callback_address = 10346 Address callback_address =
10341 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 10347 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
10342 VMState<EXTERNAL> state(isolate); 10348 VMState<EXTERNAL> state(isolate);
10343 ExternalCallbackScope call_scope(isolate, callback_address); 10349 ExternalCallbackScope call_scope(isolate, callback_address);
10344 callback(info); 10350 callback(info);
10345 } 10351 }
10346 10352
10347 10353
10348 } // namespace internal 10354 } // namespace internal
10349 } // namespace v8 10355 } // namespace v8
OLDNEW
« no previous file with comments | « include/v8.h ('k') | src/bootstrapper.cc » ('j') | src/builtins/builtins-console.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698