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

Side by Side Diff: mojo/common/handle_watcher.cc

Issue 190973008: Mojo: Remove implicit scoped_refptr<T> -> T* conversions in mojo/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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 | « no previous file | mojo/system/message_in_transit.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "mojo/common/handle_watcher.h" 5 #include "mojo/common/handle_watcher.h"
6 6
7 #include <map> 7 #include <map>
8 8
9 #include "base/atomic_sequence_num.h" 9 #include "base/atomic_sequence_num.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 MojoWaitFlags wait_flags, 190 MojoWaitFlags wait_flags,
191 base::TimeTicks deadline, 191 base::TimeTicks deadline,
192 const base::Callback<void(MojoResult)>& callback) { 192 const base::Callback<void(MojoResult)>& callback) {
193 WatchData data; 193 WatchData data;
194 data.id = watcher_id_generator_.GetNext(); 194 data.id = watcher_id_generator_.GetNext();
195 data.handle = handle; 195 data.handle = handle;
196 data.callback = callback; 196 data.callback = callback;
197 data.wait_flags = wait_flags; 197 data.wait_flags = wait_flags;
198 data.deadline = deadline; 198 data.deadline = deadline;
199 data.message_loop = base::MessageLoopProxy::current(); 199 data.message_loop = base::MessageLoopProxy::current();
200 DCHECK_NE(static_cast<base::MessageLoopProxy*>(NULL), data.message_loop); 200 DCHECK_NE(static_cast<base::MessageLoopProxy*>(NULL),
201 data.message_loop.get());
201 // We outlive |thread_|, so it's safe to use Unretained() here. 202 // We outlive |thread_|, so it's safe to use Unretained() here.
202 thread_.message_loop()->PostTask( 203 thread_.message_loop()->PostTask(
203 FROM_HERE, 204 FROM_HERE,
204 base::Bind(&WatcherBackend::StartWatching, 205 base::Bind(&WatcherBackend::StartWatching,
205 base::Unretained(&backend_), 206 base::Unretained(&backend_),
206 data)); 207 data));
207 return data.id; 208 return data.id;
208 } 209 }
209 210
210 void WatcherThreadManager::StopWatching(WatcherID watcher_id) { 211 void WatcherThreadManager::StopWatching(WatcherID watcher_id) {
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 } 309 }
309 310
310 // static 311 // static
311 base::TimeTicks HandleWatcher::MojoDeadlineToTimeTicks(MojoDeadline deadline) { 312 base::TimeTicks HandleWatcher::MojoDeadlineToTimeTicks(MojoDeadline deadline) {
312 return deadline == MOJO_DEADLINE_INDEFINITE ? base::TimeTicks() : 313 return deadline == MOJO_DEADLINE_INDEFINITE ? base::TimeTicks() :
313 NowTicks() + base::TimeDelta::FromMicroseconds(deadline); 314 NowTicks() + base::TimeDelta::FromMicroseconds(deadline);
314 } 315 }
315 316
316 } // namespace common 317 } // namespace common
317 } // namespace mojo 318 } // namespace mojo
OLDNEW
« no previous file with comments | « no previous file | mojo/system/message_in_transit.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698