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

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

Issue 1223153003: Move JoinString to the base namespace (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: windows Created 5 years, 5 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
« no previous file with comments | « chrome/browser/net/firefox_proxy_settings.cc ('k') | chrome/browser/net/safe_search_util.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 #include "chrome/browser/net/predictor.h" 5 #include "chrome/browser/net/predictor.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 #include <set> 9 #include <set>
10 #include <sstream> 10 #include <sstream>
(...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after
497 } 497 }
498 498
499 private: 499 private:
500 // Transforms something like "http://www.google.com/xyz" to 500 // Transforms something like "http://www.google.com/xyz" to
501 // "http://com.google.www/xyz". 501 // "http://com.google.www/xyz".
502 static std::string ReverseComponents(const GURL& url) { 502 static std::string ReverseComponents(const GURL& url) {
503 // Reverse the components in the hostname. 503 // Reverse the components in the hostname.
504 std::vector<std::string> parts; 504 std::vector<std::string> parts;
505 base::SplitString(url.host(), '.', &parts); 505 base::SplitString(url.host(), '.', &parts);
506 std::reverse(parts.begin(), parts.end()); 506 std::reverse(parts.begin(), parts.end());
507 std::string reversed_host = JoinString(parts, '.'); 507 std::string reversed_host = base::JoinString(parts, ".");
508 508
509 // Return the new URL. 509 // Return the new URL.
510 GURL::Replacements url_components; 510 GURL::Replacements url_components;
511 url_components.SetHostStr(reversed_host); 511 url_components.SetHostStr(reversed_host);
512 return url.ReplaceComponents(url_components).spec(); 512 return url.ReplaceComponents(url_components).spec();
513 } 513 }
514 }; 514 };
515 515
516 void Predictor::GetHtmlReferrerLists(std::string* output) { 516 void Predictor::GetHtmlReferrerLists(std::string* output) {
517 DCHECK_CURRENTLY_ON(BrowserThread::IO); 517 DCHECK_CURRENTLY_ON(BrowserThread::IO);
(...skipping 800 matching lines...) Expand 10 before | Expand all | Expand 10 after
1318 } 1318 }
1319 1319
1320 void SimplePredictor::ShutdownOnUIThread() { 1320 void SimplePredictor::ShutdownOnUIThread() {
1321 SetShutdown(true); 1321 SetShutdown(true);
1322 } 1322 }
1323 1323
1324 bool SimplePredictor::CanPrefetchAndPrerender() const { return true; } 1324 bool SimplePredictor::CanPrefetchAndPrerender() const { return true; }
1325 bool SimplePredictor::CanPreresolveAndPreconnect() const { return true; } 1325 bool SimplePredictor::CanPreresolveAndPreconnect() const { return true; }
1326 1326
1327 } // namespace chrome_browser_net 1327 } // namespace chrome_browser_net
OLDNEW
« no previous file with comments | « chrome/browser/net/firefox_proxy_settings.cc ('k') | chrome/browser/net/safe_search_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698