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

Side by Side Diff: content/browser/web_contents/web_contents_impl.h

Issue 23841002: Create a new RenderFrameHost per child frame when --site-per-process is enabled. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: notify observers regardless of flag Created 7 years, 2 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 | Annotate | Revision Log
OLDNEW
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_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ 5 #ifndef CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_
6 #define CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ 6 #define CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_
7 7
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
11 11
12 #include "base/compiler_specific.h" 12 #include "base/compiler_specific.h"
13 #include "base/gtest_prod_util.h" 13 #include "base/gtest_prod_util.h"
14 #include "base/memory/scoped_ptr.h" 14 #include "base/memory/scoped_ptr.h"
15 #include "base/observer_list.h" 15 #include "base/observer_list.h"
16 #include "base/process/process.h" 16 #include "base/process/process.h"
17 #include "base/values.h" 17 #include "base/values.h"
18 #include "content/browser/renderer_host/frame_tree.h"
18 #include "content/browser/renderer_host/render_view_host_delegate.h" 19 #include "content/browser/renderer_host/render_view_host_delegate.h"
19 #include "content/browser/renderer_host/render_widget_host_delegate.h" 20 #include "content/browser/renderer_host/render_widget_host_delegate.h"
20 #include "content/browser/web_contents/frame_tree_node.h"
21 #include "content/browser/web_contents/navigation_controller_impl.h" 21 #include "content/browser/web_contents/navigation_controller_impl.h"
22 #include "content/browser/web_contents/render_view_host_manager.h" 22 #include "content/browser/web_contents/render_view_host_manager.h"
23 #include "content/common/content_export.h" 23 #include "content/common/content_export.h"
24 #include "content/public/browser/notification_observer.h" 24 #include "content/public/browser/notification_observer.h"
25 #include "content/public/browser/notification_registrar.h" 25 #include "content/public/browser/notification_registrar.h"
26 #include "content/public/browser/web_contents.h" 26 #include "content/public/browser/web_contents.h"
27 #include "content/public/common/renderer_preferences.h" 27 #include "content/public/common/renderer_preferences.h"
28 #include "content/public/common/three_d_api_types.h" 28 #include "content/public/common/three_d_api_types.h"
29 #include "net/base/load_states.h" 29 #include "net/base/load_states.h"
30 #include "third_party/WebKit/public/web/WebDragOperation.h" 30 #include "third_party/WebKit/public/web/WebDragOperation.h"
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 // Informs the render view host and the BrowserPluginEmbedder, if present, of 196 // Informs the render view host and the BrowserPluginEmbedder, if present, of
197 // a Drag Source End. 197 // a Drag Source End.
198 void DragSourceEndedAt(int client_x, int client_y, int screen_x, 198 void DragSourceEndedAt(int client_x, int client_y, int screen_x,
199 int screen_y, WebKit::WebDragOperation operation); 199 int screen_y, WebKit::WebDragOperation operation);
200 200
201 // Informs the render view host and the BrowserPluginEmbedder, if present, of 201 // Informs the render view host and the BrowserPluginEmbedder, if present, of
202 // a Drag Source Move. 202 // a Drag Source Move.
203 void DragSourceMovedTo(int client_x, int client_y, 203 void DragSourceMovedTo(int client_x, int client_y,
204 int screen_x, int screen_y); 204 int screen_x, int screen_y);
205 205
206 FrameTreeNode* GetFrameTreeRootForTesting() {
207 return frame_tree_root_.get();
208 }
209
210 // WebContents ------------------------------------------------------ 206 // WebContents ------------------------------------------------------
211 virtual WebContentsDelegate* GetDelegate() OVERRIDE; 207 virtual WebContentsDelegate* GetDelegate() OVERRIDE;
212 virtual void SetDelegate(WebContentsDelegate* delegate) OVERRIDE; 208 virtual void SetDelegate(WebContentsDelegate* delegate) OVERRIDE;
213 virtual NavigationControllerImpl& GetController() OVERRIDE; 209 virtual NavigationControllerImpl& GetController() OVERRIDE;
214 virtual const NavigationControllerImpl& GetController() const OVERRIDE; 210 virtual const NavigationControllerImpl& GetController() const OVERRIDE;
215 virtual BrowserContext* GetBrowserContext() const OVERRIDE; 211 virtual BrowserContext* GetBrowserContext() const OVERRIDE;
216 virtual RenderProcessHost* GetRenderProcessHost() const OVERRIDE; 212 virtual RenderProcessHost* GetRenderProcessHost() const OVERRIDE;
217 virtual RenderViewHost* GetRenderViewHost() const OVERRIDE; 213 virtual RenderViewHost* GetRenderViewHost() const OVERRIDE;
218 virtual void GetRenderViewHostAtPosition( 214 virtual void GetRenderViewHostAtPosition(
219 int x, 215 int x,
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
459 bool user_gesture) OVERRIDE; 455 bool user_gesture) OVERRIDE;
460 virtual void ShowCreatedWidget(int route_id, 456 virtual void ShowCreatedWidget(int route_id,
461 const gfx::Rect& initial_pos) OVERRIDE; 457 const gfx::Rect& initial_pos) OVERRIDE;
462 virtual void ShowCreatedFullscreenWidget(int route_id) OVERRIDE; 458 virtual void ShowCreatedFullscreenWidget(int route_id) OVERRIDE;
463 virtual void ShowContextMenu(const ContextMenuParams& params) OVERRIDE; 459 virtual void ShowContextMenu(const ContextMenuParams& params) OVERRIDE;
464 virtual void RequestMediaAccessPermission( 460 virtual void RequestMediaAccessPermission(
465 const MediaStreamRequest& request, 461 const MediaStreamRequest& request,
466 const MediaResponseCallback& callback) OVERRIDE; 462 const MediaResponseCallback& callback) OVERRIDE;
467 virtual SessionStorageNamespace* GetSessionStorageNamespace( 463 virtual SessionStorageNamespace* GetSessionStorageNamespace(
468 SiteInstance* instance) OVERRIDE; 464 SiteInstance* instance) OVERRIDE;
465 virtual FrameTree* GetFrameTree() OVERRIDE;
469 466
470 // RenderWidgetHostDelegate -------------------------------------------------- 467 // RenderWidgetHostDelegate --------------------------------------------------
471 468
472 virtual void RenderWidgetDeleted( 469 virtual void RenderWidgetDeleted(
473 RenderWidgetHostImpl* render_widget_host) OVERRIDE; 470 RenderWidgetHostImpl* render_widget_host) OVERRIDE;
474 virtual bool PreHandleKeyboardEvent( 471 virtual bool PreHandleKeyboardEvent(
475 const NativeWebKeyboardEvent& event, 472 const NativeWebKeyboardEvent& event,
476 bool* is_keyboard_shortcut) OVERRIDE; 473 bool* is_keyboard_shortcut) OVERRIDE;
477 virtual void HandleKeyboardEvent( 474 virtual void HandleKeyboardEvent(
478 const NativeWebKeyboardEvent& event) OVERRIDE; 475 const NativeWebKeyboardEvent& event) OVERRIDE;
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
629 const GURL& url, 626 const GURL& url,
630 const base::FilePath& plugin_path); 627 const base::FilePath& plugin_path);
631 void OnBrowserPluginMessage(const IPC::Message& message); 628 void OnBrowserPluginMessage(const IPC::Message& message);
632 void OnDidDownloadImage(int id, 629 void OnDidDownloadImage(int id,
633 int http_status_code, 630 int http_status_code,
634 const GURL& image_url, 631 const GURL& image_url,
635 const std::vector<SkBitmap>& bitmaps, 632 const std::vector<SkBitmap>& bitmaps,
636 const std::vector<gfx::Size>& original_bitmap_sizes); 633 const std::vector<gfx::Size>& original_bitmap_sizes);
637 void OnUpdateFaviconURL(int32 page_id, 634 void OnUpdateFaviconURL(int32 page_id,
638 const std::vector<FaviconURL>& candidates); 635 const std::vector<FaviconURL>& candidates);
639 void OnFrameAttached(int64 parent_frame_id,
640 int64 frame_id,
641 const std::string& frame_name);
642 void OnFrameDetached(int64 parent_frame_id, int64 frame_id);
643 636
644 void OnMediaNotification(int64 player_cookie, 637 void OnMediaNotification(int64 player_cookie,
645 bool has_video, 638 bool has_video,
646 bool has_audio, 639 bool has_audio,
647 bool is_playing); 640 bool is_playing);
648 641
649 // Changes the IsLoading state and notifies delegate as needed 642 // Changes the IsLoading state and notifies delegate as needed
650 // |details| is used to provide details on the load that just finished 643 // |details| is used to provide details on the load that just finished
651 // (but can be null if not applicable). Can be overridden. 644 // (but can be null if not applicable). Can be overridden.
652 void SetIsLoading(bool is_loading, 645 void SetIsLoading(bool is_loading,
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
745 738
746 // Helper functions for sending notifications. 739 // Helper functions for sending notifications.
747 void NotifySwapped(RenderViewHost* old_render_view_host); 740 void NotifySwapped(RenderViewHost* old_render_view_host);
748 void NotifyDisconnected(); 741 void NotifyDisconnected();
749 void NotifyNavigationEntryCommitted(const LoadCommittedDetails& load_details); 742 void NotifyNavigationEntryCommitted(const LoadCommittedDetails& load_details);
750 743
751 void SetEncoding(const std::string& encoding); 744 void SetEncoding(const std::string& encoding);
752 745
753 RenderViewHostImpl* GetRenderViewHostImpl(); 746 RenderViewHostImpl* GetRenderViewHostImpl();
754 747
755 FrameTreeNode* FindFrameTreeNodeByID(int64 frame_id);
756
757 // Removes browser plugin embedder if there is one. 748 // Removes browser plugin embedder if there is one.
758 void RemoveBrowserPluginEmbedder(); 749 void RemoveBrowserPluginEmbedder();
759 750
760 // Clear |render_view_host|'s PowerSaveBlockers. 751 // Clear |render_view_host|'s PowerSaveBlockers.
761 void ClearPowerSaveBlockers(RenderViewHost* render_view_host); 752 void ClearPowerSaveBlockers(RenderViewHost* render_view_host);
762 753
763 // Clear all PowerSaveBlockers, leave power_save_blocker_ empty. 754 // Clear all PowerSaveBlockers, leave power_save_blocker_ empty.
764 void ClearAllPowerSaveBlockers(); 755 void ClearAllPowerSaveBlockers();
765 756
766 // Helper function to invoke WebContentsDelegate::GetSizeForNewRenderView(). 757 // Helper function to invoke WebContentsDelegate::GetSizeForNewRenderView().
767 gfx::Size GetSizeForNewRenderView() const; 758 gfx::Size GetSizeForNewRenderView() const;
768 759
760 void OnFrameRemoved(int64 frame_id);
761
769 // Data for core operation --------------------------------------------------- 762 // Data for core operation ---------------------------------------------------
770 763
771 // Delegate for notifying our owner about stuff. Not owned by us. 764 // Delegate for notifying our owner about stuff. Not owned by us.
772 WebContentsDelegate* delegate_; 765 WebContentsDelegate* delegate_;
773 766
774 // Handles the back/forward list and loading. 767 // Handles the back/forward list and loading.
775 NavigationControllerImpl controller_; 768 NavigationControllerImpl controller_;
776 769
777 // The corresponding view. 770 // The corresponding view.
778 scoped_ptr<WebContentsViewPort> view_; 771 scoped_ptr<WebContentsViewPort> view_;
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
814 // Maps the RenderViewHost to its media_player_cookie and PowerSaveBlocker 807 // Maps the RenderViewHost to its media_player_cookie and PowerSaveBlocker
815 // pairs. Key is the RenderViewHost, value is the map which maps player_cookie 808 // pairs. Key is the RenderViewHost, value is the map which maps player_cookie
816 // on to PowerSaveBlocker. 809 // on to PowerSaveBlocker.
817 typedef std::map<RenderViewHost*, std::map<int64, PowerSaveBlocker*> > 810 typedef std::map<RenderViewHost*, std::map<int64, PowerSaveBlocker*> >
818 PowerSaveBlockerMap; 811 PowerSaveBlockerMap;
819 PowerSaveBlockerMap power_save_blockers_; 812 PowerSaveBlockerMap power_save_blockers_;
820 813
821 // Manages creation and swapping of render views. 814 // Manages creation and swapping of render views.
822 RenderViewHostManager render_manager_; 815 RenderViewHostManager render_manager_;
823 816
817 // The frame tree structure of the current page.
818 FrameTree frame_tree_;
819
824 #if defined(OS_ANDROID) 820 #if defined(OS_ANDROID)
825 // Manages injecting Java objects into all RenderViewHosts associated with 821 // Manages injecting Java objects into all RenderViewHosts associated with
826 // this WebContentsImpl. 822 // this WebContentsImpl.
827 scoped_ptr<JavaBridgeDispatcherHostManager> 823 scoped_ptr<JavaBridgeDispatcherHostManager>
828 java_bridge_dispatcher_host_manager_; 824 java_bridge_dispatcher_host_manager_;
829 #endif 825 #endif
830 826
831 // SavePackage, lazily created. 827 // SavePackage, lazily created.
832 scoped_refptr<SavePackage> save_package_; 828 scoped_refptr<SavePackage> save_package_;
833 829
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
869 // When a navigation occurs, we record its contents MIME type. It can be 865 // When a navigation occurs, we record its contents MIME type. It can be
870 // used to check whether we can do something for some special contents. 866 // used to check whether we can do something for some special contents.
871 std::string contents_mime_type_; 867 std::string contents_mime_type_;
872 868
873 // Character encoding. 869 // Character encoding.
874 std::string encoding_; 870 std::string encoding_;
875 871
876 // True if this is a secure page which displayed insecure content. 872 // True if this is a secure page which displayed insecure content.
877 bool displayed_insecure_content_; 873 bool displayed_insecure_content_;
878 874
879 // The frame tree structure of the current page.
880 scoped_ptr<FrameTreeNode> frame_tree_root_;
881
882 // Data for misc internal state ---------------------------------------------- 875 // Data for misc internal state ----------------------------------------------
883 876
884 // When > 0, the WebContents is currently being captured (e.g., for 877 // When > 0, the WebContents is currently being captured (e.g., for
885 // screenshots or mirroring); and the underlying RenderWidgetHost should not 878 // screenshots or mirroring); and the underlying RenderWidgetHost should not
886 // be told it is hidden. 879 // be told it is hidden.
887 int capturer_count_; 880 int capturer_count_;
888 881
889 // Tracks whether RWHV should be visible once capturer_count_ becomes zero. 882 // Tracks whether RWHV should be visible once capturer_count_ becomes zero.
890 bool should_normally_be_visible_; 883 bool should_normally_be_visible_;
891 884
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
970 // Maps the ids of pending image downloads to their callbacks 963 // Maps the ids of pending image downloads to their callbacks
971 typedef std::map<int, ImageDownloadCallback> ImageDownloadMap; 964 typedef std::map<int, ImageDownloadCallback> ImageDownloadMap;
972 ImageDownloadMap image_download_map_; 965 ImageDownloadMap image_download_map_;
973 966
974 DISALLOW_COPY_AND_ASSIGN(WebContentsImpl); 967 DISALLOW_COPY_AND_ASSIGN(WebContentsImpl);
975 }; 968 };
976 969
977 } // namespace content 970 } // namespace content
978 971
979 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ 972 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_
OLDNEW
« no previous file with comments | « content/browser/web_contents/render_view_host_manager.cc ('k') | content/browser/web_contents/web_contents_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698