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

Side by Side Diff: chrome/browser/history/in_memory_url_index.cc

Issue 7008005: base/i18n: Pass |str| as const reference in BreakIterator::Init(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: const reference Created 9 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 | « base/i18n/break_iterator_unittest.cc ('k') | chrome/browser/history/query_parser.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) 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/history/in_memory_url_index.h" 5 #include "chrome/browser/history/in_memory_url_index.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <functional> 8 #include <functional>
9 #include <iterator> 9 #include <iterator>
10 #include <limits> 10 #include <limits>
(...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after
480 ++iter) 480 ++iter)
481 word_set.insert(base::i18n::ToLower(*iter)); 481 word_set.insert(base::i18n::ToLower(*iter));
482 return word_set; 482 return word_set;
483 } 483 }
484 484
485 // static 485 // static
486 InMemoryURLIndex::String16Vector InMemoryURLIndex::WordVectorFromString16( 486 InMemoryURLIndex::String16Vector InMemoryURLIndex::WordVectorFromString16(
487 const string16& uni_string, 487 const string16& uni_string,
488 bool break_on_space) { 488 bool break_on_space) {
489 base::i18n::BreakIterator iter( 489 base::i18n::BreakIterator iter(
490 &uni_string, 490 uni_string,
491 break_on_space ? base::i18n::BreakIterator::BREAK_SPACE 491 break_on_space ? base::i18n::BreakIterator::BREAK_SPACE
492 : base::i18n::BreakIterator::BREAK_WORD); 492 : base::i18n::BreakIterator::BREAK_WORD);
493 String16Vector words; 493 String16Vector words;
494 if (!iter.Init()) 494 if (!iter.Init())
495 return words; 495 return words;
496 while (iter.Advance()) { 496 while (iter.Advance()) {
497 if (break_on_space || iter.IsWord()) { 497 if (break_on_space || iter.IsWord()) {
498 string16 word = iter.GetString(); 498 string16 word = iter.GetString();
499 if (break_on_space) 499 if (break_on_space)
500 TrimWhitespace(word, TRIM_ALL, &word); 500 TrimWhitespace(word, TRIM_ALL, &word);
(...skipping 582 matching lines...) Expand 10 before | Expand all | Expand 10 after
1083 if (iter->has_title()) { 1083 if (iter->has_title()) {
1084 string16 title(UTF8ToUTF16(iter->title())); 1084 string16 title(UTF8ToUTF16(iter->title()));
1085 url_row.set_title(title); 1085 url_row.set_title(title);
1086 } 1086 }
1087 history_info_map_[history_id] = url_row; 1087 history_info_map_[history_id] = url_row;
1088 } 1088 }
1089 return true; 1089 return true;
1090 } 1090 }
1091 1091
1092 } // namespace history 1092 } // namespace history
OLDNEW
« no previous file with comments | « base/i18n/break_iterator_unittest.cc ('k') | chrome/browser/history/query_parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698