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

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

Issue 5695002: IndexedDB: Numeric keys are floating point. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 10 years 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "chrome/common/indexed_db_param_traits.h" 5 #include "chrome/common/indexed_db_param_traits.h"
6 6
7 #include "chrome/common/indexed_db_key.h" 7 #include "chrome/common/indexed_db_key.h"
8 #include "chrome/common/serialized_script_value.h" 8 #include "chrome/common/serialized_script_value.h"
9 #include "ipc/ipc_message_utils.h" 9 #include "ipc/ipc_message_utils.h"
10 10
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 // TODO(jorlow): Technically, we only need to pack the type being used. 51 // TODO(jorlow): Technically, we only need to pack the type being used.
52 WriteParam(m, p.string()); 52 WriteParam(m, p.string());
53 WriteParam(m, p.number()); 53 WriteParam(m, p.number());
54 } 54 }
55 55
56 bool ParamTraits<IndexedDBKey>::Read(const Message* m, 56 bool ParamTraits<IndexedDBKey>::Read(const Message* m,
57 void** iter, 57 void** iter,
58 param_type* r) { 58 param_type* r) {
59 int type; 59 int type;
60 string16 string; 60 string16 string;
61 int32 number; 61 double number;
62 bool ok = 62 bool ok =
63 ReadParam(m, iter, &type) && 63 ReadParam(m, iter, &type) &&
64 ReadParam(m, iter, &string) && 64 ReadParam(m, iter, &string) &&
65 ReadParam(m, iter, &number); 65 ReadParam(m, iter, &number);
66 if (!ok) 66 if (!ok)
67 return false; 67 return false;
68 switch (type) { 68 switch (type) {
69 case WebKit::WebIDBKey::NullType: 69 case WebKit::WebIDBKey::NullType:
70 r->SetNull(); 70 r->SetNull();
71 return true; 71 return true;
(...skipping 15 matching lines...) Expand all
87 l->append("<IndexedDBKey>("); 87 l->append("<IndexedDBKey>(");
88 LogParam(int(p.type()), l); 88 LogParam(int(p.type()), l);
89 l->append(", "); 89 l->append(", ");
90 LogParam(p.string(), l); 90 LogParam(p.string(), l);
91 l->append(", "); 91 l->append(", ");
92 LogParam(p.number(), l); 92 LogParam(p.number(), l);
93 l->append(")"); 93 l->append(")");
94 } 94 }
95 95
96 } // namespace IPC 96 } // namespace IPC
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698