| 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 20 matching lines...) Expand all Loading... |
| 31 #ifndef DOMFileSystem_h | 31 #ifndef DOMFileSystem_h |
| 32 #define DOMFileSystem_h | 32 #define DOMFileSystem_h |
| 33 | 33 |
| 34 #include "bindings/core/v8/ScriptWrappable.h" | 34 #include "bindings/core/v8/ScriptWrappable.h" |
| 35 #include "core/dom/ActiveDOMObject.h" | 35 #include "core/dom/ActiveDOMObject.h" |
| 36 #include "core/dom/ExecutionContext.h" | 36 #include "core/dom/ExecutionContext.h" |
| 37 #include "core/dom/ExecutionContextTask.h" | 37 #include "core/dom/ExecutionContextTask.h" |
| 38 #include "modules/filesystem/DOMFileSystemBase.h" | 38 #include "modules/filesystem/DOMFileSystemBase.h" |
| 39 #include "modules/filesystem/EntriesCallback.h" | 39 #include "modules/filesystem/EntriesCallback.h" |
| 40 #include "platform/heap/Handle.h" | 40 #include "platform/heap/Handle.h" |
| 41 #include "public/platform/WebTraceLocation.h" | |
| 42 | 41 |
| 43 namespace blink { | 42 namespace blink { |
| 44 | 43 |
| 45 class DirectoryEntry; | 44 class DirectoryEntry; |
| 46 class FileCallback; | 45 class FileCallback; |
| 47 class FileEntry; | 46 class FileEntry; |
| 48 class FileWriterCallback; | 47 class FileWriterCallback; |
| 49 | 48 |
| 50 class DOMFileSystem final : public DOMFileSystemBase, public ScriptWrappable, pu
blic ActiveDOMObject { | 49 class DOMFileSystem final : public DOMFileSystemBase, public ScriptWrappable, pu
blic ActiveDOMObject { |
| 51 DEFINE_WRAPPERTYPEINFO(); | 50 DEFINE_WRAPPERTYPEINFO(); |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 }; | 195 }; |
| 197 | 196 |
| 198 int m_numberOfPendingCallbacks; | 197 int m_numberOfPendingCallbacks; |
| 199 }; | 198 }; |
| 200 | 199 |
| 201 template <typename CB, typename CBArg> | 200 template <typename CB, typename CBArg> |
| 202 void DOMFileSystem::scheduleCallback(ExecutionContext* executionContext, CB* cal
lback, PassRefPtrWillBeRawPtr<CBArg> arg) | 201 void DOMFileSystem::scheduleCallback(ExecutionContext* executionContext, CB* cal
lback, PassRefPtrWillBeRawPtr<CBArg> arg) |
| 203 { | 202 { |
| 204 ASSERT(executionContext->isContextThread()); | 203 ASSERT(executionContext->isContextThread()); |
| 205 if (callback) | 204 if (callback) |
| 206 executionContext->postTask(FROM_HERE, adoptPtr(new DispatchCallbackRefPt
rArgTask<CB, CBArg>(callback, arg))); | 205 executionContext->postTask(adoptPtr(new DispatchCallbackRefPtrArgTask<CB
, CBArg>(callback, arg))); |
| 207 } | 206 } |
| 208 | 207 |
| 209 template <typename CB, typename CBArg> | 208 template <typename CB, typename CBArg> |
| 210 void DOMFileSystem::scheduleCallback(ExecutionContext* executionContext, CB* cal
lback, CBArg* arg) | 209 void DOMFileSystem::scheduleCallback(ExecutionContext* executionContext, CB* cal
lback, CBArg* arg) |
| 211 { | 210 { |
| 212 ASSERT(executionContext->isContextThread()); | 211 ASSERT(executionContext->isContextThread()); |
| 213 if (callback) | 212 if (callback) |
| 214 executionContext->postTask(FROM_HERE, adoptPtr(new DispatchCallbackPtrAr
gTask<CB, CBArg>(callback, arg))); | 213 executionContext->postTask(adoptPtr(new DispatchCallbackPtrArgTask<CB, C
BArg>(callback, arg))); |
| 215 } | 214 } |
| 216 | 215 |
| 217 template <typename CB, typename CBArg> | 216 template <typename CB, typename CBArg> |
| 218 void DOMFileSystem::scheduleCallback(ExecutionContext* executionContext, CB* cal
lback, const HeapVector<CBArg>& arg) | 217 void DOMFileSystem::scheduleCallback(ExecutionContext* executionContext, CB* cal
lback, const HeapVector<CBArg>& arg) |
| 219 { | 218 { |
| 220 ASSERT(executionContext->isContextThread()); | 219 ASSERT(executionContext->isContextThread()); |
| 221 if (callback) | 220 if (callback) |
| 222 executionContext->postTask(FROM_HERE, adoptPtr(new DispatchCallbackNonPt
rArgTask<CB, PersistentHeapVector<CBArg>>(callback, arg))); | 221 executionContext->postTask(adoptPtr(new DispatchCallbackNonPtrArgTask<CB
, PersistentHeapVector<CBArg>>(callback, arg))); |
| 223 } | 222 } |
| 224 | 223 |
| 225 template <typename CB, typename CBArg> | 224 template <typename CB, typename CBArg> |
| 226 void DOMFileSystem::scheduleCallback(ExecutionContext* executionContext, CB* cal
lback, const CBArg& arg) | 225 void DOMFileSystem::scheduleCallback(ExecutionContext* executionContext, CB* cal
lback, const CBArg& arg) |
| 227 { | 226 { |
| 228 ASSERT(executionContext->isContextThread()); | 227 ASSERT(executionContext->isContextThread()); |
| 229 if (callback) | 228 if (callback) |
| 230 executionContext->postTask(FROM_HERE, adoptPtr(new DispatchCallbackNonPt
rArgTask<CB, CBArg>(callback, arg))); | 229 executionContext->postTask(adoptPtr(new DispatchCallbackNonPtrArgTask<CB
, CBArg>(callback, arg))); |
| 231 } | 230 } |
| 232 | 231 |
| 233 template <typename CB, typename CBArg> | 232 template <typename CB, typename CBArg> |
| 234 void DOMFileSystem::scheduleCallback(ExecutionContext* executionContext, CB* cal
lback, const Member<CBArg>& arg) | 233 void DOMFileSystem::scheduleCallback(ExecutionContext* executionContext, CB* cal
lback, const Member<CBArg>& arg) |
| 235 { | 234 { |
| 236 ASSERT(executionContext->isContextThread()); | 235 ASSERT(executionContext->isContextThread()); |
| 237 if (callback) | 236 if (callback) |
| 238 executionContext->postTask(FROM_HERE, adoptPtr(new DispatchCallbackNonPt
rArgTask<CB, Persistent<CBArg>>(callback, arg))); | 237 executionContext->postTask(adoptPtr(new DispatchCallbackNonPtrArgTask<CB
, Persistent<CBArg>>(callback, arg))); |
| 239 } | 238 } |
| 240 | 239 |
| 241 template <typename CB> | 240 template <typename CB> |
| 242 void DOMFileSystem::scheduleCallback(ExecutionContext* executionContext, CB* cal
lback) | 241 void DOMFileSystem::scheduleCallback(ExecutionContext* executionContext, CB* cal
lback) |
| 243 { | 242 { |
| 244 ASSERT(executionContext->isContextThread()); | 243 ASSERT(executionContext->isContextThread()); |
| 245 if (callback) | 244 if (callback) |
| 246 executionContext->postTask(FROM_HERE, adoptPtr(new DispatchCallbackNoArg
Task<CB>(callback))); | 245 executionContext->postTask(adoptPtr(new DispatchCallbackNoArgTask<CB>(ca
llback))); |
| 247 } | 246 } |
| 248 | 247 |
| 249 } // namespace blink | 248 } // namespace blink |
| 250 | 249 |
| 251 #endif // DOMFileSystem_h | 250 #endif // DOMFileSystem_h |
| OLD | NEW |