OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/renderer/web_ui_mojo.h" | 5 #include "content/renderer/web_ui_mojo.h" |
6 | 6 |
7 #include "content/common/view_messages.h" | 7 #include "content/common/view_messages.h" |
8 #include "content/public/renderer/render_frame.h" | 8 #include "content/public/renderer/render_frame.h" |
9 #include "content/public/renderer/render_view.h" | 9 #include "content/public/renderer/render_view.h" |
10 #include "content/renderer/web_ui_mojo_context_state.h" | 10 #include "content/renderer/web_ui_mojo_context_state.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 void WebUIMojo::MainFrameObserver::WillReleaseScriptContext( | 38 void WebUIMojo::MainFrameObserver::WillReleaseScriptContext( |
39 v8::Local<v8::Context> context, | 39 v8::Local<v8::Context> context, |
40 int world_id) { | 40 int world_id) { |
41 web_ui_mojo_->DestroyContextState(context); | 41 web_ui_mojo_->DestroyContextState(context); |
42 } | 42 } |
43 | 43 |
44 void WebUIMojo::MainFrameObserver::DidFinishDocumentLoad() { | 44 void WebUIMojo::MainFrameObserver::DidFinishDocumentLoad() { |
45 web_ui_mojo_->OnDidFinishDocumentLoad(); | 45 web_ui_mojo_->OnDidFinishDocumentLoad(); |
46 } | 46 } |
47 | 47 |
| 48 void WebUIMojo::MainFrameObserver::OnDestruct() { |
| 49 } |
| 50 |
48 WebUIMojo::WebUIMojo(RenderView* render_view) | 51 WebUIMojo::WebUIMojo(RenderView* render_view) |
49 : RenderViewObserver(render_view), | 52 : RenderViewObserver(render_view), |
50 RenderViewObserverTracker<WebUIMojo>(render_view), | 53 RenderViewObserverTracker<WebUIMojo>(render_view), |
51 main_frame_observer_(this) { | 54 main_frame_observer_(this) { |
52 } | 55 } |
53 | 56 |
54 WebUIMojo::~WebUIMojo() { | 57 WebUIMojo::~WebUIMojo() { |
55 } | 58 } |
56 | 59 |
57 void WebUIMojo::CreateContextState() { | 60 void WebUIMojo::CreateContextState() { |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 // be empty and we don't need to destroy it. | 114 // be empty and we don't need to destroy it. |
112 WebUIMojoContextState* state = GetContextState(); | 115 WebUIMojoContextState* state = GetContextState(); |
113 if (state && !state->module_added()) | 116 if (state && !state->module_added()) |
114 return; | 117 return; |
115 | 118 |
116 v8::HandleScope handle_scope(blink::mainThreadIsolate()); | 119 v8::HandleScope handle_scope(blink::mainThreadIsolate()); |
117 DestroyContextState(frame->mainWorldScriptContext()); | 120 DestroyContextState(frame->mainWorldScriptContext()); |
118 } | 121 } |
119 | 122 |
120 } // namespace content | 123 } // namespace content |
OLD | NEW |