summaryrefslogtreecommitdiffstats
path: root/net/proxy/proxy_resolver_v8_unittest.cc
diff options
context:
space:
mode:
authoreroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-01 22:20:50 +0000
committereroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-01 22:20:50 +0000
commit9b9ae9556a0b51fc0201e925624ae6bd76686536 (patch)
treecc0643d59f985f5c28f73e4056dac5a20bfe0e0d /net/proxy/proxy_resolver_v8_unittest.cc
parent947405b19c553f4cba8d0027f472ed932b2d84d5 (diff)
downloadchromium_src-9b9ae9556a0b51fc0201e925624ae6bd76686536.zip
chromium_src-9b9ae9556a0b51fc0201e925624ae6bd76686536.tar.gz
chromium_src-9b9ae9556a0b51fc0201e925624ae6bd76686536.tar.bz2
Optimization: reduce the copying of string data between C++ and javascript in proxy_resolver_v8.cc.
This is done by sharing the string storage using ExternalStringResource. An accompanying change was to pass around the PAC script data as a UTF16 string16 rather than a UTF8 std::string -- this required changing plumbing in the other files. This optimization will be important when creating multiple ProxyResolverV8's so they don't end up duplicating the script text. BUG=11079 Review URL: http://codereview.chromium.org/2817043 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@51434 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/proxy/proxy_resolver_v8_unittest.cc')
-rw-r--r--net/proxy/proxy_resolver_v8_unittest.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/proxy/proxy_resolver_v8_unittest.cc b/net/proxy/proxy_resolver_v8_unittest.cc
index 9f9f50d..2e09e4a 100644
--- a/net/proxy/proxy_resolver_v8_unittest.cc
+++ b/net/proxy/proxy_resolver_v8_unittest.cc
@@ -109,7 +109,7 @@ class ProxyResolverV8WithMockBindings : public ProxyResolverV8 {
}
// Load the PAC script into the ProxyResolver.
- return SetPacScriptByData(file_contents, NULL);
+ return SetPacScriptByData(UTF8ToUTF16(file_contents), NULL);
}
};
@@ -366,7 +366,7 @@ TEST(ProxyResolverV8Test, NoSetPacScript) {
EXPECT_EQ(OK, result);
// Clear it, by initializing with an empty string.
- resolver.SetPacScriptByData(std::string(), NULL);
+ resolver.SetPacScriptByData(string16(), NULL);
// Resolve should fail again now.
result = resolver.GetProxyForURL(kQueryUrl, &proxy_info, NULL, NULL,