OLD | NEW |
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_SPDY_SPDY_STREAM_H_ | 5 #ifndef NET_SPDY_SPDY_STREAM_H_ |
6 #define NET_SPDY_SPDY_STREAM_H_ | 6 #define NET_SPDY_SPDY_STREAM_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 GURL GetUrl() const; | 251 GURL GetUrl() const; |
252 | 252 |
253 // ChunkCallback methods. | 253 // ChunkCallback methods. |
254 virtual void OnChunkAvailable() OVERRIDE; | 254 virtual void OnChunkAvailable() OVERRIDE; |
255 | 255 |
256 int GetProtocolVersion() const; | 256 int GetProtocolVersion() const; |
257 | 257 |
258 private: | 258 private: |
259 enum State { | 259 enum State { |
260 STATE_NONE, | 260 STATE_NONE, |
261 STATE_GET_ORIGIN_BOUND_CERT, | 261 STATE_GET_DOMAIN_BOUND_CERT, |
262 STATE_GET_ORIGIN_BOUND_CERT_COMPLETE, | 262 STATE_GET_DOMAIN_BOUND_CERT_COMPLETE, |
263 STATE_SEND_ORIGIN_BOUND_CERT, | 263 STATE_SEND_DOMAIN_BOUND_CERT, |
264 STATE_SEND_ORIGIN_BOUND_CERT_COMPLETE, | 264 STATE_SEND_DOMAIN_BOUND_CERT_COMPLETE, |
265 STATE_SEND_HEADERS, | 265 STATE_SEND_HEADERS, |
266 STATE_SEND_HEADERS_COMPLETE, | 266 STATE_SEND_HEADERS_COMPLETE, |
267 STATE_SEND_BODY, | 267 STATE_SEND_BODY, |
268 STATE_SEND_BODY_COMPLETE, | 268 STATE_SEND_BODY_COMPLETE, |
269 STATE_WAITING_FOR_RESPONSE, | 269 STATE_WAITING_FOR_RESPONSE, |
270 STATE_OPEN, | 270 STATE_OPEN, |
271 STATE_DONE | 271 STATE_DONE |
272 }; | 272 }; |
273 | 273 |
274 friend class base::RefCounted<SpdyStream>; | 274 friend class base::RefCounted<SpdyStream>; |
275 virtual ~SpdyStream(); | 275 virtual ~SpdyStream(); |
276 | 276 |
277 void OnGetOriginBoundCertComplete(int result); | 277 void OnGetDomainBoundCertComplete(int result); |
278 | 278 |
279 // Try to make progress sending/receiving the request/response. | 279 // Try to make progress sending/receiving the request/response. |
280 int DoLoop(int result); | 280 int DoLoop(int result); |
281 | 281 |
282 // The implementations of each state of the state machine. | 282 // The implementations of each state of the state machine. |
283 int DoGetOriginBoundCert(); | 283 int DoGetDomainBoundCert(); |
284 int DoGetOriginBoundCertComplete(int result); | 284 int DoGetDomainBoundCertComplete(int result); |
285 int DoSendOriginBoundCert(); | 285 int DoSendDomainBoundCert(); |
286 int DoSendOriginBoundCertComplete(int result); | 286 int DoSendDomainBoundCertComplete(int result); |
287 int DoSendHeaders(); | 287 int DoSendHeaders(); |
288 int DoSendHeadersComplete(int result); | 288 int DoSendHeadersComplete(int result); |
289 int DoSendBody(); | 289 int DoSendBody(); |
290 int DoSendBodyComplete(int result); | 290 int DoSendBodyComplete(int result); |
291 int DoReadHeaders(); | 291 int DoReadHeaders(); |
292 int DoReadHeadersComplete(int result); | 292 int DoReadHeadersComplete(int result); |
293 int DoOpen(int result); | 293 int DoOpen(int result); |
294 | 294 |
295 // Update the histograms. Can safely be called repeatedly, but should only | 295 // Update the histograms. Can safely be called repeatedly, but should only |
296 // be called after the stream has completed. | 296 // be called after the stream has completed. |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
350 BoundNetLog net_log_; | 350 BoundNetLog net_log_; |
351 | 351 |
352 base::TimeTicks send_time_; | 352 base::TimeTicks send_time_; |
353 base::TimeTicks recv_first_byte_time_; | 353 base::TimeTicks recv_first_byte_time_; |
354 base::TimeTicks recv_last_byte_time_; | 354 base::TimeTicks recv_last_byte_time_; |
355 int send_bytes_; | 355 int send_bytes_; |
356 int recv_bytes_; | 356 int recv_bytes_; |
357 // Data received before delegate is attached. | 357 // Data received before delegate is attached. |
358 std::vector<scoped_refptr<IOBufferWithSize> > pending_buffers_; | 358 std::vector<scoped_refptr<IOBufferWithSize> > pending_buffers_; |
359 | 359 |
360 SSLClientCertType ob_cert_type_; | 360 SSLClientCertType domain_bound_cert_type_; |
361 std::string ob_private_key_; | 361 std::string domain_bound_private_key_; |
362 std::string ob_cert_; | 362 std::string domain_bound_cert_; |
363 OriginBoundCertService::RequestHandle ob_cert_request_handle_; | 363 ServerBoundCertService::RequestHandle domain_bound_cert_request_handle_; |
364 | 364 |
365 DISALLOW_COPY_AND_ASSIGN(SpdyStream); | 365 DISALLOW_COPY_AND_ASSIGN(SpdyStream); |
366 }; | 366 }; |
367 | 367 |
368 class NetLogSpdyStreamErrorParameter : public NetLog::EventParameters { | 368 class NetLogSpdyStreamErrorParameter : public NetLog::EventParameters { |
369 public: | 369 public: |
370 NetLogSpdyStreamErrorParameter(spdy::SpdyStreamId stream_id, | 370 NetLogSpdyStreamErrorParameter(spdy::SpdyStreamId stream_id, |
371 int status, | 371 int status, |
372 const std::string& description); | 372 const std::string& description); |
373 | 373 |
374 spdy::SpdyStreamId stream_id() const { return stream_id_; } | 374 spdy::SpdyStreamId stream_id() const { return stream_id_; } |
375 virtual base::Value* ToValue() const OVERRIDE; | 375 virtual base::Value* ToValue() const OVERRIDE; |
376 | 376 |
377 private: | 377 private: |
378 virtual ~NetLogSpdyStreamErrorParameter(); | 378 virtual ~NetLogSpdyStreamErrorParameter(); |
379 | 379 |
380 const spdy::SpdyStreamId stream_id_; | 380 const spdy::SpdyStreamId stream_id_; |
381 const int status_; | 381 const int status_; |
382 const std::string description_; | 382 const std::string description_; |
383 | 383 |
384 DISALLOW_COPY_AND_ASSIGN(NetLogSpdyStreamErrorParameter); | 384 DISALLOW_COPY_AND_ASSIGN(NetLogSpdyStreamErrorParameter); |
385 }; | 385 }; |
386 | 386 |
387 } // namespace net | 387 } // namespace net |
388 | 388 |
389 #endif // NET_SPDY_SPDY_STREAM_H_ | 389 #endif // NET_SPDY_SPDY_STREAM_H_ |
OLD | NEW |