| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009, 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2009, 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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 signalled = blink::Platform::current()->waitMultipleEvents(events); | 88 signalled = blink::Platform::current()->waitMultipleEvents(events); |
| 89 } | 89 } |
| 90 if (signalled == shutdownEvent) { | 90 if (signalled == shutdownEvent) { |
| 91 loader->cancel(); | 91 loader->cancel(); |
| 92 return; | 92 return; |
| 93 } | 93 } |
| 94 | 94 |
| 95 clientBridgePtr->run(); | 95 clientBridgePtr->run(); |
| 96 } | 96 } |
| 97 | 97 |
| 98 void WorkerThreadableLoader::overrideTimeout(unsigned long timeoutMilliseconds) |
| 99 { |
| 100 m_bridge.overrideTimeout(timeoutMilliseconds); |
| 101 } |
| 102 |
| 98 void WorkerThreadableLoader::cancel() | 103 void WorkerThreadableLoader::cancel() |
| 99 { | 104 { |
| 100 m_bridge.cancel(); | 105 m_bridge.cancel(); |
| 101 } | 106 } |
| 102 | 107 |
| 103 WorkerThreadableLoader::MainThreadBridge::MainThreadBridge( | 108 WorkerThreadableLoader::MainThreadBridge::MainThreadBridge( |
| 104 PassRefPtr<ThreadableLoaderClientWrapper> workerClientWrapper, | 109 PassRefPtr<ThreadableLoaderClientWrapper> workerClientWrapper, |
| 105 PassOwnPtr<ThreadableLoaderClient> clientBridge, | 110 PassOwnPtr<ThreadableLoaderClient> clientBridge, |
| 106 WorkerLoaderProxy& loaderProxy, | 111 WorkerLoaderProxy& loaderProxy, |
| 107 const ResourceRequest& request, | 112 const ResourceRequest& request, |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 void WorkerThreadableLoader::MainThreadBridge::destroy() | 152 void WorkerThreadableLoader::MainThreadBridge::destroy() |
| 148 { | 153 { |
| 149 // Ensure that no more client callbacks are done in the worker context's thr
ead. | 154 // Ensure that no more client callbacks are done in the worker context's thr
ead. |
| 150 clearClientWrapper(); | 155 clearClientWrapper(); |
| 151 | 156 |
| 152 // "delete this" and m_mainThreadLoader::deref() on the worker object's thre
ad. | 157 // "delete this" and m_mainThreadLoader::deref() on the worker object's thre
ad. |
| 153 m_loaderProxy.postTaskToLoader( | 158 m_loaderProxy.postTaskToLoader( |
| 154 createCallbackTask(&MainThreadBridge::mainThreadDestroy, AllowCrossThrea
dAccess(this))); | 159 createCallbackTask(&MainThreadBridge::mainThreadDestroy, AllowCrossThrea
dAccess(this))); |
| 155 } | 160 } |
| 156 | 161 |
| 162 void WorkerThreadableLoader::MainThreadBridge::mainThreadOverrideTimeout(Executi
onContext* context, MainThreadBridge* thisPtr, unsigned long timeoutMilliseconds
) |
| 163 { |
| 164 ASSERT(isMainThread()); |
| 165 ASSERT_UNUSED(context, context->isDocument()); |
| 166 |
| 167 if (!thisPtr->m_mainThreadLoader) |
| 168 return; |
| 169 thisPtr->m_mainThreadLoader->overrideTimeout(timeoutMilliseconds); |
| 170 } |
| 171 |
| 172 void WorkerThreadableLoader::MainThreadBridge::overrideTimeout(unsigned long tim
eoutMilliseconds) |
| 173 { |
| 174 m_loaderProxy.postTaskToLoader( |
| 175 createCallbackTask(&MainThreadBridge::mainThreadOverrideTimeout, AllowCr
ossThreadAccess(this), |
| 176 timeoutMilliseconds)); |
| 177 } |
| 178 |
| 157 void WorkerThreadableLoader::MainThreadBridge::mainThreadCancel(ExecutionContext
* context, MainThreadBridge* thisPtr) | 179 void WorkerThreadableLoader::MainThreadBridge::mainThreadCancel(ExecutionContext
* context, MainThreadBridge* thisPtr) |
| 158 { | 180 { |
| 159 ASSERT(isMainThread()); | 181 ASSERT(isMainThread()); |
| 160 ASSERT_UNUSED(context, context->isDocument()); | 182 ASSERT_UNUSED(context, context->isDocument()); |
| 161 | 183 |
| 162 if (!thisPtr->m_mainThreadLoader) | 184 if (!thisPtr->m_mainThreadLoader) |
| 163 return; | 185 return; |
| 164 thisPtr->m_mainThreadLoader->cancel(); | 186 thisPtr->m_mainThreadLoader->cancel(); |
| 165 thisPtr->m_mainThreadLoader = nullptr; | 187 thisPtr->m_mainThreadLoader = nullptr; |
| 166 } | 188 } |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 { | 246 { |
| 225 m_clientBridge->didFailAccessControlCheck(error); | 247 m_clientBridge->didFailAccessControlCheck(error); |
| 226 } | 248 } |
| 227 | 249 |
| 228 void WorkerThreadableLoader::MainThreadBridge::didFailRedirectCheck() | 250 void WorkerThreadableLoader::MainThreadBridge::didFailRedirectCheck() |
| 229 { | 251 { |
| 230 m_clientBridge->didFailRedirectCheck(); | 252 m_clientBridge->didFailRedirectCheck(); |
| 231 } | 253 } |
| 232 | 254 |
| 233 } // namespace WebCore | 255 } // namespace WebCore |
| OLD | NEW |