| 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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 WorkerContext* m_workerContext; | 172 WorkerContext* m_workerContext; |
| 173 }; | 173 }; |
| 174 | 174 |
| 175 void WorkerAsyncFileSystemChromium::createWriter(AsyncFileWriterClient* client,
const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks) | 175 void WorkerAsyncFileSystemChromium::createWriter(AsyncFileWriterClient* client,
const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks) |
| 176 { | 176 { |
| 177 createWorkerFileSystemCallbacksBridge(WorkerFileWriterHelperCallbacks::creat
e(client, path, m_webFileSystem, callbacks, m_workerContext))->postReadMetadataT
oMainThread(m_webFileSystem, path, m_modeForCurrentOperation); | 177 createWorkerFileSystemCallbacksBridge(WorkerFileWriterHelperCallbacks::creat
e(client, path, m_webFileSystem, callbacks, m_workerContext))->postReadMetadataT
oMainThread(m_webFileSystem, path, m_modeForCurrentOperation); |
| 178 } | 178 } |
| 179 | 179 |
| 180 void WorkerAsyncFileSystemChromium::createSnapshotFileAndReadMetadata(const KURL
& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks) | 180 void WorkerAsyncFileSystemChromium::createSnapshotFileAndReadMetadata(const KURL
& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks) |
| 181 { | 181 { |
| 182 KURL internalBlobURL = BlobURL::createInternalURL(); | 182 createWorkerFileSystemCallbacksBridge(callbacks)->postCreateSnapshotFileToMa
inThread(m_webFileSystem, path, m_modeForCurrentOperation); |
| 183 | |
| 184 createWorkerFileSystemCallbacksBridge(createSnapshotFileCallback(internalBlo
bURL, callbacks))->postCreateSnapshotFileToMainThread(m_webFileSystem, internalB
lobURL, path, m_modeForCurrentOperation); | |
| 185 } | 183 } |
| 186 | 184 |
| 187 PassRefPtr<WorkerFileSystemCallbacksBridge> WorkerAsyncFileSystemChromium::creat
eWorkerFileSystemCallbacksBridge(PassOwnPtr<AsyncFileSystemCallbacks> callbacks) | 185 PassRefPtr<WorkerFileSystemCallbacksBridge> WorkerAsyncFileSystemChromium::creat
eWorkerFileSystemCallbacksBridge(PassOwnPtr<AsyncFileSystemCallbacks> callbacks) |
| 188 { | 186 { |
| 189 ASSERT(m_synchronousType == AsynchronousFileSystem || !m_bridgeForCurrentOpe
ration); | 187 ASSERT(m_synchronousType == AsynchronousFileSystem || !m_bridgeForCurrentOpe
ration); |
| 190 (void)m_synchronousType; | |
| 191 | 188 |
| 192 m_modeForCurrentOperation = fileSystemOperationsMode; | 189 m_modeForCurrentOperation = fileSystemOperationsMode; |
| 193 m_modeForCurrentOperation.append(String::number(m_workerContext->thread()->r
unLoop().createUniqueId())); | 190 m_modeForCurrentOperation.append(String::number(m_workerContext->thread()->r
unLoop().createUniqueId())); |
| 194 | 191 |
| 195 m_bridgeForCurrentOperation = WorkerFileSystemCallbacksBridge::create(m_work
erLoaderProxy, m_scriptExecutionContext, new WebKit::WebFileSystemCallbacksImpl(
callbacks)); | 192 m_bridgeForCurrentOperation = WorkerFileSystemCallbacksBridge::create(m_work
erLoaderProxy, m_scriptExecutionContext, new WebKit::WebFileSystemCallbacksImpl(
callbacks)); |
| 196 return m_bridgeForCurrentOperation; | 193 return m_bridgeForCurrentOperation; |
| 197 } | 194 } |
| 198 | 195 |
| 199 } // namespace WebCore | 196 } // namespace WebCore |
| 200 | 197 |
| 201 #endif // ENABLE(FILE_SYSTEM) | 198 #endif // ENABLE(FILE_SYSTEM) |
| OLD | NEW |