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

Unified Diff: third_party/WebKit/Source/bindings/core/v8/V8Initializer.cpp

Issue 2039333002: Fixes ASan crash for an embedded Blink-in-JS component. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ...now with test expectation. Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/bindings/blink-in-js-asan-crash-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/bindings/core/v8/V8Initializer.cpp
diff --git a/third_party/WebKit/Source/bindings/core/v8/V8Initializer.cpp b/third_party/WebKit/Source/bindings/core/v8/V8Initializer.cpp
index f8bdd8ae7eb31964f83930ff0a23a3687c819c21..1879f9d9d48e4418f904e75c22ab1c0e43df929d 100644
--- a/third_party/WebKit/Source/bindings/core/v8/V8Initializer.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/V8Initializer.cpp
@@ -114,6 +114,9 @@ static void messageHandlerInMainThread(v8::Local<v8::Message> message, v8::Local
ASSERT(isMainThread());
v8::Isolate* isolate = v8::Isolate::GetCurrent();
+ if (isolate->GetEnteredContext().IsEmpty())
+ return;
+
// If called during context initialization, there will be no entered context.
ScriptState* scriptState = ScriptState::current(isolate);
if (!scriptState->contextIsValid())
« no previous file with comments | « third_party/WebKit/LayoutTests/bindings/blink-in-js-asan-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698