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

Side by Side Diff: Source/core/workers/WorkerGlobalScope.cpp

Issue 901143002: Support deprecation warnings in shared/service workers (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 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 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 316 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 WorkerEventQueue* WorkerGlobalScope::eventQueue() const 327 WorkerEventQueue* WorkerGlobalScope::eventQueue() const
328 { 328 {
329 return m_eventQueue.get(); 329 return m_eventQueue.get();
330 } 330 }
331 331
332 void WorkerGlobalScope::countFeature(UseCounter::Feature) const 332 void WorkerGlobalScope::countFeature(UseCounter::Feature) const
333 { 333 {
334 // FIXME: How should we count features for shared/service workers? 334 // FIXME: How should we count features for shared/service workers?
335 } 335 }
336 336
337 void WorkerGlobalScope::countDeprecation(UseCounter::Feature) const 337 void WorkerGlobalScope::countDeprecation(UseCounter::Feature feature) const
338 { 338 {
339 // FIXME: How should we count features for shared/service workers? 339 // FIXME: How should we count features for shared/service workers?
340
sof 2015/02/05 08:48:18 Could you add a comment (or an assert, if you pref
Kunihiko Sakamoto 2015/02/05 10:35:37 Done.
341 // For each deprecated feature, send console message at most once
342 // per worker lifecycle.
343 if (!m_deprecationWarningBits) {
344 m_deprecationWarningBits = adoptPtr(new BitVector(UseCounter::NumberOfFe atures));
345 m_deprecationWarningBits->clearAll();
346 }
347 if (!m_deprecationWarningBits->quickGet(feature)) {
348 m_deprecationWarningBits->quickSet(feature);
349 ASSERT(!UseCounter::deprecationMessage(feature).isEmpty());
350 executionContext()->addConsoleMessage(ConsoleMessage::create(Deprecation MessageSource, WarningMessageLevel, UseCounter::deprecationMessage(feature)));
sof 2015/02/05 08:48:18 We know currently from calling context that execut
Kunihiko Sakamoto 2015/02/05 10:35:37 Done.
351 }
340 } 352 }
341 353
342 ConsoleMessageStorage* WorkerGlobalScope::messageStorage() 354 ConsoleMessageStorage* WorkerGlobalScope::messageStorage()
343 { 355 {
344 return m_messageStorage.get(); 356 return m_messageStorage.get();
345 } 357 }
346 358
347 void WorkerGlobalScope::exceptionHandled(int exceptionId, bool isHandled) 359 void WorkerGlobalScope::exceptionHandled(int exceptionId, bool isHandled)
348 { 360 {
349 RefPtrWillBeRawPtr<ConsoleMessage> consoleMessage = m_pendingMessages.take(e xceptionId); 361 RefPtrWillBeRawPtr<ConsoleMessage> consoleMessage = m_pendingMessages.take(e xceptionId);
(...skipping 13 matching lines...) Expand all
363 visitor->trace(m_timers); 375 visitor->trace(m_timers);
364 visitor->trace(m_messageStorage); 376 visitor->trace(m_messageStorage);
365 visitor->trace(m_pendingMessages); 377 visitor->trace(m_pendingMessages);
366 HeapSupplementable<WorkerGlobalScope>::trace(visitor); 378 HeapSupplementable<WorkerGlobalScope>::trace(visitor);
367 #endif 379 #endif
368 ExecutionContext::trace(visitor); 380 ExecutionContext::trace(visitor);
369 EventTargetWithInlineData::trace(visitor); 381 EventTargetWithInlineData::trace(visitor);
370 } 382 }
371 383
372 } // namespace blink 384 } // namespace blink
OLDNEW
« Source/core/workers/WorkerGlobalScope.h ('K') | « Source/core/workers/WorkerGlobalScope.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698