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 RenderFrameHostDelegate; | 24 class RenderFrameHostDelegate; |
24 class RenderProcessHost; | 25 class RenderProcessHost; |
25 class RenderViewHostImpl; | 26 class RenderViewHostImpl; |
26 | 27 |
27 class CONTENT_EXPORT RenderFrameHostImpl : public RenderFrameHost { | 28 class CONTENT_EXPORT RenderFrameHostImpl : public RenderFrameHost { |
28 public: | 29 public: |
29 static RenderFrameHostImpl* FromID(int process_id, int routing_id); | 30 static RenderFrameHostImpl* FromID(int process_id, int routing_id); |
30 | 31 |
31 virtual ~RenderFrameHostImpl(); | 32 virtual ~RenderFrameHostImpl(); |
(...skipping 11 matching lines...) Expand all Loading... | |
43 RenderProcessHost* GetProcess() const; | 44 RenderProcessHost* GetProcess() const; |
44 int routing_id() const { return routing_id_; } | 45 int routing_id() const { return routing_id_; } |
45 void OnCreateChildFrame(int new_frame_routing_id, | 46 void OnCreateChildFrame(int new_frame_routing_id, |
46 int64 parent_frame_id, | 47 int64 parent_frame_id, |
47 int64 frame_id, | 48 int64 frame_id, |
48 const std::string& frame_name); | 49 const std::string& frame_name); |
49 | 50 |
50 RenderViewHostImpl* render_view_host() { return render_view_host_; } | 51 RenderViewHostImpl* render_view_host() { return render_view_host_; } |
51 RenderFrameHostDelegate* delegate() { return delegate_; } | 52 RenderFrameHostDelegate* delegate() { return delegate_; } |
52 | 53 |
54 void SetCrossProcessFrameConnector(CrossProcessFrameConnector*); | |
Charlie Reis
2013/12/12 02:42:05
style: Please name parameters in .h files.
kenrb
2013/12/13 18:41:17
Done.
| |
55 | |
53 protected: | 56 protected: |
54 friend class RenderFrameHostFactory; | 57 friend class RenderFrameHostFactory; |
55 | 58 |
56 // TODO(nasko): Remove dependency on RenderViewHost here. RenderProcessHost | 59 // TODO(nasko): Remove dependency on RenderViewHost here. RenderProcessHost |
57 // should be the abstraction needed here, but we need RenderViewHost to pass | 60 // should be the abstraction needed here, but we need RenderViewHost to pass |
58 // into WebContentsObserver::FrameDetached for now. | 61 // into WebContentsObserver::FrameDetached for now. |
59 RenderFrameHostImpl(RenderViewHostImpl* render_view_host, | 62 RenderFrameHostImpl(RenderViewHostImpl* render_view_host, |
60 RenderFrameHostDelegate* delegate, | 63 RenderFrameHostDelegate* delegate, |
61 FrameTree* frame_tree, | 64 FrameTree* frame_tree, |
62 int routing_id, | 65 int routing_id, |
63 bool is_swapped_out); | 66 bool is_swapped_out); |
64 | 67 |
65 private: | 68 private: |
66 // IPC Message handlers. | 69 // IPC Message handlers. |
67 void OnDetach(int64 parent_frame_id, int64 frame_id); | 70 void OnDetach(int64 parent_frame_id, int64 frame_id); |
68 void OnDidStartProvisionalLoadForFrame(int64 frame_id, | 71 void OnDidStartProvisionalLoadForFrame(int64 frame_id, |
69 int64 parent_frame_id, | 72 int64 parent_frame_id, |
70 bool main_frame, | 73 bool main_frame, |
71 const GURL& url); | 74 const GURL& url); |
72 | 75 |
73 bool is_swapped_out() { return is_swapped_out_; } | 76 bool is_swapped_out() { return is_swapped_out_; } |
74 | 77 |
75 // TODO(nasko): This should be removed and replaced by RenderProcessHost. | 78 // TODO(nasko): This should be removed and replaced by RenderProcessHost. |
76 RenderViewHostImpl* render_view_host_; // Not owned. | 79 RenderViewHostImpl* render_view_host_; // Not owned. |
77 | 80 |
78 RenderFrameHostDelegate* delegate_; | 81 RenderFrameHostDelegate* delegate_; |
79 | 82 |
83 // Object that handles messages destined to a child frame in another | |
84 // process from its parent. | |
85 // This will move to RenderFrameProxyHost when that class is created. | |
Charlie Reis
2013/12/12 02:42:05
Does that mean it's only used (i.e., non-NULL) whe
kenrb
2013/12/13 18:41:17
Yes, although it will also be NULL on swapped out
| |
86 CrossProcessFrameConnector* cross_process_frame_connector_; | |
87 | |
80 // Reference to the whole frame tree that this RenderFrameHost belongs too. | 88 // Reference to the whole frame tree that this RenderFrameHost belongs too. |
81 // Allows this RenderFrameHost to add and remove nodes in response to | 89 // Allows this RenderFrameHost to add and remove nodes in response to |
82 // messages from the renderer requesting DOM manipulation. | 90 // messages from the renderer requesting DOM manipulation. |
83 FrameTree* frame_tree_; | 91 FrameTree* frame_tree_; |
84 int routing_id_; | 92 int routing_id_; |
85 bool is_swapped_out_; | 93 bool is_swapped_out_; |
86 | 94 |
87 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostImpl); | 95 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostImpl); |
88 }; | 96 }; |
89 | 97 |
90 } // namespace content | 98 } // namespace content |
91 | 99 |
92 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_ | 100 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_ |
OLD | NEW |