Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(170)

Side by Side Diff: third_party/WebKit/Source/modules/filesystem/DOMFileSystem.h

Issue 1805843002: [v8 gc] Introduce a base class for all objects that can have pending activity (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: updates Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 13 matching lines...) Expand all
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31 #ifndef DOMFileSystem_h 31 #ifndef DOMFileSystem_h
32 #define DOMFileSystem_h 32 #define DOMFileSystem_h
33 33
34 #include "bindings/core/v8/ActiveScriptWrappable.h"
34 #include "bindings/core/v8/ScriptWrappable.h" 35 #include "bindings/core/v8/ScriptWrappable.h"
35 #include "core/dom/ActiveDOMObject.h" 36 #include "core/dom/ActiveDOMObject.h"
36 #include "core/dom/ExecutionContext.h" 37 #include "core/dom/ExecutionContext.h"
37 #include "core/dom/ExecutionContextTask.h" 38 #include "core/dom/ExecutionContextTask.h"
38 #include "modules/ModulesExport.h" 39 #include "modules/ModulesExport.h"
39 #include "modules/filesystem/DOMFileSystemBase.h" 40 #include "modules/filesystem/DOMFileSystemBase.h"
40 #include "modules/filesystem/EntriesCallback.h" 41 #include "modules/filesystem/EntriesCallback.h"
41 #include "platform/heap/Handle.h" 42 #include "platform/heap/Handle.h"
42 #include "public/platform/WebTraceLocation.h" 43 #include "public/platform/WebTraceLocation.h"
43 44
44 namespace blink { 45 namespace blink {
45 46
46 class DirectoryEntry; 47 class DirectoryEntry;
47 class BlobCallback; 48 class BlobCallback;
48 class FileEntry; 49 class FileEntry;
49 class FileWriterCallback; 50 class FileWriterCallback;
50 51
51 class MODULES_EXPORT DOMFileSystem final : public DOMFileSystemBase, public Scri ptWrappable, public ActiveDOMObject { 52 class MODULES_EXPORT DOMFileSystem final : public DOMFileSystemBase, public Scri ptWrappable, public ActiveScriptWrappable, public ActiveDOMObject {
52 DEFINE_WRAPPERTYPEINFO(); 53 DEFINE_WRAPPERTYPEINFO();
53 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(DOMFileSystem); 54 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(DOMFileSystem);
54 public: 55 public:
55 static DOMFileSystem* create(ExecutionContext*, const String& name, FileSyst emType, const KURL& rootURL); 56 static DOMFileSystem* create(ExecutionContext*, const String& name, FileSyst emType, const KURL& rootURL);
56 57
57 // Creates a new isolated file system for the given filesystemId. 58 // Creates a new isolated file system for the given filesystemId.
58 static DOMFileSystem* createIsolatedFileSystem(ExecutionContext*, const Stri ng& filesystemId); 59 static DOMFileSystem* createIsolatedFileSystem(ExecutionContext*, const Stri ng& filesystemId);
59 60
60 DirectoryEntry* root() const; 61 DirectoryEntry* root() const;
61 62
62 // DOMFileSystemBase overrides. 63 // DOMFileSystemBase overrides.
63 void addPendingCallbacks() override; 64 void addPendingCallbacks() override;
64 void removePendingCallbacks() override; 65 void removePendingCallbacks() override;
65 void reportError(ErrorCallback*, FileError*) override; 66 void reportError(ErrorCallback*, FileError*) override;
66 67
67 // ActiveDOMObject overrides. 68 // ActiveScriptWrappable overrides.
68 bool hasPendingActivity() const override; 69 bool hasPendingActivity() const final;
69 70
70 void createWriter(const FileEntry*, FileWriterCallback*, ErrorCallback*); 71 void createWriter(const FileEntry*, FileWriterCallback*, ErrorCallback*);
71 void createFile(const FileEntry*, BlobCallback*, ErrorCallback*); 72 void createFile(const FileEntry*, BlobCallback*, ErrorCallback*);
72 73
73 // Schedule a callback. This should not cross threads (should be called on t he same context thread). 74 // Schedule a callback. This should not cross threads (should be called on t he same context thread).
74 // FIXME: move this to a more generic place. 75 // FIXME: move this to a more generic place.
75 template <typename CB, typename CBArg> 76 template <typename CB, typename CBArg>
76 static void scheduleCallback(ExecutionContext*, CB*, CBArg*); 77 static void scheduleCallback(ExecutionContext*, CB*, CBArg*);
77 78
78 template <typename CB, typename CBArg> 79 template <typename CB, typename CBArg>
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 void DOMFileSystem::scheduleCallback(ExecutionContext* executionContext, CB* cal lback) 208 void DOMFileSystem::scheduleCallback(ExecutionContext* executionContext, CB* cal lback)
208 { 209 {
209 ASSERT(executionContext->isContextThread()); 210 ASSERT(executionContext->isContextThread());
210 if (callback) 211 if (callback)
211 executionContext->postTask(BLINK_FROM_HERE, adoptPtr(new DispatchCallbac kNoArgTask<CB>(callback))); 212 executionContext->postTask(BLINK_FROM_HERE, adoptPtr(new DispatchCallbac kNoArgTask<CB>(callback)));
212 } 213 }
213 214
214 } // namespace blink 215 } // namespace blink
215 216
216 #endif // DOMFileSystem_h 217 #endif // DOMFileSystem_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698