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

Side by Side Diff: net/quic/chromium/quic_chromium_client_stream.cc

Issue 2315613002: Extracted NetLog class's inner enum types into their own enum classes and (Closed)
Patch Set: Ran "git cl format" on code. Much formatting ensued. Created 4 years, 3 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
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/chromium/quic_chromium_client_stream.h" 5 #include "net/quic/chromium/quic_chromium_client_stream.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind_helpers.h" 9 #include "base/bind_helpers.h"
10 #include "base/callback_helpers.h" 10 #include "base/callback_helpers.h"
11 #include "base/location.h" 11 #include "base/location.h"
12 #include "base/threading/thread_task_runner_handle.h" 12 #include "base/threading/thread_task_runner_handle.h"
13 #include "net/base/io_buffer.h" 13 #include "net/base/io_buffer.h"
14 #include "net/base/net_errors.h" 14 #include "net/base/net_errors.h"
15 #include "net/log/net_log_event_type.h"
15 #include "net/quic/chromium/quic_chromium_client_session.h" 16 #include "net/quic/chromium/quic_chromium_client_session.h"
16 #include "net/quic/core/quic_http_utils.h" 17 #include "net/quic/core/quic_http_utils.h"
17 #include "net/quic/core/quic_spdy_session.h" 18 #include "net/quic/core/quic_spdy_session.h"
18 #include "net/quic/core/quic_write_blocked_list.h" 19 #include "net/quic/core/quic_write_blocked_list.h"
19 #include "net/quic/core/spdy_utils.h" 20 #include "net/quic/core/spdy_utils.h"
20 21
21 namespace net { 22 namespace net {
22 23
23 QuicChromiumClientStream::QuicChromiumClientStream( 24 QuicChromiumClientStream::QuicChromiumClientStream(
24 QuicStreamId id, 25 QuicStreamId id,
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 size_t QuicChromiumClientStream::WriteHeaders( 161 size_t QuicChromiumClientStream::WriteHeaders(
161 SpdyHeaderBlock header_block, 162 SpdyHeaderBlock header_block,
162 bool fin, 163 bool fin,
163 QuicAckListenerInterface* ack_notifier_delegate) { 164 QuicAckListenerInterface* ack_notifier_delegate) {
164 if (!session()->IsCryptoHandshakeConfirmed()) { 165 if (!session()->IsCryptoHandshakeConfirmed()) {
165 auto entry = header_block.find(":method"); 166 auto entry = header_block.find(":method");
166 DCHECK(entry != header_block.end()); 167 DCHECK(entry != header_block.end());
167 DCHECK_NE("POST", entry->second); 168 DCHECK_NE("POST", entry->second);
168 } 169 }
169 net_log_.AddEvent( 170 net_log_.AddEvent(
170 NetLog::TYPE_QUIC_CHROMIUM_CLIENT_STREAM_SEND_REQUEST_HEADERS, 171 NetLogEventType::QUIC_CHROMIUM_CLIENT_STREAM_SEND_REQUEST_HEADERS,
171 base::Bind(&QuicRequestNetLogCallback, id(), &header_block, 172 base::Bind(&QuicRequestNetLogCallback, id(), &header_block,
172 QuicSpdyStream::priority())); 173 QuicSpdyStream::priority()));
173 return QuicSpdyStream::WriteHeaders(std::move(header_block), fin, 174 return QuicSpdyStream::WriteHeaders(std::move(header_block), fin,
174 ack_notifier_delegate); 175 ack_notifier_delegate);
175 } 176 }
176 177
177 SpdyPriority QuicChromiumClientStream::priority() const { 178 SpdyPriority QuicChromiumClientStream::priority() const {
178 if (delegate_ && delegate_->HasSendHeadersComplete()) { 179 if (delegate_ && delegate_->HasSendHeadersComplete()) {
179 return QuicSpdyStream::priority(); 180 return QuicSpdyStream::priority();
180 } 181 }
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 void QuicChromiumClientStream::NotifyDelegateOfHeadersComplete( 276 void QuicChromiumClientStream::NotifyDelegateOfHeadersComplete(
276 SpdyHeaderBlock headers, 277 SpdyHeaderBlock headers,
277 size_t frame_len) { 278 size_t frame_len) {
278 if (!delegate_) 279 if (!delegate_)
279 return; 280 return;
280 // Only mark trailers consumed when we are about to notify delegate. 281 // Only mark trailers consumed when we are about to notify delegate.
281 if (headers_delivered_) { 282 if (headers_delivered_) {
282 MarkTrailersConsumed(decompressed_trailers().length()); 283 MarkTrailersConsumed(decompressed_trailers().length());
283 MarkTrailersDelivered(); 284 MarkTrailersDelivered();
284 net_log_.AddEvent( 285 net_log_.AddEvent(
285 NetLog::TYPE_QUIC_CHROMIUM_CLIENT_STREAM_READ_RESPONSE_TRAILERS, 286 NetLogEventType::QUIC_CHROMIUM_CLIENT_STREAM_READ_RESPONSE_TRAILERS,
286 base::Bind(&SpdyHeaderBlockNetLogCallback, &headers)); 287 base::Bind(&SpdyHeaderBlockNetLogCallback, &headers));
287 } else { 288 } else {
288 headers_delivered_ = true; 289 headers_delivered_ = true;
289 net_log_.AddEvent( 290 net_log_.AddEvent(
290 NetLog::TYPE_QUIC_CHROMIUM_CLIENT_STREAM_READ_RESPONSE_HEADERS, 291 NetLogEventType::QUIC_CHROMIUM_CLIENT_STREAM_READ_RESPONSE_HEADERS,
291 base::Bind(&SpdyHeaderBlockNetLogCallback, &headers)); 292 base::Bind(&SpdyHeaderBlockNetLogCallback, &headers));
292 } 293 }
293 294
294 delegate_->OnHeadersAvailable(headers, frame_len); 295 delegate_->OnHeadersAvailable(headers, frame_len);
295 } 296 }
296 297
297 void QuicChromiumClientStream::NotifyDelegateOfDataAvailableLater() { 298 void QuicChromiumClientStream::NotifyDelegateOfDataAvailableLater() {
298 RunOrBuffer( 299 RunOrBuffer(
299 base::Bind(&QuicChromiumClientStream::NotifyDelegateOfDataAvailable, 300 base::Bind(&QuicChromiumClientStream::NotifyDelegateOfDataAvailable,
300 weak_factory_.GetWeakPtr())); 301 weak_factory_.GetWeakPtr()));
(...skipping 10 matching lines...) Expand all
311 } else { 312 } else {
312 delegate_tasks_.push_back(closure); 313 delegate_tasks_.push_back(closure);
313 } 314 }
314 } 315 }
315 316
316 void QuicChromiumClientStream::DisableConnectionMigration() { 317 void QuicChromiumClientStream::DisableConnectionMigration() {
317 can_migrate_ = false; 318 can_migrate_ = false;
318 } 319 }
319 320
320 } // namespace net 321 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/chromium/quic_chromium_client_session.cc ('k') | net/quic/chromium/quic_connection_logger.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698