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

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

Issue 367653002: Add a FrameHostMsg_BeginNavigation IPC (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added unit test + fixed bug in parent_is_render_frame_computation Created 6 years, 5 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 "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
11 #include "base/memory/weak_ptr.h" 11 #include "base/memory/weak_ptr.h"
12 #include "content/browser/renderer_host/render_view_host_delegate.h" 12 #include "content/browser/renderer_host/render_view_host_delegate.h"
13 #include "content/browser/site_instance_impl.h" 13 #include "content/browser/site_instance_impl.h"
14 #include "content/common/content_export.h" 14 #include "content/common/content_export.h"
15 #include "content/public/browser/global_request_id.h" 15 #include "content/public/browser/global_request_id.h"
16 #include "content/public/browser/notification_observer.h" 16 #include "content/public/browser/notification_observer.h"
17 #include "content/public/browser/notification_registrar.h" 17 #include "content/public/browser/notification_registrar.h"
18 #include "content/public/common/referrer.h" 18 #include "content/public/common/referrer.h"
19 19
20 struct FrameHostMsg_BeginNavigation_Params;
20 21
21 namespace content { 22 namespace content {
22 class BrowserContext; 23 class BrowserContext;
23 class CrossProcessFrameConnector; 24 class CrossProcessFrameConnector;
24 class CrossSiteTransferringRequest; 25 class CrossSiteTransferringRequest;
25 class InterstitialPageImpl; 26 class InterstitialPageImpl;
26 class FrameTreeNode; 27 class FrameTreeNode;
27 class NavigationControllerImpl; 28 class NavigationControllerImpl;
28 class NavigationEntry; 29 class NavigationEntry;
29 class NavigationEntryImpl; 30 class NavigationEntryImpl;
31 class NavigationRequest;
30 class RenderFrameHost; 32 class RenderFrameHost;
31 class RenderFrameHostDelegate; 33 class RenderFrameHostDelegate;
32 class RenderFrameHostImpl; 34 class RenderFrameHostImpl;
33 class RenderFrameHostManagerTest; 35 class RenderFrameHostManagerTest;
34 class RenderFrameProxyHost; 36 class RenderFrameProxyHost;
35 class RenderViewHost; 37 class RenderViewHost;
36 class RenderViewHostImpl; 38 class RenderViewHostImpl;
37 class RenderWidgetHostDelegate; 39 class RenderWidgetHostDelegate;
38 class RenderWidgetHostView; 40 class RenderWidgetHostView;
39 class TestWebContents; 41 class TestWebContents;
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 170
169 // Returns the current committed Web UI or NULL if none applies. 171 // Returns the current committed Web UI or NULL if none applies.
170 WebUIImpl* web_ui() const { return web_ui_.get(); } 172 WebUIImpl* web_ui() const { return web_ui_.get(); }
171 173
172 // Returns the Web UI for the pending navigation, or NULL of none applies. 174 // Returns the Web UI for the pending navigation, or NULL of none applies.
173 WebUIImpl* pending_web_ui() const { 175 WebUIImpl* pending_web_ui() const {
174 return pending_web_ui_.get() ? pending_web_ui_.get() : 176 return pending_web_ui_.get() ? pending_web_ui_.get() :
175 pending_and_current_web_ui_.get(); 177 pending_and_current_web_ui_.get();
176 } 178 }
177 179
180 // Returns the current navigation request (used in the PlzNavigate navigation
nasko 2014/07/07 11:35:09 Now that you mention it like this, it might not be
181 // logic refactoring project).
182 NavigationRequest* navigation_request() const {
nasko 2014/07/07 11:35:09 This is only used for tests, so it should be named
clamy 2014/07/07 13:36:23 Done.
183 return navigation_request_.get(); }
184
178 // Sets the pending Web UI for the pending navigation, ensuring that the 185 // Sets the pending Web UI for the pending navigation, ensuring that the
179 // bindings are appropriate for the given NavigationEntry. 186 // bindings are appropriate for the given NavigationEntry.
180 void SetPendingWebUI(const NavigationEntryImpl& entry); 187 void SetPendingWebUI(const NavigationEntryImpl& entry);
181 188
182 // Called when we want to instruct the renderer to navigate to the given 189 // Called when we want to instruct the renderer to navigate to the given
183 // navigation entry. It may create a new RenderFrameHost or re-use an existing 190 // navigation entry. It may create a new RenderFrameHost or re-use an existing
184 // one. The RenderFrameHost to navigate will be returned. Returns NULL if one 191 // one. The RenderFrameHost to navigate will be returned. Returns NULL if one
185 // could not be created. 192 // could not be created.
186 RenderFrameHostImpl* Navigate(const NavigationEntryImpl& entry); 193 RenderFrameHostImpl* Navigate(const NavigationEntryImpl& entry);
187 194
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 void SwapOutOldPage(); 300 void SwapOutOldPage();
294 301
295 // Deletes a RenderFrameHost that was pending shutdown. 302 // Deletes a RenderFrameHost that was pending shutdown.
296 void ClearPendingShutdownRFHForSiteInstance(int32 site_instance_id, 303 void ClearPendingShutdownRFHForSiteInstance(int32 site_instance_id,
297 RenderFrameHostImpl* rfh); 304 RenderFrameHostImpl* rfh);
298 305
299 // Deletes any proxy hosts associated with this node. Used during destruction 306 // Deletes any proxy hosts associated with this node. Used during destruction
300 // of WebContentsImpl. 307 // of WebContentsImpl.
301 void ResetProxyHosts(); 308 void ResetProxyHosts();
302 309
310 // Used to start a navigation, part of PlzNavigate project.
311 void BeginNavigation(const FrameHostMsg_BeginNavigation_Params& params);
312
303 private: 313 private:
304 friend class RenderFrameHostManagerTest; 314 friend class RenderFrameHostManagerTest;
305 friend class TestWebContents; 315 friend class TestWebContents;
306 316
307 // Tracks information about a navigation while a cross-process transition is 317 // Tracks information about a navigation while a cross-process transition is
308 // in progress, in case we need to transfer it to a new RenderFrameHost. 318 // in progress, in case we need to transfer it to a new RenderFrameHost.
309 // When a request is being transferred, deleting the PendingNavigationParams, 319 // When a request is being transferred, deleting the PendingNavigationParams,
310 // and thus |cross_site_transferring_request|, will cancel the request being 320 // and thus |cross_site_transferring_request|, will cancel the request being
311 // transferred, unless its ReleaseRequest method has been called. 321 // transferred, unless its ReleaseRequest method has been called.
312 struct PendingNavigationParams { 322 struct PendingNavigationParams {
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
487 typedef base::hash_map<int32, linked_ptr<RenderFrameHostImpl> > 497 typedef base::hash_map<int32, linked_ptr<RenderFrameHostImpl> >
488 RFHPendingDeleteMap; 498 RFHPendingDeleteMap;
489 RFHPendingDeleteMap pending_delete_hosts_; 499 RFHPendingDeleteMap pending_delete_hosts_;
490 500
491 // The intersitial page currently shown if any, not own by this class 501 // The intersitial page currently shown if any, not own by this class
492 // (the InterstitialPage is self-owned, it deletes itself when hidden). 502 // (the InterstitialPage is self-owned, it deletes itself when hidden).
493 InterstitialPageImpl* interstitial_page_; 503 InterstitialPageImpl* interstitial_page_;
494 504
495 NotificationRegistrar registrar_; 505 NotificationRegistrar registrar_;
496 506
507 // Owns a navigation request that originated in that frame until it commits.
508 scoped_ptr<NavigationRequest> navigation_request_;
509
497 base::WeakPtrFactory<RenderFrameHostManager> weak_factory_; 510 base::WeakPtrFactory<RenderFrameHostManager> weak_factory_;
498 511
499 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostManager); 512 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostManager);
500 }; 513 };
501 514
502 } // namespace content 515 } // namespace content
503 516
504 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_MANAGER_H_ 517 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698