Commit 1630477a authored by raymes's avatar raymes Committed by Commit bot

Always use the caller's context in PepperTryCatchV8

This removes the DCHECK from PepperTryCatch which checks that the current
context is equal to the plugin context. This assumption is not always true.
In particular, if we call into the plugin directly from another frame (which
is in the same origin) the current context will differ. The same is true for background scripts. This should be ok; we should always use the calling context so as to not leak v8 objects across contexts.

BUG=412062

Review URL: https://codereview.chromium.org/555583003

Cr-Commit-Position: refs/heads/master@{#294291}
parent 7689f9b0
......@@ -70,8 +70,11 @@ PepperTryCatchV8::PepperTryCatchV8(
// Typically when using PepperTryCatchV8 we are passed an isolate. We verify
// that this isolate is the same as the plugin isolate.
DCHECK(isolate == instance_->GetIsolate());
// We assume we are already in the plugin context for PepperTryCatchV8.
DCHECK(GetContext() == isolate->GetCurrentContext());
// We assume that a handle scope and context has been setup by the user of
// this class. This is typically true because this class is used when calling
// into the plugin from JavaScript. We want to use whatever v8 context the
// caller is in.
}
PepperTryCatchV8::~PepperTryCatchV8() {
......
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