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 25 matching lines...) Expand all Loading... |
36 #include "core/loader/DocumentThreadableLoader.h" | 36 #include "core/loader/DocumentThreadableLoader.h" |
37 #include "core/loader/ThreadableLoaderClientWrapper.h" | 37 #include "core/loader/ThreadableLoaderClientWrapper.h" |
38 #include "core/loader/WorkerLoaderClientBridge.h" | 38 #include "core/loader/WorkerLoaderClientBridge.h" |
39 #include "core/loader/WorkerThreadableLoader.h" | 39 #include "core/loader/WorkerThreadableLoader.h" |
40 #include "core/workers/WorkerGlobalScope.h" | 40 #include "core/workers/WorkerGlobalScope.h" |
41 #include "core/workers/WorkerRunLoop.h" | 41 #include "core/workers/WorkerRunLoop.h" |
42 #include "core/workers/WorkerThread.h" | 42 #include "core/workers/WorkerThread.h" |
43 | 43 |
44 namespace WebCore { | 44 namespace WebCore { |
45 | 45 |
46 PassRefPtr<ThreadableLoader> ThreadableLoader::create(ExecutionContext& context,
ThreadableLoaderClient* client, const ResourceRequest& request, const Threadabl
eLoaderOptions& options) | 46 PassRefPtr<ThreadableLoader> ThreadableLoader::create(ExecutionContext& context,
ThreadableLoaderClient* client, const ResourceRequest& request, const Threadabl
eLoaderOptions& options, const ResourceLoaderOptions& resourceLoaderOptions) |
47 { | 47 { |
48 ASSERT(client); | 48 ASSERT(client); |
49 | 49 |
50 if (context.isWorkerGlobalScope()) { | 50 if (context.isWorkerGlobalScope()) { |
51 WorkerGlobalScope& workerGlobalScope = toWorkerGlobalScope(context); | 51 WorkerGlobalScope& workerGlobalScope = toWorkerGlobalScope(context); |
52 RefPtr<ThreadableLoaderClientWrapper> clientWrapper(ThreadableLoaderClie
ntWrapper::create(client)); | 52 RefPtr<ThreadableLoaderClientWrapper> clientWrapper(ThreadableLoaderClie
ntWrapper::create(client)); |
53 OwnPtr<ThreadableLoaderClient> clientBridge(WorkerLoaderClientBridge::cr
eate(clientWrapper, workerGlobalScope.thread()->workerLoaderProxy())); | 53 OwnPtr<ThreadableLoaderClient> clientBridge(WorkerLoaderClientBridge::cr
eate(clientWrapper, workerGlobalScope.thread()->workerLoaderProxy())); |
54 return WorkerThreadableLoader::create(workerGlobalScope, clientWrapper,
clientBridge.release(), request, options); | 54 return WorkerThreadableLoader::create(workerGlobalScope, clientWrapper,
clientBridge.release(), request, options, resourceLoaderOptions); |
55 } | 55 } |
56 | 56 |
57 return DocumentThreadableLoader::create(toDocument(context), client, request
, options); | 57 return DocumentThreadableLoader::create(toDocument(context), client, request
, options, resourceLoaderOptions); |
58 } | 58 } |
59 | 59 |
60 void ThreadableLoader::loadResourceSynchronously(ExecutionContext& context, cons
t ResourceRequest& request, ThreadableLoaderClient& client, const ThreadableLoad
erOptions& options) | 60 void ThreadableLoader::loadResourceSynchronously(ExecutionContext& context, cons
t ResourceRequest& request, ThreadableLoaderClient& client, const ThreadableLoad
erOptions& options, const ResourceLoaderOptions& resourceLoaderOptions) |
61 { | 61 { |
62 if (context.isWorkerGlobalScope()) { | 62 if (context.isWorkerGlobalScope()) { |
63 WorkerThreadableLoader::loadResourceSynchronously(toWorkerGlobalScope(co
ntext), request, client, options); | 63 WorkerThreadableLoader::loadResourceSynchronously(toWorkerGlobalScope(co
ntext), request, client, options, resourceLoaderOptions); |
64 return; | 64 return; |
65 } | 65 } |
66 | 66 |
67 DocumentThreadableLoader::loadResourceSynchronously(toDocument(context), req
uest, client, options); | 67 DocumentThreadableLoader::loadResourceSynchronously(toDocument(context), req
uest, client, options, resourceLoaderOptions); |
68 } | 68 } |
69 | 69 |
70 } // namespace WebCore | 70 } // namespace WebCore |
OLD | NEW |