OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "content/common/common_param_traits.h" |
| 6 |
| 7 #include "content/common/content_constants.h" |
| 8 |
| 9 namespace IPC { |
| 10 |
| 11 void ParamTraits<GURL>::Write(Message* m, const GURL& p) { |
| 12 m->WriteString(p.possibly_invalid_spec()); |
| 13 // TODO(brettw) bug 684583: Add encoding for query params. |
| 14 } |
| 15 |
| 16 bool ParamTraits<GURL>::Read(const Message* m, void** iter, GURL* p) { |
| 17 std::string s; |
| 18 if (!m->ReadString(iter, &s) || s.length() > content::kMaxURLChars) { |
| 19 *p = GURL(); |
| 20 return false; |
| 21 } |
| 22 *p = GURL(s); |
| 23 return true; |
| 24 } |
| 25 |
| 26 void ParamTraits<GURL>::Log(const GURL& p, std::string* l) { |
| 27 l->append(p.spec()); |
| 28 } |
| 29 |
| 30 } // namespace IPC |
OLD | NEW |