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

Unified Diff: Source/platform/heap/ThreadState.cpp

Issue 1107573003: Oilpan: Add a missing null check for Platform::current() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/heap/ThreadState.cpp
diff --git a/Source/platform/heap/ThreadState.cpp b/Source/platform/heap/ThreadState.cpp
index 6270835414dc436b35f708b6bdad82d70da4ed11..c0e907511d4fc75292ff4b0514ade04549bae142 100644
--- a/Source/platform/heap/ThreadState.cpp
+++ b/Source/platform/heap/ThreadState.cpp
@@ -663,8 +663,10 @@ void ThreadState::scheduleIdleGC()
return;
}
- Platform::current()->currentThread()->scheduler()->postNonNestableIdleTask(FROM_HERE, WTF::bind<double>(&ThreadState::performIdleGC, this));
- setGCState(IdleGCScheduled);
+ if (Platform::current()) {
sof 2015/04/23 18:22:41 Platform::current() will exist, but it may not hav
+ Platform::current()->currentThread()->scheduler()->postNonNestableIdleTask(FROM_HERE, WTF::bind<double>(&ThreadState::performIdleGC, this));
+ setGCState(IdleGCScheduled);
+ }
}
void ThreadState::scheduleIdleLazySweep()
@@ -675,7 +677,9 @@ void ThreadState::scheduleIdleLazySweep()
// TODO(haraken): Remove this. Lazy sweeping is not yet enabled in non-oilpan builds.
#if ENABLE(OILPAN)
- Platform::current()->currentThread()->scheduler()->postIdleTask(FROM_HERE, WTF::bind<double>(&ThreadState::performIdleLazySweep, this));
+ if (Platform::current()) {
+ Platform::current()->currentThread()->scheduler()->postIdleTask(FROM_HERE, WTF::bind<double>(&ThreadState::performIdleLazySweep, this));
+ }
#endif
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698