| Index: third_party/WebKit/Source/platform/loader/fetch/Resource.cpp
|
| diff --git a/third_party/WebKit/Source/platform/loader/fetch/Resource.cpp b/third_party/WebKit/Source/platform/loader/fetch/Resource.cpp
|
| index c874c0774d0fe3f576d001693dc6f832285fbfa3..d67a8fa1369e9874d0684ad3c72e16addd95277e 100644
|
| --- a/third_party/WebKit/Source/platform/loader/fetch/Resource.cpp
|
| +++ b/third_party/WebKit/Source/platform/loader/fetch/Resource.cpp
|
| @@ -269,14 +269,19 @@ Resource::Resource(const ResourceRequest& request,
|
| integrity_disposition_(ResourceIntegrityDisposition::kNotChecked),
|
| options_(options),
|
| response_timestamp_(CurrentTime()),
|
| - cancel_timer_(IsMainThread()
|
| - ? Platform::Current()->MainThread()->GetWebTaskRunner()
|
| - : Platform::Current()
|
| - ->CurrentThread()
|
| - ->Scheduler()
|
| - ->LoadingTaskRunner(),
|
| - this,
|
| - &Resource::CancelTimerFired),
|
| + cancel_timer_(
|
| + // We use MainThread() for main-thread cases to avoid syscall cost
|
| + // when checking main_thread_->isCurrentThread() in currentThread().
|
| + IsMainThread() ? Platform::Current()
|
| + ->MainThread()
|
| + ->Scheduler()
|
| + ->LoadingTaskRunner()
|
| + : Platform::Current()
|
| + ->CurrentThread()
|
| + ->Scheduler()
|
| + ->LoadingTaskRunner(),
|
| + this,
|
| + &Resource::CancelTimerFired),
|
| resource_request_(request) {
|
| InstanceCounters::IncrementCounter(InstanceCounters::kResourceCounter);
|
|
|
|
|