Index: content/common/common_param_traits.cc |
=================================================================== |
--- content/common/common_param_traits.cc (revision 0) |
+++ content/common/common_param_traits.cc (revision 0) |
@@ -0,0 +1,30 @@ |
+// Copyright (c) 2011 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "content/common/common_param_traits.h" |
+ |
+#include "content/common/content_constants.h" |
+ |
+namespace IPC { |
+ |
+void ParamTraits<GURL>::Write(Message* m, const GURL& p) { |
+ m->WriteString(p.possibly_invalid_spec()); |
+ // TODO(brettw) bug 684583: Add encoding for query params. |
+} |
+ |
+bool ParamTraits<GURL>::Read(const Message* m, void** iter, GURL* p) { |
+ std::string s; |
+ if (!m->ReadString(iter, &s) || s.length() > content::kMaxURLChars) { |
+ *p = GURL(); |
+ return false; |
+ } |
+ *p = GURL(s); |
+ return true; |
+} |
+ |
+void ParamTraits<GURL>::Log(const GURL& p, std::string* l) { |
+ l->append(p.spec()); |
+} |
+ |
+} // namespace IPC |
Property changes on: content\common\common_param_traits.cc |
___________________________________________________________________ |
Added: svn:eol-style |
+ LF |