OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "chrome/utility/image_writer/disk_unmounter_mac.h" | 5 #include "chrome/utility/image_writer/disk_unmounter_mac.h" |
6 | 6 |
7 #include <sys/socket.h> | 7 #include <sys/socket.h> |
8 #include <IOKit/storage/IOStorageProtocolCharacteristics.h> | 8 #include <IOKit/storage/IOStorageProtocolCharacteristics.h> |
9 | 9 |
10 #include "base/message_loop/message_pump_mac.h" | 10 #include "base/message_loop/message_pump_mac.h" |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 LOG(ERROR) << "Unable to unmount disk."; | 82 LOG(ERROR) << "Unable to unmount disk."; |
83 disk_unmounter->Error(); | 83 disk_unmounter->Error(); |
84 return; | 84 return; |
85 } | 85 } |
86 | 86 |
87 disk_unmounter->original_thread_->PostTask( | 87 disk_unmounter->original_thread_->PostTask( |
88 FROM_HERE, disk_unmounter->success_continuation_); | 88 FROM_HERE, disk_unmounter->success_continuation_); |
89 } | 89 } |
90 | 90 |
91 // static | 91 // static |
92 scoped_ptr<base::MessagePump> DiskUnmounterMac::CreateMessagePump() { | 92 std::unique_ptr<base::MessagePump> DiskUnmounterMac::CreateMessagePump() { |
93 return scoped_ptr<base::MessagePump>(new base::MessagePumpCFRunLoop); | 93 return std::unique_ptr<base::MessagePump>(new base::MessagePumpCFRunLoop); |
94 } | 94 } |
95 | 95 |
96 void DiskUnmounterMac::UnmountOnWorker(const std::string& device_path) { | 96 void DiskUnmounterMac::UnmountOnWorker(const std::string& device_path) { |
97 DCHECK(cf_thread_.message_loop() == base::MessageLoop::current()); | 97 DCHECK(cf_thread_.message_loop() == base::MessageLoop::current()); |
98 | 98 |
99 session_.reset(DASessionCreate(NULL)); | 99 session_.reset(DASessionCreate(NULL)); |
100 | 100 |
101 DASessionScheduleWithRunLoop( | 101 DASessionScheduleWithRunLoop( |
102 session_, CFRunLoopGetCurrent(), kCFRunLoopCommonModes); | 102 session_, CFRunLoopGetCurrent(), kCFRunLoopCommonModes); |
103 | 103 |
(...skipping 12 matching lines...) Expand all Loading... |
116 this, | 116 this, |
117 DiskClaimed, | 117 DiskClaimed, |
118 this); | 118 this); |
119 } | 119 } |
120 | 120 |
121 void DiskUnmounterMac::Error() { | 121 void DiskUnmounterMac::Error() { |
122 original_thread_->PostTask(FROM_HERE, failure_continuation_); | 122 original_thread_->PostTask(FROM_HERE, failure_continuation_); |
123 } | 123 } |
124 | 124 |
125 } // namespace image_writer | 125 } // namespace image_writer |
OLD | NEW |