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

Side by Side Diff: mojo/application_manager/application_manager.h

Issue 522443003: Accept inbound connections on unix domain socket (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bug407782
Patch Set: Deleted extra curly brace, which was closing a namespace too early Created 6 years, 2 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 unified diff | Download patch
« no previous file with comments | « mojo/BUILD.gn ('k') | mojo/application_manager/application_manager.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef MOJO_APPLICATION_MANAGER_APPLICATION_MANAGER_H_ 5 #ifndef MOJO_APPLICATION_MANAGER_APPLICATION_MANAGER_H_
6 #define MOJO_APPLICATION_MANAGER_APPLICATION_MANAGER_H_ 6 #define MOJO_APPLICATION_MANAGER_APPLICATION_MANAGER_H_
7 7
8 #include <map> 8 #include <map>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
11 #include "base/gtest_prod_util.h" 11 #include "base/gtest_prod_util.h"
12 #include "base/memory/scoped_ptr.h" 12 #include "base/memory/scoped_ptr.h"
13 #include "base/memory/weak_ptr.h" 13 #include "base/memory/weak_ptr.h"
14 #include "mojo/application_manager/application_loader.h" 14 #include "mojo/application_manager/application_loader.h"
15 #include "mojo/application_manager/application_manager_export.h" 15 #include "mojo/application_manager/application_manager_export.h"
16 #include "mojo/public/interfaces/application/service_provider.mojom.h" 16 #include "mojo/public/interfaces/application/service_provider.mojom.h"
17 #include "url/gurl.h" 17 #include "url/gurl.h"
18 18
19 namespace mojo { 19 namespace mojo {
20 20
21 class MOJO_APPLICATION_MANAGER_EXPORT ApplicationManager { 21 class MOJO_APPLICATION_MANAGER_EXPORT ApplicationManager {
22 public: 22 public:
23 class MOJO_APPLICATION_MANAGER_EXPORT Delegate { 23 class MOJO_APPLICATION_MANAGER_EXPORT Delegate {
24 public: 24 public:
25 virtual ~Delegate(); 25 virtual ~Delegate();
26 // Send when the Applicaiton holding the handle on the other end of the 26 // Send when the Application holding the handle on the other end of the
27 // Shell pipe goes away. 27 // Shell pipe goes away.
28 virtual void OnApplicationError(const GURL& url) = 0; 28 virtual void OnApplicationError(const GURL& url) = 0;
29 }; 29 };
30 30
31 // API for testing. 31 // API for testing.
32 class MOJO_APPLICATION_MANAGER_EXPORT TestAPI { 32 class MOJO_APPLICATION_MANAGER_EXPORT TestAPI {
33 public: 33 public:
34 explicit TestAPI(ApplicationManager* manager); 34 explicit TestAPI(ApplicationManager* manager);
35 ~TestAPI(); 35 ~TestAPI();
36 36
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 InterfacePtr<Interface>* ptr) { 73 InterfacePtr<Interface>* ptr) {
74 ScopedMessagePipeHandle service_handle = 74 ScopedMessagePipeHandle service_handle =
75 ConnectToServiceByName(application_url, Interface::Name_); 75 ConnectToServiceByName(application_url, Interface::Name_);
76 ptr->Bind(service_handle.Pass()); 76 ptr->Bind(service_handle.Pass());
77 } 77 }
78 78
79 ScopedMessagePipeHandle ConnectToServiceByName( 79 ScopedMessagePipeHandle ConnectToServiceByName(
80 const GURL& application_url, 80 const GURL& application_url,
81 const std::string& interface_name); 81 const std::string& interface_name);
82 82
83 void RegisterExternalApplication(const GURL& application_url,
84 ScopedMessagePipeHandle shell);
85
83 void set_delegate(Delegate* delegate) { delegate_ = delegate; } 86 void set_delegate(Delegate* delegate) { delegate_ = delegate; }
84 87
85 // Sets the default Loader to be used if not overridden by SetLoaderForURL() 88 // Sets the default Loader to be used if not overridden by SetLoaderForURL()
86 // or SetLoaderForScheme(). 89 // or SetLoaderForScheme().
87 void set_default_loader(scoped_ptr<ApplicationLoader> loader) { 90 void set_default_loader(scoped_ptr<ApplicationLoader> loader) {
88 default_loader_ = loader.Pass(); 91 default_loader_ = loader.Pass();
89 } 92 }
90 // Sets a Loader to be used for a specific url. 93 // Sets a Loader to be used for a specific url.
91 void SetLoaderForURL(scoped_ptr<ApplicationLoader> loader, const GURL& url); 94 void SetLoaderForURL(scoped_ptr<ApplicationLoader> loader, const GURL& url);
92 // Sets a Loader to be used for a specific url scheme. 95 // Sets a Loader to be used for a specific url scheme.
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 URLToArgsMap url_to_args_; 154 URLToArgsMap url_to_args_;
152 155
153 base::WeakPtrFactory<ApplicationManager> weak_ptr_factory_; 156 base::WeakPtrFactory<ApplicationManager> weak_ptr_factory_;
154 157
155 DISALLOW_COPY_AND_ASSIGN(ApplicationManager); 158 DISALLOW_COPY_AND_ASSIGN(ApplicationManager);
156 }; 159 };
157 160
158 } // namespace mojo 161 } // namespace mojo
159 162
160 #endif // MOJO_APPLICATION_MANAGER_APPLICATION_MANAGER_H_ 163 #endif // MOJO_APPLICATION_MANAGER_APPLICATION_MANAGER_H_
OLDNEW
« no previous file with comments | « mojo/BUILD.gn ('k') | mojo/application_manager/application_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698