| 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 <limits> | 7 #include <limits> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| 11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 #include "base/location.h" | 12 #include "base/location.h" |
| 13 #include "base/logging.h" | 13 #include "base/logging.h" |
| 14 #include "base/metrics/histogram_macros.h" | 14 #include "base/metrics/histogram_macros.h" |
| 15 #include "base/single_thread_task_runner.h" | 15 #include "base/single_thread_task_runner.h" |
| 16 #include "base/strings/string_number_conversions.h" | 16 #include "base/strings/string_number_conversions.h" |
| 17 #include "base/strings/string_util.h" |
| 17 #include "base/strings/stringprintf.h" | 18 #include "base/strings/stringprintf.h" |
| 18 #include "base/thread_task_runner_handle.h" | 19 #include "base/thread_task_runner_handle.h" |
| 19 #include "base/values.h" | 20 #include "base/values.h" |
| 20 #include "net/spdy/spdy_buffer_producer.h" | 21 #include "net/spdy/spdy_buffer_producer.h" |
| 21 #include "net/spdy/spdy_http_utils.h" | 22 #include "net/spdy/spdy_http_utils.h" |
| 22 #include "net/spdy/spdy_session.h" | 23 #include "net/spdy/spdy_session.h" |
| 23 | 24 |
| 24 namespace net { | 25 namespace net { |
| 25 | 26 |
| 26 namespace { | 27 namespace { |
| (...skipping 16 matching lines...) Expand all Loading... |
| 43 int32_t window_size, | 44 int32_t window_size, |
| 44 NetLogCaptureMode /* capture_mode */) { | 45 NetLogCaptureMode /* capture_mode */) { |
| 45 scoped_ptr<base::DictionaryValue> dict(new base::DictionaryValue()); | 46 scoped_ptr<base::DictionaryValue> dict(new base::DictionaryValue()); |
| 46 dict->SetInteger("stream_id", stream_id); | 47 dict->SetInteger("stream_id", stream_id); |
| 47 dict->SetInteger("delta", delta); | 48 dict->SetInteger("delta", delta); |
| 48 dict->SetInteger("window_size", window_size); | 49 dict->SetInteger("window_size", window_size); |
| 49 return std::move(dict); | 50 return std::move(dict); |
| 50 } | 51 } |
| 51 | 52 |
| 52 bool ContainsUppercaseAscii(const std::string& str) { | 53 bool ContainsUppercaseAscii(const std::string& str) { |
| 53 for (std::string::const_iterator i(str.begin()); i != str.end(); ++i) { | 54 return std::any_of(str.begin(), str.end(), base::IsAsciiUpper<char>); |
| 54 if (*i >= 'A' && *i <= 'Z') { | |
| 55 return true; | |
| 56 } | |
| 57 } | |
| 58 return false; | |
| 59 } | 55 } |
| 60 | 56 |
| 61 } // namespace | 57 } // namespace |
| 62 | 58 |
| 63 void SpdyStream::Delegate::OnTrailers(const SpdyHeaderBlock& trailers) {} | 59 void SpdyStream::Delegate::OnTrailers(const SpdyHeaderBlock& trailers) {} |
| 64 | 60 |
| 65 // A wrapper around a stream that calls into ProduceSynStreamFrame(). | 61 // A wrapper around a stream that calls into ProduceSynStreamFrame(). |
| 66 class SpdyStream::SynStreamBufferProducer : public SpdyBufferProducer { | 62 class SpdyStream::SynStreamBufferProducer : public SpdyBufferProducer { |
| 67 public: | 63 public: |
| 68 SynStreamBufferProducer(const base::WeakPtr<SpdyStream>& stream) | 64 SynStreamBufferProducer(const base::WeakPtr<SpdyStream>& stream) |
| (...skipping 875 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 944 description = base::StringPrintf("Unknown state 0x%08X (%u)", state, | 940 description = base::StringPrintf("Unknown state 0x%08X (%u)", state, |
| 945 state); | 941 state); |
| 946 break; | 942 break; |
| 947 } | 943 } |
| 948 return description; | 944 return description; |
| 949 } | 945 } |
| 950 | 946 |
| 951 #undef STATE_CASE | 947 #undef STATE_CASE |
| 952 | 948 |
| 953 } // namespace net | 949 } // namespace net |
| OLD | NEW |