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

Side by Side Diff: chrome/browser/chromeos/file_manager/file_browser_handlers.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 | « apps/launcher.cc ('k') | chrome/browser/extensions/api/messaging/message_service.cc » ('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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/browser/chromeos/file_manager/file_browser_handlers.h" 5 #include "chrome/browser/chromeos/file_manager/file_browser_handlers.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <set> 8 #include <set>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 14 matching lines...) Expand all
25 #include "chrome/common/extensions/api/file_manager_private.h" 25 #include "chrome/common/extensions/api/file_manager_private.h"
26 #include "chromeos/chromeos_switches.h" 26 #include "chromeos/chromeos_switches.h"
27 #include "content/public/browser/browser_thread.h" 27 #include "content/public/browser/browser_thread.h"
28 #include "content/public/browser/child_process_security_policy.h" 28 #include "content/public/browser/child_process_security_policy.h"
29 #include "content/public/browser/render_process_host.h" 29 #include "content/public/browser/render_process_host.h"
30 #include "content/public/browser/site_instance.h" 30 #include "content/public/browser/site_instance.h"
31 #include "content/public/browser/web_contents.h" 31 #include "content/public/browser/web_contents.h"
32 #include "extensions/browser/event_router.h" 32 #include "extensions/browser/event_router.h"
33 #include "extensions/browser/extension_host.h" 33 #include "extensions/browser/extension_host.h"
34 #include "extensions/browser/extension_registry.h" 34 #include "extensions/browser/extension_registry.h"
35 #include "extensions/browser/extension_system.h"
36 #include "extensions/browser/extension_util.h" 35 #include "extensions/browser/extension_util.h"
37 #include "extensions/browser/lazy_background_task_queue.h" 36 #include "extensions/browser/lazy_background_task_queue.h"
38 #include "extensions/common/extension_set.h" 37 #include "extensions/common/extension_set.h"
39 #include "extensions/common/manifest_handlers/background_info.h" 38 #include "extensions/common/manifest_handlers/background_info.h"
40 #include "extensions/common/url_pattern.h" 39 #include "extensions/common/url_pattern.h"
41 #include "net/base/escape.h" 40 #include "net/base/escape.h"
42 #include "storage/browser/fileapi/file_system_context.h" 41 #include "storage/browser/fileapi/file_system_context.h"
43 #include "storage/browser/fileapi/file_system_url.h" 42 #include "storage/browser/fileapi/file_system_url.h"
44 #include "storage/common/fileapi/file_system_info.h" 43 #include "storage/common/fileapi/file_system_info.h"
45 #include "storage/common/fileapi/file_system_util.h" 44 #include "storage/common/fileapi/file_system_util.h"
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
342 } 341 }
343 342
344 if (handler_pid > 0) { 343 if (handler_pid > 0) {
345 SetupPermissionsAndDispatchEvent(file_definition_list.Pass(), 344 SetupPermissionsAndDispatchEvent(file_definition_list.Pass(),
346 entry_definition_list.Pass(), 345 entry_definition_list.Pass(),
347 handler_pid, 346 handler_pid,
348 NULL); 347 NULL);
349 } else { 348 } else {
350 // We have to wake the handler background page before we proceed. 349 // We have to wake the handler background page before we proceed.
351 extensions::LazyBackgroundTaskQueue* queue = 350 extensions::LazyBackgroundTaskQueue* queue =
352 extensions::ExtensionSystem::Get(profile_)-> 351 extensions::LazyBackgroundTaskQueue::Get(profile_);
353 lazy_background_task_queue();
354 if (!queue->ShouldEnqueueTask(profile_, extension_.get())) { 352 if (!queue->ShouldEnqueueTask(profile_, extension_.get())) {
355 ExecuteDoneOnUIThread(false); 353 ExecuteDoneOnUIThread(false);
356 return; 354 return;
357 } 355 }
358 queue->AddPendingTask( 356 queue->AddPendingTask(
359 profile_, 357 profile_,
360 extension_->id(), 358 extension_->id(),
361 base::Bind( 359 base::Bind(
362 &FileBrowserHandlerExecutor::SetupPermissionsAndDispatchEvent, 360 &FileBrowserHandlerExecutor::SetupPermissionsAndDispatchEvent,
363 weak_ptr_factory_.GetWeakPtr(), 361 weak_ptr_factory_.GetWeakPtr(),
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
530 if (common_handlers.empty()) 528 if (common_handlers.empty())
531 return FileBrowserHandlerList(); 529 return FileBrowserHandlerList();
532 } 530 }
533 } 531 }
534 532
535 return common_handlers; 533 return common_handlers;
536 } 534 }
537 535
538 } // namespace file_browser_handlers 536 } // namespace file_browser_handlers
539 } // namespace file_manager 537 } // namespace file_manager
OLDNEW
« no previous file with comments | « apps/launcher.cc ('k') | chrome/browser/extensions/api/messaging/message_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698