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

Unified Diff: third_party/WebKit/Source/core/dom/TaskRunnerHelper.h

Issue 2236833002: Pass per-frame task runners to Workers (when possible) [2nd try] (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixing hash traits Created 4 years, 4 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
Index: third_party/WebKit/Source/core/dom/TaskRunnerHelper.h
diff --git a/third_party/WebKit/Source/core/dom/TaskRunnerHelper.h b/third_party/WebKit/Source/core/dom/TaskRunnerHelper.h
index fb72520ea51694929384e84048ceeb3aaa307f7c..d475360a77cddc5c91fb7d4e199f8cb32bc03642 100644
--- a/third_party/WebKit/Source/core/dom/TaskRunnerHelper.h
+++ b/third_party/WebKit/Source/core/dom/TaskRunnerHelper.h
@@ -7,6 +7,7 @@
#include "core/CoreExport.h"
#include "wtf/Allocator.h"
+#include "wtf/HashTraits.h"
namespace blink {
@@ -16,7 +17,7 @@ class LocalFrame;
class ScriptState;
class WebTaskRunner;
-enum class TaskType {
+enum class TaskType : unsigned {
// Speced tasks and related internal tasks should be posted to one of
// the following task runners. These task runners may be throttled.
DOMManipulation,
@@ -43,6 +44,14 @@ enum class TaskType {
Unthrottled,
};
+// HashTraits for TaskType.
+struct TaskTypeTraits : WTF::GenericHashTraits<TaskType> {
+ static const bool emptyValueIsZero = false;
+ static TaskType emptyValue() { return static_cast<TaskType>(-1); }
+ static void constructDeletedValue(TaskType& slot, bool) { slot = static_cast<TaskType>(-2); }
+ static bool isDeletedValue(TaskType value) { return value == static_cast<TaskType>(-2); }
+};
+
class CORE_EXPORT TaskRunnerHelper final {
STATIC_ONLY(TaskRunnerHelper);
public:
« no previous file with comments | « third_party/WebKit/Source/core/core.gypi ('k') | third_party/WebKit/Source/core/workers/InProcessWorkerMessagingProxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698