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

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

Issue 3013048: Convert src/net to use std::string/char* for DictionaryValue keys. (Closed)
Patch Set: fix for windows Created 10 years, 4 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/proxy/proxy_resolver_js_bindings.cc ('k') | net/url_request/url_request_netlog_params.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) 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"
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 NetLogSpdySynParameter(const linked_ptr<spdy::SpdyHeaderBlock>& headers, 79 NetLogSpdySynParameter(const linked_ptr<spdy::SpdyHeaderBlock>& headers,
80 spdy::SpdyControlFlags flags, 80 spdy::SpdyControlFlags flags,
81 spdy::SpdyStreamId id) 81 spdy::SpdyStreamId id)
82 : headers_(headers), flags_(flags), id_(id) {} 82 : headers_(headers), flags_(flags), id_(id) {}
83 83
84 Value* ToValue() const { 84 Value* ToValue() const {
85 DictionaryValue* dict = new DictionaryValue(); 85 DictionaryValue* dict = new DictionaryValue();
86 DictionaryValue* headers_dict = new DictionaryValue(); 86 DictionaryValue* headers_dict = new DictionaryValue();
87 for (spdy::SpdyHeaderBlock::const_iterator it = headers_->begin(); 87 for (spdy::SpdyHeaderBlock::const_iterator it = headers_->begin();
88 it != headers_->end(); ++it) { 88 it != headers_->end(); ++it) {
89 headers_dict->SetString(ASCIIToWide(it->first), it->second); 89 headers_dict->SetString(it->first, it->second);
90 } 90 }
91 dict->SetInteger(L"flags", flags_); 91 dict->SetInteger("flags", flags_);
92 dict->Set(L"headers", headers_dict); 92 dict->Set("headers", headers_dict);
93 dict->SetInteger(L"id", id_); 93 dict->SetInteger("id", id_);
94 return dict; 94 return dict;
95 } 95 }
96 96
97 private: 97 private:
98 ~NetLogSpdySynParameter() {} 98 ~NetLogSpdySynParameter() {}
99 99
100 const linked_ptr<spdy::SpdyHeaderBlock> headers_; 100 const linked_ptr<spdy::SpdyHeaderBlock> headers_;
101 spdy::SpdyControlFlags flags_; 101 spdy::SpdyControlFlags flags_;
102 spdy::SpdyStreamId id_; 102 spdy::SpdyStreamId id_;
103 103
104 DISALLOW_COPY_AND_ASSIGN(NetLogSpdySynParameter); 104 DISALLOW_COPY_AND_ASSIGN(NetLogSpdySynParameter);
105 }; 105 };
106 106
107 class NetLogSpdySettingsParameter : public NetLog::EventParameters { 107 class NetLogSpdySettingsParameter : public NetLog::EventParameters {
108 public: 108 public:
109 explicit NetLogSpdySettingsParameter(const spdy::SpdySettings& settings) 109 explicit NetLogSpdySettingsParameter(const spdy::SpdySettings& settings)
110 : settings_(settings) {} 110 : settings_(settings) {}
111 111
112 Value* ToValue() const { 112 Value* ToValue() const {
113 DictionaryValue* dict = new DictionaryValue(); 113 DictionaryValue* dict = new DictionaryValue();
114 ListValue* settings = new ListValue(); 114 ListValue* settings = new ListValue();
115 for (spdy::SpdySettings::const_iterator it = settings_.begin(); 115 for (spdy::SpdySettings::const_iterator it = settings_.begin();
116 it != settings_.end(); ++it) { 116 it != settings_.end(); ++it) {
117 settings->Append(new StringValue( 117 settings->Append(new StringValue(
118 StringPrintf("[%u:%u]", it->first.id(), it->second))); 118 StringPrintf("[%u:%u]", it->first.id(), it->second)));
119 } 119 }
120 dict->Set(L"settings", settings); 120 dict->Set("settings", settings);
121 return dict; 121 return dict;
122 } 122 }
123 123
124 private: 124 private:
125 ~NetLogSpdySettingsParameter() {} 125 ~NetLogSpdySettingsParameter() {}
126 126
127 const spdy::SpdySettings settings_; 127 const spdy::SpdySettings settings_;
128 128
129 DISALLOW_COPY_AND_ASSIGN(NetLogSpdySettingsParameter); 129 DISALLOW_COPY_AND_ASSIGN(NetLogSpdySettingsParameter);
130 }; 130 };
(...skipping 1198 matching lines...) Expand 10 before | Expand all | Expand 10 after
1329 UMA_HISTOGRAM_CUSTOM_COUNTS("Net.SpdySettingsRetransRate", 1329 UMA_HISTOGRAM_CUSTOM_COUNTS("Net.SpdySettingsRetransRate",
1330 setting.second, 1330 setting.second,
1331 1, 100, 50); 1331 1, 100, 50);
1332 break; 1332 break;
1333 } 1333 }
1334 } 1334 }
1335 } 1335 }
1336 } 1336 }
1337 1337
1338 } // namespace net 1338 } // namespace net
OLDNEW
« no previous file with comments | « net/proxy/proxy_resolver_js_bindings.cc ('k') | net/url_request/url_request_netlog_params.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698