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

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

Issue 1550843002: Convert enable_bidirectional_stream into build flag local to net. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
« net/http/bidirectional_stream.h ('K') | « net/net_common.gypi ('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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/bidirectional_stream_spdy_job.h" 5 #include "net/spdy/bidirectional_stream_spdy_job.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/location.h" 8 #include "base/location.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/time/time.h" 10 #include "base/time/time.h"
11 #include "base/timer/timer.h" 11 #include "base/timer/timer.h"
12 #include "net/http/bidirectional_stream_request_info.h" 12 #include "net/http/bidirectional_stream_request_info.h"
13 #include "net/spdy/spdy_buffer.h" 13 #include "net/spdy/spdy_buffer.h"
14 #include "net/spdy/spdy_header_block.h" 14 #include "net/spdy/spdy_header_block.h"
15 #include "net/spdy/spdy_http_utils.h" 15 #include "net/spdy/spdy_http_utils.h"
16 #include "net/spdy/spdy_stream.h" 16 #include "net/spdy/spdy_stream.h"
17 17
18 namespace net { 18 namespace net {
19 19
20 namespace { 20 namespace {
21 21
22 // Time to wait in millisecond to notify |delegate_| of data received. 22 // Time to wait in millisecond to notify |delegate_| of data received.
23 // Handing small chunks of data to the caller creates measurable overhead. 23 // Handing small chunks of data to the caller creates measurable overhead.
24 // So buffer data in short time-spans and send a single read notification. 24 // So buffer data in short time-spans and send a single read notification.
25 const int64 kBufferTimeMs = 1; 25 const int kBufferTimeMs = 1;
26 26
27 } // namespace 27 } // namespace
28 28
29 BidirectionalStreamSpdyJob::BidirectionalStreamSpdyJob( 29 BidirectionalStreamSpdyJob::BidirectionalStreamSpdyJob(
30 const base::WeakPtr<SpdySession>& spdy_session) 30 const base::WeakPtr<SpdySession>& spdy_session)
31 : spdy_session_(spdy_session), 31 : spdy_session_(spdy_session),
32 request_info_(nullptr), 32 request_info_(nullptr),
33 delegate_(nullptr), 33 delegate_(nullptr),
34 negotiated_protocol_(kProtoUnknown), 34 negotiated_protocol_(kProtoUnknown),
35 more_read_data_pending_(false), 35 more_read_data_pending_(false),
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 271
272 bool BidirectionalStreamSpdyJob::ShouldWaitForMoreBufferedData() const { 272 bool BidirectionalStreamSpdyJob::ShouldWaitForMoreBufferedData() const {
273 if (stream_closed_) 273 if (stream_closed_)
274 return false; 274 return false;
275 DCHECK_GT(read_buffer_len_, 0); 275 DCHECK_GT(read_buffer_len_, 0);
276 return read_data_queue_.GetTotalSize() < 276 return read_data_queue_.GetTotalSize() <
277 static_cast<size_t>(read_buffer_len_); 277 static_cast<size_t>(read_buffer_len_);
278 } 278 }
279 279
280 } // namespace net 280 } // namespace net
OLDNEW
« net/http/bidirectional_stream.h ('K') | « net/net_common.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698