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

Unified Diff: chrome/browser/resources/cryptotoken/gstaticorigincheck.js

Issue 799923007: Enable 3rd party support for Security Keys. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove duplicate line from merge Created 6 years 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: chrome/browser/resources/cryptotoken/gstaticorigincheck.js
diff --git a/chrome/browser/resources/cryptotoken/gstaticorigincheck.js b/chrome/browser/resources/cryptotoken/gstaticorigincheck.js
deleted file mode 100644
index 8ea48b55fdf97ea6009bca1be870014c7af9d598..0000000000000000000000000000000000000000
--- a/chrome/browser/resources/cryptotoken/gstaticorigincheck.js
+++ /dev/null
@@ -1,51 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-/**
- * @fileoverview Implements a check whether an origin is allowed to assert an
- * app id based on a fixed set of allowed app ids for the google.com domain.
- *
- */
-'use strict';
-
-/**
- * Implements half of the app id policy: whether an origin is allowed to claim
- * an app id. For checking whether the app id also lists the origin,
- * @see AppIdChecker.
- * @implements OriginChecker
- * @constructor
- */
-function GstaticOriginChecker() {
-}
-
-/**
- * Checks whether the origin is allowed to claim the app ids.
- * @param {string} origin The origin claiming the app id.
- * @param {!Array.<string>} appIds The app ids being claimed.
- * @return {Promise.<boolean>} A promise for the result of the check.
- */
-GstaticOriginChecker.prototype.canClaimAppIds = function(origin, appIds) {
- return Promise.resolve(appIds.every(this.checkAppId_.bind(this, origin)));
-};
-
-/**
- * Checks if a single appId can be asserted by the given origin.
- * @param {string} origin The origin.
- * @param {string} appId The appId to check.
- * @return {boolean} Whether the given origin can assert the app id.
- * @private
- */
-GstaticOriginChecker.prototype.checkAppId_ = function(origin, appId) {
- if (appId == origin) {
- // Trivially allowed
- return true;
- }
- var anchor = document.createElement('a');
- anchor.href = origin;
- if (/google.com$/.test(anchor.hostname)) {
- return (appId.indexOf('https://www.gstatic.com') == 0 ||
- appId.indexOf('https://static.corp.google.com') == 0);
- }
- return false;
-};
« no previous file with comments | « chrome/browser/resources/cryptotoken/googleapprovedorigins.js ('k') | chrome/browser/resources/cryptotoken/manifest.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698