OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "chromeos/dbus/image_burner_client.h" | 5 #include "chromeos/dbus/image_burner_client.h" |
6 | 6 |
| 7 #include <stdint.h> |
| 8 |
7 #include "base/bind.h" | 9 #include "base/bind.h" |
8 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| 11 #include "base/macros.h" |
9 #include "dbus/bus.h" | 12 #include "dbus/bus.h" |
10 #include "dbus/message.h" | 13 #include "dbus/message.h" |
11 #include "dbus/object_path.h" | 14 #include "dbus/object_path.h" |
12 #include "dbus/object_proxy.h" | 15 #include "dbus/object_proxy.h" |
13 #include "third_party/cros_system_api/dbus/service_constants.h" | 16 #include "third_party/cros_system_api/dbus/service_constants.h" |
14 | 17 |
15 namespace chromeos { | 18 namespace chromeos { |
16 | 19 |
17 namespace { | 20 namespace { |
18 | 21 |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 return; | 98 return; |
96 } | 99 } |
97 if (!burn_finished_handler_.is_null()) | 100 if (!burn_finished_handler_.is_null()) |
98 burn_finished_handler_.Run(target_path, success, error); | 101 burn_finished_handler_.Run(target_path, success, error); |
99 } | 102 } |
100 | 103 |
101 // Handles burn_progress_udpate signal and calls |handler|. | 104 // Handles burn_progress_udpate signal and calls |handler|. |
102 void OnBurnProgressUpdate(dbus::Signal* signal) { | 105 void OnBurnProgressUpdate(dbus::Signal* signal) { |
103 dbus::MessageReader reader(signal); | 106 dbus::MessageReader reader(signal); |
104 std::string target_path; | 107 std::string target_path; |
105 int64 num_bytes_burnt; | 108 int64_t num_bytes_burnt; |
106 int64 total_size; | 109 int64_t total_size; |
107 if (!reader.PopString(&target_path) || | 110 if (!reader.PopString(&target_path) || |
108 !reader.PopInt64(&num_bytes_burnt) || | 111 !reader.PopInt64(&num_bytes_burnt) || |
109 !reader.PopInt64(&total_size)) { | 112 !reader.PopInt64(&total_size)) { |
110 LOG(ERROR) << "Invalid signal: " << signal->ToString(); | 113 LOG(ERROR) << "Invalid signal: " << signal->ToString(); |
111 return; | 114 return; |
112 } | 115 } |
113 if (!burn_progress_update_handler_.is_null()) | 116 if (!burn_progress_update_handler_.is_null()) |
114 burn_progress_update_handler_.Run(target_path, num_bytes_burnt, | 117 burn_progress_update_handler_.Run(target_path, num_bytes_burnt, |
115 total_size); | 118 total_size); |
116 } | 119 } |
(...skipping 24 matching lines...) Expand all Loading... |
141 | 144 |
142 ImageBurnerClient::~ImageBurnerClient() { | 145 ImageBurnerClient::~ImageBurnerClient() { |
143 } | 146 } |
144 | 147 |
145 // static | 148 // static |
146 ImageBurnerClient* ImageBurnerClient::Create() { | 149 ImageBurnerClient* ImageBurnerClient::Create() { |
147 return new ImageBurnerClientImpl(); | 150 return new ImageBurnerClientImpl(); |
148 } | 151 } |
149 | 152 |
150 } // namespace chromeos | 153 } // namespace chromeos |
OLD | NEW |