| 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 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| 11 #include "base/logging.h" | 11 #include "base/logging.h" |
| 12 #include "base/message_loop.h" | 12 #include "base/message_loop.h" |
| 13 #include "base/strings/stringprintf.h" | 13 #include "base/strings/stringprintf.h" |
| 14 #include "base/strings/string_number_conversions.h" | 14 #include "base/strings/string_number_conversions.h" |
| 15 #include "base/values.h" | 15 #include "base/values.h" |
| 16 #include "net/spdy/spdy_buffer_producer.h" | 16 #include "net/spdy/spdy_buffer_producer.h" |
| 17 #include "net/spdy/spdy_http_utils.h" | 17 #include "net/spdy/spdy_http_utils.h" |
| 18 #include "net/spdy/spdy_session.h" | 18 #include "net/spdy/spdy_session.h" |
| 19 | 19 |
| 20 namespace net { | 20 namespace net { |
| 21 | 21 |
| 22 namespace { | 22 namespace { |
| 23 | 23 |
| 24 Value* NetLogSpdyStreamErrorCallback(SpdyStreamId stream_id, | 24 base::Value* NetLogSpdyStreamErrorCallback(SpdyStreamId stream_id, |
| 25 int status, | 25 int status, |
| 26 const std::string* description, | 26 const std::string* description, |
| 27 NetLog::LogLevel /* log_level */) { | 27 NetLog::LogLevel /* log_level */) { |
| 28 DictionaryValue* dict = new DictionaryValue(); | 28 base::DictionaryValue* dict = new base::DictionaryValue(); |
| 29 dict->SetInteger("stream_id", static_cast<int>(stream_id)); | 29 dict->SetInteger("stream_id", static_cast<int>(stream_id)); |
| 30 dict->SetInteger("status", status); | 30 dict->SetInteger("status", status); |
| 31 dict->SetString("description", *description); | 31 dict->SetString("description", *description); |
| 32 return dict; | 32 return dict; |
| 33 } | 33 } |
| 34 | 34 |
| 35 Value* NetLogSpdyStreamWindowUpdateCallback(SpdyStreamId stream_id, | 35 base::Value* NetLogSpdyStreamWindowUpdateCallback( |
| 36 int32 delta, | 36 SpdyStreamId stream_id, |
| 37 int32 window_size, | 37 int32 delta, |
| 38 NetLog::LogLevel /* log_level */) { | 38 int32 window_size, |
| 39 DictionaryValue* dict = new DictionaryValue(); | 39 NetLog::LogLevel /* log_level */) { |
| 40 base::DictionaryValue* dict = new base::DictionaryValue(); |
| 40 dict->SetInteger("stream_id", stream_id); | 41 dict->SetInteger("stream_id", stream_id); |
| 41 dict->SetInteger("delta", delta); | 42 dict->SetInteger("delta", delta); |
| 42 dict->SetInteger("window_size", window_size); | 43 dict->SetInteger("window_size", window_size); |
| 43 return dict; | 44 return dict; |
| 44 } | 45 } |
| 45 | 46 |
| 46 bool ContainsUpperAscii(const std::string& str) { | 47 bool ContainsUpperAscii(const std::string& str) { |
| 47 for (std::string::const_iterator i(str.begin()); i != str.end(); ++i) { | 48 for (std::string::const_iterator i(str.begin()); i != str.end(); ++i) { |
| 48 if (*i >= 'A' && *i <= 'Z') { | 49 if (*i >= 'A' && *i <= 'Z') { |
| 49 return true; | 50 return true; |
| (...skipping 925 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 975 GetWeakPtr(), payload_size)); | 976 GetWeakPtr(), payload_size)); |
| 976 } | 977 } |
| 977 | 978 |
| 978 session_->EnqueueStreamWrite( | 979 session_->EnqueueStreamWrite( |
| 979 GetWeakPtr(), DATA, | 980 GetWeakPtr(), DATA, |
| 980 scoped_ptr<SpdyBufferProducer>( | 981 scoped_ptr<SpdyBufferProducer>( |
| 981 new SimpleBufferProducer(data_buffer.Pass()))); | 982 new SimpleBufferProducer(data_buffer.Pass()))); |
| 982 } | 983 } |
| 983 | 984 |
| 984 } // namespace net | 985 } // namespace net |
| OLD | NEW |