OLD | NEW |
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 <algorithm> | 7 #include <algorithm> |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/bind.h" | 11 #include "base/bind.h" |
12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
13 #include "base/logging.h" | 13 #include "base/logging.h" |
14 #include "base/message_loop/message_loop.h" | 14 #include "base/message_loop/message_loop.h" |
15 #include "base/metrics/field_trial.h" | 15 #include "base/metrics/field_trial.h" |
16 #include "base/metrics/histogram.h" | 16 #include "base/metrics/histogram.h" |
17 #include "base/metrics/sparse_histogram.h" | 17 #include "base/metrics/sparse_histogram.h" |
18 #include "base/metrics/stats_counters.h" | 18 #include "base/metrics/stats_counters.h" |
19 #include "base/profiler/scoped_profile.h" | 19 #include "base/profiler/scoped_tracker.h" |
20 #include "base/stl_util.h" | 20 #include "base/stl_util.h" |
21 #include "base/strings/string_number_conversions.h" | 21 #include "base/strings/string_number_conversions.h" |
22 #include "base/strings/string_util.h" | 22 #include "base/strings/string_util.h" |
23 #include "base/strings/stringprintf.h" | 23 #include "base/strings/stringprintf.h" |
24 #include "base/strings/utf_string_conversions.h" | 24 #include "base/strings/utf_string_conversions.h" |
25 #include "base/time/time.h" | 25 #include "base/time/time.h" |
26 #include "base/values.h" | 26 #include "base/values.h" |
27 #include "crypto/ec_private_key.h" | 27 #include "crypto/ec_private_key.h" |
28 #include "crypto/ec_signature_creator.h" | 28 #include "crypto/ec_signature_creator.h" |
29 #include "net/base/connection_type_histograms.h" | 29 #include "net/base/connection_type_histograms.h" |
(...skipping 1300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1330 | 1330 |
1331 DCHECK(buffered_spdy_framer_.get()); | 1331 DCHECK(buffered_spdy_framer_.get()); |
1332 scoped_ptr<SpdyFrame> rst_frame( | 1332 scoped_ptr<SpdyFrame> rst_frame( |
1333 buffered_spdy_framer_->CreateRstStream(stream_id, status)); | 1333 buffered_spdy_framer_->CreateRstStream(stream_id, status)); |
1334 | 1334 |
1335 EnqueueSessionWrite(priority, RST_STREAM, rst_frame.Pass()); | 1335 EnqueueSessionWrite(priority, RST_STREAM, rst_frame.Pass()); |
1336 RecordProtocolErrorHistogram(MapRstStreamStatusToProtocolError(status)); | 1336 RecordProtocolErrorHistogram(MapRstStreamStatusToProtocolError(status)); |
1337 } | 1337 } |
1338 | 1338 |
1339 void SpdySession::PumpReadLoop(ReadState expected_read_state, int result) { | 1339 void SpdySession::PumpReadLoop(ReadState expected_read_state, int result) { |
1340 // TODO(vadimt): Remove ScopedProfile below once crbug.com/418183 is fixed. | 1340 // TODO(vadimt): Remove ScopedTracker below once crbug.com/418183 is fixed. |
1341 tracked_objects::ScopedProfile tracking_profile( | 1341 tracked_objects::ScopedTracker tracking_profile( |
1342 FROM_HERE_WITH_EXPLICIT_FUNCTION( | 1342 FROM_HERE_WITH_EXPLICIT_FUNCTION( |
1343 "418183 DoReadCallback => SpdySession::PumpReadLoop")); | 1343 "418183 DoReadCallback => SpdySession::PumpReadLoop")); |
1344 | 1344 |
1345 CHECK(!in_io_loop_); | 1345 CHECK(!in_io_loop_); |
1346 if (availability_state_ == STATE_DRAINING) { | 1346 if (availability_state_ == STATE_DRAINING) { |
1347 return; | 1347 return; |
1348 } | 1348 } |
1349 ignore_result(DoReadLoop(expected_read_state, result)); | 1349 ignore_result(DoReadLoop(expected_read_state, result)); |
1350 } | 1350 } |
1351 | 1351 |
(...skipping 1906 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3258 if (!queue->empty()) { | 3258 if (!queue->empty()) { |
3259 SpdyStreamId stream_id = queue->front(); | 3259 SpdyStreamId stream_id = queue->front(); |
3260 queue->pop_front(); | 3260 queue->pop_front(); |
3261 return stream_id; | 3261 return stream_id; |
3262 } | 3262 } |
3263 } | 3263 } |
3264 return 0; | 3264 return 0; |
3265 } | 3265 } |
3266 | 3266 |
3267 } // namespace net | 3267 } // namespace net |
OLD | NEW |