| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/browser/chromeos/drive/file_system/set_property_operation.h" | 5 #include "chrome/browser/chromeos/drive/file_system/set_property_operation.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
| 9 #include "base/sequenced_task_runner.h" | 9 #include "base/sequenced_task_runner.h" |
| 10 #include "chrome/browser/chromeos/drive/drive.pb.h" | |
| 11 #include "chrome/browser/chromeos/drive/file_errors.h" | 10 #include "chrome/browser/chromeos/drive/file_errors.h" |
| 12 #include "chrome/browser/chromeos/drive/file_system/operation_delegate.h" | 11 #include "chrome/browser/chromeos/drive/file_system/operation_delegate.h" |
| 13 #include "chrome/browser/chromeos/drive/job_scheduler.h" | 12 #include "chrome/browser/chromeos/drive/job_scheduler.h" |
| 14 #include "chrome/browser/chromeos/drive/resource_metadata.h" | 13 #include "chrome/browser/chromeos/drive/resource_metadata.h" |
| 14 #include "components/drive/drive.pb.h" |
| 15 | 15 |
| 16 namespace drive { | 16 namespace drive { |
| 17 namespace file_system { | 17 namespace file_system { |
| 18 | 18 |
| 19 namespace { | 19 namespace { |
| 20 | 20 |
| 21 // Adds the property to resource entry. Overwrites existing property if exists. | 21 // Adds the property to resource entry. Overwrites existing property if exists. |
| 22 // If no change has been made (same key, visibility and value is already added) | 22 // If no change has been made (same key, visibility and value is already added) |
| 23 // then FILE_ERROR_EXISTS is returned. | 23 // then FILE_ERROR_EXISTS is returned. |
| 24 FileError UpdateLocalState(internal::ResourceMetadata* metadata, | 24 FileError UpdateLocalState(internal::ResourceMetadata* metadata, |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 entry->local_id()); | 113 entry->local_id()); |
| 114 } | 114 } |
| 115 | 115 |
| 116 // Even if exists, return success, as the set property operation always | 116 // Even if exists, return success, as the set property operation always |
| 117 // overwrites existing values. | 117 // overwrites existing values. |
| 118 callback.Run(result == FILE_ERROR_EXISTS ? FILE_ERROR_OK : result); | 118 callback.Run(result == FILE_ERROR_EXISTS ? FILE_ERROR_OK : result); |
| 119 } | 119 } |
| 120 | 120 |
| 121 } // namespace file_system | 121 } // namespace file_system |
| 122 } // namespace drive | 122 } // namespace drive |
| OLD | NEW |