Skip to content

Commit b19036e

Browse files
committed
Fix: set force close only when dealing with top frames
Fix the previous commit in a better way to simulate the previous solution (but do it from renderer): only try to set the flag on the first time.
1 parent ba4f09f commit b19036e

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/renderer/shell_content_renderer_client.cc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,8 @@ RenderView* GetCurrentRenderView() {
9393

9494
} // namespace
9595

96-
ShellContentRendererClient::ShellContentRendererClient() {
96+
ShellContentRendererClient::ShellContentRendererClient()
97+
:creating_first_context_(true) {
9798
}
9899

99100
ShellContentRendererClient::~ShellContentRendererClient() {
@@ -204,6 +205,7 @@ void ShellContentRendererClient::DidCreateScriptContext(
204205
GURL url(frame->document().url());
205206
VLOG(1) << "DidCreateScriptContext: " << url;
206207
InstallNodeSymbols(frame, context, url);
208+
creating_first_context_ = false;
207209
}
208210

209211
bool ShellContentRendererClient::goodForNode(WebKit::WebFrame* frame)
@@ -354,7 +356,7 @@ void ShellContentRendererClient::InstallNodeSymbols(
354356
int ret;
355357
RenderViewImpl* render_view = RenderViewImpl::FromWebView(frame->view());
356358

357-
if (frame->parent() == NULL) {
359+
if (frame->parent() == NULL && creating_first_context_) {
358360
// do this only for top frames, or initialization of iframe
359361
// could override parent settings here
360362
render_view->Send(new ShellViewHostMsg_SetForceClose(

src/renderer/shell_content_renderer_client.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ class ShellContentRendererClient : public ContentRendererClient {
6060
scoped_ptr<ShellRenderProcessObserver> shell_observer_;
6161
scoped_ptr<nwapi::WindowBindings> window_bindings_;
6262

63+
bool creating_first_context_;
64+
6365
void InstallNodeSymbols(WebKit::WebFrame* frame,
6466
v8::Handle<v8::Context> context, const GURL& url);
6567
void UninstallNodeSymbols(WebKit::WebFrame* frame,

0 commit comments

Comments
 (0)