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

Side by Side Diff: chrome/browser/guest_view/guest_view_manager.h

Issue 261013005: BrowserPlugin: Move CreateGuest to chrome (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@guestview_manager_simplify_api
Patch Set: Created 6 years, 7 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 CHROME_BROWSER_GUEST_VIEW_GUEST_VIEW_MANAGER_H_ 5 #ifndef CHROME_BROWSER_GUEST_VIEW_GUEST_VIEW_MANAGER_H_
6 #define CHROME_BROWSER_GUEST_VIEW_GUEST_VIEW_MANAGER_H_ 6 #define CHROME_BROWSER_GUEST_VIEW_GUEST_VIEW_MANAGER_H_
7 7
8 #include <map> 8 #include <map>
9 9
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 21 matching lines...) Expand all
32 content::WebContents* GetGuestByInstanceIDSafely( 32 content::WebContents* GetGuestByInstanceIDSafely(
33 int guest_instance_id, 33 int guest_instance_id,
34 int embedder_render_process_id); 34 int embedder_render_process_id);
35 bool CanEmbedderAccessInstanceIDMaybeKill( 35 bool CanEmbedderAccessInstanceIDMaybeKill(
36 int embedder_render_process_id, 36 int embedder_render_process_id,
37 int guest_instance_id); 37 int guest_instance_id);
38 bool CanEmbedderAccessInstanceID(int embedder_render_process_id, 38 bool CanEmbedderAccessInstanceID(int embedder_render_process_id,
39 int guest_instance_id); 39 int guest_instance_id);
40 40
41 // BrowserPluginGuestManagerDelegate implementation. 41 // BrowserPluginGuestManagerDelegate implementation.
42 virtual content::WebContents* CreateGuest(
43 content::SiteInstance* embedder_site_instance,
44 int instance_id,
45 const content::StorageInfo& storage_info,
46 scoped_ptr<base::DictionaryValue> extra_params) OVERRIDE;
42 virtual int GetNextInstanceID() OVERRIDE; 47 virtual int GetNextInstanceID() OVERRIDE;
43 virtual void AddGuest(int guest_instance_id, 48 virtual void AddGuest(int guest_instance_id,
44 content::WebContents* guest_web_contents) OVERRIDE; 49 content::WebContents* guest_web_contents) OVERRIDE;
45 virtual void RemoveGuest(int guest_instance_id) OVERRIDE; 50 virtual void RemoveGuest(int guest_instance_id) OVERRIDE;
46 virtual void MaybeGetGuestByInstanceIDOrKill( 51 virtual void MaybeGetGuestByInstanceIDOrKill(
47 int guest_instance_id, 52 int guest_instance_id,
48 int embedder_render_process_id, 53 int embedder_render_process_id,
49 const GuestByInstanceIDCallback& callback) OVERRIDE; 54 const GuestByInstanceIDCallback& callback) OVERRIDE;
50 virtual content::SiteInstance* GetGuestSiteInstance(
51 const GURL& guest_site) OVERRIDE;
52 virtual bool ForEachGuest(content::WebContents* embedder_web_contents, 55 virtual bool ForEachGuest(content::WebContents* embedder_web_contents,
53 const GuestCallback& callback) OVERRIDE; 56 const GuestCallback& callback) OVERRIDE;
54 57
55 private: 58 private:
56 friend class GuestWebContentsObserver; 59 friend class GuestWebContentsObserver;
57 60
58 void AddRenderProcessHostID(int render_process_host_id); 61 void AddRenderProcessHostID(int render_process_host_id);
59 62
60 content::WebContents* GetGuestByInstanceID( 63 content::WebContents* GetGuestByInstanceID(
61 int guest_instance_id, 64 int guest_instance_id,
62 int embedder_render_process_id); 65 int embedder_render_process_id);
63 66
67 content::SiteInstance* GetGuestSiteInstance(
68 const GURL& guest_site);
69
64 static bool CanEmbedderAccessGuest(int embedder_render_process_id, 70 static bool CanEmbedderAccessGuest(int embedder_render_process_id,
65 GuestViewBase* guest); 71 GuestViewBase* guest);
66 72
67 // Counts RenderProcessHost IDs of GuestViewBases. 73 // Counts RenderProcessHost IDs of GuestViewBases.
68 std::multiset<int> render_process_host_id_multiset_; 74 std::multiset<int> render_process_host_id_multiset_;
69 75
70 // Contains guests' WebContents, mapping from their instance ids. 76 // Contains guests' WebContents, mapping from their instance ids.
71 typedef std::map<int, content::WebContents*> GuestInstanceMap; 77 typedef std::map<int, content::WebContents*> GuestInstanceMap;
72 GuestInstanceMap guest_web_contents_by_instance_id_; 78 GuestInstanceMap guest_web_contents_by_instance_id_;
73 79
74 int current_instance_id_; 80 int current_instance_id_;
75 content::BrowserContext* context_; 81 content::BrowserContext* context_;
76 82
77 DISALLOW_COPY_AND_ASSIGN(GuestViewManager); 83 DISALLOW_COPY_AND_ASSIGN(GuestViewManager);
78 }; 84 };
79 85
80 #endif // CHROME_BROWSER_GUEST_VIEW_GUEST_VIEW_MANAGER_H_ 86 #endif // CHROME_BROWSER_GUEST_VIEW_GUEST_VIEW_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698