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

Side by Side Diff: third_party/WebKit/Source/bindings/core/v8/V8GCController.cpp

Issue 1686483002: Oilpan: Remove most WillBe types from the code base (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 m_liveRootGroupIdSet = true; 222 m_liveRootGroupIdSet = true;
223 ++m_domObjectsWithPendingActivity; 223 ++m_domObjectsWithPendingActivity;
224 } 224 }
225 return id; 225 return id;
226 } 226 }
227 227
228 v8::Isolate* m_isolate; 228 v8::Isolate* m_isolate;
229 // v8 guarantees that Blink will not regain control while a v8 GC runs 229 // v8 guarantees that Blink will not regain control while a v8 GC runs
230 // (=> no Oilpan GCs will be triggered), hence raw, untraced members 230 // (=> no Oilpan GCs will be triggered), hence raw, untraced members
231 // can safely be kept here. 231 // can safely be kept here.
232 Vector<RawPtrWillBeUntracedMember<Node>> m_groupsWhichNeedRetainerInfo; 232 Vector<UntracedMember<Node>> m_groupsWhichNeedRetainerInfo;
233 int m_domObjectsWithPendingActivity; 233 int m_domObjectsWithPendingActivity;
234 bool m_liveRootGroupIdSet; 234 bool m_liveRootGroupIdSet;
235 bool m_constructRetainedObjectInfos; 235 bool m_constructRetainedObjectInfos;
236 }; 236 };
237 237
238 static unsigned long long usedHeapSize(v8::Isolate* isolate) 238 static unsigned long long usedHeapSize(v8::Isolate* isolate)
239 { 239 {
240 v8::HeapStatistics heapStatistics; 240 v8::HeapStatistics heapStatistics;
241 isolate->GetHeapStatistics(&heapStatistics); 241 isolate->GetHeapStatistics(&heapStatistics);
242 return heapStatistics.used_heap_size(); 242 return heapStatistics.used_heap_size();
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
473 // 473 //
474 /* && toExecutionContext(wrapper->creationContext()) == m_executionC ontext */ 474 /* && toExecutionContext(wrapper->creationContext()) == m_executionC ontext */
475 ) 475 )
476 m_pendingActivityFound = true; 476 m_pendingActivityFound = true;
477 } 477 }
478 478
479 bool pendingActivityFound() const { return m_pendingActivityFound; } 479 bool pendingActivityFound() const { return m_pendingActivityFound; }
480 480
481 private: 481 private:
482 v8::Isolate* m_isolate; 482 v8::Isolate* m_isolate;
483 RawPtrWillBePersistent<ExecutionContext> m_executionContext; 483 Persistent<ExecutionContext> m_executionContext;
484 bool m_pendingActivityFound; 484 bool m_pendingActivityFound;
485 }; 485 };
486 486
487 bool V8GCController::hasPendingActivity(v8::Isolate* isolate, ExecutionContext* executionContext) 487 bool V8GCController::hasPendingActivity(v8::Isolate* isolate, ExecutionContext* executionContext)
488 { 488 {
489 // V8GCController::hasPendingActivity is used only when a worker checks if 489 // V8GCController::hasPendingActivity is used only when a worker checks if
490 // the worker contains any wrapper that has pending activities. 490 // the worker contains any wrapper that has pending activities.
491 ASSERT(!isMainThread()); 491 ASSERT(!isMainThread());
492 492
493 DEFINE_THREAD_SAFE_STATIC_LOCAL(CustomCountHistogram, scanPendingActivityHis togram, new CustomCountHistogram("Blink.ScanPendingActivityDuration", 1, 1000, 5 0)); 493 DEFINE_THREAD_SAFE_STATIC_LOCAL(CustomCountHistogram, scanPendingActivityHis togram, new CustomCountHistogram("Blink.ScanPendingActivityDuration", 1, 1000, 5 0));
494 double startTime = WTF::currentTimeMS(); 494 double startTime = WTF::currentTimeMS();
495 v8::HandleScope scope(isolate); 495 v8::HandleScope scope(isolate);
496 PendingActivityVisitor visitor(isolate, executionContext); 496 PendingActivityVisitor visitor(isolate, executionContext);
497 toIsolate(executionContext)->VisitHandlesWithClassIds(&visitor); 497 toIsolate(executionContext)->VisitHandlesWithClassIds(&visitor);
498 scanPendingActivityHistogram.count(static_cast<int>(WTF::currentTimeMS() - s tartTime)); 498 scanPendingActivityHistogram.count(static_cast<int>(WTF::currentTimeMS() - s tartTime));
499 return visitor.pendingActivityFound(); 499 return visitor.pendingActivityFound();
500 } 500 }
501 501
502 } // namespace blink 502 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698