Chromium Code Reviews| 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..53b084150ab32655354a5441e5becd93da6dafa0 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 for origin thread and any unknown threads. |
|
reveman
2014/06/20 18:44:19
nit: "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: |