| 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_INTERFACE_ENDPOINT_CLIENT_H_ | 5 #ifndef MOJO_PUBLIC_CPP_BINDINGS_INTERFACE_ENDPOINT_CLIENT_H_ |
| 6 #define MOJO_PUBLIC_CPP_BINDINGS_INTERFACE_ENDPOINT_CLIENT_H_ | 6 #define MOJO_PUBLIC_CPP_BINDINGS_INTERFACE_ENDPOINT_CLIENT_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| 11 #include <memory> | 11 #include <memory> |
| 12 | 12 |
| 13 #include "base/callback.h" | 13 #include "base/callback.h" |
| 14 #include "base/compiler_specific.h" |
| 14 #include "base/logging.h" | 15 #include "base/logging.h" |
| 15 #include "base/macros.h" | 16 #include "base/macros.h" |
| 16 #include "base/memory/ref_counted.h" | 17 #include "base/memory/ref_counted.h" |
| 17 #include "base/memory/weak_ptr.h" | 18 #include "base/memory/weak_ptr.h" |
| 18 #include "base/single_thread_task_runner.h" | 19 #include "base/single_thread_task_runner.h" |
| 19 #include "base/threading/thread_checker.h" | 20 #include "base/threading/thread_checker.h" |
| 21 #include "mojo/public/cpp/bindings/bindings_export.h" |
| 20 #include "mojo/public/cpp/bindings/connection_error_callback.h" | 22 #include "mojo/public/cpp/bindings/connection_error_callback.h" |
| 21 #include "mojo/public/cpp/bindings/filter_chain.h" | 23 #include "mojo/public/cpp/bindings/filter_chain.h" |
| 22 #include "mojo/public/cpp/bindings/lib/control_message_handler.h" | 24 #include "mojo/public/cpp/bindings/lib/control_message_handler.h" |
| 23 #include "mojo/public/cpp/bindings/lib/control_message_proxy.h" | 25 #include "mojo/public/cpp/bindings/lib/control_message_proxy.h" |
| 24 #include "mojo/public/cpp/bindings/message.h" | 26 #include "mojo/public/cpp/bindings/message.h" |
| 25 #include "mojo/public/cpp/bindings/scoped_interface_endpoint_handle.h" | 27 #include "mojo/public/cpp/bindings/scoped_interface_endpoint_handle.h" |
| 26 | 28 |
| 27 namespace mojo { | 29 namespace mojo { |
| 28 | 30 |
| 29 class AssociatedGroup; | 31 class AssociatedGroup; |
| 30 class AssociatedGroupController; | 32 class AssociatedGroupController; |
| 31 class InterfaceEndpointController; | 33 class InterfaceEndpointController; |
| 32 | 34 |
| 33 // InterfaceEndpointClient handles message sending and receiving of an interface | 35 // InterfaceEndpointClient handles message sending and receiving of an interface |
| 34 // endpoint, either the implementation side or the client side. | 36 // endpoint, either the implementation side or the client side. |
| 35 // It should only be accessed and destructed on the creating thread. | 37 // It should only be accessed and destructed on the creating thread. |
| 36 class InterfaceEndpointClient : public MessageReceiverWithResponder { | 38 class MOJO_CPP_BINDINGS_EXPORT InterfaceEndpointClient |
| 39 : NON_EXPORTED_BASE(public MessageReceiverWithResponder) { |
| 37 public: | 40 public: |
| 38 // |receiver| is okay to be null. If it is not null, it must outlive this | 41 // |receiver| is okay to be null. If it is not null, it must outlive this |
| 39 // object. | 42 // object. |
| 40 InterfaceEndpointClient(ScopedInterfaceEndpointHandle handle, | 43 InterfaceEndpointClient(ScopedInterfaceEndpointHandle handle, |
| 41 MessageReceiverWithResponderStatus* receiver, | 44 MessageReceiverWithResponderStatus* receiver, |
| 42 std::unique_ptr<MessageReceiver> payload_validator, | 45 std::unique_ptr<MessageReceiver> payload_validator, |
| 43 bool expect_sync_requests, | 46 bool expect_sync_requests, |
| 44 scoped_refptr<base::SingleThreadTaskRunner> runner, | 47 scoped_refptr<base::SingleThreadTaskRunner> runner, |
| 45 uint32_t interface_version); | 48 uint32_t interface_version); |
| 46 ~InterfaceEndpointClient() override; | 49 ~InterfaceEndpointClient() override; |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 base::ThreadChecker thread_checker_; | 173 base::ThreadChecker thread_checker_; |
| 171 | 174 |
| 172 base::WeakPtrFactory<InterfaceEndpointClient> weak_ptr_factory_; | 175 base::WeakPtrFactory<InterfaceEndpointClient> weak_ptr_factory_; |
| 173 | 176 |
| 174 DISALLOW_COPY_AND_ASSIGN(InterfaceEndpointClient); | 177 DISALLOW_COPY_AND_ASSIGN(InterfaceEndpointClient); |
| 175 }; | 178 }; |
| 176 | 179 |
| 177 } // namespace mojo | 180 } // namespace mojo |
| 178 | 181 |
| 179 #endif // MOJO_PUBLIC_CPP_BINDINGS_INTERFACE_ENDPOINT_CLIENT_H_ | 182 #endif // MOJO_PUBLIC_CPP_BINDINGS_INTERFACE_ENDPOINT_CLIENT_H_ |
| OLD | NEW |