OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 if (blobData) { | 91 if (blobData) { |
92 ASSERT(!stream); | 92 ASSERT(!stream); |
93 BlobRegistry::registerPublicBlobURL(executionContext.securityOrigin(), m
_urlForReading, blobData); | 93 BlobRegistry::registerPublicBlobURL(executionContext.securityOrigin(), m
_urlForReading, blobData); |
94 } else { | 94 } else { |
95 ASSERT(stream); | 95 ASSERT(stream); |
96 BlobRegistry::registerStreamURL(executionContext.securityOrigin(), m_url
ForReading, stream->url()); | 96 BlobRegistry::registerStreamURL(executionContext.securityOrigin(), m_url
ForReading, stream->url()); |
97 } | 97 } |
98 | 98 |
99 // Construct and load the request. | 99 // Construct and load the request. |
100 ResourceRequest request(m_urlForReading); | 100 ResourceRequest request(m_urlForReading); |
| 101 request.setIsExternalRequest(executionContext.securityContext().isHostedInRe
servedIPRange()); |
101 | 102 |
102 // FIXME: Should this really be 'internal'? Do we know anything about the ac
tual request that generated this fetch? | 103 // FIXME: Should this really be 'internal'? Do we know anything about the ac
tual request that generated this fetch? |
103 request.setRequestContext(WebURLRequest::RequestContextInternal); | 104 request.setRequestContext(WebURLRequest::RequestContextInternal); |
104 | 105 |
105 request.setHTTPMethod(HTTPNames::GET); | 106 request.setHTTPMethod(HTTPNames::GET); |
106 if (m_hasRange) | 107 if (m_hasRange) |
107 request.setHTTPHeaderField(HTTPNames::Range, AtomicString(String::format
("bytes=%d-%d", m_rangeStart, m_rangeEnd))); | 108 request.setHTTPHeaderField(HTTPNames::Range, AtomicString(String::format
("bytes=%d-%d", m_rangeStart, m_rangeEnd))); |
108 | 109 |
109 ThreadableLoaderOptions options; | 110 ThreadableLoaderOptions options; |
110 options.preflightPolicy = ConsiderPreflight; | 111 options.preflightPolicy = ConsiderPreflight; |
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
401 m_stringResult = builder.toString(); | 402 m_stringResult = builder.toString(); |
402 } | 403 } |
403 | 404 |
404 void FileReaderLoader::setEncoding(const String& encoding) | 405 void FileReaderLoader::setEncoding(const String& encoding) |
405 { | 406 { |
406 if (!encoding.isEmpty()) | 407 if (!encoding.isEmpty()) |
407 m_encoding = WTF::TextEncoding(encoding); | 408 m_encoding = WTF::TextEncoding(encoding); |
408 } | 409 } |
409 | 410 |
410 } // namespace blink | 411 } // namespace blink |
OLD | NEW |