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_SERVICES_NETWORK_HTTP_CONNECTION_IMPL_H_ | 5 #ifndef MOJO_SERVICES_NETWORK_HTTP_CONNECTION_IMPL_H_ |
6 #define MOJO_SERVICES_NETWORK_HTTP_CONNECTION_IMPL_H_ | 6 #define MOJO_SERVICES_NETWORK_HTTP_CONNECTION_IMPL_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/macros.h" | 11 #include "base/macros.h" |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "mojo/services/network/public/interfaces/http_connection.mojom.h" | 13 #include "mojo/services/network/public/interfaces/http_connection.mojom.h" |
14 #include "mojo/services/network/public/interfaces/url_loader.mojom.h" | 14 #include "mojo/services/network/public/interfaces/http_message.mojom.h" |
15 #include "third_party/mojo/src/mojo/public/cpp/bindings/binding.h" | 15 #include "third_party/mojo/src/mojo/public/cpp/bindings/binding.h" |
16 #include "third_party/mojo/src/mojo/public/cpp/bindings/error_handler.h" | 16 #include "third_party/mojo/src/mojo/public/cpp/bindings/error_handler.h" |
17 | 17 |
18 namespace net { | 18 namespace net { |
19 class HttpServerRequestInfo; | 19 class HttpServerRequestInfo; |
20 } | 20 } |
21 | 21 |
22 namespace mojo { | 22 namespace mojo { |
23 | 23 |
24 class HttpServerImpl; | 24 class HttpServerImpl; |
(...skipping 19 matching lines...) Expand all Loading... |
44 // HttpConnection implementation. | 44 // HttpConnection implementation. |
45 void SetSendBufferSize(uint32_t size, | 45 void SetSendBufferSize(uint32_t size, |
46 const SetSendBufferSizeCallback& callback) override; | 46 const SetSendBufferSizeCallback& callback) override; |
47 void SetReceiveBufferSize( | 47 void SetReceiveBufferSize( |
48 uint32_t size, | 48 uint32_t size, |
49 const SetReceiveBufferSizeCallback& callback) override; | 49 const SetReceiveBufferSizeCallback& callback) override; |
50 | 50 |
51 // ErrorHandler implementation. | 51 // ErrorHandler implementation. |
52 void OnConnectionError() override; | 52 void OnConnectionError() override; |
53 | 53 |
54 void OnFinishedReadingResponseBody(URLResponsePtr response_ptr, | 54 void OnFinishedReadingResponseBody(HttpResponsePtr response_ptr, |
55 SimpleDataPipeReader* reader, | 55 SimpleDataPipeReader* reader, |
56 scoped_ptr<std::string> body); | 56 scoped_ptr<std::string> body); |
57 | 57 |
58 bool EncounteredConnectionError() const { | 58 bool EncounteredConnectionError() const { |
59 return !binding_.is_bound() || !delegate_; | 59 return !binding_.is_bound() || !delegate_; |
60 } | 60 } |
61 | 61 |
62 const int connection_id_; | 62 const int connection_id_; |
63 HttpServerImpl* const owner_; | 63 HttpServerImpl* const owner_; |
64 HttpConnectionDelegatePtr delegate_; | 64 HttpConnectionDelegatePtr delegate_; |
65 Binding<HttpConnection> binding_; | 65 Binding<HttpConnection> binding_; |
66 // Owns its elements. | 66 // Owns its elements. |
67 std::set<SimpleDataPipeReader*> response_body_readers_; | 67 std::set<SimpleDataPipeReader*> response_body_readers_; |
68 | 68 |
69 DISALLOW_COPY_AND_ASSIGN(HttpConnectionImpl); | 69 DISALLOW_COPY_AND_ASSIGN(HttpConnectionImpl); |
70 }; | 70 }; |
71 | 71 |
72 } // namespace mojo | 72 } // namespace mojo |
73 | 73 |
74 #endif // MOJO_SERVICES_NETWORK_HTTP_CONNECTION_IMPL_H_ | 74 #endif // MOJO_SERVICES_NETWORK_HTTP_CONNECTION_IMPL_H_ |
OLD | NEW |