diff options
-rw-r--r-- | chrome/browser/browser_main.cc | 6 | ||||
-rw-r--r-- | net/base/net_module.cc | 4 | ||||
-rw-r--r-- | net/base/net_module.h | 5 | ||||
-rw-r--r-- | net/base/net_util.cc | 5 | ||||
-rw-r--r-- | net/base/registry_controlled_domain.cc | 2 | ||||
-rw-r--r-- | net/url_request/url_request_unittest.cc | 3 | ||||
-rw-r--r-- | webkit/tools/test_shell/test_shell_main.cc | 5 |
7 files changed, 13 insertions, 17 deletions
diff --git a/chrome/browser/browser_main.cc b/chrome/browser/browser_main.cc index 5bc0e9b..91973ba 100644 --- a/chrome/browser/browser_main.cc +++ b/chrome/browser/browser_main.cc @@ -117,11 +117,11 @@ base::LazyInstance<LazyDirectoryListerCacher> lazy_dir_lister( base::LINKER_INITIALIZED); // This is called indirectly by the network layer to access resources. -StringPiece NetResourceProvider(int key) { +std::string NetResourceProvider(int key) { if (IDR_DIR_HEADER_HTML == key) - return StringPiece(lazy_dir_lister.Pointer()->html_data); + return lazy_dir_lister.Pointer()->html_data; - return ResourceBundle::GetSharedInstance().GetRawDataResource(key); + return ResourceBundle::GetSharedInstance().GetDataResource(key); } // Displays a warning message if the user is running chrome on windows 2000. diff --git a/net/base/net_module.cc b/net/base/net_module.cc index 7c3f9c1..d54a0a4 100644 --- a/net/base/net_module.cc +++ b/net/base/net_module.cc @@ -14,10 +14,10 @@ void NetModule::SetResourceProvider(ResourceProvider func) { } // static -StringPiece NetModule::GetResource(int key) { +std::string NetModule::GetResource(int key) { // avoid thread safety issues by copying provider address to a local var ResourceProvider func = resource_provider; - return func ? func(key) : StringPiece(); + return func ? func(key) : std::string(); } } // namespace net diff --git a/net/base/net_module.h b/net/base/net_module.h index e527b9f..ef309ff 100644 --- a/net/base/net_module.h +++ b/net/base/net_module.h @@ -8,7 +8,6 @@ #include <string> #include "base/basictypes.h" -#include "base/string_piece.h" namespace net { @@ -21,7 +20,7 @@ namespace net { // class NetModule { public: - typedef StringPiece (*ResourceProvider)(int key); + typedef std::string (*ResourceProvider)(int key); // Set the function to call when the net module needs resources static void SetResourceProvider(ResourceProvider func); @@ -29,7 +28,7 @@ class NetModule { // Call the resource provider (if one exists) to get the specified resource. // Returns an empty string if the resource does not exist or if there is no // resource provider. - static StringPiece GetResource(int key); + static std::string GetResource(int key); private: DISALLOW_IMPLICIT_CONSTRUCTORS(NetModule); diff --git a/net/base/net_util.cc b/net/base/net_util.cc index 1617d85..05419fb 100644 --- a/net/base/net_util.cc +++ b/net/base/net_util.cc @@ -800,12 +800,11 @@ std::string CanonicalizeHost(const std::wstring& host, bool* is_ip_address) { #ifdef OS_WIN std::string GetDirectoryListingHeader(const std::string& title) { - static const StringPiece header(NetModule::GetResource(IDR_DIR_HEADER_HTML)); - if (header.empty()) { + std::string result = NetModule::GetResource(IDR_DIR_HEADER_HTML); + if (result.empty()) { NOTREACHED() << "expected resource not found"; } - std::string result(header.data(), header.size()); result.append("<script>start("); string_escape::JavascriptDoubleQuote(title, true, &result); result.append(");</script>\n"); diff --git a/net/base/registry_controlled_domain.cc b/net/base/registry_controlled_domain.cc index f98a3f3..3f4f024 100644 --- a/net/base/registry_controlled_domain.cc +++ b/net/base/registry_controlled_domain.cc @@ -296,7 +296,7 @@ void RegistryControlledDomainService::UseDomainData(const std::string& data) { } void RegistryControlledDomainService::Init() { - domain_data_ = NetModule::GetResource(IDR_EFFECTIVE_TLD_NAMES).as_string(); + domain_data_ = NetModule::GetResource(IDR_EFFECTIVE_TLD_NAMES); if (domain_data_.empty()) { // The resource file isn't present for some unit tests, for example. Fall // back to a tiny, basic list of rules in that case. diff --git a/net/url_request/url_request_unittest.cc b/net/url_request/url_request_unittest.cc index 9b560ae..b6720aa 100644 --- a/net/url_request/url_request_unittest.cc +++ b/net/url_request/url_request_unittest.cc @@ -16,7 +16,6 @@ #include "base/path_service.h" #include "base/platform_test.h" #include "base/process_util.h" -#include "base/string_piece.h" #include "base/string_util.h" #include "net/base/load_flags.h" #include "net/base/net_errors.h" @@ -53,7 +52,7 @@ class TestURLRequest : public URLRequest { } }; -StringPiece TestNetResourceProvider(int key) { +std::string TestNetResourceProvider(int key) { return "header"; } diff --git a/webkit/tools/test_shell/test_shell_main.cc b/webkit/tools/test_shell/test_shell_main.cc index 40fa00a..b5a19a74 100644 --- a/webkit/tools/test_shell/test_shell_main.cc +++ b/webkit/tools/test_shell/test_shell_main.cc @@ -31,7 +31,6 @@ #include "base/process_util.h" #include "base/rand_util.h" #include "base/stats_table.h" -#include "base/string_piece.h" #include "base/string_util.h" #include "base/sys_info.h" #include "base/trace_event.h" @@ -68,8 +67,8 @@ std::string GetDataResource(HMODULE module, int resource_id) { } // This is called indirectly by the network layer to access resources. -StringPiece NetResourceProvider(int key) { - return GetRawDataResource(::GetModuleHandle(NULL), key); +std::string NetResourceProvider(int key) { + return GetDataResource(::GetModuleHandle(NULL), key); } #endif |