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

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

Issue 972313002: Make <webview> use out-of-process iframe architecture. (Closed) Base URL: ssh://saopaulo.wat/mnt/dev/shared/src@testoopif2z-better-chrome
Patch Set: Move iframe*guestview to components/ Created 5 years, 6 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
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_MANAGER_H_ 5 #ifndef CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_MANAGER_H_
6 #define CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_MANAGER_H_ 6 #define CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_MANAGER_H_
7 7
8 #include <list> 8 #include <list>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 // to see what it should do. 164 // to see what it should do.
165 virtual bool FocusLocationBarByDefault() = 0; 165 virtual bool FocusLocationBarByDefault() = 0;
166 166
167 // Focuses the location bar. 167 // Focuses the location bar.
168 virtual void SetFocusToLocationBar(bool select_all) = 0; 168 virtual void SetFocusToLocationBar(bool select_all) = 0;
169 169
170 // Returns true if views created for this delegate should be created in a 170 // Returns true if views created for this delegate should be created in a
171 // hidden state. 171 // hidden state.
172 virtual bool IsHidden() = 0; 172 virtual bool IsHidden() = 0;
173 173
174 // If the delegate is an inner WebContents, this method returns the
175 // FrameTreeNode ID of the frame in the outer WebContents which hosts
176 // the inner WebContents. Returns FrameTreeNode::kFrameTreeNodeInvalidID
177 // if the delegate does not have an outer WebContents.
178 virtual int GetOuterDelegateFrameTreeNodeID() = 0;
179
174 protected: 180 protected:
175 virtual ~Delegate() {} 181 virtual ~Delegate() {}
176 }; 182 };
177 183
178 // Used with FrameTree::ForEach to delete RenderFrameHosts pending shutdown 184 // Used with FrameTree::ForEach to delete RenderFrameHosts pending shutdown
179 // from a FrameTreeNode's RenderFrameHostManager. Used during destruction of 185 // from a FrameTreeNode's RenderFrameHostManager. Used during destruction of
180 // WebContentsImpl. 186 // WebContentsImpl.
181 static bool ClearRFHsPendingShutdown(FrameTreeNode* node); 187 static bool ClearRFHsPendingShutdown(FrameTreeNode* node);
182 188
183 // All three delegate pointers must be non-NULL and are not owned by this 189 // All three delegate pointers must be non-NULL and are not owned by this
(...skipping 25 matching lines...) Expand all
209 return render_frame_host_.get(); 215 return render_frame_host_.get();
210 } 216 }
211 217
212 // TODO(creis): Remove this when we no longer use RVH for navigation. 218 // TODO(creis): Remove this when we no longer use RVH for navigation.
213 RenderViewHostImpl* current_host() const; 219 RenderViewHostImpl* current_host() const;
214 220
215 // Returns the view associated with the current RenderViewHost, or NULL if 221 // Returns the view associated with the current RenderViewHost, or NULL if
216 // there is no current one. 222 // there is no current one.
217 RenderWidgetHostView* GetRenderWidgetHostView() const; 223 RenderWidgetHostView* GetRenderWidgetHostView() const;
218 224
225 // Returns whether this manager belongs to a FrameTreeNode that is a main
226 // frame in an inner WebContents.
227 // TODO(lazyboy): Make this work correctly for subframes inside inner
228 // WebContents too.
229 bool ForInnerDelegate();
230
231 // Returns the RenderWidgetHost of the outer WebContents (if any) that can be
232 // used to fetch the last keyboard event.
233 // TODO(lazyboy): This can be removed once input events are sent directly to
234 // remote frames.
235 RenderWidgetHostImpl* GetOuterRenderWidgetHostForKeyboardInput();
236
219 RenderFrameProxyHost* GetProxyToParent(); 237 RenderFrameProxyHost* GetProxyToParent();
220 238
239 // Returns the proxy to inner WebContents in the outer WebContents's
240 // SiteInstance. Returns nullptr if this WebContents isn't part of inner/outer
241 // relationship.
242 RenderFrameProxyHost* GetProxyToOuterDelegate();
243
244 // Removes the FrameTreeNode in the outer WebContents that represents this
245 // FrameTreeNode.
246 void RemoveOuterDelegateFrame();
247
221 // Returns the pending RenderFrameHost, or NULL if there is no pending one. 248 // Returns the pending RenderFrameHost, or NULL if there is no pending one.
222 RenderFrameHostImpl* pending_frame_host() const { 249 RenderFrameHostImpl* pending_frame_host() const {
223 return pending_render_frame_host_.get(); 250 return pending_render_frame_host_.get();
224 } 251 }
225 252
226 // Returns the speculative RenderFrameHost, or null if there is no speculative 253 // Returns the speculative RenderFrameHost, or null if there is no speculative
227 // one. 254 // one.
228 RenderFrameHostImpl* speculative_frame_host_for_testing() const { 255 RenderFrameHostImpl* speculative_frame_host_for_testing() const {
229 return speculative_render_frame_host_.get(); 256 return speculative_render_frame_host_.get();
230 } 257 }
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
419 446
420 // Recursively creates swapped out RenderViews and RenderFrameProxies for 447 // Recursively creates swapped out RenderViews and RenderFrameProxies for
421 // this frame's FrameTree and for its opener chain in the given SiteInstance. 448 // this frame's FrameTree and for its opener chain in the given SiteInstance.
422 // This allows other tabs to send cross-process JavaScript calls to their 449 // This allows other tabs to send cross-process JavaScript calls to their
423 // opener(s) and to any other frames in the opener's FrameTree (e.g., 450 // opener(s) and to any other frames in the opener's FrameTree (e.g.,
424 // supporting calls like window.opener.opener.frames[x][y]). Returns the 451 // supporting calls like window.opener.opener.frames[x][y]). Returns the
425 // route ID of this frame's RenderView for |instance|. 452 // route ID of this frame's RenderView for |instance|.
426 // TODO(alexmos): Switch this to return RenderFrame routing IDs. 453 // TODO(alexmos): Switch this to return RenderFrame routing IDs.
427 int CreateOpenerProxies(SiteInstance* instance); 454 int CreateOpenerProxies(SiteInstance* instance);
428 455
456 // Called on the RFHM of the inner WebContents to create a
457 // RenderFrameProxyHost in its outer WebContents's SiteInstance,
458 // |outer_contents_site_instance|. The frame in outer WebContents that is
459 // hosting the inner WebContents is |render_frame_host|, and the frame will
460 // be swapped out by the proxy.
nasko 2015/06/23 13:39:23 nit: s/out/with/
lazyboy 2015/06/23 23:00:00 Done.
461 void CreateOuterDelegateProxy(SiteInstance* outer_contents_site_instance,
462 RenderFrameHostImpl* render_frame_host);
463
464 // Sets the child RenderWidgetHostView for this frame, which must be part of
465 // an inner WebContents.
466 void SetRWHViewForInnerContents(RenderWidgetHostView* child_rwhv);
467
429 private: 468 private:
430 friend class FrameTreeVisualizer; 469 friend class FrameTreeVisualizer;
431 friend class NavigatorTestWithBrowserSideNavigation; 470 friend class NavigatorTestWithBrowserSideNavigation;
432 friend class RenderFrameHostManagerTest; 471 friend class RenderFrameHostManagerTest;
433 friend class TestWebContents; 472 friend class TestWebContents;
434 473
435 // Stores information regarding a SiteInstance targeted at a specific URL to 474 // Stores information regarding a SiteInstance targeted at a specific URL to
436 // allow for comparisons without having to actually create new instances. It 475 // allow for comparisons without having to actually create new instances. It
437 // can point to an existing one or store the details needed to create a new 476 // can point to an existing one or store the details needed to create a new
438 // one. 477 // one.
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
749 bool should_reuse_web_ui_; 788 bool should_reuse_web_ui_;
750 789
751 base::WeakPtrFactory<RenderFrameHostManager> weak_factory_; 790 base::WeakPtrFactory<RenderFrameHostManager> weak_factory_;
752 791
753 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostManager); 792 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostManager);
754 }; 793 };
755 794
756 } // namespace content 795 } // namespace content
757 796
758 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_MANAGER_H_ 797 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698