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

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

Issue 2366253002: Remove ActiveDOMObject::stop() (Closed)
Patch Set: temp Created 4 years, 2 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 487 matching lines...) Expand 10 before | Expand all | Expand 10 after
498 m_metadata.objectStores.find(objectStoreId); 498 m_metadata.objectStores.find(objectStoreId);
499 it->value.name = newName; 499 it->value.name = newName;
500 } 500 }
501 501
502 bool IDBDatabase::hasPendingActivity() const { 502 bool IDBDatabase::hasPendingActivity() const {
503 // The script wrapper must not be collected before the object is closed or 503 // The script wrapper must not be collected before the object is closed or
504 // we can't fire a "versionchange" event to let script manually close the conn ection. 504 // we can't fire a "versionchange" event to let script manually close the conn ection.
505 return !m_closePending && hasEventListeners() && !m_contextStopped; 505 return !m_closePending && hasEventListeners() && !m_contextStopped;
506 } 506 }
507 507
508 void IDBDatabase::stop() { 508 void IDBDatabase::contextDestroyed() {
509 m_contextStopped = true; 509 m_contextStopped = true;
510 510
511 // Immediately close the connection to the back end. Don't attempt a 511 // Immediately close the connection to the back end. Don't attempt a
512 // normal close() since that may wait on transactions which require a 512 // normal close() since that may wait on transactions which require a
513 // round trip to the back-end to abort. 513 // round trip to the back-end to abort.
514 if (m_backend) { 514 if (m_backend) {
515 m_backend->close(); 515 m_backend->close();
516 m_backend.reset(); 516 m_backend.reset();
517 } 517 }
518 } 518 }
519 519
520 const AtomicString& IDBDatabase::interfaceName() const { 520 const AtomicString& IDBDatabase::interfaceName() const {
521 return EventTargetNames::IDBDatabase; 521 return EventTargetNames::IDBDatabase;
522 } 522 }
523 523
524 ExecutionContext* IDBDatabase::getExecutionContext() const { 524 ExecutionContext* IDBDatabase::getExecutionContext() const {
525 return ActiveDOMObject::getExecutionContext(); 525 return ActiveDOMObject::getExecutionContext();
526 } 526 }
527 527
528 void IDBDatabase::recordApiCallsHistogram(IndexedDatabaseMethods method) { 528 void IDBDatabase::recordApiCallsHistogram(IndexedDatabaseMethods method) {
529 DEFINE_THREAD_SAFE_STATIC_LOCAL( 529 DEFINE_THREAD_SAFE_STATIC_LOCAL(
530 EnumerationHistogram, apiCallsHistogram, 530 EnumerationHistogram, apiCallsHistogram,
531 new EnumerationHistogram("WebCore.IndexedDB.FrontEndAPICalls", 531 new EnumerationHistogram("WebCore.IndexedDB.FrontEndAPICalls",
532 IDBMethodsMax)); 532 IDBMethodsMax));
533 apiCallsHistogram.count(method); 533 apiCallsHistogram.count(method);
534 } 534 }
535 535
536 } // namespace blink 536 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698