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

Unified Diff: extensions/renderer/extension_helper.cc

Issue 2923053002: Move MainWorldScriptContext accessor/method from WebFrame to WebLocalFrame. (Closed)
Patch Set: Rebasing... Created 3 years, 6 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: extensions/renderer/extension_helper.cc
diff --git a/extensions/renderer/extension_helper.cc b/extensions/renderer/extension_helper.cc
index d90a34d7066fcc1186acd604aed54accda9a574f..eb64c4b6a4eba472956b4f990b379aa62528d16d 100644
--- a/extensions/renderer/extension_helper.cc
+++ b/extensions/renderer/extension_helper.cc
@@ -15,6 +15,7 @@
#include "extensions/renderer/dispatcher.h"
#include "third_party/WebKit/public/platform/WebURLRequest.h"
#include "third_party/WebKit/public/web/WebDocument.h"
+#include "third_party/WebKit/public/web/WebLocalFrame.h"
#include "third_party/WebKit/public/web/WebView.h"
namespace extensions {
@@ -66,9 +67,16 @@ void ExtensionHelper::OnSetFrameName(const std::string& name) {
}
void ExtensionHelper::OnAppWindowClosed() {
+ // ExtensionMsg_AppWindowClosed is always sent to the current, non-swapped-out
+ // RenderView where the main frame is a local frame.
+ DCHECK(render_view()->GetWebView()->MainFrame()->IsWebLocalFrame());
+
v8::HandleScope scope(v8::Isolate::GetCurrent());
- v8::Local<v8::Context> v8_context =
- render_view()->GetWebView()->MainFrame()->MainWorldScriptContext();
+ v8::Local<v8::Context> v8_context = render_view()
+ ->GetWebView()
+ ->MainFrame()
+ ->ToWebLocalFrame()
+ ->MainWorldScriptContext();
ScriptContext* script_context =
dispatcher_->script_context_set().GetByV8Context(v8_context);
if (!script_context)

Powered by Google App Engine
This is Rietveld 408576698