| 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 <algorithm> | 5 #include <algorithm> |
| 6 #include <cstdio> | 6 #include <cstdio> |
| 7 | 7 |
| 8 #include "net/proxy/proxy_resolver_v8.h" | 8 #include "net/proxy/proxy_resolver_v8.h" |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 703 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 714 context_->SetCurrentRequestContext(NULL); | 714 context_->SetCurrentRequestContext(NULL); |
| 715 | 715 |
| 716 return rv; | 716 return rv; |
| 717 } | 717 } |
| 718 | 718 |
| 719 void ProxyResolverV8::CancelRequest(RequestHandle request) { | 719 void ProxyResolverV8::CancelRequest(RequestHandle request) { |
| 720 // This is a synchronous ProxyResolver; no possibility for async requests. | 720 // This is a synchronous ProxyResolver; no possibility for async requests. |
| 721 NOTREACHED(); | 721 NOTREACHED(); |
| 722 } | 722 } |
| 723 | 723 |
| 724 void ProxyResolverV8::CancelSetPacScript() { |
| 725 NOTREACHED(); |
| 726 } |
| 727 |
| 724 void ProxyResolverV8::PurgeMemory() { | 728 void ProxyResolverV8::PurgeMemory() { |
| 725 context_->PurgeMemory(); | 729 context_->PurgeMemory(); |
| 726 } | 730 } |
| 727 | 731 |
| 728 void ProxyResolverV8::Shutdown() { | 732 void ProxyResolverV8::Shutdown() { |
| 729 js_bindings_->Shutdown(); | 733 js_bindings_->Shutdown(); |
| 730 } | 734 } |
| 731 | 735 |
| 732 int ProxyResolverV8::SetPacScript( | 736 int ProxyResolverV8::SetPacScript( |
| 733 const scoped_refptr<ProxyResolverScriptData>& script_data, | 737 const scoped_refptr<ProxyResolverScriptData>& script_data, |
| 734 CompletionCallback* /*callback*/) { | 738 CompletionCallback* /*callback*/) { |
| 735 DCHECK(script_data.get()); | 739 DCHECK(script_data.get()); |
| 736 context_.reset(); | 740 context_.reset(); |
| 737 if (script_data->utf16().empty()) | 741 if (script_data->utf16().empty()) |
| 738 return ERR_PAC_SCRIPT_FAILED; | 742 return ERR_PAC_SCRIPT_FAILED; |
| 739 | 743 |
| 740 // Try parsing the PAC script. | 744 // Try parsing the PAC script. |
| 741 scoped_ptr<Context> context(new Context(js_bindings_.get())); | 745 scoped_ptr<Context> context(new Context(js_bindings_.get())); |
| 742 int rv = context->InitV8(script_data); | 746 int rv = context->InitV8(script_data); |
| 743 if (rv == OK) | 747 if (rv == OK) |
| 744 context_.reset(context.release()); | 748 context_.reset(context.release()); |
| 745 return rv; | 749 return rv; |
| 746 } | 750 } |
| 747 | 751 |
| 748 } // namespace net | 752 } // namespace net |
| OLD | NEW |