RESOLVED FIXED 145230
Allow overriding the waitForDidUpdateViewState timeout
https://bugs.webkit.org/show_bug.cgi?id=145230
Summary Allow overriding the waitForDidUpdateViewState timeout
Tim Horton
Reported 2015-05-20 16:21:23 PDT
Allow overriding the waitForDidUpdateViewState timeout
Attachments
Patch (2.31 KB, patch)
2015-05-20 16:22 PDT, Tim Horton
darin: review+
Tim Horton
Comment 1 2015-05-20 16:22:21 PDT
Darin Adler
Comment 2 2015-05-20 16:42:04 PDT
Comment on attachment 253474 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=253474&action=review > Source/WebKit2/UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:407 > + static std::chrono::milliseconds viewStateUpdateTimeout; > + if (viewStateUpdateTimeout == std::chrono::milliseconds::zero()) { > + if (id value = [[NSUserDefaults standardUserDefaults] objectForKey:@"WebKit2OverrideViewStateUpdateTimeoutMS"]) > + viewStateUpdateTimeout = std::chrono::milliseconds([value integerValue]); > + else { > #if PLATFORM(IOS) > - auto viewStateUpdateTimeout = std::chrono::milliseconds(500); > + viewStateUpdateTimeout = std::chrono::milliseconds(500); > #else > - auto viewStateUpdateTimeout = std::chrono::milliseconds(250); > + viewStateUpdateTimeout = std::chrono::milliseconds(250); > #endif > + } > + } We should not use zero as a magic value to mean uninitialized. We should use use a lambda and initialization syntax: static std::chrono::milliseconds viewStateUpdateTimeout = [] { ... fancy code in here ... }();
Note You need to log in before you can comment on or make changes to this bug.