diff options
Diffstat (limited to 'net')
-rw-r--r-- | net/base/net_resources.grd | 18 | ||||
-rw-r--r-- | net/base/net_resources.h | 4 | ||||
-rw-r--r-- | net/base/net_resources.rc | 20 | ||||
-rw-r--r-- | net/base/net_util.cc | 5 | ||||
-rw-r--r-- | net/base/registry_controlled_domain.cc | 9 | ||||
-rw-r--r-- | net/build/convert_tld_data.rules | 4 | ||||
-rw-r--r-- | net/build/net.vcproj | 2 | ||||
-rw-r--r-- | net/build/net_resources.vcproj | 44 | ||||
-rw-r--r-- | net/net.sln | 17 | ||||
-rw-r--r-- | net/net_lib.scons | 1 | ||||
-rw-r--r-- | net/net_resources.scons | 44 | ||||
-rw-r--r-- | net/tools/tld_cleanup/tld_cleanup.scons | 1 |
12 files changed, 119 insertions, 50 deletions
diff --git a/net/base/net_resources.grd b/net/base/net_resources.grd new file mode 100644 index 0000000..655b785ca --- /dev/null +++ b/net/base/net_resources.grd @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="UTF-8"?> +<grit latest_public_release="0" current_release="1"> + <outputs> + <output filename="net_resources.h" type="rc_header"> + <emit emit_type='prepend'></emit> + </output> + <output filename="net_resources.rc" type="rc_all" /> + </outputs> + <translations /> + <release seq="1"> + <includes> + <include name="IDR_DIR_HEADER_HTML" file="dir_header.html" type="BINDATA" /> + + <!-- This file is generated by tld_cleanup. --> + <include name="IDR_EFFECTIVE_TLD_NAMES" file="effective_tld_names_clean.dat" filenameonly="true" type="BINDATA" /> + </includes> + </release> +</grit> diff --git a/net/base/net_resources.h b/net/base/net_resources.h deleted file mode 100644 index d0b9f8b..0000000 --- a/net/base/net_resources.h +++ /dev/null @@ -1,4 +0,0 @@ -// TODO(tc): Come up with a way to automate the generation of these -// IDs so they don't collide with other rc files. -#define IDR_DIR_HEADER_HTML 400 -#define IDR_EFFECTIVE_TLD_NAMES 401 diff --git a/net/base/net_resources.rc b/net/base/net_resources.rc deleted file mode 100644 index a85f4d3..0000000 --- a/net/base/net_resources.rc +++ /dev/null @@ -1,20 +0,0 @@ -// Resources used by the net module. This rc file is meant to be included by -// the application rc file (e.g., app/chrome_dll.rc). -// -// Paths in this file are relative to SolutionDir (//trunk/chrome/). - -#ifdef APSTUDIO_INVOKED - #error // Don't open in the Visual Studio resource editor! -#endif //APSTUDIO_INVOKED - -#include "net\\base\\net_resources.h" - -///////////////////////////////////////////////////////////////////////////// -// -// data resources -// - -IDR_DIR_HEADER_HTML BINDATA "net\\base\\dir_header.html" - -// The converted file is generated, so we need to use a path relative to "obj". -IDR_EFFECTIVE_TLD_NAMES BINDATA "net\\effective_tld_names_clean.dat" diff --git a/net/base/net_util.cc b/net/base/net_util.cc index 64f4d1d..6b24fe7 100644 --- a/net/base/net_util.cc +++ b/net/base/net_util.cc @@ -40,10 +40,13 @@ #include "googleurl/src/url_parse.h" #include "net/base/escape.h" #include "net/base/net_module.h" -#include "net/base/net_resources.h" #include "net/base/base64.h" #include "unicode/datefmt.h" +#if !defined(OS_MACOSX) +#include "net_resources.h" +#endif + using base::Time; namespace { diff --git a/net/base/registry_controlled_domain.cc b/net/base/registry_controlled_domain.cc index be485ac7..f6aa02a 100644 --- a/net/base/registry_controlled_domain.cc +++ b/net/base/registry_controlled_domain.cc @@ -45,9 +45,12 @@ #include "googleurl/src/gurl.h" #include "googleurl/src/url_parse.h" #include "net/base/net_module.h" -#include "net/base/net_resources.h" #include "net/base/net_util.h" +#if !defined(OS_MACOSX) +#include "net_resources.h" +#endif + namespace net { // This list of rules is used by unit tests and any other time that the main @@ -284,10 +287,14 @@ void RegistryControlledDomainService::UseDomainData(const std::string& data) { } void RegistryControlledDomainService::Init() { +#if defined(OS_MACOSX) + ParseDomainData(kDefaultDomainData); +#else // The resource file isn't present for some unit tests, for example. Fall // back to a tiny, basic list of rules in that case. StringPiece res_data = NetModule::GetResource(IDR_EFFECTIVE_TLD_NAMES); ParseDomainData(!res_data.empty() ? res_data : kDefaultDomainData); +#endif } void RegistryControlledDomainService::ParseDomainData(const StringPiece& data) { diff --git a/net/build/convert_tld_data.rules b/net/build/convert_tld_data.rules index 0331c13..db39029 100644 --- a/net/build/convert_tld_data.rules +++ b/net/build/convert_tld_data.rules @@ -7,8 +7,8 @@ <CustomBuildRule Name="Convert TLD Data File" DisplayName="Convert TLD Data File" - CommandLine=""$(OutDir)\tld_cleanup.exe" "$(InputPath)" "$(IntDir)\$(InputName)_clean.dat"" - Outputs=""$(IntDir)\$(InputName)_clean.dat"" + CommandLine=""$(OutDir)\tld_cleanup.exe" "$(InputPath)" "$(IntDir)\..\$(InputName)_clean.dat"" + Outputs=""$(IntDir)\..\$(InputName)_clean.dat"" FileExtensions="*.dat" ExecutionDescription="Converting TLD data file..." > diff --git a/net/build/net.vcproj b/net/build/net.vcproj index dad5e02..917f1d5 100644 --- a/net/build/net.vcproj +++ b/net/build/net.vcproj @@ -21,7 +21,7 @@ <Configuration Name="Debug|Win32" ConfigurationType="4" - InheritedPropertySheets="$(SolutionDir)..\build\common.vsprops;$(SolutionDir)..\build\debug.vsprops;$(SolutionDir)..\third_party\icu38\build\using_icu.vsprops;$(SolutionDir)..\third_party\zlib\using_zlib.vsprops;$(SolutionDir)..\sdch\using_sdch.vsprops" + InheritedPropertySheets="$(SolutionDir)..\build\common.vsprops;$(SolutionDir)..\build\debug.vsprops;$(SolutionDir)..\third_party\icu38\build\using_icu.vsprops;$(SolutionDir)..\third_party\zlib\using_zlib.vsprops;$(SolutionDir)..\sdch\using_sdch.vsprops;$(SolutionDir)..\tools\grit\build\using_generated_resources.vsprops" > <Tool Name="VCPreBuildEventTool" diff --git a/net/build/net_resources.vcproj b/net/build/net_resources.vcproj new file mode 100644 index 0000000..b122488 --- /dev/null +++ b/net/build/net_resources.vcproj @@ -0,0 +1,44 @@ +<?xml version="1.0" encoding="Windows-1252"?> +<VisualStudioProject + ProjectType="Visual C++" + Version="8.00" + Name="net_resources" + ProjectGUID="{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}" + RootNamespace="net_resources" + Keyword="Win32Proj" + > + <Platforms> + <Platform + Name="Win32" + /> + </Platforms> + <ToolFiles> + <ToolFile + RelativePath="..\..\tools\grit\build\grit_resources.rules" + /> + </ToolFiles> + <Configurations> + <Configuration + Name="Debug|Win32" + ConfigurationType="10" + InheritedPropertySheets="$(SolutionDir)..\build\common.vsprops;$(SolutionDir)..\build\debug.vsprops" + > + </Configuration> + <Configuration + Name="Release|Win32" + ConfigurationType="10" + InheritedPropertySheets="$(SolutionDir)..\build\common.vsprops;$(SolutionDir)..\build\release.vsprops" + > + </Configuration> + </Configurations> + <Files> + <File + RelativePath="..\base\net_resources.grd" + > + </File> + <File + RelativePath="$(OutDir)\grit_derived_sources\net_resources.h" + > + </File> + </Files> +</VisualStudioProject> diff --git a/net/net.sln b/net/net.sln index 37878dc..daedba1 100644 --- a/net/net.sln +++ b/net/net.sln @@ -48,6 +48,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "net", "build\net.vcproj", " Release.AspNetCompiler.Debug = "False" EndProjectSection ProjectSection(ProjectDependencies) = postProject + {8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942} = {8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942} {E13045CD-7E1F-4A41-9B18-8D288B2E7B41} = {E13045CD-7E1F-4A41-9B18-8D288B2E7B41} EndProjectSection EndProject @@ -154,10 +155,20 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sdch", "..\sdch\sdch.vcproj EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dump_cache", "build\dump_cache.vcproj", "{4A14E455-2B7C-4C0F-BCC2-35A9666C186F}" + ProjectSection(WebsiteProperties) = preProject + Debug.AspNetCompiler.Debug = "True" + Release.AspNetCompiler.Debug = "False" + EndProjectSection ProjectSection(ProjectDependencies) = postProject {1832A374-8A74-4F9E-B536-69A699B3E165} = {1832A374-8A74-4F9E-B536-69A699B3E165} - {8C27D792-2648-4F5E-9ED0-374276327308} = {8C27D792-2648-4F5E-9ED0-374276327308} {326E9795-E760-410A-B69A-3F79DB3F5243} = {326E9795-E760-410A-B69A-3F79DB3F5243} + {8C27D792-2648-4F5E-9ED0-374276327308} = {8C27D792-2648-4F5E-9ED0-374276327308} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "net_resources", "build\net_resources.vcproj", "{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}" + ProjectSection(WebsiteProperties) = preProject + Debug.AspNetCompiler.Debug = "True" + Release.AspNetCompiler.Debug = "False" EndProjectSection EndProject Global @@ -194,6 +205,10 @@ Global {8423AF0D-4B88-4EBF-94E1-E4D00D00E21C}.Debug|Win32.Build.0 = Debug|Win32 {8423AF0D-4B88-4EBF-94E1-E4D00D00E21C}.Release|Win32.ActiveCfg = Release|Win32 {8423AF0D-4B88-4EBF-94E1-E4D00D00E21C}.Release|Win32.Build.0 = Release|Win32 + {8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}.Debug|Win32.ActiveCfg = Debug|Win32 + {8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}.Debug|Win32.Build.0 = Debug|Win32 + {8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}.Release|Win32.ActiveCfg = Release|Win32 + {8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}.Release|Win32.Build.0 = Release|Win32 {8C27D792-2648-4F5E-9ED0-374276327308}.Debug|Win32.ActiveCfg = Debug|Win32 {8C27D792-2648-4F5E-9ED0-374276327308}.Debug|Win32.Build.0 = Debug|Win32 {8C27D792-2648-4F5E-9ED0-374276327308}.Release|Win32.ActiveCfg = Release|Win32 diff --git a/net/net_lib.scons b/net/net_lib.scons index 70d36e9..30e83a8 100644 --- a/net/net_lib.scons +++ b/net/net_lib.scons @@ -11,6 +11,7 @@ Import('env') env = env.Clone() env.ApplySConscript([ + '$GRIT_DIR/build/using_generated_resources.scons', '$ICU38_DIR/using_icu38.scons', '$SDCH_DIR/using_sdch.scons', '$ZLIB_DIR/using_zlib.scons', diff --git a/net/net_resources.scons b/net/net_resources.scons index c7dfc31..c76ed62 100644 --- a/net/net_resources.scons +++ b/net/net_resources.scons @@ -6,33 +6,39 @@ __doc__ = """ Configuration for building the net_resources.rc resources. """ +import os +import sys + Import('env') env = env.Clone() -env.Prepend( - RCFLAGS = [ - ['/l', '0x409'], - ], -) - input_files = [ 'base/effective_tld_names.dat', - 'tools/tld_cleanup/tld_cleanup.exe' + 'tools/tld_cleanup/tld_cleanup$PROGSUFFIX', ] +sys.path.append(env.Dir('$CHROME_SRC_DIR/tools/grit').abspath) +env.Tool('scons', toolpath=[env.Dir('$CHROME_SRC_DIR/tools/grit/grit')]) +# This dummy target is used to tell the emitter where to put the target files. +generated = env.GRIT('$TARGET_ROOT/grit_derived_sources/dummy_net_res', + 'base/net_resources.grd') + if env.Bit('windows'): + env.Prepend( + RCFLAGS = [ + '/l 0x409', + ], + ) + # TODO(port): Need to figure out what to do with external resources # on linux (and mac?). - # This dat file needed by net_resources is generated. - tld_names_clean = env.Command('net/effective_tld_names_clean.dat', - input_files, - '${SOURCES[1]} ${SOURCES[0]} $TARGET') - - rc = env.Command('net_resources.rc', - 'base/net_resources.rc', - Copy('$TARGET', '$SOURCE')) - - env.Depends(rc, tld_names_clean) - - env.RES(rc) + # This dat file needed by net_resources.rc is generated. + tld_names_clean = env.Command( + '$TARGET_ROOT/grit_derived_sources/effective_tld_names_clean.dat', + input_files, + '${SOURCES[1]} ${SOURCES[0]} $TARGET') + + for g in [g for g in generated if str(g).endswith('.rc')]: + net_res = env.RES(g) + env.Depends(net_res, tld_names_clean) diff --git a/net/tools/tld_cleanup/tld_cleanup.scons b/net/tools/tld_cleanup/tld_cleanup.scons index 882790f..fbdb2d3 100644 --- a/net/tools/tld_cleanup/tld_cleanup.scons +++ b/net/tools/tld_cleanup/tld_cleanup.scons @@ -14,7 +14,6 @@ env.ApplySConscript([ '$BASE_DIR/using_base.scons', '$CHROME_SRC_DIR/build/using_googleurl.scons', '$ICU38_DIR/using_icu38.scons', - '$NET_DIR/using_net.scons', ]) if env.Bit('windows'): |