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

Side by Side Diff: third_party/WebKit/Source/web/WebSharedWorkerReportingProxyImpl.h

Issue 2894063002: Expose UseCounter::Feature enum out of blink as WebFeature (Closed)
Patch Set: Initial check in Created 3 years, 7 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
1 // Copyright 2017 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef WebSharedWorkerReportingProxyImpl_h 5 #ifndef WebSharedWorkerReportingProxyImpl_h
6 #define WebSharedWorkerReportingProxyImpl_h 6 #define WebSharedWorkerReportingProxyImpl_h
7 7
8 #include "core/workers/ParentFrameTaskRunners.h" 8 #include "core/workers/ParentFrameTaskRunners.h"
9 #include "core/workers/WorkerReportingProxy.h" 9 #include "core/workers/WorkerReportingProxy.h"
10 #include "platform/heap/GarbageCollected.h" 10 #include "platform/heap/GarbageCollected.h"
11 11
12 namespace blink { 12 namespace blink {
13 13
14 class WebSharedWorkerImpl; 14 class WebSharedWorkerImpl;
15 15
16 // An implementation of WorkerReportingProxy for SharedWorker. This is created 16 // An implementation of WorkerReportingProxy for SharedWorker. This is created
17 // and owned by WebSharedWorkerImpl on the main thread, accessed from a worker 17 // and owned by WebSharedWorkerImpl on the main thread, accessed from a worker
18 // thread, and destroyed on the main thread. 18 // thread, and destroyed on the main thread.
19 class WebSharedWorkerReportingProxyImpl final 19 class WebSharedWorkerReportingProxyImpl final
20 : public GarbageCollectedFinalized<WebSharedWorkerReportingProxyImpl>, 20 : public GarbageCollectedFinalized<WebSharedWorkerReportingProxyImpl>,
21 public WorkerReportingProxy { 21 public WorkerReportingProxy {
22 WTF_MAKE_NONCOPYABLE(WebSharedWorkerReportingProxyImpl); 22 WTF_MAKE_NONCOPYABLE(WebSharedWorkerReportingProxyImpl);
23 23
24 public: 24 public:
25 WebSharedWorkerReportingProxyImpl(WebSharedWorkerImpl*, 25 WebSharedWorkerReportingProxyImpl(WebSharedWorkerImpl*,
26 ParentFrameTaskRunners*); 26 ParentFrameTaskRunners*);
27 ~WebSharedWorkerReportingProxyImpl() override; 27 ~WebSharedWorkerReportingProxyImpl() override;
28 28
29 // WorkerReportingProxy methods: 29 // WorkerReportingProxy methods:
30 // TODO(lunalu): Deprecate UseCounter::Feature by WebFeature.
30 void CountFeature(UseCounter::Feature) override; 31 void CountFeature(UseCounter::Feature) override;
32 void CountFeature(WebFeature feature) override {
33 return CountFeature(static_cast<UseCounter::Feature>(feature));
34 }
31 void CountDeprecation(UseCounter::Feature) override; 35 void CountDeprecation(UseCounter::Feature) override;
36 void CountDeprecation(WebFeature feature) override {
37 return CountDeprecation(static_cast<UseCounter::Feature>(feature));
38 }
32 void ReportException(const WTF::String&, 39 void ReportException(const WTF::String&,
33 std::unique_ptr<SourceLocation>, 40 std::unique_ptr<SourceLocation>,
34 int exception_id) override; 41 int exception_id) override;
35 void ReportConsoleMessage(MessageSource, 42 void ReportConsoleMessage(MessageSource,
36 MessageLevel, 43 MessageLevel,
37 const String& message, 44 const String& message,
38 SourceLocation*) override; 45 SourceLocation*) override;
39 void PostMessageToPageInspector(const WTF::String&) override; 46 void PostMessageToPageInspector(const WTF::String&) override;
40 void DidEvaluateWorkerScript(bool success) override {} 47 void DidEvaluateWorkerScript(bool success) override {}
41 void DidCloseWorkerGlobalScope() override; 48 void DidCloseWorkerGlobalScope() override;
42 void WillDestroyWorkerGlobalScope() override {} 49 void WillDestroyWorkerGlobalScope() override {}
43 void DidTerminateWorkerThread() override; 50 void DidTerminateWorkerThread() override;
44 51
45 DECLARE_TRACE(); 52 DECLARE_TRACE();
46 53
47 private: 54 private:
48 // Not owned because this outlives the reporting proxy. 55 // Not owned because this outlives the reporting proxy.
49 WebSharedWorkerImpl* worker_; 56 WebSharedWorkerImpl* worker_;
50 57
51 Member<ParentFrameTaskRunners> parent_frame_task_runners_; 58 Member<ParentFrameTaskRunners> parent_frame_task_runners_;
52 }; 59 };
53 60
54 } // namespace blink 61 } // namespace blink
55 62
56 #endif // WebSharedWorkerReportingProxyImpl_h 63 #endif // WebSharedWorkerReportingProxyImpl_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698