| 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 : ActiveScriptWrappable(), |
| 105 SuspendableObject(context), | 105 SuspendableObject(context), |
| 106 m_backend(std::move(backend)), | 106 m_backend(std::move(backend)), |
| 107 m_databaseCallbacks(callbacks) { | 107 m_databaseCallbacks(callbacks) { |
| 108 m_databaseCallbacks->connect(this); | 108 m_databaseCallbacks->connect(this); |
| 109 } | 109 } |
| 110 | 110 |
| 111 IDBDatabase::~IDBDatabase() { | 111 IDBDatabase::~IDBDatabase() { |
| 112 if (!m_closePending && m_backend) | 112 if (!m_closePending && m_backend) |
| 113 m_backend->close(); | 113 m_backend->close(); |
| 114 } | 114 } |
| (...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 584 | 584 |
| 585 void IDBDatabase::recordApiCallsHistogram(IndexedDatabaseMethods method) { | 585 void IDBDatabase::recordApiCallsHistogram(IndexedDatabaseMethods method) { |
| 586 DEFINE_THREAD_SAFE_STATIC_LOCAL( | 586 DEFINE_THREAD_SAFE_STATIC_LOCAL( |
| 587 EnumerationHistogram, apiCallsHistogram, | 587 EnumerationHistogram, apiCallsHistogram, |
| 588 new EnumerationHistogram("WebCore.IndexedDB.FrontEndAPICalls", | 588 new EnumerationHistogram("WebCore.IndexedDB.FrontEndAPICalls", |
| 589 IDBMethodsMax)); | 589 IDBMethodsMax)); |
| 590 apiCallsHistogram.count(method); | 590 apiCallsHistogram.count(method); |
| 591 } | 591 } |
| 592 | 592 |
| 593 } // namespace blink | 593 } // namespace blink |
| OLD | NEW |