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

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

Issue 1551943002: Rewrite most of the scopers in //base/mac to use ScopedTypeRef or ScopedGeneric. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix iOS Created 4 years, 11 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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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_io_ios.h" 5 #include "base/message_loop/message_pump_io_ios.h"
6 6
7 #include <unistd.h> 7 #include <unistd.h>
8 8
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 26 matching lines...) Expand all
37 if (IGNORE_EINTR(close(pipefds_[1])) < 0) 37 if (IGNORE_EINTR(close(pipefds_[1])) < 0)
38 PLOG(ERROR) << "close"; 38 PLOG(ERROR) << "close";
39 } 39 }
40 40
41 MessageLoop* ui_loop() { return &ui_loop_; } 41 MessageLoop* ui_loop() { return &ui_loop_; }
42 MessageLoopForIO* io_loop() const { 42 MessageLoopForIO* io_loop() const {
43 return static_cast<MessageLoopForIO*>(io_thread_.message_loop()); 43 return static_cast<MessageLoopForIO*>(io_thread_.message_loop());
44 } 44 }
45 45
46 void HandleFdIOEvent(MessageLoopForIO::FileDescriptorWatcher* watcher) { 46 void HandleFdIOEvent(MessageLoopForIO::FileDescriptorWatcher* watcher) {
47 MessagePumpIOSForIO::HandleFdIOEvent(watcher->fdref_, 47 MessagePumpIOSForIO::HandleFdIOEvent(watcher->fdref_.get(),
48 kCFFileDescriptorReadCallBack | kCFFileDescriptorWriteCallBack, 48 kCFFileDescriptorReadCallBack | kCFFileDescriptorWriteCallBack,
49 watcher); 49 watcher);
50 } 50 }
51 51
52 int pipefds_[2]; 52 int pipefds_[2];
53 int alternate_pipefds_[2]; 53 int alternate_pipefds_[2];
54 54
55 private: 55 private:
56 MessageLoop ui_loop_; 56 MessageLoop ui_loop_;
57 Thread io_thread_; 57 Thread io_thread_;
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 pump->WatchFileDescriptor(pipefds_[1], 174 pump->WatchFileDescriptor(pipefds_[1],
175 false, MessagePumpIOSForIO::WATCH_READ_WRITE, &watcher, &delegate); 175 false, MessagePumpIOSForIO::WATCH_READ_WRITE, &watcher, &delegate);
176 176
177 // Spoof a callback. 177 // Spoof a callback.
178 HandleFdIOEvent(&watcher); 178 HandleFdIOEvent(&watcher);
179 } 179 }
180 180
181 } // namespace 181 } // namespace
182 182
183 } // namespace base 183 } // namespace base
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698