diff options
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"); |