Unreviewed, a speculative build fix for r235888.
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2018-09-11  Jiewen Tan  <jiewen_tan@apple.com>
2
3         Unreviewed, a speculative build fix for r235888.
4
5         * Modules/mediastream/MediaDevices.h:
6         Add class Document forward declaration.
7
8 2018-09-11  Woodrow Wang  <woodrow_wang@apple.com>
9
10         Add Web API Statistics Collection
11         https://bugs.webkit.org/show_bug.cgi?id=187773
12         <rdar://problem/44155162>
13
14         Reviewed by Brent Fulgham.
15
16         Added data collection for web API statistics, specifically regarding the canvas, font loads, 
17         screen functions, and navigator functions. The data collection code is placed under a runtime 
18         enabled feature flag. The statistics are stored in a ResourceLoadStatistics object and written 
19         to a plist on disk. Added a new file CanvasActivityRecord.h and CanvasActivityRecord.cpp which
20         includes a struct to keep track of HTML5 canvas element read and writes. 
21
22         Tests: http/tests/webAPIStatistics/canvas-read-and-write-data-collection.html
23                http/tests/webAPIStatistics/font-load-data-collection.html
24                http/tests/webAPIStatistics/navigator-functions-accessed-data-collection.html
25                http/tests/webAPIStatistics/screen-functions-accessed-data-collection.html
26
27         * Sources.txt:
28         * WebCore.xcodeproj/project.pbxproj:
29         * css/CSSFontFaceSource.cpp:
30         (WebCore::CSSFontFaceSource::load):
31         * css/CSSFontSelector.cpp:
32         (WebCore::CSSFontSelector::fontRangesForFamily):
33         (WebCore::CSSFontSelector::fallbackFontAt):
34
35         The following are the functions where we'd like to record a canvas read.
36
37         * html/HTMLCanvasElement.cpp:
38         (WebCore::HTMLCanvasElement::toDataURL):
39         (WebCore::HTMLCanvasElement::toBlob):
40         (WebCore::HTMLCanvasElement::getImageData):
41         (WebCore::HTMLCanvasElement::toMediaSample):
42         (WebCore::HTMLCanvasElement::captureStream):
43
44         The following are the functions where we'd like to record a canvas write.
45
46         * html/canvas/CanvasRenderingContext2D.cpp:
47         (WebCore::CanvasRenderingContext2D::measureText):
48         (WebCore::CanvasRenderingContext2D::drawTextInternal):
49
50         The following files and functions handle the CanvasActivityRecord struct and
51         its respective functions.
52
53         * loader/CanvasActivityRecord.cpp: Added.
54         (WebCore::CanvasActivityRecord::recordWrittenOrMeasuredText):
55         (WebCore::CanvasActivityRecord::mergeWith):
56         * loader/CanvasActivityRecord.h: Added.
57         (WebCore::CanvasActivityRecord::encode const):
58         (WebCore::CanvasActivityRecord::decode):
59
60         * loader/DocumentThreadableLoader.cpp:
61         * loader/FrameLoader.cpp:
62         * loader/ResourceLoadObserver.cpp:
63         (WebCore::ResourceLoadObserver::logFontLoad):
64         (WebCore::ResourceLoadObserver::logCanvasRead):
65         (WebCore::ResourceLoadObserver::logCanvasWriteOrMeasure):
66         (WebCore::ResourceLoadObserver::logNavigatorAPIAccessed):
67         (WebCore::ResourceLoadObserver::logScreenAPIAccessed):
68
69         Before, entries in the ResourceLoadStatistics involving HashSets used "origin" as the key. 
70         Now the encodeHashSet function has been generalized to take any key to encode the entries 
71         in the HashSet. Also added functionality to encode an OptionSet by converting it to its 
72         raw bitmask state. 
73
74         * loader/ResourceLoadObserver.h:
75         * loader/ResourceLoadStatistics.cpp:
76         (WebCore::encodeHashSet):
77         (WebCore::encodeOriginHashSet):
78         (WebCore::encodeOptionSet):
79         (WebCore::encodeFontHashSet):
80         (WebCore::encodeCanvasActivityRecord):
81         (WebCore::ResourceLoadStatistics::encode const):
82         (WebCore::decodeHashSet):
83         (WebCore::decodeOriginHashSet):
84         (WebCore::decodeOptionSet):
85         (WebCore::decodeFontHashSet):
86         (WebCore::decodeCanvasActivityRecord):
87         (WebCore::ResourceLoadStatistics::decode):
88         (WebCore::navigatorAPIEnumToString):
89         (WebCore::screenAPIEnumToString):
90         (WebCore::appendNavigatorAPIOptionSet):
91         (WebCore::appendScreenAPIOptionSet):
92         (WebCore::ResourceLoadStatistics::toString const):
93         (WebCore::ResourceLoadStatistics::merge):
94         * loader/ResourceLoadStatistics.h:
95         * loader/ResourceTiming.cpp:
96
97         The following are the navigator functions recorded for the web API statistics.
98
99         * page/Navigator.cpp:
100         (WebCore::Navigator::appVersion const):
101         (WebCore::Navigator::userAgent const):
102         (WebCore::Navigator::plugins):
103         (WebCore::Navigator::mimeTypes):
104         (WebCore::Navigator::cookieEnabled const):
105         (WebCore::Navigator::javaEnabled const):
106
107         The following are the screen functions recorded for the web API statistics.
108
109         * page/Screen.cpp:
110         (WebCore::Screen::height const):
111         (WebCore::Screen::width const):
112         (WebCore::Screen::colorDepth const):
113         (WebCore::Screen::pixelDepth const):
114         (WebCore::Screen::availLeft const):
115         (WebCore::Screen::availTop const):
116         (WebCore::Screen::availHeight const):
117         (WebCore::Screen::availWidth const):
118
119 2018-09-11  Pablo Saavedra  <psaavedra@igalia.com>
120
121         playbackControlsManagerUpdateTimerFired and
122         m_playbackControlsManagerUpdateTimer must be
123         guarded with ENABLE(VIDEO), otherwise the following
124         error occurs with the VIDEO feature turned off:
125
126           error: 'MediaElementSession' has not been declared
127
128         Add missing #if ENABLE(VIDEO) Page.cpp and Page.h
129         https://bugs.webkit.org/show_bug.cgi?id=189500
130
131         Reviewed by Anders Carlsson.
132
133         * page/Page.cpp:
134         (WebCore::Page::Page):
135         (WebCore::Page::schedulePlaybackControlsManagerUpdate):
136         * page/Page.h:
137
138 2018-09-11  Frederic Wang  <fwang@igalia.com>
139
140         Refactor filter list checking code
141         https://bugs.webkit.org/show_bug.cgi?id=185087
142
143         Reviewed by Antonio Gomes.
144
145         No new tests, behavior unchanged.
146
147         * page/animation/KeyframeAnimation.h: Add missing forward-declaration FilterOperations.
148
149 == Rolled over to ChangeLog-2018-09-11 ==