Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(380)

Side by Side Diff: mojo/services/network/http_connection_impl.h

Issue 1134883002: Mojo service implementation for HTTP server - part 1 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « mojo/services/network/BUILD.gn ('k') | mojo/services/network/http_connection_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef MOJO_SERVICES_NETWORK_HTTP_CONNECTION_IMPL_H_
6 #define MOJO_SERVICES_NETWORK_HTTP_CONNECTION_IMPL_H_
7
8 #include <string>
9
10 #include "base/macros.h"
11 #include "mojo/services/network/public/interfaces/http_connection.mojom.h"
12 #include "third_party/mojo/src/mojo/public/cpp/bindings/binding.h"
13 #include "third_party/mojo/src/mojo/public/cpp/bindings/error_handler.h"
14
15 namespace net {
16 class HttpServerRequestInfo;
17 }
18
19 namespace mojo {
20
21 class HttpServerImpl;
22
23 class HttpConnectionImpl : public HttpConnection,
24 public ErrorHandler {
25 public:
26 // |owner| must outlive this object.
27 HttpConnectionImpl(int connection_id,
28 HttpServerImpl* owner,
29 HttpConnectionDelegatePtr delegate,
30 HttpConnectionPtr* connection);
31
32 ~HttpConnectionImpl() override;
33
34 void OnReceivedHttpRequest(const net::HttpServerRequestInfo& info);
35 void OnReceivedWebSocketRequest(const net::HttpServerRequestInfo& info);
36 void OnReceivedWebSocketMessage(const std::string& data);
37
38 private:
39 // HttpConnection implementation.
40 void SetSendBufferSize(uint32_t size,
41 const SetSendBufferSizeCallback& callback) override;
42 void SetReceiveBufferSize(
43 uint32_t size,
44 const SetReceiveBufferSizeCallback& callback) override;
45
46 // ErrorHandler implementation.
47 void OnConnectionError() override;
48
49 const int connection_id_;
50 HttpServerImpl* const owner_;
51 HttpConnectionDelegatePtr delegate_;
52 Binding<HttpConnection> binding_;
53
54 DISALLOW_COPY_AND_ASSIGN(HttpConnectionImpl);
55 };
56
57 } // namespace mojo
58
59 #endif // MOJO_SERVICES_NETWORK_HTTP_CONNECTION_IMPL_H_
OLDNEW
« no previous file with comments | « mojo/services/network/BUILD.gn ('k') | mojo/services/network/http_connection_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698