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

Unified Diff: content/browser/browser_plugin/test_guest_manager_delegate.cc

Issue 264943006: BrowserPlugin: Simplify content/public API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@guestview_manager_v1
Patch Set: Fixed nit Created 6 years, 7 months 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/browser_plugin/test_guest_manager_delegate.cc
diff --git a/content/browser/browser_plugin/test_guest_manager_delegate.cc b/content/browser/browser_plugin/test_guest_manager_delegate.cc
index 544e4dcf62ab89ef0924f90a47e0e2a460956f47..11d3b34af69550984af0c6fe2f75a2940e425f3e 100644
--- a/content/browser/browser_plugin/test_guest_manager_delegate.cc
+++ b/content/browser/browser_plugin/test_guest_manager_delegate.cc
@@ -43,26 +43,17 @@ void TestGuestManagerDelegate::RemoveGuest(
guest_web_contents_by_instance_id_.erase(it);
}
-WebContents* TestGuestManagerDelegate::GetGuestByInstanceID(
- int guest_instance_id,
- int embedder_render_process_id) {
+void TestGuestManagerDelegate::MaybeGetGuestByInstanceIDOrKill(
+ int guest_instance_id,
+ int embedder_render_process_id,
+ const GuestByInstanceIDCallback& callback) {
GuestInstanceMap::const_iterator it =
guest_web_contents_by_instance_id_.find(guest_instance_id);
- if (it == guest_web_contents_by_instance_id_.end())
- return NULL;
- return it->second;
-}
-
-bool TestGuestManagerDelegate::CanEmbedderAccessInstanceIDMaybeKill(
- int embedder_render_process_id,
- int guest_instance_id) {
- return true;
-}
-
-bool TestGuestManagerDelegate::CanEmbedderAccessInstanceID(
- int embedder_render_process_id,
- int guest_instance_id) {
- return true;
+ if (it == guest_web_contents_by_instance_id_.end()) {
+ callback.Run(NULL);
+ return;
+ }
+ callback.Run(it->second);
}
SiteInstance* TestGuestManagerDelegate::GetGuestSiteInstance(

Powered by Google App Engine
This is Rietveld 408576698