OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. |
3 * Copyright (C) 2009, 2011 Google Inc. All Rights Reserved. | 3 * Copyright (C) 2009, 2011 Google Inc. All Rights Reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
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 28 matching lines...) Expand all Loading... |
39 | 39 |
40 WorkerGlobalScopeIndexedDatabase::~WorkerGlobalScopeIndexedDatabase() | 40 WorkerGlobalScopeIndexedDatabase::~WorkerGlobalScopeIndexedDatabase() |
41 { | 41 { |
42 } | 42 } |
43 | 43 |
44 const char* WorkerGlobalScopeIndexedDatabase::supplementName() | 44 const char* WorkerGlobalScopeIndexedDatabase::supplementName() |
45 { | 45 { |
46 return "WorkerGlobalScopeIndexedDatabase"; | 46 return "WorkerGlobalScopeIndexedDatabase"; |
47 } | 47 } |
48 | 48 |
49 WorkerGlobalScopeIndexedDatabase& WorkerGlobalScopeIndexedDatabase::from(HeapSup
plementable<WorkerGlobalScope>& context) | 49 WorkerGlobalScopeIndexedDatabase& WorkerGlobalScopeIndexedDatabase::from(Supplem
entable<WorkerGlobalScope>& context) |
50 { | 50 { |
51 WorkerGlobalScopeIndexedDatabase* supplement = static_cast<WorkerGlobalScope
IndexedDatabase*>(HeapSupplement<WorkerGlobalScope>::from(context, supplementNam
e())); | 51 WorkerGlobalScopeIndexedDatabase* supplement = static_cast<WorkerGlobalScope
IndexedDatabase*>(Supplement<WorkerGlobalScope>::from(context, supplementName())
); |
52 if (!supplement) { | 52 if (!supplement) { |
53 supplement = new WorkerGlobalScopeIndexedDatabase(); | 53 supplement = new WorkerGlobalScopeIndexedDatabase; |
54 provideTo(context, supplementName(), adoptPtrWillBeNoop(supplement)); | 54 provideTo(context, supplementName(), supplement); |
55 } | 55 } |
56 return *supplement; | 56 return *supplement; |
57 } | 57 } |
58 | 58 |
59 IDBFactory* WorkerGlobalScopeIndexedDatabase::indexedDB(HeapSupplementable<Worke
rGlobalScope>& context) | 59 IDBFactory* WorkerGlobalScopeIndexedDatabase::indexedDB(Supplementable<WorkerGlo
balScope>& context) |
60 { | 60 { |
61 return from(context).indexedDB(); | 61 return from(context).indexedDB(); |
62 } | 62 } |
63 | 63 |
64 IDBFactory* WorkerGlobalScopeIndexedDatabase::indexedDB() | 64 IDBFactory* WorkerGlobalScopeIndexedDatabase::indexedDB() |
65 { | 65 { |
66 if (!m_idbFactory) | 66 if (!m_idbFactory) |
67 m_idbFactory = IDBFactory::create(IndexedDBClient::create()); | 67 m_idbFactory = IDBFactory::create(IndexedDBClient::create()); |
68 return m_idbFactory.get(); | 68 return m_idbFactory.get(); |
69 } | 69 } |
70 | 70 |
71 DEFINE_TRACE(WorkerGlobalScopeIndexedDatabase) | 71 DEFINE_TRACE(WorkerGlobalScopeIndexedDatabase) |
72 { | 72 { |
73 visitor->trace(m_idbFactory); | 73 visitor->trace(m_idbFactory); |
74 HeapSupplement<WorkerGlobalScope>::trace(visitor); | 74 Supplement<WorkerGlobalScope>::trace(visitor); |
75 } | 75 } |
76 | 76 |
77 } // namespace blink | 77 } // namespace blink |
OLD | NEW |