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/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 622 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
633 | 633 |
634 void ProxyResolverV8::CancelRequest(RequestHandle request) { | 634 void ProxyResolverV8::CancelRequest(RequestHandle request) { |
635 // This is a synchronous ProxyResolver; no possibility for async requests. | 635 // This is a synchronous ProxyResolver; no possibility for async requests. |
636 NOTREACHED(); | 636 NOTREACHED(); |
637 } | 637 } |
638 | 638 |
639 void ProxyResolverV8::PurgeMemory() { | 639 void ProxyResolverV8::PurgeMemory() { |
640 context_->PurgeMemory(); | 640 context_->PurgeMemory(); |
641 } | 641 } |
642 | 642 |
| 643 void ProxyResolverV8::Shutdown() { |
| 644 js_bindings_->Shutdown(); |
| 645 } |
| 646 |
643 int ProxyResolverV8::SetPacScript(const GURL& /*url*/, | 647 int ProxyResolverV8::SetPacScript(const GURL& /*url*/, |
644 const string16& pac_script, | 648 const string16& pac_script, |
645 CompletionCallback* /*callback*/) { | 649 CompletionCallback* /*callback*/) { |
646 context_.reset(); | 650 context_.reset(); |
647 if (pac_script.empty()) | 651 if (pac_script.empty()) |
648 return ERR_PAC_SCRIPT_FAILED; | 652 return ERR_PAC_SCRIPT_FAILED; |
649 | 653 |
650 // Try parsing the PAC script. | 654 // Try parsing the PAC script. |
651 scoped_ptr<Context> context(new Context(js_bindings_.get())); | 655 scoped_ptr<Context> context(new Context(js_bindings_.get())); |
652 int rv = context->InitV8(pac_script); | 656 int rv = context->InitV8(pac_script); |
653 if (rv == OK) | 657 if (rv == OK) |
654 context_.reset(context.release()); | 658 context_.reset(context.release()); |
655 return rv; | 659 return rv; |
656 } | 660 } |
657 | 661 |
658 } // namespace net | 662 } // namespace net |
OLD | NEW |