Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(137)

Side by Side Diff: Source/WebKit/chromium/src/IDBFactoryBackendProxy.cpp

Issue 13843016: Prepare to remove WebSecurityOrigin from IDB backend (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Update to new #includes Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 static WebFrameImpl* getWebFrame(ScriptExecutionContext* context) 190 static WebFrameImpl* getWebFrame(ScriptExecutionContext* context)
191 { 191 {
192 ASSERT_WITH_SECURITY_IMPLICATION(context->isDocument() || context->isWorkerC ontext()); 192 ASSERT_WITH_SECURITY_IMPLICATION(context->isDocument() || context->isWorkerC ontext());
193 if (context->isDocument()) { 193 if (context->isDocument()) {
194 Document* document = static_cast<Document*>(context); 194 Document* document = static_cast<Document*>(context);
195 return WebFrameImpl::fromFrame(document->frame()); 195 return WebFrameImpl::fromFrame(document->frame());
196 } 196 }
197 return 0; 197 return 0;
198 } 198 }
199 199
200 void IDBFactoryBackendProxy::getDatabaseNames(PassRefPtr<IDBCallbacks> prpCallba cks, PassRefPtr<SecurityOrigin> securityOrigin, ScriptExecutionContext* context, const String& dataDir) 200 void IDBFactoryBackendProxy::getDatabaseNames(PassRefPtr<IDBCallbacks> prpCallba cks, const String& databaseIdentifier, ScriptExecutionContext* context, const St ring& dataDir)
201 { 201 {
202 RefPtr<IDBCallbacks> callbacks(prpCallbacks); 202 RefPtr<IDBCallbacks> callbacks(prpCallbacks);
203 WebSecurityOrigin origin(securityOrigin); 203 WebSecurityOrigin origin(context->securityOrigin());
204 if (!allowIndexedDB(context, "Database Listing", origin, callbacks)) 204 if (!allowIndexedDB(context, "Database Listing", origin, callbacks))
205 return; 205 return;
206 206
207 WebFrameImpl* webFrame = getWebFrame(context); 207 m_webIDBFactory->getDatabaseNames(new WebIDBCallbacksImpl(callbacks), databa seIdentifier, dataDir);
208 m_webIDBFactory->getDatabaseNames(new WebIDBCallbacksImpl(callbacks), origin , webFrame, dataDir);
209 } 208 }
210 209
211 void IDBFactoryBackendProxy::open(const String& name, int64_t version, int64_t t ransactionId, PassRefPtr<IDBCallbacks> prpCallbacks, PassRefPtr<IDBDatabaseCallb acks> prpDatabaseCallbacks, PassRefPtr<SecurityOrigin> securityOrigin, ScriptExe cutionContext* context, const String& dataDir) 210 void IDBFactoryBackendProxy::open(const String& name, int64_t version, int64_t t ransactionId, PassRefPtr<IDBCallbacks> prpCallbacks, PassRefPtr<IDBDatabaseCallb acks> prpDatabaseCallbacks, const String& databaseIdentifier, ScriptExecutionCon text* context, const String& dataDir)
212 { 211 {
213 RefPtr<IDBCallbacks> callbacks(prpCallbacks); 212 RefPtr<IDBCallbacks> callbacks(prpCallbacks);
214 RefPtr<IDBDatabaseCallbacks> databaseCallbacks(prpDatabaseCallbacks); 213 RefPtr<IDBDatabaseCallbacks> databaseCallbacks(prpDatabaseCallbacks);
215 WebSecurityOrigin origin(securityOrigin); 214 WebSecurityOrigin origin(context->securityOrigin());
216 if (!allowIndexedDB(context, name, origin, callbacks)) 215 if (!allowIndexedDB(context, name, origin, callbacks))
217 return; 216 return;
218 217
219 WebFrameImpl* webFrame = getWebFrame(context); 218 m_webIDBFactory->open(name, version, transactionId, new WebIDBCallbacksImpl( callbacks), new WebIDBDatabaseCallbacksImpl(databaseCallbacks), databaseIdentifi er, dataDir);
220 m_webIDBFactory->open(name, version, transactionId, new WebIDBCallbacksImpl( callbacks), new WebIDBDatabaseCallbacksImpl(databaseCallbacks), origin, webFrame , dataDir);
221 } 219 }
222 220
223 void IDBFactoryBackendProxy::deleteDatabase(const String& name, PassRefPtr<IDBCa llbacks> prpCallbacks, PassRefPtr<SecurityOrigin> securityOrigin, ScriptExecutio nContext* context, const String& dataDir) 221 void IDBFactoryBackendProxy::deleteDatabase(const String& name, PassRefPtr<IDBCa llbacks> prpCallbacks, const String& databaseIdentifier, ScriptExecutionContext* context, const String& dataDir)
224 { 222 {
225 RefPtr<IDBCallbacks> callbacks(prpCallbacks); 223 RefPtr<IDBCallbacks> callbacks(prpCallbacks);
226 WebSecurityOrigin origin(securityOrigin); 224 WebSecurityOrigin origin(context->securityOrigin());
227 if (!allowIndexedDB(context, name, origin, callbacks)) 225 if (!allowIndexedDB(context, name, origin, callbacks))
228 return; 226 return;
229 227
230 WebFrameImpl* webFrame = getWebFrame(context); 228 m_webIDBFactory->deleteDatabase(name, new WebIDBCallbacksImpl(callbacks), da tabaseIdentifier, dataDir);
231 m_webIDBFactory->deleteDatabase(name, new WebIDBCallbacksImpl(callbacks), or igin, webFrame, dataDir);
232 } 229 }
233 230
234 } // namespace WebKit 231 } // namespace WebKit
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698