| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009, 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2009, 2010 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 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 424 std::unique_ptr<CrossThreadResourceRequestData> request, | 424 std::unique_ptr<CrossThreadResourceRequestData> request, |
| 425 const ThreadableLoaderOptions& options, | 425 const ThreadableLoaderOptions& options, |
| 426 const ResourceLoaderOptions& resourceLoaderOptions, | 426 const ResourceLoaderOptions& resourceLoaderOptions, |
| 427 PassRefPtr<WaitableEventWithTasks> eventWithTasks, | 427 PassRefPtr<WaitableEventWithTasks> eventWithTasks, |
| 428 ExecutionContext* executionContext) | 428 ExecutionContext* executionContext) |
| 429 { | 429 { |
| 430 DCHECK(isMainThread()); | 430 DCHECK(isMainThread()); |
| 431 TaskForwarder* forwarder; | 431 TaskForwarder* forwarder; |
| 432 RefPtr<WorkerLoaderProxy> loaderProxy = passLoaderProxy; | 432 RefPtr<WorkerLoaderProxy> loaderProxy = passLoaderProxy; |
| 433 if (eventWithTasks) | 433 if (eventWithTasks) |
| 434 forwarder = new SyncTaskForwarder(eventWithTasks); | 434 forwarder = new SyncTaskForwarder(std::move(eventWithTasks)); |
| 435 else | 435 else |
| 436 forwarder = new AsyncTaskForwarder(loaderProxy); | 436 forwarder = new AsyncTaskForwarder(loaderProxy); |
| 437 | 437 |
| 438 MainThreadLoaderHolder* mainThreadLoaderHolder = new MainThreadLoaderHolder(
forwarder, workerThreadLifecycleContext); | 438 MainThreadLoaderHolder* mainThreadLoaderHolder = new MainThreadLoaderHolder(
forwarder, workerThreadLifecycleContext); |
| 439 if (mainThreadLoaderHolder->wasContextDestroyedBeforeObserverCreation()) { | 439 if (mainThreadLoaderHolder->wasContextDestroyedBeforeObserverCreation()) { |
| 440 // The thread is already terminating. | 440 // The thread is already terminating. |
| 441 forwarder->abort(); | 441 forwarder->abort(); |
| 442 mainThreadLoaderHolder->m_forwarder = nullptr; | 442 mainThreadLoaderHolder->m_forwarder = nullptr; |
| 443 return; | 443 return; |
| 444 } | 444 } |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 596 const ResourceLoaderOptions& originalResourceLoaderOptions) | 596 const ResourceLoaderOptions& originalResourceLoaderOptions) |
| 597 { | 597 { |
| 598 DCHECK(isMainThread()); | 598 DCHECK(isMainThread()); |
| 599 ResourceLoaderOptions resourceLoaderOptions = originalResourceLoaderOptions; | 599 ResourceLoaderOptions resourceLoaderOptions = originalResourceLoaderOptions; |
| 600 resourceLoaderOptions.requestInitiatorContext = WorkerContext; | 600 resourceLoaderOptions.requestInitiatorContext = WorkerContext; |
| 601 m_mainThreadLoader = DocumentThreadableLoader::create(document, this, option
s, resourceLoaderOptions); | 601 m_mainThreadLoader = DocumentThreadableLoader::create(document, this, option
s, resourceLoaderOptions); |
| 602 m_mainThreadLoader->start(ResourceRequest(request.get())); | 602 m_mainThreadLoader->start(ResourceRequest(request.get())); |
| 603 } | 603 } |
| 604 | 604 |
| 605 } // namespace blink | 605 } // namespace blink |
| OLD | NEW |