WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
192301
Remove "using namespace WebKit" under Source/WebKit/WebProcess/InjectedBundle/API
https://bugs.webkit.org/show_bug.cgi?id=192301
Summary
Remove "using namespace WebKit" under Source/WebKit/WebProcess/InjectedBundle...
Fujii Hironori
Reported
2018-12-03 00:17:07 PST
Remove "using namespace WebKit" under Source/WebKit/WebProcess/InjectedBundle/API (In reply to Darin Adler from
bug #191995 comment #8
)
> Same applies to "using namespace WebKit" and those should be removed for the > same reason.
Attachments
Patch
(104.46 KB, patch)
2018-12-03 00:28 PST
,
Fujii Hironori
no flags
Details
Formatted Diff
Diff
Patch
(104.47 KB, patch)
2018-12-03 01:03 PST
,
Fujii Hironori
no flags
Details
Formatted Diff
Diff
Patch
(102.28 KB, patch)
2018-12-03 01:47 PST
,
Fujii Hironori
no flags
Details
Formatted Diff
Diff
Show Obsolete
(2)
View All
Add attachment
proposed patch, testcase, etc.
Fujii Hironori
Comment 1
2018-12-03 00:18:23 PST
Here are commands I invoked:
> sed -i -e '/using namespace WebKit;/d' *.cpp > name="(toFloatRect|SnapshotOptions|SnapshotOptionsInViewCoordinates|WebPageGroupProxy|WebPageOverlay|WebRenderLayer|WebRenderObject|snapshotOptionsFromImageOptions|toFindOptions|toIntRect|toLayoutMilestones|InjectedBundlePageContextMenuClient|InjectedBundlePageEditorClient|InjectedBundlePageFormClient|InjectedBundlePageLoaderClient|InjectedBundlePageResourceLoadClient|InjectedBundlePageUIClient|InjectedBundleRangeHandle|WebContextMenu|WebContextMenuItem|WebImage|WebPage|toIntPoint|toSnapshotOptions|toImpl|InjectedBundleDOMWindowExtension|InjectedBundleHitTestResult|InjectedBundleNavigationAction|InjectedBundleNodeHandle|SecurityOriginData|WebFrame|WebInspector|toAPI|toCopiedAPI|toCopiedURLAPI|InjectedBundleClient|InjectedBundle|toWTFString|toUserScriptInjectionTime|toUserContentInjectedFrames|toUserContentInjectedFrames|InjectedBundleScriptWorld)"; sed -Ei -e "s/WebKit::$name\\b/\\1/g" -e "s/\\b$name\\b/WebKit::\\1/g" -e "s/\\bWebKit::$name\\.h\\b/\\1.h/g" *.cpp
Fujii Hironori
Comment 2
2018-12-03 00:28:17 PST
Created
attachment 356363
[details]
Patch
Fujii Hironori
Comment 3
2018-12-03 01:03:57 PST
Created
attachment 356366
[details]
Patch
Darin Adler
Comment 4
2018-12-03 01:05:18 PST
Comment on
attachment 356363
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=356363&action=review
Argument-dependent lookup means that some small number of these might not be needed. If any argument has a type in the WebKit namespace, then the function name doesn’t need to include a WebKit prefix. But that only affects a very small number of these.
> Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundlePageBanner.cpp:35 > + return WebKit::toAPI(PageBanner::APIType);
Looks ike this needs to be WebKit::PageBanner::APIType.
Fujii Hironori
Comment 5
2018-12-03 01:47:36 PST
Created
attachment 356367
[details]
Patch
Fujii Hironori
Comment 6
2018-12-03 01:51:09 PST
Comment on
attachment 356367
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=356367&action=review
> Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundle.cpp:53 > + return WebKit::toAPI(WebKit::InjectedBundle::APIType);
Some "WebKit::" can not be removed even though its argument's namespace is WebKit. For example, this "WebKit::" of toAPI can not be removed.
> In file included from DerivedSources\WebKit\unified-sources\UnifiedSource43.cpp:4: > ..\..\Source\WebKit\WebProcess/InjectedBundle/API/c/WKBundle.cpp(53,12): error: use of undeclared identifier 'toAPI'; did you mean 'WebKit::toAPI'? > return toAPI(WebKit::InjectedBundle::APIType); > ^~~~~ > WebKit::toAPI > ..\..\Source\WebKit\Shared\API\c\WKSharedAPICast.h(279,17): note: 'WebKit::toAPI' declared here > inline WKTypeID toAPI(API::Object::Type type) > ^ > 1 error generated.
Fujii Hironori
Comment 7
2018-12-03 01:53:22 PST
Comment on
attachment 356367
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=356367&action=review
>> Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundle.cpp:53 >> + return WebKit::toAPI(WebKit::InjectedBundle::APIType); > > Some "WebKit::" can not be removed even though its argument's namespace is WebKit. > For example, this "WebKit::" of toAPI can not be removed.
Its argument namespace is WebKit::InjectedBundle, not WebKit in that case?
Fujii Hironori
Comment 8
2018-12-03 17:13:18 PST
Comment on
attachment 356367
[details]
Patch Clearing flags on attachment: 356367 Committed
r238832
: <
https://trac.webkit.org/changeset/238832
>
Fujii Hironori
Comment 9
2018-12-03 17:13:21 PST
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 10
2018-12-03 17:14:36 PST
<
rdar://problem/46438085
>
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