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_RENDERER_HOST_RENDER_FRAME_HOST_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_FRAME_HOST_IMPL_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_FRAME_HOST_IMPL_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_FRAME_HOST_IMPL_H_ |
7 | 7 |
| 8 #include <string> |
| 9 |
8 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
9 #include "content/public/browser/render_frame_host.h" | 11 #include "content/public/browser/render_frame_host.h" |
10 | 12 |
11 namespace content { | 13 namespace content { |
12 | 14 |
| 15 class FrameTree; |
13 class RenderProcessHost; | 16 class RenderProcessHost; |
14 class RenderViewHostImpl; | |
15 | 17 |
16 class CONTENT_EXPORT RenderFrameHostImpl : public RenderFrameHost { | 18 class CONTENT_EXPORT RenderFrameHostImpl : public RenderFrameHost { |
17 public: | 19 public: |
18 static RenderFrameHostImpl* FromID(int process_id, int routing_id); | 20 static RenderFrameHostImpl* FromID(int process_id, int routing_id); |
19 | 21 |
20 RenderFrameHostImpl(RenderViewHostImpl* render_view_host, | 22 RenderFrameHostImpl(RenderProcessHost* render_process_host, |
| 23 FrameTree* frame_tree, |
21 int routing_id, | 24 int routing_id, |
22 bool is_swapped_out); | 25 bool is_swapped_out); |
23 virtual ~RenderFrameHostImpl(); | 26 virtual ~RenderFrameHostImpl(); |
24 | 27 |
25 // IPC::Sender | 28 // IPC::Sender |
26 virtual bool Send(IPC::Message* msg) OVERRIDE; | 29 virtual bool Send(IPC::Message* msg) OVERRIDE; |
27 | 30 |
28 // IPC::Listener | 31 // IPC::Listener |
29 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; | 32 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; |
30 | 33 |
31 void Init(); | 34 void Init(); |
32 RenderProcessHost* GetProcess() const; | 35 RenderProcessHost* GetProcess() const; |
33 int routing_id() const { return routing_id_; } | 36 int routing_id() const { return routing_id_; } |
| 37 void OnCreateChildFrame(int new_frame_routing_id, |
| 38 int64 parent_frame_id, |
| 39 int64 frame_id, |
| 40 const std::string& frame_name); |
34 | 41 |
35 private: | 42 private: |
36 bool is_swapped_out() { return is_swapped_out_; } | 43 bool is_swapped_out() { return is_swapped_out_; } |
37 | 44 |
38 RenderViewHostImpl* render_view_host_; // Not owned. Outlives this object. | 45 // IPC message handlers. |
| 46 void OnDetach(int64 parent_frame_id, int64 frame_id); |
| 47 |
| 48 RenderProcessHost* render_process_host_; // Not owned. |
| 49 |
| 50 // Reference to the whole frame tree that this RenderFrameHost belongs too. |
| 51 // Allows this RenderFrameHost to add and remove nodes in response to |
| 52 // requests DOM manipulation messages from the renderer. |
| 53 FrameTree* frame_tree_; |
39 int routing_id_; | 54 int routing_id_; |
40 bool is_swapped_out_; | 55 bool is_swapped_out_; |
41 | 56 |
42 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostImpl); | 57 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostImpl); |
43 }; | 58 }; |
44 | 59 |
45 } // namespace content | 60 } // namespace content |
46 | 61 |
47 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_FRAME_HOST_IMPL_H_ | 62 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_FRAME_HOST_IMPL_H_ |
OLD | NEW |