| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "chromeos/binder/ipc_thread.h" | 5 #include "chromeos/binder/ipc_thread.h" |
| 6 | 6 |
| 7 #include "chromeos/binder/command_broker.h" | 7 #include "chromeos/binder/command_broker.h" |
| 8 #include "chromeos/binder/driver.h" | 8 #include "chromeos/binder/driver.h" |
| 9 | 9 |
| 10 namespace binder { | 10 namespace binder { |
| 11 | 11 |
| 12 // IpcThreadPoller | 12 // IpcThreadPoller |
| 13 IpcThreadPoller::IpcThreadPoller(ThreadType type, Driver* driver) | 13 IpcThreadPoller::IpcThreadPoller(ThreadType type, Driver* driver) |
| 14 : type_(type), driver_(driver), command_broker_(driver) {} | 14 : type_(type), |
| 15 driver_(driver), |
| 16 command_broker_(driver), |
| 17 watcher_(FROM_HERE) {} |
| 15 | 18 |
| 16 IpcThreadPoller::~IpcThreadPoller() { | 19 IpcThreadPoller::~IpcThreadPoller() { |
| 17 if (!command_broker_.ExitLooper()) { | 20 if (!command_broker_.ExitLooper()) { |
| 18 LOG(ERROR) << "Failed to exit looper."; | 21 LOG(ERROR) << "Failed to exit looper."; |
| 19 } | 22 } |
| 20 if (!driver_->NotifyCurrentThreadExiting()) { | 23 if (!driver_->NotifyCurrentThreadExiting()) { |
| 21 LOG(ERROR) << "Failed to send thread exit."; | 24 LOG(ERROR) << "Failed to send thread exit."; |
| 22 } | 25 } |
| 23 } | 26 } |
| 24 | 27 |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 return; | 115 return; |
| 113 } | 116 } |
| 114 initialized_ = true; | 117 initialized_ = true; |
| 115 } | 118 } |
| 116 | 119 |
| 117 void SubIpcThread::CleanUp() { | 120 void SubIpcThread::CleanUp() { |
| 118 poller_.reset(); | 121 poller_.reset(); |
| 119 } | 122 } |
| 120 | 123 |
| 121 } // namespace binder | 124 } // namespace binder |
| OLD | NEW |