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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 AtomicString initiator; | 73 AtomicString initiator; |
74 ContentSecurityPolicyEnforcement contentSecurityPolicyEnforcement; | 74 ContentSecurityPolicyEnforcement contentSecurityPolicyEnforcement; |
75 unsigned long timeoutMilliseconds; | 75 unsigned long timeoutMilliseconds; |
76 }; | 76 }; |
77 | 77 |
78 // Useful for doing loader operations from any thread (not threadsafe, | 78 // Useful for doing loader operations from any thread (not threadsafe, |
79 // just able to run on threads other than the main thread). | 79 // just able to run on threads other than the main thread). |
80 class ThreadableLoader { | 80 class ThreadableLoader { |
81 WTF_MAKE_NONCOPYABLE(ThreadableLoader); | 81 WTF_MAKE_NONCOPYABLE(ThreadableLoader); |
82 public: | 82 public: |
83 static void loadResourceSynchronously(ExecutionContext*, const ResourceR
equest&, ThreadableLoaderClient&, const ThreadableLoaderOptions&); | 83 static void loadResourceSynchronously(ExecutionContext&, const ResourceR
equest&, ThreadableLoaderClient&, const ThreadableLoaderOptions&); |
84 static PassRefPtr<ThreadableLoader> create(ExecutionContext*, Threadable
LoaderClient*, const ResourceRequest&, const ThreadableLoaderOptions&); | 84 static PassRefPtr<ThreadableLoader> create(ExecutionContext&, Threadable
LoaderClient*, const ResourceRequest&, const ThreadableLoaderOptions&); |
85 | 85 |
86 virtual void cancel() = 0; | 86 virtual void cancel() = 0; |
87 void ref() { refThreadableLoader(); } | 87 void ref() { refThreadableLoader(); } |
88 void deref() { derefThreadableLoader(); } | 88 void deref() { derefThreadableLoader(); } |
89 | 89 |
90 protected: | 90 protected: |
91 ThreadableLoader() { } | 91 ThreadableLoader() { } |
92 virtual ~ThreadableLoader() { } | 92 virtual ~ThreadableLoader() { } |
93 virtual void refThreadableLoader() = 0; | 93 virtual void refThreadableLoader() = 0; |
94 virtual void derefThreadableLoader() = 0; | 94 virtual void derefThreadableLoader() = 0; |
95 }; | 95 }; |
96 | 96 |
97 } // namespace WebCore | 97 } // namespace WebCore |
98 | 98 |
99 #endif // ThreadableLoader_h | 99 #endif // ThreadableLoader_h |
OLD | NEW |