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

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

Issue 1264453002: Split the constructor of ThreadableLoader into two methods (ctor and start()) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Removed pipes around non-variables in a comment Created 4 years, 10 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
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 22 matching lines...) Expand all
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 ResourceRequest& request, const Threadabl eLoaderOptions& options, const ResourceLoaderOptions& resourceLoaderOptions) 43 PassRefPtr<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, request, options, resourceLoaderOptions); 48 return WorkerThreadableLoader::create(toWorkerGlobalScope(context), clie nt, options, resourceLoaderOptions);
49 } 49 }
50 50
51 return DocumentThreadableLoader::create(toDocument(context), client, request , 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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698