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

Side by Side Diff: third_party/WebKit/Source/platform/heap/ThreadState.cpp

Issue 2093603002: Wrap non-GCed raw pointer parameters of WTF::bind with WTF::unretained (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@unretained_wrapper
Patch Set: rebase Created 4 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 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 771 matching lines...) Expand 10 before | Expand all | Expand 10 after
782 782
783 if (isSweepingInProgress()) { 783 if (isSweepingInProgress()) {
784 setGCState(SweepingAndIdleGCScheduled); 784 setGCState(SweepingAndIdleGCScheduled);
785 return; 785 return;
786 } 786 }
787 787
788 // Some threads (e.g. PPAPI thread) don't have a scheduler. 788 // Some threads (e.g. PPAPI thread) don't have a scheduler.
789 if (!Platform::current()->currentThread()->scheduler()) 789 if (!Platform::current()->currentThread()->scheduler())
790 return; 790 return;
791 791
792 Platform::current()->currentThread()->scheduler()->postNonNestableIdleTask(B LINK_FROM_HERE, WTF::bind(&ThreadState::performIdleGC, this)); 792 Platform::current()->currentThread()->scheduler()->postNonNestableIdleTask(B LINK_FROM_HERE, WTF::bind(&ThreadState::performIdleGC, WTF::unretained(this)));
793 setGCState(IdleGCScheduled); 793 setGCState(IdleGCScheduled);
794 } 794 }
795 795
796 void ThreadState::scheduleIdleLazySweep() 796 void ThreadState::scheduleIdleLazySweep()
797 { 797 {
798 // TODO(haraken): Idle complete sweep should be supported in worker threads. 798 // TODO(haraken): Idle complete sweep should be supported in worker threads.
799 if (!isMainThread()) 799 if (!isMainThread())
800 return; 800 return;
801 801
802 // Some threads (e.g. PPAPI thread) don't have a scheduler. 802 // Some threads (e.g. PPAPI thread) don't have a scheduler.
803 if (!Platform::current()->currentThread()->scheduler()) 803 if (!Platform::current()->currentThread()->scheduler())
804 return; 804 return;
805 805
806 Platform::current()->currentThread()->scheduler()->postIdleTask(BLINK_FROM_H ERE, WTF::bind(&ThreadState::performIdleLazySweep, this)); 806 Platform::current()->currentThread()->scheduler()->postIdleTask(BLINK_FROM_H ERE, WTF::bind(&ThreadState::performIdleLazySweep, WTF::unretained(this)));
807 } 807 }
808 808
809 void ThreadState::schedulePreciseGC() 809 void ThreadState::schedulePreciseGC()
810 { 810 {
811 ASSERT(checkThread()); 811 ASSERT(checkThread());
812 if (isSweepingInProgress()) { 812 if (isSweepingInProgress()) {
813 setGCState(SweepingAndPreciseGCScheduled); 813 setGCState(SweepingAndPreciseGCScheduled);
814 return; 814 return;
815 } 815 }
816 816
(...skipping 716 matching lines...) Expand 10 before | Expand all | Expand 10 after
1533 threadDump->AddScalar("dead_count", "objects", totalDeadCount); 1533 threadDump->AddScalar("dead_count", "objects", totalDeadCount);
1534 threadDump->AddScalar("live_size", "bytes", totalLiveSize); 1534 threadDump->AddScalar("live_size", "bytes", totalLiveSize);
1535 threadDump->AddScalar("dead_size", "bytes", totalDeadSize); 1535 threadDump->AddScalar("dead_size", "bytes", totalDeadSize);
1536 1536
1537 base::trace_event::MemoryAllocatorDump* heapsDump = BlinkGCMemoryDumpProvide r::instance()->createMemoryAllocatorDumpForCurrentGC(heapsDumpName); 1537 base::trace_event::MemoryAllocatorDump* heapsDump = BlinkGCMemoryDumpProvide r::instance()->createMemoryAllocatorDumpForCurrentGC(heapsDumpName);
1538 base::trace_event::MemoryAllocatorDump* classesDump = BlinkGCMemoryDumpProvi der::instance()->createMemoryAllocatorDumpForCurrentGC(classesDumpName); 1538 base::trace_event::MemoryAllocatorDump* classesDump = BlinkGCMemoryDumpProvi der::instance()->createMemoryAllocatorDumpForCurrentGC(classesDumpName);
1539 BlinkGCMemoryDumpProvider::instance()->currentProcessMemoryDump()->AddOwners hipEdge(classesDump->guid(), heapsDump->guid()); 1539 BlinkGCMemoryDumpProvider::instance()->currentProcessMemoryDump()->AddOwners hipEdge(classesDump->guid(), heapsDump->guid());
1540 } 1540 }
1541 1541
1542 } // namespace blink 1542 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698