OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/linked_ptr.h" | 8 #include "base/linked_ptr.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
11 #include "base/rand_util.h" | 11 #include "base/rand_util.h" |
12 #include "base/stats_counters.h" | 12 #include "base/stats_counters.h" |
13 #include "base/stl_util-inl.h" | 13 #include "base/stl_util-inl.h" |
| 14 #include "base/string_number_conversions.h" |
14 #include "base/string_util.h" | 15 #include "base/string_util.h" |
15 #include "base/time.h" | 16 #include "base/time.h" |
16 #include "base/values.h" | 17 #include "base/values.h" |
17 #include "net/base/connection_type_histograms.h" | 18 #include "net/base/connection_type_histograms.h" |
18 #include "net/base/load_flags.h" | 19 #include "net/base/load_flags.h" |
19 #include "net/base/net_log.h" | 20 #include "net/base/net_log.h" |
20 #include "net/base/net_util.h" | 21 #include "net/base/net_util.h" |
21 #include "net/http/http_network_session.h" | 22 #include "net/http/http_network_session.h" |
22 #include "net/socket/client_socket.h" | 23 #include "net/socket/client_socket.h" |
23 #include "net/socket/client_socket_factory.h" | 24 #include "net/socket/client_socket_factory.h" |
(...skipping 582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
606 DCHECK(write_pending_); | 607 DCHECK(write_pending_); |
607 DCHECK(in_flight_write_.size()); | 608 DCHECK(in_flight_write_.size()); |
608 DCHECK_NE(result, 0); // This shouldn't happen for write. | 609 DCHECK_NE(result, 0); // This shouldn't happen for write. |
609 | 610 |
610 write_pending_ = false; | 611 write_pending_ = false; |
611 | 612 |
612 scoped_refptr<SpdyStream> stream = in_flight_write_.stream(); | 613 scoped_refptr<SpdyStream> stream = in_flight_write_.stream(); |
613 | 614 |
614 LOG(INFO) << "Spdy write complete (result=" << result << ")" | 615 LOG(INFO) << "Spdy write complete (result=" << result << ")" |
615 << (stream ? std::string(" for stream ") + | 616 << (stream ? std::string(" for stream ") + |
616 IntToString(stream->stream_id()) : ""); | 617 base::IntToString(stream->stream_id()) : ""); |
617 | 618 |
618 if (result >= 0) { | 619 if (result >= 0) { |
619 // It should not be possible to have written more bytes than our | 620 // It should not be possible to have written more bytes than our |
620 // in_flight_write_. | 621 // in_flight_write_. |
621 DCHECK_LE(result, in_flight_write_.buffer()->BytesRemaining()); | 622 DCHECK_LE(result, in_flight_write_.buffer()->BytesRemaining()); |
622 | 623 |
623 in_flight_write_.buffer()->DidConsume(result); | 624 in_flight_write_.buffer()->DidConsume(result); |
624 | 625 |
625 // We only notify the stream when we've fully written the pending frame. | 626 // We only notify the stream when we've fully written the pending frame. |
626 if (!in_flight_write_.buffer()->BytesRemaining()) { | 627 if (!in_flight_write_.buffer()->BytesRemaining()) { |
(...skipping 701 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1328 UMA_HISTOGRAM_CUSTOM_COUNTS("Net.SpdySettingsRetransRate", | 1329 UMA_HISTOGRAM_CUSTOM_COUNTS("Net.SpdySettingsRetransRate", |
1329 setting.second, | 1330 setting.second, |
1330 1, 100, 50); | 1331 1, 100, 50); |
1331 break; | 1332 break; |
1332 } | 1333 } |
1333 } | 1334 } |
1334 } | 1335 } |
1335 } | 1336 } |
1336 | 1337 |
1337 } // namespace net | 1338 } // namespace net |
OLD | NEW |