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

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

Issue 2415373002: Loading: bulk style errors fix in core/loader (Closed)
Patch Set: Created 4 years, 2 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, 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2009, 2010 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 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 ->start(request); 214 ->start(request);
215 } 215 }
216 216
217 WorkerThreadableLoader::~WorkerThreadableLoader() { 217 WorkerThreadableLoader::~WorkerThreadableLoader() {
218 DCHECK(!m_mainThreadLoaderHolder); 218 DCHECK(!m_mainThreadLoaderHolder);
219 DCHECK(!m_client); 219 DCHECK(!m_client);
220 } 220 }
221 221
222 void WorkerThreadableLoader::start(const ResourceRequest& originalRequest) { 222 void WorkerThreadableLoader::start(const ResourceRequest& originalRequest) {
223 ResourceRequest request(originalRequest); 223 ResourceRequest request(originalRequest);
224 if (!request.didSetHTTPReferrer()) 224 if (!request.didSetHTTPReferrer()) {
225 request.setHTTPReferrer(SecurityPolicy::generateReferrer( 225 request.setHTTPReferrer(SecurityPolicy::generateReferrer(
226 m_workerGlobalScope->getReferrerPolicy(), request.url(), 226 m_workerGlobalScope->getReferrerPolicy(), request.url(),
227 m_workerGlobalScope->outgoingReferrer())); 227 m_workerGlobalScope->outgoingReferrer()));
228 }
228 229
229 DCHECK(!isMainThread()); 230 DCHECK(!isMainThread());
230 RefPtr<WaitableEventWithTasks> eventWithTasks; 231 RefPtr<WaitableEventWithTasks> eventWithTasks;
231 if (m_blockingBehavior == LoadSynchronously) 232 if (m_blockingBehavior == LoadSynchronously)
232 eventWithTasks = WaitableEventWithTasks::create(); 233 eventWithTasks = WaitableEventWithTasks::create();
233 234
234 m_workerLoaderProxy->postTaskToLoader( 235 m_workerLoaderProxy->postTaskToLoader(
235 BLINK_FROM_HERE, 236 BLINK_FROM_HERE,
236 createCrossThreadTask( 237 createCrossThreadTask(
237 &MainThreadLoaderHolder::createAndStart, 238 &MainThreadLoaderHolder::createAndStart,
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after
645 const ResourceLoaderOptions& originalResourceLoaderOptions) { 646 const ResourceLoaderOptions& originalResourceLoaderOptions) {
646 DCHECK(isMainThread()); 647 DCHECK(isMainThread());
647 ResourceLoaderOptions resourceLoaderOptions = originalResourceLoaderOptions; 648 ResourceLoaderOptions resourceLoaderOptions = originalResourceLoaderOptions;
648 resourceLoaderOptions.requestInitiatorContext = WorkerContext; 649 resourceLoaderOptions.requestInitiatorContext = WorkerContext;
649 m_mainThreadLoader = DocumentThreadableLoader::create(document, this, options, 650 m_mainThreadLoader = DocumentThreadableLoader::create(document, this, options,
650 resourceLoaderOptions); 651 resourceLoaderOptions);
651 m_mainThreadLoader->start(ResourceRequest(request.get())); 652 m_mainThreadLoader->start(ResourceRequest(request.get()));
652 } 653 }
653 654
654 } // namespace blink 655 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698