From 4b67ff9534663df5936661ffddae649c142e5d6a Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Tue, 2 Feb 2016 23:38:49 +0800 Subject: [PATCH] Override WillReleaseScriptContext --- atom/renderer/atom_renderer_client.cc | 11 ++++++++++- atom/renderer/atom_renderer_client.h | 1 + 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/atom/renderer/atom_renderer_client.cc b/atom/renderer/atom_renderer_client.cc index 3c97db4..925088e 100644 --- a/atom/renderer/atom_renderer_client.cc +++ b/atom/renderer/atom_renderer_client.cc @@ -52,11 +52,16 @@ class AtomRenderFrameObserver : public content::RenderFrameObserver { // content::RenderFrameObserver: void DidCreateScriptContext(v8::Handle context, int extension_group, - int world_id) { + int world_id) override { renderer_client_->DidCreateScriptContext( render_frame()->GetWebFrame(), context); } + void WillReleaseScriptContext(v8::Local context, + int world_id) override { + renderer_client_->WillReleaseScriptContext(context); + } + private: AtomRendererClient* renderer_client_; @@ -162,6 +167,10 @@ void AtomRendererClient::DidCreateScriptContext( node_bindings_->LoadEnvironment(env); } +void AtomRendererClient::WillReleaseScriptContext( + v8::Handle context) { +} + bool AtomRendererClient::ShouldFork(blink::WebLocalFrame* frame, const GURL& url, const std::string& http_method, diff --git a/atom/renderer/atom_renderer_client.h b/atom/renderer/atom_renderer_client.h index beeeb9d..a8d404e 100644 --- a/atom/renderer/atom_renderer_client.h +++ b/atom/renderer/atom_renderer_client.h @@ -24,6 +24,7 @@ class AtomRendererClient : public content::ContentRendererClient, void DidCreateScriptContext(blink::WebFrame* frame, v8::Handle context); + void WillReleaseScriptContext(v8::Handle context); private: enum NodeIntegration { -- 2.7.4