OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_RENDERER_HOST_RENDER_VIEW_HOST_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_IMPL_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_IMPL_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_IMPL_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
449 bool CanCommitURL(const GURL& url); | 449 bool CanCommitURL(const GURL& url); |
450 | 450 |
451 // Checks that the given renderer can request |url|, if not it sets it to | 451 // Checks that the given renderer can request |url|, if not it sets it to |
452 // about:blank. | 452 // about:blank. |
453 // empty_allowed must be set to false for navigations for security reasons. | 453 // empty_allowed must be set to false for navigations for security reasons. |
454 static void FilterURL(ChildProcessSecurityPolicyImpl* policy, | 454 static void FilterURL(ChildProcessSecurityPolicyImpl* policy, |
455 const RenderProcessHost* process, | 455 const RenderProcessHost* process, |
456 bool empty_allowed, | 456 bool empty_allowed, |
457 GURL* url); | 457 GURL* url); |
458 | 458 |
459 // Update the FrameTree with the new RenderFrameHost for the main frame. | |
Charlie Reis
2013/09/27 19:19:21
This makes sense but is hard to read, since it's n
awong
2013/09/27 20:50:09
Done.
| |
460 // Called when the RenderViewHost is commited. | |
461 // | |
462 // TODO(ajwong): Remove once RenderViewHost no longer owns the main frame | |
463 // RenderFrameHost. | |
464 void AttachToFrameTree(); | |
465 | |
459 // NOTE: Do not add functions that just send an IPC message that are called in | 466 // NOTE: Do not add functions that just send an IPC message that are called in |
460 // one or two places. Have the caller send the IPC message directly (unless | 467 // one or two places. Have the caller send the IPC message directly (unless |
461 // the caller places are in different platforms, in which case it's better | 468 // the caller places are in different platforms, in which case it's better |
462 // to keep them consistent). | 469 // to keep them consistent). |
463 | 470 |
464 protected: | 471 protected: |
465 friend class RenderViewHostObserver; | 472 friend class RenderViewHostObserver; |
466 | 473 |
467 // Add and remove observers for filtering IPC messages. Clients must be sure | 474 // Add and remove observers for filtering IPC messages. Clients must be sure |
468 // to remove the observer before they go away. | 475 // to remove the observer before they go away. |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
574 void OnRunFileChooser(const FileChooserParams& params); | 581 void OnRunFileChooser(const FileChooserParams& params); |
575 void OnDidAccessInitialDocument(); | 582 void OnDidAccessInitialDocument(); |
576 void OnDomOperationResponse(const std::string& json_string, | 583 void OnDomOperationResponse(const std::string& json_string, |
577 int automation_id); | 584 int automation_id); |
578 void OnGetWindowSnapshot(const int snapshot_id); | 585 void OnGetWindowSnapshot(const int snapshot_id); |
579 | 586 |
580 #if defined(OS_MACOSX) || defined(OS_ANDROID) | 587 #if defined(OS_MACOSX) || defined(OS_ANDROID) |
581 void OnShowPopup(const ViewHostMsg_ShowPopup_Params& params); | 588 void OnShowPopup(const ViewHostMsg_ShowPopup_Params& params); |
582 #endif | 589 #endif |
583 | 590 |
591 // TODO(nasko): Remove this accessor once RenderFrameHost moves into the frame | |
592 // tree. | |
593 RenderFrameHostImpl* main_render_frame_host() const { | |
594 return main_render_frame_host_.get(); | |
595 } | |
596 | |
584 private: | 597 private: |
585 friend class TestRenderViewHost; | 598 friend class TestRenderViewHost; |
586 FRIEND_TEST_ALL_PREFIXES(RenderViewHostTest, BasicRenderFrameHost); | 599 FRIEND_TEST_ALL_PREFIXES(RenderViewHostTest, BasicRenderFrameHost); |
587 FRIEND_TEST_ALL_PREFIXES(RenderViewHostTest, RoutingIdSane); | 600 FRIEND_TEST_ALL_PREFIXES(RenderViewHostTest, RoutingIdSane); |
588 | 601 |
589 // TODO(nasko): Remove this accessor once RenderFrameHost moves into the frame | |
590 // tree. | |
591 RenderFrameHostImpl* main_render_frame_host() const; | |
592 | |
593 // Sets whether this RenderViewHost is swapped out in favor of another, | 602 // Sets whether this RenderViewHost is swapped out in favor of another, |
594 // and clears any waiting state that is no longer relevant. | 603 // and clears any waiting state that is no longer relevant. |
595 void SetSwappedOut(bool is_swapped_out); | 604 void SetSwappedOut(bool is_swapped_out); |
596 | 605 |
597 bool CanAccessFilesOfPageState(const PageState& state) const; | 606 bool CanAccessFilesOfPageState(const PageState& state) const; |
598 | 607 |
599 // This is an RenderFrameHost object associated with the top-level frame in | 608 // All RenderViewHosts must have a RenderFrameHost for its main frame. |
600 // the page rendered by this RenderViewHost. | 609 // Currently the RenderFrameHost is created in lock step on construction |
601 // TODO(nasko): Remove this pointer once we have enough infrastructure to | 610 // and a pointer to the main frame is given to the FrameTreeNode |
602 // move this to the top-level FrameTreeNode. | 611 // when the RenderViewHost commits (see AttachToFrameTree()). |
612 // | |
613 // TODO(ajwong): Make this reference non-owning. The root FrameTreeNode of | |
614 // the FrameTree should be responsible for owning the main frame's | |
615 // RenderFrameHost. | |
603 scoped_ptr<RenderFrameHostImpl> main_render_frame_host_; | 616 scoped_ptr<RenderFrameHostImpl> main_render_frame_host_; |
604 | 617 |
605 // Our delegate, which wants to know about changes in the RenderView. | 618 // Our delegate, which wants to know about changes in the RenderView. |
606 RenderViewHostDelegate* delegate_; | 619 RenderViewHostDelegate* delegate_; |
607 | 620 |
608 // The SiteInstance associated with this RenderViewHost. All pages drawn | 621 // The SiteInstance associated with this RenderViewHost. All pages drawn |
609 // in this RenderViewHost are part of this SiteInstance. Should not change | 622 // in this RenderViewHost are part of this SiteInstance. Should not change |
610 // over time. | 623 // over time. |
611 scoped_refptr<SiteInstanceImpl> instance_; | 624 scoped_refptr<SiteInstanceImpl> instance_; |
612 | 625 |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
709 DISALLOW_COPY_AND_ASSIGN(RenderViewHostImpl); | 722 DISALLOW_COPY_AND_ASSIGN(RenderViewHostImpl); |
710 }; | 723 }; |
711 | 724 |
712 #if defined(COMPILER_MSVC) | 725 #if defined(COMPILER_MSVC) |
713 #pragma warning(pop) | 726 #pragma warning(pop) |
714 #endif | 727 #endif |
715 | 728 |
716 } // namespace content | 729 } // namespace content |
717 | 730 |
718 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_IMPL_H_ | 731 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_IMPL_H_ |
OLD | NEW |