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

Unified Diff: components/profile_service/profile_service_impl.cc

Issue 1741953002: mojo: Sketch a profile application. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Don't add a boolean to BrowserContext; allocate an object instead. Created 4 years, 10 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: components/profile_service/profile_service_impl.cc
diff --git a/components/profile_service/profile_service_impl.cc b/components/profile_service/profile_service_impl.cc
new file mode 100644
index 0000000000000000000000000000000000000000..b6239dd706459860cd7bc7d52bf90d00d965cbfe
--- /dev/null
+++ b/components/profile_service/profile_service_impl.cc
@@ -0,0 +1,39 @@
+// Copyright 2016 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 "components/profile_service/profile_service_impl.h"
+
+#include "base/files/file_path.h"
+#include "base/files/file_util.h"
+#include "base/files/scoped_temp_dir.h"
+#include "components/filesystem/directory_impl.h"
+#include "components/filesystem/lock_table.h"
+#include "mojo/shell/public/cpp/connection.h"
+
+namespace profile {
+
+ProfileServiceImpl::ProfileServiceImpl(
+ mojo::Connection* connection,
+ mojo::InterfaceRequest<ProfileService> request,
+ base::FilePath base_profile_dir,
+ filesystem::LockTable* lock_table)
+ : binding_(this, std::move(request)),
+ lock_table_(lock_table),
+ path_(base_profile_dir) {
+ if (!base::PathExists(path_))
+ base::CreateDirectory(path_);
+}
+
+ProfileServiceImpl::~ProfileServiceImpl() {
+}
+
+void ProfileServiceImpl::GetDirectory(
+ mojo::InterfaceRequest<filesystem::Directory> request) {
+ new filesystem::DirectoryImpl(std::move(request),
+ path_,
+ scoped_ptr<base::ScopedTempDir>(),
+ lock_table_);
+}
+
+} // namespace profile
« no previous file with comments | « components/profile_service/profile_service_impl.h ('k') | components/profile_service/public/interfaces/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698