Chromium Code Reviews| 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_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 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 413 // to |bindings|. | 413 // to |bindings|. |
| 414 scoped_ptr<WebUIImpl> CreateWebUI(const GURL& url, int bindings); | 414 scoped_ptr<WebUIImpl> CreateWebUI(const GURL& url, int bindings); |
| 415 | 415 |
| 416 // Returns true if it is safe to reuse the current WebUI when navigating from | 416 // Returns true if it is safe to reuse the current WebUI when navigating from |
| 417 // |current_entry| to |new_url|. | 417 // |current_entry| to |new_url|. |
| 418 bool ShouldReuseWebUI( | 418 bool ShouldReuseWebUI( |
| 419 const NavigationEntry* current_entry, | 419 const NavigationEntry* current_entry, |
| 420 const GURL& new_url) const; | 420 const GURL& new_url) const; |
| 421 | 421 |
| 422 // Returns the SiteInstance to use for the navigation. | 422 // Returns the SiteInstance to use for the navigation. |
| 423 SiteInstance* GetSiteInstanceForNavigation( | 423 SiteInstance* GetSiteInstanceForNavigation(const GURL& dest_url, |
| 424 const GURL& dest_url, | 424 SiteInstance* source_instance, |
| 425 SiteInstance* dest_instance, | 425 SiteInstance* dest_instance, |
| 426 ui::PageTransition dest_transition, | 426 ui::PageTransition transition, |
| 427 bool dest_is_restore, | 427 bool dest_is_restore, |
| 428 bool dest_is_view_source_mode); | 428 bool dest_is_view_source_mode); |
| 429 | 429 |
| 430 // Returns an appropriate SiteInstance object for the given |dest_url|, | 430 // Returns an appropriate SiteInstance object for the given |dest_url|, |
| 431 // possibly reusing the current SiteInstance. If --process-per-tab is used, | 431 // possibly reusing the current SiteInstance. If --process-per-tab is used, |
| 432 // this is only called when ShouldSwapBrowsingInstancesForNavigation returns | 432 // this is only called when ShouldSwapBrowsingInstancesForNavigation returns |
| 433 // true. |dest_instance| will be used if it is not null. | 433 // true. |
| 434 // |source_instance| is the SiteInstance of the frame that initiated the | |
|
nasko
2014/12/11 01:14:44
nit: I'd avoid putting each param description on a
lfg
2014/12/11 23:55:24
Done.
| |
| 435 // navigation. | |
| 436 // |current_instance| is the SiteInstance of the frame that is currently | |
|
nasko
2014/12/11 01:14:44
An example explaining the difference between the c
lfg
2014/12/11 23:55:24
Done.
| |
| 437 // navigating. | |
| 438 // |dest_instance|, is a predetermined SiteInstance that'll be used if not | |
| 439 // null. | |
| 434 // This is a helper function for GetSiteInstanceForNavigation. | 440 // This is a helper function for GetSiteInstanceForNavigation. |
| 435 SiteInstance* GetSiteInstanceForURL( | 441 SiteInstance* GetSiteInstanceForURL(const GURL& dest_url, |
| 436 const GURL& dest_url, | 442 SiteInstance* source_instance, |
| 437 SiteInstance* dest_instance, | 443 SiteInstance* current_instance, |
| 438 ui::PageTransition dest_transition, | 444 SiteInstance* dest_instance, |
| 439 bool dest_is_restore, | 445 ui::PageTransition transition, |
| 440 bool dest_is_view_source_mode, | 446 bool dest_is_restore, |
| 441 SiteInstance* current_instance, | 447 bool dest_is_view_source_mode, |
| 442 bool force_browsing_instance_swap); | 448 bool force_browsing_instance_swap); |
| 443 | 449 |
| 444 // Determines the appropriate url to use as the current url for SiteInstance | 450 // Determines the appropriate url to use as the current url for SiteInstance |
| 445 // selection. | 451 // selection. |
| 446 const GURL& GetCurrentURLForSiteInstance( | 452 const GURL& GetCurrentURLForSiteInstance( |
| 447 SiteInstance* current_instance, | 453 SiteInstance* current_instance, |
| 448 NavigationEntry* current_entry); | 454 NavigationEntry* current_entry); |
| 449 | 455 |
| 450 // Creates a new RenderFrameHostImpl for the |new_instance| and assign it to | 456 // Creates a new RenderFrameHostImpl for the |new_instance| and assign it to |
| 451 // |pending_render_frame_host_| while respecting the opener route if needed | 457 // |pending_render_frame_host_| while respecting the opener route if needed |
| 452 // and stores it in pending_render_frame_host_. | 458 // and stores it in pending_render_frame_host_. |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 509 | 515 |
| 510 // Helper method to terminate the pending RenderViewHost. | 516 // Helper method to terminate the pending RenderViewHost. |
| 511 void CancelPending(); | 517 void CancelPending(); |
| 512 | 518 |
| 513 // Helper method to set the active RenderFrameHost. Returns the old | 519 // Helper method to set the active RenderFrameHost. Returns the old |
| 514 // RenderFrameHost and updates counts. | 520 // RenderFrameHost and updates counts. |
| 515 scoped_ptr<RenderFrameHostImpl> SetRenderFrameHost( | 521 scoped_ptr<RenderFrameHostImpl> SetRenderFrameHost( |
| 516 scoped_ptr<RenderFrameHostImpl> render_frame_host); | 522 scoped_ptr<RenderFrameHostImpl> render_frame_host); |
| 517 | 523 |
| 518 RenderFrameHostImpl* UpdateStateForNavigate( | 524 RenderFrameHostImpl* UpdateStateForNavigate( |
| 519 const GURL& url, | 525 const GURL& dest_url, |
| 520 SiteInstance* instance, | 526 SiteInstance* source_instance, |
| 527 SiteInstance* dest_instance, | |
| 521 ui::PageTransition transition, | 528 ui::PageTransition transition, |
| 522 bool is_restore, | 529 bool dest_is_restore, |
| 523 bool is_view_source_mode, | 530 bool dest_is_view_source_mode, |
| 524 const GlobalRequestID& transferred_request_id, | 531 const GlobalRequestID& transferred_request_id, |
| 525 int bindings); | 532 int bindings); |
| 526 | 533 |
| 527 // Called when a renderer process is starting to close. We should not | 534 // Called when a renderer process is starting to close. We should not |
| 528 // schedule new navigations in its swapped out RenderFrameHosts after this. | 535 // schedule new navigations in its swapped out RenderFrameHosts after this. |
| 529 void RendererProcessClosing(RenderProcessHost* render_process_host); | 536 void RendererProcessClosing(RenderProcessHost* render_process_host); |
| 530 | 537 |
| 531 // Helper method to delete a RenderFrameProxyHost from the list, if one exists | 538 // Helper method to delete a RenderFrameProxyHost from the list, if one exists |
| 532 // for the given |instance|. | 539 // for the given |instance|. |
| 533 void DeleteRenderFrameProxyHost(SiteInstance* instance); | 540 void DeleteRenderFrameProxyHost(SiteInstance* instance); |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 602 NotificationRegistrar registrar_; | 609 NotificationRegistrar registrar_; |
| 603 | 610 |
| 604 base::WeakPtrFactory<RenderFrameHostManager> weak_factory_; | 611 base::WeakPtrFactory<RenderFrameHostManager> weak_factory_; |
| 605 | 612 |
| 606 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostManager); | 613 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostManager); |
| 607 }; | 614 }; |
| 608 | 615 |
| 609 } // namespace content | 616 } // namespace content |
| 610 | 617 |
| 611 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_MANAGER_H_ | 618 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_MANAGER_H_ |
| OLD | NEW |