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

Side by Side Diff: chrome/browser/extensions/lazy_background_task_queue.cc

Issue 10804020: Introduce runtime.onSuspendCanceled() event. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: respond to comments Created 8 years, 5 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 | Annotate | Revision Log
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/extensions/lazy_background_task_queue.h" 5 #include "chrome/browser/extensions/lazy_background_task_queue.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "chrome/browser/extensions/extension_host.h" 9 #include "chrome/browser/extensions/extension_host.h"
10 #include "chrome/browser/extensions/extension_process_manager.h" 10 #include "chrome/browser/extensions/extension_process_manager.h"
(...skipping 30 matching lines...) Expand all
41 } 41 }
42 42
43 bool LazyBackgroundTaskQueue::ShouldEnqueueTask( 43 bool LazyBackgroundTaskQueue::ShouldEnqueueTask(
44 Profile* profile, const Extension* extension) { 44 Profile* profile, const Extension* extension) {
45 DCHECK(extension); 45 DCHECK(extension);
46 if (extension->has_lazy_background_page()) { 46 if (extension->has_lazy_background_page()) {
47 ExtensionProcessManager* pm = 47 ExtensionProcessManager* pm =
48 ExtensionSystem::Get(profile)->process_manager(); 48 ExtensionSystem::Get(profile)->process_manager();
49 ExtensionHost* background_host = 49 ExtensionHost* background_host =
50 pm->GetBackgroundHostForExtension(extension->id()); 50 pm->GetBackgroundHostForExtension(extension->id());
51 if (!background_host || !background_host->did_stop_loading() || 51 if (!background_host || !background_host->did_stop_loading())
52 pm->IsBackgroundHostClosing(extension->id()))
53 return true; 52 return true;
54 } 53 }
55 54
56 return false; 55 return false;
57 } 56 }
58 57
59 void LazyBackgroundTaskQueue::AddPendingTask( 58 void LazyBackgroundTaskQueue::AddPendingTask(
60 Profile* profile, 59 Profile* profile,
61 const std::string& extension_id, 60 const std::string& extension_id,
62 const PendingTask& task) { 61 const PendingTask& task) {
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 } 181 }
183 break; 182 break;
184 } 183 }
185 default: 184 default:
186 NOTREACHED(); 185 NOTREACHED();
187 break; 186 break;
188 } 187 }
189 } 188 }
190 189
191 } // namespace extensions 190 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698