OLD | NEW |
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> |
(...skipping 23 matching lines...) Expand all Loading... |
34 | 34 |
35 // ServiceRegistry overrides. | 35 // ServiceRegistry overrides. |
36 virtual void AddService( | 36 virtual void AddService( |
37 const std::string& service_name, | 37 const std::string& service_name, |
38 const base::Callback<void(mojo::ScopedMessagePipeHandle)> service_factory) | 38 const base::Callback<void(mojo::ScopedMessagePipeHandle)> service_factory) |
39 OVERRIDE; | 39 OVERRIDE; |
40 virtual void RemoveService(const std::string& service_name) OVERRIDE; | 40 virtual void RemoveService(const std::string& service_name) OVERRIDE; |
41 virtual void GetRemoteInterface( | 41 virtual void GetRemoteInterface( |
42 const base::StringPiece& service_name, | 42 const base::StringPiece& service_name, |
43 mojo::ScopedMessagePipeHandle handle) OVERRIDE; | 43 mojo::ScopedMessagePipeHandle handle) OVERRIDE; |
| 44 virtual base::WeakPtr<ServiceRegistry> GetWeakPtr() OVERRIDE; |
44 | 45 |
45 private: | 46 private: |
46 // mojo::InterfaceImpl<mojo::IInterfaceProvider> overrides. | 47 // mojo::InterfaceImpl<mojo::IInterfaceProvider> overrides. |
47 virtual void GetInterface( | 48 virtual void GetInterface( |
48 const mojo::String& name, | 49 const mojo::String& name, |
49 mojo::ScopedMessagePipeHandle client_handle) OVERRIDE; | 50 mojo::ScopedMessagePipeHandle client_handle) OVERRIDE; |
50 virtual void OnConnectionError() OVERRIDE; | 51 virtual void OnConnectionError() OVERRIDE; |
51 | 52 |
52 std::map<std::string, base::Callback<void(mojo::ScopedMessagePipeHandle)> > | 53 std::map<std::string, base::Callback<void(mojo::ScopedMessagePipeHandle)> > |
53 service_factories_; | 54 service_factories_; |
54 std::queue<std::pair<std::string, mojo::MessagePipeHandle> > | 55 std::queue<std::pair<std::string, mojo::MessagePipeHandle> > |
55 pending_connects_; | 56 pending_connects_; |
56 bool bound_; | 57 bool bound_; |
| 58 |
| 59 base::WeakPtrFactory<ServiceRegistry> weak_factory_; |
57 }; | 60 }; |
58 | 61 |
59 } // namespace content | 62 } // namespace content |
60 | 63 |
61 #endif // CONTENT_COMMON_MOJO_SERVICE_REGISTRY_IMPL_H_ | 64 #endif // CONTENT_COMMON_MOJO_SERVICE_REGISTRY_IMPL_H_ |
OLD | NEW |