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/stl_util.h" | 20 #include "base/stl_util.h" |
20 #include "base/strings/string_number_conversions.h" | 21 #include "base/strings/string_number_conversions.h" |
21 #include "base/strings/string_util.h" | 22 #include "base/strings/string_util.h" |
22 #include "base/strings/stringprintf.h" | 23 #include "base/strings/stringprintf.h" |
23 #include "base/strings/utf_string_conversions.h" | 24 #include "base/strings/utf_string_conversions.h" |
24 #include "base/time/time.h" | 25 #include "base/time/time.h" |
25 #include "base/values.h" | 26 #include "base/values.h" |
26 #include "crypto/ec_private_key.h" | 27 #include "crypto/ec_private_key.h" |
27 #include "crypto/ec_signature_creator.h" | 28 #include "crypto/ec_signature_creator.h" |
28 #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... |
1329 | 1330 |
1330 DCHECK(buffered_spdy_framer_.get()); | 1331 DCHECK(buffered_spdy_framer_.get()); |
1331 scoped_ptr<SpdyFrame> rst_frame( | 1332 scoped_ptr<SpdyFrame> rst_frame( |
1332 buffered_spdy_framer_->CreateRstStream(stream_id, status)); | 1333 buffered_spdy_framer_->CreateRstStream(stream_id, status)); |
1333 | 1334 |
1334 EnqueueSessionWrite(priority, RST_STREAM, rst_frame.Pass()); | 1335 EnqueueSessionWrite(priority, RST_STREAM, rst_frame.Pass()); |
1335 RecordProtocolErrorHistogram(MapRstStreamStatusToProtocolError(status)); | 1336 RecordProtocolErrorHistogram(MapRstStreamStatusToProtocolError(status)); |
1336 } | 1337 } |
1337 | 1338 |
1338 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. |
| 1341 tracked_objects::ScopedProfile tracking_profile( |
| 1342 FROM_HERE_WITH_EXPLICIT_FUNCTION( |
| 1343 "418183 DoReadCallback => SpdySession::PumpReadLoop")); |
| 1344 |
1339 CHECK(!in_io_loop_); | 1345 CHECK(!in_io_loop_); |
1340 if (availability_state_ == STATE_DRAINING) { | 1346 if (availability_state_ == STATE_DRAINING) { |
1341 return; | 1347 return; |
1342 } | 1348 } |
1343 ignore_result(DoReadLoop(expected_read_state, result)); | 1349 ignore_result(DoReadLoop(expected_read_state, result)); |
1344 } | 1350 } |
1345 | 1351 |
1346 int SpdySession::DoReadLoop(ReadState expected_read_state, int result) { | 1352 int SpdySession::DoReadLoop(ReadState expected_read_state, int result) { |
1347 CHECK(!in_io_loop_); | 1353 CHECK(!in_io_loop_); |
1348 CHECK_EQ(read_state_, expected_read_state); | 1354 CHECK_EQ(read_state_, expected_read_state); |
(...skipping 1903 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3252 if (!queue->empty()) { | 3258 if (!queue->empty()) { |
3253 SpdyStreamId stream_id = queue->front(); | 3259 SpdyStreamId stream_id = queue->front(); |
3254 queue->pop_front(); | 3260 queue->pop_front(); |
3255 return stream_id; | 3261 return stream_id; |
3256 } | 3262 } |
3257 } | 3263 } |
3258 return 0; | 3264 return 0; |
3259 } | 3265 } |
3260 | 3266 |
3261 } // namespace net | 3267 } // namespace net |
OLD | NEW |