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

Side by Side Diff: url/gurl.cc

Issue 2485253002: Remove unnecessary calls to GURL() (Closed)
Patch Set: Assert that StringPiece must always be canonicalized. Fix some constants. Created 4 years, 1 month 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 | « ios/chrome/browser/history/history_utils.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "url/gurl.h" 5 #include "url/gurl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <ostream> 10 #include <ostream>
(...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after
505 505
506 bool operator==(const GURL& x, const GURL& y) { 506 bool operator==(const GURL& x, const GURL& y) {
507 return x.possibly_invalid_spec() == y.possibly_invalid_spec(); 507 return x.possibly_invalid_spec() == y.possibly_invalid_spec();
508 } 508 }
509 509
510 bool operator!=(const GURL& x, const GURL& y) { 510 bool operator!=(const GURL& x, const GURL& y) {
511 return !(x == y); 511 return !(x == y);
512 } 512 }
513 513
514 bool operator==(const GURL& x, const base::StringPiece& spec) { 514 bool operator==(const GURL& x, const base::StringPiece& spec) {
515 DCHECK_EQ(GURL(spec).possibly_invalid_spec(), spec);
515 return x.possibly_invalid_spec() == spec; 516 return x.possibly_invalid_spec() == spec;
516 } 517 }
517 518
518 bool operator!=(const GURL& x, const base::StringPiece& spec) { 519 bool operator!=(const GURL& x, const base::StringPiece& spec) {
519 return !(x == spec); 520 return !(x == spec);
520 } 521 }
OLDNEW
« no previous file with comments | « ios/chrome/browser/history/history_utils.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698