| 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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 IDBDatabaseCallbacks* callbacks) { | 94 IDBDatabaseCallbacks* callbacks) { |
| 95 IDBDatabase* idbDatabase = | 95 IDBDatabase* idbDatabase = |
| 96 new IDBDatabase(context, std::move(database), callbacks); | 96 new IDBDatabase(context, std::move(database), callbacks); |
| 97 idbDatabase->suspendIfNeeded(); | 97 idbDatabase->suspendIfNeeded(); |
| 98 return idbDatabase; | 98 return idbDatabase; |
| 99 } | 99 } |
| 100 | 100 |
| 101 IDBDatabase::IDBDatabase(ExecutionContext* context, | 101 IDBDatabase::IDBDatabase(ExecutionContext* context, |
| 102 std::unique_ptr<WebIDBDatabase> backend, | 102 std::unique_ptr<WebIDBDatabase> backend, |
| 103 IDBDatabaseCallbacks* callbacks) | 103 IDBDatabaseCallbacks* callbacks) |
| 104 : ActiveScriptWrappable(this), | 104 : SuspendableObject(context), |
| 105 SuspendableObject(context), | |
| 106 m_backend(std::move(backend)), | 105 m_backend(std::move(backend)), |
| 107 m_databaseCallbacks(callbacks) { | 106 m_databaseCallbacks(callbacks) { |
| 108 m_databaseCallbacks->connect(this); | 107 m_databaseCallbacks->connect(this); |
| 109 } | 108 } |
| 110 | 109 |
| 111 IDBDatabase::~IDBDatabase() { | 110 IDBDatabase::~IDBDatabase() { |
| 112 if (!m_closePending && m_backend) | 111 if (!m_closePending && m_backend) |
| 113 m_backend->close(); | 112 m_backend->close(); |
| 114 } | 113 } |
| 115 | 114 |
| (...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 584 | 583 |
| 585 void IDBDatabase::recordApiCallsHistogram(IndexedDatabaseMethods method) { | 584 void IDBDatabase::recordApiCallsHistogram(IndexedDatabaseMethods method) { |
| 586 DEFINE_THREAD_SAFE_STATIC_LOCAL( | 585 DEFINE_THREAD_SAFE_STATIC_LOCAL( |
| 587 EnumerationHistogram, apiCallsHistogram, | 586 EnumerationHistogram, apiCallsHistogram, |
| 588 new EnumerationHistogram("WebCore.IndexedDB.FrontEndAPICalls", | 587 new EnumerationHistogram("WebCore.IndexedDB.FrontEndAPICalls", |
| 589 IDBMethodsMax)); | 588 IDBMethodsMax)); |
| 590 apiCallsHistogram.count(method); | 589 apiCallsHistogram.count(method); |
| 591 } | 590 } |
| 592 | 591 |
| 593 } // namespace blink | 592 } // namespace blink |
| OLD | NEW |