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

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

Issue 2727633006: DevTools: Rename InspectorInstrumentation:: namespace into probe:: (Closed)
Patch Set: Created 3 years, 9 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
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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 WTF::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 probe::asyncTaskScheduled(m_request->getExecutionContext(),
66 m_request->getExecutionContext(), IndexedDBNames::IndexedDB, this, true); 66 IndexedDBNames::IndexedDB, this, true);
67 } 67 }
68 68
69 WebIDBCallbacksImpl::~WebIDBCallbacksImpl() { 69 WebIDBCallbacksImpl::~WebIDBCallbacksImpl() {
70 if (m_request) { 70 if (m_request) {
71 InspectorInstrumentation::asyncTaskCanceled( 71 probe::asyncTaskCanceled(m_request->getExecutionContext(), this);
72 m_request->getExecutionContext(), this);
73 m_request->webCallbacksDestroyed(); 72 m_request->webCallbacksDestroyed();
74 } 73 }
75 } 74 }
76 75
77 void WebIDBCallbacksImpl::onError(const WebIDBDatabaseError& error) { 76 void WebIDBCallbacksImpl::onError(const WebIDBDatabaseError& error) {
78 if (!m_request) 77 if (!m_request)
79 return; 78 return;
80 79
81 InspectorInstrumentation::AsyncTask asyncTask( 80 probe::AsyncTask asyncTask(m_request->getExecutionContext(), this);
82 m_request->getExecutionContext(), this);
83 m_request->onError(DOMException::create(error.code(), error.message())); 81 m_request->onError(DOMException::create(error.code(), error.message()));
84 } 82 }
85 83
86 void WebIDBCallbacksImpl::onSuccess(const WebVector<WebString>& webStringList) { 84 void WebIDBCallbacksImpl::onSuccess(const WebVector<WebString>& webStringList) {
87 if (!m_request) 85 if (!m_request)
88 return; 86 return;
89 87
90 Vector<String> stringList; 88 Vector<String> stringList;
91 for (size_t i = 0; i < webStringList.size(); ++i) 89 for (size_t i = 0; i < webStringList.size(); ++i)
92 stringList.push_back(webStringList[i]); 90 stringList.push_back(webStringList[i]);
93 InspectorInstrumentation::AsyncTask asyncTask( 91 probe::AsyncTask asyncTask(m_request->getExecutionContext(), this);
94 m_request->getExecutionContext(), this);
95 m_request->onSuccess(stringList); 92 m_request->onSuccess(stringList);
96 } 93 }
97 94
98 void WebIDBCallbacksImpl::onSuccess(WebIDBCursor* cursor, 95 void WebIDBCallbacksImpl::onSuccess(WebIDBCursor* cursor,
99 const WebIDBKey& key, 96 const WebIDBKey& key,
100 const WebIDBKey& primaryKey, 97 const WebIDBKey& primaryKey,
101 const WebIDBValue& value) { 98 const WebIDBValue& value) {
102 if (!m_request) 99 if (!m_request)
103 return; 100 return;
104 101
105 InspectorInstrumentation::AsyncTask asyncTask( 102 probe::AsyncTask asyncTask(m_request->getExecutionContext(), this);
106 m_request->getExecutionContext(), this);
107 m_request->onSuccess(WTF::wrapUnique(cursor), key, primaryKey, 103 m_request->onSuccess(WTF::wrapUnique(cursor), key, primaryKey,
108 IDBValue::create(value, m_request->isolate())); 104 IDBValue::create(value, m_request->isolate()));
109 } 105 }
110 106
111 void WebIDBCallbacksImpl::onSuccess(WebIDBDatabase* backend, 107 void WebIDBCallbacksImpl::onSuccess(WebIDBDatabase* backend,
112 const WebIDBMetadata& metadata) { 108 const WebIDBMetadata& metadata) {
113 std::unique_ptr<WebIDBDatabase> db = WTF::wrapUnique(backend); 109 std::unique_ptr<WebIDBDatabase> db = WTF::wrapUnique(backend);
114 if (m_request) { 110 if (m_request) {
115 InspectorInstrumentation::AsyncTask asyncTask( 111 probe::AsyncTask asyncTask(m_request->getExecutionContext(), this);
116 m_request->getExecutionContext(), this);
117 m_request->onSuccess(std::move(db), IDBDatabaseMetadata(metadata)); 112 m_request->onSuccess(std::move(db), IDBDatabaseMetadata(metadata));
118 } else if (db) { 113 } else if (db) {
119 db->close(); 114 db->close();
120 } 115 }
121 } 116 }
122 117
123 void WebIDBCallbacksImpl::onSuccess(const WebIDBKey& key) { 118 void WebIDBCallbacksImpl::onSuccess(const WebIDBKey& key) {
124 if (!m_request) 119 if (!m_request)
125 return; 120 return;
126 121
127 InspectorInstrumentation::AsyncTask asyncTask( 122 probe::AsyncTask asyncTask(m_request->getExecutionContext(), this);
128 m_request->getExecutionContext(), this);
129 m_request->onSuccess(key); 123 m_request->onSuccess(key);
130 } 124 }
131 125
132 void WebIDBCallbacksImpl::onSuccess(const WebIDBValue& value) { 126 void WebIDBCallbacksImpl::onSuccess(const WebIDBValue& value) {
133 if (!m_request) 127 if (!m_request)
134 return; 128 return;
135 129
136 InspectorInstrumentation::AsyncTask asyncTask( 130 probe::AsyncTask asyncTask(m_request->getExecutionContext(), this);
137 m_request->getExecutionContext(), this);
138 m_request->onSuccess(IDBValue::create(value, m_request->isolate())); 131 m_request->onSuccess(IDBValue::create(value, m_request->isolate()));
139 } 132 }
140 133
141 void WebIDBCallbacksImpl::onSuccess(const WebVector<WebIDBValue>& values) { 134 void WebIDBCallbacksImpl::onSuccess(const WebVector<WebIDBValue>& values) {
142 if (!m_request) 135 if (!m_request)
143 return; 136 return;
144 137
145 InspectorInstrumentation::AsyncTask asyncTask( 138 probe::AsyncTask asyncTask(m_request->getExecutionContext(), this);
146 m_request->getExecutionContext(), this);
147 Vector<RefPtr<IDBValue>> idbValues(values.size()); 139 Vector<RefPtr<IDBValue>> idbValues(values.size());
148 for (size_t i = 0; i < values.size(); ++i) 140 for (size_t i = 0; i < values.size(); ++i)
149 idbValues[i] = IDBValue::create(values[i], m_request->isolate()); 141 idbValues[i] = IDBValue::create(values[i], m_request->isolate());
150 m_request->onSuccess(idbValues); 142 m_request->onSuccess(idbValues);
151 } 143 }
152 144
153 void WebIDBCallbacksImpl::onSuccess(long long value) { 145 void WebIDBCallbacksImpl::onSuccess(long long value) {
154 if (!m_request) 146 if (!m_request)
155 return; 147 return;
156 148
157 InspectorInstrumentation::AsyncTask asyncTask( 149 probe::AsyncTask asyncTask(m_request->getExecutionContext(), this);
158 m_request->getExecutionContext(), this);
159 m_request->onSuccess(value); 150 m_request->onSuccess(value);
160 } 151 }
161 152
162 void WebIDBCallbacksImpl::onSuccess() { 153 void WebIDBCallbacksImpl::onSuccess() {
163 if (!m_request) 154 if (!m_request)
164 return; 155 return;
165 156
166 InspectorInstrumentation::AsyncTask asyncTask( 157 probe::AsyncTask asyncTask(m_request->getExecutionContext(), this);
167 m_request->getExecutionContext(), this);
168 m_request->onSuccess(); 158 m_request->onSuccess();
169 } 159 }
170 160
171 void WebIDBCallbacksImpl::onSuccess(const WebIDBKey& key, 161 void WebIDBCallbacksImpl::onSuccess(const WebIDBKey& key,
172 const WebIDBKey& primaryKey, 162 const WebIDBKey& primaryKey,
173 const WebIDBValue& value) { 163 const WebIDBValue& value) {
174 if (!m_request) 164 if (!m_request)
175 return; 165 return;
176 166
177 InspectorInstrumentation::AsyncTask asyncTask( 167 probe::AsyncTask asyncTask(m_request->getExecutionContext(), this);
178 m_request->getExecutionContext(), this);
179 m_request->onSuccess(key, primaryKey, 168 m_request->onSuccess(key, primaryKey,
180 IDBValue::create(value, m_request->isolate())); 169 IDBValue::create(value, m_request->isolate()));
181 } 170 }
182 171
183 void WebIDBCallbacksImpl::onBlocked(long long oldVersion) { 172 void WebIDBCallbacksImpl::onBlocked(long long oldVersion) {
184 if (!m_request) 173 if (!m_request)
185 return; 174 return;
186 175
187 InspectorInstrumentation::AsyncTask asyncTask( 176 probe::AsyncTask asyncTask(m_request->getExecutionContext(), this);
188 m_request->getExecutionContext(), this);
189 m_request->onBlocked(oldVersion); 177 m_request->onBlocked(oldVersion);
190 } 178 }
191 179
192 void WebIDBCallbacksImpl::onUpgradeNeeded(long long oldVersion, 180 void WebIDBCallbacksImpl::onUpgradeNeeded(long long oldVersion,
193 WebIDBDatabase* database, 181 WebIDBDatabase* database,
194 const WebIDBMetadata& metadata, 182 const WebIDBMetadata& metadata,
195 unsigned short dataLoss, 183 unsigned short dataLoss,
196 WebString dataLossMessage) { 184 WebString dataLossMessage) {
197 std::unique_ptr<WebIDBDatabase> db = WTF::wrapUnique(database); 185 std::unique_ptr<WebIDBDatabase> db = WTF::wrapUnique(database);
198 if (m_request) { 186 if (m_request) {
199 InspectorInstrumentation::AsyncTask asyncTask( 187 probe::AsyncTask asyncTask(m_request->getExecutionContext(), this);
200 m_request->getExecutionContext(), this);
201 m_request->onUpgradeNeeded( 188 m_request->onUpgradeNeeded(
202 oldVersion, std::move(db), IDBDatabaseMetadata(metadata), 189 oldVersion, std::move(db), IDBDatabaseMetadata(metadata),
203 static_cast<WebIDBDataLoss>(dataLoss), dataLossMessage); 190 static_cast<WebIDBDataLoss>(dataLoss), dataLossMessage);
204 } else { 191 } else {
205 db->close(); 192 db->close();
206 } 193 }
207 } 194 }
208 195
209 void WebIDBCallbacksImpl::detach() { 196 void WebIDBCallbacksImpl::detach() {
210 m_request.clear(); 197 m_request.clear();
211 } 198 }
212 199
213 } // namespace blink 200 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698