summaryrefslogtreecommitdiffstats
path: root/net/base
diff options
context:
space:
mode:
authortc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-08 21:58:04 +0000
committertc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-08 21:58:04 +0000
commit85aed525ca4109b6d3f9fe82d0b82c3a6d2cf722 (patch)
tree78f12ef87462b62f1fd11a7116d1a771b9ca2e90 /net/base
parentb11c6a558fe2e45617ed715fb98ed7d1ea2e9126 (diff)
downloadchromium_src-85aed525ca4109b6d3f9fe82d0b82c3a6d2cf722.zip
chromium_src-85aed525ca4109b6d3f9fe82d0b82c3a6d2cf722.tar.gz
chromium_src-85aed525ca4109b6d3f9fe82d0b82c3a6d2cf722.tar.bz2
Remove net_resources.rc and net_resources.h and replace it
with a grd file that generates the same thing. We want to do this so on linux, we will have grit generate the .h file and a platform specific resource file. There's some munging going on to be able to get the effective_tld_names_clean.dat file included in the rc. This works in visual studio and scons. I need to update chrome_kjs.sln and the webkit*.sln files and the mac build before committing. Review URL: http://codereview.chromium.org/16565 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7762 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/base')
-rw-r--r--net/base/net_resources.grd18
-rw-r--r--net/base/net_resources.h4
-rw-r--r--net/base/net_resources.rc20
-rw-r--r--net/base/net_util.cc5
-rw-r--r--net/base/registry_controlled_domain.cc9
5 files changed, 30 insertions, 26 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) {