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

Unified Diff: chrome/renderer/extensions/bindings_utils.cc

Issue 200116: Fix bug where content scripts can get GC'd if they don't attach (Closed)
Patch Set: remove extra braces Created 11 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
Index: chrome/renderer/extensions/bindings_utils.cc
diff --git a/chrome/renderer/extensions/bindings_utils.cc b/chrome/renderer/extensions/bindings_utils.cc
index d96f8d771b5b9aee01480f8bc25b9cf76775f766..ddccf2c115e07aa0c1ee5565420a9c9cb584fa97 100644
--- a/chrome/renderer/extensions/bindings_utils.cc
+++ b/chrome/renderer/extensions/bindings_utils.cc
@@ -71,6 +71,15 @@ ContextList GetContextsForExtension(const std::string& extension_id) {
return contexts;
}
+ContextInfo* GetInfoForCurrentContext() {
+ v8::Local<v8::Context> context = v8::Context::GetCurrent();
+ ContextList::iterator context_iter = FindContext(context);
+ if (context_iter == GetContexts().end())
+ return NULL;
+ else
+ return context_iter->get();
+}
+
ContextList::iterator FindContext(v8::Handle<v8::Context> context) {
ContextList& all_contexts = GetContexts();

Powered by Google App Engine
This is Rietveld 408576698