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

Side by Side Diff: chrome/browser/chrome_browser_field_trials_desktop.cc

Issue 2720353002: Flush stability file after initialization (Closed)
Patch Set: Created 3 years, 9 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/chrome_browser_field_trials_desktop.h" 5 #include "chrome/browser/chrome_browser_field_trials_desktop.h"
6 6
7 #if defined(OS_WIN) 7 #if defined(OS_WIN)
8 #include <windows.h> 8 #include <windows.h>
9 #endif 9 #endif
10 10
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 global_data.SetString(browser_watcher::kStabilitySpecialBuild, 168 global_data.SetString(browser_watcher::kStabilitySpecialBuild,
169 special_build); 169 special_build);
170 #if defined(ARCH_CPU_X86) 170 #if defined(ARCH_CPU_X86)
171 global_data.SetString(browser_watcher::kStabilityPlatform, "Win32"); 171 global_data.SetString(browser_watcher::kStabilityPlatform, "Win32");
172 #elif defined(ARCH_CPU_X86_64) 172 #elif defined(ARCH_CPU_X86_64)
173 global_data.SetString(browser_watcher::kStabilityPlatform, "Win64"); 173 global_data.SetString(browser_watcher::kStabilityPlatform, "Win64");
174 #endif 174 #endif
175 175
176 // Record information about chrome's module. We want this to be done early. 176 // Record information about chrome's module. We want this to be done early.
177 RecordChromeModuleInfo(global_tracker); 177 RecordChromeModuleInfo(global_tracker);
178
179 // Trigger a flush of the memory mapped file to maximize the chances of
180 // having a minimal amount of content in the stability file, even if
181 // the system crashes or loses power. Note: this does not flush the file
182 // metadata nor does it wait for the changes to be flushed to disk before
183 // returning.
184 ::FlushViewOfFile(global_tracker->allocator()->data(), 0U);
bcwhite 2017/03/06 13:59:17 How about making this a method off of GlobalActivi
manzagop (departed) 2017/03/06 16:46:26 I guess GlobalActivityTracker would have a flush t
bcwhite 2017/03/07 18:37:26 Yeah... It would have to be a virtual method on t
178 } 185 }
179 } 186 }
180 #endif // defined(OS_WIN) 187 #endif // defined(OS_WIN)
181 188
182 } // namespace 189 } // namespace
183 190
184 void SetupDesktopFieldTrials() { 191 void SetupDesktopFieldTrials() {
185 prerender::ConfigurePrerender(); 192 prerender::ConfigurePrerender();
186 SetupStunProbeTrial(); 193 SetupStunProbeTrial();
187 #if defined(OS_WIN) 194 #if defined(OS_WIN)
188 SetupStabilityDebugging(); 195 SetupStabilityDebugging();
189 base::FeatureList::IsEnabled(features::kModuleDatabase); 196 base::FeatureList::IsEnabled(features::kModuleDatabase);
190 #endif // defined(OS_WIN) 197 #endif // defined(OS_WIN)
191 // Activate the experiment as early as possible to increase its visibility 198 // Activate the experiment as early as possible to increase its visibility
192 // (e.g. the likelihood of its presence in the serialized system profile). 199 // (e.g. the likelihood of its presence in the serialized system profile).
193 // This also needs to happen before the browser rendez-vous attempt 200 // This also needs to happen before the browser rendez-vous attempt
194 // (NotifyOtherProcessOrCreate) in PreMainMessageLoopRun so the corresponding 201 // (NotifyOtherProcessOrCreate) in PreMainMessageLoopRun so the corresponding
195 // metrics are tagged. 202 // metrics are tagged.
196 base::FeatureList::IsEnabled(features::kDesktopFastShutdown); 203 base::FeatureList::IsEnabled(features::kDesktopFastShutdown);
197 } 204 }
198 205
199 } // namespace chrome 206 } // namespace chrome
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698