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

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

Issue 2824533002: Migrate Bind to BindOnce or BindRepeating in //base/message_loop (Closed)
Patch Set: Created 3 years, 8 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 (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 <math.h> 7 #include <math.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <limits> 10 #include <limits>
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 return timeout < 0 ? 0 : 83 return timeout < 0 ? 0 :
84 (timeout > std::numeric_limits<int>::max() ? 84 (timeout > std::numeric_limits<int>::max() ?
85 std::numeric_limits<int>::max() : static_cast<int>(timeout)); 85 std::numeric_limits<int>::max() : static_cast<int>(timeout));
86 } 86 }
87 87
88 //----------------------------------------------------------------------------- 88 //-----------------------------------------------------------------------------
89 // MessagePumpForUI public: 89 // MessagePumpForUI public:
90 90
91 MessagePumpForUI::MessagePumpForUI() { 91 MessagePumpForUI::MessagePumpForUI() {
92 bool succeeded = message_window_.Create( 92 bool succeeded = message_window_.Create(
93 Bind(&MessagePumpForUI::MessageCallback, Unretained(this))); 93 BindRepeating(&MessagePumpForUI::MessageCallback, Unretained(this)));
94 DCHECK(succeeded); 94 DCHECK(succeeded);
95 } 95 }
96 96
97 MessagePumpForUI::~MessagePumpForUI() = default; 97 MessagePumpForUI::~MessagePumpForUI() = default;
98 98
99 void MessagePumpForUI::ScheduleWork() { 99 void MessagePumpForUI::ScheduleWork() {
100 if (InterlockedExchange(&work_state_, HAVE_WORK) != READY) 100 if (InterlockedExchange(&work_state_, HAVE_WORK) != READY)
101 return; // Someone else continued the pumping. 101 return; // Someone else continued the pumping.
102 102
103 // Make sure the MessagePump does some work for us. 103 // Make sure the MessagePump does some work for us.
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after
571 if (!filter || it->handler == filter) { 571 if (!filter || it->handler == filter) {
572 *item = *it; 572 *item = *it;
573 completed_io_.erase(it); 573 completed_io_.erase(it);
574 return true; 574 return true;
575 } 575 }
576 } 576 }
577 return false; 577 return false;
578 } 578 }
579 579
580 } // namespace base 580 } // namespace base
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698