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

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

Issue 471603002: Remove dependency on NavigationEntry to get a SiteInstance (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 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/frame_host/navigation_entry_impl.h"
12 #include "content/browser/renderer_host/render_view_host_delegate.h" 13 #include "content/browser/renderer_host/render_view_host_delegate.h"
13 #include "content/browser/site_instance_impl.h" 14 #include "content/browser/site_instance_impl.h"
14 #include "content/common/content_export.h" 15 #include "content/common/content_export.h"
15 #include "content/public/browser/global_request_id.h" 16 #include "content/public/browser/global_request_id.h"
16 #include "content/public/browser/notification_observer.h" 17 #include "content/public/browser/notification_observer.h"
17 #include "content/public/browser/notification_registrar.h" 18 #include "content/public/browser/notification_registrar.h"
18 #include "content/public/common/referrer.h" 19 #include "content/public/common/referrer.h"
19 20
20 struct FrameHostMsg_BeginNavigation_Params; 21 struct FrameHostMsg_BeginNavigation_Params;
21 22
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after
379 // Used with FrameTree::ForEach to erase RenderFrameProxyHosts from a 380 // Used with FrameTree::ForEach to erase RenderFrameProxyHosts from a
380 // FrameTreeNode's RenderFrameHostManager. 381 // FrameTreeNode's RenderFrameHostManager.
381 static bool ClearProxiesInSiteInstance(int32 site_instance_id, 382 static bool ClearProxiesInSiteInstance(int32 site_instance_id,
382 FrameTreeNode* node); 383 FrameTreeNode* node);
383 384
384 // Returns whether this tab should transition to a new renderer for 385 // Returns whether this tab should transition to a new renderer for
385 // cross-site URLs. Enabled unless we see the --process-per-tab command line 386 // cross-site URLs. Enabled unless we see the --process-per-tab command line
386 // switch. Can be overridden in unit tests. 387 // switch. Can be overridden in unit tests.
387 bool ShouldTransitionCrossSite(); 388 bool ShouldTransitionCrossSite();
388 389
389 // Returns true if for the navigation from |current_entry| to |new_entry|, 390 // Returns true if for the navigation from |current_entry| to |new_url|,
390 // a new SiteInstance and BrowsingInstance should be created (even if we are 391 // a new SiteInstance and BrowsingInstance should be created (even if we are
391 // in a process model that doesn't usually swap). This forces a process swap 392 // in a process model that doesn't usually swap). This forces a process swap
392 // and severs script connections with existing tabs. Cases where this can 393 // and severs script connections with existing tabs. Cases where this can
393 // happen include transitions between WebUI and regular web pages. 394 // happen include transitions between WebUI and regular web pages.
394 // Either of the entries may be NULL. 395 // |current_entry| and |new_site_instance| may be null.
395 bool ShouldSwapBrowsingInstancesForNavigation( 396 bool ShouldSwapBrowsingInstancesForNavigation(
396 const NavigationEntry* current_entry, 397 const NavigationEntry* current_entry,
Charlie Reis 2014/08/14 06:28:09 Looks like we can eliminate |current_entry| from t
clamy 2014/08/14 10:02:59 Done.
397 const NavigationEntryImpl* new_entry) const; 398 SiteInstance* new_site_instance,
399 const GURL& new_url,
Charlie Reis 2014/08/14 06:28:09 It's very important that this is the result of Get
clamy 2014/08/14 10:02:59 Done.
400 bool new_is_view_source_mode) const;
398 401
399 // Returns true if it is safe to reuse the current WebUI when navigating from 402 // Returns true if it is safe to reuse the current WebUI when navigating from
400 // |current_entry| to |new_entry|. 403 // |current_entry| to |new_entry|.
401 bool ShouldReuseWebUI( 404 bool ShouldReuseWebUI(
402 const NavigationEntry* current_entry, 405 const NavigationEntry* current_entry,
403 const NavigationEntryImpl* new_entry) const; 406 const NavigationEntryImpl* new_entry) const;
404 407
405 // Returns an appropriate SiteInstance object for the given NavigationEntry, 408 // Returns an appropriate SiteInstance object for the given |dest_url|,
406 // possibly reusing the current SiteInstance. If --process-per-tab is used, 409 // possibly reusing the current SiteInstance. If --process-per-tab is used,
407 // this is only called when ShouldSwapBrowsingInstancesForNavigation returns 410 // this is only called when ShouldSwapBrowsingInstancesForNavigation returns
408 // true. 411 // true. |navigation_instance| will be used if it is not null.
409 SiteInstance* GetSiteInstanceForEntry( 412 SiteInstance* GetSiteInstanceForURL(
410 const NavigationEntryImpl& entry, 413 const GURL& dest_url,
414 SiteInstance* navigation_instance,
Charlie Reis 2014/08/14 06:28:09 We should be clearer about which parameters are fo
clamy 2014/08/14 10:02:59 Done.
411 SiteInstance* current_instance, 415 SiteInstance* current_instance,
412 bool force_browsing_instance_swap); 416 PageTransition page_transition,
417 NavigationEntryImpl::RestoreType restore_type,
Charlie Reis 2014/08/14 06:28:09 We can make this a bool |dest_is_restore| to avoid
clamy 2014/08/14 10:02:59 Done.
418 bool force_browsing_instance_swap,
419 bool is_view_source_mode);
413 420
414 // Creates a RenderFrameHost and corresponding RenderViewHost if necessary. 421 // Creates a RenderFrameHost and corresponding RenderViewHost if necessary.
415 scoped_ptr<RenderFrameHostImpl> CreateRenderFrameHost(SiteInstance* instance, 422 scoped_ptr<RenderFrameHostImpl> CreateRenderFrameHost(SiteInstance* instance,
416 int view_routing_id, 423 int view_routing_id,
417 int frame_routing_id, 424 int frame_routing_id,
418 bool swapped_out, 425 bool swapped_out,
419 bool hidden); 426 bool hidden);
420 427
421 // Sets up the necessary state for a new RenderViewHost with the given opener, 428 // Sets up the necessary state for a new RenderViewHost with the given opener,
422 // if necessary. It creates a RenderFrameProxy in the target renderer process 429 // if necessary. It creates a RenderFrameProxy in the target renderer process
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
533 scoped_ptr<NavigationRequest> navigation_request_; 540 scoped_ptr<NavigationRequest> navigation_request_;
534 541
535 base::WeakPtrFactory<RenderFrameHostManager> weak_factory_; 542 base::WeakPtrFactory<RenderFrameHostManager> weak_factory_;
536 543
537 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostManager); 544 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostManager);
538 }; 545 };
539 546
540 } // namespace content 547 } // namespace content
541 548
542 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_MANAGER_H_ 549 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698