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

Side by Side Diff: src/api.cc

Issue 1015643002: Provide method for getting Isolate by v8::Message (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 9 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 | « include/v8.h ('k') | test/cctest/test-api.cc » ('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 2283 matching lines...) Expand 10 before | Expand all | Expand 10 after
2294 bool Message::IsSharedCrossOrigin() const { 2294 bool Message::IsSharedCrossOrigin() const {
2295 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); 2295 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
2296 ENTER_V8(isolate); 2296 ENTER_V8(isolate);
2297 auto self = Utils::OpenHandle(this); 2297 auto self = Utils::OpenHandle(this);
2298 auto script = i::Handle<i::JSValue>::cast( 2298 auto script = i::Handle<i::JSValue>::cast(
2299 i::Handle<i::Object>(self->script(), isolate)); 2299 i::Handle<i::Object>(self->script(), isolate));
2300 return i::Script::cast(script->value())->is_shared_cross_origin(); 2300 return i::Script::cast(script->value())->is_shared_cross_origin();
2301 } 2301 }
2302 2302
2303 2303
2304 v8::Isolate* Message::GetIsolate() const {
2305 return reinterpret_cast<Isolate*>(Utils::OpenHandle(this)->GetIsolate());
2306 }
2307
2308
2304 MaybeLocal<String> Message::GetSourceLine(Local<Context> context) const { 2309 MaybeLocal<String> Message::GetSourceLine(Local<Context> context) const {
2305 PREPARE_FOR_EXECUTION(context, "v8::Message::GetSourceLine()", String); 2310 PREPARE_FOR_EXECUTION(context, "v8::Message::GetSourceLine()", String);
2306 i::Handle<i::Object> result; 2311 i::Handle<i::Object> result;
2307 has_pending_exception = 2312 has_pending_exception =
2308 !CallV8HeapFunction(isolate, "GetSourceLine", Utils::OpenHandle(this)) 2313 !CallV8HeapFunction(isolate, "GetSourceLine", Utils::OpenHandle(this))
2309 .ToHandle(&result); 2314 .ToHandle(&result);
2310 RETURN_ON_FAILED_EXECUTION(String); 2315 RETURN_ON_FAILED_EXECUTION(String);
2311 Local<String> str; 2316 Local<String> str;
2312 if (result->IsString()) { 2317 if (result->IsString()) {
2313 str = Utils::ToLocal(i::Handle<i::String>::cast(result)); 2318 str = Utils::ToLocal(i::Handle<i::String>::cast(result));
(...skipping 5680 matching lines...) Expand 10 before | Expand all | Expand 10 after
7994 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); 7999 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate());
7995 Address callback_address = 8000 Address callback_address =
7996 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 8001 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
7997 VMState<EXTERNAL> state(isolate); 8002 VMState<EXTERNAL> state(isolate);
7998 ExternalCallbackScope call_scope(isolate, callback_address); 8003 ExternalCallbackScope call_scope(isolate, callback_address);
7999 callback(info); 8004 callback(info);
8000 } 8005 }
8001 8006
8002 8007
8003 } } // namespace v8::internal 8008 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « include/v8.h ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698