Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(233)

Side by Side Diff: net/proxy/proxy_resolver_v8.cc

Issue 1164483003: Allow startup with missing V8 snapshot file. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix misplaced ifdef for Windows Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « media/blink/run_all_unittests.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 349 matching lines...) Expand 10 before | Expand all | Expand 10 after
360 360
361 // Lazily creates a v8::Isolate, or returns the already created instance. 361 // Lazily creates a v8::Isolate, or returns the already created instance.
362 v8::Isolate* GetSharedIsolate() { 362 v8::Isolate* GetSharedIsolate() {
363 base::AutoLock l(lock_); 363 base::AutoLock l(lock_);
364 364
365 if (!holder_) { 365 if (!holder_) {
366 // Do one-time initialization for V8. 366 // Do one-time initialization for V8.
367 if (!has_initialized_v8_) { 367 if (!has_initialized_v8_) {
368 #ifdef V8_USE_EXTERNAL_STARTUP_DATA 368 #ifdef V8_USE_EXTERNAL_STARTUP_DATA
369 gin::V8Initializer::LoadV8Snapshot(); 369 gin::V8Initializer::LoadV8Snapshot();
370 gin::V8Initializer::LoadV8Natives();
370 #endif 371 #endif
371 372
372 gin::IsolateHolder::Initialize( 373 gin::IsolateHolder::Initialize(
373 gin::IsolateHolder::kNonStrictMode, 374 gin::IsolateHolder::kNonStrictMode,
374 gin::ArrayBufferAllocator::SharedInstance()); 375 gin::ArrayBufferAllocator::SharedInstance());
375 376
376 has_initialized_v8_ = true; 377 has_initialized_v8_ = true;
377 } 378 }
378 379
379 holder_.reset(new gin::IsolateHolder(gin::IsolateHolder::kUseLocker)); 380 holder_.reset(new gin::IsolateHolder(gin::IsolateHolder::kUseLocker));
(...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after
876 return 0; 877 return 0;
877 878
878 v8::Locker locked(isolate); 879 v8::Locker locked(isolate);
879 v8::Isolate::Scope isolate_scope(isolate); 880 v8::Isolate::Scope isolate_scope(isolate);
880 v8::HeapStatistics heap_statistics; 881 v8::HeapStatistics heap_statistics;
881 isolate->GetHeapStatistics(&heap_statistics); 882 isolate->GetHeapStatistics(&heap_statistics);
882 return heap_statistics.used_heap_size(); 883 return heap_statistics.used_heap_size();
883 } 884 }
884 885
885 } // namespace net 886 } // namespace net
OLDNEW
« no previous file with comments | « media/blink/run_all_unittests.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698