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

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

Issue 1686483002: Oilpan: Remove most WillBe types from the code base (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 m_pendingCursor.clear(); 232 m_pendingCursor.clear();
233 enqueueEvent(Event::createCancelableBubble(EventTypeNames::error)); 233 enqueueEvent(Event::createCancelableBubble(EventTypeNames::error));
234 } 234 }
235 235
236 void IDBRequest::onSuccess(const Vector<String>& stringList) 236 void IDBRequest::onSuccess(const Vector<String>& stringList)
237 { 237 {
238 IDB_TRACE("IDBRequest::onSuccess(StringList)"); 238 IDB_TRACE("IDBRequest::onSuccess(StringList)");
239 if (!shouldEnqueueEvent()) 239 if (!shouldEnqueueEvent())
240 return; 240 return;
241 241
242 RefPtrWillBeRawPtr<DOMStringList> domStringList = DOMStringList::create(DOMS tringList::IndexedDB); 242 RawPtr<DOMStringList> domStringList = DOMStringList::create(DOMStringList::I ndexedDB);
243 for (size_t i = 0; i < stringList.size(); ++i) 243 for (size_t i = 0; i < stringList.size(); ++i)
244 domStringList->append(stringList[i]); 244 domStringList->append(stringList[i]);
245 onSuccessInternal(IDBAny::create(domStringList.release())); 245 onSuccessInternal(IDBAny::create(domStringList.release()));
246 } 246 }
247 247
248 void IDBRequest::onSuccess(PassOwnPtr<WebIDBCursor> backend, IDBKey* key, IDBKey * primaryKey, PassRefPtr<IDBValue> value) 248 void IDBRequest::onSuccess(PassOwnPtr<WebIDBCursor> backend, IDBKey* key, IDBKey * primaryKey, PassRefPtr<IDBValue> value)
249 { 249 {
250 IDB_TRACE("IDBRequest::onSuccess(IDBCursor)"); 250 IDB_TRACE("IDBRequest::onSuccess(IDBCursor)");
251 if (!shouldEnqueueEvent()) 251 if (!shouldEnqueueEvent())
252 return; 252 return;
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
403 const AtomicString& IDBRequest::interfaceName() const 403 const AtomicString& IDBRequest::interfaceName() const
404 { 404 {
405 return EventTargetNames::IDBRequest; 405 return EventTargetNames::IDBRequest;
406 } 406 }
407 407
408 ExecutionContext* IDBRequest::executionContext() const 408 ExecutionContext* IDBRequest::executionContext() const
409 { 409 {
410 return ActiveDOMObject::executionContext(); 410 return ActiveDOMObject::executionContext();
411 } 411 }
412 412
413 bool IDBRequest::dispatchEventInternal(PassRefPtrWillBeRawPtr<Event> event) 413 bool IDBRequest::dispatchEventInternal(RawPtr<Event> event)
414 { 414 {
415 IDB_TRACE("IDBRequest::dispatchEvent"); 415 IDB_TRACE("IDBRequest::dispatchEvent");
416 if (m_contextStopped || !executionContext()) 416 if (m_contextStopped || !executionContext())
417 return false; 417 return false;
418 ASSERT(m_readyState == PENDING); 418 ASSERT(m_readyState == PENDING);
419 ASSERT(m_hasPendingActivity); 419 ASSERT(m_hasPendingActivity);
420 ASSERT(m_enqueuedEvents.size()); 420 ASSERT(m_enqueuedEvents.size());
421 ASSERT(event->target() == this); 421 ASSERT(event->target() == this);
422 422
423 ScriptState::Scope scope(m_scriptState.get()); 423 ScriptState::Scope scope(m_scriptState.get());
424 424
425 if (event->type() != EventTypeNames::blocked) 425 if (event->type() != EventTypeNames::blocked)
426 m_readyState = DONE; 426 m_readyState = DONE;
427 dequeueEvent(event.get()); 427 dequeueEvent(event.get());
428 428
429 WillBeHeapVector<RefPtrWillBeMember<EventTarget>> targets; 429 HeapVector<Member<EventTarget>> targets;
430 targets.append(this); 430 targets.append(this);
431 if (m_transaction && !m_preventPropagation) { 431 if (m_transaction && !m_preventPropagation) {
432 targets.append(m_transaction); 432 targets.append(m_transaction);
433 // If there ever are events that are associated with a database but 433 // If there ever are events that are associated with a database but
434 // that do not have a transaction, then this will not work and we need 434 // that do not have a transaction, then this will not work and we need
435 // this object to actually hold a reference to the database (to ensure 435 // this object to actually hold a reference to the database (to ensure
436 // it stays alive). 436 // it stays alive).
437 targets.append(m_transaction->db()); 437 targets.append(m_transaction->db());
438 } 438 }
439 439
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
502 ASSERT(m_readyState == DONE); 502 ASSERT(m_readyState == DONE);
503 ASSERT(executionContext()); 503 ASSERT(executionContext());
504 m_transaction.clear(); 504 m_transaction.clear();
505 505
506 if (m_contextStopped) 506 if (m_contextStopped)
507 return; 507 return;
508 508
509 m_readyState = PENDING; 509 m_readyState = PENDING;
510 } 510 }
511 511
512 void IDBRequest::enqueueEvent(PassRefPtrWillBeRawPtr<Event> event) 512 void IDBRequest::enqueueEvent(RawPtr<Event> event)
513 { 513 {
514 ASSERT(m_readyState == PENDING || m_readyState == DONE); 514 ASSERT(m_readyState == PENDING || m_readyState == DONE);
515 515
516 if (m_contextStopped || !executionContext()) 516 if (m_contextStopped || !executionContext())
517 return; 517 return;
518 518
519 ASSERT_WITH_MESSAGE(m_readyState == PENDING || m_didFireUpgradeNeededEvent, "When queueing event %s, m_readyState was %d", event->type().utf8().data(), m_re adyState); 519 ASSERT_WITH_MESSAGE(m_readyState == PENDING || m_didFireUpgradeNeededEvent, "When queueing event %s, m_readyState was %d", event->type().utf8().data(), m_re adyState);
520 520
521 EventQueue* eventQueue = executionContext()->eventQueue(); 521 EventQueue* eventQueue = executionContext()->eventQueue();
522 event->setTarget(this); 522 event->setTarget(this);
523 523
524 // Keep track of enqueued events in case we need to abort prior to dispatch, 524 // Keep track of enqueued events in case we need to abort prior to dispatch,
525 // in which case these must be cancelled. If the events not dispatched for 525 // in which case these must be cancelled. If the events not dispatched for
526 // other reasons they must be removed from this list via dequeueEvent(). 526 // other reasons they must be removed from this list via dequeueEvent().
527 if (eventQueue->enqueueEvent(event.get())) 527 if (eventQueue->enqueueEvent(event.get()))
528 m_enqueuedEvents.append(event); 528 m_enqueuedEvents.append(event);
529 } 529 }
530 530
531 void IDBRequest::dequeueEvent(Event* event) 531 void IDBRequest::dequeueEvent(Event* event)
532 { 532 {
533 for (size_t i = 0; i < m_enqueuedEvents.size(); ++i) { 533 for (size_t i = 0; i < m_enqueuedEvents.size(); ++i) {
534 if (m_enqueuedEvents[i].get() == event) 534 if (m_enqueuedEvents[i].get() == event)
535 m_enqueuedEvents.remove(i); 535 m_enqueuedEvents.remove(i);
536 } 536 }
537 } 537 }
538 538
539 } // namespace blink 539 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698