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_stream.h" | 5 #include "net/spdy/spdy_stream.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| 11 #include "base/profiler/scoped_tracker.h" |
11 #include "base/strings/string_number_conversions.h" | 12 #include "base/strings/string_number_conversions.h" |
12 #include "base/strings/stringprintf.h" | 13 #include "base/strings/stringprintf.h" |
13 #include "base/values.h" | 14 #include "base/values.h" |
14 #include "net/spdy/spdy_buffer_producer.h" | 15 #include "net/spdy/spdy_buffer_producer.h" |
15 #include "net/spdy/spdy_http_utils.h" | 16 #include "net/spdy/spdy_http_utils.h" |
16 #include "net/spdy/spdy_session.h" | 17 #include "net/spdy/spdy_session.h" |
17 | 18 |
18 namespace net { | 19 namespace net { |
19 | 20 |
20 namespace { | 21 namespace { |
(...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
521 metrics_.RecordBytes(length); | 522 metrics_.RecordBytes(length); |
522 recv_bytes_ += length; | 523 recv_bytes_ += length; |
523 recv_last_byte_time_ = base::TimeTicks::Now(); | 524 recv_last_byte_time_ = base::TimeTicks::Now(); |
524 | 525 |
525 // May close |this|. | 526 // May close |this|. |
526 delegate_->OnDataReceived(buffer.Pass()); | 527 delegate_->OnDataReceived(buffer.Pass()); |
527 } | 528 } |
528 | 529 |
529 void SpdyStream::OnFrameWriteComplete(SpdyFrameType frame_type, | 530 void SpdyStream::OnFrameWriteComplete(SpdyFrameType frame_type, |
530 size_t frame_size) { | 531 size_t frame_size) { |
| 532 // TODO(pkasting): Remove ScopedTracker below once crbug.com/457517 is fixed. |
| 533 tracked_objects::ScopedTracker tracking_profile( |
| 534 FROM_HERE_WITH_EXPLICIT_FUNCTION( |
| 535 "457517 SpdyStream::OnFrameWriteComplete")); |
531 DCHECK_NE(type_, SPDY_PUSH_STREAM); | 536 DCHECK_NE(type_, SPDY_PUSH_STREAM); |
532 | 537 |
533 if (frame_size < session_->GetFrameMinimumSize() || | 538 if (frame_size < session_->GetFrameMinimumSize() || |
534 frame_size > session_->GetFrameMaximumSize()) { | 539 frame_size > session_->GetFrameMaximumSize()) { |
535 NOTREACHED(); | 540 NOTREACHED(); |
536 return; | 541 return; |
537 } | 542 } |
538 CHECK(frame_type == SYN_STREAM || | 543 CHECK(frame_type == SYN_STREAM || |
539 frame_type == DATA) << frame_type; | 544 frame_type == DATA) << frame_type; |
540 | 545 |
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
913 description = base::StringPrintf("Unknown state 0x%08X (%u)", state, | 918 description = base::StringPrintf("Unknown state 0x%08X (%u)", state, |
914 state); | 919 state); |
915 break; | 920 break; |
916 } | 921 } |
917 return description; | 922 return description; |
918 } | 923 } |
919 | 924 |
920 #undef STATE_CASE | 925 #undef STATE_CASE |
921 | 926 |
922 } // namespace net | 927 } // namespace net |
OLD | NEW |