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) |