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

Unified Diff: third_party/WebKit/Source/modules/permissions/PermissionsCallback.h

Issue 1360023005: permissions: remove duplicates from request multiple at the Blink level (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@refactor-permissions
Patch Set: Address review comments Created 5 years, 2 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/permissions/PermissionsCallback.h
diff --git a/third_party/WebKit/Source/modules/permissions/PermissionsCallback.h b/third_party/WebKit/Source/modules/permissions/PermissionsCallback.h
index feef2872bb09a55814d50f4825eef681094489fe..3800a78e4ed2ca609fd1bb2fd57694b8764488f4 100644
--- a/third_party/WebKit/Source/modules/permissions/PermissionsCallback.h
+++ b/third_party/WebKit/Source/modules/permissions/PermissionsCallback.h
@@ -26,7 +26,7 @@ class ScriptPromiseResolver;
class PermissionsCallback final
: public WebCallbacks<WebPassOwnPtr<WebVector<WebPermissionStatus>>, void> {
public:
- PermissionsCallback(ScriptPromiseResolver*, PassOwnPtr<WebVector<WebPermissionType>>);
+ PermissionsCallback(ScriptPromiseResolver*, PassOwnPtr<Vector<WebPermissionType>>, PassOwnPtr<Vector<int>>);
~PermissionsCallback() = default;
void onSuccess(WebPassOwnPtr<WebVector<WebPermissionStatus>>) override;
@@ -34,7 +34,14 @@ public:
private:
Persistent<ScriptPromiseResolver> m_resolver;
- OwnPtr<WebVector<WebPermissionType>> m_permissionTypes;
+
+ // The permission types which were passed to the client to be requested.
+ OwnPtr<Vector<WebPermissionType>> m_internalPermissions;
+
+ // Maps each index in the caller vector to the corresponding index in the
+ // internal vector (i.e. the vector passsed to the client) such that both
+ // indices have the same WebPermissionType.
+ OwnPtr<Vector<int>> m_callerIndexToInternalIndex;
WTF_MAKE_NONCOPYABLE(PermissionsCallback);
};

Powered by Google App Engine
This is Rietveld 408576698