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

Unified Diff: mojo/services/network/main.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/mojo_services.gypi ('k') | mojo/services/profile/DEPS » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/services/network/main.cc
diff --git a/mojo/services/network/main.cc b/mojo/services/network/main.cc
index 68d0c104f1b12877f96e75a65c3b49f25556b649..718a4310e912811c75ce6f2966e164782e1ab579 100644
--- a/mojo/services/network/main.cc
+++ b/mojo/services/network/main.cc
@@ -3,47 +3,24 @@
// found in the LICENSE file.
#include "base/at_exit.h"
-#include "base/bind.h"
+#include "base/base_paths.h"
#include "base/command_line.h"
#include "base/files/file_path.h"
#include "base/message_loop/message_loop.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/public/cpp/bindings/interface_ptr.h"
-#include "mojo/public/interfaces/service_provider/service_provider.mojom.h"
#include "mojo/services/network/network_context.h"
#include "mojo/services/network/network_service_impl.h"
-#include "mojo/services/public/interfaces/profile/profile_service.mojom.h"
-
-namespace {
-
-void OnPathReceived(base::FilePath* path, const mojo::String& path_as_string) {
- DCHECK(!path_as_string.is_null());
-#if defined(OS_POSIX)
- *path = base::FilePath(path_as_string);
-#elif defined(OS_WIN)
- *path = base::FilePath::FromUTF8Unsafe(path_as_string);
-#else
-#error Not implemented
-#endif
-}
-
-} // namespace
class Delegate : public mojo::ApplicationDelegate {
public:
Delegate() {}
virtual void Initialize(mojo::ApplicationImpl* app) MOJO_OVERRIDE {
- mojo::InterfacePtr<mojo::ProfileService> profile_service;
- app->ConnectToService("mojo:profile_service", &profile_service);
base::FilePath base_path;
- profile_service->GetPath(
- mojo::ProfileService::PATH_KEY_DIR_TEMP,
- base::Bind(&OnPathReceived, base::Unretained(&base_path)));
- profile_service.WaitForIncomingMethodCall();
- DCHECK(!base_path.value().empty());
+ CHECK(PathService::Get(base::DIR_TEMP, &base_path));
base_path = base_path.Append(FILE_PATH_LITERAL("network_service"));
context_.reset(new mojo::NetworkContext(base_path));
}
« no previous file with comments | « mojo/mojo_services.gypi ('k') | mojo/services/profile/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698