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

Unified Diff: content/browser/dom_storage/dom_storage_context_wrapper.cc

Issue 1871223003: Use ShellClientFactory interface to load mojo:profile (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 8 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: content/browser/dom_storage/dom_storage_context_wrapper.cc
diff --git a/content/browser/dom_storage/dom_storage_context_wrapper.cc b/content/browser/dom_storage/dom_storage_context_wrapper.cc
index bde121ad2afd62416f9dac84c032f316530e7c3d..49ab4e0a20b17c71a1bfecd522d303db9f78b213 100644
--- a/content/browser/dom_storage/dom_storage_context_wrapper.cc
+++ b/content/browser/dom_storage/dom_storage_context_wrapper.cc
@@ -18,6 +18,7 @@
#include "base/thread_task_runner_handle.h"
#include "components/filesystem/public/interfaces/directory.mojom.h"
#include "components/leveldb/public/interfaces/leveldb.mojom.h"
+#include "components/profile_service/public/cpp/constants.h"
#include "components/profile_service/public/interfaces/profile.mojom.h"
#include "content/browser/dom_storage/dom_storage_area.h"
#include "content/browser/dom_storage/dom_storage_context_impl.h"
@@ -26,9 +27,10 @@
#include "content/browser/leveldb_wrapper_impl.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/local_storage_usage_info.h"
-#include "content/public/browser/mojo_app_connection.h"
#include "content/public/browser/session_storage_usage_info.h"
#include "mojo/common/common_type_converters.h"
+#include "services/shell/public/cpp/connection.h"
+#include "services/shell/public/cpp/connector.h"
namespace content {
namespace {
@@ -78,8 +80,8 @@ void GetSessionStorageUsageHelper(
// for now).
class DOMStorageContextWrapper::MojoState {
public:
- MojoState(const std::string& mojo_user_id, const base::FilePath& subdirectory)
- : mojo_user_id_(mojo_user_id),
+ MojoState(mojo::Connector* connector, const base::FilePath& subdirectory)
+ : connector_(connector),
subdirectory_(subdirectory),
connection_state_(NO_CONNECTION),
weak_ptr_factory_(this) {}
@@ -107,8 +109,8 @@ class DOMStorageContextWrapper::MojoState {
// Maps between an origin and its prefixed LevelDB view.
std::map<url::Origin, std::unique_ptr<LevelDBWrapperImpl>> level_db_wrappers_;
- std::string mojo_user_id_;
- base::FilePath subdirectory_;
+ mojo::Connector* const connector_;
+ const base::FilePath subdirectory_;
enum ConnectionState {
NO_CONNECTION,
@@ -116,7 +118,8 @@ class DOMStorageContextWrapper::MojoState {
CONNECTION_FINISHED
} connection_state_;
- std::unique_ptr<MojoAppConnection> profile_app_connection_;
+ std::unique_ptr<mojo::Connection> profile_app_connection_;
+
profile::ProfileServicePtr profile_service_;
filesystem::DirectoryPtr directory_;
@@ -134,9 +137,9 @@ void DOMStorageContextWrapper::MojoState::OpenLocalStorage(
mojom::LevelDBWrapperRequest request) {
// If we don't have a filesystem_connection_, we'll need to establish one.
if (connection_state_ == NO_CONNECTION) {
- profile_app_connection_ = MojoAppConnection::Create(
- mojo_user_id_, "mojo:profile", kBrowserMojoAppUrl);
-
+ CHECK(connector_);
+ profile_app_connection_ =
+ connector_->Connect(profile::kProfileMojoApplicationName);
connection_state_ = CONNECTION_IN_PROGRESS;
if (!subdirectory_.empty()) {
@@ -229,14 +232,14 @@ void DOMStorageContextWrapper::MojoState::BindLocalStorage(
}
DOMStorageContextWrapper::DOMStorageContextWrapper(
- const std::string& mojo_user_id,
+ mojo::Connector* connector,
const base::FilePath& profile_path,
const base::FilePath& local_partition_path,
storage::SpecialStoragePolicy* special_storage_policy) {
base::FilePath storage_dir;
if (!profile_path.empty())
storage_dir = local_partition_path.AppendASCII(kLocalStorageDirectory);
- mojo_state_.reset(new MojoState(mojo_user_id, storage_dir));
+ mojo_state_.reset(new MojoState(connector, storage_dir));
base::FilePath data_path;
if (!profile_path.empty())
« no previous file with comments | « content/browser/dom_storage/dom_storage_context_wrapper.h ('k') | content/browser/mojo/browser_shell_connection.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698