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

Unified Diff: mojo/shell/context.cc

Issue 323593002: Mojo: Use network service to load non-local Mojo Apps. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 6 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/context.h ('k') | mojo/shell/desktop/mojo_main.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/shell/context.cc
diff --git a/mojo/shell/context.cc b/mojo/shell/context.cc
index 5d471d42292251a7ad6a6bed7904c80a3d379143..608fc53130d534415dfd7f19c24902574141cc49 100644
--- a/mojo/shell/context.cc
+++ b/mojo/shell/context.cc
@@ -17,7 +17,6 @@
#include "mojo/services/native_viewport/native_viewport_service.h"
#include "mojo/shell/dynamic_service_loader.h"
#include "mojo/shell/in_process_dynamic_service_runner.h"
-#include "mojo/shell/network_delegate.h"
#include "mojo/shell/out_of_process_dynamic_service_runner.h"
#include "mojo/shell/switches.h"
#include "mojo/spy/spy.h"
@@ -34,6 +33,12 @@ namespace mojo {
namespace shell {
namespace {
+// These mojo: URLs are loaded directly from the local filesystem. They
+// correspond to shared libraries bundled alongside the mojo_shell.
+const char* kLocalMojoURLs[] = {
+ "mojo:mojo_network_service",
+};
+
// Used to ensure we only init once.
class Setup {
public:
@@ -75,14 +80,12 @@ class Context::NativeViewportServiceLoader : public ServiceLoader {
};
Context::Context()
- : task_runners_(base::MessageLoop::current()->message_loop_proxy()),
- storage_(),
- loader_(task_runners_.io_runner(),
- task_runners_.file_runner(),
- task_runners_.cache_runner(),
- scoped_ptr<net::NetworkDelegate>(new NetworkDelegate()),
- storage_.profile_path()) {
+ : task_runners_(base::MessageLoop::current()->message_loop_proxy()) {
setup.Get();
+
+ for (size_t i = 0; i < arraysize(kLocalMojoURLs); ++i)
+ mojo_url_resolver_.AddLocalFileMapping(GURL(kLocalMojoURLs[i]));
+
base::CommandLine* cmdline = base::CommandLine::ForCurrentProcess();
scoped_ptr<DynamicServiceRunnerFactory> runner_factory;
if (cmdline->HasSwitch(switches::kEnableMultiprocess))
« no previous file with comments | « mojo/shell/context.h ('k') | mojo/shell/desktop/mojo_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698