| 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 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 369 gin::V8Initializer::LoadV8Snapshot(); | 369 gin::V8Initializer::LoadV8Snapshot(); |
| 370 #endif | 370 #endif |
| 371 | 371 |
| 372 gin::IsolateHolder::Initialize( | 372 gin::IsolateHolder::Initialize( |
| 373 gin::IsolateHolder::kNonStrictMode, | 373 gin::IsolateHolder::kNonStrictMode, |
| 374 gin::ArrayBufferAllocator::SharedInstance()); | 374 gin::ArrayBufferAllocator::SharedInstance()); |
| 375 | 375 |
| 376 has_initialized_v8_ = true; | 376 has_initialized_v8_ = true; |
| 377 } | 377 } |
| 378 | 378 |
| 379 holder_.reset(new gin::IsolateHolder); | 379 holder_.reset(new gin::IsolateHolder(gin::IsolateHolder::kUseLocker)); |
| 380 } | 380 } |
| 381 | 381 |
| 382 return holder_->isolate(); | 382 return holder_->isolate(); |
| 383 } | 383 } |
| 384 | 384 |
| 385 v8::Isolate* GetSharedIsolateWithoutCreating() { | 385 v8::Isolate* GetSharedIsolateWithoutCreating() { |
| 386 base::AutoLock l(lock_); | 386 base::AutoLock l(lock_); |
| 387 return holder_ ? holder_->isolate() : NULL; | 387 return holder_ ? holder_->isolate() : NULL; |
| 388 } | 388 } |
| 389 | 389 |
| (...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 888 return 0; | 888 return 0; |
| 889 | 889 |
| 890 v8::Locker locked(isolate); | 890 v8::Locker locked(isolate); |
| 891 v8::Isolate::Scope isolate_scope(isolate); | 891 v8::Isolate::Scope isolate_scope(isolate); |
| 892 v8::HeapStatistics heap_statistics; | 892 v8::HeapStatistics heap_statistics; |
| 893 isolate->GetHeapStatistics(&heap_statistics); | 893 isolate->GetHeapStatistics(&heap_statistics); |
| 894 return heap_statistics.used_heap_size(); | 894 return heap_statistics.used_heap_size(); |
| 895 } | 895 } |
| 896 | 896 |
| 897 } // namespace net | 897 } // namespace net |
| OLD | NEW |