Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(274)

Unified Diff: net/proxy/proxy_resolver_v8.cc

Issue 210028: Respect the charset specified in PAC file responses. ProxyScriptFetcher is no... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: re-order parameter so output is last Created 11 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/proxy/proxy_resolver_v8.h ('k') | net/proxy/proxy_script_fetcher.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/proxy/proxy_resolver_v8.cc
===================================================================
--- net/proxy/proxy_resolver_v8.cc (revision 26789)
+++ net/proxy/proxy_resolver_v8.cc (working copy)
@@ -29,7 +29,7 @@
return result;
}
-// Convert a std::string to a V8 string.
+// Convert a std::string (UTF8) to a V8 string.
v8::Local<v8::String> StdStringToV8String(const std::string& s) {
return v8::String::New(s.data(), s.size());
}
@@ -104,7 +104,7 @@
return OK;
}
- int InitV8(const std::string& pac_data) {
+ int InitV8(const std::string& pac_data_utf8) {
v8::Locker locked;
v8::HandleScope scope;
@@ -133,8 +133,8 @@
v8::TryCatch try_catch;
// Compile the script, including the PAC library functions.
- std::string text_raw = pac_data + PROXY_RESOLVER_SCRIPT;
- v8::Local<v8::String> text = StdStringToV8String(text_raw);
+ std::string text_raw_utf8 = pac_data_utf8 + PROXY_RESOLVER_SCRIPT;
+ v8::Local<v8::String> text = StdStringToV8String(text_raw_utf8);
v8::ScriptOrigin origin = v8::ScriptOrigin(
v8::String::New(kPacResourceName));
v8::Local<v8::Script> code = v8::Script::Compile(text, &origin);
@@ -284,15 +284,15 @@
}
int ProxyResolverV8::SetPacScript(const GURL& /*url*/,
- const std::string& bytes,
+ const std::string& bytes_utf8,
CompletionCallback* /*callback*/) {
context_.reset();
- if (bytes.empty())
+ if (bytes_utf8.empty())
return ERR_PAC_SCRIPT_FAILED;
// Try parsing the PAC script.
scoped_ptr<Context> context(new Context(js_bindings_.get()));
- int rv = context->InitV8(bytes);
+ int rv = context->InitV8(bytes_utf8);
if (rv == OK)
context_.reset(context.release());
return rv;
« no previous file with comments | « net/proxy/proxy_resolver_v8.h ('k') | net/proxy/proxy_script_fetcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698