OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/fake_cryptohome_client.h" | 5 #include "chromeos/dbus/fake_cryptohome_client.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 bool FakeCryptohomeClient::InstallAttributesFinalize(bool* successful) { | 285 bool FakeCryptohomeClient::InstallAttributesFinalize(bool* successful) { |
286 locked_ = true; | 286 locked_ = true; |
287 *successful = true; | 287 *successful = true; |
288 | 288 |
289 // Persist the install attributes so that they can be reloaded if the | 289 // Persist the install attributes so that they can be reloaded if the |
290 // browser is restarted. This is used for ease of development when device | 290 // browser is restarted. This is used for ease of development when device |
291 // enrollment is required. | 291 // enrollment is required. |
292 // The cryptohome::SerializedInstallAttributes protobuf lives in | 292 // The cryptohome::SerializedInstallAttributes protobuf lives in |
293 // chrome/browser/chromeos, so it can't be used directly here; use the | 293 // chrome/browser/chromeos, so it can't be used directly here; use the |
294 // low-level protobuf API instead to just write the name-value pairs. | 294 // low-level protobuf API instead to just write the name-value pairs. |
295 // The cache file is read by EnterpriseInstallAttributes::Init. | 295 // The cache file is read by InstallAttributes::Init. |
296 base::FilePath cache_path; | 296 base::FilePath cache_path; |
297 if (!PathService::Get(chromeos::FILE_INSTALL_ATTRIBUTES, &cache_path)) | 297 if (!PathService::Get(chromeos::FILE_INSTALL_ATTRIBUTES, &cache_path)) |
298 return false; | 298 return false; |
299 | 299 |
300 std::string result; | 300 std::string result; |
301 { | 301 { |
302 // |result| can be used only after the StringOutputStream goes out of | 302 // |result| can be used only after the StringOutputStream goes out of |
303 // scope. | 303 // scope. |
304 google::protobuf::io::StringOutputStream result_stream(&result); | 304 google::protobuf::io::StringOutputStream result_stream(&result); |
305 google::protobuf::io::CodedOutputStream result_output(&result_stream); | 305 google::protobuf::io::CodedOutputStream result_output(&result_stream); |
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
632 callback.Run(async_call_id_); | 632 callback.Run(async_call_id_); |
633 if (!async_call_status_data_handler_.is_null()) { | 633 if (!async_call_status_data_handler_.is_null()) { |
634 base::ThreadTaskRunnerHandle::Get()->PostTask( | 634 base::ThreadTaskRunnerHandle::Get()->PostTask( |
635 FROM_HERE, base::Bind(async_call_status_data_handler_, async_call_id_, | 635 FROM_HERE, base::Bind(async_call_status_data_handler_, async_call_id_, |
636 true, data)); | 636 true, data)); |
637 } | 637 } |
638 ++async_call_id_; | 638 ++async_call_id_; |
639 } | 639 } |
640 | 640 |
641 } // namespace chromeos | 641 } // namespace chromeos |
OLD | NEW |