| 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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 | 155 |
| 156 PassRefPtr<DOMStringList> IDBDatabase::objectStoreNames() const | 156 PassRefPtr<DOMStringList> IDBDatabase::objectStoreNames() const |
| 157 { | 157 { |
| 158 RefPtr<DOMStringList> objectStoreNames = DOMStringList::create(); | 158 RefPtr<DOMStringList> objectStoreNames = DOMStringList::create(); |
| 159 for (IDBDatabaseMetadata::ObjectStoreMap::const_iterator it = m_metadata.obj
ectStores.begin(); it != m_metadata.objectStores.end(); ++it) | 159 for (IDBDatabaseMetadata::ObjectStoreMap::const_iterator it = m_metadata.obj
ectStores.begin(); it != m_metadata.objectStores.end(); ++it) |
| 160 objectStoreNames->append(it->value.name); | 160 objectStoreNames->append(it->value.name); |
| 161 objectStoreNames->sort(); | 161 objectStoreNames->sort(); |
| 162 return objectStoreNames.release(); | 162 return objectStoreNames.release(); |
| 163 } | 163 } |
| 164 | 164 |
| 165 ScriptValue IDBDatabase::version(ExecutionContext* context) const | 165 ScriptValue IDBDatabase::version(NewScriptState* scriptState) const |
| 166 { | 166 { |
| 167 DOMRequestState requestState(toIsolate(context)); | |
| 168 int64_t intVersion = m_metadata.intVersion; | 167 int64_t intVersion = m_metadata.intVersion; |
| 169 if (intVersion == IDBDatabaseMetadata::NoIntVersion) | 168 if (intVersion == IDBDatabaseMetadata::NoIntVersion) |
| 170 return idbAnyToScriptValue(&requestState, IDBAny::createString(m_metadat
a.version)); | 169 return idbAnyToScriptValue(scriptState, IDBAny::createString(m_metadata.
version)); |
| 171 | 170 |
| 172 return idbAnyToScriptValue(&requestState, IDBAny::create(intVersion)); | 171 return idbAnyToScriptValue(scriptState, IDBAny::create(intVersion)); |
| 173 } | 172 } |
| 174 | 173 |
| 175 PassRefPtr<IDBObjectStore> IDBDatabase::createObjectStore(const String& name, co
nst Dictionary& options, ExceptionState& exceptionState) | 174 PassRefPtr<IDBObjectStore> IDBDatabase::createObjectStore(const String& name, co
nst Dictionary& options, ExceptionState& exceptionState) |
| 176 { | 175 { |
| 177 IDBKeyPath keyPath; | 176 IDBKeyPath keyPath; |
| 178 bool autoIncrement = false; | 177 bool autoIncrement = false; |
| 179 if (!options.isUndefinedOrNull()) { | 178 if (!options.isUndefinedOrNull()) { |
| 180 String keyPathString; | 179 String keyPathString; |
| 181 Vector<String> keyPathArray; | 180 Vector<String> keyPathArray; |
| 182 if (options.get("keyPath", keyPathArray)) | 181 if (options.get("keyPath", keyPathArray)) |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 424 { | 423 { |
| 425 return EventTargetNames::IDBDatabase; | 424 return EventTargetNames::IDBDatabase; |
| 426 } | 425 } |
| 427 | 426 |
| 428 ExecutionContext* IDBDatabase::executionContext() const | 427 ExecutionContext* IDBDatabase::executionContext() const |
| 429 { | 428 { |
| 430 return ActiveDOMObject::executionContext(); | 429 return ActiveDOMObject::executionContext(); |
| 431 } | 430 } |
| 432 | 431 |
| 433 } // namespace WebCore | 432 } // namespace WebCore |
| OLD | NEW |