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/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
361 | 361 |
362 // Lazily creates a v8::Isolate, or returns the already created instance. | 362 // Lazily creates a v8::Isolate, or returns the already created instance. |
363 v8::Isolate* GetSharedIsolate() { | 363 v8::Isolate* GetSharedIsolate() { |
364 base::AutoLock l(lock_); | 364 base::AutoLock l(lock_); |
365 | 365 |
366 if (!holder_) { | 366 if (!holder_) { |
367 // Do one-time initialization for V8. | 367 // Do one-time initialization for V8. |
368 if (!has_initialized_v8_) { | 368 if (!has_initialized_v8_) { |
369 #ifdef V8_USE_EXTERNAL_STARTUP_DATA | 369 #ifdef V8_USE_EXTERNAL_STARTUP_DATA |
370 gin::V8Initializer::LoadV8Snapshot(); | 370 gin::V8Initializer::LoadV8Snapshot(); |
371 gin::V8Initializer::LoadV8Natives(); | |
rmcilroy
2015/06/01 14:06:31
CHECK? (and for all LoadV8Natives)
Erik Corry Chromium.org
2015/06/02 11:18:53
See above
| |
371 #endif | 372 #endif |
372 | 373 |
373 gin::IsolateHolder::Initialize( | 374 gin::IsolateHolder::Initialize( |
374 gin::IsolateHolder::kNonStrictMode, | 375 gin::IsolateHolder::kNonStrictMode, |
375 gin::ArrayBufferAllocator::SharedInstance()); | 376 gin::ArrayBufferAllocator::SharedInstance()); |
376 | 377 |
377 has_initialized_v8_ = true; | 378 has_initialized_v8_ = true; |
378 } | 379 } |
379 | 380 |
380 holder_.reset(new gin::IsolateHolder(gin::IsolateHolder::kUseLocker)); | 381 holder_.reset(new gin::IsolateHolder(gin::IsolateHolder::kUseLocker)); |
(...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
867 return 0; | 868 return 0; |
868 | 869 |
869 v8::Locker locked(isolate); | 870 v8::Locker locked(isolate); |
870 v8::Isolate::Scope isolate_scope(isolate); | 871 v8::Isolate::Scope isolate_scope(isolate); |
871 v8::HeapStatistics heap_statistics; | 872 v8::HeapStatistics heap_statistics; |
872 isolate->GetHeapStatistics(&heap_statistics); | 873 isolate->GetHeapStatistics(&heap_statistics); |
873 return heap_statistics.used_heap_size(); | 874 return heap_statistics.used_heap_size(); |
874 } | 875 } |
875 | 876 |
876 } // namespace net | 877 } // namespace net |
OLD | NEW |