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 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
326 | 326 |
327 m_primaryKey = primaryKey; | 327 m_primaryKey = primaryKey; |
328 m_primaryKeyDirty = true; | 328 m_primaryKeyDirty = true; |
329 | 329 |
330 if (isCursorWithValue()) { | 330 if (isCursorWithValue()) { |
331 m_value = value; | 331 m_value = value; |
332 handleBlobAcks(); | 332 handleBlobAcks(); |
333 m_blobInfo = blobInfo; | 333 m_blobInfo = blobInfo; |
334 m_valueDirty = true; | 334 m_valueDirty = true; |
335 if (m_blobInfo && m_blobInfo->size() > 0) | 335 if (m_blobInfo && m_blobInfo->size() > 0) |
336 V8PerIsolateData::from(m_request->scriptState()->isolate())->ensureI
DBPendingTransactionMonitor()->registerCursor(*this); | 336 ThreadState::current()->registerPreFinalizer(*this); |
337 } | 337 } |
338 | 338 |
339 m_gotValue = true; | 339 m_gotValue = true; |
340 } | 340 } |
341 | 341 |
342 IDBObjectStore* IDBCursor::effectiveObjectStore() const | 342 IDBObjectStore* IDBCursor::effectiveObjectStore() const |
343 { | 343 { |
344 if (m_source->type() == IDBAny::IDBObjectStoreType) | 344 if (m_source->type() == IDBAny::IDBObjectStoreType) |
345 return m_source->idbObjectStore(); | 345 return m_source->idbObjectStore(); |
346 return m_source->idbIndex()->objectStore(); | 346 return m_source->idbIndex()->objectStore(); |
347 } | 347 } |
348 | 348 |
349 bool IDBCursor::isDeleted() const | 349 bool IDBCursor::isDeleted() const |
350 { | 350 { |
351 if (m_source->type() == IDBAny::IDBObjectStoreType) | 351 if (m_source->type() == IDBAny::IDBObjectStoreType) |
352 return m_source->idbObjectStore()->isDeleted(); | 352 return m_source->idbObjectStore()->isDeleted(); |
353 return m_source->idbIndex()->isDeleted(); | 353 return m_source->idbIndex()->isDeleted(); |
354 } | 354 } |
355 | 355 |
356 void IDBCursor::handleBlobAcks() | 356 void IDBCursor::handleBlobAcks() |
357 { | 357 { |
358 ASSERT(m_request || !m_blobInfo || !m_blobInfo->size()); | 358 ASSERT(m_request || !m_blobInfo || !m_blobInfo->size()); |
359 if (m_blobInfo.get() && m_blobInfo->size()) { | 359 if (m_blobInfo.get() && m_blobInfo->size()) { |
360 ASSERT(m_request); | 360 ASSERT(m_request); |
361 m_transaction->db()->ackReceivedBlobs(m_blobInfo.get()); | 361 m_transaction->db()->ackReceivedBlobs(m_blobInfo.get()); |
362 m_blobInfo.clear(); | 362 m_blobInfo.clear(); |
363 V8PerIsolateData::from(m_request->scriptState()->isolate())->ensureIDBPe
ndingTransactionMonitor()->unregisterCursor(*this); | 363 ThreadState::current()->unregisterPreFinalizer(*this); |
364 } | 364 } |
365 } | 365 } |
366 | 366 |
367 WebIDBCursorDirection IDBCursor::stringToDirection(const String& directionString
, ExceptionState& exceptionState) | 367 WebIDBCursorDirection IDBCursor::stringToDirection(const String& directionString
, ExceptionState& exceptionState) |
368 { | 368 { |
369 if (directionString == IndexedDBNames::next) | 369 if (directionString == IndexedDBNames::next) |
370 return WebIDBCursorDirectionNext; | 370 return WebIDBCursorDirectionNext; |
371 if (directionString == IndexedDBNames::nextunique) | 371 if (directionString == IndexedDBNames::nextunique) |
372 return WebIDBCursorDirectionNextNoDuplicate; | 372 return WebIDBCursorDirectionNextNoDuplicate; |
373 if (directionString == IndexedDBNames::prev) | 373 if (directionString == IndexedDBNames::prev) |
(...skipping 20 matching lines...) Expand all Loading... |
394 case WebIDBCursorDirectionPrevNoDuplicate: | 394 case WebIDBCursorDirectionPrevNoDuplicate: |
395 return IndexedDBNames::prevunique; | 395 return IndexedDBNames::prevunique; |
396 | 396 |
397 default: | 397 default: |
398 ASSERT_NOT_REACHED(); | 398 ASSERT_NOT_REACHED(); |
399 return IndexedDBNames::next; | 399 return IndexedDBNames::next; |
400 } | 400 } |
401 } | 401 } |
402 | 402 |
403 } // namespace blink | 403 } // namespace blink |
OLD | NEW |