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

Side by Side Diff: base/run_loop.cc

Issue 669813003: Update from chromium https://crrev.com/301725/ (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 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
« no previous file with comments | « base/profiler/scoped_tracker.cc ('k') | base/scoped_observer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "base/run_loop.h" 5 #include "base/run_loop.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/tracked_objects.h" 8 #include "base/tracked_objects.h"
9 9
10 #if defined(OS_WIN) 10 #if defined(OS_WIN)
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 RunLoop::~RunLoop() { 44 RunLoop::~RunLoop() {
45 } 45 }
46 46
47 void RunLoop::Run() { 47 void RunLoop::Run() {
48 if (!BeforeRun()) 48 if (!BeforeRun())
49 return; 49 return;
50 50
51 // Use task stopwatch to exclude the loop run time from the current task, if 51 // Use task stopwatch to exclude the loop run time from the current task, if
52 // any. 52 // any.
53 tracked_objects::TaskStopwatch stopwatch; 53 tracked_objects::TaskStopwatch stopwatch;
54 stopwatch.Start();
54 loop_->RunHandler(); 55 loop_->RunHandler();
55 stopwatch.Stop(); 56 stopwatch.Stop();
56 57
57 AfterRun(); 58 AfterRun();
58 } 59 }
59 60
60 void RunLoop::RunUntilIdle() { 61 void RunLoop::RunUntilIdle() {
61 quit_when_idle_received_ = true; 62 quit_when_idle_received_ = true;
62 Run(); 63 Run();
63 } 64 }
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 97
97 // Pop RunLoop stack: 98 // Pop RunLoop stack:
98 loop_->run_loop_ = previous_run_loop_; 99 loop_->run_loop_ = previous_run_loop_;
99 100
100 // Execute deferred QuitNow, if any: 101 // Execute deferred QuitNow, if any:
101 if (previous_run_loop_ && previous_run_loop_->quit_called_) 102 if (previous_run_loop_ && previous_run_loop_->quit_called_)
102 loop_->QuitNow(); 103 loop_->QuitNow();
103 } 104 }
104 105
105 } // namespace base 106 } // namespace base
OLDNEW
« no previous file with comments | « base/profiler/scoped_tracker.cc ('k') | base/scoped_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698