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

Unified Diff: third_party/WebKit/Source/bindings/core/v8/PrivateScriptRunner.js

Issue 2571063002: Remove Blink-in-JS (Closed)
Patch Set: Created 4 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: third_party/WebKit/Source/bindings/core/v8/PrivateScriptRunner.js
diff --git a/third_party/WebKit/Source/bindings/core/v8/PrivateScriptRunner.js b/third_party/WebKit/Source/bindings/core/v8/PrivateScriptRunner.js
deleted file mode 100644
index e2571f43f7722dbf99cb78d37b6c9948ff06e6aa..0000000000000000000000000000000000000000
--- a/third_party/WebKit/Source/bindings/core/v8/PrivateScriptRunner.js
+++ /dev/null
@@ -1,148 +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.
-
-"use strict";
-
-function PrivateScriptController()
-{
- this._installedClasses = {};
- this._DOMException = {};
- this._JSError = {};
- // This list must be in sync with the enum in ExceptionCode.h. The order matters.
- var domExceptions = [
- "IndexSizeError",
- "HierarchyRequestError",
- "WrongDocumentError",
- "InvalidCharacterError",
- "NoModificationAllowedError",
- "NotFoundError",
- "NotSupportedError",
- "InUseAttributeError", // Historical. Only used in setAttributeNode etc which have been removed from the DOM specs.
-
- // Introduced in DOM Level 2:
- "InvalidStateError",
- "SyntaxError",
- "InvalidModificationError",
- "NamespaceError",
- "InvalidAccessError",
-
- // Introduced in DOM Level 3:
- "TypeMismatchError", // Historical; use TypeError instead
-
- // XMLHttpRequest extension:
- "SecurityError",
-
- // Others introduced in HTML5:
- "NetworkError",
- "AbortError",
- "URLMismatchError",
- "QuotaExceededError",
- "TimeoutError",
- "InvalidNodeTypeError",
- "DataCloneError",
-
- // These are IDB-specific.
- "UnknownError",
- "ConstraintError",
- "DataError",
- "TransactionInactiveError",
- "ReadOnlyError",
- "VersionError",
-
- // File system
- "NotReadableError",
- "EncodingError",
- "PathExistsError",
-
- // SQL
- "SQLDatabaseError", // Naming conflict with DatabaseError class.
-
- // Web Crypto
- "OperationError",
-
- // Push API
- "PermissionDeniedError",
-
- // Pointer Events
- "InvalidPointerId",
- ];
-
- // This list must be in sync with the enum in ExceptionCode.h. The order matters.
- var jsErrors = [
- "Error",
- "TypeError",
- "RangeError",
- "SyntaxError",
- "ReferenceError",
- ];
-
- var code = 1;
- domExceptions.forEach(function (exception) {
- this._DOMException[exception] = code;
- ++code;
- }.bind(this));
-
- var code = 1000;
- jsErrors.forEach(function (exception) {
- this._JSError[exception] = code;
- ++code;
- }.bind(this));
-}
-
-PrivateScriptController.prototype = {
- get installedClasses()
- {
- return this._installedClasses;
- },
-
- get DOMException()
- {
- return this._DOMException;
- },
-
- get JSError()
- {
- return this._JSError;
- },
-
- installClass: function(className, implementation)
- {
- function PrivateScriptClass()
- {
- }
-
- if (!(className in this._installedClasses))
- this._installedClasses[className] = new PrivateScriptClass();
- implementation(this._installedClasses[className]);
- },
-
- // Private scripts can throw JS errors and DOM exceptions as follows:
- // throwException(privateScriptController.DOMException.IndexSizeError, "...");
- // throwException(privateScriptController.JSError.TypeError, "...");
- //
- // Note that normal JS errors thrown by private scripts are treated
- // as real JS errors caused by programming mistake and the execution crashes.
- // If you want to intentially throw JS errors from private scripts,
- // you need to use throwException(privateScriptController.JSError.TypeError, "...").
- throwException: function(code, message)
- {
- function PrivateScriptException()
- {
- }
-
- var exception = new PrivateScriptException();
- exception.code = code;
- exception.message = message;
- exception.name = "PrivateScriptException";
- throw exception;
- },
-}
-
-if (!window.hasOwnProperty("privateScriptController"))
- window.privateScriptController = new PrivateScriptController();
-
-// This line must be the last statement of this JS file.
-// A parenthesis is needed, because the caller of this script (PrivateScriptRunner.cpp)
-// is depending on the completion value of this script.
-(privateScriptController.installedClasses);

Powered by Google App Engine
This is Rietveld 408576698