WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
189636
Expose XPCServiceMain on a WebProcess object rather than WKProcessPool
https://bugs.webkit.org/show_bug.cgi?id=189636
Summary
Expose XPCServiceMain on a WebProcess object rather than WKProcessPool
Alex Christensen
Reported
2018-09-14 15:03:44 PDT
Expose XPCServiceMain on a WebProcess object rather than WKProcessPool
Attachments
Patch
(12.23 KB, patch)
2018-09-14 15:13 PDT
,
Alex Christensen
no flags
Details
Formatted Diff
Diff
Patch
(15.94 KB, patch)
2018-09-14 17:14 PDT
,
Alex Christensen
no flags
Details
Formatted Diff
Diff
Patch
(11.31 KB, patch)
2018-09-14 22:46 PDT
,
Alex Christensen
no flags
Details
Formatted Diff
Diff
Patch
(11.26 KB, patch)
2018-09-15 20:40 PDT
,
Alex Christensen
no flags
Details
Formatted Diff
Diff
Patch
(24.15 KB, patch)
2018-09-17 09:01 PDT
,
Alex Christensen
no flags
Details
Formatted Diff
Diff
Patch
(22.74 KB, patch)
2018-09-17 09:47 PDT
,
Alex Christensen
no flags
Details
Formatted Diff
Diff
Show Obsolete
(5)
View All
Add attachment
proposed patch, testcase, etc.
Alex Christensen
Comment 1
2018-09-14 15:13:46 PDT
Created
attachment 349814
[details]
Patch
Tim Horton
Comment 2
2018-09-14 15:53:35 PDT
Comment on
attachment 349814
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=349814&action=review
> Source/WebKit/ChangeLog:9 > + Confusingly I had to un-unify the build of NetscapePluginMac.mm because it introduced weird naming conflicts > + because it includes Carbon.h which doesn't play nicely with other .mm files. Specifically Rect and TextEncoding conflicted.
That means that an upstream file does 'using namespace WebCore' or something. Judging by the sorting I'd guess it's one of the ones in PluginProcess/mac. Fixing that is the right way to fix this.
Tim Horton
Comment 3
2018-09-14 15:54:02 PDT
Like, say, PluginProcessMac.mm
Alex Christensen
Comment 4
2018-09-14 17:14:20 PDT
Created
attachment 349832
[details]
Patch
mitz
Comment 5
2018-09-14 17:32:05 PDT
Comment on
attachment 349832
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=349832&action=review
> Source/WebKit/WebProcess/InjectedBundle/API/Cocoa/WKWebProcess.h:30 > +@interface WKWebProcess : NSObject
The class needs an availability annotation (and also something to take care of visibility, I think; WK_CLASS_AVAILABLE should take care of both. We normally underscore-prefix private classes (but not public and internal classes) so I’d name this _WKWebProcess.
> Source/WebKit/WebProcess/InjectedBundle/API/Cocoa/WKWebProcess.h:34 > ++ (int)main;
Why this is exposed as a method is something I don’t understand. The prevailing pattern is for “main” functions to be exposed as functions. Examples include NSApplicationMain(), UIApplicationMain() and xpc_main().
Alex Christensen
Comment 6
2018-09-14 22:43:44 PDT
(In reply to mitz from
comment #5
)
> Comment on
attachment 349832
[details]
> Patch > > View in context: >
https://bugs.webkit.org/attachment.cgi?id=349832&action=review
> > > Source/WebKit/WebProcess/InjectedBundle/API/Cocoa/WKWebProcess.h:30 > > +@interface WKWebProcess : NSObject > > The class needs an availability annotation (and also something to take care > of visibility, I think; WK_CLASS_AVAILABLE should take care of both.
Totally forgot the availability annotations :(
> Why this is exposed as a method is something I don’t understand. The > prevailing pattern is for “main” functions to be exposed as functions. > Examples include NSApplicationMain(), UIApplicationMain() and xpc_main().
NSThread has a main for something similar, though not exactly the same. Numerous internal projects use an ObjC main call like this. I did it in ObjC to get closer to a world where we have an ObjC bundle API and because we don't have a precedent for availability annotations in C APIs in WebKit, but we do in JSC so I'll do something similar.
Alex Christensen
Comment 7
2018-09-14 22:46:06 PDT
Created
attachment 349852
[details]
Patch
Alex Christensen
Comment 8
2018-09-15 20:40:03 PDT
Created
attachment 349864
[details]
Patch
mitz
Comment 9
2018-09-15 21:02:46 PDT
Comment on
attachment 349864
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=349864&action=review
(In reply to Alex Christensen from
comment #6
)
> I did it in > ObjC to get closer to a world where we have an ObjC bundle API
We do have Objective-C bundle API (it’s the only bundle API that Safari uses on iOS), in WebProcess/InjectedBundle/API/{Cocoa,mac}. An equivalent, modern place to put this function declaration would be WKWebProcessPlugIn.h. But since this API isn’t meant to be called from bundle code, perhaps a new separate header under API/Cocoa (that imports WKFoundation.h and uses WK_API_AVAILABLE) would be even better.
> Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundle.h:81 > +WK_EXPORT int WKWebProcessMain(int argc, const char** argv);
Still no availability.
Alex Christensen
Comment 10
2018-09-17 09:01:53 PDT
Created
attachment 349887
[details]
Patch
Alex Christensen
Comment 11
2018-09-17 09:47:28 PDT
Created
attachment 349894
[details]
Patch
WebKit Commit Bot
Comment 12
2018-09-17 11:45:54 PDT
Comment on
attachment 349894
[details]
Patch Clearing flags on attachment: 349894 Committed
r236075
: <
https://trac.webkit.org/changeset/236075
>
WebKit Commit Bot
Comment 13
2018-09-17 11:45:56 PDT
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 14
2018-09-17 11:46:54 PDT
<
rdar://problem/44528499
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug