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

Side by Side Diff: chrome/browser/history/url_index_private_data.h

Issue 10382032: Coverity: Fix pass by value error. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed review comments. Created 8 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/history/url_index_private_data.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 #ifndef CHROME_BROWSER_HISTORY_URL_INDEX_PRIVATE_DATA_H_ 5 #ifndef CHROME_BROWSER_HISTORY_URL_INDEX_PRIVATE_DATA_H_
6 #define CHROME_BROWSER_HISTORY_URL_INDEX_PRIVATE_DATA_H_ 6 #define CHROME_BROWSER_HISTORY_URL_INDEX_PRIVATE_DATA_H_
7 #pragma once 7 #pragma once
8 8
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 // candidates may cause perceptible typing response delays in the omnibox. 134 // candidates may cause perceptible typing response delays in the omnibox.
135 // This is likely to occur for short omnibox terms such as 'h' and 'w' which 135 // This is likely to occur for short omnibox terms such as 'h' and 'w' which
136 // will be found in nearly all history candidates. Results are sorted by 136 // will be found in nearly all history candidates. Results are sorted by
137 // descending score. The full results set (i.e. beyond the 137 // descending score. The full results set (i.e. beyond the
138 // |kItemsToScoreLimit| limit) will be retained and used for subsequent calls 138 // |kItemsToScoreLimit| limit) will be retained and used for subsequent calls
139 // to this function. 139 // to this function.
140 ScoredHistoryMatches HistoryItemsForTerms(const string16& term_string); 140 ScoredHistoryMatches HistoryItemsForTerms(const string16& term_string);
141 141
142 // Creates a new URLIndexPrivateData object, populates it from the contents 142 // Creates a new URLIndexPrivateData object, populates it from the contents
143 // of the cache file stored in |file_path|, and assigns it to |private_data|. 143 // of the cache file stored in |file_path|, and assigns it to |private_data|.
144 // |languages| will be used to break URLs and page titles into words and is 144 // |languages| will be used to break URLs and page titles into words.
145 // deliberately passed by value.
146 static void RestoreFromFileTask( 145 static void RestoreFromFileTask(
147 const FilePath& file_path, 146 const FilePath& file_path,
148 scoped_refptr<URLIndexPrivateData> private_data, 147 scoped_refptr<URLIndexPrivateData> private_data,
149 std::string languages); 148 const std::string& languages);
150 149
151 // Constructs a new object by restoring its contents from the file at |path|. 150 // Constructs a new object by restoring its contents from the file at |path|.
152 // Returns the new URLIndexPrivateData which on success will contain the 151 // Returns the new URLIndexPrivateData which on success will contain the
153 // restored data but upon failure will be empty. |languages| will be used to 152 // restored data but upon failure will be empty. |languages| will be used to
154 // break URLs and page titles into words 153 // break URLs and page titles into words
155 static scoped_refptr<URLIndexPrivateData> RestoreFromFile( 154 static scoped_refptr<URLIndexPrivateData> RestoreFromFile(
156 const FilePath& path, 155 const FilePath& path,
157 const std::string& languages); 156 const std::string& languages);
158 157
159 // Constructs a new object by rebuilding its contents from the history 158 // Constructs a new object by rebuilding its contents from the history
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
366 // Used for unit testing only. Records the number of candidate history items 365 // Used for unit testing only. Records the number of candidate history items
367 // at three stages in the index searching process. 366 // at three stages in the index searching process.
368 size_t pre_filter_item_count_; // After word index is queried. 367 size_t pre_filter_item_count_; // After word index is queried.
369 size_t post_filter_item_count_; // After trimming large result set. 368 size_t post_filter_item_count_; // After trimming large result set.
370 size_t post_scoring_item_count_; // After performing final filter/scoring. 369 size_t post_scoring_item_count_; // After performing final filter/scoring.
371 }; 370 };
372 371
373 } // namespace history 372 } // namespace history
374 373
375 #endif // CHROME_BROWSER_HISTORY_URL_INDEX_PRIVATE_DATA_H_ 374 #endif // CHROME_BROWSER_HISTORY_URL_INDEX_PRIVATE_DATA_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/history/url_index_private_data.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698