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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 ThreadableLoaderOptions() | 68 ThreadableLoaderOptions() |
69 : preflightPolicy(ConsiderPreflight) | 69 : preflightPolicy(ConsiderPreflight) |
70 , crossOriginRequestPolicy(DenyCrossOriginRequests) | 70 , crossOriginRequestPolicy(DenyCrossOriginRequests) |
71 , contentSecurityPolicyEnforcement(EnforceConnectSrcDirective) { } | 71 , contentSecurityPolicyEnforcement(EnforceConnectSrcDirective) { } |
72 | 72 |
73 PreflightPolicy preflightPolicy; // If AccessControl is used, how to det
ermine if a preflight is needed. | 73 PreflightPolicy preflightPolicy; // If AccessControl is used, how to det
ermine if a preflight is needed. |
74 CrossOriginRequestPolicy crossOriginRequestPolicy; | 74 CrossOriginRequestPolicy crossOriginRequestPolicy; |
75 RefPtr<SecurityOrigin> securityOrigin; | 75 RefPtr<SecurityOrigin> securityOrigin; |
76 AtomicString initiator; | 76 AtomicString initiator; |
77 ContentSecurityPolicyEnforcement contentSecurityPolicyEnforcement; | 77 ContentSecurityPolicyEnforcement contentSecurityPolicyEnforcement; |
| 78 unsigned long timeoutMilliseconds; |
78 }; | 79 }; |
79 | 80 |
80 // Useful for doing loader operations from any thread (not threadsafe, | 81 // Useful for doing loader operations from any thread (not threadsafe, |
81 // just able to run on threads other than the main thread). | 82 // just able to run on threads other than the main thread). |
82 class ThreadableLoader { | 83 class ThreadableLoader { |
83 WTF_MAKE_NONCOPYABLE(ThreadableLoader); | 84 WTF_MAKE_NONCOPYABLE(ThreadableLoader); |
84 public: | 85 public: |
85 static void loadResourceSynchronously(ScriptExecutionContext*, const Res
ourceRequest&, ThreadableLoaderClient&, const ThreadableLoaderOptions&); | 86 static void loadResourceSynchronously(ScriptExecutionContext*, const Res
ourceRequest&, ThreadableLoaderClient&, const ThreadableLoaderOptions&); |
86 static PassRefPtr<ThreadableLoader> create(ScriptExecutionContext*, Thre
adableLoaderClient*, const ResourceRequest&, const ThreadableLoaderOptions&); | 87 static PassRefPtr<ThreadableLoader> create(ScriptExecutionContext*, Thre
adableLoaderClient*, const ResourceRequest&, const ThreadableLoaderOptions&); |
87 | 88 |
88 virtual void cancel() = 0; | 89 virtual void cancel() = 0; |
89 void ref() { refThreadableLoader(); } | 90 void ref() { refThreadableLoader(); } |
90 void deref() { derefThreadableLoader(); } | 91 void deref() { derefThreadableLoader(); } |
91 | 92 |
92 protected: | 93 protected: |
93 ThreadableLoader() { } | 94 ThreadableLoader() { } |
94 virtual ~ThreadableLoader() { } | 95 virtual ~ThreadableLoader() { } |
95 virtual void refThreadableLoader() = 0; | 96 virtual void refThreadableLoader() = 0; |
96 virtual void derefThreadableLoader() = 0; | 97 virtual void derefThreadableLoader() = 0; |
97 }; | 98 }; |
98 | 99 |
99 } // namespace WebCore | 100 } // namespace WebCore |
100 | 101 |
101 #endif // ThreadableLoader_h | 102 #endif // ThreadableLoader_h |
OLD | NEW |