Skip to content

Commit

Permalink
DNR: Add filter_list_converter tool.
Browse files Browse the repository at this point in the history
Filter List Converter is a tool to convert filter list files in the text format
to a JSON file in a format supported by the Declarative Net Request API. It can
either output the complete extension (with a manifest file and a JSON ruleset)
or just the JSON ruleset.

This is based on the ruleset converter module in the subresource_filter
component.

BUG=972290

Change-Id: Id67ccaa5cc3cc469da67865c3754b41182d1ab9f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1139592
Auto-Submit: Karan Bhatia <karandeepb@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Reviewed-by: Istiaque Ahmed <lazyboy@chromium.org>
Reviewed-by: Charlie Harrison <csharrison@chromium.org>
Commit-Queue: Karan Bhatia <karandeepb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#672233}
  • Loading branch information
Karan Bhatia authored and Commit Bot committed Jun 25, 2019
1 parent 732c12d commit 4860e09
Show file tree
Hide file tree
Showing 11 changed files with 853 additions and 1 deletion.
1 change: 1 addition & 0 deletions BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ group("gn_all") {
deps += [
"//extensions:extensions_browsertests",
"//extensions:extensions_unittests",
"//extensions/browser/api/declarative_net_request/filter_list_converter",
"//extensions/shell:app_shell_unittests",
]
}
Expand Down
1 change: 1 addition & 0 deletions extensions/browser/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -686,6 +686,7 @@ source_set("unit_tests") {
"//device/bluetooth:mocks",
"//extensions:extensions_browser_resources",
"//extensions:test_support",
"//extensions/browser/api/declarative_net_request/filter_list_converter:unit_tests",
"//extensions/buildflags",
"//extensions/common",
"//extensions/common:test_support",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Copyright 2019 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("//extensions/buildflags/buildflags.gni")

assert(enable_extensions)

source_set("support") {
testonly = true
sources = [
"converter.cc",
"converter.h",
]
deps = [
"//base",
"//components/subresource_filter/tools/ruleset_converter:support",
"//extensions/browser",
"//extensions/common",
"//extensions/common:test_support",
"//url",
]
}

executable("filter_list_converter") {
testonly = true
sources = [
"main.cc",
]
deps = [
":support",
"//base",
]
}

source_set("unit_tests") {
testonly = true
sources = [
"converter_unittest.cc",
]
deps = [
":support",
"//base",
"//testing/gtest",
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
include_rules = [
"+components/subresource_filter/tools/ruleset_converter",
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Filter List Converter is a tool to convert filter list files in the text format
to a JSON file in a format supported by the Declarative Net Request API. It can
either output the complete extension or just the JSON ruleset.

This is based on the ruleset converter module in the subresource_filter
component.
Loading

0 comments on commit 4860e09

Please sign in to comment.