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

Unified Diff: chrome/browser/chromeos/drive/remove_stale_cache_files.cc

Issue 1314803004: Move chrome/browser/chromeos/drive/file_system.cc (+deps) into components/drive. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebasing... Created 5 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/drive/remove_stale_cache_files.cc
diff --git a/chrome/browser/chromeos/drive/remove_stale_cache_files.cc b/chrome/browser/chromeos/drive/remove_stale_cache_files.cc
deleted file mode 100644
index 3193aace43b706b18e49570a83bc4b13f6b79e37..0000000000000000000000000000000000000000
--- a/chrome/browser/chromeos/drive/remove_stale_cache_files.cc
+++ /dev/null
@@ -1,34 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/browser/chromeos/drive/remove_stale_cache_files.h"
-
-#include "base/logging.h"
-#include "components/drive/drive.pb.h"
-#include "components/drive/file_cache.h"
-#include "components/drive/resource_metadata.h"
-
-namespace drive {
-namespace internal {
-
-void RemoveStaleCacheFiles(FileCache* cache,
- ResourceMetadata* resource_metadata) {
- scoped_ptr<ResourceMetadata::Iterator> it = resource_metadata->GetIterator();
- for (; !it->IsAtEnd(); it->Advance()) {
- const ResourceEntry& entry = it->GetValue();
- const FileCacheEntry& cache_state =
- entry.file_specific_info().cache_state();
- // Stale = not dirty but the MD5 does not match.
- if (!cache_state.is_dirty() &&
- cache_state.md5() != entry.file_specific_info().md5()) {
- FileError error = cache->Remove(it->GetID());
- LOG_IF(WARNING, error != FILE_ERROR_OK)
- << "Failed to remove a stale cache file. resource_id: "
- << it->GetID();
- }
- }
-}
-
-} // namespace internal
-} // namespace drive

Powered by Google App Engine
This is Rietveld 408576698