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

Unified Diff: chrome/browser/chrome_browser_main.cc

Issue 1140643002: Fix device_event_log component build, make NonThreadSafe (Take 2) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/chromeos/chrome_browser_main_chromeos.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chrome_browser_main.cc
diff --git a/chrome/browser/chrome_browser_main.cc b/chrome/browser/chrome_browser_main.cc
index 94d64620fa0528ce244baa4303e66098e8d07cbb..611ff39f0caaf1a7897e3ae63d780c622f2e77c8 100644
--- a/chrome/browser/chrome_browser_main.cc
+++ b/chrome/browser/chrome_browser_main.cc
@@ -797,14 +797,19 @@ void ChromeBrowserMainParts::ToolkitInitialized() {
void ChromeBrowserMainParts::PreMainMessageLoopStart() {
TRACE_EVENT0("startup", "ChromeBrowserMainParts::PreMainMessageLoopStart");
- device_event_log::Initialize(0 /* default max entries */);
-
for (size_t i = 0; i < chrome_extra_parts_.size(); ++i)
chrome_extra_parts_[i]->PreMainMessageLoopStart();
}
void ChromeBrowserMainParts::PostMainMessageLoopStart() {
TRACE_EVENT0("startup", "ChromeBrowserMainParts::PostMainMessageLoopStart");
+
+ // device_event_log must be initialized after the message loop. Calls to
+ // {DEVICE}_LOG prior to here will only be logged with VLOG. Some
+ // platforms (e.g. chromeos) may have already initialized this.
+ if (!device_event_log::IsInitialized())
+ device_event_log::Initialize(0 /* default max entries */);
+
for (size_t i = 0; i < chrome_extra_parts_.size(); ++i)
chrome_extra_parts_[i]->PostMainMessageLoopStart();
}
« no previous file with comments | « no previous file | chrome/browser/chromeos/chrome_browser_main_chromeos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698