| 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 m_workerClientWrapper->setResourceTimingClient(this); | 66 m_workerClientWrapper->setResourceTimingClient(this); |
| 67 if (blockingBehavior == LoadAsynchronously) { | 67 if (blockingBehavior == LoadAsynchronously) { |
| 68 m_bridge = new MainThreadAsyncBridge(workerGlobalScope, m_workerClientWr
apper, options, resourceLoaderOptions); | 68 m_bridge = new MainThreadAsyncBridge(workerGlobalScope, m_workerClientWr
apper, options, resourceLoaderOptions); |
| 69 } else { | 69 } else { |
| 70 m_bridge = new MainThreadSyncBridge(workerGlobalScope, m_workerClientWra
pper, options, resourceLoaderOptions); | 70 m_bridge = new MainThreadSyncBridge(workerGlobalScope, m_workerClientWra
pper, options, resourceLoaderOptions); |
| 71 } | 71 } |
| 72 } | 72 } |
| 73 | 73 |
| 74 void WorkerThreadableLoader::loadResourceSynchronously(WorkerGlobalScope& worker
GlobalScope, const ResourceRequest& request, ThreadableLoaderClient& client, con
st ThreadableLoaderOptions& options, const ResourceLoaderOptions& resourceLoader
Options) | 74 void WorkerThreadableLoader::loadResourceSynchronously(WorkerGlobalScope& worker
GlobalScope, const ResourceRequest& request, ThreadableLoaderClient& client, con
st ThreadableLoaderOptions& options, const ResourceLoaderOptions& resourceLoader
Options) |
| 75 { | 75 { |
| 76 RefPtr<WorkerThreadableLoader> loader = adoptRef(new WorkerThreadableLoader(
workerGlobalScope, &client, options, resourceLoaderOptions, LoadSynchronously)); | 76 OwnPtr<WorkerThreadableLoader> loader = adoptPtr(new WorkerThreadableLoader(
workerGlobalScope, &client, options, resourceLoaderOptions, LoadSynchronously)); |
| 77 loader->start(request); | 77 loader->start(request); |
| 78 } | 78 } |
| 79 | 79 |
| 80 WorkerThreadableLoader::~WorkerThreadableLoader() | 80 WorkerThreadableLoader::~WorkerThreadableLoader() |
| 81 { | 81 { |
| 82 m_workerClientWrapper->clearResourceTimingClient(); | 82 m_workerClientWrapper->clearResourceTimingClient(); |
| 83 m_bridge->destroy(); | 83 m_bridge->destroy(); |
| 84 m_bridge = nullptr; | 84 m_bridge = nullptr; |
| 85 } | 85 } |
| 86 | 86 |
| (...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 363 | 363 |
| 364 MutexLocker lock(m_lock); | 364 MutexLocker lock(m_lock); |
| 365 RELEASE_ASSERT(!m_done); | 365 RELEASE_ASSERT(!m_done); |
| 366 | 366 |
| 367 m_clientTasks.append(task); | 367 m_clientTasks.append(task); |
| 368 m_done = true; | 368 m_done = true; |
| 369 m_loaderDoneEvent->signal(); | 369 m_loaderDoneEvent->signal(); |
| 370 } | 370 } |
| 371 | 371 |
| 372 } // namespace blink | 372 } // namespace blink |
| OLD | NEW |