diff options
author | eroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-01 22:20:50 +0000 |
---|---|---|
committer | eroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-01 22:20:50 +0000 |
commit | 9b9ae9556a0b51fc0201e925624ae6bd76686536 (patch) | |
tree | cc0643d59f985f5c28f73e4056dac5a20bfe0e0d /net/proxy/mock_proxy_resolver.h | |
parent | 947405b19c553f4cba8d0027f472ed932b2d84d5 (diff) | |
download | chromium_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/mock_proxy_resolver.h')
-rw-r--r-- | net/proxy/mock_proxy_resolver.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/net/proxy/mock_proxy_resolver.h b/net/proxy/mock_proxy_resolver.h index 88d3246..5087d6c 100644 --- a/net/proxy/mock_proxy_resolver.h +++ b/net/proxy/mock_proxy_resolver.h @@ -61,17 +61,17 @@ class MockAsyncProxyResolverBase : public ProxyResolver { public: SetPacScriptRequest(MockAsyncProxyResolverBase* resolver, const GURL& pac_url, - const std::string& pac_bytes, + const string16& pac_script, CompletionCallback* callback) : resolver_(resolver), pac_url_(pac_url), - pac_bytes_(pac_bytes), + pac_script_(pac_script), callback_(callback), origin_loop_(MessageLoop::current()) { } const GURL& pac_url() const { return pac_url_; } - const std::string& pac_bytes() const { return pac_bytes_; } + const string16& pac_script() const { return pac_script_; } void CompleteNow(int rv) { CompletionCallback* callback = callback_; @@ -85,7 +85,7 @@ class MockAsyncProxyResolverBase : public ProxyResolver { private: MockAsyncProxyResolverBase* resolver_; const GURL pac_url_; - const std::string pac_bytes_; + const string16 pac_script_; CompletionCallback* callback_; MessageLoop* origin_loop_; }; @@ -115,11 +115,11 @@ class MockAsyncProxyResolverBase : public ProxyResolver { } virtual int SetPacScript(const GURL& pac_url, - const std::string& pac_bytes, + const string16& pac_script, CompletionCallback* callback) { DCHECK(!pending_set_pac_script_request_.get()); pending_set_pac_script_request_.reset( - new SetPacScriptRequest(this, pac_url, pac_bytes, callback)); + new SetPacScriptRequest(this, pac_url, pac_script, callback)); // Finished when user calls SetPacScriptRequest::CompleteNow(). return ERR_IO_PENDING; } |