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/media_galleries/ipc_data_source.h" | 5 #include "chrome/utility/media_galleries/ipc_data_source.h" |
6 | 6 |
7 #include "base/message_loop/message_loop_proxy.h" | 7 #include "base/message_loop/message_loop_proxy.h" |
8 #include "chrome/common/chrome_utility_messages.h" | 8 #include "chrome/common/extensions/chrome_utility_extensions_messages.h" |
9 #include "content/public/utility/utility_thread.h" | 9 #include "content/public/utility/utility_thread.h" |
10 | 10 |
11 namespace metadata { | 11 namespace metadata { |
12 | 12 |
13 IPCDataSource::IPCDataSource(int64 total_size) | 13 IPCDataSource::IPCDataSource(int64 total_size) |
14 : total_size_(total_size), | 14 : total_size_(total_size), |
15 utility_task_runner_(base::MessageLoopProxy::current()), | 15 utility_task_runner_(base::MessageLoopProxy::current()), |
16 next_request_id_(0) { | 16 next_request_id_(0) { |
17 data_source_thread_checker_.DetachFromThread(); | 17 data_source_thread_checker_.DetachFromThread(); |
18 } | 18 } |
(...skipping 80 matching lines...) Loading... |
99 if (it == pending_requests_.end()) | 99 if (it == pending_requests_.end()) |
100 return; | 100 return; |
101 | 101 |
102 std::copy(bytes.begin(), bytes.end(), it->second.destination); | 102 std::copy(bytes.begin(), bytes.end(), it->second.destination); |
103 it->second.callback.Run(bytes.size()); | 103 it->second.callback.Run(bytes.size()); |
104 | 104 |
105 pending_requests_.erase(it); | 105 pending_requests_.erase(it); |
106 } | 106 } |
107 | 107 |
108 } // namespace metadata | 108 } // namespace metadata |
OLD | NEW |