Bug 155035

Summary: Consolidate RuntimeApplicationChecks and RuntimeApplicationChecksIOS
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: WebCore Misc.Assignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: aestes, barraclough, commit-queue, darin, ddkilzer, ossy, sam
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 155256    
Bug Blocks:    
Attachments:
Description Flags
WIP Patch
none
Patch
none
Patch
none
Patch
none
Patch none

Description Chris Dumez 2016-03-04 13:09:46 PST
Consolidate RuntimeApplicationChecks and RuntimeApplicationChecksIOS and use a more consistent mechanism for app detection that works both on WK1 and WK2.
Comment 1 Chris Dumez 2016-03-04 14:24:22 PST
Created attachment 273041 [details]
WIP Patch
Comment 2 Chris Dumez 2016-03-04 15:01:28 PST
Created attachment 273049 [details]
Patch
Comment 3 Chris Dumez 2016-03-04 15:52:26 PST
Created attachment 273051 [details]
Patch
Comment 4 Chris Dumez 2016-03-04 15:53:57 PST
Created attachment 273052 [details]
Patch
Comment 5 Chris Dumez 2016-03-04 15:58:23 PST
Created attachment 273053 [details]
Patch
Comment 6 Darin Adler 2016-03-05 18:37:34 PST
Comment on attachment 273053 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=273053&action=review

> Source/WebCore/platform/RuntimeApplicationChecks.mm:64
> +    ASSERT_WITH_MESSAGE(isSafari == applicationBundleIsEqualTo("com.apple.Safari"), "Should not be called before setApplicationBundleIdentifier()");

This assertion will only fire if we use this wrong and are actually running the app in question. It would be a lot better if we had an assertion that would occur whenever the first time we called the functions in the wrong order, not just when an actual incorrect result is going to be returned.
Comment 7 WebKit Commit Bot 2016-03-05 19:28:45 PST
Comment on attachment 273053 [details]
Patch

Clearing flags on attachment: 273053

Committed r197628: <http://trac.webkit.org/changeset/197628>
Comment 8 WebKit Commit Bot 2016-03-05 19:28:49 PST
All reviewed patches have been landed.  Closing bug.
Comment 9 Csaba Osztrogonác 2016-03-18 08:44:07 PDT
(In reply to comment #7)
> Comment on attachment 273053 [details]
> Patch
> 
> Clearing flags on attachment: 273053
> 
> Committed r197628: <http://trac.webkit.org/changeset/197628>

It broke the Apple Mac cmake build:
Undefined symbols for architecture x86_64:
  "WebCore::MacApplication::isQuickenEssentials()", referenced from:
      WebCore::Widget::paint(WebCore::GraphicsContext&, WebCore::IntRect const&) in WidgetMac.mm.o
  "WebCore::MacApplication::isSolidStateNetworksDownloader()", referenced from:
      WebCore::CachedScript::shouldIgnoreHTTPStatusCodeErrors() const in CachedScript.cpp.o
  "WebCore::MacApplication::isIBooks()", referenced from:
      WebCore::JSDOMWindowBase::commonVM() in JSDOMWindowBase.cpp.o
  "WebCore::MacApplication::isITunes()", referenced from:
      WebCore::JSDOMWindowBase::commonVM() in JSDOMWindowBase.cpp.o
  "WebCore::MacApplication::isHipChat()", referenced from:
      WebCore::JSLocation::putDelegate(JSC::ExecState*, JSC::PropertyName, JSC::JSValue, JSC::PutPropertySlot&, bool&) in JSLocationCustom.cpp.o
  "WebCore::ScrollableArea::systemLanguageIsRTL()", referenced from:
      WebCore::RenderStyle::shouldPlaceBlockDirectionScrollbarOnLeft() const in RenderStyle.cpp.o
  "WebCore::ScrollableArea::verticalScrollbarIsOnLeft() const", referenced from:
      WebCore::ScrollView::updateScrollbars(WebCore::IntPoint const&) in ScrollView.cpp.o
      WebCore::ScrollView::documentScrollPositionRelativeToViewOrigin() const in ScrollView.cpp.o
      WebCore::ScrollView::scrollCornerRect() const in ScrollView.cpp.o
      WebCore::RenderLayerCompositor::positionForClipLayer() const in RenderLayerCompositor.cpp.o
ld: symbol(s) not found for architecture x86_64

speculative fix landed in http://trac.webkit.org/changeset/198412