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

Side by Side Diff: chrome/browser/net/referrer.cc

Issue 7649006: more changes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix another typo Created 9 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "chrome/browser/net/referrer.h" 5 #include "chrome/browser/net/referrer.h"
6 6
7 #include <limits.h> 7 #include <limits.h>
8 8
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 // level, so for now, we just suggest subresources, which leaves them all 140 // level, so for now, we just suggest subresources, which leaves them all
141 // with the same birth date (typically start of process). 141 // with the same birth date (typically start of process).
142 SuggestHost(url); 142 SuggestHost(url);
143 (*this)[url].SetSubresourceUseRate(rate); 143 (*this)[url].SetSubresourceUseRate(rate);
144 } 144 }
145 } 145 }
146 146
147 Value* Referrer::Serialize() const { 147 Value* Referrer::Serialize() const {
148 base::ListValue* subresource_list(new base::ListValue); 148 base::ListValue* subresource_list(new base::ListValue);
149 for (const_iterator it = begin(); it != end(); ++it) { 149 for (const_iterator it = begin(); it != end(); ++it) {
150 base::StringValue* url_spec(new base::StringValue(it->first.spec())); 150 base::StringValue* url_spec(base::StringValue::New(it->first.spec()));
151 base::FundamentalValue* rate(new base::FundamentalValue( 151 base::NumberValue* rate(base::NumberValue::New(
152 it->second.subresource_use_rate())); 152 it->second.subresource_use_rate()));
153 153
154 subresource_list->Append(url_spec); 154 subresource_list->Append(url_spec);
155 subresource_list->Append(rate); 155 subresource_list->Append(rate);
156 } 156 }
157 return subresource_list; 157 return subresource_list;
158 } 158 }
159 159
160 //------------------------------------------------------------------------------ 160 //------------------------------------------------------------------------------
161 161
(...skipping 14 matching lines...) Expand all
176 176
177 void ReferrerValue::ReferrerWasObserved() { 177 void ReferrerValue::ReferrerWasObserved() {
178 subresource_use_rate_ *= kWeightingForOldConnectsExpectedValue; 178 subresource_use_rate_ *= kWeightingForOldConnectsExpectedValue;
179 // Note: the use rate is temporarilly possibly incorect, as we need to find 179 // Note: the use rate is temporarilly possibly incorect, as we need to find
180 // out if we really end up connecting. This will happen in a few hundred 180 // out if we really end up connecting. This will happen in a few hundred
181 // milliseconds (when content arrives, etc.). 181 // milliseconds (when content arrives, etc.).
182 // Value of subresource_use_rate_ should be sampled before this call. 182 // Value of subresource_use_rate_ should be sampled before this call.
183 } 183 }
184 184
185 } // namespace chrome_browser_net 185 } // namespace chrome_browser_net
OLDNEW
« no previous file with comments | « chrome/browser/net/predictor_unittest.cc ('k') | chrome/browser/net/ssl_config_service_manager_pref_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698