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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 events.append(loaderDone.get()); | 75 events.append(loaderDone.get()); |
76 | 76 |
77 RefPtr<ThreadableLoaderClientWrapper> clientWrapper(ThreadableLoaderClientWr
apper::create(&client)); | 77 RefPtr<ThreadableLoaderClientWrapper> clientWrapper(ThreadableLoaderClientWr
apper::create(&client)); |
78 OwnPtr<WorkerLoaderClientBridgeSyncHelper> clientBridge(WorkerLoaderClientBr
idgeSyncHelper::create(client, loaderDone.release())); | 78 OwnPtr<WorkerLoaderClientBridgeSyncHelper> clientBridge(WorkerLoaderClientBr
idgeSyncHelper::create(client, loaderDone.release())); |
79 | 79 |
80 // This must be valid while loader is around. | 80 // This must be valid while loader is around. |
81 WorkerLoaderClientBridgeSyncHelper* clientBridgePtr = clientBridge.get(); | 81 WorkerLoaderClientBridgeSyncHelper* clientBridgePtr = clientBridge.get(); |
82 | 82 |
83 RefPtr<WorkerThreadableLoader> loader = WorkerThreadableLoader::create(worke
rGlobalScope, clientWrapper, clientBridge.release(), request, options); | 83 RefPtr<WorkerThreadableLoader> loader = WorkerThreadableLoader::create(worke
rGlobalScope, clientWrapper, clientBridge.release(), request, options); |
84 | 84 |
85 ThreadState::SafePointScope scope(ThreadState::HeapPointersOnStack); | 85 { |
86 blink::WebWaitableEvent* signalled = blink::Platform::current()->waitMultipl
eEvents(events); | 86 ThreadState::SafePointScope scope(ThreadState::HeapPointersOnStack); |
87 if (signalled == shutdownEvent) { | 87 blink::WebWaitableEvent* signalled = blink::Platform::current()->waitMul
tipleEvents(events); |
88 loader->cancel(); | 88 if (signalled == shutdownEvent) { |
89 return; | 89 loader->cancel(); |
| 90 return; |
| 91 } |
90 } | 92 } |
91 | 93 |
92 clientBridgePtr->run(); | 94 clientBridgePtr->run(); |
93 } | 95 } |
94 | 96 |
95 void WorkerThreadableLoader::cancel() | 97 void WorkerThreadableLoader::cancel() |
96 { | 98 { |
97 m_bridge.cancel(); | 99 m_bridge.cancel(); |
98 } | 100 } |
99 | 101 |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 { | 221 { |
220 m_clientBridge->didFailAccessControlCheck(error); | 222 m_clientBridge->didFailAccessControlCheck(error); |
221 } | 223 } |
222 | 224 |
223 void WorkerThreadableLoader::MainThreadBridge::didFailRedirectCheck() | 225 void WorkerThreadableLoader::MainThreadBridge::didFailRedirectCheck() |
224 { | 226 { |
225 m_clientBridge->didFailRedirectCheck(); | 227 m_clientBridge->didFailRedirectCheck(); |
226 } | 228 } |
227 | 229 |
228 } // namespace WebCore | 230 } // namespace WebCore |
OLD | NEW |