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

Side by Side Diff: Source/modules/indexeddb/WebIDBCallbacksImpl.cpp

Issue 1182233003: IndexedDB: Replace use of DOMError with DOMException (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased Created 5 years, 3 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) 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 11 matching lines...) Expand all
22 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */ 27 */
28 28
29 #include "config.h" 29 #include "config.h"
30 #include "modules/indexeddb/WebIDBCallbacksImpl.h" 30 #include "modules/indexeddb/WebIDBCallbacksImpl.h"
31 31
32 #include "core/dom/DOMError.h" 32 #include "core/dom/DOMException.h"
33 #include "core/inspector/InspectorInstrumentation.h" 33 #include "core/inspector/InspectorInstrumentation.h"
34 #include "modules/indexeddb/IDBMetadata.h" 34 #include "modules/indexeddb/IDBMetadata.h"
35 #include "modules/indexeddb/IDBRequest.h" 35 #include "modules/indexeddb/IDBRequest.h"
36 #include "modules/indexeddb/IDBValue.h" 36 #include "modules/indexeddb/IDBValue.h"
37 #include "platform/SharedBuffer.h" 37 #include "platform/SharedBuffer.h"
38 #include "public/platform/modules/indexeddb/WebIDBCursor.h" 38 #include "public/platform/modules/indexeddb/WebIDBCursor.h"
39 #include "public/platform/modules/indexeddb/WebIDBDatabase.h" 39 #include "public/platform/modules/indexeddb/WebIDBDatabase.h"
40 #include "public/platform/modules/indexeddb/WebIDBDatabaseError.h" 40 #include "public/platform/modules/indexeddb/WebIDBDatabaseError.h"
41 #include "public/platform/modules/indexeddb/WebIDBKey.h" 41 #include "public/platform/modules/indexeddb/WebIDBKey.h"
42 #include "public/platform/modules/indexeddb/WebIDBValue.h" 42 #include "public/platform/modules/indexeddb/WebIDBValue.h"
(...skipping 22 matching lines...) Expand all
65 } 65 }
66 66
67 WebIDBCallbacksImpl::~WebIDBCallbacksImpl() 67 WebIDBCallbacksImpl::~WebIDBCallbacksImpl()
68 { 68 {
69 InspectorInstrumentation::traceAsyncOperationCompleted(m_request->executionC ontext(), m_asyncOperationId); 69 InspectorInstrumentation::traceAsyncOperationCompleted(m_request->executionC ontext(), m_asyncOperationId);
70 } 70 }
71 71
72 void WebIDBCallbacksImpl::onError(const WebIDBDatabaseError& error) 72 void WebIDBCallbacksImpl::onError(const WebIDBDatabaseError& error)
73 { 73 {
74 InspectorInstrumentationCookie cookie = InspectorInstrumentation::traceAsync CallbackStarting(m_request->executionContext(), m_asyncOperationId); 74 InspectorInstrumentationCookie cookie = InspectorInstrumentation::traceAsync CallbackStarting(m_request->executionContext(), m_asyncOperationId);
75 m_request->onError(DOMError::create(error.code(), error.message())); 75 m_request->onError(DOMException::create(error.code(), error.message()));
76 InspectorInstrumentation::traceAsyncCallbackCompleted(cookie); 76 InspectorInstrumentation::traceAsyncCallbackCompleted(cookie);
77 } 77 }
78 78
79 void WebIDBCallbacksImpl::onSuccess(const WebVector<WebString>& webStringList) 79 void WebIDBCallbacksImpl::onSuccess(const WebVector<WebString>& webStringList)
80 { 80 {
81 Vector<String> stringList; 81 Vector<String> stringList;
82 for (size_t i = 0; i < webStringList.size(); ++i) 82 for (size_t i = 0; i < webStringList.size(); ++i)
83 stringList.append(webStringList[i]); 83 stringList.append(webStringList[i]);
84 InspectorInstrumentationCookie cookie = InspectorInstrumentation::traceAsync CallbackStarting(m_request->executionContext(), m_asyncOperationId); 84 InspectorInstrumentationCookie cookie = InspectorInstrumentation::traceAsync CallbackStarting(m_request->executionContext(), m_asyncOperationId);
85 m_request->onSuccess(stringList); 85 m_request->onSuccess(stringList);
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 } 170 }
171 171
172 void WebIDBCallbacksImpl::onUpgradeNeeded(long long oldVersion, WebIDBDatabase* database, const WebIDBMetadata& metadata, unsigned short dataLoss, WebString dat aLossMessage) 172 void WebIDBCallbacksImpl::onUpgradeNeeded(long long oldVersion, WebIDBDatabase* database, const WebIDBMetadata& metadata, unsigned short dataLoss, WebString dat aLossMessage)
173 { 173 {
174 InspectorInstrumentationCookie cookie = InspectorInstrumentation::traceAsync CallbackStarting(m_request->executionContext(), m_asyncOperationId); 174 InspectorInstrumentationCookie cookie = InspectorInstrumentation::traceAsync CallbackStarting(m_request->executionContext(), m_asyncOperationId);
175 m_request->onUpgradeNeeded(oldVersion, adoptPtr(database), IDBDatabaseMetada ta(metadata), static_cast<WebIDBDataLoss>(dataLoss), dataLossMessage); 175 m_request->onUpgradeNeeded(oldVersion, adoptPtr(database), IDBDatabaseMetada ta(metadata), static_cast<WebIDBDataLoss>(dataLoss), dataLossMessage);
176 InspectorInstrumentation::traceAsyncCallbackCompleted(cookie); 176 InspectorInstrumentation::traceAsyncCallbackCompleted(cookie);
177 } 177 }
178 178
179 } // namespace blink 179 } // namespace blink
OLDNEW
« no previous file with comments | « Source/modules/indexeddb/IDBTransactionTest.cpp ('k') | Source/modules/indexeddb/WebIDBDatabaseCallbacksImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698