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

Side by Side Diff: Source/modules/indexeddb/IDBAny.cpp

Issue 18590006: Blob support for IDB [Blink] (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: small cleanup Created 7 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 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 ASSERT(m_type == KeyPathType || m_type == BufferKeyAndKeyPathType); 122 ASSERT(m_type == KeyPathType || m_type == BufferKeyAndKeyPathType);
123 return m_idbKeyPath; 123 return m_idbKeyPath;
124 } 124 }
125 125
126 SharedBuffer* IDBAny::buffer() 126 SharedBuffer* IDBAny::buffer()
127 { 127 {
128 ASSERT(m_type == BufferType || m_type == BufferKeyAndKeyPathType); 128 ASSERT(m_type == BufferType || m_type == BufferKeyAndKeyPathType);
129 return m_buffer.get(); 129 return m_buffer.get();
130 } 130 }
131 131
132 const Vector<BlobInfo>* IDBAny::blobInfo() const
133 {
134 ASSERT(m_type == BufferType || m_type == BufferKeyAndKeyPathType);
135 return m_blobInfo;
136 }
137
132 const String& IDBAny::string() 138 const String& IDBAny::string()
133 { 139 {
134 ASSERT(m_type == StringType); 140 ASSERT(m_type == StringType);
135 return m_string; 141 return m_string;
136 } 142 }
137 143
138 int64_t IDBAny::integer() 144 int64_t IDBAny::integer()
139 { 145 {
140 ASSERT(m_type == IntegerType); 146 ASSERT(m_type == IntegerType);
141 return m_integer; 147 return m_integer;
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 { 189 {
184 } 190 }
185 191
186 IDBAny::IDBAny(PassRefPtr<IDBObjectStore> value) 192 IDBAny::IDBAny(PassRefPtr<IDBObjectStore> value)
187 : m_type(IDBObjectStoreType) 193 : m_type(IDBObjectStoreType)
188 , m_idbObjectStore(value) 194 , m_idbObjectStore(value)
189 , m_integer(0) 195 , m_integer(0)
190 { 196 {
191 } 197 }
192 198
193 IDBAny::IDBAny(PassRefPtr<SharedBuffer> value) 199 IDBAny::IDBAny(PassRefPtr<SharedBuffer> value, const Vector<BlobInfo>* blobInfo)
194 : m_type(BufferType) 200 : m_type(BufferType)
195 , m_buffer(value) 201 , m_buffer(value)
202 , m_blobInfo(blobInfo)
196 , m_integer(0) 203 , m_integer(0)
197 { 204 {
198 } 205 }
199 206
200 IDBAny::IDBAny(PassRefPtr<SharedBuffer> value, PassRefPtr<IDBKey> key, const IDB KeyPath& keyPath) 207 IDBAny::IDBAny(PassRefPtr<SharedBuffer> value, const Vector<BlobInfo>* blobInfo, PassRefPtr<IDBKey> key, const IDBKeyPath& keyPath)
201 : m_type(BufferKeyAndKeyPathType) 208 : m_type(BufferKeyAndKeyPathType)
202 , m_idbKey(key) 209 , m_idbKey(key)
203 , m_idbKeyPath(keyPath) 210 , m_idbKeyPath(keyPath)
204 , m_buffer(value) 211 , m_buffer(value)
212 , m_blobInfo(blobInfo)
205 , m_integer(0) 213 , m_integer(0)
206 { 214 {
207 } 215 }
208 216
209 IDBAny::IDBAny(PassRefPtr<IDBKey> key) 217 IDBAny::IDBAny(PassRefPtr<IDBKey> key)
210 : m_type(KeyType) 218 : m_type(KeyType)
211 , m_idbKey(key) 219 , m_idbKey(key)
212 , m_integer(0) 220 , m_integer(0)
213 { 221 {
214 } 222 }
(...skipping 12 matching lines...) Expand all
227 { 235 {
228 } 236 }
229 237
230 IDBAny::IDBAny(int64_t value) 238 IDBAny::IDBAny(int64_t value)
231 : m_type(IntegerType) 239 : m_type(IntegerType)
232 , m_integer(value) 240 , m_integer(value)
233 { 241 {
234 } 242 }
235 243
236 } // namespace WebCore 244 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698