OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <algorithm> | 7 #include <algorithm> |
8 #include <cstdio> | 8 #include <cstdio> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 692 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
703 NOTREACHED(); | 703 NOTREACHED(); |
704 } | 704 } |
705 | 705 |
706 void ProxyResolverV8::PurgeMemory() { | 706 void ProxyResolverV8::PurgeMemory() { |
707 context_->PurgeMemory(); | 707 context_->PurgeMemory(); |
708 } | 708 } |
709 | 709 |
710 int ProxyResolverV8::SetPacScript( | 710 int ProxyResolverV8::SetPacScript( |
711 const scoped_refptr<ProxyResolverScriptData>& script_data, | 711 const scoped_refptr<ProxyResolverScriptData>& script_data, |
712 const CompletionCallback& /*callback*/) { | 712 const CompletionCallback& /*callback*/) { |
713 DCHECK(script_data); | 713 DCHECK(script_data.get()); |
714 DCHECK(js_bindings_); | 714 DCHECK(js_bindings_); |
715 | 715 |
716 context_.reset(); | 716 context_.reset(); |
717 if (script_data->utf16().empty()) | 717 if (script_data->utf16().empty()) |
718 return ERR_PAC_SCRIPT_FAILED; | 718 return ERR_PAC_SCRIPT_FAILED; |
719 | 719 |
720 // Try parsing the PAC script. | 720 // Try parsing the PAC script. |
721 scoped_ptr<Context> context(new Context(this, GetDefaultIsolate())); | 721 scoped_ptr<Context> context(new Context(this, GetDefaultIsolate())); |
722 int rv = context->InitV8(script_data); | 722 int rv = context->InitV8(script_data); |
723 if (rv == OK) | 723 if (rv == OK) |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
760 if (!g_default_isolate_) | 760 if (!g_default_isolate_) |
761 return 0; | 761 return 0; |
762 | 762 |
763 v8::Locker locked(g_default_isolate_); | 763 v8::Locker locked(g_default_isolate_); |
764 v8::HeapStatistics heap_statistics; | 764 v8::HeapStatistics heap_statistics; |
765 g_default_isolate_->GetHeapStatistics(&heap_statistics); | 765 g_default_isolate_->GetHeapStatistics(&heap_statistics); |
766 return heap_statistics.used_heap_size(); | 766 return heap_statistics.used_heap_size(); |
767 } | 767 } |
768 | 768 |
769 } // namespace net | 769 } // namespace net |
OLD | NEW |