Index: cc/resources/raster_worker_pool.cc |
diff --git a/cc/resources/raster_worker_pool.cc b/cc/resources/raster_worker_pool.cc |
index 8f71b2e249328299b81ed287a7f190561899bb4b..d01bdc80cf48cdf8835544f7283b892b9ff3f6eb 100644 |
--- a/cc/resources/raster_worker_pool.cc |
+++ b/cc/resources/raster_worker_pool.cc |
@@ -46,15 +46,14 @@ class RasterTaskGraphRunner : public TaskGraphRunner, |
#endif |
workers_.push_back(worker.Pass()); |
} |
- |
- // Use index 0 for origin thread. |
- current_tls_.Set(new ThreadLocalState(0)); |
} |
virtual ~RasterTaskGraphRunner() { NOTREACHED(); } |
size_t GetPictureCloneIndexForCurrentThread() { |
- return current_tls_.Get()->picture_clone_index; |
+ // Use index 0 if called on non-raster thread. |
+ ThreadLocalState* thread_local_state = current_tls_.Get(); |
+ return thread_local_state ? current_tls_.Get()->picture_clone_index : 0; |
} |
private: |