| 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 "chrome/browser/sync_file_system/drive_backend/drive_backend_util.h" | 5 #include "chrome/browser/sync_file_system/drive_backend/drive_backend_util.h" |
| 6 | 6 |
| 7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/memory/scoped_vector.h" | 9 #include "base/memory/scoped_vector.h" |
| 10 #include "base/message_loop/message_loop_proxy.h" | 10 #include "base/message_loop/message_loop_proxy.h" |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 const std::string& file_id) { | 117 const std::string& file_id) { |
| 118 scoped_ptr<FileMetadata> file(new FileMetadata); | 118 scoped_ptr<FileMetadata> file(new FileMetadata); |
| 119 file->set_file_id(file_id); | 119 file->set_file_id(file_id); |
| 120 | 120 |
| 121 FileDetails* details = file->mutable_details(); | 121 FileDetails* details = file->mutable_details(); |
| 122 details->set_change_id(change_id); | 122 details->set_change_id(change_id); |
| 123 details->set_missing(true); | 123 details->set_missing(true); |
| 124 return file.Pass(); | 124 return file.Pass(); |
| 125 } | 125 } |
| 126 | 126 |
| 127 webkit_blob::ScopedFile CreateTemporaryFile() { | 127 webkit_blob::ScopedFile CreateTemporaryFile( |
| 128 base::TaskRunner* file_task_runner) { |
| 128 base::FilePath temp_file_path; | 129 base::FilePath temp_file_path; |
| 129 if (!file_util::CreateTemporaryFile(&temp_file_path)) | 130 if (!file_util::CreateTemporaryFile(&temp_file_path)) |
| 130 return webkit_blob::ScopedFile(); | 131 return webkit_blob::ScopedFile(); |
| 131 | 132 |
| 132 return webkit_blob::ScopedFile( | 133 return webkit_blob::ScopedFile( |
| 133 temp_file_path, | 134 temp_file_path, |
| 134 webkit_blob::ScopedFile::DELETE_ON_SCOPE_OUT, | 135 webkit_blob::ScopedFile::DELETE_ON_SCOPE_OUT, |
| 135 base::MessageLoopProxy::current().get()); | 136 file_task_runner); |
| 136 } | 137 } |
| 137 | 138 |
| 138 std::string FileKindToString(FileKind file_kind) { | 139 std::string FileKindToString(FileKind file_kind) { |
| 139 switch (file_kind) { | 140 switch (file_kind) { |
| 140 case FILE_KIND_UNSUPPORTED: | 141 case FILE_KIND_UNSUPPORTED: |
| 141 return "unsupported"; | 142 return "unsupported"; |
| 142 case FILE_KIND_FILE: | 143 case FILE_KIND_FILE: |
| 143 return "file"; | 144 return "file"; |
| 144 case FILE_KIND_FOLDER: | 145 case FILE_KIND_FOLDER: |
| 145 return "folder"; | 146 return "folder"; |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 oldest.reset(entry); | 179 oldest.reset(entry); |
| 179 candidates[i] = NULL; | 180 candidates[i] = NULL; |
| 180 } | 181 } |
| 181 } | 182 } |
| 182 | 183 |
| 183 return oldest.Pass(); | 184 return oldest.Pass(); |
| 184 } | 185 } |
| 185 | 186 |
| 186 } // namespace drive_backend | 187 } // namespace drive_backend |
| 187 } // namespace sync_file_system | 188 } // namespace sync_file_system |
| OLD | NEW |