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

Side by Side Diff: base/message_loop/message_pump_win.cc

Issue 1255673004: Proof-reading comments in base/message_loop/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: imcoming -> incoming Created 5 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
« no previous file with comments | « base/message_loop/message_pump_win.h ('k') | 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 (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/message_loop/message_pump_win.h" 5 #include "base/message_loop/message_pump_win.h"
6 6
7 #include <limits> 7 #include <limits>
8 #include <math.h> 8 #include <math.h>
9 9
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 // To provide sub-10ms timers, we process timers directly from our run loop. 312 // To provide sub-10ms timers, we process timers directly from our run loop.
313 // For the common case, timers will be processed there as the run loop does 313 // For the common case, timers will be processed there as the run loop does
314 // its normal work. However, we *also* set the system timer so that WM_TIMER 314 // its normal work. However, we *also* set the system timer so that WM_TIMER
315 // events fire. This mops up the case of timers not being able to work in 315 // events fire. This mops up the case of timers not being able to work in
316 // modal message loops. It is possible for the SetTimer to pop and have no 316 // modal message loops. It is possible for the SetTimer to pop and have no
317 // pending timers, because they could have already been processed by the 317 // pending timers, because they could have already been processed by the
318 // run loop itself. 318 // run loop itself.
319 // 319 //
320 // We use a single SetTimer corresponding to the timer that will expire 320 // We use a single SetTimer corresponding to the timer that will expire
321 // soonest. As new timers are created and destroyed, we update SetTimer. 321 // soonest. As new timers are created and destroyed, we update SetTimer.
322 // Getting a spurrious SetTimer event firing is benign, as we'll just be 322 // Getting a spurious SetTimer event firing is benign, as we'll just be
323 // processing an empty timer queue. 323 // processing an empty timer queue.
324 // 324 //
325 int delay_msec = GetCurrentDelay(); 325 int delay_msec = GetCurrentDelay();
326 DCHECK_GE(delay_msec, 0); 326 DCHECK_GE(delay_msec, 0);
327 if (delay_msec == 0) { 327 if (delay_msec == 0) {
328 ScheduleWork(); 328 ScheduleWork();
329 } else { 329 } else {
330 if (delay_msec < USER_TIMER_MINIMUM) 330 if (delay_msec < USER_TIMER_MINIMUM)
331 delay_msec = USER_TIMER_MINIMUM; 331 delay_msec = USER_TIMER_MINIMUM;
332 332
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
672 672
673 // static 673 // static
674 MessagePumpForIO::IOHandler* MessagePumpForIO::KeyToHandler( 674 MessagePumpForIO::IOHandler* MessagePumpForIO::KeyToHandler(
675 ULONG_PTR key, 675 ULONG_PTR key,
676 bool* has_valid_io_context) { 676 bool* has_valid_io_context) {
677 *has_valid_io_context = ((key & 1) == 0); 677 *has_valid_io_context = ((key & 1) == 0);
678 return reinterpret_cast<IOHandler*>(key & ~static_cast<ULONG_PTR>(1)); 678 return reinterpret_cast<IOHandler*>(key & ~static_cast<ULONG_PTR>(1));
679 } 679 }
680 680
681 } // namespace base 681 } // namespace base
OLDNEW
« no previous file with comments | « base/message_loop/message_pump_win.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698