Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(194)

Side by Side Diff: chrome/browser/chromeos/drive/resource_metadata.cc

Issue 1192493003: Move browser-agnostic code from file_system_util to file_system_core_util. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@drive-prefservice
Patch Set: Rebasing... Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/resource_metadata.h" 5 #include "chrome/browser/chromeos/drive/resource_metadata.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/guid.h" 9 #include "base/guid.h"
10 #include "base/location.h" 10 #include "base/location.h"
11 #include "base/rand_util.h" 11 #include "base/rand_util.h"
12 #include "base/strings/string_number_conversions.h" 12 #include "base/strings/string_number_conversions.h"
13 #include "base/strings/stringprintf.h" 13 #include "base/strings/stringprintf.h"
14 #include "base/sys_info.h" 14 #include "base/sys_info.h"
15 #include "chrome/browser/chromeos/drive/drive.pb.h" 15 #include "chrome/browser/chromeos/drive/drive.pb.h"
16 #include "chrome/browser/chromeos/drive/file_cache.h" 16 #include "chrome/browser/chromeos/drive/file_cache.h"
17 #include "chrome/browser/chromeos/drive/file_system_util.h" 17 #include "chrome/browser/chromeos/drive/file_system_core_util.h"
18 #include "chrome/browser/chromeos/drive/resource_metadata_storage.h" 18 #include "chrome/browser/chromeos/drive/resource_metadata_storage.h"
19 19
20 namespace drive { 20 namespace drive {
21 namespace internal { 21 namespace internal {
22 namespace { 22 namespace {
23 23
24 // Returns true if enough disk space is available for DB operation. 24 // Returns true if enough disk space is available for DB operation.
25 // TODO(hashimoto): Merge this with FileCache's FreeDiskSpaceGetterInterface. 25 // TODO(hashimoto): Merge this with FileCache's FreeDiskSpaceGetterInterface.
26 bool EnoughDiskSpaceIsAvailableForDBOperation(const base::FilePath& path) { 26 bool EnoughDiskSpaceIsAvailableForDBOperation(const base::FilePath& path) {
27 const int64 kRequiredDiskSpaceInMB = 128; // 128 MB seems to be large enough. 27 const int64 kRequiredDiskSpaceInMB = 128; // 128 MB seems to be large enough.
(...skipping 570 matching lines...) Expand 10 before | Expand all | Expand 10 after
598 598
599 error = cache_->Remove(id); 599 error = cache_->Remove(id);
600 if (error != FILE_ERROR_OK) 600 if (error != FILE_ERROR_OK)
601 return error; 601 return error;
602 602
603 return storage_->RemoveEntry(id); 603 return storage_->RemoveEntry(id);
604 } 604 }
605 605
606 } // namespace internal 606 } // namespace internal
607 } // namespace drive 607 } // namespace drive
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698