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

Unified Diff: third_party/WebKit/Source/core/html/HTMLIFrameElementPermissions.cpp

Issue 2682953002: Make delegated permissions use mojo generated -permissions. (Closed)
Patch Set: Created 3 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/core/html/HTMLIFrameElementPermissions.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLIFrameElementPermissions.cpp b/third_party/WebKit/Source/core/html/HTMLIFrameElementPermissions.cpp
index 8e22e8b423f4e83299e8bf0496d21c3c74e72954..3c398295df412df38a7c8af40c591a33e305b175 100644
--- a/third_party/WebKit/Source/core/html/HTMLIFrameElementPermissions.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLIFrameElementPermissions.cpp
@@ -5,6 +5,7 @@
#include "core/html/HTMLIFrameElementPermissions.h"
#include "core/html/HTMLIFrameElement.h"
+#include "public/platform/modules/permissions/permission.mojom-blink.h"
raymes 2017/02/08 23:07:48 nit: This is in the header so it's not needed here
riju_ 2017/02/09 07:53:44 Done.
#include "wtf/HashMap.h"
#include "wtf/text/StringBuilder.h"
@@ -14,17 +15,18 @@ namespace {
struct SupportedPermission {
const char* name;
- WebPermissionType type;
+ mojom::blink::PermissionName type;
};
const SupportedPermission kSupportedPermissions[] = {
- {"geolocation", WebPermissionTypeGeolocation},
- {"notifications", WebPermissionTypeNotifications},
- {"midi", WebPermissionTypeMidiSysEx},
+ {"geolocation", mojom::blink::PermissionName::GEOLOCATION},
+ {"notifications", mojom::blink::PermissionName::NOTIFICATIONS},
+ {"midi", mojom::blink::PermissionName::MIDI},
};
// Returns true if the name is valid and the type is stored in |result|.
-bool getPermissionType(const AtomicString& name, WebPermissionType* result) {
+bool getPermissionType(const AtomicString& name,
+ mojom::blink::PermissionName* result) {
for (const SupportedPermission& permission : kSupportedPermissions) {
if (name == permission.name) {
if (result)
@@ -49,16 +51,16 @@ DEFINE_TRACE(HTMLIFrameElementPermissions) {
DOMTokenListObserver::trace(visitor);
}
-Vector<WebPermissionType>
+Vector<mojom::blink::PermissionName>
HTMLIFrameElementPermissions::parseDelegatedPermissions(
String& invalidTokensErrorMessage) const {
- Vector<WebPermissionType> permissions;
+ Vector<blink::mojom::blink::PermissionName> permissions;
unsigned numTokenErrors = 0;
StringBuilder tokenErrors;
const SpaceSplitString& tokens = this->tokens();
for (size_t i = 0; i < tokens.size(); ++i) {
- WebPermissionType type;
+ blink::mojom::blink::PermissionName type;
if (getPermissionType(tokens[i], &type)) {
permissions.push_back(type);
} else {
@@ -86,7 +88,7 @@ HTMLIFrameElementPermissions::parseDelegatedPermissions(
bool HTMLIFrameElementPermissions::validateTokenValue(
const AtomicString& tokenValue,
ExceptionState&) const {
- WebPermissionType unused;
+ mojom::blink::PermissionName unused;
return getPermissionType(tokenValue, &unused);
}

Powered by Google App Engine
This is Rietveld 408576698