Index: chrome/browser/guest_view/guest_view_manager.cc |
diff --git a/chrome/browser/guest_view/guest_view_manager.cc b/chrome/browser/guest_view/guest_view_manager.cc |
index 1e07de105f5ddc1d603123133d849f51eaef1862..b993e86aed3e3760c147ac38d818e3f297f63ecf 100644 |
--- a/chrome/browser/guest_view/guest_view_manager.cc |
+++ b/chrome/browser/guest_view/guest_view_manager.cc |
@@ -97,13 +97,33 @@ void GuestViewManager::RemoveGuest(int guest_instance_id) { |
guest_web_contents_by_instance_id_.erase(it); |
} |
-content::WebContents* GuestViewManager::GetGuestByInstanceID( |
+void GuestViewManager::MaybeGetGuestByInstanceIDOrKill( |
+ int guest_instance_id, |
+ int embedder_render_process_id, |
+ const GuestByInstanceIDCallback& callback) { |
+ if (!CanEmbedderAccessInstanceIDMaybeKill(embedder_render_process_id, |
+ guest_instance_id)) { |
+ // If we kill the embedder, then don't bother calling back. |
+ return; |
+ } |
+ content::WebContents* guest_web_contents = |
+ GetGuestByInstanceID(guest_instance_id, embedder_render_process_id); |
+ callback.Run(guest_web_contents); |
+} |
+ |
+content::WebContents* GuestViewManager::GetGuestByInstanceIDSafely( |
int guest_instance_id, |
int embedder_render_process_id) { |
if (!CanEmbedderAccessInstanceIDMaybeKill(embedder_render_process_id, |
guest_instance_id)) { |
return NULL; |
} |
+ return GetGuestByInstanceID(guest_instance_id, embedder_render_process_id); |
+} |
+ |
+content::WebContents* GuestViewManager::GetGuestByInstanceID( |
lazyboy
2014/05/01 23:27:58
Rearrange placement of this function so it matches
Fady Samuel
2014/05/06 16:51:36
Done.
|
+ int guest_instance_id, |
+ int embedder_render_process_id) { |
GuestInstanceMap::const_iterator it = |
guest_web_contents_by_instance_id_.find(guest_instance_id); |
if (it == guest_web_contents_by_instance_id_.end()) |