Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(573)

Side by Side Diff: components/guest_view/browser/guest_view_manager.cc

Issue 2417693002: Allow MimeHandlerViewGuest be embedded inside OOPIFs (Closed)
Patch Set: Addressing lfg@ and nasko@ comments Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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")) {
Fady Samuel 2016/11/08 16:14:23 drive-by: This is a layering violation. components
EhsanK 2016/11/08 23:10:16 Done. I added a new method which explicitly asks i
467 // MimeHandlerViewGuests (PDF) may be embedded in a cross origin frame.
468 return embedder_render_process_id ==
469 guest_view->GetEmbedderFrame()->GetProcess()->GetID();
470 }
471
466 return embedder_render_process_id == 472 return embedder_render_process_id ==
Charlie Reis 2016/11/02 20:47:06 To the clarify the comment above, let's add: // Ot
EhsanK 2016/11/08 23:10:16 Thanks. I also changed "cross origin" to "cross pr
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698