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

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

Issue 213073004: Protecting against other possible uses of invalid V8 execution context. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Noted in description that fix is speculative. Created 6 years, 9 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 | « no previous file | Source/modules/indexeddb/IDBTransaction.cpp » ('j') | 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 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
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(PassRefPtr<Event> event)
380 { 380 {
381 IDB_TRACE("IDBDatabase::dispatchEvent"); 381 IDB_TRACE("IDBDatabase::dispatchEvent");
382 if (m_contextStopped || !executionContext())
383 return false;
382 ASSERT(event->type() == EventTypeNames::versionchange || event->type() == Ev entTypeNames::close); 384 ASSERT(event->type() == EventTypeNames::versionchange || event->type() == Ev entTypeNames::close);
383 for (size_t i = 0; i < m_enqueuedEvents.size(); ++i) { 385 for (size_t i = 0; i < m_enqueuedEvents.size(); ++i) {
384 if (m_enqueuedEvents[i].get() == event.get()) 386 if (m_enqueuedEvents[i].get() == event.get())
385 m_enqueuedEvents.remove(i); 387 m_enqueuedEvents.remove(i);
386 } 388 }
387 return EventTarget::dispatchEvent(event.get()); 389 return EventTarget::dispatchEvent(event.get());
388 } 390 }
389 391
390 int64_t IDBDatabase::findObjectStoreId(const String& name) const 392 int64_t IDBDatabase::findObjectStoreId(const String& name) const
391 { 393 {
(...skipping 30 matching lines...) Expand all
422 { 424 {
423 return EventTargetNames::IDBDatabase; 425 return EventTargetNames::IDBDatabase;
424 } 426 }
425 427
426 ExecutionContext* IDBDatabase::executionContext() const 428 ExecutionContext* IDBDatabase::executionContext() const
427 { 429 {
428 return ActiveDOMObject::executionContext(); 430 return ActiveDOMObject::executionContext();
429 } 431 }
430 432
431 } // namespace WebCore 433 } // namespace WebCore
OLDNEW
« no previous file with comments | « no previous file | Source/modules/indexeddb/IDBTransaction.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698