Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(457)

Side by Side Diff: net/spdy/spdy_stream.cc

Issue 1149763005: Change NetLog::ParametersCallback to return a scoped_ptr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comments on ownership removed Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/spdy/spdy_session.cc ('k') | net/ssl/openssl_ssl_util.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/metrics/histogram_macros.h" 11 #include "base/metrics/histogram_macros.h"
12 #include "base/strings/string_number_conversions.h" 12 #include "base/strings/string_number_conversions.h"
13 #include "base/strings/stringprintf.h" 13 #include "base/strings/stringprintf.h"
14 #include "base/values.h" 14 #include "base/values.h"
15 #include "net/spdy/spdy_buffer_producer.h" 15 #include "net/spdy/spdy_buffer_producer.h"
16 #include "net/spdy/spdy_http_utils.h" 16 #include "net/spdy/spdy_http_utils.h"
17 #include "net/spdy/spdy_session.h" 17 #include "net/spdy/spdy_session.h"
18 18
19 namespace net { 19 namespace net {
20 20
21 namespace { 21 namespace {
22 22
23 base::Value* NetLogSpdyStreamErrorCallback( 23 scoped_ptr<base::Value> NetLogSpdyStreamErrorCallback(
24 SpdyStreamId stream_id, 24 SpdyStreamId stream_id,
25 int status, 25 int status,
26 const std::string* description, 26 const std::string* description,
27 NetLogCaptureMode /* capture_mode */) { 27 NetLogCaptureMode /* capture_mode */) {
28 base::DictionaryValue* dict = new base::DictionaryValue(); 28 scoped_ptr<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.Pass();
33 } 33 }
34 34
35 base::Value* NetLogSpdyStreamWindowUpdateCallback( 35 scoped_ptr<base::Value> NetLogSpdyStreamWindowUpdateCallback(
36 SpdyStreamId stream_id, 36 SpdyStreamId stream_id,
37 int32 delta, 37 int32 delta,
38 int32 window_size, 38 int32 window_size,
39 NetLogCaptureMode /* capture_mode */) { 39 NetLogCaptureMode /* capture_mode */) {
40 base::DictionaryValue* dict = new base::DictionaryValue(); 40 scoped_ptr<base::DictionaryValue> dict(new base::DictionaryValue());
41 dict->SetInteger("stream_id", stream_id); 41 dict->SetInteger("stream_id", stream_id);
42 dict->SetInteger("delta", delta); 42 dict->SetInteger("delta", delta);
43 dict->SetInteger("window_size", window_size); 43 dict->SetInteger("window_size", window_size);
44 return dict; 44 return dict.Pass();
45 } 45 }
46 46
47 bool ContainsUppercaseAscii(const std::string& str) { 47 bool ContainsUppercaseAscii(const std::string& str) {
48 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) {
49 if (*i >= 'A' && *i <= 'Z') { 49 if (*i >= 'A' && *i <= 'Z') {
50 return true; 50 return true;
51 } 51 }
52 } 52 }
53 return false; 53 return false;
54 } 54 }
(...skipping 869 matching lines...) Expand 10 before | Expand all | Expand 10 after
924 description = base::StringPrintf("Unknown state 0x%08X (%u)", state, 924 description = base::StringPrintf("Unknown state 0x%08X (%u)", state,
925 state); 925 state);
926 break; 926 break;
927 } 927 }
928 return description; 928 return description;
929 } 929 }
930 930
931 #undef STATE_CASE 931 #undef STATE_CASE
932 932
933 } // namespace net 933 } // namespace net
OLDNEW
« no previous file with comments | « net/spdy/spdy_session.cc ('k') | net/ssl/openssl_ssl_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698