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

Side by Side Diff: content/common/mojo/service_registry_impl.h

Issue 1900903002: Fix content/shell including internals of content for service worker test. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix ios Created 4 years, 8 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 | « components/contextual_search.gypi ('k') | content/common/mojo/service_registry_impl.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 CONTENT_COMMON_MOJO_SERVICE_REGISTRY_IMPL_H_ 5 #ifndef CONTENT_COMMON_MOJO_SERVICE_REGISTRY_IMPL_H_
6 #define CONTENT_COMMON_MOJO_SERVICE_REGISTRY_IMPL_H_ 6 #define CONTENT_COMMON_MOJO_SERVICE_REGISTRY_IMPL_H_
7 7
8 #include <map> 8 #include <map>
9 #include <queue> 9 #include <queue>
10 #include <string> 10 #include <string>
11 #include <utility> 11 #include <utility>
12 12
13 #include "base/callback.h" 13 #include "base/callback.h"
14 #include "base/compiler_specific.h" 14 #include "base/compiler_specific.h"
15 #include "base/memory/weak_ptr.h" 15 #include "base/memory/weak_ptr.h"
16 #include "content/public/common/service_registry.h" 16 #include "content/public/common/service_registry.h"
17 #include "mojo/public/cpp/bindings/binding.h" 17 #include "mojo/public/cpp/bindings/binding.h"
18 #include "mojo/public/cpp/system/core.h" 18 #include "mojo/public/cpp/system/core.h"
19 #include "services/shell/public/interfaces/interface_provider.mojom.h"
20 19
21 namespace content { 20 namespace content {
22 21
23 class CONTENT_EXPORT ServiceRegistryImpl 22 class CONTENT_EXPORT ServiceRegistryImpl
24 : public ServiceRegistry, 23 : public ServiceRegistry,
25 public NON_EXPORTED_BASE(shell::mojom::InterfaceProvider) { 24 public NON_EXPORTED_BASE(shell::mojom::InterfaceProvider) {
26 public: 25 public:
27 using ServiceFactory = base::Callback<void(mojo::ScopedMessagePipeHandle)>; 26 using ServiceFactory = base::Callback<void(mojo::ScopedMessagePipeHandle)>;
28 27
29 ServiceRegistryImpl(); 28 ServiceRegistryImpl();
30 ~ServiceRegistryImpl() override; 29 ~ServiceRegistryImpl() override;
31 30
32 // Binds this ServiceProvider implementation to a message pipe endpoint. 31 // ServiceRegistry overrides.
33 void Bind(shell::mojom::InterfaceProviderRequest request); 32 void Bind(shell::mojom::InterfaceProviderRequest request) override;
34
35 // Binds to a remote ServiceProvider. This will expose added services to the
36 // remote ServiceProvider with the corresponding handle and enable
37 // ConnectToRemoteService to provide access to services exposed by the remote
38 // ServiceProvider.
39 void BindRemoteServiceProvider( 33 void BindRemoteServiceProvider(
40 shell::mojom::InterfaceProviderPtr service_provider); 34 shell::mojom::InterfaceProviderPtr service_provider) override;
41
42 // ServiceRegistry overrides.
43 void AddService(const std::string& service_name, 35 void AddService(const std::string& service_name,
44 const ServiceFactory service_factory) override; 36 const ServiceFactory service_factory) override;
45 void RemoveService(const std::string& service_name) override; 37 void RemoveService(const std::string& service_name) override;
46 void ConnectToRemoteService(const base::StringPiece& service_name, 38 void ConnectToRemoteService(const base::StringPiece& service_name,
47 mojo::ScopedMessagePipeHandle handle) override; 39 mojo::ScopedMessagePipeHandle handle) override;
48 void AddServiceOverrideForTesting( 40 void AddServiceOverrideForTesting(
49 const std::string& service_name, 41 const std::string& service_name,
50 const ServiceFactory& service_factory) override; 42 const ServiceFactory& service_factory) override;
51 void ClearServiceOverridesForTesting() override; 43 void ClearServiceOverridesForTesting() override;
52 44
(...skipping 16 matching lines...) Expand all
69 pending_connects_; 61 pending_connects_;
70 62
71 std::map<std::string, ServiceFactory> service_overrides_; 63 std::map<std::string, ServiceFactory> service_overrides_;
72 64
73 base::WeakPtrFactory<ServiceRegistry> weak_factory_; 65 base::WeakPtrFactory<ServiceRegistry> weak_factory_;
74 }; 66 };
75 67
76 } // namespace content 68 } // namespace content
77 69
78 #endif // CONTENT_COMMON_MOJO_SERVICE_REGISTRY_IMPL_H_ 70 #endif // CONTENT_COMMON_MOJO_SERVICE_REGISTRY_IMPL_H_
OLDNEW
« no previous file with comments | « components/contextual_search.gypi ('k') | content/common/mojo/service_registry_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698