Summary: | Remove "using namespace WebKit" under Source/WebKit/WebProcess/InjectedBundle/API | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Fujii Hironori <Hironori.Fujii> | ||||||||
Component: | WebKit2 | Assignee: | Fujii Hironori <Hironori.Fujii> | ||||||||
Status: | RESOLVED FIXED | ||||||||||
Severity: | Normal | CC: | achristensen, darin, webkit-bug-importer | ||||||||
Priority: | P2 | Keywords: | InRadar | ||||||||
Version: | WebKit Nightly Build | ||||||||||
Hardware: | Unspecified | ||||||||||
OS: | Unspecified | ||||||||||
Bug Depends on: | |||||||||||
Bug Blocks: | 192449 | ||||||||||
Attachments: |
|
Description
Fujii Hironori
2018-12-03 00:17:07 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
Created attachment 356363 [details]
Patch
Created attachment 356366 [details]
Patch
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. Created attachment 356367 [details]
Patch
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. 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? Comment on attachment 356367 [details] Patch Clearing flags on attachment: 356367 Committed r238832: <https://trac.webkit.org/changeset/238832> All reviewed patches have been landed. Closing bug. |