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

Side by Side Diff: content/common/indexed_db/indexed_db_param_traits.cc

Issue 9389025: IndexedDB: Implement IPC plumbing for IDBObjectStore.delete(IDBKeyRange) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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 unified diff | Download patch | Annotate | Revision Log
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/common/indexed_db/indexed_db_param_traits.h" 5 #include "content/common/indexed_db/indexed_db_param_traits.h"
6 6
7 #include "content/common/indexed_db/indexed_db_key.h" 7 #include "content/common/indexed_db/indexed_db_key.h"
8 #include "content/common/indexed_db/indexed_db_key_range.h"
8 #include "content/public/common/serialized_script_value.h" 9 #include "content/public/common/serialized_script_value.h"
9 #include "ipc/ipc_message_utils.h" 10 #include "ipc/ipc_message_utils.h"
10 11
11 namespace IPC { 12 namespace IPC {
12 13
13 void ParamTraits<content::SerializedScriptValue>::Write(Message* m, 14 void ParamTraits<content::SerializedScriptValue>::Write(Message* m,
14 const param_type& p) { 15 const param_type& p) {
15 WriteParam(m, p.is_null()); 16 WriteParam(m, p.is_null());
16 WriteParam(m, p.is_invalid()); 17 WriteParam(m, p.is_invalid());
17 WriteParam(m, p.data()); 18 WriteParam(m, p.data());
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 } 134 }
134 l->append("], "); 135 l->append("], ");
135 LogParam(p.string(), l); 136 LogParam(p.string(), l);
136 l->append(", "); 137 l->append(", ");
137 LogParam(p.date(), l); 138 LogParam(p.date(), l);
138 l->append(", "); 139 l->append(", ");
139 LogParam(p.number(), l); 140 LogParam(p.number(), l);
140 l->append(")"); 141 l->append(")");
141 } 142 }
142 143
144 void ParamTraits<IndexedDBKeyRange>::Write(Message* m, const param_type& p) {
145 WriteParam(m, p.lower());
146 WriteParam(m, p.upper());
147 WriteParam(m, p.lowerOpen());
148 WriteParam(m, p.upperOpen());
149 }
150
151 bool ParamTraits<IndexedDBKeyRange>::Read(const Message* m,
152 void** iter,
153 param_type* r) {
154
155 IndexedDBKey lower;
156 if (!ReadParam(m, iter, &lower))
157 return false;
158
159 IndexedDBKey upper;
160 if (!ReadParam(m, iter, &upper))
161 return false;
162
163 bool lower_open;
164 if (!ReadParam(m, iter, &lower_open))
165 return false;
166
167 bool upper_open;
168 if (!ReadParam(m, iter, &upper_open))
169 return false;
170
171 r->Set(lower, upper, lower_open, upper_open);
172 return true;
173 }
174
175 void ParamTraits<IndexedDBKeyRange>::Log(const param_type& p, std::string* l) {
176 l->append("<IndexedDBKeyRange>(lower=");
177 LogParam(p.lower(), l);
178 l->append(", upper=");
179 LogParam(p.upper(), l);
180 l->append(", lower_open=");
181 LogParam(p.lowerOpen(), l);
182 l->append(", upper_open=");
183 LogParam(p.upperOpen(), l);
184 l->append(")");
185 }
186
143 } // namespace IPC 187 } // namespace IPC
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698