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

Side by Side Diff: net/proxy/proxy_script_decider.cc

Issue 112963005: Update uses of UTF conversions in courgette/, device/, extensions/, google_apis/, gpu/, ipc/, media… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 12 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/proxy/proxy_resolver_winhttp.cc ('k') | net/proxy/proxy_script_decider_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/proxy/proxy_script_decider.h" 5 #include "net/proxy/proxy_script_decider.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/format_macros.h" 10 #include "base/format_macros.h"
(...skipping 12 matching lines...) Expand all
23 23
24 namespace { 24 namespace {
25 25
26 bool LooksLikePacScript(const base::string16& script) { 26 bool LooksLikePacScript(const base::string16& script) {
27 // Note: this is only an approximation! It may not always work correctly, 27 // Note: this is only an approximation! It may not always work correctly,
28 // however it is very likely that legitimate scripts have this exact string, 28 // however it is very likely that legitimate scripts have this exact string,
29 // since they must minimally define a function of this name. Conversely, a 29 // since they must minimally define a function of this name. Conversely, a
30 // file not containing the string is not likely to be a PAC script. 30 // file not containing the string is not likely to be a PAC script.
31 // 31 //
32 // An exact test would have to load the script in a javascript evaluator. 32 // An exact test would have to load the script in a javascript evaluator.
33 return script.find(ASCIIToUTF16("FindProxyForURL")) != base::string16::npos; 33 return script.find(base::ASCIIToUTF16("FindProxyForURL")) !=
34 base::string16::npos;
34 } 35 }
35 36
36 } 37 }
37 38
38 // This is the hard-coded location used by the DNS portion of web proxy 39 // This is the hard-coded location used by the DNS portion of web proxy
39 // auto-discovery. 40 // auto-discovery.
40 // 41 //
41 // Note that we not use DNS devolution to find the WPAD host, since that could 42 // Note that we not use DNS devolution to find the WPAD host, since that could
42 // be dangerous should our top level domain registry become out of date. 43 // be dangerous should our top level domain registry become out of date.
43 // 44 //
(...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after
472 } 473 }
473 474
474 // This is safe to call in any state. 475 // This is safe to call in any state.
475 if (dhcp_proxy_script_fetcher_) 476 if (dhcp_proxy_script_fetcher_)
476 dhcp_proxy_script_fetcher_->Cancel(); 477 dhcp_proxy_script_fetcher_->Cancel();
477 478
478 DidComplete(); 479 DidComplete();
479 } 480 }
480 481
481 } // namespace net 482 } // namespace net
OLDNEW
« no previous file with comments | « net/proxy/proxy_resolver_winhttp.cc ('k') | net/proxy/proxy_script_decider_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698