OLD | NEW |
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 Loading... |
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 |
| 341 ASSERT(isSharedWorkerGlobalScope() || isServiceWorkerGlobalScope()); |
| 342 // For each deprecated feature, send console message at most once |
| 343 // per worker lifecycle. |
| 344 if (m_deprecationWarningBits.recordMeasurement(feature)) { |
| 345 ASSERT(!UseCounter::deprecationMessage(feature).isEmpty()); |
| 346 ASSERT(executionContext()); |
| 347 executionContext()->addConsoleMessage(ConsoleMessage::create(Deprecation
MessageSource, WarningMessageLevel, UseCounter::deprecationMessage(feature))); |
| 348 } |
340 } | 349 } |
341 | 350 |
342 ConsoleMessageStorage* WorkerGlobalScope::messageStorage() | 351 ConsoleMessageStorage* WorkerGlobalScope::messageStorage() |
343 { | 352 { |
344 return m_messageStorage.get(); | 353 return m_messageStorage.get(); |
345 } | 354 } |
346 | 355 |
347 void WorkerGlobalScope::exceptionHandled(int exceptionId, bool isHandled) | 356 void WorkerGlobalScope::exceptionHandled(int exceptionId, bool isHandled) |
348 { | 357 { |
349 RefPtrWillBeRawPtr<ConsoleMessage> consoleMessage = m_pendingMessages.take(e
xceptionId); | 358 RefPtrWillBeRawPtr<ConsoleMessage> consoleMessage = m_pendingMessages.take(e
xceptionId); |
(...skipping 13 matching lines...) Expand all Loading... |
363 visitor->trace(m_timers); | 372 visitor->trace(m_timers); |
364 visitor->trace(m_messageStorage); | 373 visitor->trace(m_messageStorage); |
365 visitor->trace(m_pendingMessages); | 374 visitor->trace(m_pendingMessages); |
366 HeapSupplementable<WorkerGlobalScope>::trace(visitor); | 375 HeapSupplementable<WorkerGlobalScope>::trace(visitor); |
367 #endif | 376 #endif |
368 ExecutionContext::trace(visitor); | 377 ExecutionContext::trace(visitor); |
369 EventTargetWithInlineData::trace(visitor); | 378 EventTargetWithInlineData::trace(visitor); |
370 } | 379 } |
371 | 380 |
372 } // namespace blink | 381 } // namespace blink |
OLD | NEW |