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 | |
647 int ProxyResolverV8::SetPacScript(const GURL& /*url*/, | 643 int ProxyResolverV8::SetPacScript(const GURL& /*url*/, |
648 const string16& pac_script, | 644 const string16& pac_script, |
649 CompletionCallback* /*callback*/) { | 645 CompletionCallback* /*callback*/) { |
650 context_.reset(); | 646 context_.reset(); |
651 if (pac_script.empty()) | 647 if (pac_script.empty()) |
652 return ERR_PAC_SCRIPT_FAILED; | 648 return ERR_PAC_SCRIPT_FAILED; |
653 | 649 |
654 // Try parsing the PAC script. | 650 // Try parsing the PAC script. |
655 scoped_ptr<Context> context(new Context(js_bindings_.get())); | 651 scoped_ptr<Context> context(new Context(js_bindings_.get())); |
656 int rv = context->InitV8(pac_script); | 652 int rv = context->InitV8(pac_script); |
657 if (rv == OK) | 653 if (rv == OK) |
658 context_.reset(context.release()); | 654 context_.reset(context.release()); |
659 return rv; | 655 return rv; |
660 } | 656 } |
661 | 657 |
662 } // namespace net | 658 } // namespace net |
OLD | NEW |