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 const int connection_id_; | 58 const int connection_id_; |
59 HttpServerImpl* const owner_; | 59 HttpServerImpl* const owner_; |
60 HttpConnectionDelegatePtr delegate_; | 60 HttpConnectionDelegatePtr delegate_; |
61 Binding<HttpConnection> binding_; | 61 Binding<HttpConnection> binding_; |
62 // Owns its elements. | 62 // Owns its elements. |
63 std::set<SimpleDataPipeReader*> response_body_readers_; | 63 std::set<SimpleDataPipeReader*> response_body_readers_; |
64 bool encountered_connection_error_; | 64 bool encountered_connection_error_; |
65 | 65 |
66 DISALLOW_COPY_AND_ASSIGN(HttpConnectionImpl); | 66 DISALLOW_COPY_AND_ASSIGN(HttpConnectionImpl); |
67 }; | 67 }; |
68 | 68 |
69 } // namespace mojo | 69 } // namespace mojo |
70 | 70 |
71 #endif // MOJO_SERVICES_NETWORK_HTTP_CONNECTION_IMPL_H_ | 71 #endif // MOJO_SERVICES_NETWORK_HTTP_CONNECTION_IMPL_H_ |
OLD | NEW |