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

Unified Diff: Source/modules/filesystem/DOMFileSystem.h

Issue 314333002: Enable Oilpan by default in modules/filesystem/ (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Remove consts from conversion ctor + copy assignment op Created 6 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/modules/filesystem/DOMFilePath.h ('k') | Source/modules/filesystem/DOMFileSystem.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/filesystem/DOMFileSystem.h
diff --git a/Source/modules/filesystem/DOMFileSystem.h b/Source/modules/filesystem/DOMFileSystem.h
index 7767df39c2ddf73399856a6ffc8082c96b1a6cae..7f81372c9cbf8ee7bace20291bcddc1d49a9d617 100644
--- a/Source/modules/filesystem/DOMFileSystem.h
+++ b/Source/modules/filesystem/DOMFileSystem.h
@@ -49,12 +49,12 @@ class FileWriterCallback;
class DOMFileSystem FINAL : public DOMFileSystemBase, public ScriptWrappable, public ActiveDOMObject {
public:
- static PassRefPtrWillBeRawPtr<DOMFileSystem> create(ExecutionContext*, const String& name, FileSystemType, const KURL& rootURL);
+ static DOMFileSystem* create(ExecutionContext*, const String& name, FileSystemType, const KURL& rootURL);
// Creates a new isolated file system for the given filesystemId.
- static PassRefPtrWillBeRawPtr<DOMFileSystem> createIsolatedFileSystem(ExecutionContext*, const String& filesystemId);
+ static DOMFileSystem* createIsolatedFileSystem(ExecutionContext*, const String& filesystemId);
- PassRefPtrWillBeRawPtr<DirectoryEntry> root();
+ DirectoryEntry* root();
// DOMFileSystemBase overrides.
virtual void addPendingCallbacks() OVERRIDE;
@@ -73,6 +73,9 @@ public:
static void scheduleCallback(ExecutionContext*, PassOwnPtr<CB>, PassRefPtrWillBeRawPtr<CBArg>);
template <typename CB, typename CBArg>
+ static void scheduleCallback(ExecutionContext*, PassOwnPtr<CB>, CBArg*);
+
+ template <typename CB, typename CBArg>
static void scheduleCallback(ExecutionContext*, PassOwnPtr<CB>, const HeapVector<CBArg>&);
template <typename CB, typename CBArg>
@@ -88,6 +91,12 @@ public:
}
template <typename CB, typename CBArg>
+ void scheduleCallback(PassOwnPtr<CB> callback, CBArg* callbackArg)
+ {
+ scheduleCallback(executionContext(), callback, callbackArg);
+ }
+
+ template <typename CB, typename CBArg>
void scheduleCallback(PassOwnPtr<CB> callback, const CBArg& callbackArg)
{
scheduleCallback(executionContext(), callback, callbackArg);
@@ -98,9 +107,9 @@ private:
// A helper template to schedule a callback task.
template <typename CB, typename CBArg>
- class DispatchCallbacRefPtrArgTask FINAL : public ExecutionContextTask {
+ class DispatchCallbackRefPtrArgTask FINAL : public ExecutionContextTask {
public:
- DispatchCallbacRefPtrArgTask(PassOwnPtr<CB> callback, PassRefPtrWillBeRawPtr<CBArg> arg)
+ DispatchCallbackRefPtrArgTask(PassOwnPtr<CB> callback, PassRefPtrWillBeRawPtr<CBArg> arg)
: m_callback(callback)
, m_callbackArg(arg)
{
@@ -117,6 +126,25 @@ private:
};
template <typename CB, typename CBArg>
+ class DispatchCallbackPtrArgTask FINAL : public ExecutionContextTask {
+ public:
+ DispatchCallbackPtrArgTask(PassOwnPtr<CB> callback, CBArg* arg)
+ : m_callback(callback)
+ , m_callbackArg(arg)
+ {
+ }
+
+ virtual void performTask(ExecutionContext*) OVERRIDE
+ {
+ m_callback->handleEvent(m_callbackArg.get());
+ }
+
+ private:
+ OwnPtr<CB> m_callback;
+ Persistent<CBArg> m_callbackArg;
+ };
+
+ template <typename CB, typename CBArg>
class DispatchCallbackNonPtrArgTask FINAL : public ExecutionContextTask {
public:
DispatchCallbackNonPtrArgTask(PassOwnPtr<CB> callback, const CBArg& arg)
@@ -160,7 +188,15 @@ void DOMFileSystem::scheduleCallback(ExecutionContext* executionContext, PassOwn
{
ASSERT(executionContext->isContextThread());
if (callback)
- executionContext->postTask(adoptPtr(new DispatchCallbacRefPtrArgTask<CB, CBArg>(callback, arg)));
+ executionContext->postTask(adoptPtr(new DispatchCallbackRefPtrArgTask<CB, CBArg>(callback, arg)));
+}
+
+template <typename CB, typename CBArg>
+void DOMFileSystem::scheduleCallback(ExecutionContext* executionContext, PassOwnPtr<CB> callback, CBArg* arg)
+{
+ ASSERT(executionContext->isContextThread());
+ if (callback)
+ executionContext->postTask(adoptPtr(new DispatchCallbackPtrArgTask<CB, CBArg>(callback, arg)));
}
template <typename CB, typename CBArg>
« no previous file with comments | « Source/modules/filesystem/DOMFilePath.h ('k') | Source/modules/filesystem/DOMFileSystem.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698