[webkit-changes] [194324] trunk/Source/WebCore

2015-12-20 Thread gyuyoung . kim
Title: [194324] trunk/Source/WebCore








Revision 194324
Author gyuyoung@webkit.org
Date 2015-12-20 18:10:49 -0800 (Sun, 20 Dec 2015)


Log Message
Reduce PassRefPtr uses in dom - 2
https://bugs.webkit.org/show_bug.cgi?id=151936

Reviewed by Darin Adler.

Change PassRefPtr with RefPtr&&, WTF::move(), Foo*, and Foo&.

* dom/ScopedEventQueue.h:
* dom/ScriptedAnimationController.cpp:
(WebCore::ScriptedAnimationController::registerCallback):
* dom/ScriptedAnimationController.h:
* dom/StaticNodeList.h:
* dom/Traversal.cpp:
(WebCore::NodeIteratorBase::NodeIteratorBase):
* dom/Traversal.h:
* dom/TreeWalker.cpp:
(WebCore::TreeWalker::TreeWalker):
(WebCore::TreeWalker::setCurrentNode):
* dom/TreeWalker.h:
(WebCore::TreeWalker::create):
* dom/UserActionElementSet.h:
* dom/WebKitNamedFlow.cpp:
(WebCore::WebKitNamedFlow::WebKitNamedFlow):
(WebCore::WebKitNamedFlow::create):
(WebCore::WebKitNamedFlow::getRegionsByContent):
(WebCore::WebKitNamedFlow::getRegions):
(WebCore::WebKitNamedFlow::getContent):
* dom/WebKitNamedFlow.h:
* dom/WheelEvent.cpp:
(WebCore::WheelEvent::WheelEvent):
(WebCore::WheelEvent::initWheelEvent):
(WebCore::WheelEvent::initWebKitWheelEvent):
* dom/WheelEvent.h:

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/dom/Document.cpp
trunk/Source/WebCore/dom/NamedFlowCollection.cpp
trunk/Source/WebCore/dom/NodeIterator.cpp
trunk/Source/WebCore/dom/ScopedEventQueue.h
trunk/Source/WebCore/dom/StaticNodeList.h
trunk/Source/WebCore/dom/Traversal.cpp
trunk/Source/WebCore/dom/Traversal.h
trunk/Source/WebCore/dom/TreeWalker.cpp
trunk/Source/WebCore/dom/TreeWalker.h
trunk/Source/WebCore/dom/UserActionElementSet.h
trunk/Source/WebCore/dom/WebKitNamedFlow.cpp
trunk/Source/WebCore/dom/WebKitNamedFlow.h
trunk/Source/WebCore/dom/WheelEvent.cpp
trunk/Source/WebCore/dom/WheelEvent.h




Diff

Modified: trunk/Source/WebCore/ChangeLog (194323 => 194324)

--- trunk/Source/WebCore/ChangeLog	2015-12-21 01:19:41 UTC (rev 194323)
+++ trunk/Source/WebCore/ChangeLog	2015-12-21 02:10:49 UTC (rev 194324)
@@ -1,3 +1,39 @@
+2015-12-20  Gyuyoung Kim  
+
+Reduce PassRefPtr uses in dom - 2
+https://bugs.webkit.org/show_bug.cgi?id=151936
+
+Reviewed by Darin Adler.
+
+Change PassRefPtr with RefPtr&&, WTF::move(), Foo*, and Foo&.
+
+* dom/ScopedEventQueue.h:
+* dom/ScriptedAnimationController.cpp:
+(WebCore::ScriptedAnimationController::registerCallback):
+* dom/ScriptedAnimationController.h:
+* dom/StaticNodeList.h:
+* dom/Traversal.cpp:
+(WebCore::NodeIteratorBase::NodeIteratorBase):
+* dom/Traversal.h:
+* dom/TreeWalker.cpp:
+(WebCore::TreeWalker::TreeWalker):
+(WebCore::TreeWalker::setCurrentNode):
+* dom/TreeWalker.h:
+(WebCore::TreeWalker::create):
+* dom/UserActionElementSet.h:
+* dom/WebKitNamedFlow.cpp:
+(WebCore::WebKitNamedFlow::WebKitNamedFlow):
+(WebCore::WebKitNamedFlow::create):
+(WebCore::WebKitNamedFlow::getRegionsByContent):
+(WebCore::WebKitNamedFlow::getRegions):
+(WebCore::WebKitNamedFlow::getContent):
+* dom/WebKitNamedFlow.h:
+* dom/WheelEvent.cpp:
+(WebCore::WheelEvent::WheelEvent):
+(WebCore::WheelEvent::initWheelEvent):
+(WebCore::WheelEvent::initWebKitWheelEvent):
+* dom/WheelEvent.h:
+
 2015-12-20  Michael Catanzaro  
 
 [SOUP] Performs DNS prefetch when a proxy is configured (information leak)


Modified: trunk/Source/WebCore/dom/Document.cpp (194323 => 194324)

--- trunk/Source/WebCore/dom/Document.cpp	2015-12-21 01:19:41 UTC (rev 194323)
+++ trunk/Source/WebCore/dom/Document.cpp	2015-12-21 02:10:49 UTC (rev 194324)
@@ -1748,7 +1748,7 @@
 ec = TypeError;
 return nullptr;
 }
-return TreeWalker::create(root, whatToShow, WTF::move(filter));
+return TreeWalker::create(*root, whatToShow, WTF::move(filter));
 }
 
 RefPtr Document::createTreeWalker(Node* root, unsigned long whatToShow, ExceptionCode& ec)


Modified: trunk/Source/WebCore/dom/NamedFlowCollection.cpp (194323 => 194324)

--- trunk/Source/WebCore/dom/NamedFlowCollection.cpp	2015-12-21 01:19:41 UTC (rev 194323)
+++ trunk/Source/WebCore/dom/NamedFlowCollection.cpp	2015-12-21 02:10:49 UTC (rev 194324)
@@ -76,7 +76,7 @@
 return *namedFlow;
 }
 
-RefPtr newFlow = WebKitNamedFlow::create(this, flowName);
+RefPtr newFlow = WebKitNamedFlow::create(*this, flowName);
 m_namedFlows.add(newFlow.get());
 
 InspectorInstrumentation::didCreateNamedFlow(document(), *newFlow);


Modified: trunk/Source/WebCore/dom/NodeIterator.cpp (194323 => 194324)

--- trunk/Source/WebCore/dom/NodeIterator.cpp	2015-12-21 01:19:41 UTC (rev 194323)
+++ trunk/Source/WebCore/dom/NodeIterator.cpp	2015-12-21 02:10:49 UTC (rev 194324)
@@ -77,7 +77,7 @@
 }
 
 NodeIterator::NodeIterator(PassRefPtr rootNode, unsigned 

[webkit-changes] [194326] trunk

2015-12-20 Thread commit-queue
Title: [194326] trunk








Revision 194326
Author commit-qu...@webkit.org
Date 2015-12-20 20:23:09 -0800 (Sun, 20 Dec 2015)


Log Message
Don't allocate a NSImage and skip unneeded call to TIFFRepresentation when copying image to clipboard.
https://bugs.webkit.org/show_bug.cgi?id=152374

Patch by Jeremy Zerfas  on 2015-12-20
Reviewed by Darin Adler.

Source/WebCore:

When copying an image to the clipboard, don't bother allocating a
NSImage and skip the unneeded call to TIFFRepresentation since the data
from the previous getTIFFRepresentation call can be used instead. This
considerably reduces the amount of memory and CPU time used for large
images/animations.

Test: fast/images/image-copy-memory-usage.html

* platform/mac/PasteboardMac.mm:
(WebCore::Pasteboard::write):

LayoutTests:

Added test to make sure that when copying a 50 frame 500x500 animation
(50 MB uncompressed) to the clipboard, the additional memory usage is
kept to less than 200 MB.

* fast/images/image-copy-memory-usage-expected.txt: Added.
* fast/images/image-copy-memory-usage.html: Added.
* fast/images/resources/dot-moving-in-a-circle-animation.gif: Added.

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/platform/mac/PasteboardMac.mm


Added Paths

trunk/LayoutTests/fast/images/image-copy-memory-usage-expected.txt
trunk/LayoutTests/fast/images/image-copy-memory-usage.html
trunk/LayoutTests/fast/images/resources/dot-moving-in-a-circle-animation.gif




Diff

Modified: trunk/LayoutTests/ChangeLog (194325 => 194326)

--- trunk/LayoutTests/ChangeLog	2015-12-21 02:54:32 UTC (rev 194325)
+++ trunk/LayoutTests/ChangeLog	2015-12-21 04:23:09 UTC (rev 194326)
@@ -1,3 +1,18 @@
+2015-12-20  Jeremy Zerfas  
+
+Don't allocate a NSImage and skip unneeded call to TIFFRepresentation when copying image to clipboard.
+https://bugs.webkit.org/show_bug.cgi?id=152374
+
+Reviewed by Darin Adler.
+
+Added test to make sure that when copying a 50 frame 500x500 animation
+(50 MB uncompressed) to the clipboard, the additional memory usage is
+kept to less than 200 MB.
+
+* fast/images/image-copy-memory-usage-expected.txt: Added.
+* fast/images/image-copy-memory-usage.html: Added.
+* fast/images/resources/dot-moving-in-a-circle-animation.gif: Added.
+
 2015-12-20  Commit Queue  
 
 Unreviewed, rolling out r194033 and r194267.


Added: trunk/LayoutTests/fast/images/image-copy-memory-usage-expected.txt (0 => 194326)

--- trunk/LayoutTests/fast/images/image-copy-memory-usage-expected.txt	(rev 0)
+++ trunk/LayoutTests/fast/images/image-copy-memory-usage-expected.txt	2015-12-21 04:23:09 UTC (rev 194326)
@@ -0,0 +1,14 @@
+This is an automated test related to Bug 152374 - Reduce resource usage when copying image to clipboard.
+
+This tests how much memory is used while copying an animation into the clipboard. The animation consists of 50 500x500 frames and, assuming 32 bits per pixel, will use 50 MB of memory when uncompressed. To pass the test, after copying the animation to the clipboard, the memory usage of the browser must not have increased by more than 200 MBs.
+
+In order to make this test more accurate it should be performed in a freshly started browser session that has nothing else open and which has an empty cache.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS changeInCommittedVMBytes < 2 is true
+PASS successfullyParsed is true
+
+TEST COMPLETE
+


Added: trunk/LayoutTests/fast/images/image-copy-memory-usage.html (0 => 194326)

--- trunk/LayoutTests/fast/images/image-copy-memory-usage.html	(rev 0)
+++ trunk/LayoutTests/fast/images/image-copy-memory-usage.html	2015-12-21 04:23:09 UTC (rev 194326)
@@ -0,0 +1,75 @@
+
+
+	
+		
+		image-copy-memory-usage.html
+		
+
+	
+