Bug 156319 - Web Automation: implement Automation.addSingleCookie
Summary: Web Automation: implement Automation.addSingleCookie
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: BJ Burg
URL:
Keywords: InRadar
Depends on: 156091
Blocks: 156345
  Show dependency treegraph
 
Reported: 2016-04-06 16:48 PDT by BJ Burg
Modified: 2022-03-01 02:43 PST (History)
7 users (show)

See Also:


Attachments
Proposed Fix (12.59 KB, patch)
2016-04-06 16:52 PDT, BJ Burg
no flags Details | Formatted Diff | Diff
For EWS (12.23 KB, patch)
2016-04-07 14:49 PDT, BJ Burg
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description BJ Burg 2016-04-06 16:48:09 PDT
.
Comment 1 Radar WebKit Bug Importer 2016-04-06 16:48:25 PDT
<rdar://problem/25589605>
Comment 2 BJ Burg 2016-04-06 16:52:55 PDT
Created attachment 275832 [details]
Proposed Fix
Comment 3 BJ Burg 2016-04-07 14:49:17 PDT
Created attachment 275941 [details]
For EWS
Comment 4 BJ Burg 2016-04-07 15:34:59 PDT
Committed r199197: <http://trac.webkit.org/changeset/199197>
Comment 5 Darin Adler 2016-04-16 10:47:19 PDT
Comment on attachment 275941 [details]
For EWS

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

> Source/WebKit2/UIProcess/Automation/WebAutomationSession.cpp:754
> +    WebCore::URL activeURL = WebCore::URL(WebCore::URL(), page->pageLoadState().activeURL());

I suggest writing this in a way where WebCore::URL is not repeated as much. Either with auto, or just as a declaration without the "=".

> Source/WebKit2/UIProcess/Automation/WebAutomationSession.cpp:755
> +    ASSERT(activeURL.isValid());

Why is this a valid assertion? Is there some guarantee?

> Source/WebKit2/UIProcess/Automation/WebAutomationSession.cpp:759
> +    if (!cookieObject.getString(WTF::ASCIILiteral("name"), cookie.name))

WTF prefix here is unneeded.

> Source/WebKit2/UIProcess/Automation/WebAutomationSession.cpp:782
> +    cookie.expires = expires * 1000.0;

No need for the ".0" here.

> Source/WebKit2/UIProcess/Automation/WebAutomationSession.cpp:794
> +    WebCookieManagerProxy* cookieManager = m_processPool->supplement<WebCookieManagerProxy>();
> +    cookieManager->addCookie(cookie, activeURL.host());

I suggest writing this on a single line.