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

Side by Side Diff: net/spdy/spdy_stream.cc

Issue 10810069: SPDY: Add WriteHeaders interface to SpdySession and SpdyStream (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: support AddEvent Created 8 years, 5 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 | Annotate | Revision Log
« net/spdy/spdy_session.cc ('K') | « net/spdy/spdy_stream.h ('k') | no next file » | 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 #include "net/spdy/spdy_stream.h" 5 #include "net/spdy/spdy_stream.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/stringprintf.h" 10 #include "base/stringprintf.h"
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after
472 send_time_ = base::TimeTicks::Now(); 472 send_time_ = base::TimeTicks::Now();
473 DCHECK(!has_upload_data_); 473 DCHECK(!has_upload_data_);
474 DCHECK(response_received()); 474 DCHECK(response_received());
475 return ERR_IO_PENDING; 475 return ERR_IO_PENDING;
476 } 476 }
477 CHECK_EQ(STATE_NONE, io_state_); 477 CHECK_EQ(STATE_NONE, io_state_);
478 io_state_ = STATE_GET_DOMAIN_BOUND_CERT; 478 io_state_ = STATE_GET_DOMAIN_BOUND_CERT;
479 return DoLoop(OK); 479 return DoLoop(OK);
480 } 480 }
481 481
482 int SpdyStream::WriteHeaders(const SpdyHeaderBlock& headers,
483 SpdyControlFlags flags) {
484 // Until the first headers by SYN_STREAM have been completely sent, we can
485 // not be sure that our stream_id is correct.
486 DCHECK_GT(io_state_, STATE_SEND_HEADERS_COMPLETE);
487 return session_->WriteHeaders(stream_id_, headers, flags);
488 }
489
482 int SpdyStream::WriteStreamData(IOBuffer* data, int length, 490 int SpdyStream::WriteStreamData(IOBuffer* data, int length,
483 SpdyDataFlags flags) { 491 SpdyDataFlags flags) {
484 // Until the headers have been completely sent, we can not be sure 492 // Until the headers have been completely sent, we can not be sure
485 // that our stream_id is correct. 493 // that our stream_id is correct.
486 DCHECK_GT(io_state_, STATE_SEND_HEADERS_COMPLETE); 494 DCHECK_GT(io_state_, STATE_SEND_HEADERS_COMPLETE);
487 return session_->WriteStreamData(stream_id_, data, length, flags); 495 return session_->WriteStreamData(stream_id_, data, length, flags);
488 } 496 }
489 497
490 bool SpdyStream::GetSSLInfo(SSLInfo* ssl_info, 498 bool SpdyStream::GetSSLInfo(SSLInfo* ssl_info,
491 bool* was_npn_negotiated, 499 bool* was_npn_negotiated,
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
733 UMA_HISTOGRAM_TIMES("Net.SpdyStreamDownloadTime", 741 UMA_HISTOGRAM_TIMES("Net.SpdyStreamDownloadTime",
734 recv_last_byte_time_ - recv_first_byte_time_); 742 recv_last_byte_time_ - recv_first_byte_time_);
735 UMA_HISTOGRAM_TIMES("Net.SpdyStreamTime", 743 UMA_HISTOGRAM_TIMES("Net.SpdyStreamTime",
736 recv_last_byte_time_ - send_time_); 744 recv_last_byte_time_ - send_time_);
737 745
738 UMA_HISTOGRAM_COUNTS("Net.SpdySendBytes", send_bytes_); 746 UMA_HISTOGRAM_COUNTS("Net.SpdySendBytes", send_bytes_);
739 UMA_HISTOGRAM_COUNTS("Net.SpdyRecvBytes", recv_bytes_); 747 UMA_HISTOGRAM_COUNTS("Net.SpdyRecvBytes", recv_bytes_);
740 } 748 }
741 749
742 } // namespace net 750 } // namespace net
OLDNEW
« net/spdy/spdy_session.cc ('K') | « net/spdy/spdy_stream.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698