| 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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 options.preflightPolicy = ConsiderPreflight; | 110 options.preflightPolicy = ConsiderPreflight; |
| 111 options.crossOriginRequestPolicy = DenyCrossOriginRequests; | 111 options.crossOriginRequestPolicy = DenyCrossOriginRequests; |
| 112 // FIXME: Is there a directive to which this load should be subject? | 112 // FIXME: Is there a directive to which this load should be subject? |
| 113 options.contentSecurityPolicyEnforcement = DoNotEnforceContentSecurityPolicy
; | 113 options.contentSecurityPolicyEnforcement = DoNotEnforceContentSecurityPolicy
; |
| 114 // Use special initiator to hide the request from the inspector. | 114 // Use special initiator to hide the request from the inspector. |
| 115 options.initiator = FetchInitiatorTypeNames::internal; | 115 options.initiator = FetchInitiatorTypeNames::internal; |
| 116 | 116 |
| 117 ResourceLoaderOptions resourceLoaderOptions; | 117 ResourceLoaderOptions resourceLoaderOptions; |
| 118 resourceLoaderOptions.allowCredentials = AllowStoredCredentials; | 118 resourceLoaderOptions.allowCredentials = AllowStoredCredentials; |
| 119 | 119 |
| 120 if (m_client) | 120 if (m_client) { |
| 121 m_loader = ThreadableLoader::create(executionContext, this, request, opt
ions, resourceLoaderOptions); | 121 m_loader = ThreadableLoader::create(executionContext, this, options, res
ourceLoaderOptions); |
| 122 else | 122 m_loader->start(request); |
| 123 } else { |
| 123 ThreadableLoader::loadResourceSynchronously(executionContext, request, *
this, options, resourceLoaderOptions); | 124 ThreadableLoader::loadResourceSynchronously(executionContext, request, *
this, options, resourceLoaderOptions); |
| 125 } |
| 124 } | 126 } |
| 125 | 127 |
| 126 void FileReaderLoader::start(ExecutionContext* executionContext, PassRefPtr<Blob
DataHandle> blobData) | 128 void FileReaderLoader::start(ExecutionContext* executionContext, PassRefPtr<Blob
DataHandle> blobData) |
| 127 { | 129 { |
| 128 ASSERT(executionContext); | 130 ASSERT(executionContext); |
| 129 m_urlForReadingIsStream = false; | 131 m_urlForReadingIsStream = false; |
| 130 startInternal(*executionContext, 0, blobData); | 132 startInternal(*executionContext, 0, blobData); |
| 131 } | 133 } |
| 132 | 134 |
| 133 void FileReaderLoader::start(ExecutionContext* executionContext, const Stream& s
tream, unsigned readSize) | 135 void FileReaderLoader::start(ExecutionContext* executionContext, const Stream& s
tream, unsigned readSize) |
| (...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 399 m_stringResult = builder.toString(); | 401 m_stringResult = builder.toString(); |
| 400 } | 402 } |
| 401 | 403 |
| 402 void FileReaderLoader::setEncoding(const String& encoding) | 404 void FileReaderLoader::setEncoding(const String& encoding) |
| 403 { | 405 { |
| 404 if (!encoding.isEmpty()) | 406 if (!encoding.isEmpty()) |
| 405 m_encoding = WTF::TextEncoding(encoding); | 407 m_encoding = WTF::TextEncoding(encoding); |
| 406 } | 408 } |
| 407 | 409 |
| 408 } // namespace blink | 410 } // namespace blink |
| OLD | NEW |