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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 #include "modules/indexeddb/IDBTracing.h" | 44 #include "modules/indexeddb/IDBTracing.h" |
45 #include "modules/indexeddb/IDBTransaction.h" | 45 #include "modules/indexeddb/IDBTransaction.h" |
46 #include "modules/indexeddb/IDBVersionChangeEvent.h" | 46 #include "modules/indexeddb/IDBVersionChangeEvent.h" |
47 #include <limits> | 47 #include <limits> |
48 #include "wtf/Atomics.h" | 48 #include "wtf/Atomics.h" |
49 | 49 |
50 namespace WebCore { | 50 namespace WebCore { |
51 | 51 |
52 DEFINE_GC_INFO(IDBDatabase); | 52 DEFINE_GC_INFO(IDBDatabase); |
53 | 53 |
54 PassRefPtr<IDBDatabase> IDBDatabase::create(ScriptExecutionContext* context, Pas
sRefPtr<IDBDatabaseBackendInterface> database, PassRefPtr<IDBDatabaseCallbacks>
callbacks) | 54 IDBDatabase* IDBDatabase::create(ScriptExecutionContext* context, IDBDatabaseBac
kendInterface* database, IDBDatabaseCallbacks* callbacks) |
55 { | 55 { |
56 RefPtr<IDBDatabase> idbDatabase(adoptRef(new IDBDatabase(context, database,
callbacks))); | 56 IDBDatabase* idbDatabase = new IDBDatabase(context, database, callbacks); |
57 idbDatabase->suspendIfNeeded(); | 57 idbDatabase->suspendIfNeeded(); |
58 return idbDatabase.release(); | 58 return idbDatabase; |
59 } | 59 } |
60 | 60 |
61 IDBDatabase::IDBDatabase(ScriptExecutionContext* context, PassRefPtr<IDBDatabase
BackendInterface> backend, PassRefPtr<IDBDatabaseCallbacks> callbacks) | 61 IDBDatabase::IDBDatabase(ScriptExecutionContext* context, IDBDatabaseBackendInte
rface* backend, IDBDatabaseCallbacks* callbacks) |
62 : ActiveDOMObject(context) | 62 : ActiveDOMObject(context) |
63 , m_backend(backend) | 63 , m_backend(backend) |
64 , m_closePending(false) | 64 , m_closePending(false) |
65 , m_contextStopped(false) | 65 , m_contextStopped(false) |
66 , m_databaseCallbacks(callbacks) | 66 , m_databaseCallbacks(callbacks) |
67 { | 67 { |
68 // We pass a reference of this object before it can be adopted. | 68 // We pass a reference of this object before it can be adopted. |
69 relaxAdoptionRequirement(); | 69 relaxAdoptionRequirement(); |
70 ScriptWrappable::init(this); | 70 ScriptWrappable::init(this); |
71 } | 71 } |
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
391 EventTargetData* IDBDatabase::eventTargetData() | 391 EventTargetData* IDBDatabase::eventTargetData() |
392 { | 392 { |
393 return &m_eventTargetData; | 393 return &m_eventTargetData; |
394 } | 394 } |
395 | 395 |
396 EventTargetData* IDBDatabase::ensureEventTargetData() | 396 EventTargetData* IDBDatabase::ensureEventTargetData() |
397 { | 397 { |
398 return &m_eventTargetData; | 398 return &m_eventTargetData; |
399 } | 399 } |
400 | 400 |
| 401 void IDBDatabase::trace(Visitor* visitor) |
| 402 { |
| 403 visitor->trace(m_backend); |
| 404 visitor->trace(m_databaseCallbacks); |
| 405 } |
| 406 |
401 } // namespace WebCore | 407 } // namespace WebCore |
OLD | NEW |