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 COMPONENTS_GUEST_VIEW_RENDERER_GUEST_VIEW_CONTAINER_H_ | 5 #ifndef COMPONENTS_GUEST_VIEW_RENDERER_GUEST_VIEW_CONTAINER_H_ |
6 #define COMPONENTS_GUEST_VIEW_RENDERER_GUEST_VIEW_CONTAINER_H_ | 6 #define COMPONENTS_GUEST_VIEW_RENDERER_GUEST_VIEW_CONTAINER_H_ |
7 | 7 |
8 #include "base/memory/linked_ptr.h" | 8 #include "base/memory/linked_ptr.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "content/public/renderer/browser_plugin_delegate.h" | 10 #include "content/public/renderer/browser_plugin_delegate.h" |
(...skipping 25 matching lines...) Expand all Loading... | |
36 // Called when the embedding RenderFrame is destroyed. | 36 // Called when the embedding RenderFrame is destroyed. |
37 virtual void OnRenderFrameDestroyed() {} | 37 virtual void OnRenderFrameDestroyed() {} |
38 | 38 |
39 // Called to respond to IPCs from the browser process that have not been | 39 // Called to respond to IPCs from the browser process that have not been |
40 // handled by GuestViewContainer. | 40 // handled by GuestViewContainer. |
41 virtual bool OnMessage(const IPC::Message& message); | 41 virtual bool OnMessage(const IPC::Message& message); |
42 | 42 |
43 // Called to perform actions when a GuestViewContainer gets a geometry. | 43 // Called to perform actions when a GuestViewContainer gets a geometry. |
44 virtual void OnReady() {} | 44 virtual void OnReady() {} |
45 | 45 |
46 // Called to perform actions when a GuestViewContainer is about to be | |
47 // destroyed. | |
48 virtual void OnDestroy() {} | |
49 | |
46 private: | 50 private: |
47 class RenderFrameLifetimeObserver; | 51 class RenderFrameLifetimeObserver; |
48 friend class RenderFrameLifetimeObserver; | 52 friend class RenderFrameLifetimeObserver; |
49 | 53 |
50 void RenderFrameDestroyed(); | 54 void RenderFrameDestroyed(); |
51 | 55 |
52 void EnqueueRequest(linked_ptr<GuestViewRequest> request); | 56 void EnqueueRequest(linked_ptr<GuestViewRequest> request); |
53 void PerformPendingRequest(); | 57 void PerformPendingRequest(); |
54 void HandlePendingResponseCallback(const IPC::Message& message); | 58 void HandlePendingResponseCallback(const IPC::Message& message); |
55 | 59 |
56 void OnHandleCallback(const IPC::Message& message); | 60 void OnHandleCallback(const IPC::Message& message); |
57 | 61 |
58 // BrowserPluginDelegate implementation. | 62 // BrowserPluginDelegate implementation. |
59 void Ready() final; | 63 void Ready() final; |
60 void SetElementInstanceID(int element_instance_id) final; | 64 void SetElementInstanceID(int element_instance_id) final; |
65 void WillDestroy() final; | |
lazyboy
2015/06/05 16:56:55
The chosen name here is ambiguous, the name should
| |
61 | 66 |
62 int element_instance_id_; | 67 int element_instance_id_; |
63 content::RenderFrame* render_frame_; | 68 content::RenderFrame* render_frame_; |
64 scoped_ptr<RenderFrameLifetimeObserver> render_frame_lifetime_observer_; | 69 scoped_ptr<RenderFrameLifetimeObserver> render_frame_lifetime_observer_; |
65 | 70 |
66 bool ready_; | 71 bool ready_; |
67 | 72 |
68 std::deque<linked_ptr<GuestViewRequest> > pending_requests_; | 73 std::deque<linked_ptr<GuestViewRequest> > pending_requests_; |
69 linked_ptr<GuestViewRequest> pending_response_; | 74 linked_ptr<GuestViewRequest> pending_response_; |
70 | 75 |
71 DISALLOW_COPY_AND_ASSIGN(GuestViewContainer); | 76 DISALLOW_COPY_AND_ASSIGN(GuestViewContainer); |
72 }; | 77 }; |
73 | 78 |
74 } // namespace guest_view | 79 } // namespace guest_view |
75 | 80 |
76 #endif // COMPONENTS_GUEST_VIEW_RENDERER_GUEST_VIEW_CONTAINER_H_ | 81 #endif // COMPONENTS_GUEST_VIEW_RENDERER_GUEST_VIEW_CONTAINER_H_ |
OLD | NEW |