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

Side by Side Diff: chrome/browser/safe_browsing/protocol_manager.cc

Issue 1172183002: Move StartsWith[ASCII] to base namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@string_util3
Patch Set: merger Created 5 years, 6 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
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/safe_browsing/protocol_manager.h" 5 #include "chrome/browser/safe_browsing/protocol_manager.h"
6 6
7 #include "base/environment.h" 7 #include "base/environment.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/memory/scoped_vector.h" 9 #include "base/memory/scoped_vector.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 731 matching lines...) Expand 10 before | Expand all | Expand 10 after
742 742
743 GURL SafeBrowsingProtocolManager::GetHashUrl() const { 743 GURL SafeBrowsingProtocolManager::GetHashUrl() const {
744 std::string url = SafeBrowsingProtocolManagerHelper::ComposeUrl( 744 std::string url = SafeBrowsingProtocolManagerHelper::ComposeUrl(
745 url_prefix_, "gethash", client_name_, version_, additional_query_); 745 url_prefix_, "gethash", client_name_, version_, additional_query_);
746 return GURL(url); 746 return GURL(url);
747 } 747 }
748 748
749 GURL SafeBrowsingProtocolManager::NextChunkUrl(const std::string& url) const { 749 GURL SafeBrowsingProtocolManager::NextChunkUrl(const std::string& url) const {
750 DCHECK(CalledOnValidThread()); 750 DCHECK(CalledOnValidThread());
751 std::string next_url; 751 std::string next_url;
752 if (!StartsWithASCII(url, "http://", false) && 752 if (!base::StartsWithASCII(url, "http://", false) &&
753 !StartsWithASCII(url, "https://", false)) { 753 !base::StartsWithASCII(url, "https://", false)) {
754 // Use https if we updated via https, otherwise http (useful for testing). 754 // Use https if we updated via https, otherwise http (useful for testing).
755 if (StartsWithASCII(url_prefix_, "https://", false)) 755 if (base::StartsWithASCII(url_prefix_, "https://", false))
756 next_url.append("https://"); 756 next_url.append("https://");
757 else 757 else
758 next_url.append("http://"); 758 next_url.append("http://");
759 next_url.append(url); 759 next_url.append(url);
760 } else { 760 } else {
761 next_url = url; 761 next_url = url;
762 } 762 }
763 if (!additional_query_.empty()) { 763 if (!additional_query_.empty()) {
764 if (next_url.find("?") != std::string::npos) { 764 if (next_url.find("?") != std::string::npos) {
765 next_url.append("&"); 765 next_url.append("&");
(...skipping 14 matching lines...) Expand all
780 FullHashCallback callback, bool is_download) 780 FullHashCallback callback, bool is_download)
781 : callback(callback), 781 : callback(callback),
782 is_download(is_download) { 782 is_download(is_download) {
783 } 783 }
784 784
785 SafeBrowsingProtocolManager::FullHashDetails::~FullHashDetails() { 785 SafeBrowsingProtocolManager::FullHashDetails::~FullHashDetails() {
786 } 786 }
787 787
788 SafeBrowsingProtocolManagerDelegate::~SafeBrowsingProtocolManagerDelegate() { 788 SafeBrowsingProtocolManagerDelegate::~SafeBrowsingProtocolManagerDelegate() {
789 } 789 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698