| 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 585 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 596 Document* document = frame ? frame->document() : 0; | 596 Document* document = frame ? frame->document() : 0; |
| 597 | 597 |
| 598 if (!document) | 598 if (!document) |
| 599 *errorString = "No document for given frame found"; | 599 *errorString = "No document for given frame found"; |
| 600 | 600 |
| 601 return document; | 601 return document; |
| 602 } | 602 } |
| 603 | 603 |
| 604 static IDBFactory* assertIDBFactory(ErrorString* errorString, Document* document
) | 604 static IDBFactory* assertIDBFactory(ErrorString* errorString, Document* document
) |
| 605 { | 605 { |
| 606 DOMWindow* domWindow = document->domWindow(); | 606 LocalDOMWindow* domWindow = document->domWindow(); |
| 607 if (!domWindow) { | 607 if (!domWindow) { |
| 608 *errorString = "No IndexedDB factory for given frame found"; | 608 *errorString = "No IndexedDB factory for given frame found"; |
| 609 return 0; | 609 return 0; |
| 610 } | 610 } |
| 611 IDBFactory* idbFactory = DOMWindowIndexedDatabase::indexedDB(*domWindow); | 611 IDBFactory* idbFactory = DOMWindowIndexedDatabase::indexedDB(*domWindow); |
| 612 | 612 |
| 613 if (!idbFactory) | 613 if (!idbFactory) |
| 614 *errorString = "No IndexedDB factory for given frame found"; | 614 *errorString = "No IndexedDB factory for given frame found"; |
| 615 | 615 |
| 616 return idbFactory; | 616 return idbFactory; |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 768 if (!idbFactory) | 768 if (!idbFactory) |
| 769 return; | 769 return; |
| 770 | 770 |
| 771 ScriptState* scriptState = ScriptState::forMainWorld(frame); | 771 ScriptState* scriptState = ScriptState::forMainWorld(frame); |
| 772 ScriptState::Scope scope(scriptState); | 772 ScriptState::Scope scope(scriptState); |
| 773 RefPtr<ClearObjectStore> clearObjectStore = ClearObjectStore::create(scriptS
tate, objectStoreName, requestCallback); | 773 RefPtr<ClearObjectStore> clearObjectStore = ClearObjectStore::create(scriptS
tate, objectStoreName, requestCallback); |
| 774 clearObjectStore->start(idbFactory, document->securityOrigin(), databaseName
); | 774 clearObjectStore->start(idbFactory, document->securityOrigin(), databaseName
); |
| 775 } | 775 } |
| 776 | 776 |
| 777 } // namespace WebCore | 777 } // namespace WebCore |
| OLD | NEW |