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

Side by Side Diff: chrome/common/render_messages.cc

Issue 6713084: Move the rest of the renderer->browser messages that belong in content. Also do a bunch of cleanup: (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 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 | Annotate | Revision Log
« no previous file with comments | « chrome/common/render_messages.h ('k') | chrome/common/render_messages_params.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) 2011 The Chromium Authors. All rights reserved. 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 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 // Get basic type definitions.
6 #define IPC_MESSAGE_IMPL
7 #include "chrome/common/render_messages.h" 5 #include "chrome/common/render_messages.h"
8 #include "chrome/common/common_param_traits.h"
9
10 // Generate constructors.
11 #include "ipc/struct_constructor_macros.h"
12 #include "chrome/common/render_messages.h"
13
14 // Generate destructors.
15 #include "ipc/struct_destructor_macros.h"
16 #include "chrome/common/render_messages.h"
17
18 // Generate param traits write methods.
19 #include "ipc/param_traits_write_macros.h"
20 namespace IPC {
21 #include "chrome/common/render_messages.h"
22 } // namespace IPC
23
24 // Generate param traits read methods.
25 #include "ipc/param_traits_read_macros.h"
26 namespace IPC {
27 #include "chrome/common/render_messages.h"
28 } // namespace IPC
29
30 // Generate param traits log methods.
31 #include "ipc/param_traits_log_macros.h"
32 namespace IPC {
33 #include "chrome/common/render_messages.h"
34 } // namespace IPC
35 6
36 namespace IPC { 7 namespace IPC {
37 8
9 void ParamTraits<ContentSettings>::Write(
10 Message* m, const ContentSettings& settings) {
11 for (size_t i = 0; i < arraysize(settings.settings); ++i)
12 WriteParam(m, settings.settings[i]);
13 }
14
15 bool ParamTraits<ContentSettings>::Read(
16 const Message* m, void** iter, ContentSettings* r) {
17 for (size_t i = 0; i < arraysize(r->settings); ++i) {
18 if (!ReadParam(m, iter, &r->settings[i]))
19 return false;
20 }
21 return true;
22 }
23
24 void ParamTraits<ContentSettings>::Log(
25 const ContentSettings& p, std::string* l) {
26 l->append("<ContentSettings>");
27 }
28
38 void ParamTraits<URLPattern>::Write(Message* m, const param_type& p) { 29 void ParamTraits<URLPattern>::Write(Message* m, const param_type& p) {
39 WriteParam(m, p.valid_schemes()); 30 WriteParam(m, p.valid_schemes());
40 WriteParam(m, p.GetAsString()); 31 WriteParam(m, p.GetAsString());
41 } 32 }
42 33
43 bool ParamTraits<URLPattern>::Read(const Message* m, void** iter, 34 bool ParamTraits<URLPattern>::Read(const Message* m, void** iter,
44 param_type* p) { 35 param_type* p) {
45 int valid_schemes; 36 int valid_schemes;
46 std::string spec; 37 std::string spec;
47 if (!ReadParam(m, iter, &valid_schemes) || 38 if (!ReadParam(m, iter, &valid_schemes) ||
(...skipping 22 matching lines...) Expand all
70 61
71 for (size_t i = 0; i < patterns.size(); ++i) 62 for (size_t i = 0; i < patterns.size(); ++i)
72 p->AddPattern(patterns[i]); 63 p->AddPattern(patterns[i]);
73 return true; 64 return true;
74 } 65 }
75 66
76 void ParamTraits<ExtensionExtent>::Log(const param_type& p, std::string* l) { 67 void ParamTraits<ExtensionExtent>::Log(const param_type& p, std::string* l) {
77 LogParam(p.patterns(), l); 68 LogParam(p.patterns(), l);
78 } 69 }
79 70
80 void ParamTraits<webkit_glue::WebAccessibility>::Write(Message* m,
81 const param_type& p) {
82 WriteParam(m, p.id);
83 WriteParam(m, p.name);
84 WriteParam(m, p.value);
85 WriteParam(m, static_cast<int>(p.role));
86 WriteParam(m, static_cast<int>(p.state));
87 WriteParam(m, p.location);
88 WriteParam(m, p.attributes);
89 WriteParam(m, p.children);
90 WriteParam(m, p.indirect_child_ids);
91 WriteParam(m, p.html_attributes);
92 }
93
94 bool ParamTraits<webkit_glue::WebAccessibility>::Read(
95 const Message* m, void** iter, param_type* p) {
96 bool ret = ReadParam(m, iter, &p->id);
97 ret = ret && ReadParam(m, iter, &p->name);
98 ret = ret && ReadParam(m, iter, &p->value);
99 int role = -1;
100 ret = ret && ReadParam(m, iter, &role);
101 if (role >= webkit_glue::WebAccessibility::ROLE_NONE &&
102 role < webkit_glue::WebAccessibility::NUM_ROLES) {
103 p->role = static_cast<webkit_glue::WebAccessibility::Role>(role);
104 } else {
105 p->role = webkit_glue::WebAccessibility::ROLE_NONE;
106 }
107 int state = 0;
108 ret = ret && ReadParam(m, iter, &state);
109 p->state = static_cast<webkit_glue::WebAccessibility::State>(state);
110 ret = ret && ReadParam(m, iter, &p->location);
111 ret = ret && ReadParam(m, iter, &p->attributes);
112 ret = ret && ReadParam(m, iter, &p->children);
113 ret = ret && ReadParam(m, iter, &p->indirect_child_ids);
114 ret = ret && ReadParam(m, iter, &p->html_attributes);
115 return ret;
116 }
117
118 void ParamTraits<webkit_glue::WebAccessibility>::Log(const param_type& p,
119 std::string* l) {
120 l->append("(");
121 LogParam(p.id, l);
122 l->append(", ");
123 LogParam(p.name, l);
124 l->append(", ");
125 LogParam(p.value, l);
126 l->append(", ");
127 LogParam(static_cast<int>(p.role), l);
128 l->append(", ");
129 LogParam(static_cast<int>(p.state), l);
130 l->append(", ");
131 LogParam(p.location, l);
132 l->append(", ");
133 LogParam(p.attributes, l);
134 l->append(", ");
135 LogParam(p.children, l);
136 l->append(", ");
137 LogParam(p.html_attributes, l);
138 l->append(", ");
139 LogParam(p.indirect_child_ids, l);
140 l->append(")");
141 }
142
143 } // namespace IPC 71 } // namespace IPC
OLDNEW
« no previous file with comments | « chrome/common/render_messages.h ('k') | chrome/common/render_messages_params.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698