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 <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
429 return GetBackgroundHostForExtension(extension_id) == nullptr; | 429 return GetBackgroundHostForExtension(extension_id) == nullptr; |
430 } | 430 } |
431 | 431 |
432 bool ProcessManager::WakeEventPage(const std::string& extension_id, | 432 bool ProcessManager::WakeEventPage(const std::string& extension_id, |
433 const base::Callback<void(bool)>& callback) { | 433 const base::Callback<void(bool)>& callback) { |
434 if (GetBackgroundHostForExtension(extension_id)) { | 434 if (GetBackgroundHostForExtension(extension_id)) { |
435 // Run the callback immediately if the extension is already awake. | 435 // Run the callback immediately if the extension is already awake. |
436 return false; | 436 return false; |
437 } | 437 } |
438 LazyBackgroundTaskQueue* queue = | 438 LazyBackgroundTaskQueue* queue = |
439 ExtensionSystem::Get(browser_context_)->lazy_background_task_queue(); | 439 LazyBackgroundTaskQueue::Get(browser_context_); |
440 queue->AddPendingTask(browser_context_, extension_id, | 440 queue->AddPendingTask(browser_context_, extension_id, |
441 base::Bind(&PropagateExtensionWakeResult, callback)); | 441 base::Bind(&PropagateExtensionWakeResult, callback)); |
442 return true; | 442 return true; |
443 } | 443 } |
444 | 444 |
445 bool ProcessManager::IsBackgroundHostClosing(const std::string& extension_id) { | 445 bool ProcessManager::IsBackgroundHostClosing(const std::string& extension_id) { |
446 ExtensionHost* host = GetBackgroundHostForExtension(extension_id); | 446 ExtensionHost* host = GetBackgroundHostForExtension(extension_id); |
447 return (host && background_page_data_[extension_id].is_closing); | 447 return (host && background_page_data_[extension_id].is_closing); |
448 } | 448 } |
449 | 449 |
(...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
951 if (extension && !IncognitoInfo::IsSplitMode(extension)) { | 951 if (extension && !IncognitoInfo::IsSplitMode(extension)) { |
952 BrowserContext* original_context = | 952 BrowserContext* original_context = |
953 ExtensionsBrowserClient::Get()->GetOriginalContext(browser_context()); | 953 ExtensionsBrowserClient::Get()->GetOriginalContext(browser_context()); |
954 return ProcessManager::Get(original_context)->GetSiteInstanceForURL(url); | 954 return ProcessManager::Get(original_context)->GetSiteInstanceForURL(url); |
955 } | 955 } |
956 | 956 |
957 return ProcessManager::GetSiteInstanceForURL(url); | 957 return ProcessManager::GetSiteInstanceForURL(url); |
958 } | 958 } |
959 | 959 |
960 } // namespace extensions | 960 } // namespace extensions |
OLD | NEW |