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

Side by Side Diff: base/message_pump_default.cc

Issue 3828009: Move scoped_nsdisable_screen_update from base to app/mac... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « base/mac/scoped_nsautorelease_pool.mm ('k') | base/message_pump_libevent.cc » ('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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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/message_pump_default.h" 5 #include "base/message_pump_default.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/scoped_nsautorelease_pool.h" 8 #include "base/mac/scoped_nsautorelease_pool.h"
9 9
10 namespace base { 10 namespace base {
11 11
12 MessagePumpDefault::MessagePumpDefault() 12 MessagePumpDefault::MessagePumpDefault()
13 : keep_running_(true), 13 : keep_running_(true),
14 event_(false, false) { 14 event_(false, false) {
15 } 15 }
16 16
17 void MessagePumpDefault::Run(Delegate* delegate) { 17 void MessagePumpDefault::Run(Delegate* delegate) {
18 DCHECK(keep_running_) << "Quit must have been called outside of Run!"; 18 DCHECK(keep_running_) << "Quit must have been called outside of Run!";
19 19
20 for (;;) { 20 for (;;) {
21 ScopedNSAutoreleasePool autorelease_pool; 21 mac::ScopedNSAutoreleasePool autorelease_pool;
22 22
23 bool did_work = delegate->DoWork(); 23 bool did_work = delegate->DoWork();
24 if (!keep_running_) 24 if (!keep_running_)
25 break; 25 break;
26 26
27 did_work |= delegate->DoDelayedWork(&delayed_work_time_); 27 did_work |= delegate->DoDelayedWork(&delayed_work_time_);
28 if (!keep_running_) 28 if (!keep_running_)
29 break; 29 break;
30 30
31 if (did_work) 31 if (did_work)
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 } 68 }
69 69
70 void MessagePumpDefault::ScheduleDelayedWork(const Time& delayed_work_time) { 70 void MessagePumpDefault::ScheduleDelayedWork(const Time& delayed_work_time) {
71 // We know that we can't be blocked on Wait right now since this method can 71 // We know that we can't be blocked on Wait right now since this method can
72 // only be called on the same thread as Run, so we only need to update our 72 // only be called on the same thread as Run, so we only need to update our
73 // record of how long to sleep when we do sleep. 73 // record of how long to sleep when we do sleep.
74 delayed_work_time_ = delayed_work_time; 74 delayed_work_time_ = delayed_work_time;
75 } 75 }
76 76
77 } // namespace base 77 } // namespace base
OLDNEW
« no previous file with comments | « base/mac/scoped_nsautorelease_pool.mm ('k') | base/message_pump_libevent.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698