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

Side by Side Diff: Source/modules/indexeddb/IDBDatabase.cpp

Issue 216523002: Oilpan: Replace most of RefPtrs for Event objects with oilpan's transition types (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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 | Annotate | Revision Log
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 348 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 if (m_contextStopped || !executionContext()) 359 if (m_contextStopped || !executionContext())
360 return; 360 return;
361 361
362 if (m_closePending) 362 if (m_closePending)
363 return; 363 return;
364 364
365 Nullable<unsigned long long> newVersionNullable = (newVersion == IDBDatabase Metadata::NoIntVersion) ? Nullable<unsigned long long>() : Nullable<unsigned lon g long>(newVersion); 365 Nullable<unsigned long long> newVersionNullable = (newVersion == IDBDatabase Metadata::NoIntVersion) ? Nullable<unsigned long long>() : Nullable<unsigned lon g long>(newVersion);
366 enqueueEvent(IDBVersionChangeEvent::create(EventTypeNames::versionchange, ol dVersion, newVersionNullable)); 366 enqueueEvent(IDBVersionChangeEvent::create(EventTypeNames::versionchange, ol dVersion, newVersionNullable));
367 } 367 }
368 368
369 void IDBDatabase::enqueueEvent(PassRefPtr<Event> event) 369 void IDBDatabase::enqueueEvent(PassRefPtrWillBeRawPtr<Event> event)
370 { 370 {
371 ASSERT(!m_contextStopped); 371 ASSERT(!m_contextStopped);
372 ASSERT(executionContext()); 372 ASSERT(executionContext());
373 EventQueue* eventQueue = executionContext()->eventQueue(); 373 EventQueue* eventQueue = executionContext()->eventQueue();
374 event->setTarget(this); 374 event->setTarget(this);
375 eventQueue->enqueueEvent(event.get()); 375 eventQueue->enqueueEvent(event.get());
376 m_enqueuedEvents.append(event); 376 m_enqueuedEvents.append(event);
377 } 377 }
378 378
379 bool IDBDatabase::dispatchEvent(PassRefPtr<Event> event) 379 bool IDBDatabase::dispatchEvent(PassRefPtrWillBeRawPtr<Event> event)
380 { 380 {
381 IDB_TRACE("IDBDatabase::dispatchEvent"); 381 IDB_TRACE("IDBDatabase::dispatchEvent");
382 if (m_contextStopped || !executionContext()) 382 if (m_contextStopped || !executionContext())
383 return false; 383 return false;
384 ASSERT(event->type() == EventTypeNames::versionchange || event->type() == Ev entTypeNames::close); 384 ASSERT(event->type() == EventTypeNames::versionchange || event->type() == Ev entTypeNames::close);
385 for (size_t i = 0; i < m_enqueuedEvents.size(); ++i) { 385 for (size_t i = 0; i < m_enqueuedEvents.size(); ++i) {
386 if (m_enqueuedEvents[i].get() == event.get()) 386 if (m_enqueuedEvents[i].get() == event.get())
387 m_enqueuedEvents.remove(i); 387 m_enqueuedEvents.remove(i);
388 } 388 }
389 return EventTarget::dispatchEvent(event.get()); 389 return EventTarget::dispatchEvent(event.get());
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 { 424 {
425 return EventTargetNames::IDBDatabase; 425 return EventTargetNames::IDBDatabase;
426 } 426 }
427 427
428 ExecutionContext* IDBDatabase::executionContext() const 428 ExecutionContext* IDBDatabase::executionContext() const
429 { 429 {
430 return ActiveDOMObject::executionContext(); 430 return ActiveDOMObject::executionContext();
431 } 431 }
432 432
433 } // namespace WebCore 433 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698