| 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 #include "public/platform/Platform.h" | 48 #include "public/platform/Platform.h" |
| 49 #include "wtf/OwnPtr.h" | 49 #include "wtf/OwnPtr.h" |
| 50 #include "wtf/Vector.h" | 50 #include "wtf/Vector.h" |
| 51 | 51 |
| 52 namespace blink { | 52 namespace blink { |
| 53 | 53 |
| 54 static PassOwnPtr<Vector<char>> createVectorFromMemoryRegion(const char* data, u
nsigned dataLength) | 54 static PassOwnPtr<Vector<char>> createVectorFromMemoryRegion(const char* data, u
nsigned dataLength) |
| 55 { | 55 { |
| 56 OwnPtr<Vector<char>> buffer = adoptPtr(new Vector<char>(dataLength)); | 56 OwnPtr<Vector<char>> buffer = adoptPtr(new Vector<char>(dataLength)); |
| 57 memcpy(buffer->data(), data, dataLength); | 57 memcpy(buffer->data(), data, dataLength); |
| 58 return buffer.release(); | 58 return buffer; |
| 59 } | 59 } |
| 60 | 60 |
| 61 WorkerThreadableLoader::WorkerThreadableLoader(WorkerGlobalScope& workerGlobalSc
ope, ThreadableLoaderClient* client, const ThreadableLoaderOptions& options, con
st ResourceLoaderOptions& resourceLoaderOptions, BlockingBehavior blockingBehavi
or) | 61 WorkerThreadableLoader::WorkerThreadableLoader(WorkerGlobalScope& workerGlobalSc
ope, ThreadableLoaderClient* client, const ThreadableLoaderOptions& options, con
st ResourceLoaderOptions& resourceLoaderOptions, BlockingBehavior blockingBehavi
or) |
| 62 : m_workerGlobalScope(&workerGlobalScope) | 62 : m_workerGlobalScope(&workerGlobalScope) |
| 63 , m_workerClientWrapper(ThreadableLoaderClientWrapper::create(client)) | 63 , m_workerClientWrapper(ThreadableLoaderClientWrapper::create(client)) |
| 64 { | 64 { |
| 65 m_workerClientWrapper->setResourceTimingClient(this); | 65 m_workerClientWrapper->setResourceTimingClient(this); |
| 66 if (blockingBehavior == LoadAsynchronously) { | 66 if (blockingBehavior == LoadAsynchronously) { |
| 67 m_bridge = new MainThreadAsyncBridge(workerGlobalScope, m_workerClientWr
apper, options, resourceLoaderOptions); | 67 m_bridge = new MainThreadAsyncBridge(workerGlobalScope, m_workerClientWr
apper, options, resourceLoaderOptions); |
| 68 } else { | 68 } else { |
| (...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 361 | 361 |
| 362 MutexLocker lock(m_lock); | 362 MutexLocker lock(m_lock); |
| 363 RELEASE_ASSERT(!m_done); | 363 RELEASE_ASSERT(!m_done); |
| 364 | 364 |
| 365 m_clientTasks.append(std::move(task)); | 365 m_clientTasks.append(std::move(task)); |
| 366 m_done = true; | 366 m_done = true; |
| 367 m_loaderDoneEvent->signal(); | 367 m_loaderDoneEvent->signal(); |
| 368 } | 368 } |
| 369 | 369 |
| 370 } // namespace blink | 370 } // namespace blink |
| OLD | NEW |