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

Side by Side Diff: Source/core/workers/WorkerScriptLoader.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: Created 5 years, 4 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 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2009 Apple Inc. All Rights Reserved.
3 * Copyright (C) 2009, 2011 Google Inc. All Rights Reserved. 3 * Copyright (C) 2009, 2011 Google Inc. All Rights Reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 if (!request) 94 if (!request)
95 return; 95 return;
96 96
97 ThreadableLoaderOptions options; 97 ThreadableLoaderOptions options;
98 options.crossOriginRequestPolicy = crossOriginRequestPolicy; 98 options.crossOriginRequestPolicy = crossOriginRequestPolicy;
99 99
100 ResourceLoaderOptions resourceLoaderOptions; 100 ResourceLoaderOptions resourceLoaderOptions;
101 resourceLoaderOptions.allowCredentials = AllowStoredCredentials; 101 resourceLoaderOptions.allowCredentials = AllowStoredCredentials;
102 102
103 m_needToCancel = true; 103 m_needToCancel = true;
104 m_threadableLoader = ThreadableLoader::create(executionContext, this, *reque st, options, resourceLoaderOptions); 104 m_threadableLoader = ThreadableLoader::create(executionContext, this, option s, resourceLoaderOptions);
105 m_threadableLoader->start(*request);
105 if (m_failed) 106 if (m_failed)
106 notifyFinished(); 107 notifyFinished();
107 // Do nothing here since notifyFinished() could delete |this|. 108 // Do nothing here since notifyFinished() could delete |this|.
108 } 109 }
109 110
110 const KURL& WorkerScriptLoader::responseURL() const 111 const KURL& WorkerScriptLoader::responseURL() const
111 { 112 {
112 ASSERT(!failed()); 113 ASSERT(!failed());
113 return m_responseURL; 114 return m_responseURL;
114 } 115 }
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 // document (which is implemented in WorkerMessagingProxy, and 226 // document (which is implemented in WorkerMessagingProxy, and
226 // m_contentSecurityPolicy should be left as nullptr to inherit the policy). 227 // m_contentSecurityPolicy should be left as nullptr to inherit the policy).
227 if (!response.url().protocolIs("blob") && !response.url().protocolIs("file") && !response.url().protocolIs("filesystem")) { 228 if (!response.url().protocolIs("blob") && !response.url().protocolIs("file") && !response.url().protocolIs("filesystem")) {
228 m_contentSecurityPolicy = ContentSecurityPolicy::create(); 229 m_contentSecurityPolicy = ContentSecurityPolicy::create();
229 m_contentSecurityPolicy->setOverrideURLForSelf(response.url()); 230 m_contentSecurityPolicy->setOverrideURLForSelf(response.url());
230 m_contentSecurityPolicy->didReceiveHeaders(ContentSecurityPolicyResponse Headers(response)); 231 m_contentSecurityPolicy->didReceiveHeaders(ContentSecurityPolicyResponse Headers(response));
231 } 232 }
232 } 233 }
233 234
234 } // namespace blink 235 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698