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

Unified Diff: mojo/shell/application_fetcher.h

Issue 1342503003: Move fetching logic out of ApplicationManager, eliminate url mappings. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 years, 3 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/DEPS ('k') | mojo/shell/application_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/shell/application_fetcher.h
diff --git a/mojo/shell/application_fetcher.h b/mojo/shell/application_fetcher.h
new file mode 100644
index 0000000000000000000000000000000000000000..4f880012f6a7705efa66f7e820d2578e57e2669d
--- /dev/null
+++ b/mojo/shell/application_fetcher.h
@@ -0,0 +1,43 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef MOJO_SHELL_APPLICATION_FETCHER_H_
+#define MOJO_SHELL_APPLICATION_FETCHER_H_
+
+#include "mojo/shell/fetcher.h"
+#include "mojo/services/network/public/interfaces/url_loader.mojom.h"
+
+class GURL;
+
+namespace mojo {
+namespace shell {
+
+class ApplicationManager;
+
+// A class implementing this interface assists Shell::ConnectToApplication in
+// resolving URLs and fetching the applications located therein.
+class ApplicationFetcher {
+ public:
+ virtual ~ApplicationFetcher() {}
+
+ // Called once, during initialization, to tell the fetcher about the
+ // associated ApplicationManager.
+ virtual void SetApplicationManager(ApplicationManager* manager) = 0;
+
+ // Resolves |url| to its canonical form. e.g. for mojo: urls, returns a file:
+ // url with a path ending in .mojo.
+ virtual GURL ResolveURL(const GURL& url) = 0;
+
+ // Asks the delegate to fetch the specified url. |url| must be unresolved,
+ // i.e. ResolveURL() above must not have been called on it.
+ // TODO(beng): figure out how not to expose Fetcher at all at this layer.
+ virtual void FetchRequest(
+ URLRequestPtr request,
+ const Fetcher::FetchCallback& loader_callback) = 0;
+};
+
+} // namespace shell
+} // namespace mojo
+
+#endif // MOJO_SHELL_APPLICATION_FETCHER_H_
« no previous file with comments | « mojo/shell/DEPS ('k') | mojo/shell/application_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698