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