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

Side by Side Diff: net/quic/quic_stream_factory.h

Issue 11416058: Integrating the QuicStreamFactory into the network stack. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix static initializer Created 8 years 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 | Annotate | Revision Log
« no previous file with comments | « net/quic/quic_protocol.h ('k') | net/quic/quic_stream_factory.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 NET_QUIC_QUIC_STREAM_FACTORY_H_ 5 #ifndef NET_QUIC_QUIC_STREAM_FACTORY_H_
6 #define NET_QUIC_QUIC_STREAM_FACTORY_H_ 6 #define NET_QUIC_QUIC_STREAM_FACTORY_H_
7 7
8 #include <map> 8 #include <map>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 59
60 // A factory for creating new QuicHttpStreams on top of a pool of 60 // A factory for creating new QuicHttpStreams on top of a pool of
61 // QuicClientSessions. 61 // QuicClientSessions.
62 class NET_EXPORT_PRIVATE QuicStreamFactory { 62 class NET_EXPORT_PRIVATE QuicStreamFactory {
63 public: 63 public:
64 typedef base::Callback<uint64()> RandomUint64Callback; 64 typedef base::Callback<uint64()> RandomUint64Callback;
65 65
66 QuicStreamFactory(HostResolver* host_resolver, 66 QuicStreamFactory(HostResolver* host_resolver,
67 ClientSocketFactory* client_socket_factory, 67 ClientSocketFactory* client_socket_factory,
68 const RandomUint64Callback& random_uint64_callback, 68 const RandomUint64Callback& random_uint64_callback,
69 const QuicClock* clock); 69 QuicClock* clock);
70 virtual ~QuicStreamFactory(); 70 virtual ~QuicStreamFactory();
71 71
72 // Creates a new QuicHttpStream to |host_port_proxy_pair| which will be 72 // Creates a new QuicHttpStream to |host_port_proxy_pair| which will be
73 // owned by |request|. If a matching session already exists, this 73 // owned by |request|. If a matching session already exists, this
74 // method will return OK. If no matching session exists, this will 74 // method will return OK. If no matching session exists, this will
75 // return ERR_IO_PENDING and will invoke OnRequestComplete asynchronously. 75 // return ERR_IO_PENDING and will invoke OnRequestComplete asynchronously.
76 int Create(const HostPortProxyPair& host_port_proxy_pair, 76 int Create(const HostPortProxyPair& host_port_proxy_pair,
77 const BoundNetLog& net_log, 77 const BoundNetLog& net_log,
78 QuicStreamRequest* request); 78 QuicStreamRequest* request);
79 79
(...skipping 28 matching lines...) Expand all
108 bool HasActiveSession(const HostPortProxyPair& host_port_proxy_pair); 108 bool HasActiveSession(const HostPortProxyPair& host_port_proxy_pair);
109 bool HasActiveJob(const HostPortProxyPair& host_port_proxy_pair); 109 bool HasActiveJob(const HostPortProxyPair& host_port_proxy_pair);
110 QuicClientSession* CreateSession(const AddressList& address_list_, 110 QuicClientSession* CreateSession(const AddressList& address_list_,
111 const BoundNetLog& net_log); 111 const BoundNetLog& net_log);
112 void ActivateSession(const HostPortProxyPair& host_port_proxy_pair, 112 void ActivateSession(const HostPortProxyPair& host_port_proxy_pair,
113 QuicClientSession* session); 113 QuicClientSession* session);
114 114
115 HostResolver* host_resolver_; 115 HostResolver* host_resolver_;
116 ClientSocketFactory* client_socket_factory_; 116 ClientSocketFactory* client_socket_factory_;
117 RandomUint64Callback random_uint64_callback_; 117 RandomUint64Callback random_uint64_callback_;
118 const QuicClock* clock_; 118 scoped_ptr<QuicClock> clock_;
119 119
120 // Contains owning pointers to all sessions that currently exist. 120 // Contains owning pointers to all sessions that currently exist.
121 SessionSet all_sessions_; 121 SessionSet all_sessions_;
122 // Contains non-owning pointers to currently active session 122 // Contains non-owning pointers to currently active session
123 // (not going away session, once they're implemented). 123 // (not going away session, once they're implemented).
124 SessionMap active_sessions_; 124 SessionMap active_sessions_;
125 SessionAliasMap session_aliases_; 125 SessionAliasMap session_aliases_;
126 126
127 JobMap active_jobs_; 127 JobMap active_jobs_;
128 JobRequestsMap job_requests_map_; 128 JobRequestsMap job_requests_map_;
129 RequestMap active_requests_; 129 RequestMap active_requests_;
130 130
131 base::WeakPtrFactory<QuicStreamFactory> weak_factory_; 131 base::WeakPtrFactory<QuicStreamFactory> weak_factory_;
132 132
133 DISALLOW_COPY_AND_ASSIGN(QuicStreamFactory); 133 DISALLOW_COPY_AND_ASSIGN(QuicStreamFactory);
134 }; 134 };
135 135
136 } // namespace net 136 } // namespace net
137 137
138 #endif // NET_QUIC_QUIC_STREAM_FACTORY_H_ 138 #endif // NET_QUIC_QUIC_STREAM_FACTORY_H_
OLDNEW
« no previous file with comments | « net/quic/quic_protocol.h ('k') | net/quic/quic_stream_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698