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 "components/drive/file_system_core_util.h" | 5 #include "components/drive/file_system_core_util.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/bind.h" | 13 #include "base/bind.h" |
14 #include "base/bind_helpers.h" | 14 #include "base/bind_helpers.h" |
15 #include "base/files/file_path.h" | 15 #include "base/files/file_path.h" |
16 #include "base/files/file_util.h" | 16 #include "base/files/file_util.h" |
17 #include "base/i18n/icu_string_conversions.h" | 17 #include "base/i18n/icu_string_conversions.h" |
18 #include "base/json/json_file_value_serializer.h" | 18 #include "base/json/json_file_value_serializer.h" |
19 #include "base/logging.h" | 19 #include "base/logging.h" |
20 #include "base/memory/scoped_ptr.h" | 20 #include "base/memory/scoped_ptr.h" |
21 #include "base/prefs/pref_service.h" | |
22 #include "base/strings/string_number_conversions.h" | 21 #include "base/strings/string_number_conversions.h" |
23 #include "base/strings/string_util.h" | 22 #include "base/strings/string_util.h" |
24 #include "base/strings/stringprintf.h" | 23 #include "base/strings/stringprintf.h" |
25 #include "base/thread_task_runner_handle.h" | 24 #include "base/thread_task_runner_handle.h" |
26 #include "base/threading/sequenced_worker_pool.h" | 25 #include "base/threading/sequenced_worker_pool.h" |
27 #include "components/drive/drive.pb.h" | 26 #include "components/drive/drive.pb.h" |
28 #include "components/drive/drive_pref_names.h" | 27 #include "components/drive/drive_pref_names.h" |
29 #include "components/drive/job_list.h" | 28 #include "components/drive/job_list.h" |
| 29 #include "components/prefs/pref_service.h" |
30 | 30 |
31 namespace drive { | 31 namespace drive { |
32 namespace util { | 32 namespace util { |
33 | 33 |
34 namespace { | 34 namespace { |
35 | 35 |
36 std::string ReadStringFromGDocFile(const base::FilePath& file_path, | 36 std::string ReadStringFromGDocFile(const base::FilePath& file_path, |
37 const std::string& key) { | 37 const std::string& key) { |
38 const int64_t kMaxGDocSize = 4096; | 38 const int64_t kMaxGDocSize = 4096; |
39 int64_t file_size = 0; | 39 int64_t file_size = 0; |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 GURL ReadUrlFromGDocFile(const base::FilePath& file_path) { | 135 GURL ReadUrlFromGDocFile(const base::FilePath& file_path) { |
136 return GURL(ReadStringFromGDocFile(file_path, "url")); | 136 return GURL(ReadStringFromGDocFile(file_path, "url")); |
137 } | 137 } |
138 | 138 |
139 std::string ReadResourceIdFromGDocFile(const base::FilePath& file_path) { | 139 std::string ReadResourceIdFromGDocFile(const base::FilePath& file_path) { |
140 return ReadStringFromGDocFile(file_path, "resource_id"); | 140 return ReadStringFromGDocFile(file_path, "resource_id"); |
141 } | 141 } |
142 | 142 |
143 } // namespace util | 143 } // namespace util |
144 } // namespace drive | 144 } // namespace drive |
OLD | NEW |