| 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 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 367 if (!holder_) { | 367 if (!holder_) { |
| 368 // Do one-time initialization for V8. | 368 // Do one-time initialization for V8. |
| 369 if (!has_initialized_v8_) { | 369 if (!has_initialized_v8_) { |
| 370 #ifdef V8_USE_EXTERNAL_STARTUP_DATA | 370 #ifdef V8_USE_EXTERNAL_STARTUP_DATA |
| 371 gin::V8Initializer::LoadV8Snapshot(); | 371 gin::V8Initializer::LoadV8Snapshot(); |
| 372 gin::V8Initializer::LoadV8Natives(); | 372 gin::V8Initializer::LoadV8Natives(); |
| 373 #endif | 373 #endif |
| 374 | 374 |
| 375 gin::IsolateHolder::Initialize( | 375 gin::IsolateHolder::Initialize( |
| 376 gin::IsolateHolder::kNonStrictMode, | 376 gin::IsolateHolder::kNonStrictMode, |
| 377 gin::IsolateHolder::kStableV8Extras, |
| 377 gin::ArrayBufferAllocator::SharedInstance()); | 378 gin::ArrayBufferAllocator::SharedInstance()); |
| 378 | 379 |
| 379 has_initialized_v8_ = true; | 380 has_initialized_v8_ = true; |
| 380 } | 381 } |
| 381 | 382 |
| 382 holder_.reset(new gin::IsolateHolder(gin::IsolateHolder::kUseLocker)); | 383 holder_.reset(new gin::IsolateHolder(gin::IsolateHolder::kUseLocker)); |
| 383 } | 384 } |
| 384 | 385 |
| 385 return holder_->isolate(); | 386 return holder_->isolate(); |
| 386 } | 387 } |
| (...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 879 return 0; | 880 return 0; |
| 880 | 881 |
| 881 v8::Locker locked(isolate); | 882 v8::Locker locked(isolate); |
| 882 v8::Isolate::Scope isolate_scope(isolate); | 883 v8::Isolate::Scope isolate_scope(isolate); |
| 883 v8::HeapStatistics heap_statistics; | 884 v8::HeapStatistics heap_statistics; |
| 884 isolate->GetHeapStatistics(&heap_statistics); | 885 isolate->GetHeapStatistics(&heap_statistics); |
| 885 return heap_statistics.used_heap_size(); | 886 return heap_statistics.used_heap_size(); |
| 886 } | 887 } |
| 887 | 888 |
| 888 } // namespace net | 889 } // namespace net |
| OLD | NEW |