| 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 22 matching lines...) Expand all Loading... |
| 33 | 33 |
| 34 #include "FileSystemType.h" | 34 #include "FileSystemType.h" |
| 35 #include "WebFileSystemCallbacks.h" | 35 #include "WebFileSystemCallbacks.h" |
| 36 #include <public/WebFileSystem.h> | 36 #include <public/WebFileSystem.h> |
| 37 #include <public/WebVector.h> | 37 #include <public/WebVector.h> |
| 38 #include <wtf/OwnPtr.h> | 38 #include <wtf/OwnPtr.h> |
| 39 #include <wtf/PassOwnPtr.h> | 39 #include <wtf/PassOwnPtr.h> |
| 40 | 40 |
| 41 namespace WebCore { | 41 namespace WebCore { |
| 42 class AsyncFileSystemCallbacks; | 42 class AsyncFileSystemCallbacks; |
| 43 class BlobDataHandle; |
| 43 class ScriptExecutionContext; | 44 class ScriptExecutionContext; |
| 44 } | 45 } |
| 45 | 46 |
| 46 namespace WebKit { | 47 namespace WebKit { |
| 47 | 48 |
| 48 struct WebFileInfo; | 49 struct WebFileInfo; |
| 49 struct WebFileSystemEntry; | 50 struct WebFileSystemEntry; |
| 50 class WebString; | 51 class WebString; |
| 51 class WebURL; | 52 class WebURL; |
| 52 | 53 |
| 53 class WebFileSystemCallbacksImpl : public WebFileSystemCallbacks { | 54 class WebFileSystemCallbacksImpl : public WebFileSystemCallbacks { |
| 54 public: | 55 public: |
| 55 WebFileSystemCallbacksImpl(PassOwnPtr<WebCore::AsyncFileSystemCallbacks>, We
bCore::ScriptExecutionContext* = 0, WebCore::FileSystemSynchronousType = WebCore
::AsynchronousFileSystem); | 56 WebFileSystemCallbacksImpl(PassOwnPtr<WebCore::AsyncFileSystemCallbacks>, We
bCore::ScriptExecutionContext* = 0, WebCore::FileSystemSynchronousType = WebCore
::AsynchronousFileSystem); |
| 56 virtual ~WebFileSystemCallbacksImpl(); | 57 virtual ~WebFileSystemCallbacksImpl(); |
| 57 | 58 |
| 58 virtual void didSucceed(); | 59 virtual void didSucceed(); |
| 59 virtual void didReadMetadata(const WebFileInfo& info); | 60 virtual void didReadMetadata(const WebFileInfo& info); |
| 61 virtual void didCreateSnapshotFile(const WebFileInfo& info); |
| 60 virtual void didReadDirectory(const WebVector<WebFileSystemEntry>& entries,
bool hasMore); | 62 virtual void didReadDirectory(const WebVector<WebFileSystemEntry>& entries,
bool hasMore); |
| 61 virtual void didOpenFileSystem(const WebString& name, const WebURL& rootURL)
; | 63 virtual void didOpenFileSystem(const WebString& name, const WebURL& rootURL)
; |
| 62 virtual void didFail(WebFileError error); | 64 virtual void didFail(WebFileError error); |
| 63 | 65 |
| 66 // This internal overload is used by WorkerFileSystemCallbacksBridge to deli
ver a blob data handle |
| 67 // created on the main thread to an AsyncFileSystemCallback on a background
worker thread. The other |
| 68 // virtual method is invoked by the embedder. |
| 69 void didCreateSnapshotFile(const WebFileInfo& info, PassRefPtr<WebCore::Blob
DataHandle> snapshot); |
| 70 |
| 64 private: | 71 private: |
| 65 OwnPtr<WebCore::AsyncFileSystemCallbacks> m_callbacks; | 72 OwnPtr<WebCore::AsyncFileSystemCallbacks> m_callbacks; |
| 66 | 73 |
| 67 // Used for worker's openFileSystem callbacks. | 74 // Used for worker's openFileSystem callbacks. |
| 68 WebCore::ScriptExecutionContext* m_context; | 75 WebCore::ScriptExecutionContext* m_context; |
| 69 WebCore::FileSystemSynchronousType m_synchronousType; | 76 WebCore::FileSystemSynchronousType m_synchronousType; |
| 70 }; | 77 }; |
| 71 | 78 |
| 72 } // namespace WebKit | 79 } // namespace WebKit |
| 73 | 80 |
| 74 #endif // WebFileSystemCallbacksImpl_h | 81 #endif // WebFileSystemCallbacksImpl_h |
| OLD | NEW |