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

Unified Diff: mojo/shell/context.cc

Issue 423963004: First cut at "content handling" support in Mojo. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use URLResponse with ContentHandler interface instead of data pipe Created 6 years, 4 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: mojo/shell/context.cc
diff --git a/mojo/shell/context.cc b/mojo/shell/context.cc
index 159e3230d5236cac5a603e8d8ead01ecc935dbf0..91d8e9a26041b6b39bdeef6c2ae116a59eaee69e 100644
--- a/mojo/shell/context.cc
+++ b/mojo/shell/context.cc
@@ -69,10 +69,14 @@ class Context::NativeViewportServiceLoader : public ServiceLoader {
virtual ~NativeViewportServiceLoader() {}
private:
- virtual void LoadService(ServiceManager* manager,
- const GURL& url,
- ScopedMessagePipeHandle shell_handle) OVERRIDE {
- app_.reset(services::CreateNativeViewportService(shell_handle.Pass()));
+ virtual void LoadService(
+ ServiceManager* manager,
+ const GURL& url,
+ scoped_refptr<LoadServiceCallbacks> callbacks) OVERRIDE {
+ ScopedMessagePipeHandle shell_handle = callbacks->RegisterApplication();
+ if (shell_handle.is_valid()) {
DaveMoore 2014/08/04 21:50:51 Nit: no braces
Aaron Boodman 2014/08/05 05:44:54 Done.
+ app_.reset(services::CreateNativeViewportService(shell_handle.Pass()));
+ }
}
virtual void OnServiceError(ServiceManager* manager,
@@ -97,9 +101,13 @@ Context::Context()
else
runner_factory.reset(new InProcessDynamicServiceRunnerFactory());
+ DynamicServiceLoader* dynamic_service_loader =
+ new DynamicServiceLoader(this, runner_factory.Pass());
+ dynamic_service_loader->set_content_handler(
+ "text/plain", GURL("mojo://mojo_content_handler_demo/"));
DaveMoore 2014/08/04 21:50:51 mojo_content_handler_demo?
Aaron Boodman 2014/08/05 05:44:54 I don't understand this comment, but I've removed
service_manager_.set_default_loader(
- scoped_ptr<ServiceLoader>(
- new DynamicServiceLoader(this, runner_factory.Pass())));
+ scoped_ptr<ServiceLoader>(dynamic_service_loader));
+
// The native viewport service synchronously waits for certain messages. If we
// don't run it on its own thread we can easily deadlock. Long term native
// viewport should run its own process so that this isn't an issue.

Powered by Google App Engine
This is Rietveld 408576698