| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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.h" | 5 #include "net/proxy/proxy_resolver_v8.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
| 9 #include "googleurl/src/gurl.h" | 9 #include "googleurl/src/gurl.h" |
| 10 #include "net/base/net_errors.h" | 10 #include "net/base/net_errors.h" |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 return true; | 95 return true; |
| 96 } | 96 } |
| 97 | 97 |
| 98 } // namespace | 98 } // namespace |
| 99 | 99 |
| 100 // ProxyResolverV8::Context --------------------------------------------------- | 100 // ProxyResolverV8::Context --------------------------------------------------- |
| 101 | 101 |
| 102 class ProxyResolverV8::Context { | 102 class ProxyResolverV8::Context { |
| 103 public: | 103 public: |
| 104 explicit Context(ProxyResolverJSBindings* js_bindings) | 104 explicit Context(ProxyResolverJSBindings* js_bindings) |
| 105 : js_bindings_(js_bindings), current_request_net_log_(NULL) { | 105 : js_bindings_(js_bindings) { |
| 106 DCHECK(js_bindings != NULL); | 106 DCHECK(js_bindings != NULL); |
| 107 } | 107 } |
| 108 | 108 |
| 109 ~Context() { | 109 ~Context() { |
| 110 v8::Locker locked; | 110 v8::Locker locked; |
| 111 | 111 |
| 112 v8_this_.Dispose(); | 112 v8_this_.Dispose(); |
| 113 v8_context_.Dispose(); | 113 v8_context_.Dispose(); |
| 114 } | 114 } |
| 115 | 115 |
| (...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 430 | 430 |
| 431 // Try parsing the PAC script. | 431 // Try parsing the PAC script. |
| 432 scoped_ptr<Context> context(new Context(js_bindings_.get())); | 432 scoped_ptr<Context> context(new Context(js_bindings_.get())); |
| 433 int rv = context->InitV8(bytes_utf8); | 433 int rv = context->InitV8(bytes_utf8); |
| 434 if (rv == OK) | 434 if (rv == OK) |
| 435 context_.reset(context.release()); | 435 context_.reset(context.release()); |
| 436 return rv; | 436 return rv; |
| 437 } | 437 } |
| 438 | 438 |
| 439 } // namespace net | 439 } // namespace net |
| OLD | NEW |