Title: [209423] trunk/Source
Revision
209423
Author
akl...@apple.com
Date
2016-12-06 14:38:45 -0800 (Tue, 06 Dec 2016)

Log Message

[Cocoa] Add some memory usage related information to sysdiagnose state dumps
<https://webkit.org/b/165375>
<rdar://problem/29057243>

Reviewed by Darin Adler.

Follow-up to address two more review comments.

Source/WebCore:

* page/PerformanceLogging.cpp:
(WebCore::PerformanceLogging::_javascript_ObjectCounts): Use WTFMove() when returning the
HashCountedSet to avoid making an extra copy.

Source/WebKit2:

* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::registerWithStateDumper): Use adoptNS() instead of autorelease for NSStrings.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (209422 => 209423)


--- trunk/Source/WebCore/ChangeLog	2016-12-06 22:32:45 UTC (rev 209422)
+++ trunk/Source/WebCore/ChangeLog	2016-12-06 22:38:45 UTC (rev 209423)
@@ -1,3 +1,17 @@
+2016-12-06  Andreas Kling  <akl...@apple.com>
+
+        [Cocoa] Add some memory usage related information to sysdiagnose state dumps
+        <https://webkit.org/b/165375>
+        <rdar://problem/29057243>
+
+        Reviewed by Darin Adler.
+
+        Follow-up to address two more review comments.
+
+        * page/PerformanceLogging.cpp:
+        (WebCore::PerformanceLogging::_javascript_ObjectCounts): Use WTFMove() when returning the
+        HashCountedSet to avoid making an extra copy.
+
 2016-12-06  Dave Hyatt  <hy...@apple.com>
 
         REGRESSION (Safari 10): Scrolling not working inside height 100% table

Modified: trunk/Source/WebCore/page/PerformanceLogging.cpp (209422 => 209423)


--- trunk/Source/WebCore/page/PerformanceLogging.cpp	2016-12-06 22:32:45 UTC (rev 209422)
+++ trunk/Source/WebCore/page/PerformanceLogging.cpp	2016-12-06 22:38:45 UTC (rev 209423)
@@ -74,7 +74,7 @@
 
 HashCountedSet<const char*> PerformanceLogging::_javascript_ObjectCounts()
 {
-    return *JSDOMWindow::commonVM().heap.objectTypeCounts();
+    return WTFMove(*JSDOMWindow::commonVM().heap.objectTypeCounts());
 }
 
 PerformanceLogging::PerformanceLogging(MainFrame& mainFrame)

Modified: trunk/Source/WebKit2/ChangeLog (209422 => 209423)


--- trunk/Source/WebKit2/ChangeLog	2016-12-06 22:32:45 UTC (rev 209422)
+++ trunk/Source/WebKit2/ChangeLog	2016-12-06 22:38:45 UTC (rev 209423)
@@ -1,3 +1,16 @@
+2016-12-06  Andreas Kling  <akl...@apple.com>
+
+        [Cocoa] Add some memory usage related information to sysdiagnose state dumps
+        <https://webkit.org/b/165375>
+        <rdar://problem/29057243>
+
+        Reviewed by Darin Adler.
+
+        Follow-up to address two more review comments.
+
+        * WebProcess/cocoa/WebProcessCocoa.mm:
+        (WebKit::WebProcess::registerWithStateDumper): Use adoptNS() instead of autorelease for NSStrings.
+
 2016-12-06  Eric Carlson  <eric.carl...@apple.com>
 
         [MediaStream][Mac] Revoke sandbox extensions when capture ends

Modified: trunk/Source/WebKit2/WebProcess/cocoa/WebProcessCocoa.mm (209422 => 209423)


--- trunk/Source/WebKit2/WebProcess/cocoa/WebProcessCocoa.mm	2016-12-06 22:32:45 UTC (rev 209422)
+++ trunk/Source/WebKit2/WebProcess/cocoa/WebProcessCocoa.mm	2016-12-06 22:38:45 UTC (rev 209423)
@@ -197,15 +197,19 @@
 
             {
                 auto memoryUsageStats = adoptNS([[NSMutableDictionary alloc] init]);
-                for (auto& it : PerformanceLogging::memoryUsageStatistics(ShouldIncludeExpensiveComputations::Yes))
-                    [memoryUsageStats setObject:@(it.value) forKey:[[[NSString alloc] initWithUTF8String:it.key] autorelease]];
+                for (auto& it : PerformanceLogging::memoryUsageStatistics(ShouldIncludeExpensiveComputations::Yes)) {
+                    auto keyString = adoptNS([[NSString alloc] initWithUTF8String:it.key]);
+                    [memoryUsageStats setObject:@(it.value) forKey:keyString.get()];
+                }
                 [stateDict setObject:memoryUsageStats.get() forKey:@"Memory Usage Stats"];
             }
 
             {
                 auto jsObjectCounts = adoptNS([[NSMutableDictionary alloc] init]);
-                for (auto& it : PerformanceLogging::_javascript_ObjectCounts())
-                    [jsObjectCounts setObject:@(it.value) forKey:[[[NSString alloc] initWithUTF8String:it.key] autorelease]];
+                for (auto& it : PerformanceLogging::_javascript_ObjectCounts()) {
+                    auto keyString = adoptNS([[NSString alloc] initWithUTF8String:it.key]);
+                    [jsObjectCounts setObject:@(it.value) forKey:keyString.get()];
+                }
                 [stateDict setObject:jsObjectCounts.get() forKey:@"_javascript_ Object Counts"];
             }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to