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

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

Issue 6804032: Add TLS-SRP (RFC 5054) support Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: use system srp and mpi libs, not local copies Created 9 years, 8 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
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 661 matching lines...) Expand 10 before | Expand all | Expand 10 after
672 //------------------------------------------------------------------------------ 672 //------------------------------------------------------------------------------
673 673
674 // static 674 // static
675 GURL Predictor::CanonicalizeUrl(const GURL& url) { 675 GURL Predictor::CanonicalizeUrl(const GURL& url) {
676 if (!url.has_host()) 676 if (!url.has_host())
677 return GURL::EmptyGURL(); 677 return GURL::EmptyGURL();
678 678
679 std::string scheme; 679 std::string scheme;
680 if (url.has_scheme()) { 680 if (url.has_scheme()) {
681 scheme = url.scheme(); 681 scheme = url.scheme();
682 if (scheme != "http" && scheme != "https") 682 if (scheme != "http" && scheme != "https" && scheme != "httpsv")
683 return GURL::EmptyGURL(); 683 return GURL::EmptyGURL();
684 if (url.has_port()) 684 if (url.has_port())
685 return url.GetWithEmptyPath(); 685 return url.GetWithEmptyPath();
686 } else { 686 } else {
687 scheme = "http"; 687 scheme = "http";
688 } 688 }
689 689
690 // If we omit a port, it will default to 80 or 443 as appropriate. 690 // If we omit a port, it will default to 80 or 443 as appropriate.
691 std::string colon_plus_port; 691 std::string colon_plus_port;
692 if (url.has_port()) 692 if (url.has_port())
693 colon_plus_port = ":" + url.port(); 693 colon_plus_port = ":" + url.port();
694 694
695 return GURL(scheme + "://" + url.host() + colon_plus_port); 695 return GURL(scheme + "://" + url.host() + colon_plus_port);
696 } 696 }
697 697
698 698
699 } // namespace chrome_browser_net 699 } // namespace chrome_browser_net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698