Clean up SSL false start blacklist code. Numerous changes, including:

* Handle trailing dots in LastTwoLabels() as in http://codereview.chromium.org/7518035/ .  Rename this function to LastTwoComponents() to match the terminology used in the RegistryControlledDomainService and elsewhere in Chrome.
  * Since callers are using std::string anyway, make the functions in the header take const std::string& instead of char*.  This also allows doing string operations on them.
  * Use string operations (like find_last_of()) in place of hand-written algorithms, for brevity, clarity, and safety.
  * Avoid "unsigned", which the style guide forbids, and use allowed types like size_t, uint32, or int (depending on the situation).
  * Avoid #define and "using".
  * Use standard algorithms for similar reasons as using string ops.
  * Use file_util functions to significantly abbreviate file reading/writing code.
  * Use wmain() (on Windows) in combination with FilePath to avoid issues if the provided pathname has extended characters that don't flatten losslessly to the default codepage (thanks Darin for pointing out this issue).
  * Avoid casting where possible.  Avoid some casts for printf()-style calls by using a string stream, which also allows for slightly less boilerplate.
  * Convert non-error uses of stderr to the chrome-standard VLOG(1).
  * Correctly handle hostnames with trailing dots in the input file.
  * In general, shorten code where possible.

Because this adds a dependency on base, and ssl_false_start_blacklist_process has the "#host" specifier in net.gyp, bradnelson tells me that base and its dependencies need an explicit "host, target" toolchain list for the Linux builds to work correctly.  It would be nice if we could avoid this but I guess gyp would have to be smarter or something.

BUG=none
TEST=none
Review URL: http://codereview.chromium.org/7550002

git-svn-id: http://src.chromium.org/svn/trunk/src/build@95907 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
This commit is contained in:
pkasting@chromium.org 2011-08-08 23:30:24 +00:00
Родитель 6ded4d7f6f
Коммит 99442ed8df
2 изменённых файлов: 57 добавлений и 16 удалений

Просмотреть файл

@ -31,6 +31,7 @@
{
'target_name': 'gtk',
'type': 'settings',
'toolsets': ['host', 'target'],
'conditions': [
['_toolset=="target"', {
'direct_dependent_settings': {
@ -46,12 +47,27 @@
'<!@(<(pkg-config) --libs-only-l gtk+-2.0 gthread-2.0)',
],
},
}],
[ 'chromeos==1', {
'link_settings': {
'libraries': [ '-lXtst' ]
}
}]]
}, {
'direct_dependent_settings': {
'cflags': [
'<!@(pkg-config --cflags gtk+-2.0 gthread-2.0)',
],
},
'link_settings': {
'ldflags': [
'<!@(pkg-config --libs-only-L --libs-only-other gtk+-2.0 gthread-2.0)',
],
'libraries': [
'<!@(pkg-config --libs-only-l gtk+-2.0 gthread-2.0)',
],
},
}],
['chromeos==1', {
'link_settings': {
'libraries': [ '-lXtst' ]
}
}],
],
},
{
'target_name': 'gtkprint',
@ -71,7 +87,8 @@
'<!@(<(pkg-config) --libs-only-l gtk+-unix-print-2.0)',
],
},
}]]
}],
],
},
{
'target_name': 'ssl',
@ -152,7 +169,8 @@
'<!@(<(pkg-config) --libs-only-l freetype2)',
],
},
}]]
}],
],
},
{
'target_name': 'fontconfig',
@ -172,7 +190,8 @@
'<!@(<(pkg-config) --libs-only-l fontconfig)',
],
},
}]]
}],
],
},
{
'target_name': 'gdk',
@ -192,7 +211,8 @@
'<!@(<(pkg-config) --libs-only-l gdk-2.0)',
],
},
}]]
}],
],
},
{
'target_name': 'gconf',
@ -215,7 +235,8 @@
'<!@(<(pkg-config) --libs-only-l gconf-2.0)',
],
},
}]]
}],
],
},
{
'target_name': 'gio',
@ -250,11 +271,13 @@
}],
],
},
}]]
}],
],
},
{
'target_name': 'x11',
'type': 'settings',
'toolsets': ['host', 'target'],
'conditions': [
['_toolset=="target"', {
'direct_dependent_settings': {
@ -270,7 +293,21 @@
'<!@(<(pkg-config) --libs-only-l x11 xi)',
],
},
}],
}, {
'direct_dependent_settings': {
'cflags': [
'<!@(pkg-config --cflags x11)',
],
},
'link_settings': {
'ldflags': [
'<!@(pkg-config --libs-only-L --libs-only-other x11 xi)',
],
'libraries': [
'<!@(pkg-config --libs-only-l x11 xi)',
],
},
}],
],
},
{
@ -291,7 +328,8 @@
'<!@(<(pkg-config) --libs-only-l xext)',
],
},
}]]
}],
],
},
{
'target_name': 'libgcrypt',
@ -308,7 +346,8 @@
'<!@(libgcrypt-config --libs)',
],
},
}]]
}],
],
},
{
'target_name': 'selinux',
@ -320,7 +359,8 @@
'-lselinux',
],
},
}]]
}],
],
},
{
'target_name': 'gnome_keyring',

Просмотреть файл

@ -7,6 +7,7 @@
{
'target_name': 'lastchange',
'type': 'none',
'toolsets': ['host', 'target'],
'variables': {
'lastchange_out_path': '<(SHARED_INTERMEDIATE_DIR)/build/LASTCHANGE',
'default_lastchange_path': '../LASTCHANGE.in',