| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_resolver_v8_tracing.h" | 5 #include "net/proxy/proxy_resolver_v8_tracing.h" |
| 6 | 6 |
| 7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
| 10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 } | 67 } |
| 68 | 68 |
| 69 class MockErrorObserver : public ProxyResolverErrorObserver { | 69 class MockErrorObserver : public ProxyResolverErrorObserver { |
| 70 public: | 70 public: |
| 71 MockErrorObserver() : event_(true, false) {} | 71 MockErrorObserver() : event_(true, false) {} |
| 72 | 72 |
| 73 virtual void OnPACScriptError(int line_number, | 73 virtual void OnPACScriptError(int line_number, |
| 74 const string16& error) OVERRIDE { | 74 const string16& error) OVERRIDE { |
| 75 { | 75 { |
| 76 base::AutoLock l(lock_); | 76 base::AutoLock l(lock_); |
| 77 output += StringPrintf("Error: line %d: %s\n", line_number, | 77 output += base::StringPrintf("Error: line %d: %s\n", line_number, |
| 78 UTF16ToASCII(error).c_str()); | 78 UTF16ToASCII(error).c_str()); |
| 79 } | 79 } |
| 80 event_.Signal(); | 80 event_.Signal(); |
| 81 } | 81 } |
| 82 | 82 |
| 83 std::string GetOutput() { | 83 std::string GetOutput() { |
| 84 base::AutoLock l(lock_); | 84 base::AutoLock l(lock_); |
| 85 return output; | 85 return output; |
| 86 } | 86 } |
| 87 | 87 |
| 88 void WaitForOutput() { | 88 void WaitForOutput() { |
| (...skipping 998 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1087 proxy_uri.substr(0, proxy_uri.find(':') + 1)); | 1087 proxy_uri.substr(0, proxy_uri.find(':') + 1)); |
| 1088 } else { | 1088 } else { |
| 1089 NOTREACHED(); | 1089 NOTREACHED(); |
| 1090 } | 1090 } |
| 1091 } | 1091 } |
| 1092 } | 1092 } |
| 1093 | 1093 |
| 1094 } // namespace | 1094 } // namespace |
| 1095 | 1095 |
| 1096 } // namespace net | 1096 } // namespace net |
| OLD | NEW |