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" |
11 #include "base/strings/string_number_conversions.h" | 11 #include "base/strings/string_number_conversions.h" |
12 #include "chrome/browser/drive/drive_api_util.h" | 12 #include "chrome/browser/drive/drive_api_util.h" |
13 #include "chrome/browser/sync_file_system/drive_backend/drive_backend_constants.
h" | 13 #include "chrome/browser/sync_file_system/drive_backend/drive_backend_constants.
h" |
14 #include "chrome/browser/sync_file_system/drive_backend/metadata_database.pb.h" | 14 #include "chrome/browser/sync_file_system/drive_backend/metadata_database.pb.h" |
15 #include "chrome/browser/sync_file_system/logger.h" | 15 #include "chrome/browser/sync_file_system/logger.h" |
16 #include "google_apis/drive/drive_api_parser.h" | 16 #include "google_apis/drive/drive_api_parser.h" |
17 #include "google_apis/drive/gdata_wapi_parser.h" | 17 #include "google_apis/drive/gdata_wapi_parser.h" |
18 #include "net/base/mime_util.h" | 18 #include "net/base/mime_util.h" |
19 #include "third_party/leveldatabase/src/include/leveldb/write_batch.h" | 19 #include "third_party/leveldatabase/src/include/leveldb/write_batch.h" |
20 | 20 |
21 namespace sync_file_system { | 21 namespace sync_file_system { |
22 namespace drive_backend { | 22 namespace drive_backend { |
23 | 23 |
24 namespace { | |
25 | |
26 const char kMimeTypeOctetStream[] = "application/octet-stream"; | |
27 | |
28 } // namespace | |
29 | |
30 void PutServiceMetadataToBatch(const ServiceMetadata& service_metadata, | 24 void PutServiceMetadataToBatch(const ServiceMetadata& service_metadata, |
31 leveldb::WriteBatch* batch) { | 25 leveldb::WriteBatch* batch) { |
32 std::string value; | 26 std::string value; |
33 bool success = service_metadata.SerializeToString(&value); | 27 bool success = service_metadata.SerializeToString(&value); |
34 DCHECK(success); | 28 DCHECK(success); |
35 batch->Put(kServiceMetadataKey, value); | 29 batch->Put(kServiceMetadataKey, value); |
36 } | 30 } |
37 | 31 |
38 void PutFileToBatch(const FileMetadata& file, leveldb::WriteBatch* batch) { | 32 void PutFileToBatch(const FileMetadata& file, leveldb::WriteBatch* batch) { |
39 std::string value; | 33 std::string value; |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 | 241 |
248 util::Log(logging::LOG_WARNING, | 242 util::Log(logging::LOG_WARNING, |
249 FROM_HERE, | 243 FROM_HERE, |
250 "Got unexpected error: %d", | 244 "Got unexpected error: %d", |
251 static_cast<int>(error)); | 245 static_cast<int>(error)); |
252 return SYNC_STATUS_FAILED; | 246 return SYNC_STATUS_FAILED; |
253 } | 247 } |
254 | 248 |
255 } // namespace drive_backend | 249 } // namespace drive_backend |
256 } // namespace sync_file_system | 250 } // namespace sync_file_system |
OLD | NEW |