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

Side by Side Diff: content/browser/browser_plugin/test_guest_manager.cc

Issue 306003002: Move guest lifetime management to chrome (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed content_browsertests crash Created 6 years, 6 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 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 "content/browser/browser_plugin/test_guest_manager.h" 5 #include "content/browser/browser_plugin/test_guest_manager.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/memory/singleton.h" 8 #include "base/memory/singleton.h"
9 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 embedder_site_instance->GetBrowserContext(), guest_site); 101 embedder_site_instance->GetBrowserContext(), guest_site);
102 } 102 }
103 WebContents::CreateParams create_params( 103 WebContents::CreateParams create_params(
104 embedder_site_instance->GetBrowserContext(), 104 embedder_site_instance->GetBrowserContext(),
105 guest_site_instance); 105 guest_site_instance);
106 create_params.guest_instance_id = instance_id; 106 create_params.guest_instance_id = instance_id;
107 create_params.guest_extra_params.reset(extra_params.release()); 107 create_params.guest_extra_params.reset(extra_params.release());
108 WebContentsImpl* guest_web_contents = static_cast<WebContentsImpl*>( 108 WebContentsImpl* guest_web_contents = static_cast<WebContentsImpl*>(
109 WebContents::Create(create_params)); 109 WebContents::Create(create_params));
110 BrowserPluginGuest* guest = guest_web_contents->GetBrowserPluginGuest(); 110 BrowserPluginGuest* guest = guest_web_contents->GetBrowserPluginGuest();
111 guest_web_contents->GetBrowserPluginGuest()->SetDelegate( 111 guest_web_contents->GetBrowserPluginGuest()->set_delegate(
112 new TestBrowserPluginGuestDelegate(guest)); 112 new TestBrowserPluginGuestDelegate(guest));
113 AddGuest(instance_id, guest_web_contents); 113 AddGuest(instance_id, guest_web_contents);
114 return guest_web_contents; 114 return guest_web_contents;
115 } 115 }
116 116
117 int TestGuestManager::GetNextInstanceID() { 117 int TestGuestManager::GetNextInstanceID() {
118 return ++next_instance_id_; 118 return ++next_instance_id_;
119 } 119 }
120 120
121 void TestGuestManager::AddGuest( 121 void TestGuestManager::AddGuest(
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 if (embedder_web_contents != guest->embedder_web_contents()) 174 if (embedder_web_contents != guest->embedder_web_contents())
175 continue; 175 continue;
176 176
177 if (callback.Run(guest_web_contents)) 177 if (callback.Run(guest_web_contents))
178 return true; 178 return true;
179 } 179 }
180 return false; 180 return false;
181 } 181 }
182 182
183 } // namespace content 183 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698