| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 return; | 110 return; |
| 111 } | 111 } |
| 112 | 112 |
| 113 IDBRequest* idbRequest = static_cast<IDBRequest*>(event->target()); | 113 IDBRequest* idbRequest = static_cast<IDBRequest*>(event->target()); |
| 114 RefPtrWillBeRawPtr<IDBAny> requestResult = idbRequest->resultAsAny(); | 114 RefPtrWillBeRawPtr<IDBAny> requestResult = idbRequest->resultAsAny(); |
| 115 if (requestResult->type() != IDBAny::DOMStringListType) { | 115 if (requestResult->type() != IDBAny::DOMStringListType) { |
| 116 m_requestCallback->sendFailure("Unexpected result type."); | 116 m_requestCallback->sendFailure("Unexpected result type."); |
| 117 return; | 117 return; |
| 118 } | 118 } |
| 119 | 119 |
| 120 RefPtr<DOMStringList> databaseNamesList = requestResult->domStringList()
; | 120 RefPtrWillBeRawPtr<DOMStringList> databaseNamesList = requestResult->dom
StringList(); |
| 121 RefPtr<TypeBuilder::Array<String> > databaseNames = TypeBuilder::Array<S
tring>::create(); | 121 RefPtr<TypeBuilder::Array<String> > databaseNames = TypeBuilder::Array<S
tring>::create(); |
| 122 for (size_t i = 0; i < databaseNamesList->length(); ++i) | 122 for (size_t i = 0; i < databaseNamesList->length(); ++i) |
| 123 databaseNames->addItem(databaseNamesList->item(i)); | 123 databaseNames->addItem(databaseNamesList->item(i)); |
| 124 m_requestCallback->sendSuccess(databaseNames.release()); | 124 m_requestCallback->sendSuccess(databaseNames.release()); |
| 125 } | 125 } |
| 126 | 126 |
| 127 private: | 127 private: |
| 128 GetDatabaseNamesCallback(PassRefPtr<RequestDatabaseNamesCallback> requestCal
lback, const String& securityOrigin) | 128 GetDatabaseNamesCallback(PassRefPtr<RequestDatabaseNamesCallback> requestCal
lback, const String& securityOrigin) |
| 129 : EventListener(EventListener::CPPEventListenerType) | 129 : EventListener(EventListener::CPPEventListenerType) |
| 130 , m_requestCallback(requestCallback) | 130 , m_requestCallback(requestCallback) |
| (...skipping 639 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 770 if (!idbFactory) | 770 if (!idbFactory) |
| 771 return; | 771 return; |
| 772 | 772 |
| 773 ScriptState* scriptState = ScriptState::forMainWorld(frame); | 773 ScriptState* scriptState = ScriptState::forMainWorld(frame); |
| 774 ScriptState::Scope scope(scriptState); | 774 ScriptState::Scope scope(scriptState); |
| 775 RefPtr<ClearObjectStore> clearObjectStore = ClearObjectStore::create(scriptS
tate, objectStoreName, requestCallback); | 775 RefPtr<ClearObjectStore> clearObjectStore = ClearObjectStore::create(scriptS
tate, objectStoreName, requestCallback); |
| 776 clearObjectStore->start(idbFactory, document->securityOrigin(), databaseName
); | 776 clearObjectStore->start(idbFactory, document->securityOrigin(), databaseName
); |
| 777 } | 777 } |
| 778 | 778 |
| 779 } // namespace WebCore | 779 } // namespace WebCore |
| OLD | NEW |