forked from sanyaade-mobiledev/chromium.src
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add search_engines and precache components to GN build.
R=viettrungluu@chromium.org Review URL: https://codereview.chromium.org/393193002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@283416 0039d316-1c4b-4281-b951-d872f2087c98
- Loading branch information
brettw@chromium.org
committed
Jul 16, 2014
1 parent
b27a3c7
commit c06b844
Showing
10 changed files
with
224 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# 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. | ||
|
||
static_library("content") { | ||
sources = [ | ||
"precache_manager.cc", | ||
"precache_manager.h", | ||
"precache_manager_factory.cc", | ||
"precache_manager_factory.h", | ||
] | ||
|
||
configs += [ "//components/precache/core:precache_config" ] | ||
|
||
deps = [ | ||
"//base", | ||
"//components/precache/core", | ||
"//content/public/browser", | ||
"//url", | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# 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. | ||
|
||
import("//third_party/protobuf/proto_library.gni") | ||
|
||
precache_config_settings_url = | ||
"http://www.gstatic.com/chrome/wifiprefetch/precache_config" | ||
precache_manifest_url_prefix = | ||
"http://www.gstatic.com/chrome/wifiprefetch/precache_manifest_" | ||
|
||
config("precache_config") { | ||
defines = [ | ||
"PRECACHE_CONFIG_SETTINGS_URL=\"$precache_config_settings_url\"", | ||
"PRECACHE_MANIFEST_URL_PREFIX=\"$precache_manifest_url_prefix\"", | ||
] | ||
} | ||
|
||
static_library("core") { | ||
sources = [ | ||
"precache_database.cc", | ||
"precache_database.h", | ||
"precache_fetcher.cc", | ||
"precache_fetcher.h", | ||
"precache_switches.cc", | ||
"precache_switches.h", | ||
"precache_url_table.cc", | ||
"precache_url_table.h", | ||
"url_list_provider.h", | ||
] | ||
|
||
# Note the GYP build sets this as direct dependent settings, but this is | ||
# only used to share the settings with the unit tests. Instead, we just | ||
# set this config for the necessary targets manually. | ||
configs += [ ":precache_config" ] | ||
|
||
deps = [ | ||
":proto", | ||
"//base", | ||
"//url", | ||
] | ||
} | ||
|
||
proto_library("proto") { | ||
sources = [ "proto/precache.proto" ] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
# 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. | ||
|
||
import("//tools/json_to_struct/json_to_struct.gni") | ||
|
||
static_library("search_engines") { | ||
sources = [ | ||
"default_search_manager.cc", | ||
"default_search_manager.h", | ||
"default_search_policy_handler.cc", | ||
"default_search_policy_handler.h", | ||
"keyword_table.cc", | ||
"keyword_table.h", | ||
"keyword_web_data_service.cc", | ||
"keyword_web_data_service.h", | ||
"search_engine_type.h", | ||
"search_engines_pref_names.cc", | ||
"search_engines_pref_names.h", | ||
"search_engines_switches.cc", | ||
"search_engines_switches.h", | ||
"search_host_to_urls_map.cc", | ||
"search_host_to_urls_map.h", | ||
"search_terms_data.cc", | ||
"search_terms_data.h", | ||
"template_url.cc", | ||
"template_url.h", | ||
"template_url_data.cc", | ||
"template_url_data.h", | ||
"template_url_fetcher.cc", | ||
"template_url_fetcher.h", | ||
"template_url_id.h", | ||
"template_url_parser.cc", | ||
"template_url_parser.h", | ||
"template_url_prepopulate_data.cc", | ||
"template_url_prepopulate_data.h", | ||
"template_url_service.cc", | ||
"template_url_service.h", | ||
"template_url_service_client.h", | ||
"template_url_service_observer.h", | ||
"util.cc", | ||
"util.h", | ||
] | ||
|
||
deps = [ | ||
":prepopulated_engines", | ||
"//base", | ||
"//components/keyed_service/core", | ||
"//components/metrics/proto", | ||
"//components/policy", | ||
"//components/pref_registry", | ||
"//components/rappor", | ||
"//components/strings", | ||
"//components/url_fixer", | ||
"//components/webdata/common", | ||
"//google_apis", | ||
"//net", | ||
"//sql", | ||
"//sync", | ||
"//third_party/libxml", | ||
"//ui/gfx", | ||
"//url", | ||
#'google_core_browser', TODO(GYP) | ||
] | ||
} | ||
|
||
json_to_struct("prepopulated_engines") { | ||
visibility = ":*" | ||
|
||
source = "prepopulated_engines.json" | ||
schema_file = "prepopulated_engines_schema.json" | ||
namespace = "TemplateURLPrepopulateData" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
# 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. | ||
|
||
# Converts a .json file to a C++ struct. | ||
# | ||
# Variables: | ||
# | ||
# source (required) | ||
# Single file name of source .json file. | ||
# | ||
# schema_file (required) | ||
# Single file name of the .json file that defines the schema. | ||
# | ||
# namespace (required) | ||
# Namespace name to put result in. | ||
# | ||
# visibility (optional) | ||
# Normal meaning. | ||
template("json_to_struct") { | ||
assert(defined(invoker.source), "source required in $target_name") | ||
assert(defined(invoker.schema_file), "schema_file required in $target_name") | ||
assert(defined(invoker.namespace), "namespace required in $target_name") | ||
|
||
action_name = target_name + "_action" | ||
source_set_name = target_name | ||
|
||
action(action_name) { | ||
visibility = [ ":$source_set_name" ] | ||
script = "//tools/json_to_struct/json_to_struct.py" | ||
|
||
inputs = [ | ||
"//tools/json_to_struct/element_generator.py", | ||
"//tools/json_to_struct/struct_generator.py", | ||
invoker.source, | ||
] | ||
|
||
out_dir = get_path_info(invoker.source, "gen_dir") | ||
out_name = get_path_info(invoker.source, "name") | ||
outputs = [ | ||
"$out_dir/$out_name.cc", | ||
"$out_dir/$out_name.h", | ||
] | ||
|
||
args = [ | ||
rebase_path(invoker.source, root_build_dir), | ||
"--destbase=" + rebase_path(out_dir, root_build_dir), | ||
"--namespace=" + invoker.namespace, | ||
"--schema=" + rebase_path(invoker.schema_file, root_build_dir), | ||
] | ||
} | ||
|
||
source_set(source_set_name) { | ||
if (defined(invoker.visibility)) { | ||
visibility = invoker.visibility | ||
} | ||
|
||
sources = get_target_outputs(":$action_name") | ||
|
||
deps = [ ":$action_name" ] | ||
} | ||
} |