| 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 const char IDBDatabase::databaseClosedErrorMessage[] = "The database connection
is closed."; | 67 const char IDBDatabase::databaseClosedErrorMessage[] = "The database connection
is closed."; |
| 68 | 68 |
| 69 IDBDatabase* IDBDatabase::create(ExecutionContext* context, PassOwnPtr<WebIDBDat
abase> database, IDBDatabaseCallbacks* callbacks) | 69 IDBDatabase* IDBDatabase::create(ExecutionContext* context, PassOwnPtr<WebIDBDat
abase> database, IDBDatabaseCallbacks* callbacks) |
| 70 { | 70 { |
| 71 IDBDatabase* idbDatabase = new IDBDatabase(context, database, callbacks); | 71 IDBDatabase* idbDatabase = new IDBDatabase(context, database, callbacks); |
| 72 idbDatabase->suspendIfNeeded(); | 72 idbDatabase->suspendIfNeeded(); |
| 73 return idbDatabase; | 73 return idbDatabase; |
| 74 } | 74 } |
| 75 | 75 |
| 76 IDBDatabase::IDBDatabase(ExecutionContext* context, PassOwnPtr<WebIDBDatabase> b
ackend, IDBDatabaseCallbacks* callbacks) | 76 IDBDatabase::IDBDatabase(ExecutionContext* context, PassOwnPtr<WebIDBDatabase> b
ackend, IDBDatabaseCallbacks* callbacks) |
| 77 : ActiveDOMObject(context) | 77 : ActiveScriptWrappable(this) |
| 78 , ActiveDOMObject(context) |
| 78 , m_backend(backend) | 79 , m_backend(backend) |
| 79 , m_databaseCallbacks(callbacks) | 80 , m_databaseCallbacks(callbacks) |
| 80 { | 81 { |
| 81 m_databaseCallbacks->connect(this); | 82 m_databaseCallbacks->connect(this); |
| 82 } | 83 } |
| 83 | 84 |
| 84 IDBDatabase::~IDBDatabase() | 85 IDBDatabase::~IDBDatabase() |
| 85 { | 86 { |
| 86 if (!m_closePending && m_backend) | 87 if (!m_closePending && m_backend) |
| 87 m_backend->close(); | 88 m_backend->close(); |
| (...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 445 return ActiveDOMObject::getExecutionContext(); | 446 return ActiveDOMObject::getExecutionContext(); |
| 446 } | 447 } |
| 447 | 448 |
| 448 void IDBDatabase::recordApiCallsHistogram(IndexedDatabaseMethods method) | 449 void IDBDatabase::recordApiCallsHistogram(IndexedDatabaseMethods method) |
| 449 { | 450 { |
| 450 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)); |
| 451 apiCallsHistogram.count(method); | 452 apiCallsHistogram.count(method); |
| 452 } | 453 } |
| 453 | 454 |
| 454 } // namespace blink | 455 } // namespace blink |
| OLD | NEW |