| 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 #include "extensions/browser/guest_view/guest_view_manager.h" | 5 #include "extensions/browser/guest_view/guest_view_manager.h" |
| 6 | 6 |
| 7 #include "base/strings/stringprintf.h" | 7 #include "base/strings/stringprintf.h" |
| 8 #include "content/public/browser/browser_context.h" | 8 #include "content/public/browser/browser_context.h" |
| 9 #include "content/public/browser/render_frame_host.h" | 9 #include "content/public/browser/render_frame_host.h" |
| 10 #include "content/public/browser/render_process_host.h" | 10 #include "content/public/browser/render_process_host.h" |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 content::WebContents* GuestViewManager::GetGuestByInstanceIDSafely( | 69 content::WebContents* GuestViewManager::GetGuestByInstanceIDSafely( |
| 70 int guest_instance_id, | 70 int guest_instance_id, |
| 71 int embedder_render_process_id) { | 71 int embedder_render_process_id) { |
| 72 if (!CanEmbedderAccessInstanceIDMaybeKill(embedder_render_process_id, | 72 if (!CanEmbedderAccessInstanceIDMaybeKill(embedder_render_process_id, |
| 73 guest_instance_id)) { | 73 guest_instance_id)) { |
| 74 return nullptr; | 74 return nullptr; |
| 75 } | 75 } |
| 76 return GetGuestByInstanceID(guest_instance_id); | 76 return GetGuestByInstanceID(guest_instance_id); |
| 77 } | 77 } |
| 78 | 78 |
| 79 content::WebContents* GuestViewManager::GetGuestByInstanceIDHack( |
| 80 int guest_instance_id) { |
| 81 return GetGuestByInstanceID(guest_instance_id); |
| 82 } |
| 83 |
| 79 void GuestViewManager::AttachGuest(int embedder_process_id, | 84 void GuestViewManager::AttachGuest(int embedder_process_id, |
| 80 int element_instance_id, | 85 int element_instance_id, |
| 81 int guest_instance_id, | 86 int guest_instance_id, |
| 82 const base::DictionaryValue& attach_params) { | 87 const base::DictionaryValue& attach_params) { |
| 83 auto guest_view = GuestViewBase::From(embedder_process_id, guest_instance_id); | 88 auto guest_view = GuestViewBase::From(embedder_process_id, guest_instance_id); |
| 84 if (!guest_view) | 89 if (!guest_view) |
| 85 return; | 90 return; |
| 86 | 91 |
| 87 ElementInstanceKey key(embedder_process_id, element_instance_id); | 92 ElementInstanceKey key(embedder_process_id, element_instance_id); |
| 88 auto it = instance_id_map_.find(key); | 93 auto it = instance_id_map_.find(key); |
| (...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 366 return element_instance_id < other.element_instance_id; | 371 return element_instance_id < other.element_instance_id; |
| 367 } | 372 } |
| 368 | 373 |
| 369 bool GuestViewManager::ElementInstanceKey::operator==( | 374 bool GuestViewManager::ElementInstanceKey::operator==( |
| 370 const GuestViewManager::ElementInstanceKey& other) const { | 375 const GuestViewManager::ElementInstanceKey& other) const { |
| 371 return (embedder_process_id == other.embedder_process_id) && | 376 return (embedder_process_id == other.embedder_process_id) && |
| 372 (element_instance_id == other.element_instance_id); | 377 (element_instance_id == other.element_instance_id); |
| 373 } | 378 } |
| 374 | 379 |
| 375 } // namespace extensions | 380 } // namespace extensions |
| OLD | NEW |