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

Unified Diff: third_party/WebKit/Source/modules/indexeddb/InspectorIndexedDBAgent.cpp

Issue 1730383003: DevTools: consistently use Maybe for optional values in the protocol generator. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: more exports Created 4 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/indexeddb/InspectorIndexedDBAgent.cpp
diff --git a/third_party/WebKit/Source/modules/indexeddb/InspectorIndexedDBAgent.cpp b/third_party/WebKit/Source/modules/indexeddb/InspectorIndexedDBAgent.cpp
index c2b3db184dff0d6b39b4879d7cabed9b32bf6cbf..776066b493105ddb875580820bfe85c5e0f017f9 100644
--- a/third_party/WebKit/Source/modules/indexeddb/InspectorIndexedDBAgent.cpp
+++ b/third_party/WebKit/Source/modules/indexeddb/InspectorIndexedDBAgent.cpp
@@ -393,8 +393,9 @@ static IDBKey* idbKeyFromInspectorObject(PassOwnPtr<protocol::IndexedDB::Key> ke
return idbKey;
}
-static IDBKeyRange* idbKeyRangeFromKeyRange(PassOwnPtr<protocol::IndexedDB::KeyRange> keyRange)
+static IDBKeyRange* idbKeyRangeFromKeyRange(const Maybe<protocol::IndexedDB::KeyRange>& maybeRange)
{
+ protocol::IndexedDB::KeyRange* keyRange = maybeRange.fromJust();
dgozman 2016/02/24 23:17:43 Let's pass raw pointer to this method since it alr
pfeldman 2016/02/24 23:38:39 Done.
IDBKey* idbLower = idbKeyFromInspectorObject(keyRange->getLower(nullptr));
if (keyRange->hasLower() && !idbLower)
return nullptr;
@@ -686,7 +687,15 @@ void InspectorIndexedDBAgent::requestDatabase(ErrorString* errorString, const St
databaseLoader->start(idbFactory, document->securityOrigin(), databaseName);
}
-void InspectorIndexedDBAgent::requestData(ErrorString* errorString, const String& securityOrigin, const String& databaseName, const String& objectStoreName, const String& indexName, int skipCount, int pageSize, PassOwnPtr<protocol::IndexedDB::KeyRange> keyRange, const PassRefPtr<RequestDataCallback> requestCallback)
+void InspectorIndexedDBAgent::requestData(ErrorString* errorString,
+ const String& securityOrigin,
+ const String& databaseName,
+ const String& objectStoreName,
+ const String& indexName,
+ int skipCount,
+ int pageSize,
+ const Maybe<protocol::IndexedDB::KeyRange>& keyRange,
+ const PassRefPtr<RequestDataCallback> requestCallback)
{
LocalFrame* frame = m_inspectedFrames->frameWithSecurityOrigin(securityOrigin);
Document* document = assertDocument(errorString, frame);
@@ -696,8 +705,8 @@ void InspectorIndexedDBAgent::requestData(ErrorString* errorString, const String
if (!idbFactory)
return;
- IDBKeyRange* idbKeyRange = keyRange ? idbKeyRangeFromKeyRange(keyRange) : nullptr;
- if (keyRange && !idbKeyRange) {
+ IDBKeyRange* idbKeyRange = keyRange.isJust() ? idbKeyRangeFromKeyRange(keyRange) : nullptr;
+ if (keyRange.isJust() && !idbKeyRange) {
*errorString = "Can not parse key range.";
return;
}

Powered by Google App Engine
This is Rietveld 408576698