| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 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 22 matching lines...) Expand all Loading... |
| 33 #include "core/dom/Document.h" | 33 #include "core/dom/Document.h" |
| 34 #include "core/dom/ExecutionContext.h" | 34 #include "core/dom/ExecutionContext.h" |
| 35 #include "core/loader/DocumentThreadableLoader.h" | 35 #include "core/loader/DocumentThreadableLoader.h" |
| 36 #include "core/loader/ThreadableLoaderClientWrapper.h" | 36 #include "core/loader/ThreadableLoaderClientWrapper.h" |
| 37 #include "core/loader/WorkerThreadableLoader.h" | 37 #include "core/loader/WorkerThreadableLoader.h" |
| 38 #include "core/workers/WorkerGlobalScope.h" | 38 #include "core/workers/WorkerGlobalScope.h" |
| 39 #include "core/workers/WorkerThread.h" | 39 #include "core/workers/WorkerThread.h" |
| 40 | 40 |
| 41 namespace blink { | 41 namespace blink { |
| 42 | 42 |
| 43 PassRefPtr<ThreadableLoader> ThreadableLoader::create(ExecutionContext& context,
ThreadableLoaderClient* client, const ThreadableLoaderOptions& options, const R
esourceLoaderOptions& resourceLoaderOptions) | 43 PassOwnPtr<ThreadableLoader> ThreadableLoader::create(ExecutionContext& context,
ThreadableLoaderClient* client, const ThreadableLoaderOptions& options, const R
esourceLoaderOptions& resourceLoaderOptions) |
| 44 { | 44 { |
| 45 ASSERT(client); | 45 ASSERT(client); |
| 46 | 46 |
| 47 if (context.isWorkerGlobalScope()) { | 47 if (context.isWorkerGlobalScope()) { |
| 48 return WorkerThreadableLoader::create(toWorkerGlobalScope(context), clie
nt, options, resourceLoaderOptions); | 48 return WorkerThreadableLoader::create(toWorkerGlobalScope(context), clie
nt, options, resourceLoaderOptions); |
| 49 } | 49 } |
| 50 | 50 |
| 51 return DocumentThreadableLoader::create(toDocument(context), client, options
, resourceLoaderOptions); | 51 return DocumentThreadableLoader::create(toDocument(context), client, options
, resourceLoaderOptions); |
| 52 } | 52 } |
| 53 | 53 |
| 54 void ThreadableLoader::loadResourceSynchronously(ExecutionContext& context, cons
t ResourceRequest& request, ThreadableLoaderClient& client, const ThreadableLoad
erOptions& options, const ResourceLoaderOptions& resourceLoaderOptions) | 54 void ThreadableLoader::loadResourceSynchronously(ExecutionContext& context, cons
t ResourceRequest& request, ThreadableLoaderClient& client, const ThreadableLoad
erOptions& options, const ResourceLoaderOptions& resourceLoaderOptions) |
| 55 { | 55 { |
| 56 if (context.isWorkerGlobalScope()) { | 56 if (context.isWorkerGlobalScope()) { |
| 57 WorkerThreadableLoader::loadResourceSynchronously(toWorkerGlobalScope(co
ntext), request, client, options, resourceLoaderOptions); | 57 WorkerThreadableLoader::loadResourceSynchronously(toWorkerGlobalScope(co
ntext), request, client, options, resourceLoaderOptions); |
| 58 return; | 58 return; |
| 59 } | 59 } |
| 60 | 60 |
| 61 DocumentThreadableLoader::loadResourceSynchronously(toDocument(context), req
uest, client, options, resourceLoaderOptions); | 61 DocumentThreadableLoader::loadResourceSynchronously(toDocument(context), req
uest, client, options, resourceLoaderOptions); |
| 62 } | 62 } |
| 63 | 63 |
| 64 } // namespace blink | 64 } // namespace blink |
| OLD | NEW |