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

Side by Side Diff: url/origin.cc

Issue 1762603002: Switch components/password_manager code from IPC messages to Mojo. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Impl done, unit_tests and browser_tests not ready yet Created 4 years, 9 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/origin.h" 5 #include "url/origin.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 #include <string.h> 8 #include <string.h>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 std::string Origin::Serialize() const { 58 std::string Origin::Serialize() const {
59 if (unique()) 59 if (unique())
60 return "null"; 60 return "null";
61 61
62 if (scheme() == kFileScheme) 62 if (scheme() == kFileScheme)
63 return "file://"; 63 return "file://";
64 64
65 return tuple_.Serialize(); 65 return tuple_.Serialize();
66 } 66 }
67 67
68 Origin Origin::Clone() const {
69 return *this;
70 }
71
68 bool Origin::IsSameOriginWith(const Origin& other) const { 72 bool Origin::IsSameOriginWith(const Origin& other) const {
69 if (unique_ || other.unique_) 73 if (unique_ || other.unique_)
70 return false; 74 return false;
71 75
72 return tuple_.Equals(other.tuple_); 76 return tuple_.Equals(other.tuple_);
73 } 77 }
74 78
75 bool Origin::operator<(const Origin& other) const { 79 bool Origin::operator<(const Origin& other) const {
76 return tuple_ < other.tuple_; 80 return tuple_ < other.tuple_;
77 } 81 }
78 82
79 std::ostream& operator<<(std::ostream& out, const url::Origin& origin) { 83 std::ostream& operator<<(std::ostream& out, const url::Origin& origin) {
80 return out << origin.Serialize(); 84 return out << origin.Serialize();
81 } 85 }
82 86
83 bool IsSameOriginWith(const GURL& a, const GURL& b) { 87 bool IsSameOriginWith(const GURL& a, const GURL& b) {
84 return Origin(a).IsSameOriginWith(Origin(b)); 88 return Origin(a).IsSameOriginWith(Origin(b));
85 } 89 }
86 90
87 } // namespace url 91 } // namespace url
OLDNEW
« components/password_manager/content/renderer/credential_manager_client.cc ('K') | « url/origin.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698