| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 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 15 matching lines...) Expand all Loading... |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #ifndef ThreadableLoader_h | 31 #ifndef ThreadableLoader_h |
| 32 #define ThreadableLoader_h | 32 #define ThreadableLoader_h |
| 33 | 33 |
| 34 #include "core/CoreExport.h" | 34 #include "core/CoreExport.h" |
| 35 #include "core/fetch/ResourceLoaderOptions.h" | 35 #include "core/fetch/ResourceLoaderOptions.h" |
| 36 #include "platform/CrossThreadCopier.h" | |
| 37 #include "wtf/Allocator.h" | 36 #include "wtf/Allocator.h" |
| 37 #include "wtf/CrossThreadCopier.h" |
| 38 #include "wtf/Noncopyable.h" | 38 #include "wtf/Noncopyable.h" |
| 39 #include <memory> | 39 #include <memory> |
| 40 | 40 |
| 41 namespace blink { | 41 namespace blink { |
| 42 | 42 |
| 43 class ResourceRequest; | 43 class ResourceRequest; |
| 44 class ExecutionContext; | 44 class ExecutionContext; |
| 45 class ThreadableLoaderClient; | 45 class ThreadableLoaderClient; |
| 46 | 46 |
| 47 enum CrossOriginRequestPolicy { | 47 enum CrossOriginRequestPolicy { |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 return options; | 99 return options; |
| 100 } | 100 } |
| 101 | 101 |
| 102 PreflightPolicy preflightPolicy; | 102 PreflightPolicy preflightPolicy; |
| 103 CrossOriginRequestPolicy crossOriginRequestPolicy; | 103 CrossOriginRequestPolicy crossOriginRequestPolicy; |
| 104 String initiator; | 104 String initiator; |
| 105 ContentSecurityPolicyEnforcement contentSecurityPolicyEnforcement; | 105 ContentSecurityPolicyEnforcement contentSecurityPolicyEnforcement; |
| 106 unsigned long timeoutMilliseconds; | 106 unsigned long timeoutMilliseconds; |
| 107 }; | 107 }; |
| 108 | 108 |
| 109 } // namespace blink |
| 110 |
| 111 namespace WTF { |
| 112 |
| 109 template <> | 113 template <> |
| 110 struct CrossThreadCopier<ThreadableLoaderOptions> { | 114 struct CrossThreadCopier<blink::ThreadableLoaderOptions> { |
| 111 typedef CrossThreadThreadableLoaderOptionsData Type; | 115 typedef blink::CrossThreadThreadableLoaderOptionsData Type; |
| 112 static Type copy(const ThreadableLoaderOptions& options) | 116 static Type copy(const blink::ThreadableLoaderOptions& options) |
| 113 { | 117 { |
| 114 return CrossThreadThreadableLoaderOptionsData(options); | 118 return blink::CrossThreadThreadableLoaderOptionsData(options); |
| 115 } | 119 } |
| 116 }; | 120 }; |
| 117 | 121 |
| 122 } // namespace WTF |
| 123 |
| 124 namespace blink { |
| 125 |
| 118 // Useful for doing loader operations from any thread (not threadsafe, | 126 // Useful for doing loader operations from any thread (not threadsafe, |
| 119 // just able to run on threads other than the main thread). | 127 // just able to run on threads other than the main thread). |
| 120 // | 128 // |
| 121 // Arguments common to both loadResourceSynchronously() and create(): | 129 // Arguments common to both loadResourceSynchronously() and create(): |
| 122 // | 130 // |
| 123 // - ThreadableLoaderOptions argument configures this ThreadableLoader's | 131 // - ThreadableLoaderOptions argument configures this ThreadableLoader's |
| 124 // behavior. | 132 // behavior. |
| 125 // | 133 // |
| 126 // - ResourceLoaderOptions argument will be passed to the FetchRequest | 134 // - ResourceLoaderOptions argument will be passed to the FetchRequest |
| 127 // that this ThreadableLoader creates. It can be altered e.g. when | 135 // that this ThreadableLoader creates. It can be altered e.g. when |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 | 192 |
| 185 virtual ~ThreadableLoader() { } | 193 virtual ~ThreadableLoader() { } |
| 186 | 194 |
| 187 protected: | 195 protected: |
| 188 ThreadableLoader() { } | 196 ThreadableLoader() { } |
| 189 }; | 197 }; |
| 190 | 198 |
| 191 } // namespace blink | 199 } // namespace blink |
| 192 | 200 |
| 193 #endif // ThreadableLoader_h | 201 #endif // ThreadableLoader_h |
| OLD | NEW |