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

Side by Side 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, 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef WebSharedWorkerReportingProxyImpl_h
6 #define WebSharedWorkerReportingProxyImpl_h
7
8 #include "core/workers/ParentFrameTaskRunners.h"
9 #include "core/workers/WorkerReportingProxy.h"
10 #include "platform/heap/GarbageCollected.h"
11
12 namespace blink {
13
14 class WebSharedWorkerImpl;
15
16 // An implementation of WorkerReportingProxy for SharedWorker. This is created
17 // and owned by WebSharedWorkerImpl on the main thread, accessed from a worker
18 // thread, and destroyed on the main thread.
19 class WebSharedWorkerReportingProxyImpl final
20 : public GarbageCollectedFinalized<WebSharedWorkerReportingProxyImpl>,
21 public WorkerReportingProxy {
22 WTF_MAKE_NONCOPYABLE(WebSharedWorkerReportingProxyImpl);
23
24 public:
25 WebSharedWorkerReportingProxyImpl(WebSharedWorkerImpl*,
26 ParentFrameTaskRunners*);
27 ~WebSharedWorkerReportingProxyImpl() override;
28
29 // WorkerReportingProxy methods:
30 void countFeature(UseCounter::Feature) override;
31 void countDeprecation(UseCounter::Feature) override;
32 void reportException(const WTF::String&,
33 std::unique_ptr<SourceLocation>,
34 int exceptionId) override;
35 void reportConsoleMessage(MessageSource,
36 MessageLevel,
37 const String& message,
38 SourceLocation*) override;
39 void postMessageToPageInspector(const WTF::String&) override;
40 void didEvaluateWorkerScript(bool success) override {}
41 void didCloseWorkerGlobalScope() override;
42 void willDestroyWorkerGlobalScope() override {}
43 void didTerminateWorkerThread() override;
44
45 DECLARE_TRACE();
46
47 private:
48 // Not owned because this outlives the reporting proxy.
49 WebSharedWorkerImpl* m_worker;
50
51 Member<ParentFrameTaskRunners> m_parentFrameTaskRunners;
52 };
53
54 } // namespace blink
55
56 #endif // WebSharedWorkerReportingProxyImpl_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698