Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(163)

Side by Side Diff: content/browser/frame_host/render_frame_host_impl.h

Issue 109653014: Allow RenderFrames to swap out for subframe navigations. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix an error during merge. Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | content/browser/frame_host/render_frame_host_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 void Init(); 48 void Init();
49 int routing_id() const { return routing_id_; } 49 int routing_id() const { return routing_id_; }
50 void OnCreateChildFrame(int new_frame_routing_id, 50 void OnCreateChildFrame(int new_frame_routing_id,
51 int64 parent_frame_id, 51 int64 parent_frame_id,
52 int64 frame_id, 52 int64 frame_id,
53 const std::string& frame_name); 53 const std::string& frame_name);
54 54
55 RenderViewHostImpl* render_view_host() { return render_view_host_; } 55 RenderViewHostImpl* render_view_host() { return render_view_host_; }
56 RenderFrameHostDelegate* delegate() { return delegate_; } 56 RenderFrameHostDelegate* delegate() { return delegate_; }
57 57
58
58 // This function is called when this is a swapped out RenderFrameHost that 59 // This function is called when this is a swapped out RenderFrameHost that
59 // lives in the same process as the parent frame. The 60 // lives in the same process as the parent frame. The
60 // |cross_process_frame_connector| allows the non-swapped-out 61 // |cross_process_frame_connector| allows the non-swapped-out
61 // RenderFrameHost for a frame to communicate with the parent process 62 // RenderFrameHost for a frame to communicate with the parent process
62 // so that it may composite drawing data. 63 // so that it may composite drawing data.
63 // 64 //
64 // Ownership is not transfered. 65 // Ownership is not transfered.
65 void set_cross_process_frame_connector( 66 void set_cross_process_frame_connector(
66 CrossProcessFrameConnector* cross_process_frame_connector) { 67 CrossProcessFrameConnector* cross_process_frame_connector) {
67 cross_process_frame_connector_ = cross_process_frame_connector; 68 cross_process_frame_connector_ = cross_process_frame_connector;
68 } 69 }
69 70
71 // Hack to get this subframe to swap out, without yet moving over all the
72 // SwapOut state and machinery from RenderViewHost.
73 void SwapOut();
74 void OnSwappedOut(bool timed_out);
75 bool is_swapped_out() { return is_swapped_out_; }
76 void set_swapped_out(bool is_swapped_out) {
77 is_swapped_out_ = is_swapped_out;
78 }
79
70 protected: 80 protected:
71 friend class RenderFrameHostFactory; 81 friend class RenderFrameHostFactory;
72 82
73 // TODO(nasko): Remove dependency on RenderViewHost here. RenderProcessHost 83 // TODO(nasko): Remove dependency on RenderViewHost here. RenderProcessHost
74 // should be the abstraction needed here, but we need RenderViewHost to pass 84 // should be the abstraction needed here, but we need RenderViewHost to pass
75 // into WebContentsObserver::FrameDetached for now. 85 // into WebContentsObserver::FrameDetached for now.
76 RenderFrameHostImpl(RenderViewHostImpl* render_view_host, 86 RenderFrameHostImpl(RenderViewHostImpl* render_view_host,
77 RenderFrameHostDelegate* delegate, 87 RenderFrameHostDelegate* delegate,
78 FrameTree* frame_tree, 88 FrameTree* frame_tree,
79 FrameTreeNode* frame_tree_node, 89 FrameTreeNode* frame_tree_node,
80 int routing_id, 90 int routing_id,
81 bool is_swapped_out); 91 bool is_swapped_out);
82 92
83 private: 93 private:
84 friend class TestRenderViewHost; 94 friend class TestRenderViewHost;
85 95
86 // IPC Message handlers. 96 // IPC Message handlers.
87 void OnDetach(int64 parent_frame_id, int64 frame_id); 97 void OnDetach(int64 parent_frame_id, int64 frame_id);
88 void OnDidStartProvisionalLoadForFrame(int64 frame_id, 98 void OnDidStartProvisionalLoadForFrame(int64 frame_id,
89 int64 parent_frame_id, 99 int64 parent_frame_id,
90 bool main_frame, 100 bool main_frame,
91 const GURL& url); 101 const GURL& url);
92 102 void OnSwapOutACK();
93 bool is_swapped_out() { return is_swapped_out_; }
94 103
95 // For now, RenderFrameHosts indirectly keep RenderViewHosts alive via a 104 // For now, RenderFrameHosts indirectly keep RenderViewHosts alive via a
96 // refcount that calls Shutdown when it reaches zero. This allows each 105 // refcount that calls Shutdown when it reaches zero. This allows each
97 // RenderFrameHostManager to just care about RenderFrameHosts, while ensuring 106 // RenderFrameHostManager to just care about RenderFrameHosts, while ensuring
98 // we have a RenderViewHost for each RenderFrameHost. 107 // we have a RenderViewHost for each RenderFrameHost.
99 // TODO(creis): RenderViewHost will eventually go away and be replaced with 108 // TODO(creis): RenderViewHost will eventually go away and be replaced with
100 // some form of page context. 109 // some form of page context.
101 RenderViewHostImpl* render_view_host_; 110 RenderViewHostImpl* render_view_host_;
102 111
103 RenderFrameHostDelegate* delegate_; 112 RenderFrameHostDelegate* delegate_;
(...skipping 20 matching lines...) Expand all
124 133
125 int routing_id_; 134 int routing_id_;
126 bool is_swapped_out_; 135 bool is_swapped_out_;
127 136
128 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostImpl); 137 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostImpl);
129 }; 138 };
130 139
131 } // namespace content 140 } // namespace content
132 141
133 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_ 142 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_
OLDNEW
« no previous file with comments | « no previous file | content/browser/frame_host/render_frame_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698