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

Unified Diff: mojo/shell/dynamic_service_loader.h

Issue 122173004: Add test for ServiceManager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update new copyrights Created 6 years, 12 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.cc ('k') | mojo/shell/dynamic_service_loader.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/shell/dynamic_service_loader.h
diff --git a/mojo/shell/dynamic_service_loader.h b/mojo/shell/dynamic_service_loader.h
new file mode 100644
index 0000000000000000000000000000000000000000..c6e2ad5bccdedd035db65d7f995850ac7588c02d
--- /dev/null
+++ b/mojo/shell/dynamic_service_loader.h
@@ -0,0 +1,46 @@
+// Copyright 2014 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_DYNAMIC_SERVICE_LOADER_H_
+#define MOJO_SHELL_DYNAMIC_SERVICE_LOADER_H_
+
+#include <map>
+
+#include "base/basictypes.h"
+#include "mojo/public/system/core_cpp.h"
+#include "mojo/shell/service_manager.h"
+#include "url/gurl.h"
+
+namespace mojo {
+namespace shell {
+
+class Context;
+
+// A subclass of ServiceManager::Loader that loads a dynamic library containing
+// the implementation of the service.
+class DynamicServiceLoader : public ServiceManager::Loader {
+ public:
+ explicit DynamicServiceLoader(Context* context);
+ virtual ~DynamicServiceLoader();
+
+ private:
+ class LoadContext;
+
+ // Initiates the dynamic load. If the url is a mojo: scheme then the name
+ // specified will be modified to the platform's naming scheme. Also the
+ // value specified to the --origin command line argument will be used as the
+ // host / port.
+ virtual void Load(const GURL& url,
+ ScopedMessagePipeHandle service_handle) MOJO_OVERRIDE;
+
+ typedef std::map<GURL, LoadContext*> LoadContextMap;
+ LoadContextMap url_to_load_context_;
+ Context* context_;
+ DISALLOW_COPY_AND_ASSIGN(DynamicServiceLoader);
+};
+
+} // namespace shell
+} // namespace mojo
+
+#endif // MOJO_SHELL_DYNAMIC_SERVICE_LOADER_H_
« no previous file with comments | « mojo/shell/context.cc ('k') | mojo/shell/dynamic_service_loader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698