| 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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 WorkerThreadableLoader::~WorkerThreadableLoader() | 61 WorkerThreadableLoader::~WorkerThreadableLoader() |
| 62 { | 62 { |
| 63 m_bridge.destroy(); | 63 m_bridge.destroy(); |
| 64 } | 64 } |
| 65 | 65 |
| 66 void WorkerThreadableLoader::loadResourceSynchronously(WorkerGlobalScope* worker
GlobalScope, const ResourceRequest& request, ThreadableLoaderClient& client, con
st ThreadableLoaderOptions& options) | 66 void WorkerThreadableLoader::loadResourceSynchronously(WorkerGlobalScope* worker
GlobalScope, const ResourceRequest& request, ThreadableLoaderClient& client, con
st ThreadableLoaderOptions& options) |
| 67 { | 67 { |
| 68 WorkerRunLoop& runLoop = workerGlobalScope->thread()->runLoop(); | 68 WorkerRunLoop& runLoop = workerGlobalScope->thread()->runLoop(); |
| 69 | 69 |
| 70 // Create a unique mode just for this synchronous resource load. | 70 // Create a unique mode just for this synchronous resource load. |
| 71 String mode = loadResourceSynchronouslyMode; | 71 String mode = loadResourceSynchronouslyMode + String::number(runLoop.createU
niqueId()); |
| 72 mode.append(String::number(runLoop.createUniqueId())); | |
| 73 | 72 |
| 74 RefPtr<WorkerThreadableLoader> loader = WorkerThreadableLoader::create(worke
rGlobalScope, &client, mode, request, options); | 73 RefPtr<WorkerThreadableLoader> loader = WorkerThreadableLoader::create(worke
rGlobalScope, &client, mode, request, options); |
| 75 MessageQueueWaitResult result = MessageQueueMessageReceived; | 74 MessageQueueWaitResult result = MessageQueueMessageReceived; |
| 76 while (!loader->done() && result != MessageQueueTerminated) | 75 while (!loader->done() && result != MessageQueueTerminated) |
| 77 result = runLoop.runInMode(workerGlobalScope, mode); | 76 result = runLoop.runInMode(workerGlobalScope, mode); |
| 78 | 77 |
| 79 if (!loader->done() && result == MessageQueueTerminated) | 78 if (!loader->done() && result == MessageQueueTerminated) |
| 80 loader->cancel(); | 79 loader->cancel(); |
| 81 } | 80 } |
| 82 | 81 |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 262 ASSERT_UNUSED(context, context->isWorkerGlobalScope()); | 261 ASSERT_UNUSED(context, context->isWorkerGlobalScope()); |
| 263 workerClientWrapper->didFailRedirectCheck(); | 262 workerClientWrapper->didFailRedirectCheck(); |
| 264 } | 263 } |
| 265 | 264 |
| 266 void WorkerThreadableLoader::MainThreadBridge::didFailRedirectCheck() | 265 void WorkerThreadableLoader::MainThreadBridge::didFailRedirectCheck() |
| 267 { | 266 { |
| 268 m_loaderProxy.postTaskForModeToWorkerGlobalScope(createCallbackTask(&workerG
lobalScopeDidFailRedirectCheck, m_workerClientWrapper), m_taskMode); | 267 m_loaderProxy.postTaskForModeToWorkerGlobalScope(createCallbackTask(&workerG
lobalScopeDidFailRedirectCheck, m_workerClientWrapper), m_taskMode); |
| 269 } | 268 } |
| 270 | 269 |
| 271 } // namespace WebCore | 270 } // namespace WebCore |
| OLD | NEW |