| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 * 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 * | 10 * |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 using blink::WebIDBKeyPath; | 50 using blink::WebIDBKeyPath; |
| 51 using blink::WebIDBMetadata; | 51 using blink::WebIDBMetadata; |
| 52 using blink::WebIDBValue; | 52 using blink::WebIDBValue; |
| 53 using blink::WebVector; | 53 using blink::WebVector; |
| 54 | 54 |
| 55 namespace blink { | 55 namespace blink { |
| 56 | 56 |
| 57 // static | 57 // static |
| 58 std::unique_ptr<WebIDBCallbacksImpl> WebIDBCallbacksImpl::create( | 58 std::unique_ptr<WebIDBCallbacksImpl> WebIDBCallbacksImpl::create( |
| 59 IDBRequest* request) { | 59 IDBRequest* request) { |
| 60 return wrapUnique(new WebIDBCallbacksImpl(request)); | 60 return WTF::wrapUnique(new WebIDBCallbacksImpl(request)); |
| 61 } | 61 } |
| 62 | 62 |
| 63 WebIDBCallbacksImpl::WebIDBCallbacksImpl(IDBRequest* request) | 63 WebIDBCallbacksImpl::WebIDBCallbacksImpl(IDBRequest* request) |
| 64 : m_request(request) { | 64 : m_request(request) { |
| 65 InspectorInstrumentation::asyncTaskScheduled( | 65 InspectorInstrumentation::asyncTaskScheduled( |
| 66 m_request->getExecutionContext(), IndexedDBNames::IndexedDB, this, true); | 66 m_request->getExecutionContext(), IndexedDBNames::IndexedDB, this, true); |
| 67 } | 67 } |
| 68 | 68 |
| 69 WebIDBCallbacksImpl::~WebIDBCallbacksImpl() { | 69 WebIDBCallbacksImpl::~WebIDBCallbacksImpl() { |
| 70 if (m_request) { | 70 if (m_request) { |
| (...skipping 26 matching lines...) Expand all Loading... |
| 97 | 97 |
| 98 void WebIDBCallbacksImpl::onSuccess(WebIDBCursor* cursor, | 98 void WebIDBCallbacksImpl::onSuccess(WebIDBCursor* cursor, |
| 99 const WebIDBKey& key, | 99 const WebIDBKey& key, |
| 100 const WebIDBKey& primaryKey, | 100 const WebIDBKey& primaryKey, |
| 101 const WebIDBValue& value) { | 101 const WebIDBValue& value) { |
| 102 if (!m_request) | 102 if (!m_request) |
| 103 return; | 103 return; |
| 104 | 104 |
| 105 InspectorInstrumentation::AsyncTask asyncTask( | 105 InspectorInstrumentation::AsyncTask asyncTask( |
| 106 m_request->getExecutionContext(), this); | 106 m_request->getExecutionContext(), this); |
| 107 m_request->onSuccess(wrapUnique(cursor), key, primaryKey, | 107 m_request->onSuccess(WTF::wrapUnique(cursor), key, primaryKey, |
| 108 IDBValue::create(value)); | 108 IDBValue::create(value)); |
| 109 } | 109 } |
| 110 | 110 |
| 111 void WebIDBCallbacksImpl::onSuccess(WebIDBDatabase* backend, | 111 void WebIDBCallbacksImpl::onSuccess(WebIDBDatabase* backend, |
| 112 const WebIDBMetadata& metadata) { | 112 const WebIDBMetadata& metadata) { |
| 113 std::unique_ptr<WebIDBDatabase> db = wrapUnique(backend); | 113 std::unique_ptr<WebIDBDatabase> db = WTF::wrapUnique(backend); |
| 114 if (m_request) { | 114 if (m_request) { |
| 115 InspectorInstrumentation::AsyncTask asyncTask( | 115 InspectorInstrumentation::AsyncTask asyncTask( |
| 116 m_request->getExecutionContext(), this); | 116 m_request->getExecutionContext(), this); |
| 117 m_request->onSuccess(std::move(db), IDBDatabaseMetadata(metadata)); | 117 m_request->onSuccess(std::move(db), IDBDatabaseMetadata(metadata)); |
| 118 } else if (db) { | 118 } else if (db) { |
| 119 db->close(); | 119 db->close(); |
| 120 } | 120 } |
| 121 } | 121 } |
| 122 | 122 |
| 123 void WebIDBCallbacksImpl::onSuccess(const WebIDBKey& key) { | 123 void WebIDBCallbacksImpl::onSuccess(const WebIDBKey& key) { |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 InspectorInstrumentation::AsyncTask asyncTask( | 186 InspectorInstrumentation::AsyncTask asyncTask( |
| 187 m_request->getExecutionContext(), this); | 187 m_request->getExecutionContext(), this); |
| 188 m_request->onBlocked(oldVersion); | 188 m_request->onBlocked(oldVersion); |
| 189 } | 189 } |
| 190 | 190 |
| 191 void WebIDBCallbacksImpl::onUpgradeNeeded(long long oldVersion, | 191 void WebIDBCallbacksImpl::onUpgradeNeeded(long long oldVersion, |
| 192 WebIDBDatabase* database, | 192 WebIDBDatabase* database, |
| 193 const WebIDBMetadata& metadata, | 193 const WebIDBMetadata& metadata, |
| 194 unsigned short dataLoss, | 194 unsigned short dataLoss, |
| 195 WebString dataLossMessage) { | 195 WebString dataLossMessage) { |
| 196 std::unique_ptr<WebIDBDatabase> db = wrapUnique(database); | 196 std::unique_ptr<WebIDBDatabase> db = WTF::wrapUnique(database); |
| 197 if (m_request) { | 197 if (m_request) { |
| 198 InspectorInstrumentation::AsyncTask asyncTask( | 198 InspectorInstrumentation::AsyncTask asyncTask( |
| 199 m_request->getExecutionContext(), this); | 199 m_request->getExecutionContext(), this); |
| 200 m_request->onUpgradeNeeded( | 200 m_request->onUpgradeNeeded( |
| 201 oldVersion, std::move(db), IDBDatabaseMetadata(metadata), | 201 oldVersion, std::move(db), IDBDatabaseMetadata(metadata), |
| 202 static_cast<WebIDBDataLoss>(dataLoss), dataLossMessage); | 202 static_cast<WebIDBDataLoss>(dataLoss), dataLossMessage); |
| 203 } else { | 203 } else { |
| 204 db->close(); | 204 db->close(); |
| 205 } | 205 } |
| 206 } | 206 } |
| 207 | 207 |
| 208 void WebIDBCallbacksImpl::detach() { | 208 void WebIDBCallbacksImpl::detach() { |
| 209 m_request.clear(); | 209 m_request.clear(); |
| 210 } | 210 } |
| 211 | 211 |
| 212 } // namespace blink | 212 } // namespace blink |
| OLD | NEW |