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 29 matching lines...) Expand all Loading... |
40 namespace WebCore { | 40 namespace WebCore { |
41 | 41 |
42 class DirectoryEntry; | 42 class DirectoryEntry; |
43 class File; | 43 class File; |
44 class FileCallback; | 44 class FileCallback; |
45 class FileEntry; | 45 class FileEntry; |
46 class FileWriterCallback; | 46 class FileWriterCallback; |
47 | 47 |
48 class DOMFileSystem : public DOMFileSystemBase, public ScriptWrappable, public A
ctiveDOMObject { | 48 class DOMFileSystem : public DOMFileSystemBase, public ScriptWrappable, public A
ctiveDOMObject { |
49 public: | 49 public: |
50 static PassRefPtr<DOMFileSystem> create(ScriptExecutionContext*, const Strin
g& name, FileSystemType, const KURL& rootURL, PassOwnPtr<AsyncFileSystem>); | 50 static PassRefPtr<DOMFileSystem> create(ScriptExecutionContext*, const Strin
g& name, FileSystemType, const KURL& rootURL); |
51 | 51 |
52 // Creates a new isolated file system for the given filesystemId. | 52 // Creates a new isolated file system for the given filesystemId. |
53 static PassRefPtr<DOMFileSystem> createIsolatedFileSystem(ScriptExecutionCon
text*, const String& filesystemId); | 53 static PassRefPtr<DOMFileSystem> createIsolatedFileSystem(ScriptExecutionCon
text*, const String& filesystemId); |
54 | 54 |
55 PassRefPtr<DirectoryEntry> root(); | 55 PassRefPtr<DirectoryEntry> root(); |
56 | 56 |
57 // ActiveDOMObject methods. | 57 // ActiveDOMObject methods. |
58 virtual void stop(); | 58 virtual void stop(); |
59 virtual bool hasPendingActivity() const; | 59 virtual bool hasPendingActivity() const; |
60 virtual void contextDestroyed(); | 60 virtual void contextDestroyed(); |
(...skipping 15 matching lines...) Expand all Loading... |
76 scheduleCallback(scriptExecutionContext(), callback, callbackArg); | 76 scheduleCallback(scriptExecutionContext(), callback, callbackArg); |
77 } | 77 } |
78 | 78 |
79 template <typename CB, typename CBArg> | 79 template <typename CB, typename CBArg> |
80 void scheduleCallback(PassRefPtr<CB> callback, const CBArg& callbackArg) | 80 void scheduleCallback(PassRefPtr<CB> callback, const CBArg& callbackArg) |
81 { | 81 { |
82 scheduleCallback(scriptExecutionContext(), callback, callbackArg); | 82 scheduleCallback(scriptExecutionContext(), callback, callbackArg); |
83 } | 83 } |
84 | 84 |
85 private: | 85 private: |
86 DOMFileSystem(ScriptExecutionContext*, const String& name, FileSystemType, c
onst KURL& rootURL, PassOwnPtr<AsyncFileSystem>); | 86 DOMFileSystem(ScriptExecutionContext*, const String& name, FileSystemType, c
onst KURL& rootURL); |
87 | 87 |
88 // A helper template to schedule a callback task. | 88 // A helper template to schedule a callback task. |
89 template <typename CB, typename CBArg> | 89 template <typename CB, typename CBArg> |
90 class DispatchCallbacRefPtrArgTask : public ScriptExecutionContext::Task { | 90 class DispatchCallbacRefPtrArgTask : public ScriptExecutionContext::Task { |
91 public: | 91 public: |
92 DispatchCallbacRefPtrArgTask(PassRefPtr<CB> callback, PassRefPtr<CBArg>
arg) | 92 DispatchCallbacRefPtrArgTask(PassRefPtr<CB> callback, PassRefPtr<CBArg>
arg) |
93 : m_callback(callback) | 93 : m_callback(callback) |
94 , m_callbackArg(arg) | 94 , m_callbackArg(arg) |
95 { | 95 { |
96 } | 96 } |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 void DOMFileSystem::scheduleCallback(ScriptExecutionContext* scriptExecutionCont
ext, PassRefPtr<CB> callback, const CBArg& arg) | 137 void DOMFileSystem::scheduleCallback(ScriptExecutionContext* scriptExecutionCont
ext, PassRefPtr<CB> callback, const CBArg& arg) |
138 { | 138 { |
139 ASSERT(scriptExecutionContext->isContextThread()); | 139 ASSERT(scriptExecutionContext->isContextThread()); |
140 if (callback) | 140 if (callback) |
141 scriptExecutionContext->postTask(adoptPtr(new DispatchCallbackNonPtrArgT
ask<CB, CBArg>(callback, arg))); | 141 scriptExecutionContext->postTask(adoptPtr(new DispatchCallbackNonPtrArgT
ask<CB, CBArg>(callback, arg))); |
142 } | 142 } |
143 | 143 |
144 } // namespace | 144 } // namespace |
145 | 145 |
146 #endif // DOMFileSystem_h | 146 #endif // DOMFileSystem_h |
OLD | NEW |