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

Side by Side Diff: Source/WebCore/Modules/indexeddb/IDBRequest.cpp

Issue 10007047: Merge 112740 - IndexedDB: Race condition causes version change transaction to commit after onblocked (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1084/
Patch Set: Created 8 years, 8 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
« no previous file with comments | « LayoutTests/storage/indexeddb/resources/dont-commit-on-blocked-worker.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 360 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 ASSERT(event->type() == eventNames().successEvent || event->type() == eventN ames().errorEvent || event->type() == eventNames().blockedEvent); 371 ASSERT(event->type() == eventNames().successEvent || event->type() == eventN ames().errorEvent || event->type() == eventNames().blockedEvent);
372 bool dontPreventDefault = IDBEventDispatcher::dispatch(event.get(), targets) ; 372 bool dontPreventDefault = IDBEventDispatcher::dispatch(event.get(), targets) ;
373 373
374 // If the result was of type IDBCursor, or a onBlocked event, then we'll fir e again. 374 // If the result was of type IDBCursor, or a onBlocked event, then we'll fir e again.
375 if (event->type() != eventNames().blockedEvent && (!cursorToNotify || m_curs orFinished)) 375 if (event->type() != eventNames().blockedEvent && (!cursorToNotify || m_curs orFinished))
376 m_requestFinished = true; 376 m_requestFinished = true;
377 377
378 if (cursorToNotify) 378 if (cursorToNotify)
379 cursorToNotify->postSuccessHandlerCallback(); 379 cursorToNotify->postSuccessHandlerCallback();
380 380
381 if (m_transaction) { 381 if (m_transaction && event->type() != eventNames().blockedEvent) {
382 // If an error event and the default wasn't prevented... 382 // If an error event and the default wasn't prevented...
383 if (dontPreventDefault && event->type() == eventNames().errorEvent) 383 if (dontPreventDefault && event->type() == eventNames().errorEvent)
384 m_transaction->backend()->abort(); 384 m_transaction->backend()->abort();
385 m_transaction->backend()->didCompleteTaskEvents(); 385 m_transaction->backend()->didCompleteTaskEvents();
386 } 386 }
387 return dontPreventDefault; 387 return dontPreventDefault;
388 } 388 }
389 389
390 void IDBRequest::uncaughtExceptionInEventHandler() 390 void IDBRequest::uncaughtExceptionInEventHandler()
391 { 391 {
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
425 m_result = IDBAny::create(prpCursor); 425 m_result = IDBAny::create(prpCursor);
426 return; 426 return;
427 } 427 }
428 428
429 m_result = IDBAny::create(IDBCursorWithValue::fromCursor(prpCursor)); 429 m_result = IDBAny::create(IDBCursorWithValue::fromCursor(prpCursor));
430 } 430 }
431 431
432 } // namespace WebCore 432 } // namespace WebCore
433 433
434 #endif 434 #endif
OLDNEW
« no previous file with comments | « LayoutTests/storage/indexeddb/resources/dont-commit-on-blocked-worker.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698