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

Side by Side Diff: third_party/WebKit/Source/core/workers/WorkerGlobalScope.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 /* 1 /*
2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved.
3 * Copyright (C) 2009, 2011 Google Inc. All Rights Reserved. 3 * Copyright (C) 2009, 2011 Google Inc. All Rights Reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 listeners.swap(event_listeners_); 105 listeners.swap(event_listeners_);
106 } 106 }
107 RemoveAllEventListeners(); 107 RemoveAllEventListeners();
108 108
109 script_controller_->Dispose(); 109 script_controller_->Dispose();
110 script_controller_.Clear(); 110 script_controller_.Clear();
111 event_queue_->Close(); 111 event_queue_->Close();
112 thread_ = nullptr; 112 thread_ = nullptr;
113 } 113 }
114 114
115 void WorkerGlobalScope::CountFeature(UseCounter::Feature feature) { 115 void WorkerGlobalScope::ReportFeature(UseCounter::Feature feature) {
116 DCHECK(IsContextThread()); 116 DCHECK(IsContextThread());
117 DCHECK(thread_); 117 DCHECK(thread_);
118 thread_->GetWorkerReportingProxy().CountFeature(feature); 118 thread_->GetWorkerReportingProxy().CountFeature(feature);
119 } 119 }
120 120
121 void WorkerGlobalScope::CountDeprecation(UseCounter::Feature feature) { 121 void WorkerGlobalScope::ReportDeprecation(UseCounter::Feature feature) {
122 DCHECK(IsContextThread()); 122 DCHECK(IsContextThread());
123 DCHECK(thread_); 123 DCHECK(thread_);
124 AddDeprecationMessage(feature);
125 thread_->GetWorkerReportingProxy().CountDeprecation(feature); 124 thread_->GetWorkerReportingProxy().CountDeprecation(feature);
126 } 125 }
127 126
128 void WorkerGlobalScope::ExceptionUnhandled(int exception_id) { 127 void WorkerGlobalScope::ExceptionUnhandled(int exception_id) {
129 ErrorEvent* event = pending_error_events_.Take(exception_id); 128 ErrorEvent* event = pending_error_events_.Take(exception_id);
130 DCHECK(event); 129 DCHECK(event);
131 if (WorkerThreadDebugger* debugger = 130 if (WorkerThreadDebugger* debugger =
132 WorkerThreadDebugger::From(GetThread()->GetIsolate())) 131 WorkerThreadDebugger::From(GetThread()->GetIsolate()))
133 debugger->ExceptionThrown(thread_, event); 132 debugger->ExceptionThrown(thread_, event);
134 } 133 }
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
392 visitor->Trace(event_listeners_); 391 visitor->Trace(event_listeners_);
393 visitor->Trace(pending_error_events_); 392 visitor->Trace(pending_error_events_);
394 visitor->Trace(fetch_context_); 393 visitor->Trace(fetch_context_);
395 ExecutionContext::Trace(visitor); 394 ExecutionContext::Trace(visitor);
396 EventTargetWithInlineData::Trace(visitor); 395 EventTargetWithInlineData::Trace(visitor);
397 SecurityContext::Trace(visitor); 396 SecurityContext::Trace(visitor);
398 Supplementable<WorkerGlobalScope>::Trace(visitor); 397 Supplementable<WorkerGlobalScope>::Trace(visitor);
399 } 398 }
400 399
401 } // namespace blink 400 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698