OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2009 Apple 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 | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 #endif | 53 #endif |
54 } | 54 } |
55 | 55 |
56 SubresourceLoader::~SubresourceLoader() | 56 SubresourceLoader::~SubresourceLoader() |
57 { | 57 { |
58 #ifndef NDEBUG | 58 #ifndef NDEBUG |
59 subresourceLoaderCounter.decrement(); | 59 subresourceLoaderCounter.decrement(); |
60 #endif | 60 #endif |
61 } | 61 } |
62 | 62 |
63 PassRefPtr<SubresourceLoader> SubresourceLoader::create(Frame* frame, Subresourc
eLoaderClient* client, const ResourceRequest& request, SecurityCheckPolicy secur
ityCheck, bool sendResourceLoadCallbacks, bool shouldContentSniff, const String&
optionalOutgoingReferrer) | 63 PassRefPtr<SubresourceLoader> SubresourceLoader::create(Frame* frame, Subresourc
eLoaderClient* client, const ResourceRequest& request, SecurityCheckPolicy secur
ityCheck, bool sendResourceLoadCallbacks, bool shouldContentSniff, const String&
optionalOutgoingReferrer, bool shouldBufferData) |
64 { | 64 { |
65 if (!frame) | 65 if (!frame) |
66 return 0; | 66 return 0; |
67 | 67 |
68 FrameLoader* fl = frame->loader(); | 68 FrameLoader* fl = frame->loader(); |
69 if (securityCheck == DoSecurityCheck && (fl->state() == FrameStateProvisiona
l || !fl->activeDocumentLoader() || fl->activeDocumentLoader()->isStopping())) | 69 if (securityCheck == DoSecurityCheck && (fl->state() == FrameStateProvisiona
l || !fl->activeDocumentLoader() || fl->activeDocumentLoader()->isStopping())) |
70 return 0; | 70 return 0; |
71 | 71 |
72 ResourceRequest newRequest = request; | 72 ResourceRequest newRequest = request; |
73 | 73 |
(...skipping 14 matching lines...) Expand all Loading... |
88 | 88 |
89 if (SecurityOrigin::shouldHideReferrer(request.url(), outgoingReferrer)) | 89 if (SecurityOrigin::shouldHideReferrer(request.url(), outgoingReferrer)) |
90 newRequest.clearHTTPReferrer(); | 90 newRequest.clearHTTPReferrer(); |
91 else if (!request.httpReferrer()) | 91 else if (!request.httpReferrer()) |
92 newRequest.setHTTPReferrer(outgoingReferrer); | 92 newRequest.setHTTPReferrer(outgoingReferrer); |
93 FrameLoader::addHTTPOriginIfNeeded(newRequest, outgoingOrigin); | 93 FrameLoader::addHTTPOriginIfNeeded(newRequest, outgoingOrigin); |
94 | 94 |
95 fl->addExtraFieldsToSubresourceRequest(newRequest); | 95 fl->addExtraFieldsToSubresourceRequest(newRequest); |
96 | 96 |
97 RefPtr<SubresourceLoader> subloader(adoptRef(new SubresourceLoader(frame, cl
ient, sendResourceLoadCallbacks, shouldContentSniff))); | 97 RefPtr<SubresourceLoader> subloader(adoptRef(new SubresourceLoader(frame, cl
ient, sendResourceLoadCallbacks, shouldContentSniff))); |
| 98 subloader->setShouldBufferData(shouldBufferData); |
98 subloader->documentLoader()->addSubresourceLoader(subloader.get()); | 99 subloader->documentLoader()->addSubresourceLoader(subloader.get()); |
99 if (!subloader->init(newRequest)) | 100 if (!subloader->init(newRequest)) |
100 return 0; | 101 return 0; |
101 | 102 |
102 return subloader.release(); | 103 return subloader.release(); |
103 } | 104 } |
104 | 105 |
105 void SubresourceLoader::willSendRequest(ResourceRequest& newRequest, const Resou
rceResponse& redirectResponse) | 106 void SubresourceLoader::willSendRequest(ResourceRequest& newRequest, const Resou
rceResponse& redirectResponse) |
106 { | 107 { |
107 // Store the previous URL because the call to ResourceLoader::willSendReques
t will modify it. | 108 // Store the previous URL because the call to ResourceLoader::willSendReques
t will modify it. |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
280 RefPtr<SubresourceLoader> protect(this); | 281 RefPtr<SubresourceLoader> protect(this); |
281 | 282 |
282 if (m_client) | 283 if (m_client) |
283 m_client->receivedCancellation(this, challenge); | 284 m_client->receivedCancellation(this, challenge); |
284 | 285 |
285 ResourceLoader::receivedCancellation(challenge); | 286 ResourceLoader::receivedCancellation(challenge); |
286 } | 287 } |
287 | 288 |
288 | 289 |
289 } | 290 } |
OLD | NEW |