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

Side by Side Diff: chrome/browser/service/service_process_control_manager.cc

Issue 3153029: Resubmit r56600 - Start/stop service process when browser starts and stop (Closed)
Patch Set: Created 10 years, 4 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 | « chrome/browser/service/service_process_control.cc ('k') | chrome/common/pref_names.h » ('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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/service/service_process_control_manager.h" 5 #include "chrome/browser/service/service_process_control_manager.h"
6 6
7 #include "base/singleton.h" 7 #include "base/singleton.h"
8 #include "base/stl_util-inl.h" 8 #include "base/stl_util-inl.h"
9 #include "chrome/browser/chrome_thread.h" 9 #include "chrome/browser/chrome_thread.h"
10 #include "chrome/browser/profile.h" 10 #include "chrome/browser/profile.h"
(...skipping 18 matching lines...) Expand all
29 return *i; 29 return *i;
30 } 30 }
31 31
32 // Couldn't find a ServiceProcess so construct a new one. 32 // Couldn't find a ServiceProcess so construct a new one.
33 ServiceProcessControl* process = new ServiceProcessControl(profile, type); 33 ServiceProcessControl* process = new ServiceProcessControl(profile, type);
34 process_control_list_.push_back(process); 34 process_control_list_.push_back(process);
35 return process; 35 return process;
36 } 36 }
37 37
38 void ServiceProcessControlManager::Shutdown() { 38 void ServiceProcessControlManager::Shutdown() {
39 // TODO(hclam): Normally we should just delete the list but for simplicity
40 // we also shutdown the service processes.
41 for (ServiceProcessControlList::iterator i = process_control_list_.begin();
42 i != process_control_list_.end(); ++i) {
43 (*i)->Shutdown();
44 }
39 STLDeleteElements(&process_control_list_); 45 STLDeleteElements(&process_control_list_);
40 } 46 }
41 47
42 // static 48 // static
43 ServiceProcessControlManager* ServiceProcessControlManager::instance() { 49 ServiceProcessControlManager* ServiceProcessControlManager::instance() {
44 return Singleton<ServiceProcessControlManager>::get(); 50 return Singleton<ServiceProcessControlManager>::get();
45 } 51 }
OLDNEW
« no previous file with comments | « chrome/browser/service/service_process_control.cc ('k') | chrome/common/pref_names.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698