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

Unified Diff: mojo/shell/network_service_loader.cc

Issue 395163002: Bundle the network service in the shell on Android. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 5 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
« no previous file with comments | « mojo/shell/network_service_loader.h ('k') | mojo/shell/profile_service_loader.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/shell/network_service_loader.cc
diff --git a/mojo/shell/profile_service_loader.cc b/mojo/shell/network_service_loader.cc
similarity index 51%
rename from mojo/shell/profile_service_loader.cc
rename to mojo/shell/network_service_loader.cc
index 741d2f21c479ca1f15b6e2fa7c02c81f7bcae232..04161db50b9aabfb506f8499ec4962895ec1536c 100644
--- a/mojo/shell/profile_service_loader.cc
+++ b/mojo/shell/network_service_loader.cc
@@ -2,23 +2,34 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "mojo/shell/profile_service_loader.h"
+#include "mojo/shell/network_service_loader.h"
+#include "base/base_paths.h"
+#include "base/files/file_path.h"
+#include "base/path_service.h"
#include "mojo/public/cpp/application/application_connection.h"
#include "mojo/public/cpp/application/application_delegate.h"
#include "mojo/public/cpp/application/application_impl.h"
-#include "mojo/services/profile/profile_service_impl.h"
+#include "mojo/services/network/network_service_impl.h"
+
+namespace {
+base::FilePath GetBasePath() {
+ base::FilePath path;
+ CHECK(PathService::Get(base::DIR_TEMP, &path));
+ return path.Append(FILE_PATH_LITERAL("network_service"));
+}
+}
namespace mojo {
namespace shell {
-ProfileServiceLoader::ProfileServiceLoader() {
+NetworkServiceLoader::NetworkServiceLoader() {
}
-ProfileServiceLoader::~ProfileServiceLoader() {
+NetworkServiceLoader::~NetworkServiceLoader() {
}
-void ProfileServiceLoader::LoadService(
+void NetworkServiceLoader::LoadService(
ServiceManager* manager,
const GURL& url,
ScopedMessagePipeHandle shell_handle) {
@@ -30,14 +41,19 @@ void ProfileServiceLoader::LoadService(
}
}
-void ProfileServiceLoader::OnServiceError(ServiceManager* manager,
+void NetworkServiceLoader::OnServiceError(ServiceManager* manager,
const GURL& url) {
apps_.erase(reinterpret_cast<uintptr_t>(manager));
}
-bool ProfileServiceLoader::ConfigureIncomingConnection(
+void NetworkServiceLoader::Initialize(ApplicationImpl* app) {
+ // The context must be created on the same thread as the network service.
+ context_.reset(new NetworkContext(GetBasePath()));
+}
+
+bool NetworkServiceLoader::ConfigureIncomingConnection(
ApplicationConnection* connection) {
- connection->AddService<ProfileServiceImpl>();
+ connection->AddService<NetworkServiceImpl>(context_.get());
return true;
}
« no previous file with comments | « mojo/shell/network_service_loader.h ('k') | mojo/shell/profile_service_loader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698