| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 using namespace WebCore; | 49 using namespace WebCore; |
| 50 | 50 |
| 51 namespace WebKit { | 51 namespace WebKit { |
| 52 | 52 |
| 53 void WorkerFileWriterCallbacksBridge::notifyStop() | 53 void WorkerFileWriterCallbacksBridge::notifyStop() |
| 54 { | 54 { |
| 55 ASSERT(m_workerContext->isContextThread()); | 55 ASSERT(m_workerContext->isContextThread()); |
| 56 m_clientOnWorkerThread = 0; | 56 m_clientOnWorkerThread = 0; |
| 57 } | 57 } |
| 58 | 58 |
| 59 void WorkerFileWriterCallbacksBridge::postWriteToMainThread(long long position,
const KURL& data) | 59 void WorkerFileWriterCallbacksBridge::postWriteToMainThread(long long position,
const String& blobUUID) |
| 60 { | 60 { |
| 61 // FIXME: param s/b a blobDataHandle |
| 61 ASSERT(!m_operationInProgress); | 62 ASSERT(!m_operationInProgress); |
| 62 m_operationInProgress = true; | 63 m_operationInProgress = true; |
| 63 dispatchTaskToMainThread(createCallbackTask(&writeOnMainThread, | 64 dispatchTaskToMainThread(createCallbackTask(&writeOnMainThread, |
| 64 this, position, data)); | 65 this, position, blobUUID)); |
| 65 } | 66 } |
| 66 | 67 |
| 67 void WorkerFileWriterCallbacksBridge::postTruncateToMainThread(long long length) | 68 void WorkerFileWriterCallbacksBridge::postTruncateToMainThread(long long length) |
| 68 { | 69 { |
| 69 ASSERT(!m_operationInProgress); | 70 ASSERT(!m_operationInProgress); |
| 70 m_operationInProgress = true; | 71 m_operationInProgress = true; |
| 71 dispatchTaskToMainThread(createCallbackTask(&truncateOnMainThread, | 72 dispatchTaskToMainThread(createCallbackTask(&truncateOnMainThread, |
| 72 this, length)); | 73 this, length)); |
| 73 } | 74 } |
| 74 | 75 |
| 75 void WorkerFileWriterCallbacksBridge::postAbortToMainThread() | 76 void WorkerFileWriterCallbacksBridge::postAbortToMainThread() |
| 76 { | 77 { |
| 77 ASSERT(m_operationInProgress); | 78 ASSERT(m_operationInProgress); |
| 78 dispatchTaskToMainThread(createCallbackTask(&abortOnMainThread, this)); | 79 dispatchTaskToMainThread(createCallbackTask(&abortOnMainThread, this)); |
| 79 } | 80 } |
| 80 | 81 |
| 81 void WorkerFileWriterCallbacksBridge::postShutdownToMainThread(PassRefPtr<Worker
FileWriterCallbacksBridge> bridge) | 82 void WorkerFileWriterCallbacksBridge::postShutdownToMainThread(PassRefPtr<Worker
FileWriterCallbacksBridge> bridge) |
| 82 { | 83 { |
| 83 ASSERT(m_workerContext->isContextThread()); | 84 ASSERT(m_workerContext->isContextThread()); |
| 84 m_clientOnWorkerThread = 0; | 85 m_clientOnWorkerThread = 0; |
| 85 dispatchTaskToMainThread(createCallbackTask(&shutdownOnMainThread, bridge)); | 86 dispatchTaskToMainThread(createCallbackTask(&shutdownOnMainThread, bridge)); |
| 86 } | 87 } |
| 87 | 88 |
| 88 void WorkerFileWriterCallbacksBridge::writeOnMainThread(ScriptExecutionContext*,
PassRefPtr<WorkerFileWriterCallbacksBridge> bridge, long long position, const K
URL& data) | 89 void WorkerFileWriterCallbacksBridge::writeOnMainThread(ScriptExecutionContext*,
PassRefPtr<WorkerFileWriterCallbacksBridge> bridge, long long position, const S
tring& blobUUID) |
| 89 { | 90 { |
| 90 bridge->m_writer->write(position, WebURL(data)); | 91 // FIXME: param s/b a blobDataHandle |
| 92 //bridge->m_writer->write(position, WebURL(data)); |
| 91 } | 93 } |
| 92 | 94 |
| 93 void WorkerFileWriterCallbacksBridge::truncateOnMainThread(ScriptExecutionContex
t*, PassRefPtr<WorkerFileWriterCallbacksBridge> bridge, long long length) | 95 void WorkerFileWriterCallbacksBridge::truncateOnMainThread(ScriptExecutionContex
t*, PassRefPtr<WorkerFileWriterCallbacksBridge> bridge, long long length) |
| 94 { | 96 { |
| 95 bridge->m_writer->truncate(length); | 97 bridge->m_writer->truncate(length); |
| 96 } | 98 } |
| 97 | 99 |
| 98 void WorkerFileWriterCallbacksBridge::abortOnMainThread(ScriptExecutionContext*,
PassRefPtr<WorkerFileWriterCallbacksBridge> bridge) | 100 void WorkerFileWriterCallbacksBridge::abortOnMainThread(ScriptExecutionContext*,
PassRefPtr<WorkerFileWriterCallbacksBridge> bridge) |
| 99 { | 101 { |
| 100 bridge->m_writer->cancel(); | 102 bridge->m_writer->cancel(); |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 WorkerContext* context = static_cast<WorkerContext*>(m_workerContext); | 217 WorkerContext* context = static_cast<WorkerContext*>(m_workerContext); |
| 216 if (context->thread()->runLoop().runInMode(context, m_mode) == MessageQu
eueTerminated) | 218 if (context->thread()->runLoop().runInMode(context, m_mode) == MessageQu
eueTerminated) |
| 217 return false; | 219 return false; |
| 218 } | 220 } |
| 219 return true; | 221 return true; |
| 220 } | 222 } |
| 221 | 223 |
| 222 } // namespace WebKit | 224 } // namespace WebKit |
| 223 | 225 |
| 224 #endif // ENABLE(FILE_SYSTEM) | 226 #endif // ENABLE(FILE_SYSTEM) |
| OLD | NEW |