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 struct FrameHostMsg_DidFailProvisionalLoadWithError_Params; |
15 | 16 |
16 namespace base { | 17 namespace base { |
17 class FilePath; | 18 class FilePath; |
18 } | 19 } |
19 | 20 |
20 namespace content { | 21 namespace content { |
21 | 22 |
22 class CrossProcessFrameConnector; | 23 class CrossProcessFrameConnector; |
23 class FrameTree; | 24 class FrameTree; |
24 class FrameTreeNode; | 25 class FrameTreeNode; |
(...skipping 22 matching lines...) Expand all Loading... |
47 | 48 |
48 void Init(); | 49 void Init(); |
49 int routing_id() const { return routing_id_; } | 50 int routing_id() const { return routing_id_; } |
50 void OnCreateChildFrame(int new_frame_routing_id, | 51 void OnCreateChildFrame(int new_frame_routing_id, |
51 int64 parent_frame_id, | 52 int64 parent_frame_id, |
52 int64 frame_id, | 53 int64 frame_id, |
53 const std::string& frame_name); | 54 const std::string& frame_name); |
54 | 55 |
55 RenderViewHostImpl* render_view_host() { return render_view_host_; } | 56 RenderViewHostImpl* render_view_host() { return render_view_host_; } |
56 RenderFrameHostDelegate* delegate() { return delegate_; } | 57 RenderFrameHostDelegate* delegate() { return delegate_; } |
57 | 58 FrameTreeNode* frame_tree_node() { return frame_tree_node_; } |
58 | 59 |
59 // This function is called when this is a swapped out RenderFrameHost that | 60 // This function is called when this is a swapped out RenderFrameHost that |
60 // lives in the same process as the parent frame. The | 61 // lives in the same process as the parent frame. The |
61 // |cross_process_frame_connector| allows the non-swapped-out | 62 // |cross_process_frame_connector| allows the non-swapped-out |
62 // RenderFrameHost for a frame to communicate with the parent process | 63 // RenderFrameHost for a frame to communicate with the parent process |
63 // so that it may composite drawing data. | 64 // so that it may composite drawing data. |
64 // | 65 // |
65 // Ownership is not transfered. | 66 // Ownership is not transfered. |
66 void set_cross_process_frame_connector( | 67 void set_cross_process_frame_connector( |
67 CrossProcessFrameConnector* cross_process_frame_connector) { | 68 CrossProcessFrameConnector* cross_process_frame_connector) { |
(...skipping 24 matching lines...) Expand all Loading... |
92 | 93 |
93 private: | 94 private: |
94 friend class TestRenderViewHost; | 95 friend class TestRenderViewHost; |
95 | 96 |
96 // IPC Message handlers. | 97 // IPC Message handlers. |
97 void OnDetach(int64 parent_frame_id, int64 frame_id); | 98 void OnDetach(int64 parent_frame_id, int64 frame_id); |
98 void OnDidStartProvisionalLoadForFrame(int64 frame_id, | 99 void OnDidStartProvisionalLoadForFrame(int64 frame_id, |
99 int64 parent_frame_id, | 100 int64 parent_frame_id, |
100 bool main_frame, | 101 bool main_frame, |
101 const GURL& url); | 102 const GURL& url); |
| 103 void OnDidFailProvisionalLoadWithError( |
| 104 const FrameHostMsg_DidFailProvisionalLoadWithError_Params& params); |
102 void OnSwapOutACK(); | 105 void OnSwapOutACK(); |
103 | 106 |
104 // For now, RenderFrameHosts indirectly keep RenderViewHosts alive via a | 107 // For now, RenderFrameHosts indirectly keep RenderViewHosts alive via a |
105 // refcount that calls Shutdown when it reaches zero. This allows each | 108 // refcount that calls Shutdown when it reaches zero. This allows each |
106 // RenderFrameHostManager to just care about RenderFrameHosts, while ensuring | 109 // RenderFrameHostManager to just care about RenderFrameHosts, while ensuring |
107 // we have a RenderViewHost for each RenderFrameHost. | 110 // we have a RenderViewHost for each RenderFrameHost. |
108 // TODO(creis): RenderViewHost will eventually go away and be replaced with | 111 // TODO(creis): RenderViewHost will eventually go away and be replaced with |
109 // some form of page context. | 112 // some form of page context. |
110 RenderViewHostImpl* render_view_host_; | 113 RenderViewHostImpl* render_view_host_; |
111 | 114 |
112 RenderFrameHostDelegate* delegate_; | 115 RenderFrameHostDelegate* delegate_; |
113 | 116 |
114 // |cross_process_frame_connector_| passes messages from an out-of-process | 117 // |cross_process_frame_connector_| passes messages from an out-of-process |
115 // child frame to the parent process for compositing. | 118 // child frame to the parent process for compositing. |
116 // | 119 // |
117 // This is only non-NULL when this is the swapped out RenderFrameHost in | 120 // This is only non-NULL when this is the swapped out RenderFrameHost in |
118 // the same site instance as this frame's parent. | 121 // the same site instance as this frame's parent. |
119 // | 122 // |
120 // See the class comment above CrossProcessFrameConnector for more | 123 // See the class comment above CrossProcessFrameConnector for more |
121 // information. | 124 // information. |
122 // | 125 // |
123 // This will move to RenderFrameProxyHost when that class is created. | 126 // This will move to RenderFrameProxyHost when that class is created. |
124 CrossProcessFrameConnector* cross_process_frame_connector_; | 127 CrossProcessFrameConnector* cross_process_frame_connector_; |
125 | 128 |
126 // Reference to the whole frame tree that this RenderFrameHost belongs too. | 129 // Reference to the whole frame tree that this RenderFrameHost belongs to. |
127 // Allows this RenderFrameHost to add and remove nodes in response to | 130 // Allows this RenderFrameHost to add and remove nodes in response to |
128 // messages from the renderer requesting DOM manipulation. | 131 // messages from the renderer requesting DOM manipulation. |
129 FrameTree* frame_tree_; | 132 FrameTree* frame_tree_; |
130 | 133 |
131 // The FrameTreeNode which this RenderFrameHostImpl is hosted in. | 134 // The FrameTreeNode which this RenderFrameHostImpl is hosted in. |
132 FrameTreeNode* frame_tree_node_; | 135 FrameTreeNode* frame_tree_node_; |
133 | 136 |
134 int routing_id_; | 137 int routing_id_; |
135 bool is_swapped_out_; | 138 bool is_swapped_out_; |
136 | 139 |
137 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostImpl); | 140 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostImpl); |
138 }; | 141 }; |
139 | 142 |
140 } // namespace content | 143 } // namespace content |
141 | 144 |
142 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_ | 145 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_ |
OLD | NEW |