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

Side by Side Diff: chrome/browser/browser_process_impl.h

Issue 4118004: Update NetLog to be thread safe. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Response to comments (And net-internals refresh fix) Created 10 years, 1 month 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) 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 // 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/message_loop.h" 17 #include "base/message_loop.h"
18 #include "base/non_thread_safe.h" 18 #include "base/non_thread_safe.h"
19 #include "base/timer.h" 19 #include "base/timer.h"
20 #include "base/scoped_ptr.h" 20 #include "base/scoped_ptr.h"
21 #include "chrome/browser/browser_process.h" 21 #include "chrome/browser/browser_process.h"
22 #include "chrome/browser/download/download_status_updater.h" 22 #include "chrome/browser/download/download_status_updater.h"
23 #include "chrome/browser/prefs/pref_change_registrar.h" 23 #include "chrome/browser/prefs/pref_change_registrar.h"
24 #include "chrome/browser/tab_contents/thumbnail_generator.h" 24 #include "chrome/browser/tab_contents/thumbnail_generator.h"
25 #include "ipc/ipc_message.h" 25 #include "ipc/ipc_message.h"
26 26
27 class ChromeNetLog;
27 class CommandLine; 28 class CommandLine;
28 class DebuggerWrapper; 29 class DebuggerWrapper;
29 class FilePath; 30 class FilePath;
30 class NotificationService; 31 class NotificationService;
31 class TabCloseableStateWatcher; 32 class TabCloseableStateWatcher;
32 33
33 // Real implementation of BrowserProcess that creates and returns the services. 34 // Real implementation of BrowserProcess that creates and returns the services.
34 class BrowserProcessImpl : public BrowserProcess, public NonThreadSafe { 35 class BrowserProcessImpl : public BrowserProcess, public NonThreadSafe {
35 public: 36 public:
36 explicit BrowserProcessImpl(const CommandLine& command_line); 37 explicit BrowserProcessImpl(const CommandLine& command_line);
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 // Runs on the file thread and stats the inspector's directory, filling in 200 // Runs on the file thread and stats the inspector's directory, filling in
200 // have_inspector_files_ with the result. 201 // have_inspector_files_ with the result.
201 void DoInspectorFilesCheck(); 202 void DoInspectorFilesCheck();
202 // Our best estimate about the existence of the inspector directory. 203 // Our best estimate about the existence of the inspector directory.
203 bool have_inspector_files_; 204 bool have_inspector_files_;
204 205
205 // Ensures that the observers of plugin/print disable/enable state 206 // Ensures that the observers of plugin/print disable/enable state
206 // notifications are properly added and removed. 207 // notifications are properly added and removed.
207 PrefChangeRegistrar pref_change_registrar_; 208 PrefChangeRegistrar pref_change_registrar_;
208 209
210 // Lives here so can safely log events on shutdown.
211 scoped_ptr<ChromeNetLog> net_log_;
212
209 #if (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) 213 #if (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS)
210 base::RepeatingTimer<BrowserProcessImpl> autoupdate_timer_; 214 base::RepeatingTimer<BrowserProcessImpl> autoupdate_timer_;
211 215
212 // Gets called by autoupdate timer to see if browser needs restart and can be 216 // Gets called by autoupdate timer to see if browser needs restart and can be
213 // restarted, and if that's the case, restarts the browser. 217 // restarted, and if that's the case, restarts the browser.
214 void OnAutoupdateTimer(); 218 void OnAutoupdateTimer();
215 bool CanAutorestartForUpdate() const; 219 bool CanAutorestartForUpdate() const;
216 void RestartPersistentInstance(); 220 void RestartPersistentInstance();
217 #endif // defined(OS_WIN) || defined(OS_LINUX) 221 #endif // defined(OS_WIN) || defined(OS_LINUX)
218 222
219 DISALLOW_COPY_AND_ASSIGN(BrowserProcessImpl); 223 DISALLOW_COPY_AND_ASSIGN(BrowserProcessImpl);
220 }; 224 };
221 225
222 #endif // CHROME_BROWSER_BROWSER_PROCESS_IMPL_H_ 226 #endif // CHROME_BROWSER_BROWSER_PROCESS_IMPL_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/browser_process_impl.cc » ('j') | chrome/browser/dom_ui/net_internals_ui.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698