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

Side by Side Diff: Source/modules/fetch/FetchManager.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 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "config.h" 5 #include "config.h"
6 #include "modules/fetch/FetchManager.h" 6 #include "modules/fetch/FetchManager.h"
7 7
8 #include "bindings/core/v8/ExceptionState.h" 8 #include "bindings/core/v8/ExceptionState.h"
9 #include "bindings/core/v8/ScriptPromiseResolver.h" 9 #include "bindings/core/v8/ScriptPromiseResolver.h"
10 #include "bindings/core/v8/ScriptState.h" 10 #include "bindings/core/v8/ScriptState.h"
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 threadableLoaderOptions.crossOriginRequestPolicy = DenyCrossOriginReques ts; 374 threadableLoaderOptions.crossOriginRequestPolicy = DenyCrossOriginReques ts;
375 break; 375 break;
376 case WebURLRequest::FetchRequestModeNoCORS: 376 case WebURLRequest::FetchRequestModeNoCORS:
377 threadableLoaderOptions.crossOriginRequestPolicy = AllowCrossOriginReque sts; 377 threadableLoaderOptions.crossOriginRequestPolicy = AllowCrossOriginReque sts;
378 break; 378 break;
379 case WebURLRequest::FetchRequestModeCORS: 379 case WebURLRequest::FetchRequestModeCORS:
380 case WebURLRequest::FetchRequestModeCORSWithForcedPreflight: 380 case WebURLRequest::FetchRequestModeCORSWithForcedPreflight:
381 threadableLoaderOptions.crossOriginRequestPolicy = UseAccessControl; 381 threadableLoaderOptions.crossOriginRequestPolicy = UseAccessControl;
382 break; 382 break;
383 } 383 }
384 m_loader = ThreadableLoader::create(*executionContext(), this, request, thre adableLoaderOptions, resourceLoaderOptions); 384 m_loader = ThreadableLoader::create(*executionContext(), this, threadableLoa derOptions, resourceLoaderOptions);
385 if (!m_loader) 385 m_loader->start(request);
386 performNetworkError("Can't create ThreadableLoader");
387 } 386 }
388 387
389 void FetchManager::Loader::failed(const String& message) 388 void FetchManager::Loader::failed(const String& message)
390 { 389 {
391 if (m_failed || m_finished) 390 if (m_failed || m_finished)
392 return; 391 return;
393 m_failed = true; 392 m_failed = true;
394 if (!message.isEmpty()) 393 if (!message.isEmpty())
395 executionContext()->addConsoleMessage(ConsoleMessage::create(JSMessageSo urce, ErrorMessageLevel, message)); 394 executionContext()->addConsoleMessage(ConsoleMessage::create(JSMessageSo urce, ErrorMessageLevel, message));
396 if (m_resolver) { 395 if (m_resolver) {
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
454 453
455 DEFINE_TRACE(FetchManager) 454 DEFINE_TRACE(FetchManager)
456 { 455 {
457 #if ENABLE(OILPAN) 456 #if ENABLE(OILPAN)
458 visitor->trace(m_executionContext); 457 visitor->trace(m_executionContext);
459 visitor->trace(m_loaders); 458 visitor->trace(m_loaders);
460 #endif 459 #endif
461 } 460 }
462 461
463 } // namespace blink 462 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698