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_; } |
58 FrameTreeNode* frame_tree_node() { return frame_tree_node_; } | |
Charlie Reis
2014/01/06 18:13:35
Do we need to expose FrameTreeNode yet? Looks lik
nasko
2014/01/06 18:47:03
Exposing FrameTreeNode seems more logical, since i
Charlie Reis
2014/01/06 19:07:17
That's fair. Let's leave it as is.
| |
57 | 59 |
58 // 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 |
59 // lives in the same process as the parent frame. The | 61 // lives in the same process as the parent frame. The |
60 // |cross_process_frame_connector| allows the non-swapped-out | 62 // |cross_process_frame_connector| allows the non-swapped-out |
61 // RenderFrameHost for a frame to communicate with the parent process | 63 // RenderFrameHost for a frame to communicate with the parent process |
62 // so that it may composite drawing data. | 64 // so that it may composite drawing data. |
63 // | 65 // |
64 // Ownership is not transfered. | 66 // Ownership is not transfered. |
65 void set_cross_process_frame_connector( | 67 void set_cross_process_frame_connector( |
66 CrossProcessFrameConnector* cross_process_frame_connector) { | 68 CrossProcessFrameConnector* cross_process_frame_connector) { |
(...skipping 15 matching lines...) Expand all Loading... | |
82 | 84 |
83 private: | 85 private: |
84 friend class TestRenderViewHost; | 86 friend class TestRenderViewHost; |
85 | 87 |
86 // IPC Message handlers. | 88 // IPC Message handlers. |
87 void OnDetach(int64 parent_frame_id, int64 frame_id); | 89 void OnDetach(int64 parent_frame_id, int64 frame_id); |
88 void OnDidStartProvisionalLoadForFrame(int64 frame_id, | 90 void OnDidStartProvisionalLoadForFrame(int64 frame_id, |
89 int64 parent_frame_id, | 91 int64 parent_frame_id, |
90 bool main_frame, | 92 bool main_frame, |
91 const GURL& url); | 93 const GURL& url); |
94 void OnDidFailProvisionalLoadWithError( | |
95 const FrameHostMsg_DidFailProvisionalLoadWithError_Params& params); | |
92 | 96 |
93 bool is_swapped_out() { return is_swapped_out_; } | 97 bool is_swapped_out() { return is_swapped_out_; } |
94 | 98 |
95 // For now, RenderFrameHosts indirectly keep RenderViewHosts alive via a | 99 // For now, RenderFrameHosts indirectly keep RenderViewHosts alive via a |
96 // refcount that calls Shutdown when it reaches zero. This allows each | 100 // refcount that calls Shutdown when it reaches zero. This allows each |
97 // RenderFrameHostManager to just care about RenderFrameHosts, while ensuring | 101 // RenderFrameHostManager to just care about RenderFrameHosts, while ensuring |
98 // we have a RenderViewHost for each RenderFrameHost. | 102 // we have a RenderViewHost for each RenderFrameHost. |
99 // TODO(creis): RenderViewHost will eventually go away and be replaced with | 103 // TODO(creis): RenderViewHost will eventually go away and be replaced with |
100 // some form of page context. | 104 // some form of page context. |
101 RenderViewHostImpl* render_view_host_; | 105 RenderViewHostImpl* render_view_host_; |
102 | 106 |
103 RenderFrameHostDelegate* delegate_; | 107 RenderFrameHostDelegate* delegate_; |
104 | 108 |
105 // |cross_process_frame_connector_| passes messages from an out-of-process | 109 // |cross_process_frame_connector_| passes messages from an out-of-process |
106 // child frame to the parent process for compositing. | 110 // child frame to the parent process for compositing. |
107 // | 111 // |
108 // This is only non-NULL when this is the swapped out RenderFrameHost in | 112 // This is only non-NULL when this is the swapped out RenderFrameHost in |
109 // the same site instance as this frame's parent. | 113 // the same site instance as this frame's parent. |
110 // | 114 // |
111 // See the class comment above CrossProcessFrameConnector for more | 115 // See the class comment above CrossProcessFrameConnector for more |
112 // information. | 116 // information. |
113 // | 117 // |
114 // This will move to RenderFrameProxyHost when that class is created. | 118 // This will move to RenderFrameProxyHost when that class is created. |
115 CrossProcessFrameConnector* cross_process_frame_connector_; | 119 CrossProcessFrameConnector* cross_process_frame_connector_; |
116 | 120 |
117 // Reference to the whole frame tree that this RenderFrameHost belongs too. | 121 // Reference to the whole frame tree that this RenderFrameHost belongs too. |
Charlie Reis
2014/01/06 18:13:35
nit: too -> to
nasko
2014/01/06 18:47:03
Done.
| |
118 // Allows this RenderFrameHost to add and remove nodes in response to | 122 // Allows this RenderFrameHost to add and remove nodes in response to |
119 // messages from the renderer requesting DOM manipulation. | 123 // messages from the renderer requesting DOM manipulation. |
120 FrameTree* frame_tree_; | 124 FrameTree* frame_tree_; |
121 | 125 |
122 // The FrameTreeNode which this RenderFrameHostImpl is hosted in. | 126 // The FrameTreeNode which this RenderFrameHostImpl is hosted in. |
123 FrameTreeNode* frame_tree_node_; | 127 FrameTreeNode* frame_tree_node_; |
124 | 128 |
125 int routing_id_; | 129 int routing_id_; |
126 bool is_swapped_out_; | 130 bool is_swapped_out_; |
127 | 131 |
128 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostImpl); | 132 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostImpl); |
129 }; | 133 }; |
130 | 134 |
131 } // namespace content | 135 } // namespace content |
132 | 136 |
133 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_ | 137 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_ |
OLD | NEW |