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 #include "mojo/services/network/http_connection_impl.h" | 5 #include "mojo/services/network/http_connection_impl.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
11 #include "base/callback.h" | 11 #include "base/callback.h" |
12 #include "base/logging.h" | 12 #include "base/logging.h" |
13 #include "base/stl_util.h" | 13 #include "base/stl_util.h" |
14 #include "base/strings/string_util.h" | 14 #include "base/strings/string_util.h" |
15 #include "mojo/message_pump/handle_watcher.h" | 15 #include "mojo/message_pump/handle_watcher.h" |
| 16 #include "mojo/public/cpp/bindings/type_converter.h" |
| 17 #include "mojo/public/cpp/system/data_pipe.h" |
16 #include "mojo/services/network/http_server_impl.h" | 18 #include "mojo/services/network/http_server_impl.h" |
17 #include "mojo/services/network/net_adapters.h" | 19 #include "mojo/services/network/net_adapters.h" |
18 #include "mojo/services/network/public/cpp/web_socket_read_queue.h" | 20 #include "mojo/services/network/public/cpp/web_socket_read_queue.h" |
19 #include "mojo/services/network/public/cpp/web_socket_write_queue.h" | 21 #include "mojo/services/network/public/cpp/web_socket_write_queue.h" |
20 #include "mojo/services/network/public/interfaces/web_socket.mojom.h" | 22 #include "mojo/services/network/public/interfaces/web_socket.mojom.h" |
21 #include "net/base/net_errors.h" | 23 #include "net/base/net_errors.h" |
22 #include "net/http/http_request_headers.h" | 24 #include "net/http/http_request_headers.h" |
23 #include "net/http/http_status_code.h" | 25 #include "net/http/http_status_code.h" |
24 #include "net/server/http_server.h" | 26 #include "net/server/http_server.h" |
25 #include "net/server/http_server_request_info.h" | 27 #include "net/server/http_server_request_info.h" |
26 #include "net/server/http_server_response_info.h" | 28 #include "net/server/http_server_response_info.h" |
27 #include "third_party/mojo/src/mojo/public/cpp/bindings/type_converter.h" | |
28 #include "third_party/mojo/src/mojo/public/cpp/system/data_pipe.h" | |
29 | 29 |
30 namespace mojo { | 30 namespace mojo { |
31 | 31 |
32 // SimpleDataPipeReader reads till end-of-file, stores the data in a string and | 32 // SimpleDataPipeReader reads till end-of-file, stores the data in a string and |
33 // notifies completion. | 33 // notifies completion. |
34 class HttpConnectionImpl::SimpleDataPipeReader { | 34 class HttpConnectionImpl::SimpleDataPipeReader { |
35 public: | 35 public: |
36 using CompletionCallback = | 36 using CompletionCallback = |
37 base::Callback<void(SimpleDataPipeReader*, scoped_ptr<std::string>)>; | 37 base::Callback<void(SimpleDataPipeReader*, scoped_ptr<std::string>)>; |
38 | 38 |
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
413 // The close operation is initiated by this object. | 413 // The close operation is initiated by this object. |
414 NotifyOwnerCloseIfAllDone(); | 414 NotifyOwnerCloseIfAllDone(); |
415 } else { | 415 } else { |
416 // The close operation is initiated by |web_socket_|; start closing this | 416 // The close operation is initiated by |web_socket_|; start closing this |
417 // object. | 417 // object. |
418 Close(); | 418 Close(); |
419 } | 419 } |
420 } | 420 } |
421 | 421 |
422 } // namespace mojo | 422 } // namespace mojo |
OLD | NEW |