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

Side by Side Diff: net/quic/quic_http_stream.cc

Issue 125333002: Log the QUIC priority when sending requests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: cleanup Created 6 years, 11 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/base/net_log_event_type_list.h ('k') | net/quic/quic_http_utils.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/quic/quic_http_stream.h" 5 #include "net/quic/quic_http_stream.h"
6 6
7 #include "base/callback_helpers.h" 7 #include "base/callback_helpers.h"
8 #include "base/strings/stringprintf.h" 8 #include "base/strings/stringprintf.h"
9 #include "net/base/io_buffer.h" 9 #include "net/base/io_buffer.h"
10 #include "net/base/net_errors.h" 10 #include "net/base/net_errors.h"
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after
412 weak_factory_.GetWeakPtr()))) { 412 weak_factory_.GetWeakPtr()))) {
413 // Do not compress headers unless it is likely that they can be sent. 413 // Do not compress headers unless it is likely that they can be sent.
414 next_state_ = STATE_SEND_HEADERS; 414 next_state_ = STATE_SEND_HEADERS;
415 return ERR_IO_PENDING; 415 return ERR_IO_PENDING;
416 } 416 }
417 request_ = stream_->compressor()->CompressHeadersWithPriority( 417 request_ = stream_->compressor()->CompressHeadersWithPriority(
418 ConvertRequestPriorityToQuicPriority(priority_), request_headers_); 418 ConvertRequestPriorityToQuicPriority(priority_), request_headers_);
419 } 419 }
420 // Log the actual request with the URL Request's net log. 420 // Log the actual request with the URL Request's net log.
421 stream_net_log_.AddEvent( 421 stream_net_log_.AddEvent(
422 NetLog::TYPE_HTTP_TRANSACTION_SPDY_SEND_REQUEST_HEADERS, 422 NetLog::TYPE_HTTP_TRANSACTION_QUIC_SEND_REQUEST_HEADERS,
423 base::Bind(&SpdyHeaderBlockNetLogCallback, &request_headers_)); 423 base::Bind(&QuicRequestNetLogCallback, &request_headers_, priority_));
424 // Also log to the QuicSession's net log. 424 // Also log to the QuicSession's net log.
425 stream_->net_log().AddEvent( 425 stream_->net_log().AddEvent(
426 NetLog::TYPE_QUIC_HTTP_STREAM_SEND_REQUEST_HEADERS, 426 NetLog::TYPE_QUIC_HTTP_STREAM_SEND_REQUEST_HEADERS,
427 base::Bind(&SpdyHeaderBlockNetLogCallback, &request_headers_)); 427 base::Bind(&QuicRequestNetLogCallback, &request_headers_, priority_));
428 428
429 bool has_upload_data = request_body_stream_ != NULL; 429 bool has_upload_data = request_body_stream_ != NULL;
430 430
431 next_state_ = STATE_SEND_HEADERS_COMPLETE; 431 next_state_ = STATE_SEND_HEADERS_COMPLETE;
432 int rv = (stream_->version() > QUIC_VERSION_12) ? 432 int rv = (stream_->version() > QUIC_VERSION_12) ?
433 stream_->WriteHeaders(request_headers_, !has_upload_data) : 433 stream_->WriteHeaders(request_headers_, !has_upload_data) :
434 stream_->WriteStreamData(request_, !has_upload_data, 434 stream_->WriteStreamData(request_, !has_upload_data,
435 base::Bind(&QuicHttpStream::OnIOComplete, 435 base::Bind(&QuicHttpStream::OnIOComplete,
436 weak_factory_.GetWeakPtr())); 436 weak_factory_.GetWeakPtr()));
437 request_headers_.clear(); 437 request_headers_.clear();
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
550 550
551 void QuicHttpStream::BufferResponseBody(const char* data, int length) { 551 void QuicHttpStream::BufferResponseBody(const char* data, int length) {
552 if (length == 0) 552 if (length == 0)
553 return; 553 return;
554 IOBufferWithSize* io_buffer = new IOBufferWithSize(length); 554 IOBufferWithSize* io_buffer = new IOBufferWithSize(length);
555 memcpy(io_buffer->data(), data, length); 555 memcpy(io_buffer->data(), data, length);
556 response_body_.push_back(make_scoped_refptr(io_buffer)); 556 response_body_.push_back(make_scoped_refptr(io_buffer));
557 } 557 }
558 558
559 } // namespace net 559 } // namespace net
OLDNEW
« no previous file with comments | « net/base/net_log_event_type_list.h ('k') | net/quic/quic_http_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698