diff options
author | deanm@chromium.org <deanm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-20 01:08:17 +0000 |
---|---|---|
committer | deanm@chromium.org <deanm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-20 01:08:17 +0000 |
commit | 73f5d66b06b9a02626a8addecb24986a88430176 (patch) | |
tree | d7348008e89272c3ad907c6a01b94e7e8960a0a4 /net/base/net_util.cc | |
parent | b1412de10508641134801305b47c8f7255ac2280 (diff) | |
download | chromium_src-73f5d66b06b9a02626a8addecb24986a88430176.zip chromium_src-73f5d66b06b9a02626a8addecb24986a88430176.tar.gz chromium_src-73f5d66b06b9a02626a8addecb24986a88430176.tar.bz2 |
Make the net resource interface use StringPiece instead of std::string. This means we can point directly into the resource in the binary, instead of copying. This makes sense for the TLD data, which doesn't need to be copied around.
Review URL: http://codereview.chromium.org/11506
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5740 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/base/net_util.cc')
-rw-r--r-- | net/base/net_util.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/net/base/net_util.cc b/net/base/net_util.cc index 05419fb..1617d85 100644 --- a/net/base/net_util.cc +++ b/net/base/net_util.cc @@ -800,11 +800,12 @@ std::string CanonicalizeHost(const std::wstring& host, bool* is_ip_address) { #ifdef OS_WIN std::string GetDirectoryListingHeader(const std::string& title) { - std::string result = NetModule::GetResource(IDR_DIR_HEADER_HTML); - if (result.empty()) { + static const StringPiece header(NetModule::GetResource(IDR_DIR_HEADER_HTML)); + if (header.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"); |