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