| 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 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 335 public: | 335 public: |
| 336 Context(ProxyResolverV8* parent, v8::Isolate* isolate) | 336 Context(ProxyResolverV8* parent, v8::Isolate* isolate) |
| 337 : parent_(parent), | 337 : parent_(parent), |
| 338 isolate_(isolate) { | 338 isolate_(isolate) { |
| 339 DCHECK(isolate); | 339 DCHECK(isolate); |
| 340 } | 340 } |
| 341 | 341 |
| 342 ~Context() { | 342 ~Context() { |
| 343 v8::Locker locked(isolate_); | 343 v8::Locker locked(isolate_); |
| 344 | 344 |
| 345 v8_this_.Dispose(isolate_); | 345 v8_this_.Dispose(); |
| 346 v8_context_.Dispose(isolate_); | 346 v8_context_.Dispose(); |
| 347 } | 347 } |
| 348 | 348 |
| 349 JSBindings* js_bindings() { | 349 JSBindings* js_bindings() { |
| 350 return parent_->js_bindings_; | 350 return parent_->js_bindings_; |
| 351 } | 351 } |
| 352 | 352 |
| 353 int ResolveProxy(const GURL& query_url, ProxyInfo* results) { | 353 int ResolveProxy(const GURL& query_url, ProxyInfo* results) { |
| 354 v8::Locker locked(isolate_); | 354 v8::Locker locked(isolate_); |
| 355 v8::HandleScope scope(isolate_); | 355 v8::HandleScope scope(isolate_); |
| 356 | 356 |
| (...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 799 if (!g_default_isolate_) | 799 if (!g_default_isolate_) |
| 800 return 0; | 800 return 0; |
| 801 | 801 |
| 802 v8::Locker locked(g_default_isolate_); | 802 v8::Locker locked(g_default_isolate_); |
| 803 v8::HeapStatistics heap_statistics; | 803 v8::HeapStatistics heap_statistics; |
| 804 g_default_isolate_->GetHeapStatistics(&heap_statistics); | 804 g_default_isolate_->GetHeapStatistics(&heap_statistics); |
| 805 return heap_statistics.used_heap_size(); | 805 return heap_statistics.used_heap_size(); |
| 806 } | 806 } |
| 807 | 807 |
| 808 } // namespace net | 808 } // namespace net |
| OLD | NEW |