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

Side by Side Diff: third_party/WebKit/Source/core/workers/ThreadedWorkletGlobalScope.cpp

Issue 2857583003: Worker: Avoid sending IPC messages for features already counted (Closed)
Patch Set: wip 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 #include "core/workers/ThreadedWorkletGlobalScope.h" 5 #include "core/workers/ThreadedWorkletGlobalScope.h"
6 6
7 #include "core/inspector/ConsoleMessage.h" 7 #include "core/inspector/ConsoleMessage.h"
8 #include "core/inspector/ConsoleMessageStorage.h" 8 #include "core/inspector/ConsoleMessageStorage.h"
9 #include "core/inspector/WorkerThreadDebugger.h" 9 #include "core/inspector/WorkerThreadDebugger.h"
10 #include "core/workers/WorkerReportingProxy.h" 10 #include "core/workers/WorkerReportingProxy.h"
(...skipping 12 matching lines...) Expand all
23 PassRefPtr<SecurityOrigin> security_origin, 23 PassRefPtr<SecurityOrigin> security_origin,
24 v8::Isolate* isolate, 24 v8::Isolate* isolate,
25 WorkerThread* thread) 25 WorkerThread* thread)
26 : WorkletGlobalScope(url, user_agent, std::move(security_origin), isolate), 26 : WorkletGlobalScope(url, user_agent, std::move(security_origin), isolate),
27 thread_(thread) {} 27 thread_(thread) {}
28 28
29 ThreadedWorkletGlobalScope::~ThreadedWorkletGlobalScope() { 29 ThreadedWorkletGlobalScope::~ThreadedWorkletGlobalScope() {
30 DCHECK(!thread_); 30 DCHECK(!thread_);
31 } 31 }
32 32
33 void ThreadedWorkletGlobalScope::CountFeature(UseCounter::Feature feature) { 33 void ThreadedWorkletGlobalScope::ReportFeature(UseCounter::Feature feature) {
34 DCHECK(IsContextThread()); 34 DCHECK(IsContextThread());
35 DCHECK(thread_); 35 DCHECK(thread_);
36 thread_->GetWorkerReportingProxy().CountFeature(feature); 36 thread_->GetWorkerReportingProxy().CountFeature(feature);
37 } 37 }
38 38
39 void ThreadedWorkletGlobalScope::CountDeprecation(UseCounter::Feature feature) { 39 void ThreadedWorkletGlobalScope::ReportDeprecation(
40 UseCounter::Feature feature) {
40 DCHECK(IsContextThread()); 41 DCHECK(IsContextThread());
41 DCHECK(thread_); 42 DCHECK(thread_);
42 AddDeprecationMessage(feature);
43 thread_->GetWorkerReportingProxy().CountDeprecation(feature); 43 thread_->GetWorkerReportingProxy().CountDeprecation(feature);
44 } 44 }
45 45
46 void ThreadedWorkletGlobalScope::Dispose() { 46 void ThreadedWorkletGlobalScope::Dispose() {
47 DCHECK(IsContextThread()); 47 DCHECK(IsContextThread());
48 WorkletGlobalScope::Dispose(); 48 WorkletGlobalScope::Dispose();
49 thread_ = nullptr; 49 thread_ = nullptr;
50 } 50 }
51 51
52 bool ThreadedWorkletGlobalScope::IsContextThread() const { 52 bool ThreadedWorkletGlobalScope::IsContextThread() const {
(...skipping 11 matching lines...) Expand all
64 } 64 }
65 65
66 void ThreadedWorkletGlobalScope::ExceptionThrown(ErrorEvent* error_event) { 66 void ThreadedWorkletGlobalScope::ExceptionThrown(ErrorEvent* error_event) {
67 DCHECK(IsContextThread()); 67 DCHECK(IsContextThread());
68 if (WorkerThreadDebugger* debugger = 68 if (WorkerThreadDebugger* debugger =
69 WorkerThreadDebugger::From(GetThread()->GetIsolate())) 69 WorkerThreadDebugger::From(GetThread()->GetIsolate()))
70 debugger->ExceptionThrown(thread_, error_event); 70 debugger->ExceptionThrown(thread_, error_event);
71 } 71 }
72 72
73 } // namespace blink 73 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698