OLD | NEW |
1 // Copyright (c) 2009 The Chromium OS Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium OS 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 "service.h" | 5 #include "service.h" |
6 | 6 |
7 #include <stdio.h> | 7 #include <stdio.h> |
8 #include <stdlib.h> | 8 #include <stdlib.h> |
9 | 9 |
10 #include <base/file_util.h> | 10 #include <base/file_util.h> |
(...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
486 | 486 |
487 gboolean Service::AsyncRemoveTrackedSubdirectories(gint *OUT_async_id, | 487 gboolean Service::AsyncRemoveTrackedSubdirectories(gint *OUT_async_id, |
488 GError **error) { | 488 GError **error) { |
489 MountTaskRemoveTrackedSubdirectories* mount_task = | 489 MountTaskRemoveTrackedSubdirectories* mount_task = |
490 new MountTaskRemoveTrackedSubdirectories(this, mount_); | 490 new MountTaskRemoveTrackedSubdirectories(this, mount_); |
491 *OUT_async_id = mount_task->sequence_id(); | 491 *OUT_async_id = mount_task->sequence_id(); |
492 mount_thread_.message_loop()->PostTask(FROM_HERE, mount_task); | 492 mount_thread_.message_loop()->PostTask(FROM_HERE, mount_task); |
493 return TRUE; | 493 return TRUE; |
494 } | 494 } |
495 | 495 |
| 496 gboolean Service::DoAutomaticFreeDiskSpaceControl(gboolean *OUT_result, |
| 497 GError **error) { |
| 498 MountTaskResult result; |
| 499 base::WaitableEvent event(true, false); |
| 500 MountTaskAutomaticFreeDiskSpace* mount_task = |
| 501 new MountTaskAutomaticFreeDiskSpace(this, mount_); |
| 502 mount_task->set_result(&result); |
| 503 mount_task->set_complete_event(&event); |
| 504 mount_thread_.message_loop()->PostTask(FROM_HERE, mount_task); |
| 505 event.Wait(); |
| 506 *OUT_result = result.return_status(); |
| 507 return TRUE; |
| 508 } |
| 509 |
| 510 gboolean Service::AsyncDoAutomaticFreeDiskSpaceControl(gint *OUT_async_id, |
| 511 GError **error) { |
| 512 MountTaskAutomaticFreeDiskSpace* mount_task = |
| 513 new MountTaskAutomaticFreeDiskSpace(this, mount_); |
| 514 *OUT_async_id = mount_task->sequence_id(); |
| 515 mount_thread_.message_loop()->PostTask(FROM_HERE, mount_task); |
| 516 return TRUE; |
| 517 } |
| 518 |
496 gboolean Service::TpmIsReady(gboolean* OUT_ready, GError** error) { | 519 gboolean Service::TpmIsReady(gboolean* OUT_ready, GError** error) { |
497 *OUT_ready = tpm_init_->IsTpmReady(); | 520 *OUT_ready = tpm_init_->IsTpmReady(); |
498 return TRUE; | 521 return TRUE; |
499 } | 522 } |
500 | 523 |
501 gboolean Service::TpmIsEnabled(gboolean* OUT_enabled, GError** error) { | 524 gboolean Service::TpmIsEnabled(gboolean* OUT_enabled, GError** error) { |
502 *OUT_enabled = tpm_init_->IsTpmEnabled(); | 525 *OUT_enabled = tpm_init_->IsTpmEnabled(); |
503 return TRUE; | 526 return TRUE; |
504 } | 527 } |
505 | 528 |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
625 (tpm_status.CanDecrypt ? "1" : "0"), | 648 (tpm_status.CanDecrypt ? "1" : "0"), |
626 (tpm_status.ThisInstanceHasContext ? "1" : "0"), | 649 (tpm_status.ThisInstanceHasContext ? "1" : "0"), |
627 (tpm_status.ThisInstanceHasKeyHandle ? "1" : "0"), | 650 (tpm_status.ThisInstanceHasKeyHandle ? "1" : "0"), |
628 tpm_status.LastTpmError, | 651 tpm_status.LastTpmError, |
629 user_data.c_str(), | 652 user_data.c_str(), |
630 (mount_->IsCryptohomeMounted() ? "1" : "0")); | 653 (mount_->IsCryptohomeMounted() ? "1" : "0")); |
631 return TRUE; | 654 return TRUE; |
632 } | 655 } |
633 | 656 |
634 } // namespace cryptohome | 657 } // namespace cryptohome |
OLD | NEW |