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

Unified Diff: Source/core/workers/WorkerMessagingProxy.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, 10 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/core/workers/WorkerMessagingProxy.cpp
diff --git a/Source/core/workers/WorkerMessagingProxy.cpp b/Source/core/workers/WorkerMessagingProxy.cpp
index 425700aee6e39a6d218e3f5e5735e9339b91beee..d8edeb835501dac793b9c3d0968320dc75bd755c 100644
--- a/Source/core/workers/WorkerMessagingProxy.cpp
+++ b/Source/core/workers/WorkerMessagingProxy.cpp
@@ -35,6 +35,7 @@
#include "core/events/MessageEvent.h"
#include "core/frame/ContentSecurityPolicy.h"
#include "core/frame/DOMWindow.h"
+#include "core/frame/Settings.h"
#include "core/inspector/InspectorInstrumentation.h"
#include "core/inspector/ScriptCallStack.h"
#include "core/inspector/WorkerDebuggerAgent.h"
@@ -114,7 +115,10 @@ void WorkerMessagingProxy::startWorkerGlobalScope(const KURL& scriptURL, const S
OwnPtr<WorkerThreadStartupData> startupData = WorkerThreadStartupData::create(scriptURL, userAgent, sourceCode, startMode, document->contentSecurityPolicy()->deprecatedHeader(), document->contentSecurityPolicy()->deprecatedHeaderType(), m_workerClients.release());
double originTime = document->loader() ? document->loader()->timing()->referenceMonotonicTime() : monotonicallyIncreasingTime();
- RefPtr<DedicatedWorkerThread> thread = DedicatedWorkerThread::create(*this, *m_workerObjectProxy.get(), originTime, startupData.release());
+ OwnPtr<WorkerSettings> settings = WorkerSettings::create();
+ if (document->settings())
+ settings->setMemoryInfoEnabled(document->settings()->memoryInfoEnabled());
+ RefPtr<DedicatedWorkerThread> thread = DedicatedWorkerThread::create(*this, *m_workerObjectProxy.get(), originTime, settings.release(), startupData.release());
workerThreadCreated(thread);
thread->start();
InspectorInstrumentation::didStartWorkerGlobalScope(m_executionContext.get(), this, scriptURL);

Powered by Google App Engine
This is Rietveld 408576698