OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "extensions/browser/process_manager.h" | 5 #include "extensions/browser/process_manager.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
371 if (host->extension_id() == extension_id) | 371 if (host->extension_id() == extension_id) |
372 return host; | 372 return host; |
373 } | 373 } |
374 return NULL; | 374 return NULL; |
375 } | 375 } |
376 | 376 |
377 std::set<RenderViewHost*> ProcessManager::GetRenderViewHostsForExtension( | 377 std::set<RenderViewHost*> ProcessManager::GetRenderViewHostsForExtension( |
378 const std::string& extension_id) { | 378 const std::string& extension_id) { |
379 std::set<RenderViewHost*> result; | 379 std::set<RenderViewHost*> result; |
380 | 380 |
381 SiteInstance* site_instance = GetSiteInstanceForURL( | 381 scoped_refptr<SiteInstance> site_instance(GetSiteInstanceForURL( |
382 Extension::GetBaseURLFromExtensionId(extension_id)); | 382 Extension::GetBaseURLFromExtensionId(extension_id))); |
383 if (!site_instance) | 383 if (!site_instance.get()) |
384 return result; | 384 return result; |
385 | 385 |
386 // Gather up all the views for that site. | 386 // Gather up all the views for that site. |
387 for (ExtensionRenderViews::iterator view = all_extension_views_.begin(); | 387 for (ExtensionRenderViews::iterator view = all_extension_views_.begin(); |
388 view != all_extension_views_.end(); ++view) { | 388 view != all_extension_views_.end(); ++view) { |
389 if (view->first->GetSiteInstance() == site_instance) | 389 if (view->first->GetSiteInstance() == site_instance) |
390 result.insert(view->first); | 390 result.insert(view->first); |
391 } | 391 } |
392 | 392 |
393 return result; | 393 return result; |
(...skipping 639 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1033 if (extension && !IncognitoInfo::IsSplitMode(extension)) { | 1033 if (extension && !IncognitoInfo::IsSplitMode(extension)) { |
1034 BrowserContext* original_context = | 1034 BrowserContext* original_context = |
1035 ExtensionsBrowserClient::Get()->GetOriginalContext(GetBrowserContext()); | 1035 ExtensionsBrowserClient::Get()->GetOriginalContext(GetBrowserContext()); |
1036 return ProcessManager::Get(original_context)->GetSiteInstanceForURL(url); | 1036 return ProcessManager::Get(original_context)->GetSiteInstanceForURL(url); |
1037 } | 1037 } |
1038 | 1038 |
1039 return ProcessManager::GetSiteInstanceForURL(url); | 1039 return ProcessManager::GetSiteInstanceForURL(url); |
1040 } | 1040 } |
1041 | 1041 |
1042 } // namespace extensions | 1042 } // namespace extensions |
OLD | NEW |