OLD | NEW |
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 // When each service is created, we set a flag indicating this. At this point, | 5 // When each service is created, we set a flag indicating this. At this point, |
6 // the service initialization could fail or succeed. This allows us to remember | 6 // the service initialization could fail or succeed. This allows us to remember |
7 // if we tried to create a service, and not try creating it over and over if | 7 // if we tried to create a service, and not try creating it over and over if |
8 // the creation failed. | 8 // the creation failed. |
9 | 9 |
10 #ifndef CHROME_BROWSER_BROWSER_PROCESS_IMPL_H_ | 10 #ifndef CHROME_BROWSER_BROWSER_PROCESS_IMPL_H_ |
11 #define CHROME_BROWSER_BROWSER_PROCESS_IMPL_H_ | 11 #define CHROME_BROWSER_BROWSER_PROCESS_IMPL_H_ |
12 #pragma once | 12 #pragma once |
13 | 13 |
14 #include <string> | 14 #include <string> |
15 | 15 |
16 #include "base/basictypes.h" | 16 #include "base/basictypes.h" |
17 #include "base/debug/stack_trace.h" | 17 #include "base/debug/stack_trace.h" |
18 #include "base/memory/ref_counted.h" | 18 #include "base/memory/ref_counted.h" |
19 #include "base/memory/scoped_ptr.h" | 19 #include "base/memory/scoped_ptr.h" |
20 #include "base/threading/non_thread_safe.h" | 20 #include "base/threading/non_thread_safe.h" |
21 #include "base/timer.h" | 21 #include "base/timer.h" |
22 #include "chrome/browser/browser_process.h" | 22 #include "chrome/browser/browser_process.h" |
23 #include "chrome/browser/prefs/pref_change_registrar.h" | 23 #include "chrome/browser/prefs/pref_change_registrar.h" |
24 #include "chrome/browser/prefs/pref_member.h" | 24 #include "chrome/browser/prefs/pref_member.h" |
25 #include "content/public/browser/notification_observer.h" | 25 #include "content/public/browser/notification_observer.h" |
26 | 26 |
27 class ChromeNetLog; | 27 class ChromeNetLog; |
28 class ChromeResourceDispatcherHostDelegate; | 28 class ChromeResourceDispatcherHostDelegate; |
29 class CommandLine; | 29 class CommandLine; |
| 30 class ProcessSingleton; |
30 class RemoteDebuggingServer; | 31 class RemoteDebuggingServer; |
31 class TabCloseableStateWatcher; | 32 class TabCloseableStateWatcher; |
32 | 33 |
33 namespace policy { | 34 namespace policy { |
34 class BrowserPolicyConnector; | 35 class BrowserPolicyConnector; |
35 class PolicyService; | 36 class PolicyService; |
36 }; | 37 }; |
37 | 38 |
38 // Real implementation of BrowserProcess that creates and returns the services. | 39 // Real implementation of BrowserProcess that creates and returns the services. |
39 class BrowserProcessImpl : public BrowserProcess, | 40 class BrowserProcessImpl : public BrowserProcess, |
40 public base::NonThreadSafe, | 41 public base::NonThreadSafe, |
41 public content::NotificationObserver { | 42 public content::NotificationObserver { |
42 public: | 43 public: |
43 explicit BrowserProcessImpl(const CommandLine& command_line); | 44 BrowserProcessImpl(const CommandLine& command_line, |
| 45 ProcessSingleton* process_singleton); |
44 virtual ~BrowserProcessImpl(); | 46 virtual ~BrowserProcessImpl(); |
45 | 47 |
46 // Called before the browser threads are created. | 48 // Called before the browser threads are created. |
47 void PreCreateThreads(); | 49 void PreCreateThreads(); |
48 | 50 |
49 // Called after the threads have been created but before the message loops | 51 // Called after the threads have been created but before the message loops |
50 // starts running. Allows the browser process to do any initialization that | 52 // starts running. Allows the browser process to do any initialization that |
51 // requires all threads running. | 53 // requires all threads running. |
52 void PreMainMessageLoopRun(); | 54 void PreMainMessageLoopRun(); |
53 | 55 |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 #else | 259 #else |
258 scoped_ptr<ComponentUpdateService> component_updater_; | 260 scoped_ptr<ComponentUpdateService> component_updater_; |
259 | 261 |
260 scoped_refptr<CRLSetFetcher> crl_set_fetcher_; | 262 scoped_refptr<CRLSetFetcher> crl_set_fetcher_; |
261 #endif | 263 #endif |
262 | 264 |
263 // TODO(eroman): Remove this when done debugging 113031. This tracks | 265 // TODO(eroman): Remove this when done debugging 113031. This tracks |
264 // the callstack which released the final module reference count. | 266 // the callstack which released the final module reference count. |
265 base::debug::StackTrace release_last_reference_callstack_; | 267 base::debug::StackTrace release_last_reference_callstack_; |
266 | 268 |
| 269 // A weak pointer to the process_singleton for use in cleanup during |
| 270 // EndSession on Windows. |
| 271 ProcessSingleton* process_singleton_; |
| 272 |
267 DISALLOW_COPY_AND_ASSIGN(BrowserProcessImpl); | 273 DISALLOW_COPY_AND_ASSIGN(BrowserProcessImpl); |
268 }; | 274 }; |
269 | 275 |
270 #endif // CHROME_BROWSER_BROWSER_PROCESS_IMPL_H_ | 276 #endif // CHROME_BROWSER_BROWSER_PROCESS_IMPL_H_ |
OLD | NEW |