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

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

Issue 10773: Fixed two simple compilations that stopped browser/net/referrer.cc from compi... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 12 years, 1 month 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
« no previous file with comments | « chrome/browser/net/referrer.h ('k') | no next file » | 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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 "base/logging.h" 7 #include "base/logging.h"
8 8
9 namespace chrome_browser_net { 9 namespace chrome_browser_net {
10 10
11 void Referrer::SuggestHost(const std::string& host) { 11 void Referrer::SuggestHost(const std::string& host) {
12 // Limit how large our list can get, in case we start make mistakes about
13 // what hostnames are in sub-resources (example: Some advertisments have
14 // a link to the ad agency, and then provide a "surprising" redirect to
15 // the advertised entity, which appears to be a subresource on the page
16 // hosting the ad).
17 static const size_t kMaxSuggestions = 8;
18
12 if (host.empty()) 19 if (host.empty())
13 return; 20 return;
14 if (kMaxSuggestions <= size()) { 21 if (kMaxSuggestions <= size()) {
15 DeleteLeastUseful(); 22 DeleteLeastUseful();
16 DCHECK(kMaxSuggestions > size()); 23 DCHECK(kMaxSuggestions > size());
17 } 24 }
18 // Add in the new suggestion. 25 // Add in the new suggestion.
19 (*this)[host]; 26 (*this)[host];
20 } 27 }
21 28
(...skipping 30 matching lines...) Expand all
52 erase(least_useful_name); 59 erase(least_useful_name);
53 } 60 }
54 61
55 void Referrer::AccrueValue(const base::TimeDelta& delta, 62 void Referrer::AccrueValue(const base::TimeDelta& delta,
56 const std::string host) { 63 const std::string host) {
57 DCHECK(this->find(host) != this->end()); 64 DCHECK(this->find(host) != this->end());
58 (*this)[host].AccrueValue(delta); 65 (*this)[host].AccrueValue(delta);
59 } 66 }
60 67
61 } // namespace chrome_browser_net 68 } // namespace chrome_browser_net
OLDNEW
« no previous file with comments | « chrome/browser/net/referrer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698