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

Unified Diff: content/renderer/pepper/pepper_try_catch.cc

Issue 562763005: Hold a handle to the v8 context in PepperTryCatchVar. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 | « content/renderer/pepper/pepper_try_catch.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/pepper/pepper_try_catch.cc
diff --git a/content/renderer/pepper/pepper_try_catch.cc b/content/renderer/pepper/pepper_try_catch.cc
index 82be7360f5e03239801678aa467b91096a6245b4..2ee6ecf88b8e8805138757a35b860ca2b38d40df 100644
--- a/content/renderer/pepper/pepper_try_catch.cc
+++ b/content/renderer/pepper/pepper_try_catch.cc
@@ -119,18 +119,17 @@ PepperTryCatchVar::PepperTryCatchVar(PepperPluginInstanceImpl* instance,
PP_Var* exception)
: PepperTryCatch(instance, V8VarConverter::kAllowObjectVars),
handle_scope_(instance_->GetIsolate()),
+ context_(GetContext()),
exception_(exception),
exception_is_set_(false) {
- // We switch to the plugin context.
- v8::Handle<v8::Context> context = GetContext();
- if (!context.IsEmpty())
- context->Enter();
+ // We switch to the plugin context if it's not empty.
+ if (!context_.IsEmpty())
+ context_->Enter();
}
PepperTryCatchVar::~PepperTryCatchVar() {
- v8::Handle<v8::Context> context = GetContext();
- if (!context.IsEmpty())
- context->Exit();
+ if (!context_.IsEmpty())
+ context_->Exit();
}
bool PepperTryCatchVar::HasException() {
« no previous file with comments | « content/renderer/pepper/pepper_try_catch.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698