Index: extensions/renderer/extension_helper.cc |
diff --git a/extensions/renderer/extension_helper.cc b/extensions/renderer/extension_helper.cc |
index d90a34d7066fcc1186acd604aed54accda9a574f..c58c556ebd8eb60b9bc59e54314ceb5cc110afac 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 { |
@@ -67,8 +68,15 @@ void ExtensionHelper::OnSetFrameName(const std::string& name) { |
void ExtensionHelper::OnAppWindowClosed() { |
v8::HandleScope scope(v8::Isolate::GetCurrent()); |
- v8::Local<v8::Context> v8_context = |
- render_view()->GetWebView()->MainFrame()->MainWorldScriptContext(); |
+ if (!render_view()->GetWebView()->MainFrame()->IsWebLocalFrame()) { |
dcheng
2017/06/06 19:57:17
Is this actually something we need to handle? I do
Łukasz Anforowicz
2017/06/07 20:35:07
Good point - ExtensionMsg_AppWindowClosed is sent
|
+ NOTREACHED(); |
+ return; |
+ } |
+ 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) |