Bug 160831 - Move the plug-in and WebGL blacklist code to WebCore
Summary: Move the plug-in and WebGL blacklist code to WebCore
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Anders Carlsson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-08-12 16:08 PDT by Anders Carlsson
Modified: 2016-08-16 20:48 PDT (History)
2 users (show)

See Also:


Attachments
Patch (59.19 KB, patch)
2016-08-12 16:13 PDT, Anders Carlsson
no flags Details | Formatted Diff | Diff
Patch (59.19 KB, patch)
2016-08-12 16:37 PDT, Anders Carlsson
no flags Details | Formatted Diff | Diff
Patch (58.85 KB, patch)
2016-08-12 16:56 PDT, Anders Carlsson
sam: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Anders Carlsson 2016-08-12 16:08:15 PDT
Move the plug-in and WebGL blacklist code to WebCore
Comment 1 Anders Carlsson 2016-08-12 16:13:17 PDT
Created attachment 285971 [details]
Patch
Comment 2 Anders Carlsson 2016-08-12 16:37:23 PDT
Created attachment 285975 [details]
Patch
Comment 3 WebKit Commit Bot 2016-08-12 16:39:47 PDT
Attachment 285975 [details] did not pass style-queue:


ERROR: Source/WebCore/platform/mac/PluginBlacklist.mm:150:  Missing space around : in range-based for statement  [whitespace/colon] [4]
Total errors found: 1 in 17 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 4 Sam Weinig 2016-08-12 16:44:41 PDT
Comment on attachment 285971 [details]
Patch

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

> Source/WebCore/platform/mac/BlacklistUpdater.h:33
> +#include <Foundation/Foundation.h>
> +#include <memory>
> +#include <string>
> +#include <vector>

I'm not sure you need any of these.  Maybe something for dispatch_queue_t.

> Source/WebCore/platform/mac/BlacklistUpdater.h:51
> +private:
> +
> +    static NSDictionary *readBlacklistData();

Extra newline.

> Source/WebCore/platform/mac/BlacklistUpdater.mm:59
> +NSDictionary * BlacklistUpdater::readBlacklistData()

Extra space.

> Source/WebCore/platform/mac/BlacklistUpdater.mm:90
> +        s_pluginBlacklist = 0;

nullptr.

> Source/WebCore/platform/mac/BlacklistUpdater.mm:95
> +        s_webGLBlacklist = 0;

nullptr.

> Source/WebCore/platform/mac/PluginBlacklist.h:66
> +    NSDictionary *m_bundleIDToMinimumSecureVersion;
> +    NSDictionary *m_bundleIDToMinimumCompatibleVersion;
> +    NSDictionary *m_bundleIDToBlockedVersions;
> +    NSSet *m_bundleIDsWithAvailableUpdates;

RetainPtrs?

> Source/WebCore/platform/mac/PluginBlacklist.mm:72
> +    CFDictionaryRef systemVersionDictionary = _CFCopySystemVersionDictionary();

RetainPtr?

> Source/WebCore/platform/mac/PluginBlacklist.mm:87
> +        for (NSString *bundleID in bundleIDs) {

What is guaranteeing these are all NSStrings?

> Source/WebCore/platform/mac/PluginBlacklist.mm:89
> +            assert(versionInfo);

ASSERT?

> Source/WebCore/platform/mac/PluginBlacklist.mm:117
> +    return std::unique_ptr<PluginBlacklist>(new PluginBlacklist(bundleIDToMinimumSecureVersion, bundleIDToMinimumCompatibleVersion, bundleIDToBlockedVersions, bundleIDsWithAvailableUpdates));

std::make_unique?

> Source/WebCore/platform/mac/WebGLBlacklist.mm:74
> +    int major; // Represents the 13 in 13C64.
> +    int minor; // Represents the C in 13C64 (as a number where A == 1, i.e. 3).
> +    int build; // Represents the 64 in 13C64.

= 0; here to avoid need for default constructor.

> Source/WebCore/platform/mac/WebGLBlacklist.mm:86
> +        return OSBuildInfo();

return { };

> Source/WebCore/platform/mac/WebGLBlacklist.mm:153
> +    unsigned maskValue;
> +    [scanner scanHexInt:&maskValue];

Please write a function that given a string with hex digits returns an unsigned 32-bit int.

> Source/WebCore/platform/mac/WebGLBlacklist.mm:171
> +    CFDictionaryRef systemVersionDictionary = _CFCopySystemVersionDictionary();

RetainPtr?

> Source/WebCore/platform/mac/WebGLBlacklist.mm:215
> +    for (NSDictionary *blockData in blockEntries) {
> +
> +        GLint gpuMask = gpuMaskFromString([blockData objectForKey:@"GPU"]);

Extra newline.

> Source/WebCore/platform/mac/WebGLBlacklist.mm:242
> +    return std::unique_ptr<WebGLBlacklist>(new WebGLBlacklist(globalCommand));

std::make_unique

> Source/WebKit2/UIProcess/Plugins/PluginInfoStore.h:32
> +#include <WebCore/PluginBlacklist.h>

Why is this change needed?
Comment 5 Sam Weinig 2016-08-12 16:48:08 PDT
Comment on attachment 285975 [details]
Patch

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

> Source/WebCore/platform/mac/PluginBlacklist.mm:46
> +        PluginBlacklist* pluginBlacklist = BlacklistUpdater::pluginBlacklist();

auto*?

> Source/WebCore/platform/mac/PluginBlacklist.mm:62
> +        PluginBlacklist* pluginBlacklist = BlacklistUpdater::pluginBlacklist();

auto*

> Source/WebCore/platform/mac/WebGLBlacklist.mm:113
> +        WebGLBlacklist* webGLBlacklist = BlacklistUpdater::webGLBlacklist();

auto*

> Source/WebCore/platform/mac/WebGLBlacklist.mm:129
> +        WebGLBlacklist* webGLBlacklist = BlacklistUpdater::webGLBlacklist();

auto*

> Source/WebCore/platform/mac/WebGLBlacklist.mm:211
> +    BlockCommand globalCommand = BlockCommand::Allow;

auto?

> Source/WebCore/platform/mac/WebGLBlacklist.mm:217
> +        OSBuildInfo blockedBuildInfo = buildInfoFromOSBuildString(static_cast<NSString*>([blockData objectForKey:@"OSBuild"]));

auto?

> Source/WebCore/platform/mac/WebGLBlacklist.mm:220
> +        BlockComparison comparison = BlockComparison::Equals;

auto?

> Source/WebCore/platform/mac/WebGLBlacklist.mm:227
> +        BlockCommand command = BlockCommand::Allow;

auto?
Comment 6 Anders Carlsson 2016-08-12 16:56:22 PDT
Created attachment 285980 [details]
Patch
Comment 7 WebKit Commit Bot 2016-08-12 16:59:41 PDT
Attachment 285980 [details] did not pass style-queue:


ERROR: Source/WebCore/platform/mac/PluginBlacklist.mm:150:  Missing space around : in range-based for statement  [whitespace/colon] [4]
Total errors found: 1 in 16 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 8 Anders Carlsson 2016-08-15 09:40:08 PDT
(In reply to comment #5)
> Comment on attachment 285975 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=285975&action=review
> 
> > Source/WebCore/platform/mac/PluginBlacklist.mm:46
> > +        PluginBlacklist* pluginBlacklist = BlacklistUpdater::pluginBlacklist();
> 
> auto*?
> 
> > Source/WebCore/platform/mac/PluginBlacklist.mm:62
> > +        PluginBlacklist* pluginBlacklist = BlacklistUpdater::pluginBlacklist();
> 
> auto*
> 
> > Source/WebCore/platform/mac/WebGLBlacklist.mm:113
> > +        WebGLBlacklist* webGLBlacklist = BlacklistUpdater::webGLBlacklist();
> 
> auto*
> 
> > Source/WebCore/platform/mac/WebGLBlacklist.mm:129
> > +        WebGLBlacklist* webGLBlacklist = BlacklistUpdater::webGLBlacklist();
> 
> auto*
> 
> > Source/WebCore/platform/mac/WebGLBlacklist.mm:211
> > +    BlockCommand globalCommand = BlockCommand::Allow;
> 
> auto?
> 
> > Source/WebCore/platform/mac/WebGLBlacklist.mm:217
> > +        OSBuildInfo blockedBuildInfo = buildInfoFromOSBuildString(static_cast<NSString*>([blockData objectForKey:@"OSBuild"]));
> 
> auto?
> 
> > Source/WebCore/platform/mac/WebGLBlacklist.mm:220
> > +        BlockComparison comparison = BlockComparison::Equals;
> 
> auto?
> 
> > Source/WebCore/platform/mac/WebGLBlacklist.mm:227
> > +        BlockCommand command = BlockCommand::Allow;
> 
> auto?

I'll resolve these in an upcoming patch - I wanted to keep the changes between WKSI and Open Source minimal.
Comment 9 Anders Carlsson 2016-08-15 09:44:48 PDT
Committed r204462: <http://trac.webkit.org/changeset/204462>
Comment 10 Hunseop Jeong 2016-08-16 20:48:23 PDT
CMake build fix
Committed r204548: <http://trac.webkit.org/changeset/204548>