Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 COMPONENTS_GUEST_VIEW_BROWSER_GUEST_VIEW_MANAGER_H_ | 5 #ifndef COMPONENTS_GUEST_VIEW_BROWSER_GUEST_VIEW_MANAGER_H_ |
| 6 #define COMPONENTS_GUEST_VIEW_BROWSER_GUEST_VIEW_MANAGER_H_ | 6 #define COMPONENTS_GUEST_VIEW_BROWSER_GUEST_VIEW_MANAGER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 55 } | 55 } |
| 56 // Returns the guest WebContents associated with the given |guest_instance_id| | 56 // Returns the guest WebContents associated with the given |guest_instance_id| |
| 57 // if the provided |embedder_render_process_id| is allowed to access it. | 57 // if the provided |embedder_render_process_id| is allowed to access it. |
| 58 // If the embedder is not allowed access, the embedder will be killed, and | 58 // If the embedder is not allowed access, the embedder will be killed, and |
| 59 // this method will return NULL. If no WebContents exists with the given | 59 // this method will return NULL. If no WebContents exists with the given |
| 60 // instance ID, then NULL will also be returned. | 60 // instance ID, then NULL will also be returned. |
| 61 content::WebContents* GetGuestByInstanceIDSafely( | 61 content::WebContents* GetGuestByInstanceIDSafely( |
| 62 int guest_instance_id, | 62 int guest_instance_id, |
| 63 int embedder_render_process_id); | 63 int embedder_render_process_id); |
| 64 | 64 |
| 65 // Associates the Browser Plugin with |element_instance_id| to a | 65 // Associates the Browser Plugin with |element_instance_id| to a guest that |
| 66 // guest that has ID of |guest_instance_id| and sets initialization | 66 // has ID of |guest_instance_id| and sets initialization parameters, |params| |
| 67 // parameters, |params| for it. | 67 // for it. |
| 68 void AttachGuest(int embedder_process_id, | 68 void AttachGuest(int embedder_process_id, |
| 69 int element_instance_id, | 69 int element_instance_id, |
| 70 int guest_instance_id, | 70 int guest_instance_id, |
| 71 const base::DictionaryValue& attach_params); | 71 const base::DictionaryValue& attach_params); |
| 72 | 72 |
| 73 // Removes the association between |element_instance_id| and a guest instance | 73 // Removes the association between |element_instance_id| and a guest instance |
| 74 // ID if one exists. | 74 // ID if one exists. |
| 75 void DetachGuest(GuestViewBase* guest); | 75 void DetachGuest(GuestViewBase* guest); |
| 76 | 76 |
| 77 // Indicates whether the |guest| is owned by an extension or Chrome App. | 77 // Indicates whether the |guest| is owned by an extension or Chrome App. |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 259 // This tracks which GuestView embedders are currently being observed. | 259 // This tracks which GuestView embedders are currently being observed. |
| 260 std::set<int> embedders_observed_; | 260 std::set<int> embedders_observed_; |
| 261 | 261 |
| 262 // |view_destruction_callback_map_| maps from embedder process ID to view ID | 262 // |view_destruction_callback_map_| maps from embedder process ID to view ID |
| 263 // to a vector of callback functions to be called when that view is destroyed. | 263 // to a vector of callback functions to be called when that view is destroyed. |
| 264 using Callbacks = std::vector<base::Closure>; | 264 using Callbacks = std::vector<base::Closure>; |
| 265 using CallbacksForEachViewID = std::map<int, Callbacks>; | 265 using CallbacksForEachViewID = std::map<int, Callbacks>; |
| 266 using CallbacksForEachEmbedderID = std::map<int, CallbacksForEachViewID>; | 266 using CallbacksForEachEmbedderID = std::map<int, CallbacksForEachViewID>; |
| 267 CallbacksForEachEmbedderID view_destruction_callback_map_; | 267 CallbacksForEachEmbedderID view_destruction_callback_map_; |
| 268 | 268 |
| 269 // The routing ID of the embedder which most recently sent an attach request. | |
| 270 // We use this value to later identify the RenderFrameHost and WebContents | |
| 271 // which embed the guest. This is mainly used for MimeHandlerViewGuest and | |
| 272 // specifically when the guest is embedded inside a cross origin frame. | |
| 273 int attaching_guest_embedder_routing_id_; | |
|
wjmaclean
2016/10/20 14:47:22
Where is this used?
EhsanK
2016/10/20 21:41:17
Stale. Thanks!
| |
| 274 | |
| 269 // This is used to ensure that an EmbedderRenderProcessHostObserver will not | 275 // This is used to ensure that an EmbedderRenderProcessHostObserver will not |
| 270 // call into this GuestViewManager after it has been destroyed. | 276 // call into this GuestViewManager after it has been destroyed. |
| 271 base::WeakPtrFactory<GuestViewManager> weak_ptr_factory_; | 277 base::WeakPtrFactory<GuestViewManager> weak_ptr_factory_; |
| 272 | 278 |
| 273 private: | 279 private: |
| 274 DISALLOW_COPY_AND_ASSIGN(GuestViewManager); | 280 DISALLOW_COPY_AND_ASSIGN(GuestViewManager); |
| 275 }; | 281 }; |
| 276 | 282 |
| 277 } // namespace guest_view | 283 } // namespace guest_view |
| 278 | 284 |
| 279 #endif // COMPONENTS_GUEST_VIEW_BROWSER_GUEST_VIEW_MANAGER_H_ | 285 #endif // COMPONENTS_GUEST_VIEW_BROWSER_GUEST_VIEW_MANAGER_H_ |
| OLD | NEW |