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

Unified Diff: Source/modules/permissions/Permissions.cpp

Issue 1054663002: Implement Permission change observing in Blink. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: relax assert Created 5 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 side-by-side diff with in-line comments
Download patch
Index: Source/modules/permissions/Permissions.cpp
diff --git a/Source/modules/permissions/Permissions.cpp b/Source/modules/permissions/Permissions.cpp
index 0fdb4d44b5e335c9a03b5f11e047e8eb1c72a1aa..264111075552b457c6a3b5bee0a7bc30f59bbf13 100644
--- a/Source/modules/permissions/Permissions.cpp
+++ b/Source/modules/permissions/Permissions.cpp
@@ -64,9 +64,9 @@ ScriptPromise Permissions::query(ScriptState* scriptState, const ScriptValue& ra
type = WebPermissionTypeNotifications;
} else if (name == "push") {
PushPermissionDescriptor pushPermission = NativeValueTraits<PushPermissionDescriptor>::nativeValue(scriptState->isolate(), rawPermission.v8Value(), exceptionState);
- // The only "userVisible" push is supported for now.
+ // Only "userVisible" push is supported for now.
if (!pushPermission.userVisible()) {
- resolver->resolve(new PermissionStatus(scriptState->executionContext(), WebPermissionStatusDenied));
+ resolver->resolve(PermissionStatus::create(scriptState->executionContext(), WebPermissionStatusDenied, WebPermissionTypePush));
return promise;
}
type = WebPermissionTypePushNotifications;
@@ -74,7 +74,7 @@ ScriptPromise Permissions::query(ScriptState* scriptState, const ScriptValue& ra
MidiPermissionDescriptor midiPermission = NativeValueTraits<MidiPermissionDescriptor>::nativeValue(scriptState->isolate(), rawPermission.v8Value(), exceptionState);
// Only sysex usage requires a permission for now.
if (!midiPermission.sysex()) {
- resolver->resolve(new PermissionStatus(scriptState->executionContext(), WebPermissionStatusGranted));
+ resolver->resolve(PermissionStatus::create(scriptState->executionContext(), WebPermissionStatusGranted, WebPermissionTypeMidi));
return promise;
}
type = WebPermissionTypeMidiSysEx;
« no previous file with comments | « Source/modules/permissions/PermissionStatus.idl ('k') | public/platform/modules/permissions/WebPermissionClient.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698