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

Unified Diff: Source/web/WebWorkerSettings.cpp

Issue 106353005: Expose performance.memory in workers (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@Perf-Memory-SharedWorker
Patch Set: Created 6 years, 9 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: Source/web/WebWorkerSettings.cpp
diff --git a/Source/web/WebWorkerSettings.cpp b/Source/web/WebWorkerSettings.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..38c68f45192a4e73e45b841d91c2f06966340f39
--- /dev/null
+++ b/Source/web/WebWorkerSettings.cpp
@@ -0,0 +1,47 @@
+// Copyright 2014 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.
+
+#include "config.h"
+#include "WebWorkerSettings.h"
+
+#include "core/workers/WorkerSettings.h"
+#include "wtf/OwnPtr.h"
+
+using namespace WebCore;
+
+namespace blink {
+
+WebWorkerSettings WebWorkerSettings::create()
+{
+ return WebWorkerSettings(WorkerSettings::create());
+}
+
+void WebWorkerSettings::assign(const WebWorkerSettings& other)
+{
+ m_private.reset(PassOwnPtr<WorkerSettings>(other));
+}
+
+void WebWorkerSettings::reset()
+{
+ m_private.reset(0);
+}
+
+void WebWorkerSettings::setMemoryInfoEnabled(bool enabled)
+{
+ m_private->setMemoryInfoEnabled(enabled);
+}
+
+WebWorkerSettings::WebWorkerSettings(const PassOwnPtr<WorkerSettings>& settings)
+ : m_private(settings)
+{
+}
+
+WebWorkerSettings::operator PassOwnPtr<WorkerSettings>() const
+{
+ OwnPtr<WorkerSettings> settings = WorkerSettings::create();
+ settings->setMemoryInfoEnabled(m_private->memoryInfoEnabled());
kinuko 2014/03/10 05:55:52 m_private itself is WorkerSettings, for our usage
Pan 2014/03/10 12:27:52 this method is also used in assign(const WebWorker
kinuko 2014/03/10 13:50:41 I see, I overlooked it. I'd add WorkerSettings::cr
+ return settings.release();
+}
+
+} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698