<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[244307] trunk</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/244307">244307</a></dd>
<dt>Author</dt> <dd>achristensen@apple.com</dd>
<dt>Date</dt> <dd>2019-04-15 16:48:55 -0700 (Mon, 15 Apr 2019)</dd>
</dl>
<h3>Log Message</h3>
<pre>Add a DiagnosticLogging method taking an arbitrary dictionary of values.
https://bugs.webkit.org/show_bug.cgi?id=196773
Source/WebCore:
Patch by Jer Noble <jer.noble@apple.com> on 2019-04-15
Reviewed by Alex Christensen.
* page/DiagnosticLoggingClient.h:
Source/WebKit:
Patch by Jer Noble <jer.noble@apple.com> on 2019-04-15
Reviewed by Alex Christensen.
In addition to adding the new logging delegate method (and piping everything into it),
add a new APIObject class to represent a signed integer.
* Shared/API/APINumber.h:
* Shared/API/APIObject.h:
* Shared/Cocoa/APIObject.mm:
(API::Object::newObject):
* Shared/Cocoa/WKNSNumber.mm:
(-[WKNSNumber dealloc]):
(-[WKNSNumber objCType]):
(-[WKNSNumber getValue:]):
(-[WKNSNumber longLongValue]):
(-[WKNSNumber _apiObject]):
* Shared/UserData.cpp:
(WebKit::UserData::encode):
(WebKit::UserData::decode):
* UIProcess/API/APIDiagnosticLoggingClient.h:
* UIProcess/API/C/WKPageDiagnosticLoggingClient.h:
* UIProcess/API/Cocoa/_WKDiagnosticLoggingDelegate.h:
* UIProcess/Cocoa/DiagnosticLoggingClient.h:
* UIProcess/Cocoa/DiagnosticLoggingClient.mm:
(WebKit::DiagnosticLoggingClient::logDiagnosticMessageWithValueDictionary):
* UIProcess/ProvisionalPageProxy.cpp:
(WebKit::ProvisionalPageProxy::didReceiveMessage):
* UIProcess/WebPageDiagnosticLoggingClient.cpp:
(WebKit::WebPageDiagnosticLoggingClient::logDiagnosticMessageWithValueDictionary):
* UIProcess/WebPageDiagnosticLoggingClient.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::logDiagnosticMessageWithValueDictionary):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.cpp:
(WebKit::WebDiagnosticLoggingClient::logDiagnosticMessageWithValueDictionary):
* WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.h:
Tools:
Reviewed by Jer Noble.
* TestWebKitAPI/Tests/WebKitCocoa/WKWebViewDiagnosticLogging.mm:
(-[TestLoggingDelegate _webView:logDiagnosticMessage:description:valueDictionary:]):
(TEST):</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreloaderEmptyClientscpp">trunk/Source/WebCore/loader/EmptyClients.cpp</a></li>
<li><a href="#trunkSourceWebCorepageDiagnosticLoggingClienth">trunk/Source/WebCore/page/DiagnosticLoggingClient.h</a></li>
<li><a href="#trunkSourceWebCoretestingInternalscpp">trunk/Source/WebCore/testing/Internals.cpp</a></li>
<li><a href="#trunkSourceWebCoretestingInternalsh">trunk/Source/WebCore/testing/Internals.h</a></li>
<li><a href="#trunkSourceWebCoretestingInternalsidl">trunk/Source/WebCore/testing/Internals.idl</a></li>
<li><a href="#trunkSourceWebKitChangeLog">trunk/Source/WebKit/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitSharedAPIAPINumberh">trunk/Source/WebKit/Shared/API/APINumber.h</a></li>
<li><a href="#trunkSourceWebKitSharedAPIAPIObjecth">trunk/Source/WebKit/Shared/API/APIObject.h</a></li>
<li><a href="#trunkSourceWebKitSharedCocoaAPIObjectmm">trunk/Source/WebKit/Shared/Cocoa/APIObject.mm</a></li>
<li><a href="#trunkSourceWebKitSharedCocoaWKNSNumbermm">trunk/Source/WebKit/Shared/Cocoa/WKNSNumber.mm</a></li>
<li><a href="#trunkSourceWebKitSharedUserDatacpp">trunk/Source/WebKit/Shared/UserData.cpp</a></li>
<li><a href="#trunkSourceWebKitUIProcessAPIAPIDiagnosticLoggingClienth">trunk/Source/WebKit/UIProcess/API/APIDiagnosticLoggingClient.h</a></li>
<li><a href="#trunkSourceWebKitUIProcessAPICocoa_WKDiagnosticLoggingDelegateh">trunk/Source/WebKit/UIProcess/API/Cocoa/_WKDiagnosticLoggingDelegate.h</a></li>
<li><a href="#trunkSourceWebKitUIProcessCocoaDiagnosticLoggingClienth">trunk/Source/WebKit/UIProcess/Cocoa/DiagnosticLoggingClient.h</a></li>
<li><a href="#trunkSourceWebKitUIProcessCocoaDiagnosticLoggingClientmm">trunk/Source/WebKit/UIProcess/Cocoa/DiagnosticLoggingClient.mm</a></li>
<li><a href="#trunkSourceWebKitUIProcessProvisionalPageProxycpp">trunk/Source/WebKit/UIProcess/ProvisionalPageProxy.cpp</a></li>
<li><a href="#trunkSourceWebKitUIProcessWebPageDiagnosticLoggingClienth">trunk/Source/WebKit/UIProcess/WebPageDiagnosticLoggingClient.h</a></li>
<li><a href="#trunkSourceWebKitUIProcessWebPageProxycpp">trunk/Source/WebKit/UIProcess/WebPageProxy.cpp</a></li>
<li><a href="#trunkSourceWebKitUIProcessWebPageProxyh">trunk/Source/WebKit/UIProcess/WebPageProxy.h</a></li>
<li><a href="#trunkSourceWebKitUIProcessWebPageProxymessagesin">trunk/Source/WebKit/UIProcess/WebPageProxy.messages.in</a></li>
<li><a href="#trunkSourceWebKitWebProcessWebCoreSupportWebDiagnosticLoggingClientcpp">trunk/Source/WebKit/WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.cpp</a></li>
<li><a href="#trunkSourceWebKitWebProcessWebCoreSupportWebDiagnosticLoggingClienth">trunk/Source/WebKit/WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.h</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsWebKitCocoaWKWebViewDiagnosticLoggingmm">trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebViewDiagnosticLogging.mm</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (244306 => 244307)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog 2019-04-15 23:36:25 UTC (rev 244306)
+++ trunk/Source/WebCore/ChangeLog 2019-04-15 23:48:55 UTC (rev 244307)
</span><span class="lines">@@ -1,3 +1,12 @@
</span><ins>+2019-04-15 Jer Noble <jer.noble@apple.com>
+
+ Add a DiagnosticLogging method taking an arbitrary dictionary of values.
+ https://bugs.webkit.org/show_bug.cgi?id=196773
+
+ Reviewed by Alex Christensen.
+
+ * page/DiagnosticLoggingClient.h:
+
</ins><span class="cx"> 2019-04-15 Justin Fan <justin_fan@apple.com>
</span><span class="cx">
</span><span class="cx"> Let WTF::convertSafely deduce types from arguments.
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderEmptyClientscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/EmptyClients.cpp (244306 => 244307)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/EmptyClients.cpp 2019-04-15 23:36:25 UTC (rev 244306)
+++ trunk/Source/WebCore/loader/EmptyClients.cpp 2019-04-15 23:48:55 UTC (rev 244307)
</span><span class="lines">@@ -131,6 +131,7 @@
</span><span class="cx"> void logDiagnosticMessageWithResult(const String&, const String&, DiagnosticLoggingResultType, ShouldSample) final { }
</span><span class="cx"> void logDiagnosticMessageWithValue(const String&, const String&, double, unsigned, ShouldSample) final { }
</span><span class="cx"> void logDiagnosticMessageWithEnhancedPrivacy(const String&, const String&, ShouldSample) final { }
</span><ins>+ void logDiagnosticMessageWithValueDictionary(const String&, const String&, const ValueDictionary&, ShouldSample) final { }
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> #if ENABLE(DRAG_SUPPORT)
</span></span></pre></div>
<a id="trunkSourceWebCorepageDiagnosticLoggingClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/DiagnosticLoggingClient.h (244306 => 244307)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/DiagnosticLoggingClient.h 2019-04-15 23:36:25 UTC (rev 244306)
+++ trunk/Source/WebCore/page/DiagnosticLoggingClient.h 2019-04-15 23:48:55 UTC (rev 244307)
</span><span class="lines">@@ -28,7 +28,9 @@
</span><span class="cx"> #include "DiagnosticLoggingResultType.h"
</span><span class="cx"> #include <wtf/FastMalloc.h>
</span><span class="cx"> #include <wtf/Forward.h>
</span><ins>+#include <wtf/HashMap.h>
</ins><span class="cx"> #include <wtf/RandomNumber.h>
</span><ins>+#include <wtf/Variant.h>
</ins><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><span class="lines">@@ -42,6 +44,11 @@
</span><span class="cx"> virtual void logDiagnosticMessageWithValue(const String& message, const String& description, double value, unsigned significantFigures, ShouldSample) = 0;
</span><span class="cx"> virtual void logDiagnosticMessageWithEnhancedPrivacy(const String& message, const String& description, ShouldSample) = 0;
</span><span class="cx">
</span><ins>+ using ValuePayload = Variant<String, uint64_t, int64_t, bool, double>;
+ using ValueDictionary = HashMap<String, ValuePayload>;
+
+ virtual void logDiagnosticMessageWithValueDictionary(const String& message, const String& description, const ValueDictionary&, ShouldSample) = 0;
+
</ins><span class="cx"> static bool shouldLogAfterSampling(ShouldSample);
</span><span class="cx">
</span><span class="cx"> virtual ~DiagnosticLoggingClient() = default;
</span></span></pre></div>
<a id="trunkSourceWebCoretestingInternalscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/Internals.cpp (244306 => 244307)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/Internals.cpp 2019-04-15 23:36:25 UTC (rev 244306)
+++ trunk/Source/WebCore/testing/Internals.cpp 2019-04-15 23:48:55 UTC (rev 244307)
</span><span class="lines">@@ -56,6 +56,7 @@
</span><span class="cx"> #include "DOMStringList.h"
</span><span class="cx"> #include "DOMWindow.h"
</span><span class="cx"> #include "DeprecatedGlobalSettings.h"
</span><ins>+#include "DiagnosticLoggingClient.h"
</ins><span class="cx"> #include "DisabledAdaptations.h"
</span><span class="cx"> #include "DisplayList.h"
</span><span class="cx"> #include "Document.h"
</span><span class="lines">@@ -4999,4 +5000,24 @@
</span><span class="cx"> PlatformMediaSessionManager::sharedManager().processDidResume();
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void Internals::testDictionaryLogging()
+{
+ auto* document = contextDocument();
+ if (!document)
+ return;
+
+ auto* page = document->page();
+ if (!page)
+ return;
+
+ DiagnosticLoggingClient::ValueDictionary dictionary;
+ dictionary.set("stringKey"_s, String("stringValue"));
+ dictionary.set("uint64Key"_s, std::numeric_limits<uint64_t>::max());
+ dictionary.set("int64Key"_s, std::numeric_limits<int64_t>::min());
+ dictionary.set("boolKey"_s, true);
+ dictionary.set("doubleKey"_s, 2.7182818284590452353602874);
+
+ page->diagnosticLoggingClient().logDiagnosticMessageWithValueDictionary("testMessage"_s, "testDescription"_s, dictionary, ShouldSample::No);
+}
+
</ins><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoretestingInternalsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/Internals.h (244306 => 244307)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/Internals.h 2019-04-15 23:36:25 UTC (rev 244306)
+++ trunk/Source/WebCore/testing/Internals.h 2019-04-15 23:48:55 UTC (rev 244307)
</span><span class="lines">@@ -814,6 +814,8 @@
</span><span class="cx"> void processWillSuspend();
</span><span class="cx"> void processDidResume();
</span><span class="cx">
</span><ins>+ void testDictionaryLogging();
+
</ins><span class="cx"> private:
</span><span class="cx"> explicit Internals(Document&);
</span><span class="cx"> Document* contextDocument() const;
</span></span></pre></div>
<a id="trunkSourceWebCoretestingInternalsidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/Internals.idl (244306 => 244307)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/Internals.idl 2019-04-15 23:36:25 UTC (rev 244306)
+++ trunk/Source/WebCore/testing/Internals.idl 2019-04-15 23:48:55 UTC (rev 244307)
</span><span class="lines">@@ -744,4 +744,6 @@
</span><span class="cx">
</span><span class="cx"> void processWillSuspend();
</span><span class="cx"> void processDidResume();
</span><ins>+
+ void testDictionaryLogging();
</ins><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebKitChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/ChangeLog (244306 => 244307)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/ChangeLog 2019-04-15 23:36:25 UTC (rev 244306)
+++ trunk/Source/WebKit/ChangeLog 2019-04-15 23:48:55 UTC (rev 244307)
</span><span class="lines">@@ -1,3 +1,45 @@
</span><ins>+2019-04-15 Jer Noble <jer.noble@apple.com>
+
+ Add a DiagnosticLogging method taking an arbitrary dictionary of values.
+ https://bugs.webkit.org/show_bug.cgi?id=196773
+
+ Reviewed by Alex Christensen.
+
+ In addition to adding the new logging delegate method (and piping everything into it),
+ add a new APIObject class to represent a signed integer.
+
+ * Shared/API/APINumber.h:
+ * Shared/API/APIObject.h:
+ * Shared/Cocoa/APIObject.mm:
+ (API::Object::newObject):
+ * Shared/Cocoa/WKNSNumber.mm:
+ (-[WKNSNumber dealloc]):
+ (-[WKNSNumber objCType]):
+ (-[WKNSNumber getValue:]):
+ (-[WKNSNumber longLongValue]):
+ (-[WKNSNumber _apiObject]):
+ * Shared/UserData.cpp:
+ (WebKit::UserData::encode):
+ (WebKit::UserData::decode):
+ * UIProcess/API/APIDiagnosticLoggingClient.h:
+ * UIProcess/API/C/WKPageDiagnosticLoggingClient.h:
+ * UIProcess/API/Cocoa/_WKDiagnosticLoggingDelegate.h:
+ * UIProcess/Cocoa/DiagnosticLoggingClient.h:
+ * UIProcess/Cocoa/DiagnosticLoggingClient.mm:
+ (WebKit::DiagnosticLoggingClient::logDiagnosticMessageWithValueDictionary):
+ * UIProcess/ProvisionalPageProxy.cpp:
+ (WebKit::ProvisionalPageProxy::didReceiveMessage):
+ * UIProcess/WebPageDiagnosticLoggingClient.cpp:
+ (WebKit::WebPageDiagnosticLoggingClient::logDiagnosticMessageWithValueDictionary):
+ * UIProcess/WebPageDiagnosticLoggingClient.h:
+ * UIProcess/WebPageProxy.cpp:
+ (WebKit::WebPageProxy::logDiagnosticMessageWithValueDictionary):
+ * UIProcess/WebPageProxy.h:
+ * UIProcess/WebPageProxy.messages.in:
+ * WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.cpp:
+ (WebKit::WebDiagnosticLoggingClient::logDiagnosticMessageWithValueDictionary):
+ * WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.h:
+
</ins><span class="cx"> 2019-04-15 Dean Jackson <dino@apple.com>
</span><span class="cx">
</span><span class="cx"> Provide option to not create a longpress gesture recognizer
</span></span></pre></div>
<a id="trunkSourceWebKitSharedAPIAPINumberh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/Shared/API/APINumber.h (244306 => 244307)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Shared/API/APINumber.h 2019-04-15 23:36:25 UTC (rev 244306)
+++ trunk/Source/WebKit/Shared/API/APINumber.h 2019-04-15 23:48:55 UTC (rev 244307)
</span><span class="lines">@@ -69,6 +69,7 @@
</span><span class="cx"> typedef Number<bool, API::Object::Type::Boolean> Boolean;
</span><span class="cx"> typedef Number<double, API::Object::Type::Double> Double;
</span><span class="cx"> typedef Number<uint64_t, API::Object::Type::UInt64> UInt64;
</span><ins>+typedef Number<int64_t, API::Object::Type::Int64> Int64;
</ins><span class="cx">
</span><span class="cx"> } // namespace API
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebKitSharedAPIAPIObjecth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/Shared/API/APIObject.h (244306 => 244307)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Shared/API/APIObject.h 2019-04-15 23:36:25 UTC (rev 244306)
+++ trunk/Source/WebKit/Shared/API/APIObject.h 2019-04-15 23:48:55 UTC (rev 244307)
</span><span class="lines">@@ -88,6 +88,7 @@
</span><span class="cx"> Boolean,
</span><span class="cx"> Double,
</span><span class="cx"> UInt64,
</span><ins>+ Int64,
</ins><span class="cx">
</span><span class="cx"> // Geometry types
</span><span class="cx"> Point,
</span></span></pre></div>
<a id="trunkSourceWebKitSharedCocoaAPIObjectmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/Shared/Cocoa/APIObject.mm (244306 => 244307)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Shared/Cocoa/APIObject.mm 2019-04-15 23:36:25 UTC (rev 244306)
+++ trunk/Source/WebKit/Shared/Cocoa/APIObject.mm 2019-04-15 23:48:55 UTC (rev 244307)
</span><span class="lines">@@ -163,6 +163,7 @@
</span><span class="cx"> case Type::Boolean:
</span><span class="cx"> case Type::Double:
</span><span class="cx"> case Type::UInt64:
</span><ins>+ case Type::Int64:
</ins><span class="cx"> wrapper = [WKNSNumber alloc];
</span><span class="cx"> ((WKNSNumber *)wrapper)->_type = type;
</span><span class="cx"> break;
</span></span></pre></div>
<a id="trunkSourceWebKitSharedCocoaWKNSNumbermm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/Shared/Cocoa/WKNSNumber.mm (244306 => 244307)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Shared/Cocoa/WKNSNumber.mm 2019-04-15 23:36:25 UTC (rev 244306)
+++ trunk/Source/WebKit/Shared/Cocoa/WKNSNumber.mm 2019-04-15 23:48:55 UTC (rev 244307)
</span><span class="lines">@@ -33,6 +33,7 @@
</span><span class="cx"> API::ObjectStorage<API::Boolean> _boolean;
</span><span class="cx"> API::ObjectStorage<API::Double> _double;
</span><span class="cx"> API::ObjectStorage<API::UInt64> _uint64;
</span><ins>+ API::ObjectStorage<API::Int64> _int64;
</ins><span class="cx"> } _number;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -51,6 +52,10 @@
</span><span class="cx"> _number._uint64->~Number<uint64_t, API::Object::Type::UInt64>();
</span><span class="cx"> break;
</span><span class="cx">
</span><ins>+ case API::Object::Type::Int64:
+ _number._int64->~Number<int64_t, API::Object::Type::Int64>();
+ break;
+
</ins><span class="cx"> default:
</span><span class="cx"> ASSERT_NOT_REACHED();
</span><span class="cx"> }
</span><span class="lines">@@ -75,6 +80,10 @@
</span><span class="cx"> return @encode(uint64_t);
</span><span class="cx"> break;
</span><span class="cx">
</span><ins>+ case API::Object::Type::Int64:
+ return @encode(int64_t);
+ break;
+
</ins><span class="cx"> default:
</span><span class="cx"> ASSERT_NOT_REACHED();
</span><span class="cx"> }
</span><span class="lines">@@ -97,6 +106,10 @@
</span><span class="cx"> *reinterpret_cast<uint64_t*>(value) = _number._uint64->value();
</span><span class="cx"> break;
</span><span class="cx">
</span><ins>+ case API::Object::Type::Int64:
+ *reinterpret_cast<int64_t*>(value) = _number._int64->value();
+ break;
+
</ins><span class="cx"> default:
</span><span class="cx"> ASSERT_NOT_REACHED();
</span><span class="cx"> }
</span><span class="lines">@@ -128,6 +141,14 @@
</span><span class="cx"> return super.unsignedLongLongValue;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+- (long long)longLongValue
+{
+ if (_type == API::Object::Type::Int64)
+ return _number._int64->value();
+
+ return super.longLongValue;
+}
+
</ins><span class="cx"> // MARK: NSCopying protocol implementation
</span><span class="cx">
</span><span class="cx"> - (id)copyWithZone:(NSZone *)zone
</span><span class="lines">@@ -152,6 +173,10 @@
</span><span class="cx"> return *_number._uint64;
</span><span class="cx"> break;
</span><span class="cx">
</span><ins>+ case API::Object::Type::Int64:
+ return *_number._int64;
+ break;
+
</ins><span class="cx"> default:
</span><span class="cx"> ASSERT_NOT_REACHED();
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKitSharedUserDatacpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/Shared/UserData.cpp (244306 => 244307)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Shared/UserData.cpp 2019-04-15 23:36:25 UTC (rev 244306)
+++ trunk/Source/WebKit/Shared/UserData.cpp 2019-04-15 23:48:55 UTC (rev 244307)
</span><span class="lines">@@ -310,6 +310,10 @@
</span><span class="cx"> static_cast<const API::UInt64&>(object).encode(encoder);
</span><span class="cx"> break;
</span><span class="cx">
</span><ins>+ case API::Object::Type::Int64:
+ static_cast<const API::Int64&>(object).encode(encoder);
+ break;
+
</ins><span class="cx"> case API::Object::Type::UserContentURLPattern: {
</span><span class="cx"> auto& urlPattern = static_cast<const API::UserContentURLPattern&>(object);
</span><span class="cx"> encoder << urlPattern.patternString();
</span><span class="lines">@@ -572,6 +576,11 @@
</span><span class="cx"> return false;
</span><span class="cx"> break;
</span><span class="cx">
</span><ins>+ case API::Object::Type::Int64:
+ if (!API::Int64::decode(decoder, result))
+ return false;
+ break;
+
</ins><span class="cx"> case API::Object::Type::UserContentURLPattern: {
</span><span class="cx"> String string;
</span><span class="cx"> if (!decoder.decode(string))
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessAPIAPIDiagnosticLoggingClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/API/APIDiagnosticLoggingClient.h (244306 => 244307)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/API/APIDiagnosticLoggingClient.h 2019-04-15 23:36:25 UTC (rev 244306)
+++ trunk/Source/WebKit/UIProcess/API/APIDiagnosticLoggingClient.h 2019-04-15 23:48:55 UTC (rev 244307)
</span><span class="lines">@@ -23,8 +23,7 @@
</span><span class="cx"> * THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx"> */
</span><span class="cx">
</span><del>-#ifndef APIDiagnosticLoggingClient_h
-#define APIDiagnosticLoggingClient_h
</del><ins>+#pragma once
</ins><span class="cx">
</span><span class="cx"> #include <WebCore/DiagnosticLoggingResultType.h>
</span><span class="cx"> #include <wtf/text/WTFString.h>
</span><span class="lines">@@ -35,6 +34,8 @@
</span><span class="cx">
</span><span class="cx"> namespace API {
</span><span class="cx">
</span><ins>+class Dictionary;
+
</ins><span class="cx"> class DiagnosticLoggingClient {
</span><span class="cx"> public:
</span><span class="cx"> virtual ~DiagnosticLoggingClient() { }
</span><span class="lines">@@ -43,9 +44,8 @@
</span><span class="cx"> virtual void logDiagnosticMessageWithResult(WebKit::WebPageProxy*, const WTF::String& message, const WTF::String& description, WebCore::DiagnosticLoggingResultType) = 0;
</span><span class="cx"> virtual void logDiagnosticMessageWithValue(WebKit::WebPageProxy*, const WTF::String& message, const WTF::String& description, const WTF::String& value) = 0;
</span><span class="cx"> virtual void logDiagnosticMessageWithEnhancedPrivacy(WebKit::WebPageProxy*, const WTF::String& message, const WTF::String& description) = 0;
</span><ins>+
+ virtual void logDiagnosticMessageWithValueDictionary(WebKit::WebPageProxy*, const WTF::String& message, const WTF::String& description, Ref<API::Dictionary>&&) = 0;
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> } // namespace API
</span><del>-
-#endif // APIDiagnosticLoggingClient_h
-
</del></span></pre></div>
<a id="trunkSourceWebKitUIProcessAPICocoa_WKDiagnosticLoggingDelegateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/_WKDiagnosticLoggingDelegate.h (244306 => 244307)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/API/Cocoa/_WKDiagnosticLoggingDelegate.h 2019-04-15 23:36:25 UTC (rev 244306)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/_WKDiagnosticLoggingDelegate.h 2019-04-15 23:48:55 UTC (rev 244307)
</span><span class="lines">@@ -40,5 +40,6 @@
</span><span class="cx"> - (void)_webView:(WKWebView *)webView logDiagnosticMessageWithResult:(NSString *)message description:(NSString *)description result:(_WKDiagnosticLoggingResultType)result;
</span><span class="cx"> - (void)_webView:(WKWebView *)webView logDiagnosticMessageWithValue:(NSString *)message description:(NSString *)description value:(NSString *) value;
</span><span class="cx"> - (void)_webView:(WKWebView *)webView logDiagnosticMessageWithEnhancedPrivacy:(NSString *)message description:(NSString *)description WK_API_AVAILABLE(macos(10.13), ios(11.0));
</span><ins>+- (void)_webView:(WKWebView *)webView logDiagnosticMessage:(NSString *)message description:(NSString *)description valueDictionary:(NSDictionary *)valueDictionary WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA));
</ins><span class="cx">
</span><span class="cx"> @end
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessCocoaDiagnosticLoggingClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/Cocoa/DiagnosticLoggingClient.h (244306 => 244307)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/Cocoa/DiagnosticLoggingClient.h 2019-04-15 23:36:25 UTC (rev 244306)
+++ trunk/Source/WebKit/UIProcess/Cocoa/DiagnosticLoggingClient.h 2019-04-15 23:48:55 UTC (rev 244307)
</span><span class="lines">@@ -51,6 +51,7 @@
</span><span class="cx"> void logDiagnosticMessageWithResult(WebPageProxy*, const String& message, const String& description, WebCore::DiagnosticLoggingResultType) override;
</span><span class="cx"> void logDiagnosticMessageWithValue(WebPageProxy*, const String& message, const String& description, const String& value) override;
</span><span class="cx"> void logDiagnosticMessageWithEnhancedPrivacy(WebPageProxy*, const String& message, const String& description) override;
</span><ins>+ void logDiagnosticMessageWithValueDictionary(WebPageProxy*, const String& message, const String& description, Ref<API::Dictionary>&&) override;
</ins><span class="cx">
</span><span class="cx"> WKWebView *m_webView;
</span><span class="cx"> WeakObjCPtr<id <_WKDiagnosticLoggingDelegate>> m_delegate;
</span><span class="lines">@@ -60,6 +61,7 @@
</span><span class="cx"> unsigned webviewLogDiagnosticMessageWithResult : 1;
</span><span class="cx"> unsigned webviewLogDiagnosticMessageWithValue : 1;
</span><span class="cx"> unsigned webviewLogDiagnosticMessageWithEnhancedPrivacy : 1;
</span><ins>+ unsigned webviewLogDiagnosticMessageWithValueDictionary : 1;
</ins><span class="cx"> } m_delegateMethods;
</span><span class="cx"> };
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessCocoaDiagnosticLoggingClientmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/Cocoa/DiagnosticLoggingClient.mm (244306 => 244307)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/Cocoa/DiagnosticLoggingClient.mm 2019-04-15 23:36:25 UTC (rev 244306)
+++ trunk/Source/WebKit/UIProcess/Cocoa/DiagnosticLoggingClient.mm 2019-04-15 23:48:55 UTC (rev 244307)
</span><span class="lines">@@ -26,6 +26,7 @@
</span><span class="cx"> #import "config.h"
</span><span class="cx"> #import "DiagnosticLoggingClient.h"
</span><span class="cx">
</span><ins>+#import "APIDictionary.h"
</ins><span class="cx"> #import "WKSharedAPICast.h"
</span><span class="cx"> #import "_WKDiagnosticLoggingDelegate.h"
</span><span class="cx">
</span><span class="lines">@@ -49,6 +50,7 @@
</span><span class="cx"> m_delegateMethods.webviewLogDiagnosticMessageWithResult = [delegate respondsToSelector:@selector(_webView:logDiagnosticMessageWithResult:description:result:)];
</span><span class="cx"> m_delegateMethods.webviewLogDiagnosticMessageWithValue = [delegate respondsToSelector:@selector(_webView:logDiagnosticMessageWithValue:description:value:)];
</span><span class="cx"> m_delegateMethods.webviewLogDiagnosticMessageWithEnhancedPrivacy = [delegate respondsToSelector:@selector(_webView:logDiagnosticMessageWithEnhancedPrivacy:description:)];
</span><ins>+ m_delegateMethods.webviewLogDiagnosticMessageWithValueDictionary = [delegate respondsToSelector:@selector(_webView:logDiagnosticMessage:description:valueDictionary:)];
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void DiagnosticLoggingClient::logDiagnosticMessage(WebKit::WebPageProxy*, const WTF::String& message, const WTF::String& description)
</span><span class="lines">@@ -87,4 +89,11 @@
</span><span class="cx"> [m_delegate.get() _webView:m_webView logDiagnosticMessageWithEnhancedPrivacy:message description:description];
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void DiagnosticLoggingClient::logDiagnosticMessageWithValueDictionary(WebPageProxy*, const String& message, const String& description, Ref<API::Dictionary>&& valueDictionary)
+{
+ if (m_delegateMethods.webviewLogDiagnosticMessageWithValueDictionary)
+ [m_delegate.get() _webView:m_webView logDiagnosticMessage:message description:description valueDictionary:static_cast<NSDictionary*>(valueDictionary->wrapper())];
+}
+
+
</ins><span class="cx"> } // namespace WebKit
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessProvisionalPageProxycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/ProvisionalPageProxy.cpp (244306 => 244307)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/ProvisionalPageProxy.cpp 2019-04-15 23:36:25 UTC (rev 244306)
+++ trunk/Source/WebKit/UIProcess/ProvisionalPageProxy.cpp 2019-04-15 23:48:55 UTC (rev 244307)
</span><span class="lines">@@ -381,6 +381,7 @@
</span><span class="cx"> || decoder.messageName() == Messages::WebPageProxy::BackForwardAddItem::name()
</span><span class="cx"> || decoder.messageName() == Messages::WebPageProxy::LogDiagnosticMessage::name()
</span><span class="cx"> || decoder.messageName() == Messages::WebPageProxy::LogDiagnosticMessageWithEnhancedPrivacy::name()
</span><ins>+ || decoder.messageName() == Messages::WebPageProxy::LogDiagnosticMessageWithValueDictionary::name()
</ins><span class="cx"> || decoder.messageName() == Messages::WebPageProxy::SetNetworkRequestsInProgress::name()
</span><span class="cx"> #if USE(QUICK_LOOK)
</span><span class="cx"> || decoder.messageName() == Messages::WebPageProxy::DidStartLoadForQuickLookDocumentInMainFrame::name()
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessWebPageDiagnosticLoggingClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/WebPageDiagnosticLoggingClient.h (244306 => 244307)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/WebPageDiagnosticLoggingClient.h 2019-04-15 23:36:25 UTC (rev 244306)
+++ trunk/Source/WebKit/UIProcess/WebPageDiagnosticLoggingClient.h 2019-04-15 23:48:55 UTC (rev 244307)
</span><span class="lines">@@ -52,6 +52,7 @@
</span><span class="cx"> void logDiagnosticMessageWithResult(WebPageProxy*, const String& message, const String& description, WebCore::DiagnosticLoggingResultType) override;
</span><span class="cx"> void logDiagnosticMessageWithValue(WebPageProxy*, const String& message, const String& description, const String& value) override;
</span><span class="cx"> void logDiagnosticMessageWithEnhancedPrivacy(WebPageProxy*, const String& message, const String& description) override;
</span><ins>+ void logDiagnosticMessageWithValueDictionary(WebKit::WebPageProxy*, const WTF::String& message, const WTF::String& description, Ref<API::Dictionary>&&) override { }
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> } // namespace WebKit
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessWebPageProxycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.cpp (244306 => 244307)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/WebPageProxy.cpp 2019-04-15 23:36:25 UTC (rev 244306)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.cpp 2019-04-15 23:48:55 UTC (rev 244307)
</span><span class="lines">@@ -6532,6 +6532,27 @@
</span><span class="cx"> effectiveClient->logDiagnosticMessageWithEnhancedPrivacy(this, message, description);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void WebPageProxy::logDiagnosticMessageWithValueDictionary(const String& message, const String& description, const WebCore::DiagnosticLoggingClient::ValueDictionary& valueDictionary, WebCore::ShouldSample shouldSample)
+{
+ auto* effectiveClient = effectiveDiagnosticLoggingClient(shouldSample);
+ if (!effectiveClient)
+ return;
+
+ auto apiDictionary = API::Dictionary::create();
+
+ for (auto& keyValuePair : valueDictionary) {
+ apiDictionary->add(keyValuePair.key, WTF::switchOn(keyValuePair.value,
+ [](const String& value) -> Ref<Object> { return API::String::create(value); },
+ [](uint64_t value) -> Ref<Object> { return API::UInt64::create(value); },
+ [](int64_t value) -> Ref<Object> { return API::Int64::create(value); },
+ [](bool value) -> Ref<Object> { return API::Boolean::create(value); },
+ [](double value) -> Ref<Object> { return API::Double::create(value); }
+ ));
+ }
+
+ effectiveClient->logDiagnosticMessageWithValueDictionary(this, message, description, WTFMove(apiDictionary));
+}
+
</ins><span class="cx"> void WebPageProxy::logScrollingEvent(uint32_t eventType, MonotonicTime timestamp, uint64_t data)
</span><span class="cx"> {
</span><span class="cx"> PerformanceLoggingClient::ScrollingEvent event = static_cast<PerformanceLoggingClient::ScrollingEvent>(eventType);
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessWebPageProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.h (244306 => 244307)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/WebPageProxy.h 2019-04-15 23:36:25 UTC (rev 244306)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.h 2019-04-15 23:48:55 UTC (rev 244307)
</span><span class="lines">@@ -70,6 +70,7 @@
</span><span class="cx"> #include <WebCore/ActivityState.h>
</span><span class="cx"> #include <WebCore/AutoplayEvent.h>
</span><span class="cx"> #include <WebCore/Color.h>
</span><ins>+#include <WebCore/DiagnosticLoggingClient.h>
</ins><span class="cx"> #include <WebCore/DragActions.h>
</span><span class="cx"> #include <WebCore/EventTrackingRegions.h>
</span><span class="cx"> #include <WebCore/FontAttributes.h>
</span><span class="lines">@@ -1345,6 +1346,7 @@
</span><span class="cx"> void logDiagnosticMessageWithResult(const String& message, const String& description, uint32_t result, WebCore::ShouldSample);
</span><span class="cx"> void logDiagnosticMessageWithValue(const String& message, const String& description, double value, unsigned significantFigures, WebCore::ShouldSample);
</span><span class="cx"> void logDiagnosticMessageWithEnhancedPrivacy(const String& message, const String& description, WebCore::ShouldSample);
</span><ins>+ void logDiagnosticMessageWithValueDictionary(const String& message, const String& description, const WebCore::DiagnosticLoggingClient::ValueDictionary&, WebCore::ShouldSample);
</ins><span class="cx">
</span><span class="cx"> // Performance logging.
</span><span class="cx"> void logScrollingEvent(uint32_t eventType, MonotonicTime, uint64_t);
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessWebPageProxymessagesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.messages.in (244306 => 244307)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/WebPageProxy.messages.in 2019-04-15 23:36:25 UTC (rev 244306)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.messages.in 2019-04-15 23:48:55 UTC (rev 244307)
</span><span class="lines">@@ -242,6 +242,7 @@
</span><span class="cx"> LogDiagnosticMessageWithResult(String message, String description, uint32_t result, enum:bool WebCore::ShouldSample shouldSample)
</span><span class="cx"> LogDiagnosticMessageWithValue(String message, String description, double value, unsigned significantFigures, enum:bool WebCore::ShouldSample shouldSample)
</span><span class="cx"> LogDiagnosticMessageWithEnhancedPrivacy(String message, String description, enum:bool WebCore::ShouldSample shouldSample)
</span><ins>+ LogDiagnosticMessageWithValueDictionary(String message, String description, WebCore::DiagnosticLoggingClient::ValueDictionary value, enum:bool WebCore::ShouldSample shouldSample)
</ins><span class="cx">
</span><span class="cx"> # Performance logging
</span><span class="cx"> LogScrollingEvent(uint32_t eventType, MonotonicTime timestamp, uint64_t data)
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessWebCoreSupportWebDiagnosticLoggingClientcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.cpp (244306 => 244307)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.cpp 2019-04-15 23:36:25 UTC (rev 244306)
+++ trunk/Source/WebKit/WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.cpp 2019-04-15 23:48:55 UTC (rev 244307)
</span><span class="lines">@@ -83,4 +83,14 @@
</span><span class="cx"> m_page.send(Messages::WebPageProxy::LogDiagnosticMessageWithEnhancedPrivacy(message, description, ShouldSample::No));
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void WebDiagnosticLoggingClient::logDiagnosticMessageWithValueDictionary(const String& message, const String& description, const ValueDictionary& value, ShouldSample shouldSample)
+{
+ ASSERT(!m_page.corePage() || m_page.corePage()->settings().diagnosticLoggingEnabled());
+
+ if (!shouldLogAfterSampling(shouldSample))
+ return;
+
+ m_page.send(Messages::WebPageProxy::LogDiagnosticMessageWithValueDictionary(message, description, value, ShouldSample::No));
+}
+
</ins><span class="cx"> } // namespace WebKit
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessWebCoreSupportWebDiagnosticLoggingClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.h (244306 => 244307)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.h 2019-04-15 23:36:25 UTC (rev 244306)
+++ trunk/Source/WebKit/WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.h 2019-04-15 23:48:55 UTC (rev 244307)
</span><span class="lines">@@ -43,6 +43,7 @@
</span><span class="cx"> void logDiagnosticMessageWithResult(const String& message, const String& description, WebCore::DiagnosticLoggingResultType, WebCore::ShouldSample) override;
</span><span class="cx"> void logDiagnosticMessageWithValue(const String& message, const String& description, double value, unsigned significantFigures, WebCore::ShouldSample) override;
</span><span class="cx"> void logDiagnosticMessageWithEnhancedPrivacy(const String& message, const String& description, WebCore::ShouldSample) override;
</span><ins>+ void logDiagnosticMessageWithValueDictionary(const String& message, const String& description, const ValueDictionary&, WebCore::ShouldSample) override;
</ins><span class="cx">
</span><span class="cx"> WebPage& m_page;
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (244306 => 244307)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog 2019-04-15 23:36:25 UTC (rev 244306)
+++ trunk/Tools/ChangeLog 2019-04-15 23:48:55 UTC (rev 244307)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2019-04-15 Alex Christensen <achristensen@webkit.org>
+
+ Add a DiagnosticLogging method taking an arbitrary dictionary of values.
+ https://bugs.webkit.org/show_bug.cgi?id=196773
+
+ Reviewed by Jer Noble.
+
+ * TestWebKitAPI/Tests/WebKitCocoa/WKWebViewDiagnosticLogging.mm:
+ (-[TestLoggingDelegate _webView:logDiagnosticMessage:description:valueDictionary:]):
+ (TEST):
+
</ins><span class="cx"> 2019-04-15 Aakash Jain <aakash_jain@apple.com>
</span><span class="cx">
</span><span class="cx"> ews-build should clearly indicate flaky test failures
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebKitCocoaWKWebViewDiagnosticLoggingmm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebViewDiagnosticLogging.mm (244306 => 244307)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebViewDiagnosticLogging.mm 2019-04-15 23:36:25 UTC (rev 244306)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebViewDiagnosticLogging.mm 2019-04-15 23:48:55 UTC (rev 244307)
</span><span class="lines">@@ -28,14 +28,30 @@
</span><span class="cx"> #import "PlatformUtilities.h"
</span><span class="cx"> #import "Test.h"
</span><span class="cx"> #import "TestNavigationDelegate.h"
</span><ins>+#import "WKWebViewConfigurationExtras.h"
+#import <WebKit/WKPreferencesPrivate.h>
</ins><span class="cx"> #import <WebKit/WKWebViewPrivate.h>
</span><span class="cx"> #import <WebKit/_WKDiagnosticLoggingDelegate.h>
</span><span class="cx"> #import <wtf/RetainPtr.h>
</span><span class="cx">
</span><ins>+static bool isDone;
+
</ins><span class="cx"> @interface TestLoggingDelegate : NSObject <_WKDiagnosticLoggingDelegate>
</span><span class="cx"> @end
</span><span class="cx">
</span><span class="cx"> @implementation TestLoggingDelegate
</span><ins>+
+- (void)_webView:(WKWebView *)webView logDiagnosticMessage:(NSString *)message description:(NSString *)description valueDictionary:(NSDictionary *)valueDictionary
+{
+ EXPECT_TRUE([[valueDictionary objectForKey:@"stringKey"] isEqualToString:@"stringValue"]);
+ EXPECT_TRUE([[valueDictionary objectForKey:@"uint64Key"] unsignedLongLongValue] == std::numeric_limits<uint64_t>::max());
+ EXPECT_TRUE([[valueDictionary objectForKey:@"int64Key"] longLongValue] == std::numeric_limits<int64_t>::min());
+ EXPECT_TRUE([[valueDictionary objectForKey:@"boolKey"] boolValue]);
+ EXPECT_TRUE([[valueDictionary objectForKey:@"doubleKey"] doubleValue] == 2.7182818284590452353602874);
+
+ isDone = true;
+}
+
</ins><span class="cx"> @end
</span><span class="cx">
</span><span class="cx"> TEST(WKWebView, PrivateSessionDiagnosticLoggingDelegate)
</span><span class="lines">@@ -69,3 +85,13 @@
</span><span class="cx"> EXPECT_EQ(nil, webView.get()._diagnosticLoggingDelegate);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+TEST(WKWebView, DiagnosticLoggingDictionary)
+{
+ auto webView = adoptNS([[WKWebView alloc] initWithFrame:CGRectZero configuration:[WKWebViewConfiguration _test_configurationWithTestPlugInClassName:@"WebProcessPlugInWithInternals"]]);
+ auto testLoggingDelegate = adoptNS([TestLoggingDelegate new]);
+ [webView _setDiagnosticLoggingDelegate:testLoggingDelegate.get()];
+ [webView configuration].preferences._diagnosticLoggingEnabled = YES;
+
+ [webView loadHTMLString:@"<script>window.internals.testDictionaryLogging()</script>" baseURL:nil];
+ TestWebKitAPI::Util::run(&isDone);
+}
</ins></span></pre>
</div>
</div>
</body>
</html>