Bug 176568

Summary: Clean up API::UIClient
Product: WebKit Reporter: Alex Christensen <achristensen>
Component: New BugsAssignee: Alex Christensen <achristensen>
Status: RESOLVED FIXED    
Severity: Normal CC: beidson, berto, buildbot, cgarcia, gustavo, joepeck, mcatanzaro, mitz, ryanhaddad, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch beidson: review+

Description Alex Christensen 2017-09-07 15:58:21 PDT
Clean up API::UIClient
Comment 1 Alex Christensen 2017-09-07 15:59:12 PDT
Created attachment 320197 [details]
Patch
Comment 2 Build Bot 2017-09-07 16:01:56 PDT
Thanks for the patch. If this patch contains new public API please make sure it follows the guidelines for new WebKit2 GTK+ API. See http://trac.webkit.org/wiki/WebKitGTK/AddingNewWebKit2API
Comment 3 Build Bot 2017-09-07 16:02:12 PDT
Attachment 320197 [details] did not pass style-queue:


ERROR: Source/WebKit/UIProcess/API/glib/WebKitUIClient.cpp:49:  The parameter name "resourceRequest" adds no information, so it should be removed.  [readability/parameter_name] [5]
ERROR: Source/WebKit/UIProcess/API/glib/WebKitUIClient.cpp:49:  The parameter name "windowFeatures" adds no information, so it should be removed.  [readability/parameter_name] [5]
ERROR: Source/WebKit/UIProcess/API/glib/WebKitUIClient.cpp:49:  The parameter name "navigationActionData" adds no information, so it should be removed.  [readability/parameter_name] [5]
Total errors found: 3 in 9 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 4 Alex Christensen 2017-09-07 16:10:29 PDT
Created attachment 320200 [details]
Patch
Comment 5 Alex Christensen 2017-09-07 16:18:14 PDT
http://trac.webkit.org/r221771
Comment 6 Ryan Haddad 2017-09-08 08:46:18 PDT
This change caused the following API tests to crash:
  WebKit.OpenAndCloseWindowAsync
  WebKit.OpenAsyncWithNil

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   com.apple.WebKit              	0x000000010e5597d9 WebKit::UIDelegate::UIClient::createNewPage(WebKit::WebPageProxy&, WTF::Ref<API::FrameInfo>&&, WebCore::ResourceRequest&&, WebCore::WindowFeatures&&, WebKit::NavigationActionData&&, WTF::Function<void (WTF::RefPtr<WebKit::WebPageProxy>&&)>&&) + 993 (UIDelegate.mm:232)
1   com.apple.WebKit              	0x000000010e63b33f WebKit::WebPageProxy::createNewPage(WebKit::FrameInfoData const&, unsigned long long, WebCore::ResourceRequest&&, WebCore::WindowFeatures&&, WebKit::NavigationActionData&&, WTF::Ref<Messages::WebPageProxy::CreateNewPage::DelayedReply>&&) + 929 (WebPageProxy.cpp:3874)
2   com.apple.WebKit              	0x000000010e659454 void IPC::handleMessageDelayed<Messages::WebPageProxy::CreateNewPage, WebKit::WebPageProxy, void (WebKit::WebPageProxy::*)(WebKit::FrameInfoData const&, unsigned long long, WebCore::ResourceRequest&&, WebCore::WindowFeatures&&, WebKit::NavigationActionData&&, WTF::Ref<Messages::WebPageProxy::CreateNewPage::DelayedReply>&&)>(IPC::Connection&, IPC::Decoder&, std::__1::unique_ptr<IPC::Encoder, std::__1::default_delete<IPC::Encoder> >&, WebKit::WebPageProxy*, void (WebKit::WebPageProxy::*)(WebKit::FrameInfoData const&, unsigned long long, WebCore::ResourceRequest&&, WebCore::WindowFeatures&&, WebKit::NavigationActionData&&, WTF::Ref<Messages::WebPageProxy::CreateNewPage::DelayedReply>&&)) + 499 (HandleMessage.h:179)
3   com.apple.WebKit              	0x000000010e4599d3 IPC::MessageReceiverMap::dispatchSyncMessage(IPC::Connection&, IPC::Decoder&, std::__1::unique_ptr<IPC::Encoder, std::__1::default_delete<IPC::Encoder> >&) + 143 (MessageReceiverMap.cpp:140)
4   com.apple.WebKit              	0x000000010e6a848e WebKit::WebProcessProxy::didReceiveSyncMessage(IPC::Connection&, IPC::Decoder&, std::__1::unique_ptr<IPC::Encoder, std::__1::default_delete<IPC::Encoder> >&) + 28 (WebProcessProxy.cpp:606)
5   com.apple.WebKit              	0x000000010e422304 IPC::Connection::dispatchSyncMessage(IPC::Decoder&) + 202 (Connection.cpp:865)
6   com.apple.WebKit              	0x000000010e41f8b2 IPC::Connection::dispatchMessage(std::__1::unique_ptr<IPC::Decoder, std::__1::default_delete<IPC::Decoder> >) + 104 (Connection.cpp:926)
7   com.apple.WebKit              	0x000000010e422529 IPC::Connection::dispatchOneMessage() + 175 (Connection.cpp:959)
8   com.apple.JavaScriptCore      	0x000000010dc76ed4 WTF::RunLoop::performWork() + 164 (RunLoop.cpp:107)
9   com.apple.JavaScriptCore      	0x000000010dc770f2 WTF::RunLoop::performWork(void*) + 34 (RunLoopCF.cpp:39)
10  com.apple.CoreFoundation      	0x00007fffac7123e1 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
11  com.apple.CoreFoundation      	0x00007fffac6f365c __CFRunLoopDoSources0 + 556
12  com.apple.CoreFoundation      	0x00007fffac6f2b46 __CFRunLoopRun + 934
13  com.apple.CoreFoundation      	0x00007fffac6f2544 CFRunLoopRunSpecific + 420
14  com.apple.Foundation          	0x00007fffae1234e2 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 277
15  TestWebKitAPI                 	0x000000010cce386f TestWebKitAPI::Util::run(bool*) + 119 (UtilitiesCocoa.mm:34)
16  TestWebKitAPI                 	0x000000010cc481e7 WebKit_OpenAsyncWithNil_Test::TestBody() + 407 (OpenAndCloseWindow.mm:177)
17  TestWebKitAPI                 	0x000000010cd4b768 testing::Test::Run() + 92
18  TestWebKitAPI                 	0x000000010cd4bf40 testing::internal::TestInfoImpl::Run() + 178
19  TestWebKitAPI                 	0x000000010cd4c334 testing::TestCase::Run() + 188
20  TestWebKitAPI                 	0x000000010cd4f819 testing::internal::UnitTestImpl::RunAllTests() + 583
21  TestWebKitAPI                 	0x000000010cc92a1f TestWebKitAPI::TestsController::run(int, char**) + 131 (TestsController.cpp:84)
22  TestWebKitAPI                 	0x000000010cd27eda main + 344 (mainMac.mm:52)
23  libdyld.dylib                 	0x00007fffc242a235 start + 1

https://build.webkit.org/builders/Apple%20Sierra%20Release%20WK2%20%28Tests%29/builds/4156
Comment 7 Ryan Haddad 2017-09-08 09:19:28 PDT
Reverted r221771 for reason:

This change caused two API tests to crash.

Committed r221787: <http://trac.webkit.org/changeset/221787>
Comment 8 Michael Catanzaro 2017-09-08 10:34:38 PDT
(In reply to Ryan Haddad from comment #7)
> Reverted r221771 for reason:
> 
> This change caused two API tests to crash.
> 
> Committed r221787: <http://trac.webkit.org/changeset/221787>

I'm not sure it actually landed. You'll want to check when SVN is fixed.
Comment 9 Alexey Proskuryakov 2017-09-08 10:46:21 PDT
SVN is actually the one thing that works. Git mirrors and Trac are broken.
Comment 10 Alex Christensen 2017-09-11 19:04:59 PDT
Comment on attachment 320200 [details]
Patch

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

> Source/WebKit/UIProcess/Cocoa/UIDelegate.mm:-227
> -        return nullptr;

Aha! I still need an early return here.
Comment 11 Alex Christensen 2017-09-11 19:05:33 PDT
http://trac.webkit.org/r221899
Comment 12 Joseph Pecoraro 2017-09-11 19:52:19 PDT
Comment on attachment 320200 [details]
Patch

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

> Source/WebKit/UIProcess/API/glib/WebKitUIClient.h:20
> -#ifndef WebKitUIClient_h
> -#define WebKitUIClient_h
> +#pragma once

Doesn't we normally not use pragma once in API headers?
Comment 13 Joseph Pecoraro 2017-09-11 19:53:14 PDT
> Doesn't we normally not use pragma once in API headers?

There are already plenty of files in the same directory with `#pragma once` so it seems fine here. I was just asking in general.
Comment 14 Michael Catanzaro 2017-09-11 20:08:23 PDT
We indeed don't use #pragma once in our public API headers, but that's actually an implementation header that's not installed. I guess it might not be obvious, but the easiest way to tell it's not installed is that it contains C++ code and follows WebKit coding style. The public headers are C and follow GNOME style.
Comment 15 Radar WebKit Bug Importer 2017-09-27 12:41:07 PDT
<rdar://problem/34693747>
Comment 16 mitz 2018-01-25 15:15:33 PST
(In reply to Alex Christensen from comment #11)
> http://trac.webkit.org/r221899

This caused bug 182152.