| 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 #ifndef CONTENT_RENDERER_WEB_UI_MOJO_H_ | 5 #ifndef CONTENT_RENDERER_WEB_UI_MOJO_H_ |
| 6 #define CONTENT_RENDERER_WEB_UI_MOJO_H_ | 6 #define CONTENT_RENDERER_WEB_UI_MOJO_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "content/public/renderer/render_frame_observer.h" | 10 #include "content/public/renderer/render_frame_observer.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 private: | 33 private: |
| 34 class MainFrameObserver : public RenderFrameObserver { | 34 class MainFrameObserver : public RenderFrameObserver { |
| 35 public: | 35 public: |
| 36 explicit MainFrameObserver(WebUIMojo* web_ui_mojo); | 36 explicit MainFrameObserver(WebUIMojo* web_ui_mojo); |
| 37 ~MainFrameObserver() override; | 37 ~MainFrameObserver() override; |
| 38 | 38 |
| 39 // RenderFrameObserver overrides: | 39 // RenderFrameObserver overrides: |
| 40 void WillReleaseScriptContext(v8::Local<v8::Context> context, | 40 void WillReleaseScriptContext(v8::Local<v8::Context> context, |
| 41 int world_id) override; | 41 int world_id) override; |
| 42 void DidFinishDocumentLoad() override; | 42 void DidFinishDocumentLoad() override; |
| 43 // MainFrameObserver is inline owned by WebUIMojo and should not be |
| 44 // destroyed when the main RenderFrame is deleted. Overriding the |
| 45 // OnDestruct method allows this object to remain alive and be cleaned |
| 46 // up as part of WebUIMojo deletion. |
| 47 void OnDestruct() override; |
| 43 | 48 |
| 44 private: | 49 private: |
| 45 WebUIMojo* web_ui_mojo_; | 50 WebUIMojo* web_ui_mojo_; |
| 46 | 51 |
| 47 DISALLOW_COPY_AND_ASSIGN(MainFrameObserver); | 52 DISALLOW_COPY_AND_ASSIGN(MainFrameObserver); |
| 48 }; | 53 }; |
| 49 | 54 |
| 50 ~WebUIMojo() override; | 55 ~WebUIMojo() override; |
| 51 | 56 |
| 52 void CreateContextState(); | 57 void CreateContextState(); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 63 void DidClearWindowObject(blink::WebLocalFrame* frame) override; | 68 void DidClearWindowObject(blink::WebLocalFrame* frame) override; |
| 64 | 69 |
| 65 MainFrameObserver main_frame_observer_; | 70 MainFrameObserver main_frame_observer_; |
| 66 | 71 |
| 67 DISALLOW_COPY_AND_ASSIGN(WebUIMojo); | 72 DISALLOW_COPY_AND_ASSIGN(WebUIMojo); |
| 68 }; | 73 }; |
| 69 | 74 |
| 70 } // namespace content | 75 } // namespace content |
| 71 | 76 |
| 72 #endif // CONTENT_RENDERER_WEB_UI_MOJO_H_ | 77 #endif // CONTENT_RENDERER_WEB_UI_MOJO_H_ |
| OLD | NEW |