summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoryzshen@chromium.org <yzshen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-02 17:26:54 +0000
committeryzshen@chromium.org <yzshen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-02 17:26:54 +0000
commit836a7e224691d75571f754e1749f434d76f1692d (patch)
tree3ddbba7f87161af43f106011f37ea191fed54212
parent7ec7ecbf9f9223c1c27c88f49aac863a28903ca3 (diff)
downloadchromium_src-836a7e224691d75571f754e1749f434d76f1692d.zip
chromium_src-836a7e224691d75571f754e1749f434d76f1692d.tar.gz
chromium_src-836a7e224691d75571f754e1749f434d76f1692d.tar.bz2
Revert 124660 - Allow comments in extension config files.
Added a script to remove comments from the extension api JSON files before processing for the extension docs. We will now be able to comment in the JSON files, and they should be much easier to read. Also added the license header to all the JSON files. BUG=114233 TEST=Put comments in one of the JSON files and remake the docs. They will make with no problems. Review URL: http://codereview.chromium.org/9447090 TBR=cduvall@chromium.org Review URL: https://chromiumcodereview.appspot.com/9582013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@124675 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/common/extensions/api/bookmarks.json4
-rw-r--r--chrome/common/extensions/api/browserAction.json4
-rw-r--r--chrome/common/extensions/api/browsingData.json4
-rw-r--r--chrome/common/extensions/api/chromeAuthPrivate.json4
-rw-r--r--chrome/common/extensions/api/chromePrivate.json4
-rw-r--r--chrome/common/extensions/api/chromeosInfoPrivate.json4
-rw-r--r--chrome/common/extensions/api/contentSettings.json4
-rw-r--r--chrome/common/extensions/api/contextMenus.json4
-rw-r--r--chrome/common/extensions/api/cookies.json4
-rw-r--r--chrome/common/extensions/api/debugger.json4
-rw-r--r--chrome/common/extensions/api/devtools.json4
-rw-r--r--chrome/common/extensions/api/devtools_api.json4
-rw-r--r--chrome/common/extensions/api/experimental.accessibility.json4
-rw-r--r--chrome/common/extensions/api/experimental.app.json4
-rw-r--r--chrome/common/extensions/api/experimental.bookmarkManager.json4
-rw-r--r--chrome/common/extensions/api/experimental.declarative.json4
-rw-r--r--chrome/common/extensions/api/experimental.dns.json4
-rw-r--r--chrome/common/extensions/api/experimental.downloads.json4
-rw-r--r--chrome/common/extensions/api/experimental.extension.json4
-rw-r--r--chrome/common/extensions/api/experimental.fonts.json4
-rw-r--r--chrome/common/extensions/api/experimental.infobars.json4
-rw-r--r--chrome/common/extensions/api/experimental.input.ui.json4
-rw-r--r--chrome/common/extensions/api/experimental.input.virtualKeyboard.json4
-rw-r--r--chrome/common/extensions/api/experimental.keybinding.json4
-rw-r--r--chrome/common/extensions/api/experimental.processes.json4
-rw-r--r--chrome/common/extensions/api/experimental.rlz.json4
-rw-r--r--chrome/common/extensions/api/experimental.serial.json4
-rw-r--r--chrome/common/extensions/api/experimental.socket.json4
-rw-r--r--chrome/common/extensions/api/experimental.speechInput.json4
-rw-r--r--chrome/common/extensions/api/experimental.topSites.json4
-rw-r--r--chrome/common/extensions/api/extension.json4
-rw-r--r--chrome/common/extensions/api/fileBrowserHandler.json4
-rw-r--r--chrome/common/extensions/api/fileBrowserPrivate.json4
-rw-r--r--chrome/common/extensions/api/history.json4
-rw-r--r--chrome/common/extensions/api/i18n.json4
-rw-r--r--chrome/common/extensions/api/idle.json4
-rw-r--r--chrome/common/extensions/api/input.ime.json4
-rw-r--r--chrome/common/extensions/api/inputMethodPrivate.json4
-rw-r--r--chrome/common/extensions/api/management.json4
-rw-r--r--chrome/common/extensions/api/mediaPlayerPrivate.json4
-rw-r--r--chrome/common/extensions/api/metricsPrivate.json4
-rw-r--r--chrome/common/extensions/api/omnibox.json4
-rw-r--r--chrome/common/extensions/api/pageAction.json4
-rw-r--r--chrome/common/extensions/api/pageActions.json4
-rw-r--r--chrome/common/extensions/api/pageCapture.json4
-rw-r--r--chrome/common/extensions/api/permissions.json4
-rw-r--r--chrome/common/extensions/api/privacy.json4
-rw-r--r--chrome/common/extensions/api/proxy.json4
-rw-r--r--chrome/common/extensions/api/storage.json4
-rw-r--r--chrome/common/extensions/api/systemPrivate.json4
-rw-r--r--chrome/common/extensions/api/tabs.json4
-rw-r--r--chrome/common/extensions/api/terminalPrivate.json4
-rw-r--r--chrome/common/extensions/api/test.json4
-rw-r--r--chrome/common/extensions/api/tts.json4
-rw-r--r--chrome/common/extensions/api/ttsEngine.json4
-rw-r--r--chrome/common/extensions/api/types.json4
-rw-r--r--chrome/common/extensions/api/webNavigation.json4
-rw-r--r--chrome/common/extensions/api/webRequest.json4
-rw-r--r--chrome/common/extensions/api/webSocketProxyPrivate.json4
-rw-r--r--chrome/common/extensions/api/webstorePrivate.json4
-rw-r--r--chrome/common/extensions/api/windows.json4
-rw-r--r--chrome/common/extensions/docs/build/directory.py4
-rw-r--r--chrome/common/extensions/docs/js/api_page_generator.js4
-rw-r--r--chrome/common/extensions/docs/template/page_shell.html3
-rw-r--r--third_party/json_minify/README35
-rw-r--r--third_party/json_minify/README.chromium14
-rw-r--r--third_party/json_minify/__init__.py1
-rw-r--r--third_party/json_minify/minify-sans-regexp.js91
-rw-r--r--third_party/json_minify/minify_json.py112
-rw-r--r--tools/json_schema_compiler/compiler.py8
-rw-r--r--tools/json_schema_compiler/cpp_type_generator_test.py8
-rw-r--r--tools/json_schema_compiler/json_schema.py19
-rw-r--r--tools/json_schema_compiler/model_test.py8
-rwxr-xr-xtools/json_schema_compiler/previewserver.py8
74 files changed, 21 insertions, 538 deletions
diff --git a/chrome/common/extensions/api/bookmarks.json b/chrome/common/extensions/api/bookmarks.json
index c507aad..8d115f4 100644
--- a/chrome/common/extensions/api/bookmarks.json
+++ b/chrome/common/extensions/api/bookmarks.json
@@ -1,7 +1,3 @@
-// Copyright (c) 2012 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.
-
[
{
"namespace": "bookmarks",
diff --git a/chrome/common/extensions/api/browserAction.json b/chrome/common/extensions/api/browserAction.json
index c6f2d6e..b051608 100644
--- a/chrome/common/extensions/api/browserAction.json
+++ b/chrome/common/extensions/api/browserAction.json
@@ -1,7 +1,3 @@
-// Copyright (c) 2012 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.
-
[
{
"namespace": "browserAction",
diff --git a/chrome/common/extensions/api/browsingData.json b/chrome/common/extensions/api/browsingData.json
index 8848f6e..d077277 100644
--- a/chrome/common/extensions/api/browsingData.json
+++ b/chrome/common/extensions/api/browsingData.json
@@ -1,7 +1,3 @@
-// Copyright (c) 2012 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.
-
[
{
"namespace": "browsingData",
diff --git a/chrome/common/extensions/api/chromeAuthPrivate.json b/chrome/common/extensions/api/chromeAuthPrivate.json
index 9f29fe7..92b3550 100644
--- a/chrome/common/extensions/api/chromeAuthPrivate.json
+++ b/chrome/common/extensions/api/chromeAuthPrivate.json
@@ -1,7 +1,3 @@
-// Copyright (c) 2012 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.
-
[
{
"namespace": "chromeAuthPrivate",
diff --git a/chrome/common/extensions/api/chromePrivate.json b/chrome/common/extensions/api/chromePrivate.json
index d5b4168..0cb05ac 100644
--- a/chrome/common/extensions/api/chromePrivate.json
+++ b/chrome/common/extensions/api/chromePrivate.json
@@ -1,7 +1,3 @@
-// Copyright (c) 2012 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.
-
[
{
"namespace": "chromePrivate",
diff --git a/chrome/common/extensions/api/chromeosInfoPrivate.json b/chrome/common/extensions/api/chromeosInfoPrivate.json
index e2cd008..0779ef72 100644
--- a/chrome/common/extensions/api/chromeosInfoPrivate.json
+++ b/chrome/common/extensions/api/chromeosInfoPrivate.json
@@ -1,7 +1,3 @@
-// Copyright (c) 2012 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.
-
[
{
"namespace": "chromeosInfoPrivate",
diff --git a/chrome/common/extensions/api/contentSettings.json b/chrome/common/extensions/api/contentSettings.json
index 2d6e803..74396bf 100644
--- a/chrome/common/extensions/api/contentSettings.json
+++ b/chrome/common/extensions/api/contentSettings.json
@@ -1,7 +1,3 @@
-// Copyright (c) 2012 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.
-
[
{
"namespace": "contentSettings",
diff --git a/chrome/common/extensions/api/contextMenus.json b/chrome/common/extensions/api/contextMenus.json
index aa38a6f..aa60918 100644
--- a/chrome/common/extensions/api/contextMenus.json
+++ b/chrome/common/extensions/api/contextMenus.json
@@ -1,7 +1,3 @@
-// Copyright (c) 2012 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.
-
[
{
"namespace": "contextMenus",
diff --git a/chrome/common/extensions/api/cookies.json b/chrome/common/extensions/api/cookies.json
index fd3a633..d70afa8 100644
--- a/chrome/common/extensions/api/cookies.json
+++ b/chrome/common/extensions/api/cookies.json
@@ -1,7 +1,3 @@
-// Copyright (c) 2012 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.
-
[
{
"namespace": "cookies",
diff --git a/chrome/common/extensions/api/debugger.json b/chrome/common/extensions/api/debugger.json
index c34e41c..5642b14 100644
--- a/chrome/common/extensions/api/debugger.json
+++ b/chrome/common/extensions/api/debugger.json
@@ -1,7 +1,3 @@
-// Copyright (c) 2012 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.
-
[
{
"namespace": "debugger",
diff --git a/chrome/common/extensions/api/devtools.json b/chrome/common/extensions/api/devtools.json
index 4a6d9df..a37576c 100644
--- a/chrome/common/extensions/api/devtools.json
+++ b/chrome/common/extensions/api/devtools.json
@@ -1,7 +1,3 @@
-// Copyright (c) 2012 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.
-
[
{
"namespace": "devtools",
diff --git a/chrome/common/extensions/api/devtools_api.json b/chrome/common/extensions/api/devtools_api.json
index 4d21eed..591cdfb 100644
--- a/chrome/common/extensions/api/devtools_api.json
+++ b/chrome/common/extensions/api/devtools_api.json
@@ -1,7 +1,3 @@
-// Copyright (c) 2012 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.
-
[
{
"namespace": "devtools.inspectedWindow",
diff --git a/chrome/common/extensions/api/experimental.accessibility.json b/chrome/common/extensions/api/experimental.accessibility.json
index 23b785a..5cc2ae6 100644
--- a/chrome/common/extensions/api/experimental.accessibility.json
+++ b/chrome/common/extensions/api/experimental.accessibility.json
@@ -1,7 +1,3 @@
-// Copyright (c) 2012 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.
-
[
{
"namespace": "experimental.accessibility",
diff --git a/chrome/common/extensions/api/experimental.app.json b/chrome/common/extensions/api/experimental.app.json
index a8cdc07..e410d97 100644
--- a/chrome/common/extensions/api/experimental.app.json
+++ b/chrome/common/extensions/api/experimental.app.json
@@ -1,7 +1,3 @@
-// Copyright (c) 2012 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.
-
[
{
"namespace":"experimental.app",
diff --git a/chrome/common/extensions/api/experimental.bookmarkManager.json b/chrome/common/extensions/api/experimental.bookmarkManager.json
index 9d130c8..48dae6e 100644
--- a/chrome/common/extensions/api/experimental.bookmarkManager.json
+++ b/chrome/common/extensions/api/experimental.bookmarkManager.json
@@ -1,7 +1,3 @@
-// Copyright (c) 2012 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.
-
[
{
"namespace": "experimental.bookmarkManager",
diff --git a/chrome/common/extensions/api/experimental.declarative.json b/chrome/common/extensions/api/experimental.declarative.json
index f75421e..aebed718 100644
--- a/chrome/common/extensions/api/experimental.declarative.json
+++ b/chrome/common/extensions/api/experimental.declarative.json
@@ -1,7 +1,3 @@
-// Copyright (c) 2012 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.
-
[
{
"namespace": "experimental.declarative",
diff --git a/chrome/common/extensions/api/experimental.dns.json b/chrome/common/extensions/api/experimental.dns.json
index 2e99d68..ea819cf 100644
--- a/chrome/common/extensions/api/experimental.dns.json
+++ b/chrome/common/extensions/api/experimental.dns.json
@@ -1,7 +1,3 @@
-// Copyright (c) 2012 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.
-
[
{
"namespace": "experimental.dns",
diff --git a/chrome/common/extensions/api/experimental.downloads.json b/chrome/common/extensions/api/experimental.downloads.json
index 7e2c8c4..0df9c35 100644
--- a/chrome/common/extensions/api/experimental.downloads.json
+++ b/chrome/common/extensions/api/experimental.downloads.json
@@ -1,7 +1,3 @@
-// Copyright (c) 2012 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.
-
[
{
"namespace": "experimental.downloads",
diff --git a/chrome/common/extensions/api/experimental.extension.json b/chrome/common/extensions/api/experimental.extension.json
index 5eae7bf..907f5ff 100644
--- a/chrome/common/extensions/api/experimental.extension.json
+++ b/chrome/common/extensions/api/experimental.extension.json
@@ -1,7 +1,3 @@
-// Copyright (c) 2012 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.
-
[
{
"namespace": "experimental.extension",
diff --git a/chrome/common/extensions/api/experimental.fonts.json b/chrome/common/extensions/api/experimental.fonts.json
index 98ce2eb..13c3ff0 100644
--- a/chrome/common/extensions/api/experimental.fonts.json
+++ b/chrome/common/extensions/api/experimental.fonts.json
@@ -1,7 +1,3 @@
-// Copyright (c) 2012 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.
-
[
{
"namespace": "experimental.fontSettings",
diff --git a/chrome/common/extensions/api/experimental.infobars.json b/chrome/common/extensions/api/experimental.infobars.json
index f7d797d..7bffdc3 100644
--- a/chrome/common/extensions/api/experimental.infobars.json
+++ b/chrome/common/extensions/api/experimental.infobars.json
@@ -1,7 +1,3 @@
-// Copyright (c) 2012 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.
-
[
{
"namespace": "experimental.infobars",
diff --git a/chrome/common/extensions/api/experimental.input.ui.json b/chrome/common/extensions/api/experimental.input.ui.json
index 303d947..95db905 100644
--- a/chrome/common/extensions/api/experimental.input.ui.json
+++ b/chrome/common/extensions/api/experimental.input.ui.json
@@ -1,7 +1,3 @@
-// Copyright (c) 2012 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.
-
[
{
"namespace": "experimental.input.ui",
diff --git a/chrome/common/extensions/api/experimental.input.virtualKeyboard.json b/chrome/common/extensions/api/experimental.input.virtualKeyboard.json
index 6845d8f..0812017 100644
--- a/chrome/common/extensions/api/experimental.input.virtualKeyboard.json
+++ b/chrome/common/extensions/api/experimental.input.virtualKeyboard.json
@@ -1,7 +1,3 @@
-// Copyright (c) 2012 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.
-
[
{
"namespace": "experimental.input.virtualKeyboard",
diff --git a/chrome/common/extensions/api/experimental.keybinding.json b/chrome/common/extensions/api/experimental.keybinding.json
index 3816cbb..93a314e 100644
--- a/chrome/common/extensions/api/experimental.keybinding.json
+++ b/chrome/common/extensions/api/experimental.keybinding.json
@@ -1,7 +1,3 @@
-// Copyright (c) 2012 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.
-
[
{
"namespace": "experimental.keybinding",
diff --git a/chrome/common/extensions/api/experimental.processes.json b/chrome/common/extensions/api/experimental.processes.json
index be7cf52..b2f36f3 100644
--- a/chrome/common/extensions/api/experimental.processes.json
+++ b/chrome/common/extensions/api/experimental.processes.json
@@ -1,7 +1,3 @@
-// Copyright (c) 2012 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.
-
[
{
"namespace": "experimental.processes",
diff --git a/chrome/common/extensions/api/experimental.rlz.json b/chrome/common/extensions/api/experimental.rlz.json
index b954a4e..56f1f1c 100644
--- a/chrome/common/extensions/api/experimental.rlz.json
+++ b/chrome/common/extensions/api/experimental.rlz.json
@@ -1,7 +1,3 @@
-// Copyright (c) 2012 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.
-
[
{
"namespace": "experimental.rlz",
diff --git a/chrome/common/extensions/api/experimental.serial.json b/chrome/common/extensions/api/experimental.serial.json
index 579fa18f..f5a225d 100644
--- a/chrome/common/extensions/api/experimental.serial.json
+++ b/chrome/common/extensions/api/experimental.serial.json
@@ -1,7 +1,3 @@
-// Copyright (c) 2012 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.
-
[
{
"namespace": "experimental.serial",
diff --git a/chrome/common/extensions/api/experimental.socket.json b/chrome/common/extensions/api/experimental.socket.json
index 0a66f2f..2cbd770 100644
--- a/chrome/common/extensions/api/experimental.socket.json
+++ b/chrome/common/extensions/api/experimental.socket.json
@@ -1,7 +1,3 @@
-// Copyright (c) 2012 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.
-
[
{
"namespace": "experimental.socket",
diff --git a/chrome/common/extensions/api/experimental.speechInput.json b/chrome/common/extensions/api/experimental.speechInput.json
index 280eb9d..1c7f610 100644
--- a/chrome/common/extensions/api/experimental.speechInput.json
+++ b/chrome/common/extensions/api/experimental.speechInput.json
@@ -1,7 +1,3 @@
-// Copyright (c) 2012 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.
-
[
{
"namespace": "experimental.speechInput",
diff --git a/chrome/common/extensions/api/experimental.topSites.json b/chrome/common/extensions/api/experimental.topSites.json
index 6f247e7..2ff669b 100644
--- a/chrome/common/extensions/api/experimental.topSites.json
+++ b/chrome/common/extensions/api/experimental.topSites.json
@@ -1,7 +1,3 @@
-// Copyright (c) 2012 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.
-
[
{
"namespace": "experimental.topSites",
diff --git a/chrome/common/extensions/api/extension.json b/chrome/common/extensions/api/extension.json
index 79fd472..0ac4a34 100644
--- a/chrome/common/extensions/api/extension.json
+++ b/chrome/common/extensions/api/extension.json
@@ -1,7 +1,3 @@
-// Copyright (c) 2012 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.
-
[
{
"namespace": "extension",
diff --git a/chrome/common/extensions/api/fileBrowserHandler.json b/chrome/common/extensions/api/fileBrowserHandler.json
index 32d54d7..4dce39e 100644
--- a/chrome/common/extensions/api/fileBrowserHandler.json
+++ b/chrome/common/extensions/api/fileBrowserHandler.json
@@ -1,7 +1,3 @@
-// Copyright (c) 2012 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.
-
[
{
"namespace":"fileBrowserHandler",
diff --git a/chrome/common/extensions/api/fileBrowserPrivate.json b/chrome/common/extensions/api/fileBrowserPrivate.json
index a9055db..e2bfe2d 100644
--- a/chrome/common/extensions/api/fileBrowserPrivate.json
+++ b/chrome/common/extensions/api/fileBrowserPrivate.json
@@ -1,7 +1,3 @@
-// Copyright (c) 2012 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.
-
[
{
"namespace":"fileBrowserPrivate",
diff --git a/chrome/common/extensions/api/history.json b/chrome/common/extensions/api/history.json
index c2c0e62..0009891 100644
--- a/chrome/common/extensions/api/history.json
+++ b/chrome/common/extensions/api/history.json
@@ -1,7 +1,3 @@
-// Copyright (c) 2012 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.
-
[
{
"namespace": "history",
diff --git a/chrome/common/extensions/api/i18n.json b/chrome/common/extensions/api/i18n.json
index ca3b81a..6b0a522 100644
--- a/chrome/common/extensions/api/i18n.json
+++ b/chrome/common/extensions/api/i18n.json
@@ -1,7 +1,3 @@
-// Copyright (c) 2012 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.
-
[
{
"namespace": "i18n",
diff --git a/chrome/common/extensions/api/idle.json b/chrome/common/extensions/api/idle.json
index 03ad9af4..ccce790b 100644
--- a/chrome/common/extensions/api/idle.json
+++ b/chrome/common/extensions/api/idle.json
@@ -1,7 +1,3 @@
-// Copyright (c) 2012 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.
-
[
{
"namespace": "idle",
diff --git a/chrome/common/extensions/api/input.ime.json b/chrome/common/extensions/api/input.ime.json
index 9ddcea8..8227c02 100644
--- a/chrome/common/extensions/api/input.ime.json
+++ b/chrome/common/extensions/api/input.ime.json
@@ -1,7 +1,3 @@
-// Copyright (c) 2012 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.
-
[
{
"namespace": "input.ime",
diff --git a/chrome/common/extensions/api/inputMethodPrivate.json b/chrome/common/extensions/api/inputMethodPrivate.json
index 6c44192..8e8a826 100644
--- a/chrome/common/extensions/api/inputMethodPrivate.json
+++ b/chrome/common/extensions/api/inputMethodPrivate.json
@@ -1,7 +1,3 @@
-// Copyright (c) 2012 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.
-
[
{
"namespace": "inputMethodPrivate",
diff --git a/chrome/common/extensions/api/management.json b/chrome/common/extensions/api/management.json
index 6661c85..59408df 100644
--- a/chrome/common/extensions/api/management.json
+++ b/chrome/common/extensions/api/management.json
@@ -1,7 +1,3 @@
-// Copyright (c) 2012 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.
-
[
{
"namespace":"management",
diff --git a/chrome/common/extensions/api/mediaPlayerPrivate.json b/chrome/common/extensions/api/mediaPlayerPrivate.json
index fef30a0..d7b4ea0 100644
--- a/chrome/common/extensions/api/mediaPlayerPrivate.json
+++ b/chrome/common/extensions/api/mediaPlayerPrivate.json
@@ -1,7 +1,3 @@
-// Copyright (c) 2012 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.
-
[
{
"namespace": "mediaPlayerPrivate",
diff --git a/chrome/common/extensions/api/metricsPrivate.json b/chrome/common/extensions/api/metricsPrivate.json
index 0113563..6de64f2 100644
--- a/chrome/common/extensions/api/metricsPrivate.json
+++ b/chrome/common/extensions/api/metricsPrivate.json
@@ -1,7 +1,3 @@
-// Copyright (c) 2012 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.
-
[
{
"namespace": "metricsPrivate",
diff --git a/chrome/common/extensions/api/omnibox.json b/chrome/common/extensions/api/omnibox.json
index bcad742..9b4f66f 100644
--- a/chrome/common/extensions/api/omnibox.json
+++ b/chrome/common/extensions/api/omnibox.json
@@ -1,7 +1,3 @@
-// Copyright (c) 2012 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.
-
[
{
"namespace": "omnibox",
diff --git a/chrome/common/extensions/api/pageAction.json b/chrome/common/extensions/api/pageAction.json
index 9446006..e07f029 100644
--- a/chrome/common/extensions/api/pageAction.json
+++ b/chrome/common/extensions/api/pageAction.json
@@ -1,7 +1,3 @@
-// Copyright (c) 2012 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.
-
[
{
"namespace": "pageAction",
diff --git a/chrome/common/extensions/api/pageActions.json b/chrome/common/extensions/api/pageActions.json
index 7283439..69e5078 100644
--- a/chrome/common/extensions/api/pageActions.json
+++ b/chrome/common/extensions/api/pageActions.json
@@ -1,7 +1,3 @@
-// Copyright (c) 2012 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.
-
[
{
"namespace": "pageActions",
diff --git a/chrome/common/extensions/api/pageCapture.json b/chrome/common/extensions/api/pageCapture.json
index 5b8fe85..13a531e 100644
--- a/chrome/common/extensions/api/pageCapture.json
+++ b/chrome/common/extensions/api/pageCapture.json
@@ -1,7 +1,3 @@
-// Copyright (c) 2012 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.
-
[
{
"namespace": "pageCapture",
diff --git a/chrome/common/extensions/api/permissions.json b/chrome/common/extensions/api/permissions.json
index 4f4b362..377a43f 100644
--- a/chrome/common/extensions/api/permissions.json
+++ b/chrome/common/extensions/api/permissions.json
@@ -1,7 +1,3 @@
-// Copyright (c) 2012 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.
-
[
{
"namespace": "permissions",
diff --git a/chrome/common/extensions/api/privacy.json b/chrome/common/extensions/api/privacy.json
index ea0f9aa..00e8b46 100644
--- a/chrome/common/extensions/api/privacy.json
+++ b/chrome/common/extensions/api/privacy.json
@@ -1,7 +1,3 @@
-// Copyright (c) 2012 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.
-
[
{
"namespace": "privacy",
diff --git a/chrome/common/extensions/api/proxy.json b/chrome/common/extensions/api/proxy.json
index ef8d38a..1b6065a 100644
--- a/chrome/common/extensions/api/proxy.json
+++ b/chrome/common/extensions/api/proxy.json
@@ -1,7 +1,3 @@
-// Copyright (c) 2012 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.
-
[
{
"namespace": "proxy",
diff --git a/chrome/common/extensions/api/storage.json b/chrome/common/extensions/api/storage.json
index b3a7e98..7165941 100644
--- a/chrome/common/extensions/api/storage.json
+++ b/chrome/common/extensions/api/storage.json
@@ -1,7 +1,3 @@
-// Copyright (c) 2012 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.
-
[
{
"namespace": "storage",
diff --git a/chrome/common/extensions/api/systemPrivate.json b/chrome/common/extensions/api/systemPrivate.json
index ec6cc53..7214419 100644
--- a/chrome/common/extensions/api/systemPrivate.json
+++ b/chrome/common/extensions/api/systemPrivate.json
@@ -1,7 +1,3 @@
-// Copyright (c) 2012 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.
-
[
{
"namespace": "systemPrivate",
diff --git a/chrome/common/extensions/api/tabs.json b/chrome/common/extensions/api/tabs.json
index de8ed67..35bffac 100644
--- a/chrome/common/extensions/api/tabs.json
+++ b/chrome/common/extensions/api/tabs.json
@@ -1,7 +1,3 @@
-// Copyright (c) 2012 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.
-
[
{
"namespace": "tabs",
diff --git a/chrome/common/extensions/api/terminalPrivate.json b/chrome/common/extensions/api/terminalPrivate.json
index 7b8802b..74d8cb6 100644
--- a/chrome/common/extensions/api/terminalPrivate.json
+++ b/chrome/common/extensions/api/terminalPrivate.json
@@ -1,7 +1,3 @@
-// Copyright (c) 2012 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.
-
[
{
"namespace": "terminalPrivate",
diff --git a/chrome/common/extensions/api/test.json b/chrome/common/extensions/api/test.json
index 929a53e..7092bb5 100644
--- a/chrome/common/extensions/api/test.json
+++ b/chrome/common/extensions/api/test.json
@@ -1,7 +1,3 @@
-// Copyright (c) 2012 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.
-
[
{
"namespace": "test",
diff --git a/chrome/common/extensions/api/tts.json b/chrome/common/extensions/api/tts.json
index 31e79a1..e54844d 100644
--- a/chrome/common/extensions/api/tts.json
+++ b/chrome/common/extensions/api/tts.json
@@ -1,7 +1,3 @@
-// Copyright (c) 2012 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.
-
[
{
"namespace": "tts",
diff --git a/chrome/common/extensions/api/ttsEngine.json b/chrome/common/extensions/api/ttsEngine.json
index 0fbabb9..1272beb 100644
--- a/chrome/common/extensions/api/ttsEngine.json
+++ b/chrome/common/extensions/api/ttsEngine.json
@@ -1,7 +1,3 @@
-// Copyright (c) 2012 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.
-
[
{
"namespace": "ttsEngine",
diff --git a/chrome/common/extensions/api/types.json b/chrome/common/extensions/api/types.json
index cb52d54..ea272bc 100644
--- a/chrome/common/extensions/api/types.json
+++ b/chrome/common/extensions/api/types.json
@@ -1,7 +1,3 @@
-// Copyright (c) 2012 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.
-
[
{
"namespace": "types",
diff --git a/chrome/common/extensions/api/webNavigation.json b/chrome/common/extensions/api/webNavigation.json
index cbfc720..35d5d50 100644
--- a/chrome/common/extensions/api/webNavigation.json
+++ b/chrome/common/extensions/api/webNavigation.json
@@ -1,7 +1,3 @@
-// Copyright (c) 2012 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.
-
[
{
"namespace": "webNavigation",
diff --git a/chrome/common/extensions/api/webRequest.json b/chrome/common/extensions/api/webRequest.json
index efa378c..d7f90ce 100644
--- a/chrome/common/extensions/api/webRequest.json
+++ b/chrome/common/extensions/api/webRequest.json
@@ -1,7 +1,3 @@
-// Copyright (c) 2012 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.
-
[
{
"namespace": "webRequest",
diff --git a/chrome/common/extensions/api/webSocketProxyPrivate.json b/chrome/common/extensions/api/webSocketProxyPrivate.json
index 4afa792..8dfbc30 100644
--- a/chrome/common/extensions/api/webSocketProxyPrivate.json
+++ b/chrome/common/extensions/api/webSocketProxyPrivate.json
@@ -1,7 +1,3 @@
-// Copyright (c) 2012 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.
-
[
{
"namespace": "webSocketProxyPrivate",
diff --git a/chrome/common/extensions/api/webstorePrivate.json b/chrome/common/extensions/api/webstorePrivate.json
index 64db63c..94a0697 100644
--- a/chrome/common/extensions/api/webstorePrivate.json
+++ b/chrome/common/extensions/api/webstorePrivate.json
@@ -1,7 +1,3 @@
-// Copyright (c) 2012 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.
-
[
{
"namespace":"webstorePrivate",
diff --git a/chrome/common/extensions/api/windows.json b/chrome/common/extensions/api/windows.json
index 8f520f1..2bec764 100644
--- a/chrome/common/extensions/api/windows.json
+++ b/chrome/common/extensions/api/windows.json
@@ -1,7 +1,3 @@
-// Copyright (c) 2012 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.
-
[
{
"namespace": "windows",
diff --git a/chrome/common/extensions/docs/build/directory.py b/chrome/common/extensions/docs/build/directory.py
index 6f49bcf..316e0d6 100644
--- a/chrome/common/extensions/docs/build/directory.py
+++ b/chrome/common/extensions/docs/build/directory.py
@@ -12,7 +12,6 @@ import re
import hashlib
import zipfile
import simplejson as json
-import json_minify as minify
# Make sure we get consistent string sorting behavior by explicitly using the
# default C locale.
@@ -49,8 +48,7 @@ def parse_json_file(path, encoding="utf-8"):
raise Exception("Failed to read the file at %s: %s" % (path, msg))
try:
- json_str = json_file.read()
- json_obj = json.loads(minify.json_minify(json_str), encoding)
+ json_obj = json.load(json_file, encoding)
except ValueError, msg:
raise Exception("Failed to parse JSON out of file %s: %s" % (path, msg))
finally:
diff --git a/chrome/common/extensions/docs/js/api_page_generator.js b/chrome/common/extensions/docs/js/api_page_generator.js
index 944a54b..202854e 100644
--- a/chrome/common/extensions/docs/js/api_page_generator.js
+++ b/chrome/common/extensions/docs/js/api_page_generator.js
@@ -183,7 +183,7 @@ function fetchSchema() {
schema = [];
function onSchemaContent(content) {
- schema = schema.concat(JSON.parse(JSON.minify(content)));
+ schema = schema.concat(JSON.parse(content));
if (++schemas_retrieved < schemas_to_retrieve.length)
return;
if (pageName.toLowerCase() == 'samples') {
@@ -204,7 +204,7 @@ function fetchSchema() {
function fetchSamples() {
// If we're rendering the samples directory, fetch the samples manifest.
fetchContent(SAMPLES, function(sampleManifest) {
- var data = JSON.parse(JSON.minify(sampleManifest));
+ var data = JSON.parse(sampleManifest);
samples = data.samples;
apiMapping = data.api;
renderTemplate();
diff --git a/chrome/common/extensions/docs/template/page_shell.html b/chrome/common/extensions/docs/template/page_shell.html
index 2aaf387..fdca7c6 100644
--- a/chrome/common/extensions/docs/template/page_shell.html
+++ b/chrome/common/extensions/docs/template/page_shell.html
@@ -17,9 +17,6 @@
<script type="text/javascript"
src="../../../third_party/jstemplate/jstemplate_compiled.js">
</script>
- <script type="text/javascript"
- src="../../../../third_party/json_minify/minify-sans-regexp.js">
- </script>
<script type="text/javascript" src="js/api_page_generator.js"></script>
<script type="text/javascript" src="js/bootstrap.js"></script>
<script type="text/javascript" src="js/sidebar.js"></script>
diff --git a/third_party/json_minify/README b/third_party/json_minify/README
deleted file mode 100644
index 98406f2..0000000
--- a/third_party/json_minify/README
+++ /dev/null
@@ -1,35 +0,0 @@
-/*! JSON.minify()
- v0.1 (c) Kyle Simpson
- MIT License
-*/
-
-JSON.minify() minifies blocks of JSON-like content into valid JSON by removing all
-whitespace *and* comments.
-
-JSON parsers (like JavaScript's JSON.parse() parser) generally don't consider JSON
-with comments to be valid and parseable. So, the intended usage is to minify
-development-friendly JSON (with comments) to valid JSON before parsing, such as:
-
-JSON.parse(JSON.minify(str));
-
-Now you can maintain development-friendly JSON documents, but minify them before
-parsing or before transmitting them over-the-wire.
-
-Though comments are not officially part of the JSON standard, this post from
-Douglas Crockford back in late 2005 helps explain the motivation behind this project.
-
-http://tech.groups.yahoo.com/group/json/message/152
-
-"A JSON encoder MUST NOT output comments. A JSON decoder MAY accept and ignore comments."
-
-Basically, comments are not in the JSON *generation* standard, but that doesn't mean
-that a parser can't be taught to ignore them. Which is exactly what JSON.minify()
-is for.
-
-The first implementation of JSON.minify() is in JavaScript, but the intent is to
-port the implementation to as many other environments as possible/practical.
-
-NOTE: As transmitting bloated (ie, with comments/whitespace) JSON would be wasteful
-and silly, this JSON.minify() is intended for use in server-side processing
-environments where you can strip comments/whitespace from JSON before parsing
-a JSON document, or before transmitting such over-the-wire from server to browser. \ No newline at end of file
diff --git a/third_party/json_minify/README.chromium b/third_party/json_minify/README.chromium
deleted file mode 100644
index ba3c05a..0000000
--- a/third_party/json_minify/README.chromium
+++ /dev/null
@@ -1,14 +0,0 @@
-Name: JSON.minify
-URL: https://github.com/getify/JSON.minify
-and also https://github.com/kitcambridge/JSON.minify
-Version: 0.1
-License: MIT License
-Security Critical: no
-
-Description:
-A set of scripts that remove comments and whitespace from JSON files.
-
-Local Modifications:
-- Added the __init__.py file for easier imports
-- Got the (much faster) json-minify-sans-regexp.js file from the second
- URL listed
diff --git a/third_party/json_minify/__init__.py b/third_party/json_minify/__init__.py
deleted file mode 100644
index d2967be..0000000
--- a/third_party/json_minify/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from minify_json import json_minify
diff --git a/third_party/json_minify/minify-sans-regexp.js b/third_party/json_minify/minify-sans-regexp.js
deleted file mode 100644
index 99c817c..0000000
--- a/third_party/json_minify/minify-sans-regexp.js
+++ /dev/null
@@ -1,91 +0,0 @@
-/*!
- * `JSON.minify()`
- * This version does not use regular expressions.
- *
- * Copyright 2011, Kyle Simpson.
- * Copyright 2012, Kit Cambridge.
- *
- * Released under the MIT License.
-*/
-
-;(function () {
- var JSON = this.JSON;
-
- // Create the global JSON object if it doesn't exist.
- if (Object(JSON) !== JSON) {
- JSON = this.JSON = {};
- }
-
- JSON.minify = function (source) {
- var index = 0, length = source.length, result = "", symbol, position;
- while (index < length) {
- symbol = source.charAt(index);
- switch (symbol) {
- // Ignore whitespace tokens. According to ES 5.1 section 15.12.1.1,
- // whitespace tokens include tabs, carriage returns, line feeds, and
- // space characters.
- // -----------------------------------------------------------------
- case "\t":
- case "\r":
- case "\n":
- case " ":
- index += 1;
- break;
- // Ignore line and block comments.
- // -------------------------------
- case "/":
- symbol = source.charAt(index += 1);
- switch (symbol) {
- // Line comments.
- // -------------
- case "/":
- position = source.indexOf("\n", index);
- if (position < 0) {
- // Check for CR-style line endings.
- position = source.indexOf("\r", index);
- }
- index = position > -1 ? position : length;
- break;
- // Block comments.
- // ---------------
- case "*":
- position = source.indexOf("*/", index);
- if (position > -1) {
- // Advance the scanner's position past the end of the comment.
- index = position += 2;
- break;
- }
- throw SyntaxError("Unterminated block comment.");
- default:
- throw SyntaxError("Invalid comment.");
- }
- break;
- // Parse strings separately to ensure that any whitespace characters and
- // JavaScript-style comments within them are preserved.
- // ---------------------------------------------------------------------
- case '"':
- position = index;
- while (index < length) {
- symbol = source.charAt(index += 1);
- if (symbol == "\\") {
- // Skip past escaped characters.
- index += 1;
- } else if (symbol == '"') {
- break;
- }
- }
- if (source.charAt(index) == '"') {
- result += source.slice(position, index += 1);
- break;
- }
- throw SyntaxError("Unterminated string.");
- // Preserve all other characters.
- // ------------------------------
- default:
- result += symbol;
- index += 1;
- }
- }
- return result;
- };
-}).call(this);
diff --git a/third_party/json_minify/minify_json.py b/third_party/json_minify/minify_json.py
deleted file mode 100644
index 9775641..0000000
--- a/third_party/json_minify/minify_json.py
+++ /dev/null
@@ -1,112 +0,0 @@
-'''
-Created on 20/01/2011
-
-v0.1 (C) Gerald Storer
-MIT License
-
-Based on JSON.minify.js:
-https://github.com/getify/JSON.minify
-'''
-
-import re
-
-def json_minify(json,strip_space=True):
- tokenizer=re.compile('"|(/\*)|(\*/)|(//)|\n|\r')
- in_string = False
- in_multiline_comment = False
- in_singleline_comment = False
-
- new_str = []
- from_index = 0 # from is a keyword in Python
-
- for match in re.finditer(tokenizer,json):
-
- if not in_multiline_comment and not in_singleline_comment:
- tmp2 = json[from_index:match.start()]
- if not in_string and strip_space:
- tmp2 = re.sub('[ \t\n\r]*','',tmp2) # replace only white space defined in standard
- new_str.append(tmp2)
-
- from_index = match.end()
-
- if match.group() == '"' and not in_multiline_comment and not in_singleline_comment:
- escaped = re.search('(\\\\)*$',json[:match.start()])
- if not in_string or escaped is None or len(escaped.group()) % 2 == 0:
- # start of string with ", or unescaped " character found to end string
- in_string = not in_string
- from_index -= 1 # include " character in next catch
-
- elif match.group() == '/*' and not in_string and not in_multiline_comment and not in_singleline_comment:
- in_multiline_comment = True
- elif match.group() == '*/' and not in_string and in_multiline_comment and not in_singleline_comment:
- in_multiline_comment = False
- elif match.group() == '//' and not in_string and not in_multiline_comment and not in_singleline_comment:
- in_singleline_comment = True
- elif (match.group() == '\n' or match.group() == '\r') and not in_string and not in_multiline_comment and in_singleline_comment:
- in_singleline_comment = False
- elif not in_multiline_comment and not in_singleline_comment and (
- match.group() not in ['\n','\r',' ','\t'] or not strip_space):
- new_str.append(match.group())
-
- new_str.append(json[from_index:])
- return ''.join(new_str)
-
-if __name__ == '__main__':
- import json # requires Python 2.6+ to run tests
-
- def test_json(s):
- return json.loads(json_minify(s))
-
- test1 = '''// this is a JSON file with comments
-{
- "foo": "bar", // this is cool
- "bar": [
- "baz", "bum", "zam"
- ],
-/* the rest of this document is just fluff
- in case you are interested. */
- "something": 10,
- "else": 20
-}
-
-/* NOTE: You can easily strip the whitespace and comments
- from such a file with the JSON.minify() project hosted
- here on github at http://github.com/getify/JSON.minify
-*/
-'''
-
- test1_res = '''{"foo":"bar","bar":["baz","bum","zam"],"something":10,"else":20}'''
-
- test2 = '''
-{"/*":"*/","//":"",/*"//"*/"/*/"://
-"//"}
-
-'''
- test2_res = '''{"/*":"*/","//":"","/*/":"//"}'''
-
- test3 = r'''/*
-this is a
-multi line comment */{
-
-"foo"
-:
- "bar/*"// something
- , "b\"az":/*
-something else */"blah"
-
-}
-'''
- test3_res = r'''{"foo":"bar/*","b\"az":"blah"}'''
-
- test4 = r'''{"foo": "ba\"r//", "bar\\": "b\\\"a/*z",
- "baz\\\\": /* yay */ "fo\\\\\"*/o"
-}
-'''
- test4_res = r'''{"foo":"ba\"r//","bar\\":"b\\\"a/*z","baz\\\\":"fo\\\\\"*/o"}'''
-
- assert test_json(test1) == json.loads(test1_res),'Failed test 1'
- assert test_json(test2) == json.loads(test2_res),'Failed test 2'
- assert test_json(test3) == json.loads(test3_res),'Failed test 3'
- assert test_json(test4) == json.loads(test4_res),'Failed test 4'
- if __debug__: # Don't print passed message if the asserts didn't run
- print 'Passed all tests' \ No newline at end of file
diff --git a/tools/json_schema_compiler/compiler.py b/tools/json_schema_compiler/compiler.py
index fb84a6c..54ab62f 100644
--- a/tools/json_schema_compiler/compiler.py
+++ b/tools/json_schema_compiler/compiler.py
@@ -19,7 +19,7 @@ Usage example:
import cc_generator
import cpp_type_generator
import h_generator
-from json_schema import LoadJSON
+import json
import model
import optparse
import os.path
@@ -49,7 +49,8 @@ if __name__ == '__main__':
# Actually generate for source file.
- api_defs = LoadJSON(schema)
+ with open(schema, 'r') as schema_file:
+ api_defs = json.loads(schema_file.read())
for target_namespace in api_defs:
referenced_schemas = target_namespace.get('dependencies', [])
@@ -57,7 +58,8 @@ if __name__ == '__main__':
for referenced_schema in referenced_schemas:
referenced_schema_path = os.path.join(
os.path.dirname(schema), referenced_schema + '.json')
- referenced_api_defs = LoadJSON(referenced_schema_path)
+ with open(referenced_schema_path, 'r') as referenced_schema_file:
+ referenced_api_defs = json.loads(referenced_schema_file.read())
for namespace in referenced_api_defs:
api_model.AddNamespace(namespace,
diff --git a/tools/json_schema_compiler/cpp_type_generator_test.py b/tools/json_schema_compiler/cpp_type_generator_test.py
index e58dbac..ac16262 100644
--- a/tools/json_schema_compiler/cpp_type_generator_test.py
+++ b/tools/json_schema_compiler/cpp_type_generator_test.py
@@ -3,22 +3,22 @@
# found in the LICENSE file.
from cpp_type_generator import CppTypeGenerator
-from json_schema import LoadJSON
+import json
import model
import unittest
class CppTypeGeneratorTest(unittest.TestCase):
def setUp(self):
self.model = model.Model()
- self.permissions_json = LoadJSON('test/permissions.json')
+ self.permissions_json = json.loads(open('test/permissions.json').read())
self.model.AddNamespace(self.permissions_json[0],
'path/to/permissions.json')
self.permissions = self.model.namespaces.get('permissions')
- self.windows_json = LoadJSON('test/windows.json')
+ self.windows_json = json.loads(open('test/windows.json').read())
self.model.AddNamespace(self.windows_json[0],
'path/to/window.json')
self.windows = self.model.namespaces.get('windows')
- self.tabs_json = LoadJSON('test/tabs.json')
+ self.tabs_json = json.loads(open('test/tabs.json').read())
self.model.AddNamespace(self.tabs_json[0],
'path/to/tabs.json')
self.tabs = self.model.namespaces.get('tabs')
diff --git a/tools/json_schema_compiler/json_schema.py b/tools/json_schema_compiler/json_schema.py
deleted file mode 100644
index aa192c0..0000000
--- a/tools/json_schema_compiler/json_schema.py
+++ /dev/null
@@ -1,19 +0,0 @@
-# Copyright (c) 2012 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.
-
-import json
-import os.path
-import sys
-
-# We need to get json_minify from the third_party directory.
-# This is similar to what is done in chrome/common/extensions/docs/build.py
-third_party_path = os.path.join(os.path.dirname(os.path.realpath(__file__)),
- os.pardir, os.pardir, 'third_party/')
-if third_party_path not in sys.path:
- sys.path.insert(0, third_party_path)
-import json_minify as minify
-
-def LoadJSON(filename):
- with open(filename, 'r') as handle:
- return json.loads(minify.json_minify(handle.read()))
diff --git a/tools/json_schema_compiler/model_test.py b/tools/json_schema_compiler/model_test.py
index a588968..3217498 100644
--- a/tools/json_schema_compiler/model_test.py
+++ b/tools/json_schema_compiler/model_test.py
@@ -2,22 +2,22 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-from json_schema import LoadJSON
+import json
import model
import unittest
class ModelTest(unittest.TestCase):
def setUp(self):
self.model = model.Model()
- self.permissions_json = LoadJSON('test/permissions.json')
+ self.permissions_json = json.loads(open('test/permissions.json').read())
self.model.AddNamespace(self.permissions_json[0],
'path/to/permissions.json')
self.permissions = self.model.namespaces.get('permissions')
- self.windows_json = LoadJSON('test/windows.json')
+ self.windows_json = json.loads(open('test/windows.json').read())
self.model.AddNamespace(self.windows_json[0],
'path/to/window.json')
self.windows = self.model.namespaces.get('windows')
- self.tabs_json = LoadJSON('test/tabs.json')
+ self.tabs_json = json.loads(open('test/tabs.json').read())
self.model.AddNamespace(self.tabs_json[0],
'path/to/tabs.json')
self.tabs = self.model.namespaces.get('tabs')
diff --git a/tools/json_schema_compiler/previewserver.py b/tools/json_schema_compiler/previewserver.py
index 8a6f6ab..384171e 100755
--- a/tools/json_schema_compiler/previewserver.py
+++ b/tools/json_schema_compiler/previewserver.py
@@ -11,7 +11,7 @@ import code
import cpp_type_generator
import cpp_util
import h_generator
-from json_schema import LoadJSON
+import json
import model
import optparse
import os
@@ -188,7 +188,8 @@ updateEverything();
try:
# Get main json file
- api_defs = LoadJSON(json_file_path)
+ with open(json_file_path) as json_file:
+ api_defs = json.loads(json_file.read())
namespace = api_model.AddNamespace(api_defs[0], json_file_path)
if not namespace:
body.Append("<pre>Target file %s is marked nocompile</pre>" %
@@ -200,7 +201,8 @@ updateEverything();
# Get json file depedencies
for dependency in api_defs[0].get('dependencies', []):
json_file_path = os.path.join(filedir, dependency + '.json')
- api_defs = LoadJSON(json_file_path)
+ with open(json_file_path) as json_file:
+ api_defs = json.loads(json_file.read())
referenced_namespace = api_model.AddNamespace(api_defs[0],
json_file_path)
if referenced_namespace: