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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "content/public/common/common_param_traits.h" 5 #include "content/public/common/common_param_traits.h"
6 6
7 #include <string>
7 #include "content/public/common/content_constants.h" 8 #include "content/public/common/content_constants.h"
Tom Sepez 2014/03/03 19:09:30 nit: blank line between system includes and other
yhirano 2014/03/03 20:32:50 Done.
8 #include "content/public/common/page_state.h" 9 #include "content/public/common/page_state.h"
9 #include "content/public/common/referrer.h" 10 #include "content/public/common/referrer.h"
10 #include "content/public/common/url_utils.h" 11 #include "content/public/common/url_utils.h"
11 #include "net/base/host_port_pair.h" 12 #include "net/base/host_port_pair.h"
12 #include "net/base/ip_endpoint.h" 13 #include "net/base/ip_endpoint.h"
13 #include "third_party/skia/include/core/SkBitmap.h" 14 #include "third_party/skia/include/core/SkBitmap.h"
14 #include "ui/gfx/rect.h" 15 #include "ui/gfx/rect.h"
15 #include "ui/gfx/rect_f.h" 16 #include "ui/gfx/rect_f.h"
16 17
17 namespace { 18 namespace {
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 *p = GURL(); 81 *p = GURL();
81 return false; 82 return false;
82 } 83 }
83 return true; 84 return true;
84 } 85 }
85 86
86 void ParamTraits<GURL>::Log(const GURL& p, std::string* l) { 87 void ParamTraits<GURL>::Log(const GURL& p, std::string* l) {
87 l->append(p.spec()); 88 l->append(p.spec());
88 } 89 }
89 90
91 void ParamTraits<SerializedOrigin>::Write(Message* m,
92 const SerializedOrigin& p) {
93 m->WriteString(p.string());
94 }
95
96 bool ParamTraits<SerializedOrigin>::Read(const Message* m,
97 PickleIterator* iter,
98 SerializedOrigin* p) {
99 std::string s;
100 if (!m->ReadString(iter, &s)) {
101 *p = SerializedOrigin();
102 return false;
103 }
104 *p = SerializedOrigin(s);
105 return true;
106 }
107
108 void ParamTraits<SerializedOrigin>::Log(const SerializedOrigin& p,
109 std::string* l) {
110 l->append(p.string());
111 }
112
90 void ParamTraits<net::HostPortPair>::Write(Message* m, const param_type& p) { 113 void ParamTraits<net::HostPortPair>::Write(Message* m, const param_type& p) {
91 WriteParam(m, p.host()); 114 WriteParam(m, p.host());
92 WriteParam(m, p.port()); 115 WriteParam(m, p.port());
93 } 116 }
94 117
95 bool ParamTraits<net::HostPortPair>::Read(const Message* m, 118 bool ParamTraits<net::HostPortPair>::Read(const Message* m,
96 PickleIterator* iter, 119 PickleIterator* iter,
97 param_type* r) { 120 param_type* r) {
98 std::string host; 121 std::string host;
99 uint16 port; 122 uint16 port;
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
378 #undef CONTENT_PUBLIC_COMMON_COMMON_PARAM_TRAITS_MACROS_H_ 401 #undef CONTENT_PUBLIC_COMMON_COMMON_PARAM_TRAITS_MACROS_H_
379 #include "content/public/common/common_param_traits_macros.h" 402 #include "content/public/common/common_param_traits_macros.h"
380 } // namespace IPC 403 } // namespace IPC
381 404
382 // Generate param traits log methods. 405 // Generate param traits log methods.
383 #include "ipc/param_traits_log_macros.h" 406 #include "ipc/param_traits_log_macros.h"
384 namespace IPC { 407 namespace IPC {
385 #undef CONTENT_PUBLIC_COMMON_COMMON_PARAM_TRAITS_MACROS_H_ 408 #undef CONTENT_PUBLIC_COMMON_COMMON_PARAM_TRAITS_MACROS_H_
386 #include "content/public/common/common_param_traits_macros.h" 409 #include "content/public/common/common_param_traits_macros.h"
387 } // namespace IPC 410 } // namespace IPC
OLDNEW
« 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