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 #include "components/guest_view/browser/guest_view_manager.h" | 5 #include "components/guest_view/browser/guest_view_manager.h" |
| 6 | 6 |
| 7 #include <tuple> | 7 #include <tuple> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 456 // We might get some late arriving messages at tear down. Let's let the | 456 // We might get some late arriving messages at tear down. Let's let the |
| 457 // embedder tear down in peace. | 457 // embedder tear down in peace. |
| 458 auto it = guest_web_contents_by_instance_id_.find(guest_instance_id); | 458 auto it = guest_web_contents_by_instance_id_.find(guest_instance_id); |
| 459 if (it == guest_web_contents_by_instance_id_.end()) | 459 if (it == guest_web_contents_by_instance_id_.end()) |
| 460 return true; | 460 return true; |
| 461 | 461 |
| 462 auto* guest_view = GuestViewBase::FromWebContents(it->second); | 462 auto* guest_view = GuestViewBase::FromWebContents(it->second); |
| 463 if (!guest_view) | 463 if (!guest_view) |
| 464 return false; | 464 return false; |
| 465 | 465 |
| 466 if (guest_view->IsViewType("mimehandler")) { | |
| 467 // MimeHandlerViewGuests (PDF) may be embedded in a cross origin frame. | |
| 468 return embedder_render_process_id == | |
| 469 guest_view->GetEmbedderFrame()->GetProcess()->GetID(); | |
|
nasko
2016/10/27 21:03:40
Why shouldn't this always be the case? Why make it
EhsanK
2016/10/27 22:06:48
I think other guests are not supposed to be embedd
| |
| 470 } | |
| 471 | |
| 466 return embedder_render_process_id == | 472 return embedder_render_process_id == |
| 467 guest_view->owner_web_contents()->GetRenderProcessHost()->GetID(); | 473 guest_view->owner_web_contents()->GetRenderProcessHost()->GetID(); |
| 468 } | 474 } |
| 469 | 475 |
| 470 GuestViewManager::ElementInstanceKey::ElementInstanceKey() | 476 GuestViewManager::ElementInstanceKey::ElementInstanceKey() |
| 471 : embedder_process_id(content::ChildProcessHost::kInvalidUniqueID), | 477 : embedder_process_id(content::ChildProcessHost::kInvalidUniqueID), |
| 472 element_instance_id(content::ChildProcessHost::kInvalidUniqueID) { | 478 element_instance_id(content::ChildProcessHost::kInvalidUniqueID) { |
| 473 } | 479 } |
| 474 | 480 |
| 475 GuestViewManager::ElementInstanceKey::ElementInstanceKey( | 481 GuestViewManager::ElementInstanceKey::ElementInstanceKey( |
| 476 int embedder_process_id, | 482 int embedder_process_id, |
| 477 int element_instance_id) | 483 int element_instance_id) |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 495 const GuestViewCreateFunction& create_function, | 501 const GuestViewCreateFunction& create_function, |
| 496 const GuestViewCleanUpFunction& cleanup_function) | 502 const GuestViewCleanUpFunction& cleanup_function) |
| 497 : create_function(create_function), cleanup_function(cleanup_function) {} | 503 : create_function(create_function), cleanup_function(cleanup_function) {} |
| 498 | 504 |
| 499 GuestViewManager::GuestViewData::GuestViewData(const GuestViewData& other) = | 505 GuestViewManager::GuestViewData::GuestViewData(const GuestViewData& other) = |
| 500 default; | 506 default; |
| 501 | 507 |
| 502 GuestViewManager::GuestViewData::~GuestViewData() {} | 508 GuestViewManager::GuestViewData::~GuestViewData() {} |
| 503 | 509 |
| 504 } // namespace guest_view | 510 } // namespace guest_view |
| OLD | NEW |