Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(260)

Issue 8226026: Allow whitelisted bundles to load in Chrome (Closed)

Created:
9 years, 2 months ago by Mark Mentovai
Modified:
9 years, 2 months ago
CC:
chromium-reviews
Visibility:
Public.

Description

Allow whitelisted bundles to load in Chrome: Default Folder X as of CFBundleVersion 4.4.3 MySpeed as of CFBundleVersion 1201 SIMBL (Albert Zeyer's fork) at any CFBundleVersion Smart Scroll as of CFBundleVersion 3.9 This also removes the prohibition on loading SIMBL plug-ins. If a permitted SIMBL is present, it is resposnbile for loading plug-ins and provides the interface for plug-ins to override code. BUG=95045 TEST=These products should now work in Chrome Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=105251

Patch Set 1 #

Total comments: 1

Patch Set 2 : '' #

Total comments: 7

Patch Set 3 : '' #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+232 lines, -34 lines) Patch
M chrome/chrome_tests.gypi View 1 2 1 chunk +3 lines, -2 lines 0 comments Download
M chrome/common/mac/cfbundle_blocker.h View 1 2 2 chunks +12 lines, -0 lines 0 comments Download
M chrome/common/mac/cfbundle_blocker.mm View 1 2 5 chunks +124 lines, -32 lines 2 comments Download
A chrome/common/mac/cfbundle_blocker_unittest.mm View 1 2 1 chunk +93 lines, -0 lines 2 comments Download

Messages

Total messages: 7 (0 generated)
Mark Mentovai
9 years, 2 months ago (2011-10-12 17:22:24 UTC) #1
Nico
http://codereview.chromium.org/8226026/diff/1/chrome/common/mac/cfbundle_blocker.mm File chrome/common/mac/cfbundle_blocker.mm (right): http://codereview.chromium.org/8226026/diff/1/chrome/common/mac/cfbundle_blocker.mm#newcode159 chrome/common/mac/cfbundle_blocker.mm:159: const AllowedBundle kAllowedBundles[] = { Add a comment saying ...
9 years, 2 months ago (2011-10-12 17:25:59 UTC) #2
Mark Mentovai
Good call. Uploaded a new version with that information in a comment.
9 years, 2 months ago (2011-10-12 18:21:36 UTC) #3
Scott Hess - ex-Googler
The review comment sounds like we've decided that the problem may not be plug-ins, but ...
9 years, 2 months ago (2011-10-12 19:34:34 UTC) #4
Mark Mentovai
I took most of your suggestions except for the wildcarding one discussed below. Ready for ...
9 years, 2 months ago (2011-10-12 23:48:50 UTC) #5
Scott Hess - ex-Googler
LGTM. My nits are entirely advisory/philosophical. http://codereview.chromium.org/8226026/diff/7001/chrome/common/mac/cfbundle_blocker.mm File chrome/common/mac/cfbundle_blocker.mm (right): http://codereview.chromium.org/8226026/diff/7001/chrome/common/mac/cfbundle_blocker.mm#newcode183 chrome/common/mac/cfbundle_blocker.mm:183: << [path fileSystemRepresentation]; ...
9 years, 2 months ago (2011-10-13 00:05:54 UTC) #6
Mark Mentovai
9 years, 2 months ago (2011-10-13 03:23:14 UTC) #7
Thanks for the review!

http://codereview.chromium.org/8226026/diff/7001/chrome/common/mac/cfbundle_b...
File chrome/common/mac/cfbundle_blocker.mm (right):

http://codereview.chromium.org/8226026/diff/7001/chrome/common/mac/cfbundle_b...
chrome/common/mac/cfbundle_blocker.mm:183: << [path fileSystemRepresentation];
shess wrote:
> Wonder if this would be cleaner using -[NSString stringWithFormat:] to format
> all the OSX stuff together, then one big -UTF8String to log it.   You
shouldn't
> have added mods, here :-).

That’d be sorta technically incorrect around the -fileSystemRepresentation bit,
and anyway, this is what LOG(…) << … << …; was born for.

You’re right, I shouldn’t have touched it. :)

http://codereview.chromium.org/8226026/diff/7001/chrome/common/mac/cfbundle_b...
File chrome/common/mac/cfbundle_blocker_unittest.mm (right):

http://codereview.chromium.org/8226026/diff/7001/chrome/common/mac/cfbundle_b...
chrome/common/mac/cfbundle_blocker_unittest.mm:88: }
shess wrote:
> Thank you for writing the test!  I think IsBundleAllowed() also became clearer
> because it could just exit-early rather than maintaining nested state.

I agree that IsBundleAllowed is cleaner this way, and it’s a benefit that it’s
easily testable.

> That said, I once got yelled at for writing a data-driven test like this.  I
> personally consider it reasonable, but figured I should bring it up.  I think
> the theory is whether this is really better than a bunch of:
> 
> EXPECT_FALSE(IsBundleAllowed(@"com.stclairsoft.DefaultFolderX.osax",
@"3.5.4"));
> 
> I can kinda see the point.  I think your logging into failure is appropriate
to
> allow debuggers to see what's happening.

There’s longstanding precedent for the big array. ’Course, some of the precedent
is stuff that I wrote, but that’s one of the perks of being with the project for
a long time. There’s also non-Mark precedent in Chrome.

The chief advantage of writing a bunch of EXPECT_xxx is that they show you the
input and line number, but including the index and inputs overcomes that. I like
writing as much of the test as possible in a real language (like C++ or
Objective-C) and having the silly macro show up in only one location. Writing
EXPECT_xxx(IsBundleAllowed(…, …)); over and over again feels like a lot of
boilerplate over and over, and one of the cardinal rules of programming is that
if you find yourself doing the same thing more than once, maybe you ought to
refactor. Doing it my way eats up less horizontal space and makes it less likely
that things will need to be wrapped “creatively.”

Powered by Google App Engine
This is Rietveld 408576698