| OLD | NEW |
| 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 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 closeConnection(); | 336 closeConnection(); |
| 337 } | 337 } |
| 338 | 338 |
| 339 void IDBDatabase::closeConnection() | 339 void IDBDatabase::closeConnection() |
| 340 { | 340 { |
| 341 ASSERT(m_closePending); | 341 ASSERT(m_closePending); |
| 342 ASSERT(m_transactions.isEmpty()); | 342 ASSERT(m_transactions.isEmpty()); |
| 343 | 343 |
| 344 if (m_backend) { | 344 if (m_backend) { |
| 345 m_backend->close(); | 345 m_backend->close(); |
| 346 m_backend.clear(); | 346 m_backend.reset(); |
| 347 } | 347 } |
| 348 | 348 |
| 349 if (m_contextStopped || !getExecutionContext()) | 349 if (m_contextStopped || !getExecutionContext()) |
| 350 return; | 350 return; |
| 351 | 351 |
| 352 EventQueue* eventQueue = getExecutionContext()->getEventQueue(); | 352 EventQueue* eventQueue = getExecutionContext()->getEventQueue(); |
| 353 // Remove any pending versionchange events scheduled to fire on this | 353 // Remove any pending versionchange events scheduled to fire on this |
| 354 // connection. They would have been scheduled by the backend when another | 354 // connection. They would have been scheduled by the backend when another |
| 355 // connection attempted an upgrade, but the frontend connection is being | 355 // connection attempted an upgrade, but the frontend connection is being |
| 356 // closed before they could fire. | 356 // closed before they could fire. |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 425 | 425 |
| 426 void IDBDatabase::stop() | 426 void IDBDatabase::stop() |
| 427 { | 427 { |
| 428 m_contextStopped = true; | 428 m_contextStopped = true; |
| 429 | 429 |
| 430 // Immediately close the connection to the back end. Don't attempt a | 430 // Immediately close the connection to the back end. Don't attempt a |
| 431 // normal close() since that may wait on transactions which require a | 431 // normal close() since that may wait on transactions which require a |
| 432 // round trip to the back-end to abort. | 432 // round trip to the back-end to abort. |
| 433 if (m_backend) { | 433 if (m_backend) { |
| 434 m_backend->close(); | 434 m_backend->close(); |
| 435 m_backend.clear(); | 435 m_backend.reset(); |
| 436 } | 436 } |
| 437 } | 437 } |
| 438 | 438 |
| 439 const AtomicString& IDBDatabase::interfaceName() const | 439 const AtomicString& IDBDatabase::interfaceName() const |
| 440 { | 440 { |
| 441 return EventTargetNames::IDBDatabase; | 441 return EventTargetNames::IDBDatabase; |
| 442 } | 442 } |
| 443 | 443 |
| 444 ExecutionContext* IDBDatabase::getExecutionContext() const | 444 ExecutionContext* IDBDatabase::getExecutionContext() const |
| 445 { | 445 { |
| 446 return ActiveDOMObject::getExecutionContext(); | 446 return ActiveDOMObject::getExecutionContext(); |
| 447 } | 447 } |
| 448 | 448 |
| 449 void IDBDatabase::recordApiCallsHistogram(IndexedDatabaseMethods method) | 449 void IDBDatabase::recordApiCallsHistogram(IndexedDatabaseMethods method) |
| 450 { | 450 { |
| 451 DEFINE_THREAD_SAFE_STATIC_LOCAL(EnumerationHistogram, apiCallsHistogram, new
EnumerationHistogram("WebCore.IndexedDB.FrontEndAPICalls", IDBMethodsMax)); | 451 DEFINE_THREAD_SAFE_STATIC_LOCAL(EnumerationHistogram, apiCallsHistogram, new
EnumerationHistogram("WebCore.IndexedDB.FrontEndAPICalls", IDBMethodsMax)); |
| 452 apiCallsHistogram.count(method); | 452 apiCallsHistogram.count(method); |
| 453 } | 453 } |
| 454 | 454 |
| 455 } // namespace blink | 455 } // namespace blink |
| OLD | NEW |