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