Override WillReleaseScriptContext

This commit is contained in:
Cheng Zhao 2016-02-02 23:38:49 +08:00
parent 808b02edda
commit 4b67ff9534
2 changed files with 11 additions and 1 deletions

View file

@ -52,11 +52,16 @@ class AtomRenderFrameObserver : public content::RenderFrameObserver {
// content::RenderFrameObserver:
void DidCreateScriptContext(v8::Handle<v8::Context> context,
int extension_group,
int world_id) {
int world_id) override {
renderer_client_->DidCreateScriptContext(
render_frame()->GetWebFrame(), context);
}
void WillReleaseScriptContext(v8::Local<v8::Context> 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<v8::Context> context) {
}
bool AtomRendererClient::ShouldFork(blink::WebLocalFrame* frame,
const GURL& url,
const std::string& http_method,

View file

@ -24,6 +24,7 @@ class AtomRendererClient : public content::ContentRendererClient,
void DidCreateScriptContext(blink::WebFrame* frame,
v8::Handle<v8::Context> context);
void WillReleaseScriptContext(v8::Handle<v8::Context> context);
private:
enum NodeIntegration {