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

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

Issue 2163753004: Rename CancellationFlag to AtomicFlag. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: self-review (remove unused includes) Created 4 years, 5 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/after_startup_task_utils.h" 5 #include "chrome/browser/after_startup_task_utils.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
11 #include "base/macros.h" 11 #include "base/macros.h"
12 #include "base/memory/ptr_util.h" 12 #include "base/memory/ptr_util.h"
13 #include "base/metrics/histogram_macros.h" 13 #include "base/metrics/histogram_macros.h"
14 #include "base/process/process_info.h" 14 #include "base/process/process_info.h"
15 #include "base/rand_util.h" 15 #include "base/rand_util.h"
16 #include "base/synchronization/cancellation_flag.h" 16 #include "base/synchronization/atomic_flag.h"
17 #include "base/task_runner.h" 17 #include "base/task_runner.h"
18 #include "base/tracked_objects.h" 18 #include "base/tracked_objects.h"
19 #include "build/build_config.h" 19 #include "build/build_config.h"
20 #include "chrome/browser/ui/browser.h" 20 #include "chrome/browser/ui/browser.h"
21 #include "chrome/browser/ui/browser_list.h" 21 #include "chrome/browser/ui/browser_list.h"
22 #include "chrome/browser/ui/tabs/tab_strip_model.h" 22 #include "chrome/browser/ui/tabs/tab_strip_model.h"
23 #include "content/public/browser/browser_thread.h" 23 #include "content/public/browser/browser_thread.h"
24 #include "content/public/browser/render_frame_host.h" 24 #include "content/public/browser/render_frame_host.h"
25 #include "content/public/browser/web_contents.h" 25 #include "content/public/browser/web_contents.h"
26 #include "content/public/browser/web_contents_observer.h" 26 #include "content/public/browser/web_contents_observer.h"
27 27
28 using content::BrowserThread; 28 using content::BrowserThread;
29 using content::WebContents; 29 using content::WebContents;
30 using content::WebContentsObserver; 30 using content::WebContentsObserver;
31 using StartupCompleteFlag = base::CancellationFlag; 31 using StartupCompleteFlag = base::AtomicFlag;
32 32
33 namespace { 33 namespace {
34 34
35 struct AfterStartupTask { 35 struct AfterStartupTask {
36 AfterStartupTask(const tracked_objects::Location& from_here, 36 AfterStartupTask(const tracked_objects::Location& from_here,
37 const scoped_refptr<base::TaskRunner>& task_runner, 37 const scoped_refptr<base::TaskRunner>& task_runner,
38 const base::Closure& task) 38 const base::Closure& task)
39 : from_here(from_here), task_runner(task_runner), task(task) {} 39 : from_here(from_here), task_runner(task_runner), task(task) {}
40 ~AfterStartupTask() {} 40 ~AfterStartupTask() {}
41 41
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 return ::IsBrowserStartupComplete(); 224 return ::IsBrowserStartupComplete();
225 } 225 }
226 226
227 void AfterStartupTaskUtils::UnsafeResetForTesting() { 227 void AfterStartupTaskUtils::UnsafeResetForTesting() {
228 DCHECK(g_after_startup_tasks.Get().empty()); 228 DCHECK(g_after_startup_tasks.Get().empty());
229 if (!IsBrowserStartupComplete()) 229 if (!IsBrowserStartupComplete())
230 return; 230 return;
231 g_startup_complete_flag.Get().UnsafeResetForTesting(); 231 g_startup_complete_flag.Get().UnsafeResetForTesting();
232 DCHECK(!IsBrowserStartupComplete()); 232 DCHECK(!IsBrowserStartupComplete());
233 } 233 }
OLDNEW
« base/synchronization/cancellation_flag.h ('K') | « base/task_scheduler/task_tracker_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698