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 18 matching lines...) Expand all Loading... |
29 #include "config.h" | 29 #include "config.h" |
30 #include "modules/indexeddb/IDBFactory.h" | 30 #include "modules/indexeddb/IDBFactory.h" |
31 | 31 |
32 #include "bindings/v8/IDBBindingUtilities.h" | 32 #include "bindings/v8/IDBBindingUtilities.h" |
33 #include "core/dom/Document.h" | 33 #include "core/dom/Document.h" |
34 #include "core/dom/ExceptionCode.h" | 34 #include "core/dom/ExceptionCode.h" |
35 #include "core/page/Frame.h" | 35 #include "core/page/Frame.h" |
36 #include "core/page/Page.h" | 36 #include "core/page/Page.h" |
37 #include "core/page/PageGroup.h" | 37 #include "core/page/PageGroup.h" |
38 #include "core/platform/HistogramSupport.h" | 38 #include "core/platform/HistogramSupport.h" |
39 #include "core/workers/WorkerContext.h" | 39 #include "core/workers/WorkerGlobalScope.h" |
40 #include "core/workers/WorkerLoaderProxy.h" | 40 #include "core/workers/WorkerLoaderProxy.h" |
41 #include "core/workers/WorkerThread.h" | 41 #include "core/workers/WorkerThread.h" |
42 #include "modules/indexeddb/IDBDatabase.h" | 42 #include "modules/indexeddb/IDBDatabase.h" |
43 #include "modules/indexeddb/IDBDatabaseCallbacksImpl.h" | 43 #include "modules/indexeddb/IDBDatabaseCallbacksImpl.h" |
44 #include "modules/indexeddb/IDBDatabaseException.h" | 44 #include "modules/indexeddb/IDBDatabaseException.h" |
45 #include "modules/indexeddb/IDBFactoryBackendInterface.h" | 45 #include "modules/indexeddb/IDBFactoryBackendInterface.h" |
46 #include "modules/indexeddb/IDBHistograms.h" | 46 #include "modules/indexeddb/IDBHistograms.h" |
47 #include "modules/indexeddb/IDBKey.h" | 47 #include "modules/indexeddb/IDBKey.h" |
48 #include "modules/indexeddb/IDBKeyRange.h" | 48 #include "modules/indexeddb/IDBKeyRange.h" |
49 #include "modules/indexeddb/IDBOpenDBRequest.h" | 49 #include "modules/indexeddb/IDBOpenDBRequest.h" |
(...skipping 10 matching lines...) Expand all Loading... |
60 relaxAdoptionRequirement(); | 60 relaxAdoptionRequirement(); |
61 ScriptWrappable::init(this); | 61 ScriptWrappable::init(this); |
62 } | 62 } |
63 | 63 |
64 IDBFactory::~IDBFactory() | 64 IDBFactory::~IDBFactory() |
65 { | 65 { |
66 } | 66 } |
67 | 67 |
68 static bool isContextValid(ScriptExecutionContext* context) | 68 static bool isContextValid(ScriptExecutionContext* context) |
69 { | 69 { |
70 ASSERT(context->isDocument() || context->isWorkerContext()); | 70 ASSERT(context->isDocument() || context->isWorkerGlobalScope()); |
71 if (context->isDocument()) { | 71 if (context->isDocument()) { |
72 Document* document = toDocument(context); | 72 Document* document = toDocument(context); |
73 return document->frame() && document->page(); | 73 return document->frame() && document->page(); |
74 } | 74 } |
75 return true; | 75 return true; |
76 } | 76 } |
77 | 77 |
78 PassRefPtr<IDBRequest> IDBFactory::getDatabaseNames(ScriptExecutionContext* cont
ext, ExceptionCode& ec) | 78 PassRefPtr<IDBRequest> IDBFactory::getDatabaseNames(ScriptExecutionContext* cont
ext, ExceptionCode& ec) |
79 { | 79 { |
80 IDB_TRACE("IDBFactory::getDatabaseNames"); | 80 IDB_TRACE("IDBFactory::getDatabaseNames"); |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 | 159 |
160 if (!first->isValid() || !second->isValid()) { | 160 if (!first->isValid() || !second->isValid()) { |
161 ec = IDBDatabaseException::DataError; | 161 ec = IDBDatabaseException::DataError; |
162 return 0; | 162 return 0; |
163 } | 163 } |
164 | 164 |
165 return static_cast<short>(first->compare(second.get())); | 165 return static_cast<short>(first->compare(second.get())); |
166 } | 166 } |
167 | 167 |
168 } // namespace WebCore | 168 } // namespace WebCore |
OLD | NEW |