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

Side by Side Diff: base/message_pump_default.cc

Issue 8414020: Expose the sandbox related code through the content API. I did a bit of cleanup while I was doing... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 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 | Annotate | Revision Log
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
9 #if defined(OS_MACOSX)
8 #include "base/mac/scoped_nsautorelease_pool.h" 10 #include "base/mac/scoped_nsautorelease_pool.h"
11 #endif
9 12
10 namespace base { 13 namespace base {
11 14
12 MessagePumpDefault::MessagePumpDefault() 15 MessagePumpDefault::MessagePumpDefault()
13 : keep_running_(true), 16 : keep_running_(true),
14 event_(false, false) { 17 event_(false, false) {
15 } 18 }
16 19
17 void MessagePumpDefault::Run(Delegate* delegate) { 20 void MessagePumpDefault::Run(Delegate* delegate) {
18 DCHECK(keep_running_) << "Quit must have been called outside of Run!"; 21 DCHECK(keep_running_) << "Quit must have been called outside of Run!";
19 22
20 for (;;) { 23 for (;;) {
24 #if defined(OS_MACOSX)
Mark Mentovai 2012/03/26 16:23:16 Like here, for example.
21 mac::ScopedNSAutoreleasePool autorelease_pool; 25 mac::ScopedNSAutoreleasePool autorelease_pool;
26 #endif
22 27
23 bool did_work = delegate->DoWork(); 28 bool did_work = delegate->DoWork();
24 if (!keep_running_) 29 if (!keep_running_)
25 break; 30 break;
26 31
27 did_work |= delegate->DoDelayedWork(&delayed_work_time_); 32 did_work |= delegate->DoDelayedWork(&delayed_work_time_);
28 if (!keep_running_) 33 if (!keep_running_)
29 break; 34 break;
30 35
31 if (did_work) 36 if (did_work)
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 74
70 void MessagePumpDefault::ScheduleDelayedWork( 75 void MessagePumpDefault::ScheduleDelayedWork(
71 const TimeTicks& delayed_work_time) { 76 const TimeTicks& delayed_work_time) {
72 // We know that we can't be blocked on Wait right now since this method can 77 // We know that we can't be blocked on Wait right now since this method can
73 // only be called on the same thread as Run, so we only need to update our 78 // only be called on the same thread as Run, so we only need to update our
74 // record of how long to sleep when we do sleep. 79 // record of how long to sleep when we do sleep.
75 delayed_work_time_ = delayed_work_time; 80 delayed_work_time_ = delayed_work_time;
76 } 81 }
77 82
78 } // namespace base 83 } // namespace base
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698