OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 } | 76 } |
77 | 77 |
78 m_webIDBFactory->getDatabaseNames(new WebIDBCallbacksImpl(callbacks), origin
, webFrame, dataDir); | 78 m_webIDBFactory->getDatabaseNames(new WebIDBCallbacksImpl(callbacks), origin
, webFrame, dataDir); |
79 } | 79 } |
80 | 80 |
81 void IDBFactoryBackendProxy::open(const String& name, PassRefPtr<IDBCallbacks> c
allbacks, PassRefPtr<SecurityOrigin> prpOrigin, Frame* frame, const String& data
Dir) | 81 void IDBFactoryBackendProxy::open(const String& name, PassRefPtr<IDBCallbacks> c
allbacks, PassRefPtr<SecurityOrigin> prpOrigin, Frame* frame, const String& data
Dir) |
82 { | 82 { |
83 WebSecurityOrigin origin(prpOrigin); | 83 WebSecurityOrigin origin(prpOrigin); |
84 WebFrameImpl* webFrame = WebFrameImpl::fromFrame(frame); | 84 WebFrameImpl* webFrame = WebFrameImpl::fromFrame(frame); |
85 WebViewImpl* webView = webFrame->viewImpl(); | 85 WebViewImpl* webView = webFrame->viewImpl(); |
| 86 if (!webView) { |
| 87 // Frame is closed, worker is terminaring. |
| 88 return; |
| 89 } |
86 if (webView->permissionClient() && !webView->permissionClient()->allowIndexe
dDB(webFrame, name, origin)) { | 90 if (webView->permissionClient() && !webView->permissionClient()->allowIndexe
dDB(webFrame, name, origin)) { |
87 callbacks->onError(WebIDBDatabaseError(0, "The user denied permission to
access the database.")); | 91 callbacks->onError(WebIDBDatabaseError(0, "The user denied permission to
access the database.")); |
88 return; | 92 return; |
89 } | 93 } |
90 | 94 |
91 m_webIDBFactory->open(name, new WebIDBCallbacksImpl(callbacks), origin, webF
rame, dataDir); | 95 m_webIDBFactory->open(name, new WebIDBCallbacksImpl(callbacks), origin, webF
rame, dataDir); |
92 } | 96 } |
93 | 97 |
94 void IDBFactoryBackendProxy::deleteDatabase(const String& name, PassRefPtr<IDBCa
llbacks> callbacks, PassRefPtr<SecurityOrigin> prpOrigin, Frame* frame, const St
ring& dataDir) | 98 void IDBFactoryBackendProxy::deleteDatabase(const String& name, PassRefPtr<IDBCa
llbacks> callbacks, PassRefPtr<SecurityOrigin> prpOrigin, Frame* frame, const St
ring& dataDir) |
95 { | 99 { |
96 WebSecurityOrigin origin(prpOrigin); | 100 WebSecurityOrigin origin(prpOrigin); |
97 WebFrameImpl* webFrame = WebFrameImpl::fromFrame(frame); | 101 WebFrameImpl* webFrame = WebFrameImpl::fromFrame(frame); |
98 WebViewImpl* webView = webFrame->viewImpl(); | 102 WebViewImpl* webView = webFrame->viewImpl(); |
99 if (webView->permissionClient() && !webView->permissionClient()->allowIndexe
dDB(webFrame, name, origin)) { | 103 if (webView->permissionClient() && !webView->permissionClient()->allowIndexe
dDB(webFrame, name, origin)) { |
100 callbacks->onError(WebIDBDatabaseError(0, "The user denied permission to
access the database.")); | 104 callbacks->onError(WebIDBDatabaseError(0, "The user denied permission to
access the database.")); |
101 return; | 105 return; |
102 } | 106 } |
103 | 107 |
104 m_webIDBFactory->deleteDatabase(name, new WebIDBCallbacksImpl(callbacks), or
igin, webFrame, dataDir); | 108 m_webIDBFactory->deleteDatabase(name, new WebIDBCallbacksImpl(callbacks), or
igin, webFrame, dataDir); |
105 } | 109 } |
106 | 110 |
107 } // namespace WebKit | 111 } // namespace WebKit |
108 | 112 |
109 #endif // ENABLE(INDEXED_DATABASE) | 113 #endif // ENABLE(INDEXED_DATABASE) |
OLD | NEW |