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

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

Issue 24009002: Move synchronously fetching to ResourceFetcher, as well as most of the logic (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 3 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved.
3 * Copyright (C) 2013, Intel Corporation 3 * Copyright (C) 2013, Intel Corporation
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 are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after
443 // FIXME: ThreadableLoaderOptions.sniffContent is not supported for synchron ous requests. 443 // FIXME: ThreadableLoaderOptions.sniffContent is not supported for synchron ous requests.
444 Vector<char> data; 444 Vector<char> data;
445 ResourceError error; 445 ResourceError error;
446 ResourceResponse response; 446 ResourceResponse response;
447 unsigned long identifier = std::numeric_limits<unsigned long>::max(); 447 unsigned long identifier = std::numeric_limits<unsigned long>::max();
448 if (Frame* frame = m_document->frame()) { 448 if (Frame* frame = m_document->frame()) {
449 if (!m_document->fetcher()->checkInsecureContent(Resource::Raw, requestU RL, options.mixedContentBlockingTreatment)) { 449 if (!m_document->fetcher()->checkInsecureContent(Resource::Raw, requestU RL, options.mixedContentBlockingTreatment)) {
450 m_client->didFail(error); 450 m_client->didFail(error);
451 return; 451 return;
452 } 452 }
453 identifier = frame->loader()->loadResourceSynchronously(request, m_optio ns.allowCredentials, error, response, data); 453 identifier = m_document->fetcher()->fetchSynchronously(request, m_option s.allowCredentials, error, response, data);
454 } 454 }
455 455
456 InspectorInstrumentation::documentThreadableLoaderStartedLoadingForClient(m_ document, identifier, m_client); 456 InspectorInstrumentation::documentThreadableLoaderStartedLoadingForClient(m_ document, identifier, m_client);
457 457
458 // No exception for file:/// resources, see <rdar://problem/4962298>. 458 // No exception for file:/// resources, see <rdar://problem/4962298>.
459 // Also, if we have an HTTP response, then it wasn't a network error in fact . 459 // Also, if we have an HTTP response, then it wasn't a network error in fact .
460 if (!error.isNull() && !requestURL.isLocalFile() && response.httpStatusCode( ) <= 0) { 460 if (!error.isNull() && !requestURL.isLocalFile() && response.httpStatusCode( ) <= 0) {
461 m_client->didFail(error); 461 m_client->didFail(error);
462 return; 462 return;
463 } 463 }
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
508 508
509 if (!(requestUrl.user().isEmpty() && requestUrl.pass().isEmpty())) { 509 if (!(requestUrl.user().isEmpty() && requestUrl.pass().isEmpty())) {
510 errorDescription = "The request was redirected to a URL ('" + requestUrl .string() + "') containing userinfo, which is disallowed for cross-origin reques ts."; 510 errorDescription = "The request was redirected to a URL ('" + requestUrl .string() + "') containing userinfo, which is disallowed for cross-origin reques ts.";
511 return false; 511 return false;
512 } 512 }
513 513
514 return true; 514 return true;
515 } 515 }
516 516
517 } // namespace WebCore 517 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698