Bug 131921

Summary: [iOS] runtime application checks don't work in WebKit2
Product: WebKit Reporter: Eric Carlson <eric.carlson>
Component: MediaAssignee: Eric Carlson <eric.carlson>
Status: RESOLVED WONTFIX    
Severity: Normal CC: andersca, commit-queue, darin, mitz, sam, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Proposed patch.
sam: review-
Updated patch
none
Updated patch
none
Updated patch none

Description Eric Carlson 2014-04-20 16:10:38 PDT
The various application checks in RuntimeApplicationChecksIOS.cpp don't work as expected when running in WebKit2 because they assume [[NSBundle mainBundle] bundleIdentifier]  returns the bundle ID of the host application.
Comment 1 Eric Carlson 2014-04-20 16:11:34 PDT
<rdar://16565372>
Comment 2 Radar WebKit Bug Importer 2014-04-20 16:12:18 PDT
<rdar://problem/16671610>
Comment 3 Eric Carlson 2014-04-20 17:24:17 PDT
Created attachment 229777 [details]
Proposed patch.
Comment 4 WebKit Commit Bot 2014-04-20 17:26:32 PDT
Attachment 229777 [details] did not pass style-queue:


ERROR: Source/WebKit2/ChangeLog:1:  ChangeLog entry has no bug number  [changelog/bugnumber] [5]
ERROR: Source/WebKit/mac/ChangeLog:1:  ChangeLog entry has no bug number  [changelog/bugnumber] [5]
Total errors found: 2 in 9 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 5 Sam Weinig 2014-04-20 17:32:01 PDT
Comment on attachment 229777 [details]
Proposed patch.

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

> Source/WebCore/page/Settings.h:275
> +    static void setEmbeddingApplicationBundleID(const String&);
> +    static const String& embeddingApplicationBundleID();

These don't seem like Settings things.  Why don't we just put all this in RuntimeApplicationChecks.h/mm.
Comment 6 Eric Carlson 2014-04-20 17:34:04 PDT
Created attachment 229778 [details]
Updated patch
Comment 7 Darin Adler 2014-04-20 20:42:20 PDT
Comment on attachment 229778 [details]
Updated patch

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

> Source/WebCore/page/Settings.h:275
> +    static void setEmbeddingApplicationBundleID(const String&);
> +    static const String& embeddingApplicationBundleID();

Never sure if such things belong in Settings, but I guess it’s OK.

> Source/WebKit/mac/WebView/WebView.mm:2458
> +    settings.setEmbeddingApplicationBundleID(String([[NSBundle mainBundle] bundleIdentifier]));

I don’t think the explicit String() is needed here. Is it?
Comment 8 Eric Carlson 2014-04-20 21:57:02 PDT
Created attachment 229783 [details]
Updated patch
Comment 9 Eric Carlson 2014-04-20 22:04:13 PDT
(In reply to comment #7)
> (From update of attachment 229778 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=229778&action=review
> 
> > Source/WebCore/page/Settings.h:275
> > +    static void setEmbeddingApplicationBundleID(const String&);
> > +    static const String& embeddingApplicationBundleID();
> 
> Never sure if such things belong in Settings, but I guess it’s OK.
> 
> > Source/WebKit/mac/WebView/WebView.mm:2458
> > +    settings.setEmbeddingApplicationBundleID(String([[NSBundle mainBundle] bundleIdentifier]));
> 
> I don’t think the explicit String() is needed here. Is it?

Oops you are right. I copied that from WebKit2 without thinking about whether or not it was necessary.
Comment 10 Eric Carlson 2014-04-20 22:05:14 PDT
Created attachment 229784 [details]
Updated patch
Comment 11 mitz 2014-04-20 22:10:34 PDT
I don’t understand why this is a bug, and I think the proposed fix (whatever it’s fixing) is conceptually wrong.

Of all the apps being tested for, none currently use the WebKit2 API. On what basis are we customizing behavior for apps that aren’t even clients of the framework? Future adopters of the API should get the API’s standard behavior. If that blocks adoption, they can request whatever additional API they need. If we anticipate such needs, we should provide such API.