OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_cache.h" | 5 #include "chrome/browser/chromeos/drive/file_cache.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/callback_helpers.h" | 9 #include "base/callback_helpers.h" |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
11 #include "base/files/file_enumerator.h" | 11 #include "base/files/file_enumerator.h" |
12 #include "base/logging.h" | 12 #include "base/logging.h" |
13 #include "base/metrics/histogram.h" | 13 #include "base/metrics/histogram.h" |
14 #include "base/strings/string_util.h" | 14 #include "base/strings/string_util.h" |
15 #include "base/strings/stringprintf.h" | 15 #include "base/strings/stringprintf.h" |
16 #include "base/sys_info.h" | 16 #include "base/sys_info.h" |
17 #include "chrome/browser/chromeos/drive/drive.pb.h" | 17 #include "chrome/browser/chromeos/drive/drive.pb.h" |
18 #include "chrome/browser/chromeos/drive/file_system_util.h" | 18 #include "chrome/browser/chromeos/drive/file_system_util.h" |
19 #include "chrome/browser/chromeos/drive/resource_metadata_storage.h" | 19 #include "chrome/browser/chromeos/drive/resource_metadata_storage.h" |
20 #include "chrome/browser/drive/drive_api_util.h" | 20 #include "chrome/browser/drive/drive_api_util.h" |
21 #include "chromeos/chromeos_constants.h" | 21 #include "chromeos/chromeos_constants.h" |
22 #include "content/public/browser/browser_thread.h" | 22 #include "content/public/browser/browser_thread.h" |
23 #include "google_apis/drive/task_util.h" | 23 #include "google_apis/drive/task_util.h" |
| 24 #include "net/base/filename_util.h" |
24 #include "net/base/mime_sniffer.h" | 25 #include "net/base/mime_sniffer.h" |
25 #include "net/base/mime_util.h" | 26 #include "net/base/mime_util.h" |
26 #include "net/base/net_util.h" | |
27 #include "third_party/cros_system_api/constants/cryptohome.h" | 27 #include "third_party/cros_system_api/constants/cryptohome.h" |
28 | 28 |
29 using content::BrowserThread; | 29 using content::BrowserThread; |
30 | 30 |
31 namespace drive { | 31 namespace drive { |
32 namespace internal { | 32 namespace internal { |
33 namespace { | 33 namespace { |
34 | 34 |
35 // Returns ID extracted from the path. | 35 // Returns ID extracted from the path. |
36 std::string GetIdFromPath(const base::FilePath& path) { | 36 std::string GetIdFromPath(const base::FilePath& path) { |
(...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
570 return; | 570 return; |
571 | 571 |
572 DCHECK_LT(0, it->second); | 572 DCHECK_LT(0, it->second); |
573 --it->second; | 573 --it->second; |
574 if (it->second == 0) | 574 if (it->second == 0) |
575 write_opened_files_.erase(it); | 575 write_opened_files_.erase(it); |
576 } | 576 } |
577 | 577 |
578 } // namespace internal | 578 } // namespace internal |
579 } // namespace drive | 579 } // namespace drive |
OLD | NEW |