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

Unified Diff: extensions/renderer/script_context_set.h

Issue 2654623007: [Extensions] Handle null ScriptContexts in GetModuleSystem() (Closed)
Patch Set: Created 3 years, 11 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 | « no previous file | extensions/renderer/v8_context_native_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/renderer/script_context_set.h
diff --git a/extensions/renderer/script_context_set.h b/extensions/renderer/script_context_set.h
index 9f47d0ad95dedbec7000e86df79b72eba0e042c8..049d315e9ed10af5116cb3597a34158fc3b3eabe 100644
--- a/extensions/renderer/script_context_set.h
+++ b/extensions/renderer/script_context_set.h
@@ -75,6 +75,12 @@ class ScriptContextSet {
// Returns the ScriptContext corresponding to the V8 context that created the
// given |object|.
+ // Note: The provided |object| may belong to a v8::Context in another frame,
+ // as can happen when a parent frame uses an object of an embedded iframe.
+ // In this case, there may be no associated ScriptContext, since the child
+ // frame can be hosted in another process. Thus, callers of this need to
+ // null-check the result (and should also always check whether or not the
+ // context has access to the other context).
static ScriptContext* GetContextByObject(const v8::Local<v8::Object>& object);
// Synchronously runs |callback| with each ScriptContext that belongs to
« no previous file with comments | « no previous file | extensions/renderer/v8_context_native_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698