Commit aac651a0 authored by Pete Williamson's avatar Pete Williamson Committed by Commit Bot

Move File Existence Checker to a better location

Since it is used by both downloads and offline_pages, moving it to
a common namespace and directory

Bug: 814492
Change-Id: I8781730c3025087ff0ab0a5473f1ae4231dbf775
Reviewed-on: https://chromium-review.googlesource.com/939701
Commit-Queue: Peter Williamson <petewil@chromium.org>
Reviewed-by: default avatarJoy Ming <jming@chromium.org>
Reviewed-by: default avatarDavid Trainor <dtrainor@chromium.org>
Cr-Commit-Position: refs/heads/master@{#541677}
parent 47e352d1
...@@ -29,6 +29,7 @@ static_library("core") { ...@@ -29,6 +29,7 @@ static_library("core") {
] ]
deps = [ deps = [
"utilities:utilities",
"//ui/gfx/geometry", "//ui/gfx/geometry",
] ]
...@@ -56,6 +57,7 @@ source_set("unit_tests") { ...@@ -56,6 +57,7 @@ source_set("unit_tests") {
deps = [ deps = [
":core", ":core",
"utilities:unit_tests",
"//base/test:test_support", "//base/test:test_support",
"//components/offline_items_collection/core/test_support", "//components/offline_items_collection/core/test_support",
] ]
......
# Copyright 2018 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.
source_set("utilities") {
sources = [
"file_existence_checker.h",
]
public_deps = [
"//base",
]
}
source_set("unit_tests") {
testonly = true
sources = [
"file_existence_checker_unittest.cc",
]
deps = [
":utilities",
"//base",
"//base/test:test_support",
"//testing/gtest",
]
}
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#ifndef COMPONENTS_OFFLINE_PAGES_CORE_FILE_EXISTENCE_CHECKER_H_ #ifndef COMPONENTS_OFFLINE_ITEMS_COLLECTION_CORE_UTILITIES_FILE_EXISTENCE_CHECKER_H_
#define COMPONENTS_OFFLINE_PAGES_CORE_FILE_EXISTENCE_CHECKER_H_ #define COMPONENTS_OFFLINE_ITEMS_COLLECTION_CORE_UTILITIES_FILE_EXISTENCE_CHECKER_H_
#include <utility> #include <utility>
#include <vector> #include <vector>
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
#include "base/sequenced_task_runner.h" #include "base/sequenced_task_runner.h"
#include "base/task_runner_util.h" #include "base/task_runner_util.h"
namespace offline_pages { namespace offline_items_collection {
// Class that checks in bulk, which of the provided set of file paths are not // Class that checks in bulk, which of the provided set of file paths are not
// pointing to an existing file. // pointing to an existing file.
...@@ -62,6 +62,6 @@ class FileExistenceChecker { ...@@ -62,6 +62,6 @@ class FileExistenceChecker {
DISALLOW_COPY_AND_ASSIGN(FileExistenceChecker); DISALLOW_COPY_AND_ASSIGN(FileExistenceChecker);
}; };
} // namespace offline_pages } // namespace offline_items_collection
#endif // COMPONENTS_OFFLINE_PAGES_CORE_FILE_EXISTENCE_CHECKER_H_ #endif // COMPONENTS_OFFLINE_ITEMS_COLLECTION_CORE_UTILITIES_FILE_EXISTENCE_CHECKER_H_
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "components/offline_pages/core/file_existence_checker.h" #include "components/offline_items_collection/core/utilities/file_existence_checker.h"
#include <vector> #include <vector>
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
#include "base/threading/thread_task_runner_handle.h" #include "base/threading/thread_task_runner_handle.h"
#include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest/include/gtest/gtest.h"
namespace offline_pages { namespace offline_items_collection {
using FileIdPairVector = FileExistenceChecker::FileWithIdCollection<int64_t>; using FileIdPairVector = FileExistenceChecker::FileWithIdCollection<int64_t>;
using FileIdPairSet = std::set<std::pair<base::FilePath, int64_t>>; using FileIdPairSet = std::set<std::pair<base::FilePath, int64_t>>;
...@@ -94,4 +94,4 @@ TEST_F(FileExistenceCheckerTest, MissingFileFound) { ...@@ -94,4 +94,4 @@ TEST_F(FileExistenceCheckerTest, MissingFileFound) {
EXPECT_EQ(0UL, missing_files.count(files[1])); EXPECT_EQ(0UL, missing_files.count(files[1]));
} }
} // namespace offline_pages } // namespace offline_items_collection
...@@ -18,7 +18,6 @@ static_library("core") { ...@@ -18,7 +18,6 @@ static_library("core") {
"client_namespace_constants.h", "client_namespace_constants.h",
"client_policy_controller.cc", "client_policy_controller.cc",
"client_policy_controller.h", "client_policy_controller.h",
"file_existence_checker.h",
"model/add_page_task.cc", "model/add_page_task.cc",
"model/add_page_task.h", "model/add_page_task.h",
"model/add_page_to_download_manager_task.cc", "model/add_page_to_download_manager_task.cc",
...@@ -84,6 +83,7 @@ static_library("core") { ...@@ -84,6 +83,7 @@ static_library("core") {
"//base", "//base",
"//components/filename_generation", "//components/filename_generation",
"//components/keyed_service/core", "//components/keyed_service/core",
"//components/offline_items_collection/core/utilities",
"//crypto", "//crypto",
"//net", "//net",
"//services/metrics/public/cpp:metrics_cpp", "//services/metrics/public/cpp:metrics_cpp",
...@@ -147,7 +147,6 @@ source_set("unit_tests") { ...@@ -147,7 +147,6 @@ source_set("unit_tests") {
"archive_manager_unittest.cc", "archive_manager_unittest.cc",
"archive_validator_unittest.cc", "archive_validator_unittest.cc",
"client_policy_controller_unittest.cc", "client_policy_controller_unittest.cc",
"file_existence_checker_unittest.cc",
"model/add_page_task_unittest.cc", "model/add_page_task_unittest.cc",
"model/add_page_to_download_manager_task_unittest.cc", "model/add_page_to_download_manager_task_unittest.cc",
"model/clear_digest_task_unittest.cc", "model/clear_digest_task_unittest.cc",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment