Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 26 matching lines...) Expand all Loading... | |
| 37 #include "core/fetch/FetchRequest.h" | 37 #include "core/fetch/FetchRequest.h" |
| 38 #include "core/fetch/Resource.h" | 38 #include "core/fetch/Resource.h" |
| 39 #include "core/fetch/ResourceFetcher.h" | 39 #include "core/fetch/ResourceFetcher.h" |
| 40 #include "core/frame/ContentSecurityPolicy.h" | 40 #include "core/frame/ContentSecurityPolicy.h" |
| 41 #include "core/frame/Frame.h" | 41 #include "core/frame/Frame.h" |
| 42 #include "core/inspector/InspectorInstrumentation.h" | 42 #include "core/inspector/InspectorInstrumentation.h" |
| 43 #include "core/loader/CrossOriginPreflightResultCache.h" | 43 #include "core/loader/CrossOriginPreflightResultCache.h" |
| 44 #include "core/loader/DocumentThreadableLoaderClient.h" | 44 #include "core/loader/DocumentThreadableLoaderClient.h" |
| 45 #include "core/loader/FrameLoader.h" | 45 #include "core/loader/FrameLoader.h" |
| 46 #include "core/loader/ThreadableLoaderClient.h" | 46 #include "core/loader/ThreadableLoaderClient.h" |
| 47 #include "platform/Logging.h" | |
|
apavlov
2013/12/19 09:31:52
a debugging leftover include?
pwnall-personal
2013/12/19 09:39:34
Done. Fixed.
Rebasing leftover. Sorry :(
| |
| 47 #include "platform/SharedBuffer.h" | 48 #include "platform/SharedBuffer.h" |
| 48 #include "platform/network/ResourceRequest.h" | 49 #include "platform/network/ResourceRequest.h" |
| 49 #include "platform/weborigin/SchemeRegistry.h" | 50 #include "platform/weborigin/SchemeRegistry.h" |
| 50 #include "platform/weborigin/SecurityOrigin.h" | 51 #include "platform/weborigin/SecurityOrigin.h" |
| 51 #include "wtf/Assertions.h" | 52 #include "wtf/Assertions.h" |
| 52 | 53 |
| 53 namespace WebCore { | 54 namespace WebCore { |
| 54 | 55 |
| 55 void DocumentThreadableLoader::loadResourceSynchronously(Document* document, con st ResourceRequest& request, ThreadableLoaderClient& client, const ThreadableLoa derOptions& options) | 56 void DocumentThreadableLoader::loadResourceSynchronously(Document* document, con st ResourceRequest& request, ThreadableLoaderClient& client, const ThreadableLoa derOptions& options) |
| 56 { | 57 { |
| (...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 405 options.sniffContent = DoNotSniffContent; | 406 options.sniffContent = DoNotSniffContent; |
| 406 // Keep buffering the data for the preflight request. | 407 // Keep buffering the data for the preflight request. |
| 407 options.dataBufferingPolicy = BufferData; | 408 options.dataBufferingPolicy = BufferData; |
| 408 } | 409 } |
| 409 | 410 |
| 410 if (m_options.timeoutMilliseconds > 0) | 411 if (m_options.timeoutMilliseconds > 0) |
| 411 m_timeoutTimer.startOneShot(m_options.timeoutMilliseconds / 1000.0); | 412 m_timeoutTimer.startOneShot(m_options.timeoutMilliseconds / 1000.0); |
| 412 | 413 |
| 413 FetchRequest newRequest(request, m_options.initiator, options); | 414 FetchRequest newRequest(request, m_options.initiator, options); |
| 414 ASSERT(!resource()); | 415 ASSERT(!resource()); |
| 415 setResource(m_document->fetcher()->fetchRawResource(newRequest)); | 416 if (request.targetType() == ResourceRequest::TargetIsMedia) |
| 417 setResource(m_document->fetcher()->fetchMedia(newRequest)); | |
| 418 else | |
| 419 setResource(m_document->fetcher()->fetchRawResource(newRequest)); | |
| 416 if (resource() && resource()->loader()) { | 420 if (resource() && resource()->loader()) { |
| 417 unsigned long identifier = resource()->identifier(); | 421 unsigned long identifier = resource()->identifier(); |
| 418 InspectorInstrumentation::documentThreadableLoaderStartedLoadingForC lient(m_document, identifier, m_client); | 422 InspectorInstrumentation::documentThreadableLoaderStartedLoadingForC lient(m_document, identifier, m_client); |
| 419 } | 423 } |
| 420 return; | 424 return; |
| 421 } | 425 } |
| 422 | 426 |
| 423 FetchRequest fetchRequest(request, m_options.initiator, options); | 427 FetchRequest fetchRequest(request, m_options.initiator, options); |
| 424 ResourcePtr<Resource> resource = m_document->fetcher()->fetchSynchronously(f etchRequest); | 428 ResourcePtr<Resource> resource = m_document->fetcher()->fetchSynchronously(f etchRequest); |
| 425 ResourceResponse response = resource ? resource->response() : ResourceRespon se(); | 429 ResourceResponse response = resource ? resource->response() : ResourceRespon se(); |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 486 | 490 |
| 487 if (!(requestUrl.user().isEmpty() && requestUrl.pass().isEmpty())) { | 491 if (!(requestUrl.user().isEmpty() && requestUrl.pass().isEmpty())) { |
| 488 errorDescription = "The request was redirected to a URL ('" + requestUrl .string() + "') containing userinfo, which is disallowed for cross-origin reques ts."; | 492 errorDescription = "The request was redirected to a URL ('" + requestUrl .string() + "') containing userinfo, which is disallowed for cross-origin reques ts."; |
| 489 return false; | 493 return false; |
| 490 } | 494 } |
| 491 | 495 |
| 492 return true; | 496 return true; |
| 493 } | 497 } |
| 494 | 498 |
| 495 } // namespace WebCore | 499 } // namespace WebCore |
| OLD | NEW |