| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_ |
| 6 #define CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_ | 6 #define CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| 11 #include "content/common/content_export.h" | 11 #include "content/common/content_export.h" |
| 12 #include "content/public/browser/render_frame_host.h" | 12 #include "content/public/browser/render_frame_host.h" |
| 13 | 13 |
| 14 class GURL; | 14 class GURL; |
| 15 | 15 |
| 16 namespace base { | 16 namespace base { |
| 17 class FilePath; | 17 class FilePath; |
| 18 } | 18 } |
| 19 | 19 |
| 20 namespace content { | 20 namespace content { |
| 21 | 21 |
| 22 class CrossProcessFrameConnector; |
| 22 class FrameTree; | 23 class FrameTree; |
| 23 class FrameTreeNode; | 24 class FrameTreeNode; |
| 24 class RenderFrameHostDelegate; | 25 class RenderFrameHostDelegate; |
| 25 class RenderProcessHost; | 26 class RenderProcessHost; |
| 26 class RenderViewHostImpl; | 27 class RenderViewHostImpl; |
| 27 | 28 |
| 28 class CONTENT_EXPORT RenderFrameHostImpl : public RenderFrameHost { | 29 class CONTENT_EXPORT RenderFrameHostImpl : public RenderFrameHost { |
| 29 public: | 30 public: |
| 30 static RenderFrameHostImpl* FromID(int process_id, int routing_id); | 31 static RenderFrameHostImpl* FromID(int process_id, int routing_id); |
| 31 | 32 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 47 void Init(); | 48 void Init(); |
| 48 int routing_id() const { return routing_id_; } | 49 int routing_id() const { return routing_id_; } |
| 49 void OnCreateChildFrame(int new_frame_routing_id, | 50 void OnCreateChildFrame(int new_frame_routing_id, |
| 50 int64 parent_frame_id, | 51 int64 parent_frame_id, |
| 51 int64 frame_id, | 52 int64 frame_id, |
| 52 const std::string& frame_name); | 53 const std::string& frame_name); |
| 53 | 54 |
| 54 RenderViewHostImpl* render_view_host() { return render_view_host_; } | 55 RenderViewHostImpl* render_view_host() { return render_view_host_; } |
| 55 RenderFrameHostDelegate* delegate() { return delegate_; } | 56 RenderFrameHostDelegate* delegate() { return delegate_; } |
| 56 | 57 |
| 58 // This function is called when this is a swapped out RenderFrameHost that |
| 59 // lives in the same process as the parent frame. The |
| 60 // |cross_process_frame_connector| allows the non-swapped-out |
| 61 // RenderFrameHost for a frame to communicate with the parent process |
| 62 // so that it may composite drawing data. |
| 63 // |
| 64 // Ownership is not transfered. |
| 65 void set_cross_process_frame_connector( |
| 66 CrossProcessFrameConnector* cross_process_frame_connector) { |
| 67 cross_process_frame_connector_ = cross_process_frame_connector; |
| 68 } |
| 69 |
| 57 protected: | 70 protected: |
| 58 friend class RenderFrameHostFactory; | 71 friend class RenderFrameHostFactory; |
| 59 | 72 |
| 60 // TODO(nasko): Remove dependency on RenderViewHost here. RenderProcessHost | 73 // TODO(nasko): Remove dependency on RenderViewHost here. RenderProcessHost |
| 61 // should be the abstraction needed here, but we need RenderViewHost to pass | 74 // should be the abstraction needed here, but we need RenderViewHost to pass |
| 62 // into WebContentsObserver::FrameDetached for now. | 75 // into WebContentsObserver::FrameDetached for now. |
| 63 RenderFrameHostImpl(RenderViewHostImpl* render_view_host, | 76 RenderFrameHostImpl(RenderViewHostImpl* render_view_host, |
| 64 RenderFrameHostDelegate* delegate, | 77 RenderFrameHostDelegate* delegate, |
| 65 FrameTree* frame_tree, | 78 FrameTree* frame_tree, |
| 66 FrameTreeNode* frame_tree_node, | 79 FrameTreeNode* frame_tree_node, |
| (...skipping 15 matching lines...) Expand all Loading... |
| 82 // For now, RenderFrameHosts indirectly keep RenderViewHosts alive via a | 95 // For now, RenderFrameHosts indirectly keep RenderViewHosts alive via a |
| 83 // refcount that calls Shutdown when it reaches zero. This allows each | 96 // refcount that calls Shutdown when it reaches zero. This allows each |
| 84 // RenderFrameHostManager to just care about RenderFrameHosts, while ensuring | 97 // RenderFrameHostManager to just care about RenderFrameHosts, while ensuring |
| 85 // we have a RenderViewHost for each RenderFrameHost. | 98 // we have a RenderViewHost for each RenderFrameHost. |
| 86 // TODO(creis): RenderViewHost will eventually go away and be replaced with | 99 // TODO(creis): RenderViewHost will eventually go away and be replaced with |
| 87 // some form of page context. | 100 // some form of page context. |
| 88 RenderViewHostImpl* render_view_host_; | 101 RenderViewHostImpl* render_view_host_; |
| 89 | 102 |
| 90 RenderFrameHostDelegate* delegate_; | 103 RenderFrameHostDelegate* delegate_; |
| 91 | 104 |
| 105 // |cross_process_frame_connector_| passes messages from an out-of-process |
| 106 // child frame to the parent process for compositing. |
| 107 // |
| 108 // This is only non-NULL when this is the swapped out RenderFrameHost in |
| 109 // the same site instance as this frame's parent. |
| 110 // |
| 111 // See the class comment above CrossProcessFrameConnector for more |
| 112 // information. |
| 113 // |
| 114 // This will move to RenderFrameProxyHost when that class is created. |
| 115 CrossProcessFrameConnector* cross_process_frame_connector_; |
| 116 |
| 92 // Reference to the whole frame tree that this RenderFrameHost belongs too. | 117 // Reference to the whole frame tree that this RenderFrameHost belongs too. |
| 93 // Allows this RenderFrameHost to add and remove nodes in response to | 118 // Allows this RenderFrameHost to add and remove nodes in response to |
| 94 // messages from the renderer requesting DOM manipulation. | 119 // messages from the renderer requesting DOM manipulation. |
| 95 FrameTree* frame_tree_; | 120 FrameTree* frame_tree_; |
| 96 | 121 |
| 97 // The FrameTreeNode which this RenderFrameHostImpl is hosted in. | 122 // The FrameTreeNode which this RenderFrameHostImpl is hosted in. |
| 98 FrameTreeNode* frame_tree_node_; | 123 FrameTreeNode* frame_tree_node_; |
| 99 | 124 |
| 100 int routing_id_; | 125 int routing_id_; |
| 101 bool is_swapped_out_; | 126 bool is_swapped_out_; |
| 102 | 127 |
| 103 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostImpl); | 128 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostImpl); |
| 104 }; | 129 }; |
| 105 | 130 |
| 106 } // namespace content | 131 } // namespace content |
| 107 | 132 |
| 108 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_ | 133 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_ |
| OLD | NEW |