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

Side by Side Diff: net/spdy/spdy_session.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
« no previous file with comments | « net/spdy/spdy_session.h ('k') | net/spdy/spdy_stream.h » ('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 #include "net/spdy/spdy_session.h" 5 #include "net/spdy/spdy_session.h"
6 6
7 #include <map> 7 #include <map>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 640 matching lines...) Expand 10 before | Expand all | Expand 10 after
651 QueueFrame(credential_frame.get(), HIGHEST, NULL); 651 QueueFrame(credential_frame.get(), HIGHEST, NULL);
652 652
653 if (net_log().IsLoggingAllEvents()) { 653 if (net_log().IsLoggingAllEvents()) {
654 net_log().AddEvent( 654 net_log().AddEvent(
655 NetLog::TYPE_SPDY_SESSION_SEND_CREDENTIAL, 655 NetLog::TYPE_SPDY_SESSION_SEND_CREDENTIAL,
656 base::Bind(&NetLogSpdyCredentialCallback, credential.slot, &origin)); 656 base::Bind(&NetLogSpdyCredentialCallback, credential.slot, &origin));
657 } 657 }
658 return ERR_IO_PENDING; 658 return ERR_IO_PENDING;
659 } 659 }
660 660
661 int SpdySession::WriteHeaders(SpdyStreamId stream_id,
662 const SpdyHeaderBlock& headers,
663 SpdyControlFlags flags) {
664 // Find our stream
665 CHECK(IsStreamActive(stream_id));
666 scoped_refptr<SpdyStream> stream = active_streams_[stream_id];
667 CHECK_EQ(stream->stream_id(), stream_id);
668
669 // Create and send a HEADER frame.
670 scoped_ptr<SpdyHeadersControlFrame> frame(
671 buffered_spdy_framer_->CreateHeaders(stream_id, flags, true, &headers));
Ryan Hamilton 2012/07/24 17:53:03 is "true" the the boolean for compressed? If so,
Takashi Toyoshima 2012/07/25 08:44:24 OK, I see the current issue. I change this flag to
672 QueueFrame(frame.get(), stream->priority(), stream);
673
674 if (net_log().IsLoggingAllEvents()) {
675 bool fin = flags & CONTROL_FLAG_FIN;
676 net_log().AddEvent(
677 NetLog::TYPE_SPDY_SESSION_HEADERS,
mmenke 2012/07/24 16:42:41 This is what's logged when we receive headers befo
Ryan Hamilton 2012/07/24 17:53:03 Yes, I think we should add a new TYPE_SPDY_SESSION
Takashi Toyoshima 2012/07/25 08:44:24 Done.
678 base::Bind(&NetLogSpdySynCallback,
679 &headers, fin, /*unidirectional=*/false,
680 stream_id, 0));
681 }
682 return ERR_IO_PENDING;
683 }
684
661 int SpdySession::WriteStreamData(SpdyStreamId stream_id, 685 int SpdySession::WriteStreamData(SpdyStreamId stream_id,
662 net::IOBuffer* data, int len, 686 net::IOBuffer* data, int len,
663 SpdyDataFlags flags) { 687 SpdyDataFlags flags) {
664 // Find our stream 688 // Find our stream
665 CHECK(IsStreamActive(stream_id)); 689 CHECK(IsStreamActive(stream_id));
666 scoped_refptr<SpdyStream> stream = active_streams_[stream_id]; 690 scoped_refptr<SpdyStream> stream = active_streams_[stream_id];
667 CHECK_EQ(stream->stream_id(), stream_id); 691 CHECK_EQ(stream->stream_id(), stream_id);
668 692
669 if (len > kMaxSpdyFrameChunkSize) { 693 if (len > kMaxSpdyFrameChunkSize) {
670 len = kMaxSpdyFrameChunkSize; 694 len = kMaxSpdyFrameChunkSize;
(...skipping 1241 matching lines...) Expand 10 before | Expand all | Expand 10 after
1912 SSLClientSocket* SpdySession::GetSSLClientSocket() const { 1936 SSLClientSocket* SpdySession::GetSSLClientSocket() const {
1913 if (!is_secure_) 1937 if (!is_secure_)
1914 return NULL; 1938 return NULL;
1915 SSLClientSocket* ssl_socket = 1939 SSLClientSocket* ssl_socket =
1916 reinterpret_cast<SSLClientSocket*>(connection_->socket()); 1940 reinterpret_cast<SSLClientSocket*>(connection_->socket());
1917 DCHECK(ssl_socket); 1941 DCHECK(ssl_socket);
1918 return ssl_socket; 1942 return ssl_socket;
1919 } 1943 }
1920 1944
1921 } // namespace net 1945 } // namespace net
OLDNEW
« no previous file with comments | « net/spdy/spdy_session.h ('k') | net/spdy/spdy_stream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698