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

Side by Side Diff: extensions/browser/process_manager.cc

Issue 1129063011: Extract LazyBackgroundTaskQueue from ExtensionSystem. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased from master Created 5 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 unified diff | Download patch
« no previous file with comments | « extensions/browser/mock_extension_system.cc ('k') | extensions/extensions.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « extensions/browser/mock_extension_system.cc ('k') | extensions/extensions.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698