| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_PUBLIC_CPP_BINDINGS_LIB_BINDING_STATE_H_ | 5 #ifndef MOJO_PUBLIC_CPP_BINDINGS_LIB_BINDING_STATE_H_ |
| 6 #define MOJO_PUBLIC_CPP_BINDINGS_LIB_BINDING_STATE_H_ | 6 #define MOJO_PUBLIC_CPP_BINDINGS_LIB_BINDING_STATE_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| 11 | 11 |
| 12 #include "base/bind.h" | 12 #include "base/bind.h" |
| 13 #include "base/callback.h" | 13 #include "base/callback.h" |
| 14 #include "base/logging.h" | 14 #include "base/logging.h" |
| 15 #include "base/macros.h" | 15 #include "base/macros.h" |
| 16 #include "base/memory/ptr_util.h" | 16 #include "base/memory/ptr_util.h" |
| 17 #include "base/memory/ref_counted.h" | 17 #include "base/memory/ref_counted.h" |
| 18 #include "base/single_thread_task_runner.h" | 18 #include "base/single_thread_task_runner.h" |
| 19 #include "mojo/public/cpp/bindings/associated_group.h" | 19 #include "mojo/public/cpp/bindings/associated_group.h" |
| 20 #include "mojo/public/cpp/bindings/bindings_export.h" |
| 20 #include "mojo/public/cpp/bindings/connection_error_callback.h" | 21 #include "mojo/public/cpp/bindings/connection_error_callback.h" |
| 21 #include "mojo/public/cpp/bindings/filter_chain.h" | 22 #include "mojo/public/cpp/bindings/filter_chain.h" |
| 22 #include "mojo/public/cpp/bindings/interface_endpoint_client.h" | 23 #include "mojo/public/cpp/bindings/interface_endpoint_client.h" |
| 23 #include "mojo/public/cpp/bindings/interface_id.h" | 24 #include "mojo/public/cpp/bindings/interface_id.h" |
| 24 #include "mojo/public/cpp/bindings/interface_ptr.h" | 25 #include "mojo/public/cpp/bindings/interface_ptr.h" |
| 25 #include "mojo/public/cpp/bindings/interface_ptr_info.h" | 26 #include "mojo/public/cpp/bindings/interface_ptr_info.h" |
| 26 #include "mojo/public/cpp/bindings/interface_request.h" | 27 #include "mojo/public/cpp/bindings/interface_request.h" |
| 27 #include "mojo/public/cpp/bindings/lib/multiplex_router.h" | 28 #include "mojo/public/cpp/bindings/lib/multiplex_router.h" |
| 28 #include "mojo/public/cpp/bindings/lib/router.h" | 29 #include "mojo/public/cpp/bindings/lib/router.h" |
| 29 #include "mojo/public/cpp/bindings/message_header_validator.h" | 30 #include "mojo/public/cpp/bindings/message_header_validator.h" |
| 30 #include "mojo/public/cpp/bindings/scoped_interface_endpoint_handle.h" | 31 #include "mojo/public/cpp/bindings/scoped_interface_endpoint_handle.h" |
| 31 #include "mojo/public/cpp/system/core.h" | 32 #include "mojo/public/cpp/system/core.h" |
| 32 | 33 |
| 33 namespace mojo { | 34 namespace mojo { |
| 34 namespace internal { | 35 namespace internal { |
| 35 | 36 |
| 36 // Base class used for templated binding primitives which bind a pipe | 37 // Base class used for templated binding primitives which bind a pipe |
| 37 // exclusively to a single interface. | 38 // exclusively to a single interface. |
| 38 class SimpleBindingState { | 39 class MOJO_CPP_BINDINGS_EXPORT SimpleBindingState { |
| 39 public: | 40 public: |
| 40 SimpleBindingState(); | 41 SimpleBindingState(); |
| 41 ~SimpleBindingState(); | 42 ~SimpleBindingState(); |
| 42 | 43 |
| 43 void AddFilter(std::unique_ptr<MessageReceiver> filter); | 44 void AddFilter(std::unique_ptr<MessageReceiver> filter); |
| 44 | 45 |
| 45 bool HasAssociatedInterfaces() const { return false; } | 46 bool HasAssociatedInterfaces() const { return false; } |
| 46 | 47 |
| 47 void PauseIncomingMethodCallProcessing(); | 48 void PauseIncomingMethodCallProcessing(); |
| 48 void ResumeIncomingMethodCallProcessing(); | 49 void ResumeIncomingMethodCallProcessing(); |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 | 128 |
| 128 private: | 129 private: |
| 129 typename Interface::Stub_ stub_; | 130 typename Interface::Stub_ stub_; |
| 130 Interface* impl_; | 131 Interface* impl_; |
| 131 | 132 |
| 132 DISALLOW_COPY_AND_ASSIGN(BindingState); | 133 DISALLOW_COPY_AND_ASSIGN(BindingState); |
| 133 }; | 134 }; |
| 134 | 135 |
| 135 // Base class used for templated binding primitives which may bind a pipe to | 136 // Base class used for templated binding primitives which may bind a pipe to |
| 136 // multiple interfaces. | 137 // multiple interfaces. |
| 137 class MultiplexedBindingState { | 138 class MOJO_CPP_BINDINGS_EXPORT MultiplexedBindingState { |
| 138 public: | 139 public: |
| 139 MultiplexedBindingState(); | 140 MultiplexedBindingState(); |
| 140 ~MultiplexedBindingState(); | 141 ~MultiplexedBindingState(); |
| 141 | 142 |
| 142 void AddFilter(std::unique_ptr<MessageReceiver> filter); | 143 void AddFilter(std::unique_ptr<MessageReceiver> filter); |
| 143 | 144 |
| 144 bool HasAssociatedInterfaces() const; | 145 bool HasAssociatedInterfaces() const; |
| 145 | 146 |
| 146 void PauseIncomingMethodCallProcessing(); | 147 void PauseIncomingMethodCallProcessing(); |
| 147 void ResumeIncomingMethodCallProcessing(); | 148 void ResumeIncomingMethodCallProcessing(); |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 typename Interface::Stub_ stub_; | 226 typename Interface::Stub_ stub_; |
| 226 Interface* impl_; | 227 Interface* impl_; |
| 227 | 228 |
| 228 DISALLOW_COPY_AND_ASSIGN(BindingState); | 229 DISALLOW_COPY_AND_ASSIGN(BindingState); |
| 229 }; | 230 }; |
| 230 | 231 |
| 231 } // namesapce internal | 232 } // namesapce internal |
| 232 } // namespace mojo | 233 } // namespace mojo |
| 233 | 234 |
| 234 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_BINDING_STATE_H_ | 235 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_BINDING_STATE_H_ |
| OLD | NEW |