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

Unified Diff: third_party/WebKit/Source/core/workers/WorkerSettings.h

Issue 2171563002: Add WorkerSettings to expose certain flag values in WorkerGlobalScope (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added expected Created 4 years, 5 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/workers/WorkerSettings.h
diff --git a/third_party/WebKit/Source/core/workers/WorkerSettings.h b/third_party/WebKit/Source/core/workers/WorkerSettings.h
new file mode 100644
index 0000000000000000000000000000000000000000..8b5a19c64086c01f5c3844e9e44bdd9bf15d4e02
--- /dev/null
+++ b/third_party/WebKit/Source/core/workers/WorkerSettings.h
@@ -0,0 +1,45 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef WorkerSettings_h
+#define WorkerSettings_h
+
+#include "core/CoreExport.h"
+#include "core/dom/ExecutionContext.h"
+#include "core/frame/Settings.h"
+#include "core/workers/WorkerClients.h"
+#include "platform/Supplementable.h"
+#include "platform/heap/Handle.h"
+
+namespace blink {
+
+class CORE_EXPORT WorkerSettings : public GarbageCollectedFinalized<WorkerSettings>, public Supplement<WorkerClients> {
kinuko 2016/07/22 09:02:54 Does this need to be on-heap? (Just asking)
xlai (Olivia) 2016/07/22 21:53:30 Hmmm, not necessary. But isn't better to be on hea
+ USING_GARBAGE_COLLECTED_MIXIN(WorkerSettings);
+ WTF_MAKE_NONCOPYABLE(WorkerSettings);
+
+public:
+ virtual ~WorkerSettings() {}
+ DECLARE_VIRTUAL_TRACE();
+
+ static WorkerSettings* create(Settings*);
+
+ static const char* supplementName();
+ static WorkerSettings* from(ExecutionContext*);
+
+ bool disableReadingFromCanvas() const { return m_disableReadingFromCanvas; }
+
+private:
+ WorkerSettings() {}
+ void copyFlagValuesFromSettings(Settings*);
+ // The settings that are to be copied from main thread to worker thread
+ // These setting's flag values must remain unchanged throughout the document
+ // lifecycle.
+ // We hard-code the flags as there're very few flags at this moment.
+ bool m_disableReadingFromCanvas = false;
+};
+
+CORE_EXPORT void provideWorkerSettingsToWorker(WorkerClients*, WorkerSettings*);
+}
kinuko 2016/07/22 09:02:54 nit: please have empty line before line 43, and ma
xlai (Olivia) 2016/07/22 21:53:30 Done.
+
+#endif // WorkerSettings_h

Powered by Google App Engine
This is Rietveld 408576698