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

Side by Side Diff: third_party/WebKit/Source/modules/indexeddb/IDBRequest.cpp

Issue 2828953002: [IndexedDB] Hold referenced to IDB::put blobs in the IDBRequest (Closed)
Patch Set: compile fix Created 3 years, 7 months 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
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 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 DCHECK(ready_state_ == PENDING || ready_state_ == DONE); 234 DCHECK(ready_state_ == PENDING || ready_state_ == DONE);
235 if (request_aborted_) 235 if (request_aborted_)
236 return false; 236 return false;
237 DCHECK_EQ(ready_state_, PENDING); 237 DCHECK_EQ(ready_state_, PENDING);
238 DCHECK(!error_ && !result_); 238 DCHECK(!error_ && !result_);
239 return true; 239 return true;
240 } 240 }
241 241
242 void IDBRequest::OnError(DOMException* error) { 242 void IDBRequest::OnError(DOMException* error) {
243 IDB_TRACE("IDBRequest::onError()"); 243 IDB_TRACE("IDBRequest::onError()");
244 ClearTransitBlobHandles();
244 if (!ShouldEnqueueEvent()) 245 if (!ShouldEnqueueEvent())
245 return; 246 return;
246 247
247 error_ = error; 248 error_ = error;
248 SetResult(IDBAny::CreateUndefined()); 249 SetResult(IDBAny::CreateUndefined());
249 pending_cursor_.Clear(); 250 pending_cursor_.Clear();
250 EnqueueEvent(Event::CreateCancelableBubble(EventTypeNames::error)); 251 EnqueueEvent(Event::CreateCancelableBubble(EventTypeNames::error));
251 } 252 }
252 253
253 void IDBRequest::OnSuccess(const Vector<String>& string_list) { 254 void IDBRequest::OnSuccess(const Vector<String>& string_list) {
(...skipping 28 matching lines...) Expand all
282 this, source_.Get(), transaction_.Get()); 283 this, source_.Get(), transaction_.Get());
283 break; 284 break;
284 default: 285 default:
285 NOTREACHED(); 286 NOTREACHED();
286 } 287 }
287 SetResultCursor(cursor, key, primary_key, std::move(value)); 288 SetResultCursor(cursor, key, primary_key, std::move(value));
288 } 289 }
289 290
290 void IDBRequest::OnSuccess(IDBKey* idb_key) { 291 void IDBRequest::OnSuccess(IDBKey* idb_key) {
291 IDB_TRACE("IDBRequest::onSuccess(IDBKey)"); 292 IDB_TRACE("IDBRequest::onSuccess(IDBKey)");
293 ClearTransitBlobHandles();
michaeln 2017/04/25 23:37:00 There are many OnSuccess variants, no doubt this i
dmurph 2017/04/27 22:04:12 Done.
292 if (!ShouldEnqueueEvent()) 294 if (!ShouldEnqueueEvent())
293 return; 295 return;
294 296
295 if (idb_key && idb_key->IsValid()) 297 if (idb_key && idb_key->IsValid())
296 OnSuccessInternal(IDBAny::Create(idb_key)); 298 OnSuccessInternal(IDBAny::Create(idb_key));
297 else 299 else
298 OnSuccessInternal(IDBAny::CreateUndefined()); 300 OnSuccessInternal(IDBAny::CreateUndefined());
299 } 301 }
300 302
301 void IDBRequest::OnSuccess(const Vector<RefPtr<IDBValue>>& values) { 303 void IDBRequest::OnSuccess(const Vector<RefPtr<IDBValue>>& values) {
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
553 } 555 }
554 556
555 void IDBRequest::DequeueEvent(Event* event) { 557 void IDBRequest::DequeueEvent(Event* event) {
556 for (size_t i = 0; i < enqueued_events_.size(); ++i) { 558 for (size_t i = 0; i < enqueued_events_.size(); ++i) {
557 if (enqueued_events_[i].Get() == event) 559 if (enqueued_events_[i].Get() == event)
558 enqueued_events_.erase(i); 560 enqueued_events_.erase(i);
559 } 561 }
560 } 562 }
561 563
562 } // namespace blink 564 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698