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

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

Issue 1100743004: Adding field to tell if gin::IsolateHolder needs lock to be accessed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@discardable
Patch Set: Created 5 years, 8 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
« gin/public/isolate_holder.h ('K') | « gin/public/isolate_holder.h ('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/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after
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::kLockToAccess));
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
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
OLDNEW
« gin/public/isolate_holder.h ('K') | « gin/public/isolate_holder.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698