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 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 DCHECK(!value->BlobInfo()->size()); | 330 DCHECK(!value->BlobInfo()->size()); |
331 pending_cursor_->Close(); | 331 pending_cursor_->Close(); |
332 pending_cursor_.Clear(); | 332 pending_cursor_.Clear(); |
333 } | 333 } |
334 | 334 |
335 #if DCHECK_IS_ON() | 335 #if DCHECK_IS_ON() |
336 DCHECK(!value->PrimaryKey() || | 336 DCHECK(!value->PrimaryKey() || |
337 value->KeyPath() == EffectiveObjectStore(source_)->IdbKeyPath()); | 337 value->KeyPath() == EffectiveObjectStore(source_)->IdbKeyPath()); |
338 #endif | 338 #endif |
339 | 339 |
340 EnqueueResultInternal(IDBAny::Create(value.Release())); | 340 EnqueueResultInternal(IDBAny::Create(std::move(value))); |
341 } | 341 } |
342 | 342 |
343 void IDBRequest::EnqueueResponse(int64_t value) { | 343 void IDBRequest::EnqueueResponse(int64_t value) { |
344 IDB_TRACE("IDBRequest::onSuccess(int64_t)"); | 344 IDB_TRACE("IDBRequest::onSuccess(int64_t)"); |
345 if (!ShouldEnqueueEvent()) | 345 if (!ShouldEnqueueEvent()) |
346 return; | 346 return; |
347 EnqueueResultInternal(IDBAny::Create(value)); | 347 EnqueueResultInternal(IDBAny::Create(value)); |
348 } | 348 } |
349 | 349 |
350 void IDBRequest::EnqueueResponse() { | 350 void IDBRequest::EnqueueResponse() { |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
436 // this object to actually hold a reference to the database (to ensure | 436 // this object to actually hold a reference to the database (to ensure |
437 // it stays alive). | 437 // it stays alive). |
438 targets.push_back(transaction_->db()); | 438 targets.push_back(transaction_->db()); |
439 } | 439 } |
440 | 440 |
441 // Cursor properties should not be updated until the success event is being | 441 // Cursor properties should not be updated until the success event is being |
442 // dispatched. | 442 // dispatched. |
443 IDBCursor* cursor_to_notify = nullptr; | 443 IDBCursor* cursor_to_notify = nullptr; |
444 if (event->type() == EventTypeNames::success) { | 444 if (event->type() == EventTypeNames::success) { |
445 cursor_to_notify = GetResultCursor(); | 445 cursor_to_notify = GetResultCursor(); |
446 if (cursor_to_notify) | 446 if (cursor_to_notify) { |
447 cursor_to_notify->SetValueReady(cursor_key_.Release(), | 447 cursor_to_notify->SetValueReady(cursor_key_.Release(), |
448 cursor_primary_key_.Release(), | 448 cursor_primary_key_.Release(), |
449 cursor_value_.Release()); | 449 std::move(cursor_value_)); |
| 450 } |
450 } | 451 } |
451 | 452 |
452 if (event->type() == EventTypeNames::upgradeneeded) { | 453 if (event->type() == EventTypeNames::upgradeneeded) { |
453 DCHECK(!did_fire_upgrade_needed_event_); | 454 DCHECK(!did_fire_upgrade_needed_event_); |
454 did_fire_upgrade_needed_event_ = true; | 455 did_fire_upgrade_needed_event_ = true; |
455 } | 456 } |
456 | 457 |
457 // FIXME: When we allow custom event dispatching, this will probably need to | 458 // FIXME: When we allow custom event dispatching, this will probably need to |
458 // change. | 459 // change. |
459 DCHECK(event->type() == EventTypeNames::success || | 460 DCHECK(event->type() == EventTypeNames::success || |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
553 } | 554 } |
554 | 555 |
555 void IDBRequest::DequeueEvent(Event* event) { | 556 void IDBRequest::DequeueEvent(Event* event) { |
556 for (size_t i = 0; i < enqueued_events_.size(); ++i) { | 557 for (size_t i = 0; i < enqueued_events_.size(); ++i) { |
557 if (enqueued_events_[i].Get() == event) | 558 if (enqueued_events_[i].Get() == event) |
558 enqueued_events_.erase(i); | 559 enqueued_events_.erase(i); |
559 } | 560 } |
560 } | 561 } |
561 | 562 |
562 } // namespace blink | 563 } // namespace blink |
OLD | NEW |