| 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 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 m_workerLoaderProxy, | 245 m_workerLoaderProxy, |
| 246 wrapCrossThreadPersistent(m_workerGlobalScope->thread()->getWorkerThread
LifecycleContext()), | 246 wrapCrossThreadPersistent(m_workerGlobalScope->thread()->getWorkerThread
LifecycleContext()), |
| 247 request, | 247 request, |
| 248 m_threadableLoaderOptions, | 248 m_threadableLoaderOptions, |
| 249 m_resourceLoaderOptions, | 249 m_resourceLoaderOptions, |
| 250 eventWithTasks)); | 250 eventWithTasks)); |
| 251 | 251 |
| 252 if (m_blockingBehavior == LoadAsynchronously) | 252 if (m_blockingBehavior == LoadAsynchronously) |
| 253 return; | 253 return; |
| 254 | 254 |
| 255 { | 255 eventWithTasks->wait(); |
| 256 SafePointScope scope(BlinkGC::HeapPointersOnStack); | |
| 257 eventWithTasks->wait(); | |
| 258 } | |
| 259 | 256 |
| 260 if (eventWithTasks->isAborted()) { | 257 if (eventWithTasks->isAborted()) { |
| 261 // This thread is going to terminate. | 258 // This thread is going to terminate. |
| 262 cancel(); | 259 cancel(); |
| 263 return; | 260 return; |
| 264 } | 261 } |
| 265 | 262 |
| 266 for (const auto& task : eventWithTasks->take()) { | 263 for (const auto& task : eventWithTasks->take()) { |
| 267 // Store the program counter where the task is posted from, and alias | 264 // Store the program counter where the task is posted from, and alias |
| 268 // it to ensure it is stored in the crash dump. | 265 // it to ensure it is stored in the crash dump. |
| (...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 599 const ResourceLoaderOptions& originalResourceLoaderOptions) | 596 const ResourceLoaderOptions& originalResourceLoaderOptions) |
| 600 { | 597 { |
| 601 DCHECK(isMainThread()); | 598 DCHECK(isMainThread()); |
| 602 ResourceLoaderOptions resourceLoaderOptions = originalResourceLoaderOptions; | 599 ResourceLoaderOptions resourceLoaderOptions = originalResourceLoaderOptions; |
| 603 resourceLoaderOptions.requestInitiatorContext = WorkerContext; | 600 resourceLoaderOptions.requestInitiatorContext = WorkerContext; |
| 604 m_mainThreadLoader = DocumentThreadableLoader::create(document, this, option
s, resourceLoaderOptions); | 601 m_mainThreadLoader = DocumentThreadableLoader::create(document, this, option
s, resourceLoaderOptions); |
| 605 m_mainThreadLoader->start(ResourceRequest(request.get())); | 602 m_mainThreadLoader->start(ResourceRequest(request.get())); |
| 606 } | 603 } |
| 607 | 604 |
| 608 } // namespace blink | 605 } // namespace blink |
| OLD | NEW |