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

Unified Diff: content/public/common/common_param_traits.cc

Issue 170843007: Introduce url::Origin to represent Web Origin. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/public/common/common_param_traits.h ('k') | net/websockets/websocket_channel.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/common/common_param_traits.cc
diff --git a/content/public/common/common_param_traits.cc b/content/public/common/common_param_traits.cc
index 7c47ab53907ae1b3c38154e6392244cdedff7fae..b1e95cbd32e6a7845d87164cafcb6922f4b2e51f 100644
--- a/content/public/common/common_param_traits.cc
+++ b/content/public/common/common_param_traits.cc
@@ -4,6 +4,8 @@
#include "content/public/common/common_param_traits.h"
+#include <string>
+
#include "content/public/common/content_constants.h"
#include "content/public/common/page_state.h"
#include "content/public/common/referrer.h"
@@ -87,6 +89,27 @@ void ParamTraits<GURL>::Log(const GURL& p, std::string* l) {
l->append(p.spec());
}
+void ParamTraits<url::Origin>::Write(Message* m,
+ const url::Origin& p) {
+ m->WriteString(p.string());
+}
+
+bool ParamTraits<url::Origin>::Read(const Message* m,
+ PickleIterator* iter,
+ url::Origin* p) {
+ std::string s;
+ if (!m->ReadString(iter, &s)) {
+ *p = url::Origin();
+ return false;
+ }
+ *p = url::Origin(s);
+ return true;
+}
+
+void ParamTraits<url::Origin>::Log(const url::Origin& p, std::string* l) {
+ l->append(p.string());
+}
+
void ParamTraits<net::HostPortPair>::Write(Message* m, const param_type& p) {
WriteParam(m, p.host());
WriteParam(m, p.port());
« no previous file with comments | « content/public/common/common_param_traits.h ('k') | net/websockets/websocket_channel.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698