Skip to content

Commit

Permalink
Move //components/filesystem to //components/services/
Browse files Browse the repository at this point in the history
Moves this service into the canonical location for services within
//components.

The existing code causes several presubmit warnings. This CL does not
attempt to fix them.

TBR=dcheng@chromium.org
NOPRESUBMIT=true

Change-Id: I3301416c1f7dd619d2a24d165c4fed9267b4eb77
Reviewed-on: https://chromium-review.googlesource.com/948913
Commit-Queue: Colin Blundell <blundell@chromium.org>
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Cr-Commit-Position: refs/heads/master@{#542795}
  • Loading branch information
colinblundell authored and Commit Bot committed Mar 13, 2018
1 parent c9a424a commit 932b437
Show file tree
Hide file tree
Showing 72 changed files with 131 additions and 135 deletions.
2 changes: 1 addition & 1 deletion BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -658,9 +658,9 @@ group("gn_all") {
"//chrome/installer/util:strings",
"//chrome/tools/convert_dict",
"//components/constrained_window:unit_tests",
"//components/filesystem:filesystem_service_unittests",
"//components/metrics:serialization",
"//components/rappor:unit_tests",
"//components/services/filesystem:filesystem_service_unittests",
"//components/services/leveldb:leveldb_service_unittests",
"//components/sessions:unit_tests",
"//media/blink:media_blink_unittests",
Expand Down
2 changes: 1 addition & 1 deletion chrome/services/file_util/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ source_set("lib") {
"zip_file_creator.h",
]

deps += [ "//components/filesystem/public/interfaces" ]
deps += [ "//components/services/filesystem/public/interfaces" ]
}

if (safe_browsing_mode == 1) {
Expand Down
2 changes: 1 addition & 1 deletion chrome/services/file_util/DEPS
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
include_rules = [
"+components/filesystem",
"+components/services/filesystem",
"+chrome/utility/safe_browsing",
"+third_party/zlib/google",
]
4 changes: 2 additions & 2 deletions chrome/services/file_util/public/cpp/zip_file_creator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
#include "base/callback_helpers.h"
#include "base/task_scheduler/post_task.h"
#include "chrome/services/file_util/public/mojom/constants.mojom.h"
#include "components/filesystem/directory_impl.h"
#include "components/filesystem/lock_table.h"
#include "components/services/filesystem/directory_impl.h"
#include "components/services/filesystem/lock_table.h"
#include "content/public/browser/browser_thread.h"
#include "mojo/public/cpp/bindings/strong_binding.h"
#include "services/service_manager/public/cpp/connector.h"
Expand Down
2 changes: 1 addition & 1 deletion chrome/services/file_util/public/mojom/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ mojom("mojom") {

if (is_chromeos) {
sources += [ "zip_file_creator.mojom" ]
public_deps += [ "//components/filesystem/public/interfaces" ]
public_deps += [ "//components/services/filesystem/public/interfaces" ]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

module chrome.mojom;

import "components/filesystem/public/interfaces/directory.mojom";
import "components/services/filesystem/public/interfaces/directory.mojom";
import "mojo/common/file.mojom";
import "mojo/common/file_path.mojom";

Expand Down
2 changes: 1 addition & 1 deletion chrome/services/file_util/zip_file_creator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#include "base/files/file.h"
#include "base/files/file_path.h"
#include "components/filesystem/public/interfaces/types.mojom-shared.h"
#include "components/services/filesystem/public/interfaces/types.mojom-shared.h"
#include "mojo/public/cpp/bindings/strong_binding.h"
#include "third_party/zlib/google/zip.h"

Expand Down
2 changes: 1 addition & 1 deletion chrome/services/file_util/zip_file_creator.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include <vector>

#include "chrome/services/file_util/public/mojom/zip_file_creator.mojom.h"
#include "components/filesystem/public/interfaces/directory.mojom.h"
#include "components/services/filesystem/public/interfaces/directory.mojom.h"
#include "services/service_manager/public/cpp/service_context_ref.h"

namespace base {
Expand Down
2 changes: 1 addition & 1 deletion components/patch_service/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ source_set("lib") {

deps = [
"//base",
"//components/filesystem/public/interfaces",
"//components/services/filesystem/public/interfaces",
"//courgette:courgette_lib",
"//mojo/public/cpp/bindings",
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ static_library("lib") {

deps = [
"//base",
"//components/filesystem/public/interfaces",
"//components/services/filesystem/public/interfaces",
"//mojo/common",
"//mojo/common:common_base",
"//mojo/public/cpp/system",
Expand All @@ -48,7 +48,7 @@ if (!is_ios) {
deps = [
":lib",
"//base",
"//components/filesystem/public/interfaces",
"//components/services/filesystem/public/interfaces",
"//mojo/common",
"//mojo/public/cpp/bindings",
"//mojo/public/cpp/system",
Expand All @@ -73,7 +73,7 @@ if (!is_ios) {

deps = [
"//base",
"//components/filesystem/public/interfaces",
"//components/services/filesystem/public/interfaces",
"//mojo/common",
"//mojo/public/cpp/bindings",
"//mojo/public/cpp/system",
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "components/filesystem/directory_impl.h"
#include "components/services/filesystem/directory_impl.h"

#include <memory>
#include <string>
Expand All @@ -15,9 +15,9 @@
#include "base/files/scoped_temp_dir.h"
#include "base/logging.h"
#include "build/build_config.h"
#include "components/filesystem/file_impl.h"
#include "components/filesystem/lock_table.h"
#include "components/filesystem/util.h"
#include "components/services/filesystem/file_impl.h"
#include "components/services/filesystem/lock_table.h"
#include "components/services/filesystem/util.h"
#include "mojo/public/cpp/bindings/strong_binding.h"

namespace filesystem {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef COMPONENTS_FILESYSTEM_DIRECTORY_IMPL_H_
#define COMPONENTS_FILESYSTEM_DIRECTORY_IMPL_H_
#ifndef COMPONENTS_SERVICES_FILESYSTEM_DIRECTORY_IMPL_H_
#define COMPONENTS_SERVICES_FILESYSTEM_DIRECTORY_IMPL_H_

#include <stdint.h>

Expand All @@ -12,8 +12,8 @@
#include "base/files/file_path.h"
#include "base/files/scoped_file.h"
#include "base/macros.h"
#include "components/filesystem/public/interfaces/directory.mojom.h"
#include "components/filesystem/shared_temp_dir.h"
#include "components/services/filesystem/public/interfaces/directory.mojom.h"
#include "components/services/filesystem/shared_temp_dir.h"
#include "mojo/public/cpp/bindings/interface_request.h"

namespace filesystem {
Expand Down Expand Up @@ -78,4 +78,4 @@ class DirectoryImpl : public mojom::Directory {

} // namespace filesystem

#endif // COMPONENTS_FILESYSTEM_DIRECTORY_IMPL_H_
#endif // COMPONENTS_SERVICES_FILESYSTEM_DIRECTORY_IMPL_H_
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include <string>

#include "base/macros.h"
#include "components/filesystem/files_test_base.h"
#include "components/services/filesystem/files_test_base.h"

namespace filesystem {
namespace {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "components/filesystem/file_impl.h"
#include "components/services/filesystem/file_impl.h"

#include <stddef.h>
#include <stdint.h>
Expand All @@ -16,9 +16,9 @@
#include "base/files/scoped_file.h"
#include "base/logging.h"
#include "build/build_config.h"
#include "components/filesystem/lock_table.h"
#include "components/filesystem/shared_temp_dir.h"
#include "components/filesystem/util.h"
#include "components/services/filesystem/lock_table.h"
#include "components/services/filesystem/shared_temp_dir.h"
#include "components/services/filesystem/util.h"
#include "mojo/public/cpp/bindings/strong_binding.h"

static_assert(sizeof(off_t) <= sizeof(int64_t), "off_t too big");
Expand Down Expand Up @@ -169,8 +169,8 @@ void FileImpl::Write(const std::vector<uint8_t>& bytes_to_write,
const char* buf = (bytes_to_write.size() > 0)
? reinterpret_cast<const char*>(&bytes_to_write.front())
: nullptr;
int num_bytes_written = file_.WriteAtCurrentPos(
buf, static_cast<int>(bytes_to_write.size()));
int num_bytes_written =
file_.WriteAtCurrentPos(buf, static_cast<int>(bytes_to_write.size()));
if (num_bytes_written < 0) {
std::move(callback).Run(base::File::Error::FILE_ERROR_FAILED, 0);
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef COMPONENTS_FILESYSTEM_FILE_IMPL_H_
#define COMPONENTS_FILESYSTEM_FILE_IMPL_H_
#ifndef COMPONENTS_SERVICES_FILESYSTEM_FILE_IMPL_H_
#define COMPONENTS_SERVICES_FILESYSTEM_FILE_IMPL_H_

#include <stdint.h>

#include "base/files/file.h"
#include "base/files/scoped_file.h"
#include "base/macros.h"
#include "build/build_config.h"
#include "components/filesystem/public/interfaces/directory.mojom.h"
#include "components/services/filesystem/public/interfaces/directory.mojom.h"
#include "mojo/public/cpp/bindings/interface_request.h"

namespace base {
Expand Down Expand Up @@ -83,4 +83,4 @@ class FileImpl : public mojom::File {

} // namespace filesystem

#endif // COMPONENTS_FILESYSTEM_FILE_IMPL_H_
#endif // COMPONENTS_SERVICES_FILESYSTEM_FILE_IMPL_H_
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include <vector>

#include "base/files/file.h"
#include "components/filesystem/files_test_base.h"
#include "components/services/filesystem/files_test_base.h"
#include "mojo/public/cpp/bindings/interface_request.h"
#include "mojo/public/cpp/bindings/type_converter.h"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "components/filesystem/file_system_app.h"
#include "components/services/filesystem/file_system_app.h"

#include <memory>

Expand Down Expand Up @@ -34,7 +34,7 @@ namespace {

const char kUserDataDir[] = "user-data-dir";

} // namespace filesystem
} // namespace

FileSystemApp::FileSystemApp() : lock_table_(new LockTable) {
registry_.AddInterface<mojom::FileSystem>(
Expand All @@ -61,7 +61,7 @@ void FileSystemApp::Create(mojom::FileSystemRequest request,
std::move(request));
}

//static
// static
base::FilePath FileSystemApp::GetUserDataDir() {
base::FilePath path;

Expand All @@ -77,9 +77,8 @@ base::FilePath FileSystemApp::GetUserDataDir() {
CHECK(PathService::Get(base::DIR_ANDROID_APP_DATA, &path));
#elif defined(OS_LINUX)
std::unique_ptr<base::Environment> env(base::Environment::Create());
path = base::nix::GetXDGDirectory(env.get(),
base::nix::kXdgConfigHomeEnvVar,
base::nix::kDotConfigDir);
path = base::nix::GetXDGDirectory(
env.get(), base::nix::kXdgConfigHomeEnvVar, base::nix::kDotConfigDir);
#else
NOTIMPLEMENTED();
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef COMPONENTS_FILESYSTEM_FILE_SYSTEM_APP_H_
#define COMPONENTS_FILESYSTEM_FILE_SYSTEM_APP_H_
#ifndef COMPONENTS_SERVICES_FILESYSTEM_FILE_SYSTEM_APP_H_
#define COMPONENTS_SERVICES_FILESYSTEM_FILE_SYSTEM_APP_H_

#include "base/macros.h"
#include "components/filesystem/directory_impl.h"
#include "components/filesystem/file_system_impl.h"
#include "components/filesystem/lock_table.h"
#include "components/filesystem/public/interfaces/file_system.mojom.h"
#include "components/services/filesystem/directory_impl.h"
#include "components/services/filesystem/file_system_impl.h"
#include "components/services/filesystem/lock_table.h"
#include "components/services/filesystem/public/interfaces/file_system.mojom.h"
#include "services/service_manager/public/cpp/binder_registry.h"
#include "services/service_manager/public/cpp/service.h"

Expand Down Expand Up @@ -44,4 +44,4 @@ class FileSystemApp : public service_manager::Service {

} // namespace filesystem

#endif // COMPONENTS_FILESYSTEM_FILE_SYSTEM_APP_H_
#endif // COMPONENTS_SERVICES_FILESYSTEM_FILE_SYSTEM_APP_H_
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "components/filesystem/file_system_impl.h"
#include "components/services/filesystem/file_system_impl.h"

#include <stddef.h>

Expand All @@ -16,8 +16,8 @@
#include "base/logging.h"
#include "base/memory/ptr_util.h"
#include "build/build_config.h"
#include "components/filesystem/directory_impl.h"
#include "components/filesystem/lock_table.h"
#include "components/services/filesystem/directory_impl.h"
#include "components/services/filesystem/lock_table.h"
#include "mojo/public/cpp/bindings/strong_binding.h"
#include "services/service_manager/public/cpp/identity.h"
#include "url/gurl.h"
Expand All @@ -31,8 +31,7 @@ FileSystemImpl::FileSystemImpl(const service_manager::Identity& remote_identity,
lock_table_(std::move(lock_table)),
persistent_dir_(persistent_dir) {}

FileSystemImpl::~FileSystemImpl() {
}
FileSystemImpl::~FileSystemImpl() {}

void FileSystemImpl::OpenTempDirectory(mojom::DirectoryRequest directory,
OpenTempDirectoryCallback callback) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef COMPONENTS_FILESYSTEM_FILE_SYSTEM_IMPL_H_
#define COMPONENTS_FILESYSTEM_FILE_SYSTEM_IMPL_H_
#ifndef COMPONENTS_SERVICES_FILESYSTEM_FILE_SYSTEM_IMPL_H_
#define COMPONENTS_SERVICES_FILESYSTEM_FILE_SYSTEM_IMPL_H_

#include "base/files/file_path.h"
#include "base/macros.h"
#include "components/filesystem/public/interfaces/file_system.mojom.h"
#include "components/filesystem/shared_temp_dir.h"
#include "components/services/filesystem/public/interfaces/file_system.mojom.h"
#include "components/services/filesystem/shared_temp_dir.h"
#include "mojo/public/cpp/bindings/interface_request.h"

namespace base {
Expand Down Expand Up @@ -51,4 +51,4 @@ class FileSystemImpl : public mojom::FileSystem {

} // namespace filesystem

#endif // COMPONENTS_FILESYSTEM_FILE_SYSTEM_IMPL_H_
#endif // COMPONENTS_SERVICES_FILESYSTEM_FILE_SYSTEM_IMPL_H_
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,19 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "components/filesystem/files_test_base.h"
#include "components/services/filesystem/files_test_base.h"

#include <utility>

#include "components/filesystem/public/interfaces/directory.mojom.h"
#include "components/filesystem/public/interfaces/types.mojom.h"
#include "components/services/filesystem/public/interfaces/directory.mojom.h"
#include "components/services/filesystem/public/interfaces/types.mojom.h"
#include "services/service_manager/public/cpp/connector.h"

namespace filesystem {

FilesTestBase::FilesTestBase()
: ServiceTest("filesystem_service_unittests") {
}
FilesTestBase::FilesTestBase() : ServiceTest("filesystem_service_unittests") {}

FilesTestBase::~FilesTestBase() {
}
FilesTestBase::~FilesTestBase() {}

void FilesTestBase::SetUp() {
ServiceTest::SetUp();
Expand Down
Loading

0 comments on commit 932b437

Please sign in to comment.