Commit 641e3ce0 authored by David Bertoni's avatar David Bertoni Committed by Commit Bot

[Extensions] Remove most references to LazyBackgroundTaskQueue.

This CL is part of the effort to unify the LazyBackgroundTaskQueue and the ServiceWorkerTaskQueue.

Bug: 915814
TBR: dmazzoni@chromium.org (Removed a header file in accessibility_extension_api.cc)
Change-Id: I067bc70b4ed047a0466d70b7d976e01806e7bf98
Reviewed-on: https://chromium-review.googlesource.com/c/1404577
Commit-Queue: David Bertoni <dbertoni@chromium.org>
Reviewed-by: default avatarBen Wells <benwells@chromium.org>
Reviewed-by: default avatarAnand Mistry <amistry@chromium.org>
Reviewed-by: default avatarLuke Halliwell <halliwell@chromium.org>
Reviewed-by: default avatarIstiaque Ahmed <lazyboy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#622127}
parent e1a6276a
...@@ -34,8 +34,8 @@ ...@@ -34,8 +34,8 @@
#include "extensions/browser/extension_prefs.h" #include "extensions/browser/extension_prefs.h"
#include "extensions/browser/extension_registry.h" #include "extensions/browser/extension_registry.h"
#include "extensions/browser/granted_file_entry.h" #include "extensions/browser/granted_file_entry.h"
#include "extensions/browser/lazy_background_task_queue.h"
#include "extensions/browser/lazy_context_id.h" #include "extensions/browser/lazy_context_id.h"
#include "extensions/browser/lazy_context_task_queue.h"
#include "extensions/browser/process_manager.h" #include "extensions/browser/process_manager.h"
#include "extensions/common/api/app_runtime.h" #include "extensions/common/api/app_runtime.h"
#include "extensions/common/extension.h" #include "extensions/common/extension.h"
...@@ -290,11 +290,11 @@ class PlatformAppPathLauncher ...@@ -290,11 +290,11 @@ class PlatformAppPathLauncher
// available, or it might be in the process of being unloaded, in which case // available, or it might be in the process of being unloaded, in which case
// the lazy background task queue is used to load the extension and then // the lazy background task queue is used to load the extension and then
// call back to us. // call back to us.
extensions::LazyBackgroundTaskQueue* const queue = const extensions::LazyContextId context_id(context_, extension_id);
extensions::LazyBackgroundTaskQueue::Get(context_); extensions::LazyContextTaskQueue* const queue = context_id.GetTaskQueue();
if (queue->ShouldEnqueueTask(context_, app)) { if (queue->ShouldEnqueueTask(context_, app)) {
queue->AddPendingTask( queue->AddPendingTask(
extensions::LazyContextId(context_, extension_id), context_id,
base::Bind(&PlatformAppPathLauncher::GrantAccessToFilesAndLaunch, base::Bind(&PlatformAppPathLauncher::GrantAccessToFilesAndLaunch,
this)); this));
return; return;
......
...@@ -27,7 +27,6 @@ ...@@ -27,7 +27,6 @@
#include "content/public/common/service_manager_connection.h" #include "content/public/common/service_manager_connection.h"
#include "extensions/browser/event_router.h" #include "extensions/browser/event_router.h"
#include "extensions/browser/extension_system.h" #include "extensions/browser/extension_system.h"
#include "extensions/browser/lazy_background_task_queue.h"
#include "extensions/common/error_utils.h" #include "extensions/common/error_utils.h"
#include "extensions/common/image_util.h" #include "extensions/common/image_util.h"
#include "extensions/common/manifest_handlers/background_info.h" #include "extensions/common/manifest_handlers/background_info.h"
......
...@@ -37,8 +37,8 @@ ...@@ -37,8 +37,8 @@
#include "extensions/browser/extension_host.h" #include "extensions/browser/extension_host.h"
#include "extensions/browser/extension_registry.h" #include "extensions/browser/extension_registry.h"
#include "extensions/browser/extension_util.h" #include "extensions/browser/extension_util.h"
#include "extensions/browser/lazy_background_task_queue.h"
#include "extensions/browser/lazy_context_id.h" #include "extensions/browser/lazy_context_id.h"
#include "extensions/browser/lazy_context_task_queue.h"
#include "extensions/common/extension_set.h" #include "extensions/common/extension_set.h"
#include "extensions/common/manifest_handlers/background_info.h" #include "extensions/common/manifest_handlers/background_info.h"
#include "extensions/common/url_pattern.h" #include "extensions/common/url_pattern.h"
...@@ -350,14 +350,14 @@ void FileBrowserHandlerExecutor::ExecuteFileActionsOnUIThread( ...@@ -350,14 +350,14 @@ void FileBrowserHandlerExecutor::ExecuteFileActionsOnUIThread(
handler_pid, nullptr); handler_pid, nullptr);
} else { } else {
// We have to wake the handler background page before we proceed. // We have to wake the handler background page before we proceed.
extensions::LazyBackgroundTaskQueue* queue = const extensions::LazyContextId context_id(profile_, extension_->id());
extensions::LazyBackgroundTaskQueue::Get(profile_); extensions::LazyContextTaskQueue* queue = context_id.GetTaskQueue();
if (!queue->ShouldEnqueueTask(profile_, extension_.get())) { if (!queue->ShouldEnqueueTask(profile_, extension_.get())) {
ExecuteDoneOnUIThread(false); ExecuteDoneOnUIThread(false);
return; return;
} }
queue->AddPendingTask( queue->AddPendingTask(
extensions::LazyContextId(profile_, extension_->id()), context_id,
base::BindOnce( base::BindOnce(
&FileBrowserHandlerExecutor::SetupPermissionsAndDispatchEvent, &FileBrowserHandlerExecutor::SetupPermissionsAndDispatchEvent,
weak_ptr_factory_.GetWeakPtr(), weak_ptr_factory_.GetWeakPtr(),
......
...@@ -7,8 +7,8 @@ ...@@ -7,8 +7,8 @@
#include "chrome/browser/devtools/devtools_window.h" #include "chrome/browser/devtools/devtools_window.h"
#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile.h"
#include "extensions/browser/extension_host.h" #include "extensions/browser/extension_host.h"
#include "extensions/browser/lazy_background_task_queue.h"
#include "extensions/browser/lazy_context_id.h" #include "extensions/browser/lazy_context_id.h"
#include "extensions/browser/lazy_context_task_queue.h"
#include "extensions/browser/process_manager.h" #include "extensions/browser/process_manager.h"
#include "extensions/common/extension.h" #include "extensions/common/extension.h"
...@@ -34,9 +34,9 @@ void InspectBackgroundPage(const Extension* extension, Profile* profile) { ...@@ -34,9 +34,9 @@ void InspectBackgroundPage(const Extension* extension, Profile* profile) {
InspectExtensionHost( InspectExtensionHost(
std::make_unique<LazyContextTaskQueue::ContextInfo>(host)); std::make_unique<LazyContextTaskQueue::ContextInfo>(host));
} else { } else {
LazyBackgroundTaskQueue::Get(profile)->AddPendingTask( const LazyContextId context_id(profile, extension->id());
LazyContextId(profile, extension->id()), context_id.GetTaskQueue()->AddPendingTask(
base::BindOnce(&InspectExtensionHost)); context_id, base::BindOnce(&InspectExtensionHost));
} }
} }
......
...@@ -23,7 +23,6 @@ ...@@ -23,7 +23,6 @@
#include "extensions/browser/extension_prefs.h" #include "extensions/browser/extension_prefs.h"
#include "extensions/browser/extension_registry.h" #include "extensions/browser/extension_registry.h"
#include "extensions/browser/info_map.h" #include "extensions/browser/info_map.h"
#include "extensions/browser/lazy_background_task_queue.h"
#include "extensions/browser/notification_types.h" #include "extensions/browser/notification_types.h"
#include "extensions/browser/null_app_sorting.h" #include "extensions/browser/null_app_sorting.h"
#include "extensions/browser/process_manager.h" #include "extensions/browser/process_manager.h"
......
...@@ -38,8 +38,6 @@ ...@@ -38,8 +38,6 @@
#include "extensions/browser/extension_web_contents_observer.h" #include "extensions/browser/extension_web_contents_observer.h"
#include "extensions/browser/extensions_browser_client.h" #include "extensions/browser/extensions_browser_client.h"
#include "extensions/browser/guest_view/web_view/web_view_guest.h" #include "extensions/browser/guest_view/web_view/web_view_guest.h"
#include "extensions/browser/lazy_background_task_queue.h"
#include "extensions/browser/lazy_context_id.h"
#include "extensions/browser/process_manager.h" #include "extensions/browser/process_manager.h"
#include "extensions/common/extension.h" #include "extensions/common/extension.h"
#include "extensions/common/manifest_constants.h" #include "extensions/common/manifest_constants.h"
...@@ -162,7 +160,6 @@ static content::RenderProcessHost* GetExtensionProcess( ...@@ -162,7 +160,6 @@ static content::RenderProcessHost* GetExtensionProcess(
MessageService::MessageService(BrowserContext* context) MessageService::MessageService(BrowserContext* context)
: messaging_delegate_(ExtensionsAPIClient::Get()->GetMessagingDelegate()), : messaging_delegate_(ExtensionsAPIClient::Get()->GetMessagingDelegate()),
lazy_background_task_queue_(LazyBackgroundTaskQueue::Get(context)),
weak_factory_(this) { weak_factory_(this) {
DCHECK_CURRENTLY_ON(BrowserThread::UI); DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK_NE(nullptr, messaging_delegate_); DCHECK_NE(nullptr, messaging_delegate_);
...@@ -635,9 +632,10 @@ void MessageService::ClosePortImpl(const PortId& port_id, ...@@ -635,9 +632,10 @@ void MessageService::ClosePortImpl(const PortId& port_id,
if (it == channels_.end()) { if (it == channels_.end()) {
auto pending = pending_lazy_background_page_channels_.find(channel_id); auto pending = pending_lazy_background_page_channels_.find(channel_id);
if (pending != pending_lazy_background_page_channels_.end()) { if (pending != pending_lazy_background_page_channels_.end()) {
lazy_background_task_queue_->AddPendingTask( const LazyContextId context_id(pending->second.browser_context(),
LazyContextId(pending->second.browser_context(), pending->second.extension_id());
pending->second.extension_id()), context_id.GetTaskQueue()->AddPendingTask(
context_id,
base::BindOnce(&MessageService::PendingLazyBackgroundPageClosePort, base::BindOnce(&MessageService::PendingLazyBackgroundPageClosePort,
weak_factory_.GetWeakPtr(), port_id, process_id, weak_factory_.GetWeakPtr(), port_id, process_id,
routing_id, force_close, error_message)); routing_id, force_close, error_message));
...@@ -736,9 +734,10 @@ void MessageService::EnqueuePendingMessageForLazyBackgroundLoad( ...@@ -736,9 +734,10 @@ void MessageService::EnqueuePendingMessageForLazyBackgroundLoad(
auto pending = pending_lazy_background_page_channels_.find(channel_id); auto pending = pending_lazy_background_page_channels_.find(channel_id);
if (pending != pending_lazy_background_page_channels_.end()) { if (pending != pending_lazy_background_page_channels_.end()) {
lazy_background_task_queue_->AddPendingTask( const LazyContextId context_id(pending->second.browser_context(),
LazyContextId(pending->second.browser_context(), pending->second.extension_id());
pending->second.extension_id()), context_id.GetTaskQueue()->AddPendingTask(
context_id,
base::BindOnce(&MessageService::PendingLazyBackgroundPagePostMessage, base::BindOnce(&MessageService::PendingLazyBackgroundPagePostMessage,
weak_factory_.GetWeakPtr(), source_port_id, message)); weak_factory_.GetWeakPtr(), source_port_id, message));
} }
...@@ -772,15 +771,17 @@ bool MessageService::MaybeAddPendingLazyBackgroundPageOpenChannelTask( ...@@ -772,15 +771,17 @@ bool MessageService::MaybeAddPendingLazyBackgroundPageOpenChannelTask(
if (!IncognitoInfo::IsSplitMode(extension)) if (!IncognitoInfo::IsSplitMode(extension))
context = ExtensionsBrowserClient::Get()->GetOriginalContext(context); context = ExtensionsBrowserClient::Get()->GetOriginalContext(context);
if (!lazy_background_task_queue_->ShouldEnqueueTask(context, extension)) const LazyContextId context_id(context, extension->id());
LazyContextTaskQueue* task_queue = context_id.GetTaskQueue();
if (!task_queue->ShouldEnqueueTask(context, extension))
return false; return false;
ChannelId channel_id = (*params)->receiver_port_id.GetChannelId(); ChannelId channel_id = (*params)->receiver_port_id.GetChannelId();
pending_lazy_background_page_channels_.insert(std::make_pair( pending_lazy_background_page_channels_.insert(std::make_pair(
channel_id, PendingLazyBackgroundPageChannel(context, extension->id()))); channel_id, PendingLazyBackgroundPageChannel(context, extension->id())));
int source_id = (*params)->source_process_id; int source_id = (*params)->source_process_id;
lazy_background_task_queue_->AddPendingTask( task_queue->AddPendingTask(
LazyContextId(context, extension->id()), context_id,
base::BindOnce(&MessageService::PendingLazyBackgroundPageOpenChannel, base::BindOnce(&MessageService::PendingLazyBackgroundPageOpenChannel,
weak_factory_.GetWeakPtr(), base::Passed(params), weak_factory_.GetWeakPtr(), base::Passed(params),
source_id)); source_id));
......
...@@ -33,7 +33,6 @@ class BrowserContext; ...@@ -33,7 +33,6 @@ class BrowserContext;
namespace extensions { namespace extensions {
class Extension; class Extension;
class ExtensionHost; class ExtensionHost;
class LazyBackgroundTaskQueue;
class MessagingDelegate; class MessagingDelegate;
// This class manages message and event passing between renderer processes. // This class manages message and event passing between renderer processes.
...@@ -187,7 +186,7 @@ class MessageService : public BrowserContextKeyedAPI, ...@@ -187,7 +186,7 @@ class MessageService : public BrowserContextKeyedAPI,
MessageChannel* channel, MessageChannel* channel,
const Message& message); const Message& message);
// Potentially registers a pending task with the LazyBackgroundTaskQueue // Potentially registers a pending task with the background task queue
// to open a channel. Returns true if a task was queued. // to open a channel. Returns true if a task was queued.
// Takes ownership of |params| if true is returned. // Takes ownership of |params| if true is returned.
bool MaybeAddPendingLazyBackgroundPageOpenChannelTask( bool MaybeAddPendingLazyBackgroundPageOpenChannelTask(
...@@ -196,7 +195,7 @@ class MessageService : public BrowserContextKeyedAPI, ...@@ -196,7 +195,7 @@ class MessageService : public BrowserContextKeyedAPI,
std::unique_ptr<OpenChannelParams>* params, std::unique_ptr<OpenChannelParams>* params,
const PendingMessagesQueue& pending_messages); const PendingMessagesQueue& pending_messages);
// Callbacks for LazyBackgroundTaskQueue tasks. The queue passes in an // Callbacks for background task queue tasks. The queue passes in an
// ExtensionHost to its task callbacks, though some of our callbacks don't // ExtensionHost to its task callbacks, though some of our callbacks don't
// use that argument. // use that argument.
void PendingLazyBackgroundPageOpenChannel( void PendingLazyBackgroundPageOpenChannel(
...@@ -254,9 +253,6 @@ class MessageService : public BrowserContextKeyedAPI, ...@@ -254,9 +253,6 @@ class MessageService : public BrowserContextKeyedAPI,
PendingLazyBackgroundPageChannelMap pending_lazy_background_page_channels_; PendingLazyBackgroundPageChannelMap pending_lazy_background_page_channels_;
MessagePropertyProvider property_provider_; MessagePropertyProvider property_provider_;
// Weak pointer. Guaranteed to outlive this class.
LazyBackgroundTaskQueue* lazy_background_task_queue_;
base::WeakPtrFactory<MessageService> weak_factory_; base::WeakPtrFactory<MessageService> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(MessageService); DISALLOW_COPY_AND_ASSIGN(MessageService);
......
...@@ -31,8 +31,8 @@ ...@@ -31,8 +31,8 @@
#include "extensions/browser/extension_system.h" #include "extensions/browser/extension_system.h"
#include "extensions/browser/extension_util.h" #include "extensions/browser/extension_util.h"
#include "extensions/browser/extensions_browser_client.h" #include "extensions/browser/extensions_browser_client.h"
#include "extensions/browser/lazy_background_task_queue.h"
#include "extensions/browser/lazy_context_id.h" #include "extensions/browser/lazy_context_id.h"
#include "extensions/browser/lazy_context_task_queue.h"
#include "extensions/browser/process_manager_factory.h" #include "extensions/browser/process_manager_factory.h"
#include "extensions/common/api/runtime.h" #include "extensions/common/api/runtime.h"
#include "extensions/common/error_utils.h" #include "extensions/common/error_utils.h"
...@@ -104,7 +104,7 @@ void DispatchOnStartupEventImpl( ...@@ -104,7 +104,7 @@ void DispatchOnStartupEventImpl(
const std::string& extension_id, const std::string& extension_id,
bool first_call, bool first_call,
std::unique_ptr<LazyContextTaskQueue::ContextInfo> context_info) { std::unique_ptr<LazyContextTaskQueue::ContextInfo> context_info) {
// A NULL ContextInfo from the LazyBackgroundTaskQueue means the page failed // A NULL ContextInfo from the task callback means the page failed
// to load. Give up. // to load. Give up.
if (!context_info && !first_call) if (!context_info && !first_call)
return; return;
...@@ -127,14 +127,15 @@ void DispatchOnStartupEventImpl( ...@@ -127,14 +127,15 @@ void DispatchOnStartupEventImpl(
ExtensionRegistry::Get(browser_context)->enabled_extensions().GetByID( ExtensionRegistry::Get(browser_context)->enabled_extensions().GetByID(
extension_id); extension_id);
if (extension && BackgroundInfo::HasPersistentBackgroundPage(extension) && if (extension && BackgroundInfo::HasPersistentBackgroundPage(extension) &&
first_call && first_call) {
LazyBackgroundTaskQueue::Get(browser_context) const LazyContextId context_id(browser_context, extension_id);
->ShouldEnqueueTask(browser_context, extension)) { LazyContextTaskQueue* task_queue = context_id.GetTaskQueue();
LazyBackgroundTaskQueue::Get(browser_context) if (task_queue->ShouldEnqueueTask(browser_context, extension)) {
->AddPendingTask(LazyContextId(browser_context, extension_id), task_queue->AddPendingTask(
base::BindOnce(&DispatchOnStartupEventImpl, context_id, base::BindOnce(&DispatchOnStartupEventImpl,
browser_context, extension_id, false)); browser_context, extension_id, false));
return; return;
}
} }
std::unique_ptr<base::ListValue> event_args(new base::ListValue()); std::unique_ptr<base::ListValue> event_args(new base::ListValue());
...@@ -596,13 +597,12 @@ void RuntimeAPI::OnExtensionInstalledAndLoaded( ...@@ -596,13 +597,12 @@ void RuntimeAPI::OnExtensionInstalledAndLoaded(
ExtensionFunction::ResponseAction RuntimeGetBackgroundPageFunction::Run() { ExtensionFunction::ResponseAction RuntimeGetBackgroundPageFunction::Run() {
ExtensionHost* host = ProcessManager::Get(browser_context()) ExtensionHost* host = ProcessManager::Get(browser_context())
->GetBackgroundHostForExtension(extension_id()); ->GetBackgroundHostForExtension(extension_id());
if (LazyBackgroundTaskQueue::Get(browser_context()) const LazyContextId context_id(browser_context(), extension_id());
->ShouldEnqueueTask(browser_context(), extension())) { LazyContextTaskQueue* task_queue = context_id.GetTaskQueue();
LazyBackgroundTaskQueue::Get(browser_context()) if (task_queue->ShouldEnqueueTask(browser_context(), extension())) {
->AddPendingTask( task_queue->AddPendingTask(
LazyContextId(browser_context(), extension_id()), context_id,
base::BindOnce(&RuntimeGetBackgroundPageFunction::OnPageLoaded, base::BindOnce(&RuntimeGetBackgroundPageFunction::OnPageLoaded, this));
this));
} else if (host) { } else if (host) {
OnPageLoaded(std::make_unique<LazyContextTaskQueue::ContextInfo>(host)); OnPageLoaded(std::make_unique<LazyContextTaskQueue::ContextInfo>(host));
} else { } else {
......
...@@ -8,9 +8,7 @@ ...@@ -8,9 +8,7 @@
#include "extensions/browser/event_router.h" #include "extensions/browser/event_router.h"
#include "extensions/browser/extension_registry.h" #include "extensions/browser/extension_registry.h"
#include "extensions/browser/extensions_browser_client.h" #include "extensions/browser/extensions_browser_client.h"
#include "extensions/browser/lazy_background_task_queue.h"
#include "extensions/browser/lazy_context_id.h" #include "extensions/browser/lazy_context_id.h"
#include "extensions/browser/service_worker_task_queue.h"
#include "extensions/common/manifest_handlers/incognito_info.h" #include "extensions/common/manifest_handlers/incognito_info.h"
using content::BrowserContext; using content::BrowserContext;
......
...@@ -16,8 +16,8 @@ ...@@ -16,8 +16,8 @@
#include "extensions/browser/extension_prefs.h" #include "extensions/browser/extension_prefs.h"
#include "extensions/browser/extension_registry.h" #include "extensions/browser/extension_registry.h"
#include "extensions/browser/extension_system.h" #include "extensions/browser/extension_system.h"
#include "extensions/browser/lazy_background_task_queue.h"
#include "extensions/browser/lazy_context_id.h" #include "extensions/browser/lazy_context_id.h"
#include "extensions/browser/lazy_context_task_queue.h"
#include "extensions/browser/notification_types.h" #include "extensions/browser/notification_types.h"
#include "extensions/browser/process_manager.h" #include "extensions/browser/process_manager.h"
#include "extensions/browser/renderer_startup_helper.h" #include "extensions/browser/renderer_startup_helper.h"
...@@ -521,10 +521,8 @@ void ExtensionRegistrar::MaybeSpinUpLazyBackgroundPage( ...@@ -521,10 +521,8 @@ void ExtensionRegistrar::MaybeSpinUpLazyBackgroundPage(
return; return;
// Wake up the event page by posting a dummy task. // Wake up the event page by posting a dummy task.
LazyBackgroundTaskQueue* queue = const LazyContextId context_id(browser_context_, extension->id());
LazyBackgroundTaskQueue::Get(browser_context_); context_id.GetTaskQueue()->AddPendingTask(context_id, base::DoNothing());
queue->AddPendingTask(LazyContextId(browser_context_, extension->id()),
base::DoNothing());
} }
} // namespace extensions } // namespace extensions
...@@ -19,8 +19,8 @@ ...@@ -19,8 +19,8 @@
#include "extensions/browser/extension_host.h" #include "extensions/browser/extension_host.h"
#include "extensions/browser/extension_registry.h" #include "extensions/browser/extension_registry.h"
#include "extensions/browser/guest_view/app_view/app_view_constants.h" #include "extensions/browser/guest_view/app_view/app_view_constants.h"
#include "extensions/browser/lazy_background_task_queue.h"
#include "extensions/browser/lazy_context_id.h" #include "extensions/browser/lazy_context_id.h"
#include "extensions/browser/lazy_context_task_queue.h"
#include "extensions/browser/process_manager.h" #include "extensions/browser/process_manager.h"
#include "extensions/browser/view_type_utils.h" #include "extensions/browser/view_type_utils.h"
#include "extensions/common/api/app_runtime.h" #include "extensions/common/api/app_runtime.h"
...@@ -194,11 +194,11 @@ void AppViewGuest::CreateWebContents(const base::DictionaryValue& create_params, ...@@ -194,11 +194,11 @@ void AppViewGuest::CreateWebContents(const base::DictionaryValue& create_params,
guest_extension, weak_ptr_factory_.GetWeakPtr(), guest_extension, weak_ptr_factory_.GetWeakPtr(),
std::move(callback)))); std::move(callback))));
LazyBackgroundTaskQueue* queue = const LazyContextId context_id(browser_context(), guest_extension->id());
LazyBackgroundTaskQueue::Get(browser_context()); LazyContextTaskQueue* queue = context_id.GetTaskQueue();
if (queue->ShouldEnqueueTask(browser_context(), guest_extension)) { if (queue->ShouldEnqueueTask(browser_context(), guest_extension)) {
queue->AddPendingTask( queue->AddPendingTask(
LazyContextId(browser_context(), guest_extension->id()), context_id,
base::BindOnce(&AppViewGuest::LaunchAppAndFireEvent, base::BindOnce(&AppViewGuest::LaunchAppAndFireEvent,
weak_ptr_factory_.GetWeakPtr(), data->CreateDeepCopy(), weak_ptr_factory_.GetWeakPtr(), data->CreateDeepCopy(),
std::move(callback))); std::move(callback)));
......
...@@ -32,8 +32,8 @@ ...@@ -32,8 +32,8 @@
#include "extensions/browser/extension_registry.h" #include "extensions/browser/extension_registry.h"
#include "extensions/browser/extension_system.h" #include "extensions/browser/extension_system.h"
#include "extensions/browser/extensions_browser_client.h" #include "extensions/browser/extensions_browser_client.h"
#include "extensions/browser/lazy_background_task_queue.h"
#include "extensions/browser/lazy_context_id.h" #include "extensions/browser/lazy_context_id.h"
#include "extensions/browser/lazy_context_task_queue.h"
#include "extensions/browser/notification_types.h" #include "extensions/browser/notification_types.h"
#include "extensions/browser/process_manager_delegate.h" #include "extensions/browser/process_manager_delegate.h"
#include "extensions/browser/process_manager_factory.h" #include "extensions/browser/process_manager_factory.h"
...@@ -432,10 +432,9 @@ bool ProcessManager::WakeEventPage(const std::string& extension_id, ...@@ -432,10 +432,9 @@ bool ProcessManager::WakeEventPage(const std::string& extension_id,
// The extension is already awake. // The extension is already awake.
return false; return false;
} }
LazyBackgroundTaskQueue* queue = const LazyContextId context_id(browser_context_, extension_id);
LazyBackgroundTaskQueue::Get(browser_context_); context_id.GetTaskQueue()->AddPendingTask(
queue->AddPendingTask( context_id,
LazyContextId(browser_context_, extension_id),
base::BindOnce(&PropagateExtensionWakeResult, std::move(callback))); base::BindOnce(&PropagateExtensionWakeResult, std::move(callback)));
return true; return true;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment