OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 ec = TypeError; | 123 ec = TypeError; |
124 return 0; | 124 return 0; |
125 } | 125 } |
126 if (!isContextValid(context)) | 126 if (!isContextValid(context)) |
127 return 0; | 127 return 0; |
128 if (!context->securityOrigin()->canAccessDatabase(context->topOrigin())) { | 128 if (!context->securityOrigin()->canAccessDatabase(context->topOrigin())) { |
129 ec = SECURITY_ERR; | 129 ec = SECURITY_ERR; |
130 return 0; | 130 return 0; |
131 } | 131 } |
132 | 132 |
133 RefPtr<IDBDatabaseCallbacksImpl> databaseCallbacks = IDBDatabaseCallbacksImp
l::create(); | 133 IDBDatabaseCallbacksImpl* databaseCallbacks = IDBDatabaseCallbacksImpl::crea
te(); |
134 int64_t transactionId = IDBDatabase::nextTransactionId(); | 134 int64_t transactionId = IDBDatabase::nextTransactionId(); |
135 RefPtr<IDBOpenDBRequest> request = IDBOpenDBRequest::create(context, databas
eCallbacks, transactionId, version); | 135 RefPtr<IDBOpenDBRequest> request = IDBOpenDBRequest::create(context, databas
eCallbacks, transactionId, version); |
136 m_backend->open(name, version, transactionId, request, databaseCallbacks, co
ntext->securityOrigin()->databaseIdentifier(), context, getIndexedDBDatabasePath
(context)); | 136 m_backend->open(name, version, transactionId, request, databaseCallbacks, co
ntext->securityOrigin()->databaseIdentifier(), context, getIndexedDBDatabasePath
(context)); |
137 return request; | 137 return request; |
138 } | 138 } |
139 | 139 |
140 PassRefPtr<IDBOpenDBRequest> IDBFactory::open(ScriptExecutionContext* context, c
onst String& name, ExceptionCode& ec) | 140 PassRefPtr<IDBOpenDBRequest> IDBFactory::open(ScriptExecutionContext* context, c
onst String& name, ExceptionCode& ec) |
141 { | 141 { |
142 IDB_TRACE("IDBFactory::open"); | 142 IDB_TRACE("IDBFactory::open"); |
143 return openInternal(context, name, IDBDatabaseMetadata::NoIntVersion, ec); | 143 return openInternal(context, name, IDBDatabaseMetadata::NoIntVersion, ec); |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 | 179 |
180 return static_cast<short>(first->compare(second.get())); | 180 return static_cast<short>(first->compare(second.get())); |
181 } | 181 } |
182 | 182 |
183 void IDBFactory::trace(Visitor* visitor) | 183 void IDBFactory::trace(Visitor* visitor) |
184 { | 184 { |
185 visitor->visit(m_backend); | 185 visitor->visit(m_backend); |
186 } | 186 } |
187 | 187 |
188 } // namespace WebCore | 188 } // namespace WebCore |
OLD | NEW |