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

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

Issue 2584233002: Specify TaskType of posted Task explicitly in FileAPIs (4) (Closed)
Patch Set: Created 4 years 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 18 matching lines...) Expand all
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/ActiveScriptWrappable.h"
35 #include "bindings/core/v8/ScriptWrappable.h" 35 #include "bindings/core/v8/ScriptWrappable.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 "core/dom/SuspendableObject.h" 38 #include "core/dom/SuspendableObject.h"
39 #include "core/dom/TaskRunnerHelper.h"
39 #include "modules/ModulesExport.h" 40 #include "modules/ModulesExport.h"
40 #include "modules/filesystem/DOMFileSystemBase.h" 41 #include "modules/filesystem/DOMFileSystemBase.h"
41 #include "modules/filesystem/EntriesCallback.h" 42 #include "modules/filesystem/EntriesCallback.h"
42 #include "platform/heap/Handle.h" 43 #include "platform/heap/Handle.h"
43 #include "public/platform/WebTraceLocation.h" 44 #include "public/platform/WebTraceLocation.h"
44 #include "wtf/PtrUtil.h" 45 #include "wtf/PtrUtil.h"
45 46
46 namespace blink { 47 namespace blink {
47 48
48 class DirectoryEntry; 49 class DirectoryEntry;
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 bool hasPendingActivity() const final; 84 bool hasPendingActivity() const final;
84 85
85 void createWriter(const FileEntry*, FileWriterCallback*, ErrorCallbackBase*); 86 void createWriter(const FileEntry*, FileWriterCallback*, ErrorCallbackBase*);
86 void createFile(const FileEntry*, BlobCallback*, ErrorCallbackBase*); 87 void createFile(const FileEntry*, BlobCallback*, ErrorCallbackBase*);
87 88
88 // Schedule a callback. This should not cross threads (should be called on the 89 // Schedule a callback. This should not cross threads (should be called on the
89 // same context thread). 90 // same context thread).
90 static void scheduleCallback(ExecutionContext* executionContext, 91 static void scheduleCallback(ExecutionContext* executionContext,
91 std::unique_ptr<ExecutionContextTask> task) { 92 std::unique_ptr<ExecutionContextTask> task) {
92 DCHECK(executionContext->isContextThread()); 93 DCHECK(executionContext->isContextThread());
93 executionContext->postTask(BLINK_FROM_HERE, std::move(task), 94 executionContext->postTask(TaskType::FileReading, BLINK_FROM_HERE,
94 taskNameForInstrumentation()); 95 std::move(task), taskNameForInstrumentation());
95 } 96 }
96 97
97 DECLARE_VIRTUAL_TRACE(); 98 DECLARE_VIRTUAL_TRACE();
98 99
99 private: 100 private:
100 DOMFileSystem(ExecutionContext*, 101 DOMFileSystem(ExecutionContext*,
101 const String& name, 102 const String& name,
102 FileSystemType, 103 FileSystemType,
103 const KURL& rootURL); 104 const KURL& rootURL);
104 105
105 static String taskNameForInstrumentation() { return "FileSystem"; } 106 static String taskNameForInstrumentation() { return "FileSystem"; }
106 107
107 int m_numberOfPendingCallbacks; 108 int m_numberOfPendingCallbacks;
108 Member<DirectoryEntry> m_rootEntry; 109 Member<DirectoryEntry> m_rootEntry;
109 }; 110 };
110 111
111 } // namespace blink 112 } // namespace blink
112 113
113 #endif // DOMFileSystem_h 114 #endif // DOMFileSystem_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698