| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 GOOGLE_APIS_GCM_ENGINE_CONNECTION_HANDLER_IMPL_H_ | 5 #ifndef GOOGLE_APIS_GCM_ENGINE_CONNECTION_HANDLER_IMPL_H_ |
| 6 #define GOOGLE_APIS_GCM_ENGINE_CONNECTION_HANDLER_IMPL_H_ | 6 #define GOOGLE_APIS_GCM_ENGINE_CONNECTION_HANDLER_IMPL_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
| 14 #include "base/time/time.h" | 14 #include "base/time/time.h" |
| 15 #include "base/timer/timer.h" | 15 #include "base/timer/timer.h" |
| 16 #include "google_apis/gcm/engine/connection_handler.h" | 16 #include "google_apis/gcm/engine/connection_handler.h" |
| 17 | 17 |
| 18 namespace mcs_proto { | 18 namespace mcs_proto { |
| 19 class LoginRequest; | 19 class LoginRequest; |
| 20 } // namespace mcs_proto | 20 } // namespace mcs_proto |
| 21 | 21 |
| 22 namespace gcm { | 22 namespace gcm { |
| 23 | 23 |
| 24 class SocketInputStream; |
| 25 class SocketOutputStream; |
| 26 |
| 24 class GCM_EXPORT ConnectionHandlerImpl : public ConnectionHandler { | 27 class GCM_EXPORT ConnectionHandlerImpl : public ConnectionHandler { |
| 25 public: | 28 public: |
| 26 // |read_callback| will be invoked with the contents of any received protobuf | 29 // |read_callback| will be invoked with the contents of any received protobuf |
| 27 // message. | 30 // message. |
| 28 // |write_callback| will be invoked anytime a message has been successfully | 31 // |write_callback| will be invoked anytime a message has been successfully |
| 29 // sent. Note: this just means the data was sent to the wire, not that the | 32 // sent. Note: this just means the data was sent to the wire, not that the |
| 30 // other end received it. | 33 // other end received it. |
| 31 // |connection_callback| will be invoked with any fatal read/write errors | 34 // |connection_callback| will be invoked with any fatal read/write errors |
| 32 // encountered. | 35 // encountered. |
| 33 ConnectionHandlerImpl( | 36 ConnectionHandlerImpl( |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 std::vector<uint8_t> payload_input_buffer_; | 128 std::vector<uint8_t> payload_input_buffer_; |
| 126 | 129 |
| 127 base::WeakPtrFactory<ConnectionHandlerImpl> weak_ptr_factory_; | 130 base::WeakPtrFactory<ConnectionHandlerImpl> weak_ptr_factory_; |
| 128 | 131 |
| 129 DISALLOW_COPY_AND_ASSIGN(ConnectionHandlerImpl); | 132 DISALLOW_COPY_AND_ASSIGN(ConnectionHandlerImpl); |
| 130 }; | 133 }; |
| 131 | 134 |
| 132 } // namespace gcm | 135 } // namespace gcm |
| 133 | 136 |
| 134 #endif // GOOGLE_APIS_GCM_ENGINE_CONNECTION_HANDLER_IMPL_H_ | 137 #endif // GOOGLE_APIS_GCM_ENGINE_CONNECTION_HANDLER_IMPL_H_ |
| OLD | NEW |