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

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

Issue 11246003: Remove Profile->GetExtensionProcessManager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix extension_crash_recovery_browsertest Created 8 years, 2 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 "chrome/browser/extensions/extension_host.h" 8 #include "chrome/browser/extensions/extension_host.h"
9 #include "chrome/browser/extensions/extension_process_manager.h" 9 #include "chrome/browser/extensions/extension_process_manager.h"
10 #include "chrome/browser/extensions/extension_service.h" 10 #include "chrome/browser/extensions/extension_service.h"
(...skipping 25 matching lines...) Expand all
36 content::Source<Profile>(profile)); 36 content::Source<Profile>(profile));
37 } 37 }
38 38
39 LazyBackgroundTaskQueue::~LazyBackgroundTaskQueue() { 39 LazyBackgroundTaskQueue::~LazyBackgroundTaskQueue() {
40 } 40 }
41 41
42 bool LazyBackgroundTaskQueue::ShouldEnqueueTask( 42 bool LazyBackgroundTaskQueue::ShouldEnqueueTask(
43 Profile* profile, const Extension* extension) { 43 Profile* profile, const Extension* extension) {
44 DCHECK(extension); 44 DCHECK(extension);
45 if (extension->has_background_page()) { 45 if (extension->has_background_page()) {
46 ExtensionProcessManager* pm = profile->GetExtensionProcessManager(); 46 ExtensionProcessManager* pm = extensions::ExtensionSystem::Get(profile)->
47 process_manager();
47 ExtensionHost* background_host = 48 ExtensionHost* background_host =
48 pm->GetBackgroundHostForExtension(extension->id()); 49 pm->GetBackgroundHostForExtension(extension->id());
49 if (!background_host || !background_host->did_stop_loading()) 50 if (!background_host || !background_host->did_stop_loading())
50 return true; 51 return true;
51 if (pm->IsBackgroundHostClosing(extension->id())) 52 if (pm->IsBackgroundHostClosing(extension->id()))
52 pm->CancelSuspend(extension); 53 pm->CancelSuspend(extension);
53 } 54 }
54 55
55 return false; 56 return false;
56 } 57 }
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 } 162 }
162 break; 163 break;
163 } 164 }
164 default: 165 default:
165 NOTREACHED(); 166 NOTREACHED();
166 break; 167 break;
167 } 168 }
168 } 169 }
169 170
170 } // namespace extensions 171 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/lazy_background_page_apitest.cc ('k') | chrome/browser/extensions/process_management_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698