| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 710 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 721 context_->SetCurrentRequestContext(NULL); | 721 context_->SetCurrentRequestContext(NULL); |
| 722 | 722 |
| 723 return rv; | 723 return rv; |
| 724 } | 724 } |
| 725 | 725 |
| 726 void ProxyResolverV8::CancelRequest(RequestHandle request) { | 726 void ProxyResolverV8::CancelRequest(RequestHandle request) { |
| 727 // This is a synchronous ProxyResolver; no possibility for async requests. | 727 // This is a synchronous ProxyResolver; no possibility for async requests. |
| 728 NOTREACHED(); | 728 NOTREACHED(); |
| 729 } | 729 } |
| 730 | 730 |
| 731 LoadState ProxyResolverV8::GetLoadState(RequestHandle request) const { |
| 732 NOTREACHED(); |
| 733 return LOAD_STATE_IDLE; |
| 734 } |
| 735 |
| 731 void ProxyResolverV8::CancelSetPacScript() { | 736 void ProxyResolverV8::CancelSetPacScript() { |
| 732 NOTREACHED(); | 737 NOTREACHED(); |
| 733 } | 738 } |
| 734 | 739 |
| 735 void ProxyResolverV8::PurgeMemory() { | 740 void ProxyResolverV8::PurgeMemory() { |
| 736 context_->PurgeMemory(); | 741 context_->PurgeMemory(); |
| 737 } | 742 } |
| 738 | 743 |
| 739 void ProxyResolverV8::Shutdown() { | 744 void ProxyResolverV8::Shutdown() { |
| 740 js_bindings_->Shutdown(); | 745 js_bindings_->Shutdown(); |
| 741 } | 746 } |
| 742 | 747 |
| 743 int ProxyResolverV8::SetPacScript( | 748 int ProxyResolverV8::SetPacScript( |
| 744 const scoped_refptr<ProxyResolverScriptData>& script_data, | 749 const scoped_refptr<ProxyResolverScriptData>& script_data, |
| 745 OldCompletionCallback* /*callback*/) { | 750 OldCompletionCallback* /*callback*/) { |
| 746 DCHECK(script_data.get()); | 751 DCHECK(script_data.get()); |
| 747 context_.reset(); | 752 context_.reset(); |
| 748 if (script_data->utf16().empty()) | 753 if (script_data->utf16().empty()) |
| 749 return ERR_PAC_SCRIPT_FAILED; | 754 return ERR_PAC_SCRIPT_FAILED; |
| 750 | 755 |
| 751 // Try parsing the PAC script. | 756 // Try parsing the PAC script. |
| 752 scoped_ptr<Context> context(new Context(js_bindings_.get())); | 757 scoped_ptr<Context> context(new Context(js_bindings_.get())); |
| 753 int rv = context->InitV8(script_data); | 758 int rv = context->InitV8(script_data); |
| 754 if (rv == OK) | 759 if (rv == OK) |
| 755 context_.reset(context.release()); | 760 context_.reset(context.release()); |
| 756 return rv; | 761 return rv; |
| 757 } | 762 } |
| 758 | 763 |
| 759 } // namespace net | 764 } // namespace net |
| OLD | NEW |