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 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
412 // to |bindings|. | 412 // to |bindings|. |
413 scoped_ptr<WebUIImpl> CreateWebUI(const GURL& url, int bindings); | 413 scoped_ptr<WebUIImpl> CreateWebUI(const GURL& url, int bindings); |
414 | 414 |
415 // Returns true if it is safe to reuse the current WebUI when navigating from | 415 // Returns true if it is safe to reuse the current WebUI when navigating from |
416 // |current_entry| to |new_url|. | 416 // |current_entry| to |new_url|. |
417 bool ShouldReuseWebUI( | 417 bool ShouldReuseWebUI( |
418 const NavigationEntry* current_entry, | 418 const NavigationEntry* current_entry, |
419 const GURL& new_url) const; | 419 const GURL& new_url) const; |
420 | 420 |
421 // Returns the SiteInstance to use for the navigation. | 421 // Returns the SiteInstance to use for the navigation. |
422 SiteInstance* GetSiteInstanceForNavigation( | 422 SiteInstance* GetSiteInstanceForNavigation(const GURL& dest_url, |
423 const GURL& dest_url, | 423 SiteInstance* source_instance, |
424 SiteInstance* dest_instance, | 424 SiteInstance* dest_instance, |
425 ui::PageTransition dest_transition, | 425 ui::PageTransition dest_transition, |
426 bool dest_is_restore, | 426 bool dest_is_restore, |
427 bool dest_is_view_source_mode); | 427 bool dest_is_view_source_mode); |
428 | 428 |
429 // Returns an appropriate SiteInstance object for the given |dest_url|, | 429 // Returns an appropriate SiteInstance object for the given |dest_url|, |
430 // possibly reusing the current SiteInstance. If --process-per-tab is used, | 430 // possibly reusing the current SiteInstance. If --process-per-tab is used, |
431 // this is only called when ShouldSwapBrowsingInstancesForNavigation returns | 431 // this is only called when ShouldSwapBrowsingInstancesForNavigation returns |
432 // true. |dest_instance| will be used if it is not null. | 432 // true. |dest_instance| will be used if it is not null. |
433 // This is a helper function for GetSiteInstanceForNavigation. | 433 // This is a helper function for GetSiteInstanceForNavigation. |
434 SiteInstance* GetSiteInstanceForURL( | 434 SiteInstance* GetSiteInstanceForURL(const GURL& dest_url, |
435 const GURL& dest_url, | 435 SiteInstance* source_instance, |
436 SiteInstance* dest_instance, | 436 SiteInstance* dest_instance, |
437 ui::PageTransition dest_transition, | 437 ui::PageTransition dest_transition, |
438 bool dest_is_restore, | 438 bool dest_is_restore, |
439 bool dest_is_view_source_mode, | 439 bool dest_is_view_source_mode, |
440 SiteInstance* current_instance, | 440 SiteInstance* current_instance, |
Charlie Reis
2014/12/06 00:18:50
Please put current_instance between source_instanc
lfg
2014/12/08 20:45:33
Done.
| |
441 bool force_browsing_instance_swap); | 441 bool force_browsing_instance_swap); |
442 | 442 |
443 // Determines the appropriate url to use as the current url for SiteInstance | 443 // Determines the appropriate url to use as the current url for SiteInstance |
444 // selection. | 444 // selection. |
445 const GURL& GetCurrentURLForSiteInstance( | 445 const GURL& GetCurrentURLForSiteInstance( |
446 SiteInstance* current_instance, | 446 SiteInstance* current_instance, |
447 NavigationEntry* current_entry); | 447 NavigationEntry* current_entry); |
448 | 448 |
449 // Creates a new RenderFrameHostImpl for the |new_instance| and assign it to | 449 // Creates a new RenderFrameHostImpl for the |new_instance| and assign it to |
450 // |pending_render_frame_host_| while respecting the opener route if needed | 450 // |pending_render_frame_host_| while respecting the opener route if needed |
451 // and stores it in pending_render_frame_host_. | 451 // and stores it in pending_render_frame_host_. |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
508 | 508 |
509 // Helper method to terminate the pending RenderViewHost. | 509 // Helper method to terminate the pending RenderViewHost. |
510 void CancelPending(); | 510 void CancelPending(); |
511 | 511 |
512 // Helper method to set the active RenderFrameHost. Returns the old | 512 // Helper method to set the active RenderFrameHost. Returns the old |
513 // RenderFrameHost and updates counts. | 513 // RenderFrameHost and updates counts. |
514 scoped_ptr<RenderFrameHostImpl> SetRenderFrameHost( | 514 scoped_ptr<RenderFrameHostImpl> SetRenderFrameHost( |
515 scoped_ptr<RenderFrameHostImpl> render_frame_host); | 515 scoped_ptr<RenderFrameHostImpl> render_frame_host); |
516 | 516 |
517 RenderFrameHostImpl* UpdateStateForNavigate( | 517 RenderFrameHostImpl* UpdateStateForNavigate( |
518 const GURL& url, | 518 const GURL& dest_url, |
519 SiteInstance* instance, | 519 SiteInstance* source_instance, |
520 ui::PageTransition transition, | 520 SiteInstance* dest_instance, |
521 bool is_restore, | 521 ui::PageTransition dest_transition, |
Charlie Reis
2014/12/06 00:18:50
Actually, let's remove dest_ from transition in th
lfg
2014/12/08 20:45:33
Done.
| |
522 bool is_view_source_mode, | 522 bool dest_is_restore, |
523 bool dest_is_view_source_mode, | |
523 const GlobalRequestID& transferred_request_id, | 524 const GlobalRequestID& transferred_request_id, |
524 int bindings); | 525 int bindings); |
525 | 526 |
526 // Called when a renderer process is starting to close. We should not | 527 // Called when a renderer process is starting to close. We should not |
527 // schedule new navigations in its swapped out RenderFrameHosts after this. | 528 // schedule new navigations in its swapped out RenderFrameHosts after this. |
528 void RendererProcessClosing(RenderProcessHost* render_process_host); | 529 void RendererProcessClosing(RenderProcessHost* render_process_host); |
529 | 530 |
530 // Helper method to delete a RenderFrameProxyHost from the list, if one exists | 531 // Helper method to delete a RenderFrameProxyHost from the list, if one exists |
531 // for the given |instance|. | 532 // for the given |instance|. |
532 void DeleteRenderFrameProxyHost(SiteInstance* instance); | 533 void DeleteRenderFrameProxyHost(SiteInstance* instance); |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
601 NotificationRegistrar registrar_; | 602 NotificationRegistrar registrar_; |
602 | 603 |
603 base::WeakPtrFactory<RenderFrameHostManager> weak_factory_; | 604 base::WeakPtrFactory<RenderFrameHostManager> weak_factory_; |
604 | 605 |
605 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostManager); | 606 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostManager); |
606 }; | 607 }; |
607 | 608 |
608 } // namespace content | 609 } // namespace content |
609 | 610 |
610 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_MANAGER_H_ | 611 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_MANAGER_H_ |
OLD | NEW |