OLD | NEW |
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_impl.h" | 5 #include "net/spdy/chromium/bidirectional_stream_spdy_impl.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "base/threading/thread_task_runner_handle.h" | 12 #include "base/threading/thread_task_runner_handle.h" |
13 #include "base/time/time.h" | 13 #include "base/time/time.h" |
14 #include "base/timer/timer.h" | 14 #include "base/timer/timer.h" |
15 #include "net/http/bidirectional_stream_request_info.h" | 15 #include "net/http/bidirectional_stream_request_info.h" |
16 #include "net/spdy/spdy_buffer.h" | 16 #include "net/spdy/chromium/spdy_buffer.h" |
17 #include "net/spdy/spdy_header_block.h" | 17 #include "net/spdy/chromium/spdy_http_utils.h" |
18 #include "net/spdy/spdy_http_utils.h" | 18 #include "net/spdy/chromium/spdy_stream.h" |
19 #include "net/spdy/spdy_stream.h" | 19 #include "net/spdy/core/spdy_header_block.h" |
20 | 20 |
21 namespace net { | 21 namespace net { |
22 | 22 |
23 namespace { | 23 namespace { |
24 | 24 |
25 // Time to wait in millisecond to notify |delegate_| of data received. | 25 // Time to wait in millisecond to notify |delegate_| of data received. |
26 // Handing small chunks of data to the caller creates measurable overhead. | 26 // Handing small chunks of data to the caller creates measurable overhead. |
27 // So buffer data in short time-spans and send a single read notification. | 27 // So buffer data in short time-spans and send a single read notification. |
28 const int kBufferTimeMs = 1; | 28 const int kBufferTimeMs = 1; |
29 | 29 |
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
415 return true; | 415 return true; |
416 } | 416 } |
417 LOG(ERROR) << "Trying to send data after stream has been destroyed."; | 417 LOG(ERROR) << "Trying to send data after stream has been destroyed."; |
418 base::ThreadTaskRunnerHandle::Get()->PostTask( | 418 base::ThreadTaskRunnerHandle::Get()->PostTask( |
419 FROM_HERE, base::Bind(&BidirectionalStreamSpdyImpl::NotifyError, | 419 FROM_HERE, base::Bind(&BidirectionalStreamSpdyImpl::NotifyError, |
420 weak_factory_.GetWeakPtr(), ERR_UNEXPECTED)); | 420 weak_factory_.GetWeakPtr(), ERR_UNEXPECTED)); |
421 return true; | 421 return true; |
422 } | 422 } |
423 | 423 |
424 } // namespace net | 424 } // namespace net |
OLD | NEW |