Commit 5c13e30a authored by Ryan Tseng's avatar Ryan Tseng Committed by Commit Bot

fix blink::ToIsolate after r611992

https://chromium-review.googlesource.com/c/chromium/src/+/1252625
was supposed to do a DCHECK to ensure the semantics of ToIsolate()
remained unchanged, but the check was incorrect.  This fixes the semantics.

The next step is to remove ToIsolate(ExecutionContext).

Bug: 889542
Change-Id: Ic0a84fa74cafef47e43858f4dae4880b2f7757ec
Reviewed-on: https://chromium-review.googlesource.com/c/1355190Reviewed-by: default avatarJeremy Roman <jbroman@chromium.org>
Commit-Queue: Ryan Tseng <hinoka@chromium.org>
Cr-Commit-Position: refs/heads/master@{#612341}
parent 5e524474
...@@ -876,11 +876,15 @@ v8::Isolate* ToIsolate(const ExecutionContext* context) { ...@@ -876,11 +876,15 @@ v8::Isolate* ToIsolate(const ExecutionContext* context) {
if (!context) if (!context)
return nullptr; return nullptr;
#if DCHECK_IS_ON()
v8::Isolate* isolate; v8::Isolate* isolate;
if (context && context->IsDocument()) if (context && context->IsDocument())
isolate = V8PerIsolateData::MainThreadIsolate(); isolate = V8PerIsolateData::MainThreadIsolate();
isolate = v8::Isolate::GetCurrent(); else
isolate = v8::Isolate::GetCurrent();
DCHECK(context->GetIsolate() == isolate); DCHECK(context->GetIsolate() == isolate);
#endif
return context->GetIsolate(); return context->GetIsolate();
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment