Changeset 211211 in webkit
- Timestamp:
- Jan 26, 2017 7:52:52 AM (7 years ago)
- Location:
- branches/safari-603-branch/Source/WebCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/safari-603-branch/Source/WebCore/ChangeLog
r211190 r211211 1 2017-01-25 Matthew Hanson <matthew_hanson@apple.com> 2 3 Merge r211151. rdar://problem/30171195 4 5 2017-01-25 Chris Dumez <cdumez@apple.com> 6 7 Measure how common it is for content to deal with WebGL context loss 8 https://bugs.webkit.org/show_bug.cgi?id=166866 9 <rdar://problem/30171195> 10 11 Reviewed by Alex Christensen. 12 13 Add diagnostic logging to measure how common it is for sites to handle 14 WebGL context loss via the webglcontextlost & webglcontextrestored 15 events. 16 17 * html/canvas/WebGLRenderingContextBase.cpp: 18 (WebCore::WebGLRenderingContextBase::WebGLRenderingContextBase): 19 (WebCore::WebGLRenderingContextBase::checkForContextLossHandling): 20 * html/canvas/WebGLRenderingContextBase.h: 21 * page/DiagnosticLoggingKeys.cpp: 22 (WebCore::DiagnosticLoggingKeys::noKey): 23 (WebCore::DiagnosticLoggingKeys::yesKey): 24 (WebCore::DiagnosticLoggingKeys::handlesContextLossKey): 25 * page/DiagnosticLoggingKeys.h: 26 1 27 2017-01-25 Matthew Hanson <matthew_hanson@apple.com> 2 28 -
branches/safari-603-branch/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp
r210876 r211211 32 32 #include "CachedImage.h" 33 33 #include "DOMWindow.h" 34 #include "DiagnosticLoggingClient.h" 35 #include "DiagnosticLoggingKeys.h" 34 36 #include "Document.h" 35 37 #include "EXTBlendMinMax.h" … … 101 103 const double secondsBetweenRestoreAttempts = 1.0; 102 104 const int maxGLErrorsAllowedToConsole = 256; 105 static const std::chrono::seconds checkContextLossHandlingDelay { 3 }; 103 106 104 107 namespace { … … 471 474 , m_isPendingPolicyResolution(true) 472 475 , m_hasRequestedPolicyResolution(false) 476 , m_checkForContextLossHandlingTimer(*this, &WebGLRenderingContextBase::checkForContextLossHandling) 473 477 { 474 478 registerWithWebGLStateTracker(); 479 m_checkForContextLossHandlingTimer.startOneShot(checkContextLossHandlingDelay); 475 480 } 476 481 … … 490 495 , m_isPendingPolicyResolution(false) 491 496 , m_hasRequestedPolicyResolution(false) 497 , m_checkForContextLossHandlingTimer(*this, &WebGLRenderingContextBase::checkForContextLossHandling) 492 498 { 493 499 ASSERT(m_context); … … 503 509 initializeNewContext(); 504 510 registerWithWebGLStateTracker(); 511 m_checkForContextLossHandlingTimer.startOneShot(checkContextLossHandlingDelay); 512 } 513 514 // We check for context loss handling after a few seconds to give the JS a chance to register the event listeners 515 // and to discard temporary GL contexts (e.g. feature detection). 516 void WebGLRenderingContextBase::checkForContextLossHandling() 517 { 518 if (!canvas().renderer()) 519 return; 520 521 auto* page = canvas().document().page(); 522 if (!page) 523 return; 524 525 bool handlesContextLoss = canvas().hasEventListeners(eventNames().webglcontextlostEvent) && canvas().hasEventListeners(eventNames().webglcontextrestoredEvent); 526 page->diagnosticLoggingClient().logDiagnosticMessageWithValue(DiagnosticLoggingKeys::webGLKey(), DiagnosticLoggingKeys::handlesContextLossKey(), handlesContextLoss ? DiagnosticLoggingKeys::yesKey() : DiagnosticLoggingKeys::noKey(), ShouldSample::No); 505 527 } 506 528 -
branches/safari-603-branch/Source/WebCore/html/canvas/WebGLRenderingContextBase.h
r210876 r211211 804 804 bool validateArrayBufferType(const char* functionName, GC3Denum type, std::optional<JSC::TypedArrayType>); 805 805 void registerWithWebGLStateTracker(); 806 void checkForContextLossHandling(); 806 807 807 808 WebGLStateTracker::Token m_trackerToken; 809 Timer m_checkForContextLossHandlingTimer; 808 810 }; 809 811 -
branches/safari-603-branch/Source/WebCore/page/DiagnosticLoggingKeys.cpp
r211188 r211211 154 154 } 155 155 156 String DiagnosticLoggingKeys::noKey() 157 { 158 return ASCIILiteral("no"); 159 } 160 156 161 String DiagnosticLoggingKeys::noCacheKey() 157 162 { … … 634 639 } 635 640 641 String DiagnosticLoggingKeys::yesKey() 642 { 643 return ASCIILiteral("yes"); 644 } 645 636 646 String DiagnosticLoggingKeys::zoomedKey() 637 647 { … … 647 657 { 648 658 return ASCIILiteral("font"); 659 } 660 661 String DiagnosticLoggingKeys::handlesContextLossKey() 662 { 663 return ASCIILiteral("handlesContextLoss"); 649 664 } 650 665 -
branches/safari-603-branch/Source/WebCore/page/DiagnosticLoggingKeys.h
r211188 r211211 57 57 static String expiredKey(); 58 58 static String fontKey(); 59 static String handlesContextLossKey(); 59 60 static String hasPluginsKey(); 60 61 static String httpsNoStoreKey(); … … 85 86 WEBCORE_EXPORT static String networkProcessCrashedKey(); 86 87 WEBCORE_EXPORT static String neverSeenBeforeKey(); 88 static String noKey(); 87 89 static String noCacheKey(); 88 90 static String noCurrentHistoryItemKey(); … … 159 161 WEBCORE_EXPORT static String webGLKey(); 160 162 WEBCORE_EXPORT static String webViewKey(); 163 static String yesKey(); 161 164 WEBCORE_EXPORT static String zoomedKey(); 162 165
Note: See TracChangeset
for help on using the changeset viewer.