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

Side by Side Diff: content/browser/renderer_host/duplicate_content_resource_handler.cc

Issue 10831201: I added another histogram into the DuplicateContentResourceHandler. The histogram is meant to keep … (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Created 8 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
« no previous file with comments | « no previous file | 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) 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 "content/browser/renderer_host/duplicate_content_resource_handler.h" 5 #include "content/browser/renderer_host/duplicate_content_resource_handler.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 std::set<MH_UINT32>* content_and_url_matches = 110 std::set<MH_UINT32>* content_and_url_matches =
111 GlobalDuplicateRecords::GetInstance()->content_and_url_matches(); 111 GlobalDuplicateRecords::GetInstance()->content_and_url_matches();
112 112
113 const bool did_match_contents = content_matches->count(contents_hash) > 0; 113 const bool did_match_contents = content_matches->count(contents_hash) > 0;
114 const bool did_match_contents_and_url = 114 const bool did_match_contents_and_url =
115 content_and_url_matches->count(hashed_with_url) > 0; 115 content_and_url_matches->count(hashed_with_url) > 0;
116 116
117 UMA_HISTOGRAM_BOOLEAN("Duplicate.Hits", did_match_contents); 117 UMA_HISTOGRAM_BOOLEAN("Duplicate.Hits", did_match_contents);
118 UMA_HISTOGRAM_BOOLEAN("Duplicate.HitsSameUrl", 118 UMA_HISTOGRAM_BOOLEAN("Duplicate.HitsSameUrl",
119 did_match_contents && did_match_contents_and_url); 119 did_match_contents && did_match_contents_and_url);
120 UMA_HISTOGRAM_ENUMERATION("Duplicate.ResourceType.All", resource_type_,
121 ResourceType::LAST_TYPE);
120 if (did_match_contents && !did_match_contents_and_url) { 122 if (did_match_contents && !did_match_contents_and_url) {
121 content_and_url_matches->insert(hashed_with_url); 123 content_and_url_matches->insert(hashed_with_url);
122 UMA_HISTOGRAM_CUSTOM_COUNTS("Duplicate.Size.HashHitUrlMiss", bytes_read_, 124 UMA_HISTOGRAM_CUSTOM_COUNTS("Duplicate.Size.HashHitUrlMiss", bytes_read_,
123 1, 0x7FFFFFFF, 50); 125 1, 0x7FFFFFFF, 50);
124 UMA_HISTOGRAM_ENUMERATION("Duplicate.ResourceType.HashHitUrlMiss", 126 UMA_HISTOGRAM_ENUMERATION("Duplicate.ResourceType.HashHitUrlMiss",
125 resource_type_, ResourceType::LAST_TYPE); 127 resource_type_, ResourceType::LAST_TYPE);
126 } 128 }
127 content_matches->insert(contents_hash); 129 content_matches->insert(contents_hash);
128 content_and_url_matches->insert(hashed_with_url); 130 content_and_url_matches->insert(hashed_with_url);
129 131
130 bytes_read_ = 0; 132 bytes_read_ = 0;
131 read_buffer_ = NULL; 133 read_buffer_ = NULL;
132 } 134 }
133 135
134 } // namespace content 136 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698