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

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

Issue 1479923002: Enumerate the return value of dispatchEvent so it is clear. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master_passive_uma_add
Patch Set: Rebase Created 5 years 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 379 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 void IDBDatabase::enqueueEvent(PassRefPtrWillBeRawPtr<Event> event) 390 void IDBDatabase::enqueueEvent(PassRefPtrWillBeRawPtr<Event> event)
391 { 391 {
392 ASSERT(!m_contextStopped); 392 ASSERT(!m_contextStopped);
393 ASSERT(executionContext()); 393 ASSERT(executionContext());
394 EventQueue* eventQueue = executionContext()->eventQueue(); 394 EventQueue* eventQueue = executionContext()->eventQueue();
395 event->setTarget(this); 395 event->setTarget(this);
396 eventQueue->enqueueEvent(event.get()); 396 eventQueue->enqueueEvent(event.get());
397 m_enqueuedEvents.append(event); 397 m_enqueuedEvents.append(event);
398 } 398 }
399 399
400 bool IDBDatabase::dispatchEventInternal(PassRefPtrWillBeRawPtr<Event> event) 400 WebInputEventResult IDBDatabase::dispatchEventInternal(PassRefPtrWillBeRawPtr<Ev ent> event)
401 { 401 {
402 IDB_TRACE("IDBDatabase::dispatchEvent"); 402 IDB_TRACE("IDBDatabase::dispatchEvent");
403 if (m_contextStopped || !executionContext()) 403 if (m_contextStopped || !executionContext())
404 return false; 404 return WebInputEventResult::HandledSuppressed;
405 ASSERT(event->type() == EventTypeNames::versionchange || event->type() == Ev entTypeNames::close); 405 ASSERT(event->type() == EventTypeNames::versionchange || event->type() == Ev entTypeNames::close);
406 for (size_t i = 0; i < m_enqueuedEvents.size(); ++i) { 406 for (size_t i = 0; i < m_enqueuedEvents.size(); ++i) {
407 if (m_enqueuedEvents[i].get() == event.get()) 407 if (m_enqueuedEvents[i].get() == event.get())
408 m_enqueuedEvents.remove(i); 408 m_enqueuedEvents.remove(i);
409 } 409 }
410 410
411 bool result = EventTarget::dispatchEventInternal(event.get()); 411 WebInputEventResult result = EventTarget::dispatchEventInternal(event.get()) ;
412 if (event->type() == EventTypeNames::versionchange && !m_closePending && m_b ackend) 412 if (event->type() == EventTypeNames::versionchange && !m_closePending && m_b ackend)
413 m_backend->versionChangeIgnored(); 413 m_backend->versionChangeIgnored();
414 return result; 414 return result;
415 } 415 }
416 416
417 int64_t IDBDatabase::findObjectStoreId(const String& name) const 417 int64_t IDBDatabase::findObjectStoreId(const String& name) const
418 { 418 {
419 for (const auto& it : m_metadata.objectStores) { 419 for (const auto& it : m_metadata.objectStores) {
420 if (it.value.name == name) { 420 if (it.value.name == name) {
421 ASSERT(it.key != IDBObjectStoreMetadata::InvalidId); 421 ASSERT(it.key != IDBObjectStoreMetadata::InvalidId);
(...skipping 27 matching lines...) Expand all
449 { 449 {
450 return EventTargetNames::IDBDatabase; 450 return EventTargetNames::IDBDatabase;
451 } 451 }
452 452
453 ExecutionContext* IDBDatabase::executionContext() const 453 ExecutionContext* IDBDatabase::executionContext() const
454 { 454 {
455 return ActiveDOMObject::executionContext(); 455 return ActiveDOMObject::executionContext();
456 } 456 }
457 457
458 } // namespace blink 458 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698