OLD | NEW |
---|---|
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 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
296 ASSERT(!blobInfo->size()); | 296 ASSERT(!blobInfo->size()); |
297 m_pendingCursor->close(); | 297 m_pendingCursor->close(); |
298 m_pendingCursor.clear(); | 298 m_pendingCursor.clear(); |
299 } | 299 } |
300 | 300 |
301 ASSERT(!m_blobInfo.get()); | 301 ASSERT(!m_blobInfo.get()); |
302 m_blobInfo = blobInfo; | 302 m_blobInfo = blobInfo; |
303 onSuccessInternal(IDBAny::create(valueBuffer, m_blobInfo.get())); | 303 onSuccessInternal(IDBAny::create(valueBuffer, m_blobInfo.get())); |
304 } | 304 } |
305 | 305 |
306 #ifndef NDEBUG | 306 #if ENABLE(ASSERT) |
307 static IDBObjectStore* effectiveObjectStore(IDBAny* source) | 307 static IDBObjectStore* effectiveObjectStore(IDBAny* source) |
308 { | 308 { |
309 if (source->type() == IDBAny::IDBObjectStoreType) | 309 if (source->type() == IDBAny::IDBObjectStoreType) |
310 return source->idbObjectStore(); | 310 return source->idbObjectStore(); |
311 if (source->type() == IDBAny::IDBIndexType) | 311 if (source->type() == IDBAny::IDBIndexType) |
312 return source->idbIndex()->objectStore(); | 312 return source->idbIndex()->objectStore(); |
313 | 313 |
314 ASSERT_NOT_REACHED(); | 314 ASSERT_NOT_REACHED(); |
315 return 0; | 315 return 0; |
316 } | 316 } |
317 #endif | 317 #endif |
318 | 318 |
319 void IDBRequest::onSuccess(PassRefPtr<SharedBuffer> prpValueBuffer, PassOwnPtr<V ector<blink::WebBlobInfo> > blobInfo, IDBKey* prpPrimaryKey, const IDBKeyPath& k eyPath) | 319 void IDBRequest::onSuccess(PassRefPtr<SharedBuffer> prpValueBuffer, PassOwnPtr<V ector<blink::WebBlobInfo> > blobInfo, IDBKey* prpPrimaryKey, const IDBKeyPath& k eyPath) |
320 { | 320 { |
321 IDB_TRACE("IDBRequest::onSuccess(SharedBuffer, IDBKey, IDBKeyPath)"); | 321 IDB_TRACE("IDBRequest::onSuccess(SharedBuffer, IDBKey, IDBKeyPath)"); |
322 if (!shouldEnqueueEvent()) | 322 if (!shouldEnqueueEvent()) |
323 return; | 323 return; |
324 | 324 |
325 #ifndef NDEBUG | 325 #if ENABLE(ASSERT) |
jsbell
2014/07/16 00:03:16
Looks like we can remove this #if guard now?
Ken Russell (switch to Gerrit)
2014/07/16 00:05:46
Sure. Will remove in a subsequent version of this
| |
326 ASSERT(keyPath == effectiveObjectStore(m_source)->metadata().keyPath); | 326 ASSERT(keyPath == effectiveObjectStore(m_source)->metadata().keyPath); |
327 #endif | 327 #endif |
328 | 328 |
329 RefPtr<SharedBuffer> valueBuffer = prpValueBuffer; | 329 RefPtr<SharedBuffer> valueBuffer = prpValueBuffer; |
330 IDBKey* primaryKey = prpPrimaryKey; | 330 IDBKey* primaryKey = prpPrimaryKey; |
331 ASSERT(!m_blobInfo.get()); | 331 ASSERT(!m_blobInfo.get()); |
332 m_blobInfo = blobInfo; | 332 m_blobInfo = blobInfo; |
333 | 333 |
334 #ifndef NDEBUG | 334 #if ENABLE(ASSERT) |
335 assertPrimaryKeyValidOrInjectable(m_scriptState.get(), valueBuffer, m_blobIn fo.get(), primaryKey, keyPath); | 335 assertPrimaryKeyValidOrInjectable(m_scriptState.get(), valueBuffer, m_blobIn fo.get(), primaryKey, keyPath); |
336 #endif | 336 #endif |
337 | 337 |
338 onSuccessInternal(IDBAny::create(valueBuffer, m_blobInfo.get(), primaryKey, keyPath)); | 338 onSuccessInternal(IDBAny::create(valueBuffer, m_blobInfo.get(), primaryKey, keyPath)); |
339 } | 339 } |
340 | 340 |
341 void IDBRequest::onSuccess(int64_t value) | 341 void IDBRequest::onSuccess(int64_t value) |
342 { | 342 { |
343 IDB_TRACE("IDBRequest::onSuccess(int64_t)"); | 343 IDB_TRACE("IDBRequest::onSuccess(int64_t)"); |
344 if (!shouldEnqueueEvent()) | 344 if (!shouldEnqueueEvent()) |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
540 | 540 |
541 void IDBRequest::dequeueEvent(Event* event) | 541 void IDBRequest::dequeueEvent(Event* event) |
542 { | 542 { |
543 for (size_t i = 0; i < m_enqueuedEvents.size(); ++i) { | 543 for (size_t i = 0; i < m_enqueuedEvents.size(); ++i) { |
544 if (m_enqueuedEvents[i].get() == event) | 544 if (m_enqueuedEvents[i].get() == event) |
545 m_enqueuedEvents.remove(i); | 545 m_enqueuedEvents.remove(i); |
546 } | 546 } |
547 } | 547 } |
548 | 548 |
549 } // namespace WebCore | 549 } // namespace WebCore |
OLD | NEW |