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

Unified Diff: chrome/common/common_param_traits.cc

Issue 6488010: Propagate the remote socket address to URLRequest and to ViewHostMsg_FrameNavigate. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address eroman's comments Created 9 years, 10 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
Index: chrome/common/common_param_traits.cc
diff --git a/chrome/common/common_param_traits.cc b/chrome/common/common_param_traits.cc
index 64fa35c9ebfc0d191d62a646d37a5f84ea443f1c..042b2ab4e8300f21d80d645f3aaa0a8cf4850831 100644
--- a/chrome/common/common_param_traits.cc
+++ b/chrome/common/common_param_traits.cc
@@ -11,6 +11,7 @@
#include "chrome/common/thumbnail_score.h"
#include "chrome/common/web_apps.h"
#include "googleurl/src/gurl.h"
+#include "net/base/host_port_pair.h"
#include "net/base/upload_data.h"
#include "printing/backend/print_backend.h"
#include "printing/native_metafile.h"
@@ -290,6 +291,27 @@ void ParamTraits<WebApplicationInfo>::Log(const WebApplicationInfo& p,
l->append("<WebApplicationInfo>");
}
+void ParamTraits<net::HostPortPair>::Write(Message* m, const param_type& p) {
+ WriteParam(m, p.host());
+ WriteParam(m, p.port());
+}
+
+bool ParamTraits<net::HostPortPair>::Read(const Message* m, void** iter,
+ param_type* r) {
+ std::string host;
+ uint16 port;
+ if (!ReadParam(m, iter, &host) || !ReadParam(m, iter, &port))
+ return false;
+
+ r->set_host(host);
+ r->set_port(port);
+ return true;
+}
+
+void ParamTraits<net::HostPortPair>::Log(const param_type& p, std::string* l) {
+ l->append(p.ToString());
+}
+
void ParamTraits<net::URLRequestStatus>::Write(Message* m,
const param_type& p) {
WriteParam(m, static_cast<int>(p.status()));

Powered by Google App Engine
This is Rietveld 408576698