Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(80)

Side by Side Diff: Source/core/loader/ThreadableLoader.cpp

Issue 301243015: Refactor ThreadableLoaderOptions for readability (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/loader/ThreadableLoader.h ('k') | Source/core/loader/WorkerThreadableLoader.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « Source/core/loader/ThreadableLoader.h ('k') | Source/core/loader/WorkerThreadableLoader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698