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

Unified Diff: third_party/WebKit/Source/web/WebSharedWorkerReportingProxyImpl.h

Issue 2721543002: SharedWorker: Factor out WorkerReportingProxy impl from WebSharedWorkerImpl (Closed)
Patch Set: tweak header comment Created 3 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: third_party/WebKit/Source/web/WebSharedWorkerReportingProxyImpl.h
diff --git a/third_party/WebKit/Source/web/WebSharedWorkerReportingProxyImpl.h b/third_party/WebKit/Source/web/WebSharedWorkerReportingProxyImpl.h
new file mode 100644
index 0000000000000000000000000000000000000000..2d6bdd13ef4dee00c54380d11b946ba4d4eed398
--- /dev/null
+++ b/third_party/WebKit/Source/web/WebSharedWorkerReportingProxyImpl.h
@@ -0,0 +1,56 @@
+// Copyright 2017 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 WebSharedWorkerReportingProxyImpl_h
+#define WebSharedWorkerReportingProxyImpl_h
+
+#include "core/workers/ParentFrameTaskRunners.h"
+#include "core/workers/WorkerReportingProxy.h"
+#include "platform/heap/GarbageCollected.h"
+
+namespace blink {
+
+class WebSharedWorkerImpl;
+
+// An implementation of WorkerReportingProxy for SharedWorker. This is created
+// and owned by WebSharedWorkerImpl on the main thread, accessed from a worker
+// thread, and destroyed on the main thread.
+class WebSharedWorkerReportingProxyImpl final
+ : public GarbageCollectedFinalized<WebSharedWorkerReportingProxyImpl>,
+ public WorkerReportingProxy {
+ WTF_MAKE_NONCOPYABLE(WebSharedWorkerReportingProxyImpl);
+
+ public:
+ WebSharedWorkerReportingProxyImpl(WebSharedWorkerImpl*,
+ ParentFrameTaskRunners*);
+ ~WebSharedWorkerReportingProxyImpl() override;
+
+ // WorkerReportingProxy methods:
+ void countFeature(UseCounter::Feature) override;
+ void countDeprecation(UseCounter::Feature) override;
+ void reportException(const WTF::String&,
+ std::unique_ptr<SourceLocation>,
+ int exceptionId) override;
+ void reportConsoleMessage(MessageSource,
+ MessageLevel,
+ const String& message,
+ SourceLocation*) override;
+ void postMessageToPageInspector(const WTF::String&) override;
+ void didEvaluateWorkerScript(bool success) override {}
+ void didCloseWorkerGlobalScope() override;
+ void willDestroyWorkerGlobalScope() override {}
+ void didTerminateWorkerThread() override;
+
+ DECLARE_TRACE();
+
+ private:
+ // Not owned because this outlives the reporting proxy.
+ WebSharedWorkerImpl* m_worker;
+
+ Member<ParentFrameTaskRunners> m_parentFrameTaskRunners;
+};
+
+} // namespace blink
+
+#endif // WebSharedWorkerReportingProxyImpl_h

Powered by Google App Engine
This is Rietveld 408576698