Fix the build.
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2015-05-08  Timothy Horton  <timothy_horton@apple.com>
2
3         Fix the build.
4
5         * Platform/mac/LayerHostingContext.mm:
6         (WebKit::LayerHostingContext::createFencePort):
7
8 2015-05-08  Timothy Horton  <timothy_horton@apple.com>
9
10         Flip the direction of the fence in scaleViewAndUpdateGeometryFenced
11         https://bugs.webkit.org/show_bug.cgi?id=144810
12
13         Reviewed by Simon Fraser.
14
15         Send the fence from the Web process to the UI process, instead of vice versa.
16         This means that we won't keep the UI process CAContext blocked for the whole
17         time that the Web process is doing layout/painting/etc. Instead, we'll start
18         blocking the Web process CAContext immediately after flushing and before committing,
19         and send the fence to the UI process to be applied immediately. This minimizes
20         the amount of time in both processes spent blocked on the fence.
21
22         * Platform/mac/LayerHostingContext.h:
23         * Platform/mac/LayerHostingContext.mm:
24         (WebKit::LayerHostingContext::createFencePort):
25         Add createFencePort, which creates a MachSendRight wrapping a CA fence port.
26         Note that you must setFencePort() with this port if you want the LayerHostingContext's
27         CAContext to block on it!
28
29         * UIProcess/WebPageProxy.cpp:
30         (WebKit::WebPageProxy::scaleViewAndUpdateGeometryFenced):
31         (WebKit::WebPageProxy::machSendRightCallback):
32         * UIProcess/WebPageProxy.h:
33         * UIProcess/WebPageProxy.messages.in:
34         Create a callback and send it to the Web process along with scaleViewAndUpdateGeometryFenced.
35
36         * UIProcess/mac/WKViewLayoutStrategy.mm:
37         (-[WKViewDynamicSizeWithMinimumViewSizeLayoutStrategy updateLayout]):
38         When called back, install the fence port in our CAContext; when the commit goes through,
39         remove the transient scale as we did previously.
40
41         * WebProcess/WebPage/DrawingArea.h:
42         (WebKit::DrawingArea::replyWithFenceAfterNextFlush):
43         (WebKit::DrawingArea::updateGeometry): Deleted.
44         * WebProcess/WebPage/WebPage.cpp:
45         (WebKit::WebPage::scaleViewAndUpdateGeometryFenced):
46         * WebProcess/WebPage/WebPage.h:
47         * WebProcess/WebPage/WebPage.messages.in:
48         Instead of installing a fence created in the UI process, tell the DrawingArea
49         to create one and reply to the UI process with it after the next flush.
50
51         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
52         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
53         (WebKit::TiledCoreAnimationDrawingArea::flushLayers):
54         (WebKit::TiledCoreAnimationDrawingArea::replyWithFenceAfterNextFlush):
55         After flushing, before committing, create a fence and reply to any
56         callbacks that requested fences, and install it in our context.
57
58 2015-05-08  Michael Catanzaro  <mcatanzaro@igalia.com>, Martin Robinson <mrobinson@igalia.com>
59
60         [GTK] Checks for DEVELOPMENT_BUILD are all wrong
61         https://bugs.webkit.org/show_bug.cgi?id=144746
62
63         Reviewed by Carlos Garcia Campos.
64
65         Use ENABLE(DEVELOPER_MODE) rather than DEVELOPMENT_BUILD.
66
67         * Shared/gtk/ProcessExecutablePathGtk.cpp:
68         (WebKit::findWebKitProcess):
69         * UIProcess/API/gtk/WebKitWebContext.cpp:
70         (injectedBundleDirectory):
71         * UIProcess/gtk/TextCheckerGtk.cpp:
72         (WebKit::enchantTextChecker):
73
74 2015-05-08  Anders Carlsson  <andersca@apple.com>
75
76         Fix ProcessLauncher port leak
77         https://bugs.webkit.org/show_bug.cgi?id=144807
78         rdar://problem/20593291
79
80         Reviewed by Sam Weinig.
81
82         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
83         (WebKit::connectToService):
84         xpc_dictionary_set_mach_send increments the send right count so make sure to
85         balance it with a call to mach_port_deallocate.
86
87 2015-05-08  Beth Dakin  <bdakin@apple.com>
88
89         Fix performance tests after r183954
90         https://bugs.webkit.org/show_bug.cgi?id=144805
91
92         Reviewed by Alexey Proskuryakov.
93
94         Web* is traditionally a WK1 prefix, so use the WK2 prefix instead in WK2 so that 
95         we don’t have two classes with the same name in the two projects.
96         * UIProcess/mac/WKImmediateActionController.mm:
97         (-[WKImmediateActionController _defaultAnimationController]):
98
99 2015-05-08  Carlos Garcia Campos  <cgarcia@igalia.com>
100
101         [GTK] Expose allowFileAccessFromFileURLs setting to WebKit2 GTK+ API
102         https://bugs.webkit.org/show_bug.cgi?id=144748
103
104         Reviewed by Sergio Villar Senin.
105
106         This is needed by local applications loaded as a file URI that do XMLHttpRequests.
107
108         * UIProcess/API/gtk/WebKitSettings.cpp:
109         (webKitSettingsSetProperty):
110         (webKitSettingsGetProperty):
111         (webkit_settings_class_init):
112         (webkit_settings_get_allow_file_access_from_file_urls):
113         (webkit_settings_set_allow_file_access_from_file_urls):
114         * UIProcess/API/gtk/WebKitSettings.h:
115         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
116         * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml:
117
118 2015-05-08  Andreas Kling  <akling@apple.com>
119
120         Optimize serialization of quoted JSON strings.
121         <https://webkit.org/b/144754>
122
123         Reviewed by Darin Adler.
124
125         * NetworkProcess/cache/NetworkCacheEntry.cpp:
126         (WebKit::NetworkCache::Entry::asJSON): Use the new StringBuilder API.
127
128 2015-05-08  Commit Queue  <commit-queue@webkit.org>
129
130         Unreviewed, rolling out r183945.
131         https://bugs.webkit.org/show_bug.cgi?id=144789
132
133         "It broke all the GTK+ tests" (Requested by KaL on #webkit).
134
135         Reverted changeset:
136
137         "[GTK] Checks for DEVELOPMENT_BUILD are all wrong"
138         https://bugs.webkit.org/show_bug.cgi?id=144746
139         http://trac.webkit.org/changeset/183945
140
141 2015-05-07  Conrad Shultz  <conrad_shultz@apple.com>
142
143         Don't register for Lookup notifications until needed
144         https://bugs.webkit.org/show_bug.cgi?id=144783
145
146         Reviewed by Tim Horton.
147
148         * UIProcess/API/mac/WKView.mm:
149         Add a WKViewData ivar to track whether we've already registered for popover notifications.
150         (-[WKView _prepareForDictionaryLookup]):
151         Added; moved notification registration from -[WKView initWithFrame:processPool:configuration:webView:.
152         (-[WKView initWithFrame:processPool:configuration:webView:]):
153         Move notification registration to -_prepareForDictionaryLookup.
154
155         * UIProcess/API/mac/WKViewInternal.h:
156         Expose -_prepareForDictionaryLookup.
157
158         * UIProcess/mac/PageClientImpl.mm:
159         (WebKit::PageClientImpl::didPerformDictionaryLookup):
160         Send -[WKView _prepareForDictionaryLookup].
161
162         * UIProcess/mac/WKImmediateActionController.mm:
163         (-[WKImmediateActionController _animationControllerForText]):
164         Ditto.
165
166 2015-05-07  Commit Queue  <commit-queue@webkit.org>
167
168         Unreviewed, rolling out r183961.
169         https://bugs.webkit.org/show_bug.cgi?id=144784
170
171         Broke js/dom/JSON-stringify.html (Requested by kling on
172         #webkit).
173
174         Reverted changeset:
175
176         "Optimize serialization of quoted JSON strings."
177         https://bugs.webkit.org/show_bug.cgi?id=144754
178         http://trac.webkit.org/changeset/183961
179
180 2015-05-07  Anders Carlsson  <andersca@apple.com>
181
182         Build fixes.
183
184         * UIProcess/API/mac/WKView.mm:
185         (-[WKView initWithFrame:processPool:configuration:webView:]):
186         Use the regular init method.
187
188         * UIProcess/mac/WKSharingServicePickerDelegate.mm:
189         (-[WKSharingServicePickerDelegate sharingService:didShareItems:]):
190         * WebProcess/WebPage/mac/WebPageMac.mm:
191         (WebKit::WebPage::handleSelectionServiceClick):
192         Pass empty dictionaries instead of nil.
193
194 2015-05-07  Chris Dumez  <cdumez@apple.com>
195
196         ASSERTION when pasting text into the WebInspector console
197         https://bugs.webkit.org/show_bug.cgi?id=144774
198
199         Reviewed by Ryosuke Niwa.
200
201         Fix assertion in didChangeSelection() meant to check that calling
202         editorState() does not cause a synchronous layout. The assertion
203         was not correct as it was relying on FrameView::needsLayout() and
204         we would hit it if calling editorState() would schedule a layout.
205         Instead, the new assertion relies on FrameView::layoutCount(),
206         which is more accurate.
207
208         * WebProcess/WebPage/WebPage.cpp:
209         (WebKit::WebPage::didChangeSelection):
210
211 2015-05-07  Andreas Kling  <akling@apple.com>
212
213         Optimize serialization of quoted JSON strings.
214         <https://webkit.org/b/144754>
215
216         Reviewed by Darin Adler.
217
218         * NetworkProcess/cache/NetworkCacheEntry.cpp:
219         (WebKit::NetworkCache::Entry::asJSON): Use the new StringBuilder API.
220
221 2015-05-07  Martin Robinson  <mrobinson@igalia.com>
222
223         Followup fixes to r183936
224
225         I neglected to include a few review comments when I landed the patch.
226
227         * UIProcess/gtk/TextCheckerGtk.cpp:
228         (WebKit::checkerState): Remove double semicolons.
229         (WebKit::updateStateForAllProcessPools): Use range-based-for loop here and
230         give the function a better name.
231         (WebKit::TextChecker::setContinuousSpellCheckingEnabled): Use new function name
232         (WebKit::TextChecker::setGrammarCheckingEnabled):Use new function name
233         (WebKit::TextChecker::ignoreWord): Fix unused parameter warning.
234         (WebKit::updateStateForAllContexts): Deleted.
235
236 2015-05-07  Michael Catanzaro  <mcatanzaro@igalia.com>
237
238         [GTK] Checks for DEVELOPMENT_BUILD are all wrong
239         https://bugs.webkit.org/show_bug.cgi?id=144746
240
241         Reviewed by Martin Robinson.
242
243         Use DEVELOPER_MODE rather than DEVELOPMENT_BUILD.
244
245         * Shared/gtk/ProcessExecutablePathGtk.cpp:
246         (WebKit::findWebKitProcess):
247         * UIProcess/API/gtk/WebKitWebContext.cpp:
248         (injectedBundleDirectory):
249         * UIProcess/gtk/TextCheckerGtk.cpp:
250         (WebKit::enchantTextChecker):
251
252 2015-05-06  Dean Jackson  <dino@apple.com>
253
254         Handle backdrop views that have to tile
255         https://bugs.webkit.org/show_bug.cgi?id=142317
256         <rdar://problem/20049088>
257
258         Reviewed by Simon Fraser.
259
260         Take 2 - this was rolled out because Mavericks was crashing.
261
262         Add some better logging for custom appearance.
263
264         * Shared/mac/RemoteLayerTreeTransaction.mm:
265         (WebKit::RemoteLayerTreeTextStream::operator<<):
266
267 2015-05-07  Sungmann Cho  <sungmann.cho@navercorp.com>
268
269         Add PLUGIN_ARCHITECTURE(X11) around m_frameRectInWindowCoordinates in NetscapePlugin.
270         https://bugs.webkit.org/show_bug.cgi?id=144490
271
272         Reviewed by Darin Adler.
273
274         m_frameRectInWindowCoordinates in NetscapePlugin is currently being used only for
275         the windowed plugins, and the windowed plugins are only supported on X11. So we can
276         guard it with PLUGIN_ARCHITECTURE(X11).
277
278         No new tests, no behavior change.
279
280         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
281         (WebKit::NetscapePlugin::geometryDidChange):
282         * WebProcess/Plugins/Netscape/NetscapePlugin.h:
283
284 2015-05-05  Myles C. Maxfield  <mmaxfield@apple.com>
285
286         Revert "Introducing the Platform Abstraction Layer (PAL)"
287         https://bugs.webkit.org/show_bug.cgi?id=144751
288
289         Unreviewed.
290
291         PAL should be a new target inside WebCore, rather than a top-level folder.
292
293         * Configurations/FeatureDefines.xcconfig: Updated
294
295 2015-05-07  Jer Noble  <jer.noble@apple.com>
296
297         [WK2][Fullscreen] Fullscreen video does not enter low-power mode.
298         https://bugs.webkit.org/show_bug.cgi?id=144744
299
300         Reviewed by Darin Adler.
301
302         One of the requirements of entering low-power compositing mode is that no masking layers
303         are present in any of the ancestors of the fullscreen video layer. So once our fullscreen
304         transition animation completes, remove the mask layer entirely from our clipping layer.
305         This means it needs to be re-created and added when entering fullscreen, rather than just
306         at initialization time.
307
308         * UIProcess/mac/WKFullScreenWindowController.mm:
309         (-[WKFullScreenWindowController initWithWindow:webView:]):
310         (-[WKFullScreenWindowController finishedEnterFullScreenAnimation:]):
311         (-[WKFullScreenWindowController _startEnterFullScreenAnimationWithDuration:]):
312
313 2015-05-07  Martin Robinson  <mrobinson@igalia.com>
314
315         [GTK] All spell checking layout tests fail
316         https://bugs.webkit.org/show_bug.cgi?id=144648
317
318         Reviewed by Carlos Garcia Campos.
319
320         Simplify and complete the GTK+ spell-checking implementation. Instead of using
321         the EFL/GTK+ only WKTextChecker interface, directly implement Enchant spell-checking
322         in TextCheckerGtk. The per-context spell checking API is an illusion, since all
323         WKTextChecker implementations will adjust the same singleton. This can be a first step
324         toward removing it entirely.
325
326         Also complete the implementation of the TextChecker interface by duplicating the EFL code,
327         which reuses other methods in the same class. Eventually this duplication will collapse,
328         once GTK+ and EFL can share an Enchant implementation.
329
330         * PlatformGTK.cmake:
331         * UIProcess/API/gtk/WebKitPrivate.h:
332         * UIProcess/API/gtk/WebKitTextChecker.cpp: Removed.
333         * UIProcess/API/gtk/WebKitTextChecker.h: Removed.
334         * UIProcess/API/gtk/WebKitWebContext.cpp: Remove WebTextChecker usage and
335         replace it with calls directly to the TextChecker singleton via static methods.
336         * UIProcess/TextChecker.h:
337         * UIProcess/gtk/TextCheckerGtk.cpp: Move the WebTextChecker enchant implementation
338         here and reuse the EFL version of WebKit::TextChecker::requestCheckingOfString.
339         Also initialize languages properly when building for developer builds. This
340         allows WebKitTestRunner to work even when it doesn't explicitly set the languages.
341
342 2015-05-07  Ada Chan  <adachan@apple.com>
343
344         Fix a couple of cases where the backForwardListState's currentIndex is not set correctly in WebBackForwardList::backForwardListState().
345         https://bugs.webkit.org/show_bug.cgi?id=144666
346
347         Reviewed by Darin Adler.
348
349         * UIProcess/WebBackForwardList.cpp:
350         (WebKit::WebBackForwardList::backForwardListState):
351         If the first item is filtered out and the currentIndex is 0, don't decrement currentIndex.
352         If all the items are filtered out, set currentIndex to the uninitialized value.
353
354 2015-05-07  Csaba Osztrogonác  <ossy@webkit.org>
355
356         [WK2] Remove Windows cruft
357         https://bugs.webkit.org/show_bug.cgi?id=144745
358
359         Reviewed by Darin Adler.
360
361         * NetworkProcess/soup/NetworkProcessSoup.cpp:
362         (WebKit::getMemorySize):
363         * Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp:
364         (IPC::ArgumentCoder<WebCore::GraphicsSurfaceToken>::encode):
365         (IPC::ArgumentCoder<WebCore::GraphicsSurfaceToken>::decode):
366         * WebProcess/soup/WebProcessSoup.cpp:
367         (WebKit::getMemorySize):
368
369 2015-05-07  Carlos Garcia Campos  <cgarcia@igalia.com>
370
371         REGRESSION(r182032): [GTK] Production build is broken after r182032
372         https://bugs.webkit.org/show_bug.cgi?id=144736
373
374         Reviewed by Martin Robinson.
375
376         The problem is that r182032 moved the NetworkProcess sources from
377         WebKit2 sources to NetworkProcess sources. That's not a problem
378         for developer builds where all internal symbols are exported, but
379         doesn't work for production builds because all those internal
380         symbols are private.
381
382         * CMakeLists.txt: Use a different name for common network process
383         sources variable.
384         * PlatformMac.cmake: Append common network process sources to the
385         network process source list for Mac.
386
387 2015-05-07  Dan Bernstein  <mitz@apple.com>
388
389         <rdar://problem/19317140> [Xcode] Remove usage of AspenFamily.xcconfig in Source/
390         https://bugs.webkit.org/show_bug.cgi?id=144727
391
392         Reviewed by Darin Adler.
393
394         * Configurations/Base.xcconfig: Don’t include AspenFamily.xcconfig, and define
395         INSTALL_PATH_PREFIX and LD_DYLIB_INSTALL_NAME for the iOS 8.x Simulator.
396         * Configurations/WebKit2.xcconfig: Define INSTALL_PATH_ACTUAL and let INSTALL_PATH be
397         derived from it and INSTALL_PATH_PREFIX. Don’t override DYLIB_INSTALL_NAME_BASE for iOS,
398         because we define LD_DYLIB_INSTALL_NAME directly where needed.
399
400 2015-05-07  Carlos Garcia Campos  <cgarcia@igalia.com>
401
402         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.9.1 release.
403
404         * gtk/NEWS: Add release notes for 2.9.1.
405
406 2015-05-07  Carlos Garcia Campos  <cgarcia@igalia.com>
407
408         [GTK] Remove dock button from Web Inspector window
409         https://bugs.webkit.org/show_bug.cgi?id=144728
410
411         Reviewed by Sergio Villar Senin.
412
413         We added the dock buttons to the headerbar, because they were
414         removed from the inspector toolbar, but with the new tabbed
415         design, the dock buttons are back in the toolbar and look redundant.
416
417         * UIProcess/WebInspectorProxy.h:
418         * UIProcess/gtk/WebInspectorProxyGtk.cpp:
419         (WebKit::WebInspectorProxy::createInspectorWindow):
420         (WebKit::WebInspectorProxy::platformAttachAvailabilityChanged):
421         (WebKit::WebInspectorProxy::dockButtonClicked): Deleted.
422
423 2015-05-06  Jer Noble  <jer.noble@apple.com>
424
425         [WK2][Fullscreen] Elements whose children extend beyond their bounds are clipped in fullscreen mode.
426         https://bugs.webkit.org/show_bug.cgi?id=144716
427
428         Reviewed by Darin Adler.
429
430         We create a mask animation for the transition between windowed and fullscreen modes, on the
431         assumption that the element being taken into fullscreen mode does not have visible children
432         who extend beyond that elements bounds. This assumption breaks down in the case where div
433         with absolutely positioned children is taken fullscreen. While we can't necessarily make the
434         transition look correct in this case, we can remove the mask after the transition completes.
435
436         * UIProcess/mac/WKFullScreenWindowController.mm:
437         (-[WKFullScreenWindowController finishedEnterFullScreenAnimation:]):
438         * WebProcess/MediaCache/WebMediaKeyStorageManager.cpp:
439         (WebKit::removeAllMediaKeyStorageForOriginPath):
440
441 2015-05-06  Jinwoo Jeong  <jw00.jeong@samsung.com>
442
443         Fix a build break on EFL debug build
444         https://bugs.webkit.org/show_bug.cgi?id=144654
445
446         Reviewed by Gyuyoung Kim.
447
448         No new tests, just build fix.
449
450         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
451         (WebKit::CoordinatedGraphicsScene::paintToCurrentGLContext):
452         (WebKit::CoordinatedGraphicsScene::paintToGraphicsContext):
453
454 2015-05-06  Daniel Bates  <dabates@apple.com>
455
456         [iOS][WK2] Pause/resume database thread when UIProcess enters/leaves the background
457         https://bugs.webkit.org/show_bug.cgi?id=144657
458         <rdar://problem/18894598>
459
460         Reviewed by Andy Estes.
461
462         Pause and resume the database thread when the UIProcess enters and leaves the background,
463         respectively, so that we avoid WebProcess termination due to holding a locked SQLite
464         database file when the WebProcess is suspended. This behavior matches the analagous
465         behavior in Legacy WebKit.
466
467         * UIProcess/WebPageProxy.h:
468         * UIProcess/ios/WKContentView.mm:
469         (-[WKContentView _applicationDidEnterBackground:]): Call WebPageProxy::applicationDidEnterBackground()
470         when the UIProcess enters the background.
471         * UIProcess/ios/WebPageProxyIOS.mm:
472         (WebKit::WebPageProxy::applicationDidEnterBackground): Added; notify the WebProcess to pause the database thread.
473         We temporarily take out background assertion on the WebProcess before sending this notification to ensure that the
474         WebProcess is running to receive it. We'll release this assertion when the WebProcess replies that it received the
475         notification.
476         * WebProcess/WebCoreSupport/WebDatabaseManager.cpp:
477         (WebKit::WebDatabaseManager::setPauseAllDatabases): Added; turns around and calls DatabaseManager::setPauseAllDatabases().
478         * WebProcess/WebCoreSupport/WebDatabaseManager.h:
479         * WebProcess/WebPage/WebPage.h:
480         * WebProcess/WebPage/WebPage.messages.in: Add message ApplicationDidEnterBackground(). Also,
481         add empty lines to help demarcate this message and the other UIKit application lifecycle-related
482         messages from the rest of the list of messages.
483         * WebProcess/WebPage/ios/WebPageIOS.mm:
484         (WebKit::WebPage::applicationWillEnterForeground): Resume the database thread.
485         (WebKit::WebPage::applicationDidEnterBackground): Pause the database thread.
486
487 2015-05-06  Ryuan Choi  <ryuan.choi@navercorp.com>
488
489         [EFL] ewk_view_page_contents_get() API test is flaky
490         https://bugs.webkit.org/show_bug.cgi?id=144683
491
492         Reviewed by Gyuyoung Kim.
493
494         Callback of WKPageGetContentsAsMHTMLData contains WKData which does not contain null terminated character.
495
496         * UIProcess/API/efl/ewk_view.cpp: Pass the data of string instead of WKData directly.
497         (ewkViewPageContentsAsMHTMLCallback):
498
499 2015-05-06  Joseph Pecoraro  <pecoraro@apple.com>
500
501         Web Inspector: Docking Toolbar Buttons do not respect Docking Availability
502         https://bugs.webkit.org/show_bug.cgi?id=144714
503
504         Reviewed by Timothy Hatcher.
505
506         * UIProcess/WebInspectorProxy.cpp:
507         (WebKit::WebInspectorProxy::createInspectorPage):
508         (WebKit::WebInspectorProxy::attachAvailabilityChanged):
509         * WebProcess/WebPage/WebInspectorUI.cpp:
510         (WebKit::WebInspectorUI::setDockingUnavailable):
511         * WebProcess/WebPage/WebInspectorUI.h:
512         * WebProcess/WebPage/WebInspectorUI.messages.in:
513         When docking availability changes, inform the inspector page
514         so it can respond by updating its UI.
515
516 2015-05-06  Joonghun Park  <jh718.park@samsung.com>
517
518         [WK2] Simplify AsyncRequestImpl::ArgumentType parameters
519         https://bugs.webkit.org/show_bug.cgi?id=144689
520
521         Reviewed by Darin Adler.
522
523         Remove duplicated typename and ::type from AsyncRequestImpl related
524         function parameters.
525
526         * Shared/AsyncRequest.h:
527
528 2015-05-06  Commit Queue  <commit-queue@webkit.org>
529
530         Unreviewed, rolling out r183894.
531         https://bugs.webkit.org/show_bug.cgi?id=144719
532
533         crashes on mavericks (Requested by dino on #webkit).
534
535         Reverted changeset:
536
537         "Handle backdrop views that have to tile"
538         https://bugs.webkit.org/show_bug.cgi?id=142317
539         http://trac.webkit.org/changeset/183894
540
541 2015-05-06  Brady Eidson  <beidson@apple.com>
542
543         Addition review followup for:
544         Crash executing null AsyncRequest in IDB code.
545         <rdar://problem/18854856> and https://bugs.webkit.org/show_bug.cgi?id=144715
546
547         Reviewed by Darin Adler.
548
549         This patch adds a layer on top of the UniqueIDBDatabase request map to catch this coding mistake in the future. 
550  
551          * DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:
552         (WebKit::UniqueIDBDatabase::didCompleteBoolRequest): Get rid of the ASSERT and the temporary variable,
553           make it a single line which reads better.
554         (WebKit::UniqueIDBDatabase::didPutRecordInBackingStore): Ditto.
555         (WebKit::UniqueIDBDatabase::didGetRecordFromBackingStore): Ditto.
556         (WebKit::UniqueIDBDatabase::didOpenCursorInBackingStore): Ditto.
557         (WebKit::UniqueIDBDatabase::didAdvanceCursorInBackingStore): Ditto.
558         (WebKit::UniqueIDBDatabase::didIterateCursorInBackingStore): Ditto.
559         (WebKit::UniqueIDBDatabase::didCountInBackingStore): Ditto.
560         (WebKit::UniqueIDBDatabase::didDeleteRangeInBackingStore): Ditto.
561         * DatabaseProcess/IndexedDB/UniqueIDBDatabase.h: Ditto.
562
563         Add the class AsyncRequestMap which shadows a HashMap but does aggressive runtime checks
564         in ::take() to make sure the same request was not dispatched twice in a row, and makes sure we
565         never try to execute a null AsyncRequest by way of a RELEASE_ASSERT.
566         * Shared/AsyncRequest.h:
567         (WebKit::AsyncRequestMap::AsyncRequestMap):
568         (WebKit::AsyncRequestMap::take):
569         (WebKit::AsyncRequestMap::add):
570         (WebKit::AsyncRequestMap::clear):
571         (WebKit::AsyncRequestMap::values):
572
573 2015-05-06  Brady Eidson  <beidson@apple.com>
574
575         Crash executing null AsyncRequest in IDB code.
576         <rdar://problem/18854856> and https://bugs.webkit.org/show_bug.cgi?id=144715
577
578         Reviewed by Darin Adler.
579
580         When UniqueIDBDatabase fails to execute an operation on the database work queue it usually
581         dispatches an AsyncRequest ID back to the main thread with an error callback.
582
583         For two of its operations it would then also dispatch the success callback.
584
585         In those cases the main thread would first take the AsyncRequest for the error callback out
586         of a map and then execute it.
587
588         It would then try to take the same AsyncRequest out of the map again, fail to do so, then
589         execute a null AsyncRequest.
590
591         This patch fixes the two functions to not dispatch both an error and success callback.
592
593         * DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:
594         (WebKit::UniqueIDBDatabase::countInBackingStore): Return after dispatching the error callback.
595         (WebKit::UniqueIDBDatabase::deleteRangeInBackingStore): Ditto.
596
597 2015-05-06  Dean Jackson  <dino@apple.com>
598
599         Handle backdrop views that have to tile
600         https://bugs.webkit.org/show_bug.cgi?id=142317
601         <rdar://problem/20049088>
602
603         Reviewed by Simon Fraser.
604
605         Add some better logging for custom appearance.
606
607         * Shared/mac/RemoteLayerTreeTransaction.mm:
608         (WebKit::RemoteLayerTreeTextStream::operator<<):
609
610 2015-05-06  Chris Dumez  <cdumez@apple.com>
611
612         Disable network cache efficacy logging
613         https://bugs.webkit.org/show_bug.cgi?id=144703
614         <rdar://problem/20439143>
615
616         Reviewed by Andreas Kling.
617
618         Disable network cache efficacy logging by default as we have sufficient
619         data for now.
620
621         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
622         (WebKit::registerUserDefaultsIfNeeded):
623
624 2015-05-06  Timothy Horton  <timothy_horton@apple.com>
625
626         Fix the build.
627
628         * UIProcess/mac/WKViewLayoutStrategy.mm:
629         (-[WKViewDynamicSizeWithMinimumViewSizeLayoutStrategy updateLayout]):
630
631 2015-05-06  Dan Bernstein  <mitz@apple.com>
632
633         No way to get a WKWebProcessPlugInFrame’s parent frame
634         https://bugs.webkit.org/show_bug.cgi?id=144705
635
636         Reviewed by Sam Weinig.
637
638         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.mm:
639         (-[WKWebProcessPlugInFrame _parentFrame]): Added this getter.
640         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFramePrivate.h: Declared new
641         _parentFrame property.
642
643 2015-05-06  Timothy Horton  <timothy_horton@apple.com>
644
645         Fix the build.
646
647         * UIProcess/mac/WKViewLayoutStrategy.mm:
648         (-[WKViewDynamicSizeWithMinimumViewSizeLayoutStrategy updateLayout]):
649
650 2015-04-02  Myles C. Maxfield  <mmaxfield@apple.com>
651
652         Introducing the Platform Abstraction Layer (PAL)
653         https://bugs.webkit.org/show_bug.cgi?id=143358
654
655         Reviewed by Simon Fraser.
656
657         * Configurations/FeatureDefines.xcconfig: Updated
658
659 2015-05-05  Carlos Garcia Campos  <cgarcia@igalia.com>
660
661         [GTK][WK2] The WebKit network disk cache is not enabled
662         https://bugs.webkit.org/show_bug.cgi?id=142821
663
664         Reviewed by Martin Robinson.
665
666         Enable NetworkCache for the GTK+ port.
667
668         * config.h:
669
670 2015-05-06  Ryuan Choi  <ryuan.choi@navercorp.com>
671
672         [EFL] Remove redudant condition in ViewClientEfl::didChangeViewportAttributes
673         https://bugs.webkit.org/show_bug.cgi?id=144672
674
675         Reviewed by Gyuyoung Kim.
676
677         ViewClientEfl::didChangeViewportAttributes is always called when fixed layout is disabled.
678
679         * UIProcess/efl/ViewClientEfl.cpp:
680         (WebKit::ViewClientEfl::didChangeViewportAttributes):
681         Removes condition that checks whether fixed layout is enabled.
682
683 2015-05-05  Alexey Proskuryakov  <ap@apple.com>
684
685         NetworkResourceLoader::cleanup() should clear ResourceHandle client pointer.
686         https://bugs.webkit.org/show_bug.cgi?id=144641
687         rdar://problem/20250960
688
689         Reviewed by David Kilzer.
690
691         * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::cleanup):
692         Clear the client pointer.
693
694         * Shared/Authentication/AuthenticationManager.cpp:
695         (WebKit::AuthenticationManager::useCredentialForChallenge):
696         (WebKit::AuthenticationManager::continueWithoutCredentialForChallenge):
697         (WebKit::AuthenticationManager::cancelChallenge):
698         (WebKit::AuthenticationManager::performDefaultHandling):
699         (WebKit::AuthenticationManager::rejectProtectionSpaceAndContinue):
700         Updated comments, which were not accurate, at least on Mac.
701
702 2015-05-05  Tim Horton  <timothy_horton@apple.com>
703
704         Views get stuck with viewScale < 1 after switching from DynamicSizeWithMinimumViewSize to ViewSize
705         https://bugs.webkit.org/show_bug.cgi?id=144656
706
707         Reviewed by Dan Bernstein.
708
709         * UIProcess/mac/WKViewLayoutStrategy.mm:
710         (-[WKViewDynamicSizeWithMinimumViewSizeLayoutStrategy willChangeLayoutStrategy]):
711         Reset the viewScale when we leave the DynamicSizeWithMinimumViewSize strategy.
712
713 2015-05-05  Tim Horton  <timothy_horton@apple.com>
714
715         Fix the build.
716
717         * Platform/mac/LayerHostingContext.mm:
718         (WebKit::LayerHostingContext::setFencePort):
719
720 2015-05-05  Tim Horton  <timothy_horton@apple.com>
721
722         Fix the build.
723
724         * UIProcess/mac/WKViewLayoutStrategy.mm:
725         (-[WKViewDynamicSizeWithMinimumViewSizeLayoutStrategy updateLayout]):
726
727 2015-05-05  Timothy Horton  <timothy_horton@apple.com>
728
729         Add a layout mode for computing fixed layout size from a minimum size
730         https://bugs.webkit.org/show_bug.cgi?id=144610
731         <rdar://problem/19790341>
732
733         Reviewed by Simon Fraser.
734
735         Add a layout mode where WebKit determines the layout size with a set of
736         (still in flux) heuristics, trying hard to keep the page usable below a
737         particular client-defined threshold view size.
738
739         This can mean that WebKit will start scaling down the page inside the view
740         to make the whole page fit, using the viewScale mechanism.
741
742         * UIProcess/API/C/WKLayoutMode.h:
743         * UIProcess/API/Cocoa/_WKLayoutMode.h:
744         Add the new layout mode, and documentation for the two complicated ones.
745         
746         * UIProcess/API/Cocoa/WKWebView.mm:
747         (-[WKWebView _layoutMode]):
748         (-[WKWebView _setLayoutMode:]):
749         (-[WKWebView _setViewScale:]):
750         (-[WKWebView _setMinimumViewSize:]):
751         (-[WKWebView _minimumViewSize]):
752         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
753         Forward the layoutMode and viewScale parameters to WKView if we have one.
754
755         * UIProcess/API/Cocoa/WKViewPrivate.h:
756         * UIProcess/API/mac/WKView.mm:
757         (-[WKView dealloc]):
758         (-[WKView viewWillStartLiveResize]):
759         (-[WKView viewDidEndLiveResize]):
760         (-[WKView setFrameSize:]):
761         (-[WKView initWithFrame:processPool:configuration:webView:]):
762         (-[WKView disableFrameSizeUpdates]):
763         (-[WKView enableFrameSizeUpdates]):
764         (-[WKView frameSizeUpdatesDisabled]):
765         (-[WKView _layoutMode]):
766         (-[WKView _setLayoutMode:]):
767         (-[WKView _setViewScale:]):
768         (-[WKView _setMinimumViewSize:]):
769         (-[WKView _minimumViewSize]):
770         Store the minimum view size, and update the fixed layout size if needed.
771
772         (-[WKView _updateAutomaticallyComputedFixedLayoutSize]): Deleted.
773         (-[WKView _setAutomaticallyComputesFixedLayoutSizeFromViewScale:]): Deleted.
774         (-[WKView _automaticallyComputesFixedLayoutSizeFromViewScale]): Deleted.
775         Store the WKLayoutMode on the WKViewLayoutStrategy instead of having a
776         bunch of things like _automaticallyComputesFixedLayoutSizeFromViewScale.
777
778         * UIProcess/API/mac/WKViewInternal.h:
779
780         * UIProcess/mac/WKViewLayoutStrategy.h: Added.
781         * UIProcess/mac/WKViewLayoutStrategy.mm: Added.
782         (+[WKViewLayoutStrategy layoutStrategyWithPage:view:mode:]):
783         (-[WKViewLayoutStrategy initWithPage:view:mode:]):
784         (-[WKViewLayoutStrategy willDestroyView:]):
785         (-[WKViewLayoutStrategy layoutMode]):
786         (-[WKViewLayoutStrategy updateLayout]):
787         (-[WKViewLayoutStrategy disableFrameSizeUpdates]):
788         (-[WKViewLayoutStrategy enableFrameSizeUpdates]):
789         (-[WKViewLayoutStrategy frameSizeUpdatesDisabled]):
790         (-[WKViewLayoutStrategy didChangeViewScale]):
791         (-[WKViewLayoutStrategy didChangeMinimumViewSize]):
792         (-[WKViewLayoutStrategy willStartLiveResize]):
793         (-[WKViewLayoutStrategy didEndLiveResize]):
794         (-[WKViewLayoutStrategy didChangeFrameSize]):
795         (-[WKViewLayoutStrategy willChangeLayoutStrategy]):
796         (-[WKViewViewSizeLayoutStrategy initWithPage:view:mode:]):
797         (-[WKViewViewSizeLayoutStrategy updateLayout]):
798         (-[WKViewFixedSizeLayoutStrategy initWithPage:view:mode:]):
799         (-[WKViewFixedSizeLayoutStrategy updateLayout]):
800         (-[WKViewDynamicSizeComputedFromViewScaleLayoutStrategy initWithPage:view:mode:]):
801         (-[WKViewDynamicSizeComputedFromViewScaleLayoutStrategy updateLayout]):
802         (-[WKViewDynamicSizeComputedFromViewScaleLayoutStrategy didChangeViewScale]):
803         (-[WKViewDynamicSizeComputedFromViewScaleLayoutStrategy didChangeFrameSize]):
804         Move the existing layout strategies from WKView into WKViewLayoutStrategy subclasses.
805
806         (-[WKViewDynamicSizeWithMinimumViewSizeLayoutStrategy initWithPage:view:mode:]):
807         (-[WKViewDynamicSizeWithMinimumViewSizeLayoutStrategy updateLayout]):
808         (-[WKViewDynamicSizeWithMinimumViewSizeLayoutStrategy didChangeMinimumViewSize]):
809         (-[WKViewDynamicSizeWithMinimumViewSizeLayoutStrategy willStartLiveResize]):
810         (-[WKViewDynamicSizeWithMinimumViewSizeLayoutStrategy didEndLiveResize]):
811         While in live resize with the new layout mode, disable frame size updates.
812         The new layout mode will do a live scale during part of the resize, and
813         we don't always want to send the new view size to the Web process.
814
815         (-[WKViewDynamicSizeWithMinimumViewSizeLayoutStrategy didChangeFrameSize]):
816         (-[WKViewDynamicSizeWithMinimumViewSizeLayoutStrategy willChangeLayoutStrategy]):
817         While in the new layout mode, maintain the viewScale as the minimum of the
818         scale required to fit the current view frame size inside the minimumViewSize.
819         If no scaling is required, carry on as usual, pushing the new view frame size
820         to the DrawingArea and on to the Web process.
821         If scaling is required, apply a transform to the view in the UI process,
822         until the live resize completes, in which case we send a fenced viewScale
823         adjustment to the Web process (so that the tiles paint at the new viewScale
824         synchronized with the removal of the transform in the UI process).
825
826         * UIProcess/WebPageProxy.cpp:
827         (WebKit::WebPageProxy::scaleViewFenced):
828         * UIProcess/WebPageProxy.h:
829         * WebProcess/WebPage/DrawingArea.h:
830         (WebKit::DrawingArea::addFence):
831         (WebKit::DrawingArea::acceleratedAnimationDidEnd): Deleted.
832         * WebProcess/WebPage/WebPage.cpp:
833         (WebKit::WebPage::scaleViewAndUpdateGeometryFenced):
834         * WebProcess/WebPage/WebPage.h:
835         * WebProcess/WebPage/WebPage.messages.in:
836         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
837         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
838         (WebKit::TiledCoreAnimationDrawingArea::addFence):
839         Add scaleViewAndUpdateGeometryFenced and the ability to install CoreAnimation fences on
840         TiledCoreAnimationDrawingArea's CAContext.
841
842         Add the ability to send updateGeometry out-of-band, so that
843         we can send it synchronously inside the message along with the CA fence.
844         We have to both change the viewScale and updateGeometry simultaneously
845         in the same CA commit that we install the fence into, in order to ensure
846         that there is no flash.
847
848 2015-05-05  Alex Christensen  <achristensen@webkit.org>
849
850         [Content Extensions] Release input NSString when finished copying it.
851         https://bugs.webkit.org/show_bug.cgi?id=144642
852
853         Reviewed by Brian Weinstein.
854
855         * UIProcess/API/Cocoa/_WKUserContentExtensionStore.h:
856         * UIProcess/API/Cocoa/_WKUserContentExtensionStore.mm:
857         (-[_WKUserContentExtensionStore compileContentExtensionForIdentifier:encodedContentExtension:completionHandler:]):
858
859 2015-05-05  Alex Christensen  <achristensen@webkit.org>
860
861         [Content Extensions] Use less memory to store the json input.
862         https://bugs.webkit.org/show_bug.cgi?id=144604
863
864         Reviewed by Benjamin Poulain.
865
866         * UIProcess/API/APIUserContentExtensionStore.cpp:
867         (API::compiledToFile):
868         (API::UserContentExtensionStore::compileContentExtension):
869         * UIProcess/API/APIUserContentExtensionStore.h:
870         Don't copy strings as much or keep them alive after done using them.
871
872 2015-05-04  Alex Christensen  <achristensen@webkit.org>
873
874         [Content Extensions] Use less memory when writing byte code to file
875         https://bugs.webkit.org/show_bug.cgi?id=144602
876
877         Reviewed by Darin Adler.
878
879         * UIProcess/API/APIUserContentExtensionStore.cpp:
880         (API::decodeContentExtensionMetaData):
881         (API::writeDataToFile):
882         (API::compiledToFile):
883         (API::createExtension):
884         Compile and write each DFA to file, then come back and write the header when finalizing.
885         Also don't copy the DFA bytecode. This way, we don't need to keep more than one DFA's
886         bytecode in memory at a time.
887
888 2015-05-05  Sungmann Cho  <sungmann.cho@navercorp.com>
889
890         Make all FrameLoadState data members private.
891         https://bugs.webkit.org/show_bug.cgi?id=144562
892
893         Reviewed by Darin Adler.
894
895         Previously, all of the data members in FrameLoadState were public and accessed directly
896         from outside the class. But these should all be private as noted in FrameLoadState.h
897         for better encapsulation.
898
899         No new tests, no behavior change.
900
901         * UIProcess/API/C/WKFrame.cpp:
902         (WKFrameGetFrameLoadState):
903         * UIProcess/FrameLoadState.h:
904         (WebKit::FrameLoadState::state):
905         (WebKit::FrameLoadState::url):
906         (WebKit::FrameLoadState::provisionalURL):
907         (WebKit::FrameLoadState::unreachableURL):
908         * UIProcess/WebFrameProxy.h:
909         (WebKit::WebFrameProxy::url):
910         (WebKit::WebFrameProxy::provisionalURL):
911         (WebKit::WebFrameProxy::unreachableURL):
912
913 2015-05-05  Alexey Proskuryakov  <ap@apple.com>
914
915         Crashes in SandboxExtension::consumePermanently when uploading
916         https://bugs.webkit.org/show_bug.cgi?id=144611
917         rdar://problem/10156710
918
919         Reviewed by Darin Adler.
920
921         This only fixes the crashes, uploading still won't work.
922         Added null checks and some logging that may help us get to the root cause eventually.
923
924         * Shared/SandboxExtension.h:
925         (WebKit::SandboxExtension::createHandle):
926         (WebKit::SandboxExtension::createHandleForReadWriteDirectory):
927         * Shared/mac/SandboxExtensionMac.mm:
928         (WebKit::SandboxExtension::createHandle):
929         (WebKit::SandboxExtension::createHandleForReadWriteDirectory):
930         * UIProcess/WebPageProxy.cpp:
931         (WebKit::WebPageProxy::didChooseFilesForOpenPanel):
932         * WebProcess/WebPage/WebPage.cpp:
933         (WebKit::WebPage::extendSandboxForFileFromOpenPanel):
934
935 2015-05-05  Csaba Osztrogonác  <ossy@webkit.org>
936
937         Remove TextureMapperImageBuffer
938         https://bugs.webkit.org/show_bug.cgi?id=143561
939
940         Reviewed by Žan Doberšek.
941
942         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
943         (WebKit::CoordinatedGraphicsScene::paintToCurrentGLContext):
944         * WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp:
945         (WebKit::LayerTreeHostGtk::setNativeSurfaceHandleForCompositing):
946
947 2015-05-05  Carlos Garcia Campos  <cgarcia@igalia.com>
948
949         [SOUP] Network Cache: IOChannel operations are not sent to the right thread
950         https://bugs.webkit.org/show_bug.cgi?id=144542
951
952         Reviewed by Darin Adler.
953
954         We are ignoring the given WorkQueue and running the async
955         operations in the current thread. Check the given WorkQueue
956         instead and schedule the operation to the given queue. If the
957         given queue is nullptr, which means the operation should be run in
958         the main context, the operation is run directly if the current
959         context is the main one or sent to the main context using a
960         GMainLoopSource.
961
962         Fixes crashes due to asserts when running disk-cache layout tests
963         in a Debug build.
964
965         * NetworkProcess/cache/NetworkCacheIOChannel.h:
966         * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:
967         (WebKit::NetworkCache::runTaskInQueue):
968         (WebKit::NetworkCache::IOChannel::read):
969         (WebKit::NetworkCache::IOChannel::readSync):
970         (WebKit::NetworkCache::IOChannel::write):
971
972 2015-05-04  Dan Bernstein  <mitz@apple.com>
973
974         WebKit always goes through LaunchServices for main frame navigation actions
975         https://bugs.webkit.org/show_bug.cgi?id=144608
976
977         Reviewed by Tim Horton.
978
979         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h: Defined
980         _WKNavigationActionPolicyAllowWithoutTryingAppLink.
981         * UIProcess/Cocoa/NavigationState.mm:
982         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction): If the policy
983         is _WKNavigationActionPolicyAllowWithoutTryingAppLink, don’t go through tryAppLink.
984
985 2015-05-04  Enrica Casucci  <enrica@apple.com>
986
987         [iOS WK2] editorState should include information about selection clipping rectangle.
988         https://bugs.webkit.org/show_bug.cgi?id=144603
989         rdar://problem/20521252
990
991         Reviewed by Chris Dumez.
992
993         Adding selectionClipRect to the post-layout portion of EditorState.
994         This way we can compute the selection clipping rectangle based on
995         up-to-date information instead of using the rectangle provided when
996         then element was first focused.
997
998         * Shared/EditorState.cpp:
999         (WebKit::EditorState::PostLayoutData::encode):
1000         (WebKit::EditorState::PostLayoutData::decode):
1001         * Shared/EditorState.h:
1002         * UIProcess/ios/WKContentViewInteraction.mm:
1003         (-[WKContentView _selectionClipRect]):
1004         * WebProcess/WebPage/ios/WebPageIOS.mm:
1005         (WebKit::WebPage::platformEditorState):
1006
1007 2015-05-04  Antti Koivisto  <antti@apple.com>
1008
1009         Network Cache: Support time based cache clearing
1010         https://bugs.webkit.org/show_bug.cgi?id=144568
1011         <rdar://problem/19769820>
1012
1013         Reviewed by Andreas Kling.
1014
1015         Support clearing cache entries newer than given time only.
1016
1017         * NetworkProcess/cache/NetworkCache.cpp:
1018         (WebKit::NetworkCache::Cache::deleteDumpFile):
1019         (WebKit::NetworkCache::Storage::traverse):
1020
1021             Also fix thread safety of traverse handler function.
1022
1023         (WebKit::NetworkCache::Cache::clear):
1024
1025             Also add completion handler to support the API properly.
1026
1027         * NetworkProcess/cache/NetworkCache.h:
1028         * NetworkProcess/cache/NetworkCacheStorage.cpp:
1029         (WebKit::NetworkCache::Storage::clear):
1030         * NetworkProcess/cache/NetworkCacheStorage.h:
1031         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
1032         (WebKit::clearNSURLCache):
1033
1034             Factor to a function.
1035
1036         (WebKit::NetworkProcess::clearDiskCache):
1037
1038 2015-05-04  Zan Dobersek  <zdobersek@igalia.com>
1039
1040         [WTF] Remove Functional.h inclusions
1041         https://bugs.webkit.org/show_bug.cgi?id=144400
1042
1043         Reviewed by Darin Adler.
1044
1045         Remove unnecessary inclusions of the <wtf/Functional.h> header in WebKit2.
1046
1047         * Platform/IPC/unix/ConnectionUnix.cpp:
1048         * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm: Import the <objc/runtime.h>
1049         header that was previously indirectly included through the Functional.h header.
1050         * WebProcess/WebPage/DrawingArea.cpp:
1051
1052 2015-05-04  Csaba Osztrogonác  <ossy@webkit.org>
1053
1054         [ARM] Don't compare unsigned chars to EOF (-1)
1055         https://bugs.webkit.org/show_bug.cgi?id=144439
1056
1057         Reviewed by Geoffrey Garen.
1058
1059         * Shared/linux/WebMemorySamplerLinux.cpp:
1060         (WebKit::nextToken): Don't cast return value of fgetc() to char.
1061
1062 2015-05-04  Antti Koivisto  <antti@apple.com>
1063
1064         Remove NetworkResourceLoadScheduler
1065         https://bugs.webkit.org/show_bug.cgi?id=144550
1066
1067         Reviewed by Sam Weinig.
1068
1069         It doesn't really do anything.
1070
1071         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1072         (WebKit::NetworkConnectionToWebProcess::scheduleResourceLoad):
1073         (WebKit::NetworkConnectionToWebProcess::performSynchronousLoad):
1074         * NetworkProcess/NetworkProcess.cpp:
1075         (WebKit::NetworkProcess::getNetworkProcessStatistics):
1076         * NetworkProcess/NetworkProcess.h:
1077         (WebKit::NetworkProcess::networkResourceLoadScheduler): Deleted.
1078         * NetworkProcess/NetworkResourceLoadScheduler.cpp: Removed.
1079         * NetworkProcess/NetworkResourceLoadScheduler.h: Removed.
1080         * NetworkProcess/NetworkResourceLoader.cpp:
1081         (WebKit::NetworkResourceLoader::cleanup):
1082         * NetworkProcess/NetworkResourceLoader.h:
1083         (WebKit::NetworkResourceLoader::create):
1084         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
1085         (WebKit::initializeNetworkSettings):
1086
1087             Moved from NetworkResourceLoadSchedulerMac.mm.
1088
1089         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
1090         * NetworkProcess/mac/NetworkResourceLoadSchedulerMac.mm: Removed.
1091         * NetworkProcess/soup/NetworkResourceLoadSchedulerSoup.cpp: Removed.
1092         * WebKit2.xcodeproj/project.pbxproj:
1093
1094 2015-05-03  Alexey Proskuryakov  <ap@apple.com>
1095
1096         Crash in SandboxExtension::consume when uploading iWork -tef documents to iCloud
1097         https://bugs.webkit.org/show_bug.cgi?id=144509
1098         rdar://problem/18731910
1099
1100         Reviewed by Daniel Bates.
1101
1102         No test, because testRunner.beginDragWithFiles doesn't work in WKTR, and making
1103         it work is hard.
1104
1105         * Shared/BlobDataFileReferenceWithSandboxExtension.cpp:
1106         (WebKit::BlobDataFileReferenceWithSandboxExtension::prepareForFileAccess):
1107         (WebKit::BlobDataFileReferenceWithSandboxExtension::revokeFileAccess):
1108
1109 2015-05-03  Carlos Garcia Campos  <cgarcia@igalia.com>
1110
1111         [GTK][EFL] Unify platform display handling
1112         https://bugs.webkit.org/show_bug.cgi?id=144517
1113
1114         Reviewed by Martin Robinson.
1115
1116         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
1117         (webkitWebViewBaseRealize): Use PlatformDisplay::sharedDisplay()
1118         to checkt the display type.
1119         (webkitWebViewBaseCreateWebPage): Ditto.
1120         * UIProcess/cairo/BackingStoreCairo.cpp:
1121         (WebKit::BackingStore::createBackend): Pass the native X11 shared
1122         display to BackingStoreBackendCairoX11.
1123         * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:
1124         (WebKit::NetscapePlugin::x11HostDisplay): Return the native X11
1125         shared display.
1126
1127 2015-05-03  Carlos Garcia Campos  <cgarcia@igalia.com>
1128
1129         Unreviewed. Fix Debug build with NETWORK_CACHE enabled and CACHE_PARTITIONING disabled.
1130
1131         * NetworkProcess/cache/NetworkCache.cpp:
1132         (WebKit::NetworkCache::Cache::store):
1133
1134 2015-05-01  Dan Bernstein  <mitz@apple.com>
1135
1136         WebKit2 part of <rdar://problem/8636045> Back/forward navigation to an error page in Safari breaks the back-forward list
1137         https://bugs.webkit.org/show_bug.cgi?id=144501
1138
1139         Reviewed by Darin Adler.
1140
1141         * UIProcess/WebPageProxy.cpp:
1142         (WebKit::WebPageProxy::loadAlternateHTMLString): If this is called during
1143         didFailProvisionalLoadForFrame, send back the provisional URL captured at the time of
1144         failure.
1145         (WebKit::WebPageProxy::didFailProvisionalLoadForFrame): Get the provisioinal URL and keep
1146         it in new member variable m_failingProvisionalLoadURL for the duration of the client’s
1147         handling of this message.
1148         * UIProcess/WebPageProxy.h:
1149
1150         * UIProcess/WebPageProxy.messages.in: Added provisionalURL parameter to
1151         DidFailProvisionalLoadForFrame.
1152
1153         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1154         (WebKit::WebFrameLoaderClient::dispatchDidFailProvisionalLoad): Send the URL for this error
1155         to the UI process.
1156
1157         * WebProcess/WebPage/WebPage.cpp:
1158         (WebKit::WebPage::loadAlternateHTMLString): Temporarily restore the loader’s state to
1159         reflect the provisional load error being handled.
1160
1161         * WebProcess/WebPage/WebPage.h:
1162         * WebProcess/WebPage/WebPage.messages.in: Added provisionalLoadErrorURL parameter to
1163         LoadAlternateHTMLString.
1164
1165 2015-05-01  Martin Robinson  <mrobinson@igalia.com>
1166
1167         USE(...) macro should expect unprefixed variables
1168         https://bugs.webkit.org/show_bug.cgi?id=144454
1169
1170         Reviewed by Daniel Bates.
1171
1172         * Shared/API/c/WKBase.h: Replace all occurrences WTF_USE with USE.
1173         * WebKit2.xcodeproj/project.pbxproj: Ditto.
1174
1175 2015-05-01  Brady Eidson  <beidson@apple.com>
1176
1177         Add API to disable meta refreshes.
1178         <rdar://problem/20333198> and https://bugs.webkit.org/show_bug.cgi?id=144269
1179
1180         Reviewed by Alexey Proskuryakov.
1181
1182         Add a preference to enable/disable meta refreshes, enabled by default.
1183
1184         * Shared/WebPreferencesDefinitions.h:
1185         * UIProcess/API/C/WKPreferences.cpp:
1186         (WKPreferencesSetMetaRefreshEnabled):
1187         (WKPreferencesGetMetaRefreshEnabled):
1188         (WKPreferencesGetIgnoreViewportScalingConstraints): Deleted.
1189         * UIProcess/API/C/WKPreferencesRefPrivate.h:
1190         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1191         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
1192         * WebProcess/WebPage/WebPage.cpp:
1193         (WebKit::WebPage::updatePreferences):
1194
1195 2015-05-01  Antti Koivisto  <antti@apple.com>
1196
1197         Remove network process load serialization code
1198         https://bugs.webkit.org/show_bug.cgi?id=144448
1199
1200         Reviewed by Alexey Proskuryakov.
1201
1202         TestRunner.setSerializeHTTPLoads is used by a few tests but it is unnecessary
1203         with network process. We don't reorder loads anyway so test results are consistent.
1204         There or no other clients for this code.
1205
1206         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1207         (WebKit::NetworkConnectionToWebProcess::NetworkConnectionToWebProcess):
1208         (WebKit::NetworkConnectionToWebProcess::setSerialLoadingEnabled): Deleted.
1209         * NetworkProcess/NetworkConnectionToWebProcess.h:
1210         (WebKit::NetworkConnectionToWebProcess::isSerialLoadingEnabled): Deleted.
1211         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
1212         * NetworkProcess/NetworkProcess.cpp:
1213         (WebKit::NetworkProcess::getNetworkProcessStatistics):
1214         * NetworkProcess/NetworkResourceLoadScheduler.cpp:
1215         (WebKit::NetworkResourceLoadScheduler::scheduleLoader):
1216         (WebKit::NetworkResourceLoadScheduler::removeLoader):
1217         (WebKit::NetworkResourceLoadScheduler::loadsPendingCount): Deleted.
1218         * NetworkProcess/NetworkResourceLoadScheduler.h:
1219         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
1220         (WKBundleSetTabKeyCyclesThroughElements):
1221         (WKBundleSetSerialLoadingEnabled): Deleted.
1222         (WKBundleDispatchPendingLoadRequests): Deleted.
1223         * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
1224         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1225         (WebKit::InjectedBundle::setSerialLoadingEnabled): Deleted.
1226         (WebKit::InjectedBundle::dispatchPendingLoadRequests): Deleted.
1227
1228             Remove also this as it does nothing.
1229
1230         * WebProcess/Network/WebResourceLoadScheduler.cpp:
1231         (WebKit::WebResourceLoadScheduler::WebResourceLoadScheduler):
1232         (WebKit::WebResourceLoadScheduler::suspendPendingRequests):
1233         (WebKit::WebResourceLoadScheduler::resumePendingRequests):
1234
1235             Remove implementation, it does nothing.
1236
1237         (WebKit::WebResourceLoadScheduler::setSerialLoadingEnabled):
1238         * WebProcess/Network/WebResourceLoadScheduler.h:
1239
1240 2015-04-30  Timothy Horton  <timothy_horton@apple.com>
1241
1242         Remove long-deprecated unused WKView minimumLayoutWidth properties
1243         https://bugs.webkit.org/show_bug.cgi?id=144480
1244
1245         Reviewed by Alexey Proskuryakov.
1246
1247         * UIProcess/API/Cocoa/WKViewPrivate.h:
1248         * UIProcess/API/mac/WKView.mm:
1249         (-[WKView minimumLayoutWidth]): Deleted.
1250         (-[WKView setMinimumLayoutWidth:]): Deleted.
1251         (-[WKView minimumWidthForAutoLayout]): Deleted.
1252         (-[WKView setMinimumWidthForAutoLayout:]): Deleted.
1253         These were replaced with minimumSizeForAutoLayout long ago.
1254
1255 2015-04-30  Simon Fraser  <simon.fraser@apple.com>
1256
1257         Fixed elements end up in the middle of the view with pageScale < 1
1258         https://bugs.webkit.org/show_bug.cgi?id=144428
1259         rdar://problem/20404982
1260
1261         Reviewed by Tim Horton.
1262
1263         Encode/decode fixedElementsLayoutRelativeToFrame.
1264
1265         * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp:
1266         (ArgumentCoder<ScrollingStateFrameScrollingNode>::encode):
1267         (ArgumentCoder<ScrollingStateFrameScrollingNode>::decode):
1268
1269 2015-04-30  Tim Horton  <timothy_horton@apple.com>
1270
1271         Asynchronous (or timed-out synchronous) resize flashes white instead of page background color
1272         https://bugs.webkit.org/show_bug.cgi?id=144468
1273
1274         Reviewed by Simon Fraser and Dan Bernstein.
1275
1276         * UIProcess/API/mac/WKView.mm:
1277         (-[WKView _viewBackgroundColor]):
1278         (-[WKView updateLayer]):
1279         Use the pageExtendedBackgroundColor for the background color of the WKView,
1280         if we have one (and aren't using a transparent background). This means
1281         during asynchronous resize or other cases where the Web process isn't keeping
1282         up with the UI process during a resize, we'll see background color instead of white.
1283
1284 2015-04-30  Beth Dakin  <bdakin@apple.com>
1285
1286         Should choose UIScrollView indicatorStyle based on the document background color
1287         https://bugs.webkit.org/show_bug.cgi?id=144473
1288         -and corresponding-
1289         rdar://problem/19897699
1290
1291         Reviewed by Simon Fraser.
1292
1293         Update the indicator style whenever the background color changes.  
1294         * UIProcess/API/Cocoa/WKWebView.mm:
1295         (-[WKWebView _updateScrollViewBackground]):
1296
1297 2015-04-30  Enrica Casucci  <enrica@apple.com>
1298
1299         [iOS] tapping in the middle of a word in editable content should not select the word.
1300         https://bugs.webkit.org/show_bug.cgi?id=144421
1301         rdar://problem/20710948
1302
1303         Reviewed by Tim Horton.
1304
1305         Reverting to the original behavior.
1306
1307         * WebProcess/WebPage/ios/WebPageIOS.mm:
1308         (WebKit::WebPage::selectWithGesture):
1309
1310 2015-04-29  Hunseop Jeong  <hs85.jeong@samsung.com>
1311
1312         Fix the EFL build after r183595
1313         https://bugs.webkit.org/show_bug.cgi?id=144427
1314
1315         Reviewed by Gyuyoung Kim.
1316
1317         updateWheelEventTestTriggersIfNeeded() is guarded by #if ENABLE(CSS_SCROLL_SNAP) || ENABLE(RUBBER_BANDING).
1318
1319         * WebProcess/WebPage/EventDispatcher.cpp:
1320         (WebKit::updateWheelEventTestTriggersIfNeeded):
1321
1322 2015-04-29  Brent Fulgham  <bfulgham@apple.com>
1323
1324         Expand test infrastructure to support scrolling tests
1325         https://bugs.webkit.org/show_bug.cgi?id=143684
1326         <rdar://problem/20375516>
1327
1328         Reviewed by Simon Fraser.
1329
1330         Update test programs to activate (and deactivate) the new WheelEventTestTrigger logic.
1331
1332         * UIProcess/API/C/WKPage.cpp:
1333         (WKPageClearWheelEventTestTriggers): Added.
1334         * UIProcess/API/C/WKPage.h:
1335         * UIProcess/WebPageProxy.cpp:
1336         (WebKit::WebPageProxy::clearWheelEventTestTrigger): Added.
1337         * UIProcess/WebPageProxy.h:
1338         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
1339         (WKBundlePageStartMonitoringScrollOperations): Interact with WheelEventTestTrigger through
1340         the Page, rather than MainFrame.
1341         (WKBundlePageRegisterScrollOperationCompletionCallback): Ditto.
1342         * WebProcess/Plugins/PDF/PDFPlugin.mm:
1343         (WebKit::PDFPlugin::createScrollbar): Make sure scroll animator knows about any
1344         active test triggers.
1345         * WebPage/EventDispatcher.mm:
1346         (WebKit::EventDispatcher::wheelEvent): If the wheel event was passed to the scrolling thread,
1347         defer tests until a Scrolling Thread Sync has occurred.
1348         * WebPage/WebPage.cpp:
1349         (WebKit::WebPage::clearWheelEventTestTrigger): Added.
1350         * WebPage/WebPage.h:
1351         * WebPage/WebPage.message.in: Added ClearWheelEventTestTrigger message.
1352
1353 2015-04-29  Enrica Casucci  <enrica@apple.com>
1354
1355         Adding the ability to move selection by granularity on iOS.
1356         https://bugs.webkit.org/show_bug.cgi?id=144410
1357         rdar://problem/19213337
1358
1359         Reviewed by Benjamin Poulain.
1360
1361         This patch also correctly sets _usingGestureForSelection for all
1362         the functions that change the selection with a gesture.
1363         This way we make sure that the selection drawing is not delayed
1364         until the next time we paint.
1365
1366         * UIProcess/WebPageProxy.h:
1367         * UIProcess/ios/WKContentViewInteraction.mm:
1368         (-[WKContentView moveSelectionAtBoundary:inDirection:completionHandler:]):
1369         * UIProcess/ios/WebPageProxyIOS.mm:
1370         (WebKit::WebPageProxy::moveSelectionAtBoundaryWithDirection):
1371         * WebProcess/WebPage/WebPage.h:
1372         * WebProcess/WebPage/WebPage.messages.in:
1373         * WebProcess/WebPage/ios/WebPageIOS.mm:
1374         (WebKit::WebPage::moveSelectionAtBoundaryWithDirection):
1375
1376 2015-04-29  Tim Horton  <timothy_horton@apple.com>
1377
1378         UI process sometimes crashes under _takeViewSnapshot when the window is off-screen
1379         https://bugs.webkit.org/show_bug.cgi?id=144418
1380         <rdar://problem/20740278>
1381
1382         Reviewed by Alexey Proskuryakov.
1383
1384         * UIProcess/API/mac/WKView.mm:
1385         (-[WKView _takeViewSnapshot]):
1386         Null-check the array before checking if it has any items.
1387         If the window is off-screen, we can't snapshot it.
1388
1389 2015-04-29  Simon Fraser  <simon.fraser@apple.com>
1390
1391         Allow testing of plug-ins that handle wheel events.
1392         https://bugs.webkit.org/show_bug.cgi?id=144413
1393
1394         Reviewed by Tim Horton.
1395         
1396         Allow the Test Netscape Plug-in to pretend to handle wheel events,
1397         so layout tests can use it.
1398
1399         * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
1400         (WebKit::NetscapePluginModule::determineQuirks):
1401
1402 2015-04-29  Filip Pizlo  <fpizlo@apple.com>
1403
1404         JSTypeInfo should have an inline type flag to indicate if getCallData() has been overridden
1405         https://bugs.webkit.org/show_bug.cgi?id=144397
1406
1407         Reviewed by Andreas Kling.
1408
1409         If you override getCallData() and you want to be called a "function", then you need to use the
1410         new TypeOfShouldCallGetCallData flag.
1411
1412         * WebProcess/Plugins/Netscape/JSNPObject.h:
1413
1414 2015-04-29  Antti Koivisto  <antti@apple.com>
1415
1416         ResourceLoadPriority should be enum class
1417         https://bugs.webkit.org/show_bug.cgi?id=144326
1418
1419         Reviewed by Darin Adler.
1420
1421         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1422         (WebKit::NetworkConnectionToWebProcess::servePendingRequests): Deleted.
1423
1424             Remove this unused message.
1425
1426         * NetworkProcess/NetworkConnectionToWebProcess.h:
1427         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
1428         * NetworkProcess/cache/NetworkCache.cpp:
1429         (WebKit::NetworkCache::makeStoreDecision):
1430         (WebKit::NetworkCache::Cache::retrieve):
1431         * NetworkProcess/mac/NetworkResourceLoadSchedulerMac.mm:
1432         (WebKit::NetworkResourceLoadScheduler::platformInitializeNetworkSettings):
1433         * WebProcess/Network/WebResourceLoadScheduler.cpp:
1434         (WebKit::WebResourceLoadScheduler::servePendingRequests):
1435         * WebProcess/Network/WebResourceLoadScheduler.h:
1436
1437 2015-04-29  Myles C. Maxfield  <mmaxfield@apple.com>
1438
1439         [OS X] Use CTFontCreateForCSS instead of doing font search ourselves
1440         https://bugs.webkit.org/show_bug.cgi?id=132159
1441
1442         Reviewed by Darin Adler.
1443
1444         Add SPI to set the font whitelist.
1445
1446         * Shared/WebProcessCreationParameters.cpp:
1447         (WebKit::WebProcessCreationParameters::encode):
1448         (WebKit::WebProcessCreationParameters::decode):
1449         * Shared/WebProcessCreationParameters.h:
1450         * UIProcess/API/C/WKContext.cpp:
1451         (WKContextSetFontWhitelist):
1452         * UIProcess/API/C/WKContextPrivate.h:
1453         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1454         (WebKit::WebProcessPool::platformInitializeWebProcess):
1455         * UIProcess/WebProcessPool.cpp:
1456         (WebKit::WebProcessPool::setFontWhitelist):
1457         * UIProcess/WebProcessPool.h:
1458         * WebProcess/cocoa/WebProcessCocoa.mm:
1459         (WebKit::WebProcess::platformInitializeWebProcess):
1460
1461 2015-04-29  Martin Robinson  <mrobinson@igalia.com>
1462
1463         [CMake] [GTK] Organize and clean up unused CMake variables
1464         https://bugs.webkit.org/show_bug.cgi?id=144364
1465
1466         Reviewed by Gyuyoung Kim.
1467
1468         * PlatformGTK.cmake: Add variables specific to this project.
1469         * webkit2gtk-web-extension.pc.in: Hardcode the GTK+ API version. It rarely changes.
1470         * webkit2gtk.pc.in: Ditto.
1471
1472 2015-04-29  Carlos Garcia Campos  <cgarcia@igalia.com>
1473
1474         REGRESSION(r182573): [GTK] The default context menu contains an empty item since r182573
1475         https://bugs.webkit.org/show_bug.cgi?id=144388
1476
1477         Reviewed by Brady Eidson.
1478
1479         Move the WebContextMenuClient::shareMenuItem() implementation to
1480         platform files, since platforms not supporting share menu item
1481         should return a null ContextMenuIem instead.
1482
1483         * WebProcess/WebCoreSupport/WebContextMenuClient.cpp:
1484         (WebKit::WebContextMenuClient::shareMenuItem): Deleted.
1485         * WebProcess/WebCoreSupport/efl/WebContextMenuClientEfl.cpp:
1486         (WebKit::WebContextMenuClient::shareMenuItem):
1487         * WebProcess/WebCoreSupport/gtk/WebContextMenuClientGtk.cpp:
1488         (WebKit::WebContextMenuClient::shareMenuItem):
1489         * WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm:
1490         (WebKit::WebContextMenuClient::shareMenuItem):
1491
1492 2015-04-29  Carlos Garcia Campos  <cgarcia@igalia.com>
1493
1494         REGRESSION(r183467): [SOUP] isMainResource is no longer passed as resource load parameters to the network process
1495         https://bugs.webkit.org/show_bug.cgi?id=144381
1496
1497         Reviewed by Darin Adler.
1498
1499         A requester enum value is passed now as part of the
1500         ResourceRequest, but it's not encoded/decoded for soup.
1501
1502         * Shared/soup/WebCoreArgumentCodersSoup.cpp:
1503         (IPC::ArgumentCoder<ResourceRequest>::encodePlatformData): Encode requester.
1504         (IPC::ArgumentCoder<ResourceRequest>::decodePlatformData): Decode requester.
1505
1506 2015-04-28  Carlos Garcia Campos  <cgarcia@igalia.com>
1507
1508         [SOUP] Use xattrs to get/set the creation time of disk cache files
1509         https://bugs.webkit.org/show_bug.cgi?id=144251
1510
1511         Reviewed by Martin Robinson.
1512
1513         The network process disk cache uses the creation time to compute a
1514         worth value used to determine the order in which cached resources
1515         are deleted when the cache is shrunk. In some operating systems
1516         like Linux there's no st_birthtime in struct stat, but since cache
1517         files are always created and deleted by us, we could use a custom
1518         xattr to store and retrieve the creation time of cached resources.
1519
1520         * NetworkProcess/cache/NetworkCacheFileSystemPosix.h:
1521         (WebKit::NetworkCache::fileTimes):
1522         * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:
1523         (WebKit::NetworkCache::IOChannel::IOChannel):
1524
1525 2015-04-28  Carlos Garcia Campos  <cgarcia@igalia.com>
1526
1527         Network Cache: Do not create a SharedBuffer for mapped resources unless explicitly requested
1528         https://bugs.webkit.org/show_bug.cgi?id=144337
1529
1530         Reviewed by Antti Koivisto.
1531
1532         We send a buffer or a memory mapped handler to the web process
1533         depending on whether the resource body is mapped or not, but we
1534         are always creating a shared buffer even for mapped resources.
1535         Split initializeBufferFromStorageRecord() moving the mapped memory
1536         handler initialization to its own method.
1537
1538         * NetworkProcess/cache/NetworkCacheEntry.cpp:
1539         (WebKit::NetworkCache::Entry::initializeShareableResourceHandleFromStorageRecord):
1540         Initialize the mapped memory handler if the body data is mapped.
1541         (WebKit::NetworkCache::Entry::initializeBufferFromStorageRecord):
1542         Initialize the buffer by wrapping the mapped memory if the body
1543         data is mapped, or using the body data directly otherwise.
1544         (WebKit::NetworkCache::Entry::shareableResourceHandle): Call
1545         initializeShareableResourceHandleFromStorageRecord() if the
1546         handler is null.
1547         * NetworkProcess/cache/NetworkCacheEntry.h:
1548
1549 2015-04-28  Simon Fraser  <simon.fraser@apple.com>
1550
1551         Make a non-static version of FrameView::yPositionForRootContentLayer()
1552         https://bugs.webkit.org/show_bug.cgi?id=144375
1553
1554         Reviewed by Andy Estes.
1555
1556         There were two calls to the static FrameView::yPositionForRootContentLayer()
1557         which passed in all the arguments for the same FrameView. Make a member
1558         function for convenience.
1559
1560         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
1561         (WebKit::shadowLayerPositionForFrame):
1562
1563 2015-04-28  Ryuan Choi  <ryuan.choi@navercorp.com>
1564
1565         [CoordinatedGraphics] Merge TILED_BACKING_STORE guard with COORDINATED_GRAPHICS
1566         https://bugs.webkit.org/show_bug.cgi?id=143001
1567
1568         Reviewed by Gyuyoung Kim.
1569
1570         * UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.cpp:
1571         (WebKit::CoordinatedLayerTreeHostProxy::commitCoordinatedGraphicsState):
1572         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1573         (WebKit::WebChromeClient::dispatchViewportPropertiesDidChange):
1574         * WebProcess/WebCoreSupport/WebChromeClient.h:
1575         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1576         (WebKit::WebFrameLoaderClient::dispatchDidLayout):
1577         (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage):
1578         * WebProcess/WebPage/WebPage.cpp:
1579         (WebKit::WebPage::setSize):
1580         (WebKit::WebPage::setUseFixedLayout):
1581         (WebKit::WebPage::canHandleUserEvents):
1582         * WebProcess/WebPage/WebPage.h:
1583
1584 2015-04-28  Timothy Horton  <timothy_horton@apple.com>
1585
1586         [TextIndicator] Yellow highlight takes too long to fade out on scroll
1587         https://bugs.webkit.org/show_bug.cgi?id=144358
1588         <rdar://problem/19451011>
1589
1590         Reviewed by Beth Dakin.
1591
1592         * UIProcess/API/Cocoa/WKViewPrivate.h:
1593         * UIProcess/API/mac/WKView.mm:
1594         (-[WKView renewGState]):
1595         (-[WKView viewDidMoveToWindow]):
1596         (-[WKView _dictionaryLookupPopoverWillClose:]):
1597         (-[WKView _setTextIndicator:]):
1598         (-[WKView _setTextIndicator:withLifetime:]):
1599         (-[WKView _clearTextIndicatorWithAnimation:]):
1600         (-[WKView magnifyWithEvent:]):
1601         (-[WKView smartMagnifyWithEvent:]):
1602         (-[WKView setMagnification:centeredAtPoint:]):
1603         (-[WKView setMagnification:]):
1604         (-[WKView _dismissContentRelativeChildWindows]):
1605         (-[WKView _dismissContentRelativeChildWindowsWithAnimation:]):
1606         (-[WKView _setTextIndicator:fadeOut:]): Deleted.
1607         * UIProcess/API/mac/WKViewInternal.h:
1608         * UIProcess/PageClient.h:
1609         * UIProcess/WebPageProxy.cpp:
1610         (WebKit::WebPageProxy::pageDidScroll):
1611         (WebKit::WebPageProxy::setTextIndicator):
1612         (WebKit::WebPageProxy::clearTextIndicator):
1613         * UIProcess/WebPageProxy.h:
1614         * UIProcess/WebPageProxy.messages.in:
1615         * UIProcess/ios/PageClientImplIOS.h:
1616         * UIProcess/ios/PageClientImplIOS.mm:
1617         (WebKit::PageClientImpl::setTextIndicator):
1618         (WebKit::PageClientImpl::clearTextIndicator):
1619         * UIProcess/mac/PageClientImpl.h:
1620         * UIProcess/mac/PageClientImpl.mm:
1621         (WebKit::PageClientImpl::setTextIndicator):
1622         (WebKit::PageClientImpl::clearTextIndicator):
1623         (WebKit::PageClientImpl::didPerformDictionaryLookup):
1624         (WebKit::PageClientImpl::dismissContentRelativeChildWindows):
1625         * UIProcess/mac/WKActionMenuController.mm:
1626         (-[WKActionMenuController _defaultMenuItemsForDataDetectedText]):
1627         * UIProcess/mac/WKImmediateActionController.mm:
1628         (-[WKImmediateActionController _defaultAnimationController]):
1629         (-[WKImmediateActionController _animationControllerForDataDetectedText]):
1630         (-[WKImmediateActionController _animationControllerForDataDetectedLink]):
1631         (-[WKImmediateActionController _animationControllerForText]):
1632         * WebProcess/WebPage/FindController.cpp:
1633         (WebKit::FindController::updateFindIndicator):
1634         Make _setTextIndicator take a reference.
1635         Add a variant of _setTextIndicator that takes a Lifetime.
1636         Make _clearTextIndicatorWithAnimation take a DismissalAnimation.
1637         Make dismissContentRelativeChildWindows take a parameter indicating
1638         whether the dismissal should include animation or not (currently
1639         only applies to TextIndicator).
1640         Don't animate when dismissal occurs because of scrolling, zooming,
1641         or other things in which the content will have changed significantly
1642         underneath the indicator and shouldn't have a slowly-fading-out yellow highlight.
1643
1644 2015-04-28  Michael Catanzaro  <mcatanzaro@igalia.com>
1645
1646         Fully replace ENABLE_LLINT_C_LOOP with ENABLE_JIT
1647         https://bugs.webkit.org/show_bug.cgi?id=144304
1648
1649         Reviewed by Geoffrey Garen.
1650
1651         Define ENABLE_JIT, enabled by default, instead of ENABLE_LLINT_C_LOOP, disabled by default.
1652
1653         * Configurations/FeatureDefines.xcconfig:
1654
1655 2015-04-28  Commit Queue  <commit-queue@webkit.org>
1656
1657         Unreviewed, rolling out r183514.
1658         https://bugs.webkit.org/show_bug.cgi?id=144359
1659
1660         It broke cloop test bots (Requested by mcatanzaro on #webkit).
1661
1662         Reverted changeset:
1663
1664         "Fully replace ENABLE_LLINT_C_LOOP with ENABLE_JIT"
1665         https://bugs.webkit.org/show_bug.cgi?id=144304
1666         http://trac.webkit.org/changeset/183514
1667
1668 2015-04-28  Michael Catanzaro  <mcatanzaro@igalia.com>
1669
1670         Fully replace ENABLE_LLINT_C_LOOP with ENABLE_JIT
1671         https://bugs.webkit.org/show_bug.cgi?id=144304
1672
1673         Reviewed by Geoffrey Garen.
1674
1675         Define ENABLE_JIT, enabled by default, instead of ENABLE_LLINT_C_LOOP, disabled by default.
1676
1677         * Configurations/FeatureDefines.xcconfig:
1678
1679 2015-04-28  Enrica Casucci  <enrica@apple.com>
1680
1681         Add support for lookup on iOS.
1682         https://bugs.webkit.org/show_bug.cgi?id=144342
1683         rdar://problem/19994090
1684
1685         Reviewed by Tim Horton.
1686
1687         * UIProcess/WebPageProxy.h:
1688         * UIProcess/ios/WKContentViewInteraction.mm:
1689         (-[WKContentView _lookup:]):
1690         (-[WKContentView canPerformAction:withSender:]):
1691         * UIProcess/ios/WebPageProxyIOS.mm:
1692         (WebKit::WebPageProxy::getLookupContextAtPoint):
1693         * WebProcess/WebPage/WebPage.h:
1694         * WebProcess/WebPage/WebPage.messages.in:
1695         * WebProcess/WebPage/ios/WebPageIOS.mm:
1696         (WebKit::WebPage::getLookupContextAtPoint):
1697
1698 2015-04-28  Brady Eidson  <beidson@apple.com>
1699
1700         Consolidate most "frame load" arguments into FrameLoadRequest.
1701         https://bugs.webkit.org/show_bug.cgi?id=144276
1702
1703         Reviewed by Alexey Proskuryakov.
1704
1705         * WebProcess/Plugins/PluginView.cpp:
1706         (WebKit::PluginView::loadURL):
1707         
1708         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1709         (WebKit::WebFrameLoaderClient::dispatchCreatePage):
1710         
1711         * WebProcess/WebPage/WebInspector.cpp:
1712         (WebKit::WebInspector::openInNewTab):
1713
1714 2015-04-28  Chris Dumez  <cdumez@apple.com>
1715
1716         [WK2][Mac] Update WebContent process' sandbox profile for AWD
1717         https://bugs.webkit.org/show_bug.cgi?id=144315
1718         <rdar://problem/20719293>
1719
1720         Reviewed by Alexey Proskuryakov.
1721
1722         Update sandbox profile for AWD similarly to what was done for iOS in
1723         r182278.
1724
1725         * WebProcess/com.apple.WebProcess.sb.in:
1726
1727 2015-04-28  Antti Koivisto  <antti@apple.com>
1728
1729         Network Cache: Disk cache getting filled by YouTube video data
1730         https://bugs.webkit.org/show_bug.cgi?id=144259
1731
1732         Reviewed by Darin Adler.
1733
1734         MSE media is loaded via XHR and tends to eventually fill the cache.
1735
1736         YouTube serves the media chunks cacheable, however they are rarely (if ever) reused.
1737         We can reduce disk writes and keep more useful resources around by not caching them
1738
1739         * NetworkProcess/NetworkResourceLoader.cpp:
1740         (WebKit::NetworkResourceLoader::didReceiveResponseAsync):
1741         (WebKit::NetworkResourceLoader::didRetrieveCacheEntry):
1742         * NetworkProcess/cache/NetworkCache.cpp:
1743         (WebKit::NetworkCache::makeStoreDecision):
1744
1745             Don't store if the requester is XHR and response has video or audio content type.
1746
1747         * NetworkProcess/cache/NetworkCache.h:
1748         * NetworkProcess/cache/NetworkCacheStatistics.cpp:
1749         (WebKit::NetworkCache::storeDecisionToDiagnosticKey):
1750         * Shared/Network/NetworkResourceLoadParameters.cpp:
1751         (WebKit::NetworkResourceLoadParameters::NetworkResourceLoadParameters):
1752         (WebKit::NetworkResourceLoadParameters::encode):
1753         (WebKit::NetworkResourceLoadParameters::decode):
1754         * Shared/Network/NetworkResourceLoadParameters.h:
1755
1756             The requester type is now part of the ResourceRequest, no need for separate parameter.
1757
1758         * Shared/mac/WebCoreArgumentCodersMac.mm:
1759         (IPC::ArgumentCoder<ResourceRequest>::encodePlatformData):
1760         (IPC::ArgumentCoder<ResourceRequest>::decodePlatformData):
1761         * WebProcess/Network/WebResourceLoadScheduler.cpp:
1762         (WebKit::WebResourceLoadScheduler::scheduleLoad):
1763
1764 2015-04-28  Zan Dobersek  <zdobersek@igalia.com>
1765
1766         [WK2] API::UserContentURLPattern creation functions should return Ref<>
1767         https://bugs.webkit.org/show_bug.cgi?id=144225
1768
1769         Reviewed by Darin Adler.
1770
1771         Have API::UserContentURLPattern creation functions return Ref<>.
1772         Call-sites are also updated, using and operating on the returned Ref<>
1773         object where possible.
1774
1775         * Shared/API/APIUserContentURLPattern.h:
1776         (API::UserContentURLPattern::create):
1777         * Shared/API/c/WKUserContentURLPattern.cpp:
1778         (WKUserContentURLPatternCreate):
1779
1780 2015-04-28  Zan Dobersek  <zdobersek@igalia.com>
1781
1782         [WK2] API::URLRequest, API::URLResponse creation functions should return Ref<>
1783         https://bugs.webkit.org/show_bug.cgi?id=144224
1784
1785         Reviewed by Darin Adler.
1786
1787         Have API::URLRequest and API::URLResponse creation functions return Ref<>.
1788         The call-sites are also updated, using and operating on the returned Ref<> object
1789         where possible.
1790
1791         * Shared/API/APIURLRequest.h:
1792         (API::URLRequest::create):
1793         * Shared/API/APIURLResponse.h:
1794         (API::URLResponse::create):
1795         * Shared/API/c/WKURLRequest.cpp:
1796         (WKURLRequestCreateWithWKURL):
1797         * Shared/API/c/mac/WKURLRequestNS.mm:
1798         (WKURLRequestCreateWithNSURLRequest):
1799         * Shared/API/c/mac/WKURLResponseNS.mm:
1800         (WKURLResponseCreateWithNSURLResponse):
1801         * UIProcess/API/C/WKContext.cpp:
1802         (WKContextSetDownloadClient):
1803         * UIProcess/API/C/WKDownload.cpp:
1804         (WKDownloadCopyRequest):
1805         * UIProcess/API/C/WKNavigationDataRef.cpp:
1806         (WKNavigationDataCopyOriginalRequest):
1807         * UIProcess/API/C/WKPage.cpp:
1808         (WKPageSetPagePolicyClient):
1809         (WKPageSetPageUIClient):
1810         * UIProcess/Cocoa/NavigationState.mm:
1811         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
1812         * UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManagerClient.cpp:
1813         (WebKit::WebSoupCustomProtocolRequestManagerClient::startLoading):
1814         * WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp:
1815         (willSendRequestForFrame):
1816         * WebProcess/InjectedBundle/InjectedBundlePagePolicyClient.cpp:
1817         (WebKit::InjectedBundlePagePolicyClient::decidePolicyForNavigationAction):
1818         (WebKit::InjectedBundlePagePolicyClient::decidePolicyForNewWindowAction):
1819         (WebKit::InjectedBundlePagePolicyClient::decidePolicyForResponse):
1820
1821 2015-04-27  Zan Dobersek  <zdobersek@igalia.com>
1822
1823         [WK2] API::Point, API::Size, API::Rect creation functions should return Ref<>
1824         https://bugs.webkit.org/show_bug.cgi?id=144223
1825
1826         Reviewed by Darin Adler.
1827
1828         Have API::Point, API::Size and API::Rect creation functions return Ref<>.
1829         Call-sites are also updated, using and operating on the returned Ref<> object
1830         where possible.
1831
1832         * Shared/API/APIGeometry.h:
1833         (API::Size::create):
1834         (API::Point::create):
1835         (API::Rect::create):
1836         * Shared/API/c/WKGeometry.cpp:
1837         (WKPointCreate):
1838         (WKSizeCreate):
1839         (WKRectCreate):
1840
1841 2015-04-27  Zan Dobersek  <zdobersek@igalia.com>
1842
1843         [WK2] API::Error creation functions should return Ref<>
1844         https://bugs.webkit.org/show_bug.cgi?id=144222
1845
1846         Reviewed by Darin Adler.
1847
1848         Have API::Error creation functions return Ref<>.
1849         The call-sites are also updated, using and operating
1850         on the returned Ref<> object where possible.
1851
1852         * Shared/API/APIError.h:
1853         (API::Error::create):
1854         * Shared/API/c/cf/WKErrorCF.cpp:
1855         (WKErrorCreateWithCFError):
1856         * UIProcess/API/C/WKOriginDataManager.cpp:
1857         (WKOriginDataManagerDeleteEntriesForOrigin):
1858         (WKOriginDataManagerDeleteEntriesModifiedBetweenDates):
1859         (WKOriginDataManagerDeleteAllEntries):
1860         * UIProcess/API/C/WKPage.cpp:
1861         (toGenericCallbackFunction):
1862         (WKPageForceRepaint):
1863         (WKPageValidateCommand):
1864         (WKPageComputePagesForPrinting):
1865         * UIProcess/API/C/WKPluginSiteDataManager.cpp:
1866         (WKPluginSiteDataManagerClearSiteData):
1867         (WKPluginSiteDataManagerClearAllSiteData):
1868         * UIProcess/GenericCallback.h:
1869         (WebKit::toGenericCallbackFunction):
1870         * UIProcess/WebPageProxy.cpp:
1871         (WebKit::WebPageProxy::printFinishedCallback):
1872
1873 2015-04-27  Sungmann Cho  <sungmann.cho@navercorp.com>
1874
1875         [GTK] Remove unnecessary semicolon from WebKitNotificationProvider.h.
1876         https://bugs.webkit.org/show_bug.cgi?id=144312
1877
1878         Reviewed by Martin Robinson.
1879
1880         No new tests, no behavior change.
1881
1882         * UIProcess/API/gtk/WebKitNotificationProvider.h:
1883
1884 2015-04-27  Brent Fulgham  <bfulgham@apple.com>
1885
1886         PDF action menu fixes
1887         https://bugs.webkit.org/show_bug.cgi?id=144299
1888         <rdar://problem/20702215>
1889
1890         Reviewed by Tim Horton.
1891
1892         Make two corrections to how PDFs are handled:
1893         1. When calculating the view rect for the user's selection, make sure
1894         that we get coordinates for the correct PDF page. The existing code assumed
1895         that the current PDFLayerControler's current page was correct, but this will
1896         not be true if you zoom the PDF out so that several pages are displayed at
1897         once. Each selection keeps track of the page it is referenced against.
1898         
1899         2. Revise the offsets calculated for the TextIndicator to take into account
1900         the font descender (as well as the ascender), and to adjust by the scaled
1901         amount of margin around the selected text.
1902
1903         * WebProcess/Plugins/PDF/PDFPlugin.mm:
1904         (WebKit::PDFPlugin::viewRectForSelection): Use correct page for calculating
1905         the coordinates.
1906         * WebProcess/WebPage/mac/WebPageMac.mm:
1907         (WebKit::WebPage::dictionaryPopupInfoForSelectionInPDFPlugin): Include font 'descendant'
1908         and (scaled) margin when adjusting the hit target for the TextIndicator to draw.
1909
1910 2015-04-27  Michael Catanzaro  <mcatanzaro@igalia.com>
1911
1912         Rename WTF_USE_3D_GRAPHICS to ENABLE_GRAPHICS_CONTEXT_3D
1913         https://bugs.webkit.org/show_bug.cgi?id=144193
1914
1915         Reviewed by Darin Adler.
1916
1917         * CMakeLists.txt:
1918
1919 2015-04-24  Jon Honeycutt  <jhoneycutt@apple.com>
1920
1921         Context menus are not reshown after an orientation change
1922
1923         <https://bugs.webkit.org/show_bug.cgi?id=144143>
1924         <rdar://problem/20679931>
1925
1926         Reviewed by Darin Adler.
1927
1928         * UIProcess/ios/WKActionSheet.mm:
1929         (-[WKActionSheet updateSheetPosition]):
1930         Return early if we're still in a rotation, not if the rotation is
1931         complete.
1932
1933 2015-04-27  Zan Dobersek  <zdobersek@igalia.com>
1934
1935         [WK2] API::Dictionary creation functions should return Ref<>
1936         https://bugs.webkit.org/show_bug.cgi?id=144221
1937
1938         Reviewed by Darin Adler.
1939
1940         Have API::Dictionary creation functions return Ref<>.
1941         The call-sites are also updated, using and operating
1942         on the returned Ref<> object where possible.
1943
1944         * Shared/API/APIDictionary.cpp:
1945         (API::Dictionary::create):
1946         * Shared/API/APIDictionary.h:
1947         * Shared/API/Cocoa/WKRemoteObjectCoder.mm:
1948         (createEncodedObject):
1949         * Shared/API/Cocoa/_WKRemoteObjectRegistry.mm:
1950         (-[_WKRemoteObjectRegistry _sendInvocation:interface:]):
1951         * Shared/API/c/WKDictionary.cpp:
1952         (WKDictionaryCreate):
1953         * Shared/API/c/WKMutableDictionary.cpp:
1954         (WKMutableDictionaryCreate):
1955         * Shared/Plugins/Netscape/PluginInformation.cpp:
1956         (WebKit::createPluginInformationDictionary):
1957         * Shared/Plugins/Netscape/PluginInformation.h:
1958         * UIProcess/API/C/WKPage.cpp:
1959         (WKPageSetPageUIClient):
1960         * UIProcess/API/gtk/WebKitWebContext.cpp:
1961         (webkit_web_context_prefetch_dns):
1962         * UIProcess/API/gtk/WebKitWebView.cpp:
1963         (webkit_web_view_get_snapshot):
1964         * UIProcess/Plugins/PlugInAutoStartProvider.cpp:
1965         (WebKit::PlugInAutoStartProvider::autoStartOriginsTableCopy):
1966         * UIProcess/Plugins/PlugInAutoStartProvider.h:
1967         * UIProcess/StatisticsRequest.cpp:
1968         (WebKit::createDictionaryFromHashMap):
1969         (WebKit::StatisticsRequest::completedRequest):
1970         * UIProcess/WebFormClient.cpp:
1971         (WebKit::WebFormClient::willSubmitForm):
1972         * UIProcess/WebPageProxy.cpp:
1973         (WebKit::WebPageProxy::didFailToInitializePlugin):
1974         * WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp:
1975         (didInitiateLoadForResource):
1976         (willSendRequestForFrame):
1977         (didReceiveResponseForResource):
1978         (didReceiveContentLengthForResource):
1979         (didFinishLoadForResource):
1980         (didFailLoadForResource):
1981         (webkitWebPageDidReceiveMessage):
1982         * WebProcess/InjectedBundle/InjectedBundlePageFormClient.cpp:
1983         (WebKit::InjectedBundlePageFormClient::willSendSubmitEvent):
1984         (WebKit::InjectedBundlePageFormClient::willSubmitForm):
1985
1986 2015-04-27  Zan Dobersek  <zdobersek@igalia.com>
1987
1988         [WK2] API::Data creation functions should return Ref<>
1989         https://bugs.webkit.org/show_bug.cgi?id=144220
1990
1991         Reviewed by Darin Adler.
1992
1993         Have API::Data creation functions return Ref<>.
1994         The call-sites are also updated, using and operating
1995         on the returned Ref<> object where possible.
1996
1997         * Shared/API/APIData.h:
1998         (API::Data::createWithoutCopying):
1999         (API::Data::create):
2000         * Shared/API/c/WKData.cpp:
2001         (WKDataCreate):
2002         * Shared/API/c/mac/WKWebArchive.cpp:
2003         (WKWebArchiveCopyData):
2004         * Shared/API/c/mac/WKWebArchiveResource.cpp:
2005         (WKWebArchiveResourceCopyData):
2006         * Shared/APIWebArchive.h:
2007         * Shared/APIWebArchive.mm:
2008         (API::WebArchive::data):
2009         * Shared/APIWebArchiveResource.h:
2010         * Shared/APIWebArchiveResource.mm:
2011         (API::WebArchiveResource::data):
2012         * Shared/Cocoa/APIDataCocoa.mm:
2013         (API::Data::createWithoutCopying):
2014         * UIProcess/API/Cocoa/WKWebView.mm:
2015         (-[WKWebView loadData:MIMEType:characterEncodingName:baseURL:]):
2016         * UIProcess/API/gtk/WebKitURISchemeRequest.cpp:
2017         (webkitURISchemeRequestReadCallback):
2018         * UIProcess/API/gtk/WebKitWebView.cpp:
2019         (webkit_web_view_load_bytes):
2020         * UIProcess/Downloads/DownloadProxy.cpp:
2021         (WebKit::createData):
2022         * UIProcess/WebPageProxy.cpp:
2023         (WebKit::WebPageProxy::dataCallback):
2024         (WebKit::WebPageProxy::savePDFToFileInDownloadsFolder):
2025
2026 2015-04-27  Zan Dobersek  <zdobersek@igalia.com>
2027
2028         [WK2] API::URL creation functions should return Ref<>
2029         https://bugs.webkit.org/show_bug.cgi?id=144219
2030
2031         Reviewed by Darin Adler.
2032
2033         Have API::URL creation functions return Ref<>.
2034         The call-sites are also updated, using and operating in the
2035         returned Ref<> object, where possible.
2036
2037         * Shared/API/APIURL.h:
2038         (API::URL::create):
2039         * Shared/API/c/WKSharedAPICast.h:
2040         (WebKit::toCopiedURLAPI):
2041         * Shared/API/c/WKURL.cpp:
2042         (WKURLCreateWithUTF8CString):
2043         (WKURLCreateWithBaseURL):
2044         * UIProcess/API/gtk/WebKitWebResource.cpp:
2045         (webkit_web_resource_get_data):
2046         * UIProcess/WebIconDatabase.cpp:
2047         (WebKit::WebIconDatabase::didChangeIconForPageURL):
2048         (WebKit::WebIconDatabase::notifyIconDataReadyForPageURL):
2049         * WebProcess/WebPage/WebPage.cpp:
2050         (WebKit::WebPage::userAgent):
2051
2052 2015-04-27  Zan Dobersek  <zdobersek@igalia.com>
2053
2054         [WK2] API::String creation functions should return Ref<>
2055         https://bugs.webkit.org/show_bug.cgi?id=144218
2056
2057         Reviewed by Darin Adler.
2058
2059         Have API::String creation functions return Ref<>.
2060         The call-sites are also updated, using and operating on the returned
2061         Ref<> object, where possible.
2062
2063         * Shared/API/APIString.h:
2064         * Shared/API/c/WKPluginInformation.cpp:
2065         (WKPluginInformationBundleIdentifierKey):
2066         (WKPluginInformationBundleVersionKey):
2067         (WKPluginInformationBundleShortVersionKey):
2068         (WKPluginInformationPathKey):
2069         (WKPluginInformationDisplayNameKey):
2070         (WKPluginInformationDefaultLoadPolicyKey):
2071         (WKPluginInformationUpdatePastLastBlockedVersionIsKnownAvailableKey):
2072         (WKPluginInformationHasSandboxProfileKey):
2073         (WKPluginInformationFrameURLKey):
2074         (WKPluginInformationMIMETypeKey):
2075         (WKPluginInformationPageURLKey):
2076         (WKPluginInformationPluginspageAttributeURLKey):
2077         (WKPluginInformationPluginURLKey):
2078         (WKPlugInInformationReplacementObscuredKey):
2079         * Shared/API/c/WKSharedAPICast.h:
2080         (WebKit::ProxyingRefPtr::ProxyingRefPtr):
2081         (WebKit::toCopiedAPI):
2082         * Shared/API/c/WKString.cpp:
2083         (WKStringCreateWithUTF8CString):
2084         (WKStringCreateWithJSString):
2085         * UIProcess/API/C/WKDatabaseManager.cpp:
2086         (WKDatabaseManagerGetOriginKey):
2087         (WKDatabaseManagerGetOriginQuotaKey):
2088         (WKDatabaseManagerGetOriginUsageKey):
2089         (WKDatabaseManagerGetDatabaseDetailsKey):
2090         (WKDatabaseManagerGetDatabaseDetailsNameKey):
2091         (WKDatabaseManagerGetDatabaseDetailsDisplayNameKey):
2092         (WKDatabaseManagerGetDatabaseDetailsExpectedUsageKey):
2093         (WKDatabaseManagerGetDatabaseDetailsCurrentUsageKey):
2094         (WKDatabaseManagerGetDatabaseDetailsCreationTimeKey):
2095         (WKDatabaseManagerGetDatabaseDetailsModificationTimeKey):
2096         * UIProcess/API/C/WKKeyValueStorageManager.cpp:
2097         (WKKeyValueStorageManagerGetOriginKey):
2098         (WKKeyValueStorageManagerGetCreationTimeKey):
2099         (WKKeyValueStorageManagerGetModificationTimeKey):
2100         * UIProcess/API/C/WKPage.cpp:
2101         (WKPageGetSessionHistoryURLValueType):
2102         (WKPageGetSessionBackForwardListItemValueType):
2103         (toGenericCallbackFunction):
2104         (WKPageValidateCommand):
2105         * UIProcess/WebProcessPool.cpp:
2106         (WebKit::WebProcessPool::didReceiveInvalidMessage):
2107
2108 2015-04-27  Brady Eidson  <beidson@apple.com>
2109
2110         Make 'enum NavigationType' be an enum class
2111         https://bugs.webkit.org/show_bug.cgi?id=144270
2112
2113         Reviewed by Alex Christensen.
2114
2115         * Shared/API/c/WKSharedAPICast.h:
2116         (WebKit::toAPI):
2117         
2118         * Shared/NavigationActionData.cpp:
2119         (WebKit::NavigationActionData::NavigationActionData):
2120         
2121         * UIProcess/API/Cocoa/WKNavigationAction.mm:
2122         (toWKNavigationType):
2123         
2124         * UIProcess/API/gtk/WebKitPrivate.cpp:
2125         (toWebKitNavigationType):
2126         
2127         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2128         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
2129         
2130         * WebProcess/WebPage/WebInspector.cpp:
2131         (WebKit::WebInspector::openInNewTab):
2132
2133 2015-04-27  Brent Fulgham  <bfulgham@apple.com>
2134
2135         REGRESSION(r182879): Images and video can no longer be downloaded
2136         https://bugs.webkit.org/show_bug.cgi?id=144267
2137         <rdar://problem/20702844>
2138
2139         Reviewed by Simon Fraser.
2140
2141         * UIProcess/mac/WKActionMenuController.mm:
2142         (-[WKActionMenuController _createActionMenuItemForTag:]): Check for
2143         "!WebCore::protocolIs(..., "file")" for image and media downloads.
2144
2145 2015-04-27  Csaba Osztrogonác  <ossy@webkit.org>
2146
2147         [EFL] TestWebKitAPI's forwarding header generator should depend on WebKit2's generator
2148         https://bugs.webkit.org/show_bug.cgi?id=143874
2149
2150         Reviewed by Gyuyoung Kim.
2151
2152         * PlatformEfl.cmake: Rename the generator to have consistent name with other generators.
2153         * Scripts/generate-forwarding-headers.pl: Removed the unnecessary multiple include-path support.
2154
2155 2015-04-17  Carlos Garcia Campos  <cgarcia@igalia.com>
2156
2157         [SOUP] Add initial implementation of NetworkProcess disk cache
2158         https://bugs.webkit.org/show_bug.cgi?id=143872
2159
2160         Reviewed by Martin Robinson.
2161
2162         Implement the platform specific parts of the disk cache
2163         implementation for Soup. It's mainly NetworkCache::Data and
2164         NetworkCache::IOChannel.
2165
2166         * CMakeLists.txt:
2167         * NetworkProcess/cache/NetworkCache.cpp:
2168         (WebKit::NetworkCache::dumpFileChanged):
2169         (WebKit::NetworkCache::Cache::initialize):
2170         * NetworkProcess/cache/NetworkCacheBlobStorage.cpp:
2171         * NetworkProcess/cache/NetworkCacheData.h:
2172         (WebKit::NetworkCache::Data::soupBuffer):
2173         * NetworkProcess/cache/NetworkCacheDataSoup.cpp: Added.
2174         (WebKit::NetworkCache::Data::Data):
2175         (WebKit::NetworkCache::Data::empty):
2176         (WebKit::NetworkCache::Data::data):
2177         (WebKit::NetworkCache::Data::isNull):
2178         (WebKit::NetworkCache::Data::apply):
2179         (WebKit::NetworkCache::Data::subrange):
2180         (WebKit::NetworkCache::concatenate):
2181         (WebKit::NetworkCache::MapWrapper::~MapWrapper):
2182         (WebKit::NetworkCache::deleteMapWrapper):
2183         (WebKit::NetworkCache::mapFile):
2184         (WebKit::NetworkCache::Data::adoptMap):
2185         (WebKit::NetworkCache::computeSHA1):
2186         (WebKit::NetworkCache::bytesEqual):
2187         * NetworkProcess/cache/NetworkCacheIOChannel.h:
2188         * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp: Added.
2189         (WebKit::NetworkCache::IOChannel::IOChannel):
2190         (WebKit::NetworkCache::IOChannel::open):
2191         (WebKit::NetworkCache::fillDataFromReadBuffer):
2192         (WebKit::NetworkCache::inputStreamReadReadyCallback):
2193         (WebKit::NetworkCache::IOChannel::read):
2194         (WebKit::NetworkCache::IOChannel::readSync):
2195         (WebKit::NetworkCache::outputStreamWriteReadyCallback):
2196         (WebKit::NetworkCache::IOChannel::write):
2197         * NetworkProcess/cache/NetworkCacheStorageSoup.cpp: Removed.
2198         * NetworkProcess/gtk/NetworkProcessMainGtk.cpp:
2199         * NetworkProcess/soup/NetworkProcessSoup.cpp:
2200         (WebKit::NetworkProcess::platformInitializeNetworkProcess):
2201         (WebKit::NetworkProcess::platformSetCacheModel):
2202         (WebKit::NetworkProcess::clearDiskCache):
2203         * PlatformGTK.cmake:
2204
2205 2015-04-26  Yusuke Suzuki  <utatane.tea@gmail.com>
2206
2207         [ES6] Implement ES6 template literals
2208         https://bugs.webkit.org/show_bug.cgi?id=142691
2209
2210         Reviewed by Darin Adler.
2211
2212         Add ENABLE_ES6_TEMPLATE_LITERAL_SYNTAX compile time flag.
2213
2214         * Configurations/FeatureDefines.xcconfig:
2215
2216 2015-04-26  Sungmann Cho  <sungmann.cho@navercorp.com>
2217
2218         Remove PluginView::renderer().
2219         https://bugs.webkit.org/show_bug.cgi?id=144216
2220
2221         Reviewed by Darin Adler.
2222
2223         Nobody should have to know about the plug-in view's renderer except the plug-in view itself.
2224
2225         No new tests, no behavior change.
2226
2227         * WebProcess/Plugins/PDF/PDFPlugin.mm:
2228         (WebKit::PDFPlugin::convertFromScrollbarToContainingView):
2229         (WebKit::PDFPlugin::convertFromContainingViewToScrollbar):
2230         * WebProcess/Plugins/PluginView.cpp:
2231         (WebKit::PluginView::renderer): Deleted.
2232         * WebProcess/Plugins/PluginView.h:
2233
2234 2015-04-26  Doug Russell  <d_russell@apple.com>
2235
2236         AX: richer text change notifications (142719)
2237         https://bugs.webkit.org/show_bug.cgi?id=142719
2238
2239         Reviewed by Darin Adler.
2240
2241         Richer accessibility value change notifications. Introduce AXTextEditType,
2242         postTextStateChangeNotification and postTextReplacementNotification to give assistive
2243         tech apps more reliable context for responding to changes in web content. Also implement
2244         a mechanism to post value changes in password form fields in coalesced ticks to thwart
2245         analyzing the cadence of changes.
2246
2247         Richer accessibility selection change notifications. Introduce AXTextStateChangeIntent,
2248         and an overload of postTextReplacementNotification to give assistive tech apps more
2249         reliable context for responding to changes in web content selection. Also block posting
2250         selection changes on password fields.
2251
2252         * UIProcess/WebEditCommandProxy.cpp:
2253         (WebKit::WebEditCommandProxy::nameForEditAction):
2254
2255 2015-04-26  Dan Bernstein  <mitz@apple.com>
2256
2257         <rdar://problem/20702337> REGRESSION (r182952): Plug-in service fails to load because it links against WebKit2.framework
2258         https://bugs.webkit.org/show_bug.cgi?id=144233
2259
2260         Reviewed by Simon Fraser.
2261
2262         Have the plug-in service link against WebKit.framework rather than WebKit2.framework.
2263
2264         * Configurations/PluginService.32.xcconfig: Removed linker flags for linking against WebKit2
2265         and Foundation from the definition of OTHER_LDFLAGS. Since linking is no longer conditional,
2266         we can just do it in the target’s Link Binary With Libraries build phase.
2267
2268         * Configurations/PluginService.64.xcconfig: Ditto.
2269
2270         * WebKit2.xcodeproj/project.pbxproj: Have Foundation and WebKit listed in the services’ Link
2271         Binariy With Libraries build phases (one service already had WebKit).
2272
2273 2015-04-26  Dan Bernstein  <mitz@apple.com>
2274
2275         Fixed the build.
2276
2277         * UIProcess/ios/forms/WKFileUploadPanel.mm:
2278         (-[WKFileUploadPanel _showDocumentPickerMenu]): Suppressed deprecation warnings around use
2279         of -[UIDocumentMenuViewController _setIgnoreApplicationEntitlementForImport:].
2280
2281 2015-04-25  Tim Horton  <timothy_horton@apple.com>
2282
2283         Further update gesture swipe shadow style
2284         https://bugs.webkit.org/show_bug.cgi?id=144215
2285         <rdar://problem/19295843>
2286
2287         Reviewed by Dan Bernstein.
2288
2289         * Resources/mac/SwipeShadow.png: Removed.
2290         * Resources/mac/SwipeShadow@2x.png: Removed.
2291         * UIProcess/mac/ViewGestureController.h:
2292         * UIProcess/mac/ViewGestureControllerMac.mm:
2293         (WebKit::ViewGestureController::beginSwipeGesture):
2294         * WebKit2.xcodeproj/project.pbxproj:
2295         Use a CAGradientLayer instead of PNGs for the swipe shadow.
2296
2297 2015-04-25  Dan Bernstein  <mitz@apple.com>
2298
2299         WebKit2 part of <rdar://problem/20697966> Avoid using TBD as an argument to NS_AVAILABLE
2300         https://bugs.webkit.org/show_bug.cgi?id=144201
2301
2302         Reviewed by Darin Adler.
2303
2304         Instead of TBD, we use the high version number to which it corresponds in CFAvailability.h,
2305         9876.5.
2306
2307         * mac/MigrateHeadersFromWebKitLegacy.make: To detect not-yet-available declarations in
2308         headers, look for "9876_5" rather than "TBA".
2309
2310 2015-04-24  Timothy Hatcher  <timothy@apple.com>
2311
2312         Web Inspector: Remove native window dock controls
2313         https://bugs.webkit.org/show_bug.cgi?id=144184
2314
2315         Reviewed by Joseph Pecoraro.
2316
2317         * Resources/DockBottom.pdf: Removed.
2318         * Resources/DockBottomLegacy.pdf: Removed.
2319         * Resources/DockRight.pdf: Removed.
2320         * Resources/DockRightLegacy.pdf: Removed.
2321         * UIProcess/WebInspectorProxy.h:
2322         * UIProcess/mac/WebInspectorProxyMac.mm:
2323         (WebKit::WebInspectorProxy::createInspectorWindow):
2324         (WebKit::WebInspectorProxy::platformAttachAvailabilityChanged):
2325         * WebKit2.xcodeproj/project.pbxproj:
2326
2327 2015-04-25  Martin Robinson  <mrobinson@igalia.com>
2328
2329         Rename ENABLE_3D_RENDERING to ENABLE_3D_TRANSFORMS
2330         https://bugs.webkit.org/show_bug.cgi?id=144182
2331
2332         Reviewed by Simon Fraser.
2333
2334         * Configurations/FeatureDefines.xcconfig: Replace all instances of 3D_RENDERING with 3D_TRANSFORMS.
2335
2336 2015-04-24  Simon Fraser  <simon.fraser@apple.com>
2337
2338         Have the web inspector report accurate memory use for layers with detached backing store
2339         https://bugs.webkit.org/show_bug.cgi?id=144179
2340
2341         Reviewed by Dean Jackson.
2342         
2343         Remote layers can make their backing store volatile, so the backing only contributes
2344         to reported memory use when attached.
2345
2346         * WebProcess/WebPage/mac/PlatformCALayerRemote.h:
2347
2348 2015-04-24  Andreas Kling  <akling@apple.com>
2349
2350         theverge.com burning 100% CPU on iPad (due to window.screenX/Y)
2351         <https://webkit.org/b/144175>
2352         <rdar://problem/20694585>
2353
2354         Reviewed by Anders Carlsson.
2355
2356         Return an empty window rect on iOS WK2 builds. This avoids sending a synchronous
2357         IPC request to the UI process that would give the same result, but spend way
2358         more time and CPU cycles to do so.
2359
2360         With this change, theverge.com CPU usage goes from 100% to ~20% when idle.
2361
2362         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2363         (WebKit::WebChromeClient::windowRect):
2364
2365 2015-04-24  Brent Fulgham  <bfulgham@apple.com>
2366
2367         TextIndicator for embedded PDFs is slightly offset
2368         https://bugs.webkit.org/show_bug.cgi?id=144172
2369         <rdar://problem/20691304>
2370
2371         Reviewed by Tim Horton.
2372
2373         When I converted the existing DOM Range logic to work with PDFSelections, I omitted the
2374         step where the font ascent was used to adjust the origin used for the TextIndicator. This
2375         patch determines the correct ascent for the range of characters in the selection, and
2376         adjusts the offset by the difference between the ascent and the height of the selection rect.
2377         
2378         Also, since the PDFSelection only supplies the bounding rect for the selection, I calculate
2379         an equivalent text bounding box by insetting the rect by half the size of the ascent.
2380
2381         * WebProcess/Plugins/PDF/PDFPlugin.mm:
2382         (WebKit::PDFPlugin::scaleFactor): Add accessor for PDF scale factor.
2383         * WebProcess/Plugins/PDF/PDFPlugin.h:
2384         * WebProcess/WebPage/mac/WebPageMac.mm:
2385         (WebKit::WebPage::dictionaryPopupInfoForPDFSelectionInPluginView): Adjusted to take the
2386         font ascent and scale factor into account.
2387
2388 2015-04-24  David Kilzer  <ddkilzer@apple.com>
2389
2390         REGRESSION (r183293): Fix iOS EWS build by adding SPI declaration for +[UIPeripheralHost visiblePeripheralFrame]
2391
2392         Fixes the following build failures:
2393
2394             WebKit2/UIProcess/ios/WKPDFView.mm:740:45: error: class method '+visiblePeripheralFrame' not found (return type defaults to 'id') [-Werror,-Wobjc-method-access]
2395                 CGRect keyboardRect = [UIPeripheralHost visiblePeripheralFrame];
2396                                                         ^~~~~~~~~~~~~~~~~~~~~~
2397             WebKit2/UIProcess/ios/WKPDFView.mm:740:12: error: no viable conversion from 'id' to 'CGRect'
2398                 CGRect keyboardRect = [UIPeripheralHost visiblePeripheralFrame];
2399                        ^              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2400
2401         * Platform/spi/ios/UIKitSPI.h:
2402         (+[UIPeripheralHost visiblePeripheralFrame]): Add declaration.
2403
2404 2015-04-24  Anders Carlsson  <andersca@apple.com>
2405
2406         Change _WKWebsiteDataStore to hold on to an internal WKWebsiteDataStore
2407         https://bugs.webkit.org/show_bug.cgi?id=144171
2408
2409         Reviewed by Tim Horton.
2410
2411         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
2412         (-[WKWebViewConfiguration _websiteDataStore]):
2413         (-[WKWebViewConfiguration _setWebsiteDataStore:]):
2414         * UIProcess/API/Cocoa/_WKWebsiteDataStore.h:
2415         * UIProcess/API/Cocoa/_WKWebsiteDataStore.mm:
2416         (-[_WKWebsiteDataStore initWithDataStore:]):
2417         (+[_WKWebsiteDataStore defaultDataStore]):
2418         (+[_WKWebsiteDataStore nonPersistentDataStore]):
2419         (-[_WKWebsiteDataStore isNonPersistent]):
2420         (-[_WKWebsiteDataStore fetchDataRecordsOfTypes:completionHandler:]):
2421         (-[_WKWebsiteDataStore removeDataOfTypes:forDataRecords:completionHandler:]):
2422         (-[_WKWebsiteDataStore removeDataOfTypes:modifiedSince:completionHandler:]):
2423         * UIProcess/API/Cocoa/_WKWebsiteDataStoreInternal.h: Copied from Source/WebKit2/UIProcess/API/Cocoa/_WKWebsiteDataStore.h.
2424         * WebKit2.xcodeproj/project.pbxproj:
2425
2426 2015-04-24  Tim Horton  <timothy_horton@apple.com>
2427
2428         WKPDFView does not support password-protected PDFs
2429         https://bugs.webkit.org/show_bug.cgi?id=144162
2430         <rdar://problem/18411512>
2431
2432         Reviewed by Andy Estes.
2433
2434         * Platform/spi/ios/UIKitSPI.h:
2435         Add some SPI.
2436
2437         * UIProcess/ios/WKPDFView.h:
2438         * UIProcess/ios/WKPDFView.mm:
2439         (-[WKPDFView _didLoadPDFDocument]):
2440         (-[WKPDFView web_setContentProviderData:suggestedFilename:]):
2441         Move creation of the UIPDFDocument (only possible if the CGPDFDocument is unlocked)
2442         and initial setup of the page views out into _didLoadPDFDocument.
2443
2444         If the CGPDFDocument is locked, we'll show some UI to unlock it; otherwise
2445         we'll continue on to _didLoadPDFDocument as previously.
2446
2447         (-[WKPDFView web_setMinimumSize:]):
2448         Resize the password UI instead of the PDF pages if we have it.
2449
2450         (-[WKPDFView _computePageAndDocumentFrames]):
2451         Don't bother doing any work revalidating PDF pages if the document is locked.
2452
2453         (-[WKPDFView _updatePasswordEntryField]):
2454         Make sure that the UIDocumentPassword view is always the size of the scrollview.
2455         This takes care of rotation.
2456
2457         (-[WKPDFView _keyboardDidShow:]):
2458         Make sure that we scroll the password field around, if necessary, to keep it
2459         on screen when editing begins.
2460
2461         (-[WKPDFView _showPasswordEntryField]):
2462         (-[WKPDFView _hidePasswordEntryField]):
2463         Adjust the background color (to match the UIDocumentPasswordView) and disable zooming
2464         while it's up. The UIDocumentPassword view is installed into the scroll view
2465         to match UIWebView behavior.
2466
2467         (-[WKPDFView userDidEnterPassword:forPasswordView:]):
2468         (-[WKPDFView didBeginEditingPassword:inView:]):
2469         (-[WKPDFView didEndEditingPassword:inView:]):
2470         (-[WKPDFView _didFailToUnlock]):
2471         Pop up a dialog informing the user that they entered the wrong password.
2472
2473         (-[WKPDFView _tryToUnlockWithPassword:]):
2474         Try to unlock the document. If it succeeds, hide the unlock UI and go back to
2475         _didLoadPDFDocument.
2476
2477 2015-04-24  Commit Queue  <commit-queue@webkit.org>
2478
2479         Unreviewed, rolling out r183266.
2480         https://bugs.webkit.org/show_bug.cgi?id=144164
2481
2482         Broke 32-bit build and a test. (Requested by ap on #webkit).
2483
2484         Reverted changeset:
2485
2486         "AX: richer text change notifications (142719)"
2487         https://bugs.webkit.org/show_bug.cgi?id=142719
2488         http://trac.webkit.org/changeset/183266
2489
2490 2015-04-24  Brent Fulgham  <bfulgham@apple.com>
2491
2492         REGRESSION: WebKit2.ActionMenusTest API test fails
2493         https://bugs.webkit.org/show_bug.cgi?id=144149
2494         <rdar://problem/20677770>
2495
2496         Reviewed by Tim Horton.
2497
2498         Tested by TestWebKitAPI 
2499
2500         The 'lookupTextAtLocation' method was not converting the NSEvent coordinates it
2501         was receiving from root view to the plugin view. Consequently, full page PDFs
2502         did hit testing correctly, but an <embed> PDF would not.
2503
2504         Since 'existingSelectionContainsPoint' is exposed as API, I also modified it to
2505         expect 'root view' coordinates and perform the requisite conversions, rather
2506         than expecting 'plugin view' coordinates.
2507
2508         * WebProcess/Plugins/PDF/PDFPlugin.mm:
2509         (WebKit::PDFPlugin::existingSelectionContainsPoint): Expect 'root view' coordinates
2510         for the input.
2511         (WebKit::PDFPlugin::lookupTextAtLocation): Properly convert the passed 'root view'
2512         coordinates to the PDF's view coordinate space.
2513         * WebProcess/WebPage/mac/WebPageMac.mm:
2514         (WebKit::WebPage::performActionMenuHitTestAtLocation): Pass hit point using view coordinates,
2515         not content coordinates.
2516
2517 2015-04-24  Anders Carlsson  <andersca@apple.com>
2518
2519         Address a review comment from Joe Pecoraro.
2520
2521         * UIProcess/API/Cocoa/WKWebsiteDataStore.h:
2522
2523 2015-04-24  Anders Carlsson  <andersca@apple.com>
2524
2525         Rename -[WKWebsiteDataStore isNonPersistent] to -[WKWebsiteDataStore isPersistent]
2526         https://bugs.webkit.org/show_bug.cgi?id=144158
2527
2528         Reviewed by Beth Dakin.
2529
2530         * UIProcess/API/APIWebsiteDataStore.cpp:
2531         (API::WebsiteDataStore::isPersistent):
2532         (API::WebsiteDataStore::isNonPersistent): Deleted.
2533         * UIProcess/API/APIWebsiteDataStore.h:
2534         * UIProcess/API/Cocoa/WKWebsiteDataStore.h:
2535         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
2536         (-[WKWebsiteDataStore isPersistent]):
2537         (-[WKWebsiteDataStore isNonPersistent]): Deleted.
2538         * UIProcess/API/Cocoa/_WKWebsiteDataStore.h:
2539         * UIProcess/API/Cocoa/_WKWebsiteDataStore.mm:
2540         (-[_WKWebsiteDataStore isNonPersistent]):
2541         * UIProcess/WebsiteData/WebsiteDataStore.h:
2542
2543 2015-04-24  Brent Fulgham  <bfulgham@apple.com>
2544
2545         Immediate action not functional for embedded PDFs
2546         https://bugs.webkit.org/show_bug.cgi?id=143952
2547         <rdar://problem/19842365>        
2548
2549         Reviewed by Tim Horton.
2550
2551         Add a new method to retrieve appropriate dictionary lookup content and update the
2552         hit test result with relevant dictionary content and the bounding rect of the
2553         selection.
2554
2555         * WebProcess/Plugins/Netscape/NetscapePlugin.h: Add stub.
2556         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp: Initialize plugin type.
2557         * WebProcess/Plugins/PDF/PDFPlugin.h:
2558         * WebProcess/Plugins/PDF/PDFPlugin.mm:
2559         (WebKit::rectInWindowSpaceForRectInLayoutSpace): New helper function to
2560         convert PDF 'in page' units to the equivalent view units.
2561         (WebKit::PDFPlugin::PDFPlugin): Initialize plugin type.
2562         (WebKit::PDFPlugin::viewRectForSelection): Query a provided PDFSelection for
2563         its bounding rect and return the result in view units.
2564         * WebProcess/Plugins/Plugin.h:
2565         * WebProcess/Plugins/PluginProxy.cpp: Initialize plugin type.
2566         * WebProcess/Plugins/PluginProxy.h: Add stub.
2567         * WebProcess/Plugins/PluginView.cpp: 
2568         (WebKit::PluginView::viewRectForSelection): Added.
2569         * WebProcess/Plugins/PluginView.h:
2570         * WebProcess/WebPage/WebPage.h:
2571         * WebProcess/WebPage/mac/WebPageMac.mm:
2572         (WebKit::WebPage::dictionaryPopupInfoForPDFSelectionInPluginView): Added.
2573         (WebKit::textIndicatorTransitionForActionMenu): Added helper function.
2574         (WebKit::WebPage::performActionMenuHitTestAtLocation): Update the hit test information
2575         with relevant dictionary lookup content, and mark the result as a text node (if
2576         appropriate).
2577
2578 2015-04-24  Jer Noble  <jer.noble@apple.com>
2579
2580         [WK2] Only issue a isPlayingAudioDidChange() notification if the audio playing state actually changed.
2581         https://bugs.webkit.org/show_bug.cgi?id=144153
2582
2583         Reviewed by Alexey Proskuryakov.
2584
2585         Check the old state vs. the new state and only issue the change notification if the IsPlayingAudio state changed.
2586
2587         * UIProcess/WebPageProxy.cpp:
2588         (WebKit::WebPageProxy::isPlayingMediaDidChange):
2589
2590 2015-04-24  Antti Koivisto  <antti@apple.com>
2591
2592         CrashTracer: [USER] com.apple.WebKit.Networking at com.apple.WebKit: WebKit::NetworkResourceLoader::~NetworkResourceLoader + 14
2593         https://bugs.webkit.org/show_bug.cgi?id=144147
2594
2595         Reviewed by Chris Dumez.
2596
2597         Storage::storeBodyAsBlob copies the std::function callback for handling mapped bodies in a thread.
2598         This is thread safe only if the function copy is thread safe. It is currently not as we are capturing
2599         RefPtr<NetworkResourceLoader> and NetworkResourceLoader doesn't use thread safe refcounting.
2600
2601         Fix by avoiding copying of the callback. Use same apporach for WriteOperation as we already use for
2602         ReadOperation: count the active operations in progress and delete WriteOperation when everything is
2603         finished. This way we don't need to copy the function out from WriteOperation.
2604
2605         * NetworkProcess/cache/NetworkCacheStorage.cpp:
2606         (WebKit::NetworkCache::Storage::ReadOperation::ReadOperation):
2607         (WebKit::NetworkCache::Storage::WriteOperation::WriteOperation):
2608
2609             Move definition here from the header.
2610
2611         (WebKit::NetworkCache::Storage::~Storage):
2612         (WebKit::NetworkCache::Storage::storeBodyAsBlob):
2613
2614             Increment the operation count when storing a blob, call finishWriteOperation when done.
2615
2616         (WebKit::NetworkCache::Storage::dispatchReadOperation):
2617         (WebKit::NetworkCache::Storage::finishReadOperation):
2618
2619             Count active operations instead of finished operations. This makes the code clearer.
2620
2621         (WebKit::NetworkCache::Storage::dispatchWriteOperation):
2622         (WebKit::NetworkCache::Storage::finishWriteOperation):
2623
2624             Mirror the way ReadOperations work.
2625
2626         * NetworkProcess/cache/NetworkCacheStorage.h:
2627         (WebKit::NetworkCache::Storage::ReadOperation::ReadOperation): Deleted.
2628
2629 2015-04-24  Timothy Hatcher  <timothy@apple.com>
2630
2631         REGRESSION: Web Inspector: Start Timeline Recording in Develop menu broken
2632         https://bugs.webkit.org/show_bug.cgi?id=144150
2633
2634         Reviewed by Brian Burg.
2635
2636         * WebProcess/WebPage/WebInspectorUI.cpp:
2637         (WebKit::WebInspectorUI::evaluateCommandOnLoad): Properly treat bools as literals
2638         instead of strings by not using the string version of evaluateCommandOnLoad.
2639
2640 2015-04-23  Anders Carlsson  <andersca@apple.com>
2641
2642         Add headerdocs for WKWebsiteDataRecord and WKWebsiteDataStore
2643         https://bugs.webkit.org/show_bug.cgi?id=144138
2644
2645         Reviewed by Darin Adler.
2646
2647         * UIProcess/API/Cocoa/WKWebsiteDataRecord.h:
2648         * UIProcess/API/Cocoa/WKWebsiteDataStore.h:
2649         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
2650         (-[WKWebsiteDataStore fetchDataRecordsOfTypes:completionHandler:]):
2651         (-[WKWebsiteDataStore removeDataOfTypes:modifiedSince:completionHandler:]):
2652         (-[WKWebsiteDataStore removeDataOfTypes:forDataRecords:completionHandler:]):
2653
2654 2015-04-24  Doug Russell  <d_russell@apple.com>
2655
2656         AX: richer text change notifications (142719)
2657         https://bugs.webkit.org/show_bug.cgi?id=142719
2658
2659         Reviewed by Darin Adler.
2660
2661         Richer accessibility value change notifications. Introduce AXTextEditType, postTextStateChangeNotification and postTextReplacementNotification to give assistive tech apps more reliable context for responding to changes in web content. Also implement a mechanism to post value changes in password form fields in coalesced ticks to thwart analyzing the cadence of changes.
2662
2663         Richer accessibility selection change notifications. Introduce AXTextStateChangeIntent, and an overload of postTextReplacementNotification to give assistive tech apps more reliable context for responding to changes in web content selection. Also block posting selection changes on password fields.
2664
2665         * UIProcess/WebEditCommandProxy.cpp:
2666         (WebKit::WebEditCommandProxy::nameForEditAction):
2667
2668 2015-04-24  Darin Adler  <darin@apple.com>
2669
2670         Convert OwnPtr and PassOwnPtr uses to std::unique_ptr
2671         https://bugs.webkit.org/show_bug.cgi?id=128007
2672
2673         Reviewed by Anders Carlsson.
2674
2675         * NetworkProcess/cache/NetworkCacheEncoder.h: Added an include now
2676         needed that was inherited from OwnPtr.h before.
2677
2678 2015-04-24  Antti Koivisto  <antti@apple.com>
2679
2680         Network Cache: Make path functions members
2681         https://bugs.webkit.org/show_bug.cgi?id=144146
2682
2683         Reviewed by Carlos Garcia Campos.
2684
2685         This simplifies the code.
2686
2687         * NetworkProcess/cache/NetworkCacheStorage.cpp:
2688         (WebKit::NetworkCache::Storage::partitionPathForKey):
2689         (WebKit::NetworkCache::Storage::recordPathForKey):
2690         (WebKit::NetworkCache::Storage::bodyPathForKey):
2691         (WebKit::NetworkCache::Storage::storeBodyAsBlob):
2692         (WebKit::NetworkCache::Storage::remove):
2693         (WebKit::NetworkCache::Storage::dispatchReadOperation):
2694         (WebKit::NetworkCache::Storage::finishReadOperation):
2695         (WebKit::NetworkCache::Storage::dispatchWriteOperation):
2696         (WebKit::NetworkCache::partitionPathForKey): Deleted.
2697         (WebKit::NetworkCache::recordPathForKey): Deleted.
2698         (WebKit::NetworkCache::bodyPathForKey): Deleted.
2699         * NetworkProcess/cache/NetworkCacheStorage.h:
2700
2701 2015-04-24  Carlos Garcia Campos  <cgarcia@igalia.com>
2702
2703         Unreviewed. Remove incorrect assert after r183189.
2704
2705         In this case the assert was already there, but it's incorrect
2706         because we are handling uninitialized attachments below in the
2707         same function, and also when sending messages. So, if it's ok to
2708         send uninitialized attachments, it's ok to receive them. This
2709         didn't fail before r183189, because we were only invaliding the
2710         attachments by setting the file descriptor to -1, and they were
2711         handled as null attachments. After r183189, the move operator
2712         resets the moved attachment leaving it uninitialized again.
2713
2714         * Platform/IPC/unix/ConnectionUnix.cpp:
2715         (IPC::Connection::processMessage):
2716
2717 2015-04-24  Carlos Garcia Campos  <cgarcia@igalia.com>
2718
2719         [SOUP] Use a webkit subdirectory for the disk cache
2720         https://bugs.webkit.org/show_bug.cgi?id=144048
2721
2722         Reviewed by Martin Robinson.
2723
2724         Recent versions of libsoup remove any file in cache dir not
2725         referenced by the index when the cache is loaded to workaround
2726         leaked resources when load/dump is unbalanced for whatever reason,
2727         like a crash. We currently use $XDG_CACHE_HOME/app-name as default
2728         disk cache directory, but that directory could be used by apps to
2729         cache other things, and the soup cache might end up deleting other
2730         stuff. The soup cache assumes the given directory is only for the
2731         disk cache, so we should ensure that.
2732
2733         * NetworkProcess/soup/NetworkProcessSoup.cpp:
2734         (WebKit::NetworkProcess::platformInitializeNetworkProcess): Append
2735         webkit to the given disk cache and clear the previous soup cache if it exists.
2736         * WebProcess/soup/WebProcessSoup.cpp:
2737         (WebKit::WebProcess::platformInitializeWebProcess): Ditto.
2738
2739 2015-04-24  Carlos Garcia Campos  <cgarcia@igalia.com>
2740
2741         Unreviewed. Remove incorrect ASSERT added in r183176.
2742
2743         We allow to encode null attachments.
2744
2745         * Platform/unix/SharedMemoryUnix.cpp:
2746         (WebKit::SharedMemory::Handle::releaseAttachment):
2747
2748 2015-04-23  Dan Bernstein  <mitz@apple.com>
2749
2750         <rdar://problem/20680694> Framework header postprocessing isn’t removing WK_DEPRECATED macros when it should.
2751
2752         Reviewed by Andy Estes.
2753
2754         * mac/postprocess-framework-headers.sh:
2755
2756 2015-04-23  Simon Fraser  <simon.fraser@apple.com>
2757
2758         Make it possible to detach GraphicsLayerCA backing store
2759         https://bugs.webkit.org/show_bug.cgi?id=144140
2760
2761         Reviewed by Tim Horton.
2762         
2763         This changes makes it possible to denote a GraphicsLayerCA's backing store
2764         as "attached" or not. When not attached, the backing store is made volatile
2765         and can be purged. This will be used in a future patch.
2766
2767         * Shared/mac/RemoteLayerBackingStore.mm:
2768         (WebKit::RemoteLayerBackingStore::~RemoteLayerBackingStore): Whitespace.
2769         (WebKit::RemoteLayerBackingStore::display): If backingStoreWillBeDisplayed()
2770         returns true, this indicates that the backing store was brought out of the
2771         "unreachable" list, so return true even if the backing store doesn't require
2772         painting.
2773         * Shared/mac/RemoteLayerBackingStoreCollection.h: C++11 initializer, and comments.
2774         * Shared/mac/RemoteLayerBackingStoreCollection.mm:
2775         (WebKit::RemoteLayerBackingStoreCollection::RemoteLayerBackingStoreCollection):
2776         (WebKit::RemoteLayerBackingStoreCollection::backingStoreWillBeDisplayed): Return true
2777         if the caller will need to submit the backing store in the current transaction.
2778         (WebKit::RemoteLayerBackingStoreCollection::backingStoreBecameUnreachable): This
2779         explicit dirtying is no longer necessary given the backingStoreWillBeDisplayed() change.
2780         * Shared/mac/RemoteLayerTreePropertyApplier.mm:
2781         (WebKit::applyPropertiesToLayer): Only set the layer's backing if we both have backing
2782         store, and it's attached.
2783         * Shared/mac/RemoteLayerTreeTransaction.h: New bit, and data member.
2784         * Shared/mac/RemoteLayerTreeTransaction.mm:
2785         (WebKit::RemoteLayerTreeTransaction::LayerProperties::LayerProperties):
2786         (WebKit::RemoteLayerTreeTransaction::LayerProperties::encode):
2787         (WebKit::RemoteLayerTreeTransaction::LayerProperties::decode):
2788         (WebKit::dumpChangedLayers):
2789         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
2790         (WebKit::PlatformCALayerRemote::recursiveBuildTransaction): Only call display()
2791         on the backing store if it's attached.
2792         (WebKit::PlatformCALayerRemote::setBackingStoreAttached):
2793         (WebKit::PlatformCALayerRemote::backingStoreAttached):
2794         * WebProcess/WebPage/mac/PlatformCALayerRemote.h:
2795         * WebProcess/WebPage/mac/RemoteLayerTreeContext.h:
2796         * WebProcess/WebPage/mac/RemoteLayerTreeContext.mm:
2797         (WebKit::RemoteLayerTreeContext::backingStoreWillBeDisplayed):
2798
2799 2015-04-23  Tim Horton  <timothy_horton@apple.com>
2800
2801         Quick Look preview popover is not dismissed on scroll in Mail
2802         https://bugs.webkit.org/show_bug.cgi?id=144119
2803         <rdar://problem/19752045>
2804
2805         Reviewed by Anders Carlsson.
2806
2807         * UIProcess/API/mac/WKView.mm:
2808         (-[WKView renewGState]):
2809         If we have a TextIndicator, dismiss all content relative child windows
2810         on renewGState, not just the TextIndicator itself.
2811
2812         This will fix cases like Mail, where WebKit isn't driving the scrolling,
2813         and we have no way (except renewGState) to know that scrolling is happening.
2814
2815 2015-04-23  Simon Fraser  <simon.fraser@apple.com>
2816
2817         Changing TiledBacking velocity should schedule a tile revalidation
2818         https://bugs.webkit.org/show_bug.cgi?id=144123
2819
2820         Reviewed by Tim Horton.
2821         
2822         Drive-by fix: use the FrameView& that we have already.
2823
2824         * WebProcess/WebPage/ios/WebPageIOS.mm:
2825         (WebKit::WebPage::updateVisibleContentRects):
2826
2827 2015-04-23  Jer Noble  <jer.noble@apple.com>
2828
2829         [Mac] Disable QTKit by default on future OS X.
2830         https://bugs.webkit.org/show_bug.cgi?id=144082
2831
2832         Reviewed by Darin Adler.
2833
2834         QTKitEnabled defaults to false.
2835
2836         * Shared/WebPreferencesDefinitions.h:
2837
2838 2015-04-23  Jer Noble  <jer.noble@apple.com>
2839
2840         [WK2][Mac] Tweak the timing curve of the WebKit Fullscreen animation
2841         https://bugs.webkit.org/show_bug.cgi?id=144120
2842
2843         Reviewed by Eric Carlson.
2844
2845         Tweak the curve to ease-in faster when the fullscreen animation duration is short.
2846
2847         * UIProcess/mac/WKFullScreenWindowController.mm:
2848         (timingFunctionForDuration):
2849         (zoomAnimation):
2850         (maskAnimation):
2851         (fadeAnimation):
2852
2853 2015-04-23  Enrica Casucci  <enrica@apple.com>
2854
2855         iOS build fix after r183208.
2856
2857         Unreviewed.
2858
2859         * UIProcess/ios/WKContentViewInteraction.mm:
2860
2861 2015-04-22  Alexey Proskuryakov  <ap@apple.com>
2862
2863         [iOS] WebKit services should inherit environment variables for home
2864         https://bugs.webkit.org/show_bug.cgi?id=144078
2865         rdar://problem/20571678
2866
2867         Reviewed by Dan Bernstein.
2868
2869         Pass current environment variables as XPC bootstrap. Also while at it, made
2870         _CFBundleSetupXPCBootstrap not soft linked.
2871
2872         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.mm:
2873         (main):
2874         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
2875         (WebKit::connectToService):
2876
2877 2015-04-23  Enrica Casucci  <enrica@apple.com>
2878
2879         Support share button.
2880         https://bugs.webkit.org/show_bug.cgi?id=144077
2881         rdar://problem/19772892
2882
2883         Reviewed by Darin Adler.
2884
2885         * UIProcess/ios/WKContentViewInteraction.mm:
2886         (-[WKContentView _share:]):
2887         (-[WKContentView canPerformAction:withSender:]):
2888         (-[WKContentView _define:]):
2889         (-[WKContentView accessibilityRetrieveSpeakSelectionContent]):
2890         (-[WKContentView moveByOffset:]):
2891         (-[WKContentView requestAutocorrectionRectsForString:withCompletionHandler:]):
2892         (-[WKContentView applyAutocorrection:toString:withCompletionHandler:]):
2893         (-[WKContentView requestAutocorrectionContextWithCompletionHandler:]):
2894         (-[WKContentView accessoryTab:]):
2895         (-[WKContentView _becomeFirstResponderWithSelectionMovingForward:completionHandler:]):
2896         (-[WKContentView executeEditCommandWithCallback:]):
2897
2898 2015-04-23  Carlos Garcia Campos  <cgarcia@igalia.com>
2899
2900         [UNIX] Do not allow copies of IPC::Attachment
2901         https://bugs.webkit.org/show_bug.cgi?id=144096
2902
2903         Reviewed by Darin Adler.
2904
2905         It ensures that the file descriptor ownership is always correctly
2906         transferred. This way we can remove the dispose() method to
2907         explicitly close the file descriptor and always close it in the
2908         Attachment destructor (unless explicitly transferred to
2909         IPC::Connection or SharedMemory). It simplifies the code and
2910         ensure we don't leak file descriptors.
2911
2912         * Platform/IPC/ArgumentDecoder.cpp:
2913         (IPC::ArgumentDecoder::~ArgumentDecoder): Remove the code to
2914         explicitly dispose attachments.
2915         (IPC::ArgumentDecoder::removeAttachment): Use WTF::move().
2916         * Platform/IPC/ArgumentEncoder.cpp:
2917         (IPC::ArgumentEncoder::~ArgumentEncoder): Remove the code to
2918         explicitly dispose attachments.
2919         (IPC::ArgumentEncoder::addAttachment): Use WTF::move().
2920         (IPC::ArgumentEncoder::releaseAttachments): Simplify by using WTF::move().
2921         * Platform/IPC/ArgumentEncoder.h:
2922         * Platform/IPC/Attachment.cpp:
2923         (IPC::Attachment::encode): Move a copy of the attachment, and
2924         reset the file descriptor, since the ownership is passed to the encoder.
2925         * Platform/IPC/Attachment.h: Make copy constructor and assignment
2926         private to not allow public copies. The only copy allowed is done
2927         by Attachment::encode(). Make m_fileDescriptor mutable so that we
2928         can reset it in Attachment::encode() after passing the ownership
2929         to the encoder.
2930         * Platform/IPC/unix/AttachmentUnix.cpp:
2931         (IPC::Attachment::~Attachment): Close the file descriptor if it
2932         hasn't been released explicitly.
2933         (IPC::Attachment::dispose): Deleted.
2934         * Platform/IPC/unix/ConnectionUnix.cpp:
2935         (IPC::Connection::processMessage): Do not use AttachmentResourceGuard.
2936         (IPC::Connection::sendOutgoingMessage): Ditto.
2937         (IPC::AttachmentResourceGuard::AttachmentResourceGuard): Deleted.
2938         (IPC::AttachmentResourceGuard::~AttachmentResourceGuard): Deleted.
2939         * Platform/unix/SharedMemoryUnix.cpp:
2940         (WebKit::SharedMemory::Handle::~Handle): Do not call clear().
2941         (WebKit::SharedMemory::Handle::clear): Reset the attachment.
2942         * UIProcess/WebInspectorProxy.cpp:
2943         (WebKit::WebInspectorProxy::createInspectorPage): Use WTF::move().
2944         * WebProcess/Plugins/PluginProcessConnectionManager.cpp:
2945         (WebKit::PluginProcessConnectionManager::getPluginProcessConnection):
2946         Call releaseFileDescriptor() instead of fileDescritpro() since the
2947         ownership is passed to the connection.
2948
2949 2015-04-23  Alexey Proskuryakov  <ap@apple.com>
2950
2951         Build fix.
2952
2953         * WebProcess/cocoa/WebProcessCocoa.mm: Correct the case of an include file name.
2954
2955 2015-04-23  Carlos Garcia Campos  <cgarcia@igalia.com>
2956
2957         Unreviewed. Fix debug build after r183176.
2958
2959         * Platform/unix/SharedMemoryUnix.cpp:
2960         (WebKit::SharedMemory::Handle::decode):
2961         (WebKit::SharedMemory::createHandle):
2962
2963 2015-04-23  Andreas Kling  <akling@apple.com>
2964
2965         There should only be one way to get the system memory size.
2966         <https://webkit.org/b/144081>
2967
2968         Reviewed by Antti Koivisto.
2969
2970         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
2971         (WebKit::NetworkProcess::platformSetCacheModel):
2972         (WebKit::memorySize): Deleted.
2973         * WebProcess/cocoa/WebProcessCocoa.mm:
2974         (WebKit::WebProcess::platformSetCacheModel):
2975         (WebKit::memorySize): Deleted.
2976
2977 2015-04-23  Chris Dumez  <cdumez@apple.com>
2978
2979         [WK2] WebDiagnosticLoggingClient is leaking
2980         https://bugs.webkit.org/show_bug.cgi?id=144089
2981         <rdar://problem/19706214>
2982
2983         Reviewed by Darin Adler.
2984
2985         WebDiagnosticLoggingClient is leaking. It is constructed inside WebPage
2986         constructor but there is no code destroying it.
2987
2988         This patch adds a new xxxDestroyed() virtual function to
2989         DiagnosticLoggingClient and that is overriden in
2990         WebDiagnosticLoggingClient to call "delete this". This is the same
2991         pattern as for other WK2 clients (e.g. WebFrameLoaderClient,
2992         WebProgressTrackerClient).
2993
2994         * WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.cpp:
2995         (WebKit::WebDiagnosticLoggingClient::mainFrameDestroyed):
2996         * WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.h:
2997
2998 2015-04-23  Carlos Garcia Campos  <cgarcia@igalia.com>
2999
3000         [UNIX] Simplify the file descriptor handling in SharedMemory
3001         https://bugs.webkit.org/show_bug.cgi?id=144046
3002
3003         Reviewed by Darin Adler.
3004
3005         Simplify the file descriptor handling and clarify its ownership by
3006         using IPC::Attachment in SharedMemory::Handle instead of fd and
3007         size members. SharedMemory::Handle::adoptFromAttachment() has been
3008         renamed as SharedMemory::Handle::adoptAttachment() and receives an
3009         IPC::Attachment. And SharedMemory::Handle::releaseToAttachment()
3010         has been renamed as SharedMemory::Handle::releaseAttachment().
3011
3012         * Platform/IPC/Attachment.h: Add move constructor and move assigned operator.
3013         * Platform/IPC/Connection.h:
3014         (IPC::Connection::identifierIsNull): A file descriptor is null
3015         when it's -1 no 0.
3016         * Platform/IPC/unix/AttachmentUnix.cpp:
3017         (IPC::Attachment::Attachment):
3018         (IPC::Attachment::operator=):
3019         (IPC::Attachment::dispose): Reset the file descriptor after
3020         closing it.
3021         * Platform/IPC/unix/ConnectionUnix.cpp:
3022         (IPC::Connection::processMessage): Use
3023         SharedMemory::Handle::adoptAttachment() that receives an
3024         IPC::Attachment now.
3025         (IPC::Connection::sendOutgoingMessage): Use
3026         SharedMemory::Handle::releaseAttachment().
3027         * Platform/SharedMemory.h:
3028         * Platform/unix/SharedMemoryUnix.cpp:
3029         (WebKit::SharedMemory::Handle::Handle): Remove initializers for
3030         file descriptor and size members.
3031         (WebKit::SharedMemory::Handle::clear): Dispose the attachment.
3032         (WebKit::SharedMemory::Handle::isNull): Handle is null if the
3033         attachment file descriptor is -1.
3034         (WebKit::SharedMemory::Handle::encode): Use releaseAttachment().
3035         (WebKit::SharedMemory::Handle::decode): Use adoptAttachment().
3036         (WebKit::SharedMemory::Handle::releaseAttachment): Implement it
3037         using move.
3038         (WebKit::SharedMemory::Handle::adoptAttachment): Ditto.
3039         (WebKit::SharedMemory::map): Use
3040         IPC::Attachment::releaseFileDescriptor() instead of manually
3041         changing the member.
3042         (WebKit::SharedMemory::createHandle): Initialize the handle
3043         attachment with the duplicated file descriptor and size.
3044
3045 2015-04-22  Darin Adler  <darin@apple.com>
3046
3047         Remove OwnPtr and PassOwnPtr use from WebKit/cf, WebKit/mac, and WebKit2
3048         https://bugs.webkit.org/show_bug.cgi?id=143943
3049
3050         Reviewed by Anders Carlsson.
3051
3052         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h:
3053         Removed unneeded include.
3054
3055 2015-04-22  Brent Fulgham  <bfulgham@apple.com>
3056
3057         VisibleSelection should only accept Range by reference
3058         https://bugs.webkit.org/show_bug.cgi?id=144047
3059
3060         Reviewed by Tim Horton.
3061
3062         Update all uses of VisibleSelection to pass a Range reference instead
3063         of a Range pointer.
3064
3065         * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
3066         (WebKit::InjectedBundleRangeHandle::renderedImage):
3067         * WebProcess/WebPage/FindController.cpp:
3068         (WebKit::FindController::getImageForFindMatch):
3069         (WebKit::FindController::selectFindMatch):
3070         * WebProcess/WebPage/WebPage.cpp:
3071         (WebKit::WebPage::insertTextAsync):
3072         (WebKit::WebPage::setCompositionAsync):
3073         * WebProcess/WebPage/mac/WebPageMac.mm:
3074         (WebKit::WebPage::insertDictatedTextAsync):
3075
3076 2015-04-22  Anders Carlsson  <andersca@apple.com>
3077
3078         Add WK_ARRAY and WK_SET annotations
3079         https://bugs.webkit.org/show_bug.cgi?id=144075
3080         rdar://problem/19417770
3081
3082         Reviewed by Dan Bernstein.
3083
3084         * Shared/API/Cocoa/WKFoundation.h:
3085         * UIProcess/API/Cocoa/WKBackForwardList.h:
3086         * UIProcess/API/Cocoa/WKUserContentController.h:
3087         * UIProcess/API/Cocoa/WKWebsiteDataRecord.h:
3088         * UIProcess/API/Cocoa/WKWebsiteDataStore.h:
3089         * mac/postprocess-framework-headers.sh:
3090
3091 2015-04-22  Brent Fulgham  <bfulgham@apple.com>
3092
3093         Unreviewed build fix after r183136.
3094
3095         * WebProcess/WebPage/mac/WebPageMac.mm: Correct capitalization of
3096         'HTMLPluginImageElement.h' -> 'HTMLPlugInImageElement.h'
3097
3098 2015-04-21  Brent Fulgham  <bfulgham@apple.com>
3099
3100         Extend action menus to support PDF
3101         https://bugs.webkit.org/show_bug.cgi?id=143895
3102         <rdar://problem/19003333>
3103
3104         Reviewed by Tim Horton.
3105
3106         If the mouse pointer is over a PDF, try to provide a relevant action menu for whatever
3107         content is under the mouse. For now, we only support copying text and handling URLs.
3108
3109         If no text is selected, use the dictionary lookup service to find a semantically appropriate
3110         selection underneath the mouse. This is consistent with how normal text is treated in pure HTML
3111         views. If some text is already selected, and the mouse is over the existing selection, continue
3112         using the selected text. Otherwise, discard the old selection and select the most appropriate
3113         region under the mouse pointer.
3114
3115         * Shared/API/c/WKActionMenuTypes.h: Add PDF menu option.
3116         * Shared/WebMouseEvent.cpp: Recognize mouse force events as valid mouse events.
3117         * UIProcess/mac/WKActionMenuController.mm:
3118         (-[WKActionMenuController _defaultMenuItemsForPDF]): Add simply copy text option.
3119         (-[WKActionMenuController _defaultMenuItems]): Recognize PDFs and add relevant action
3120         menu entries.
3121         * WebProcess/Plugins/Netscape/NetscapePlugin.h: Provide stub for new method.
3122         * WebProcess/Plugins/PDF/PDFLayerControllerDetails.h: Expose 'rectsForSelectionInLayerSpace',
3123         'rectsForAnnotationInLayoutSpace', 'layout', and 'currentPage'.
3124         * WebProcess/Plugins/PDF/PDFPlugin.h:
3125         * WebProcess/Plugins/PDF/PDFPlugin.mm:
3126         (WebKit::PDFPlugin::getSelectionForWordAtPoint): Added.
3127         (WebKit::PDFPlugin::existingSelectionContainsPoint): Added.
3128         (WebKit::PDFPlugin::lookupTextAtLocation): Added.
3129         * WebProcess/Plugins/Plugin.h: Add declaration for new 'getSelectionForWordAtPoint' method.
3130         * WebProcess/Plugins/PluginProxy.h: Provide stub for new method.
3131         * WebProcess/Plugins/PluginView.cpp:
3132         (WebKit::PluginView::getSelectionForWordAtPoint): Added.
3133         (WebKit::PluginView::existingSelectionContainsPoint): Added.
3134         (WebKit::PluginView::lookupTextAtLocation): Added.
3135         * WebProcess/Plugins/PluginView.h:
3136         * WebProcess/WebPage/mac/WebPageMac.mm:
3137         (WebKit::WebPage::performActionMenuHitTestAtLocation): Update to support PDF documents and retrieve
3138         relevant content to support later action menu handling.
3139
3140 2015-04-22  Eric Carlson  <eric.carlson@apple.com>
3141
3142         Update AirPlay sandbox rules
3143         https://bugs.webkit.org/show_bug.cgi?id=144062
3144         <rdar://problem/19869448>
3145
3146         Reviewed by Alexey Proskuryakov.
3147
3148         * WebProcess/com.apple.WebProcess.sb.in: Remove obsolete rules.
3149
3150 2015-04-22  Alexey Proskuryakov  <ap@apple.com>
3151
3152         [Mac] In nightlies and local builds, WebKit services can get terminated under memory pressure
3153         https://bugs.webkit.org/show_bug.cgi?id=144052
3154         rdar://problem/19754404
3155
3156         Reviewed by Darin Adler.
3157
3158         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.Development.mm:
3159         (main): Make XPC transaction tracking work again after a re-exec.
3160
3161 2015-04-22  Zan Dobersek  <zdobersek@igalia.com>
3162
3163         [WK2] Have API::Array creation methods return Ref<>
3164         https://bugs.webkit.org/show_bug.cgi?id=143933
3165
3166         Reviewed by Darin Adler.
3167
3168         API::Array::create() and API::Array::createStringArray() should return Ref<> objects
3169         as the return values are never null. It's up to the caller to implicitly convert the
3170         returned objects to RefPtr<> if so required. All the call-sites have been updated to
3171         reflect that.
3172
3173         * Shared/API/APIArray.cpp:
3174         (API::Array::create):
3175         (API::Array::createStringArray):
3176         (API::Array::copy):
3177         * Shared/API/APIArray.h:
3178         * Shared/API/APIDictionary.cpp:
3179         (API::Dictionary::keys):
3180         * Shared/API/APIDictionary.h:
3181         * Shared/API/Cocoa/WKRemoteObjectCoder.mm:
3182         (ensureObjectStream):
3183         * Shared/API/c/WKArray.cpp:
3184         (WKArrayCreate):
3185         (WKArrayCreateAdoptingValues):
3186         * Shared/API/c/WKContextMenuItem.cpp:
3187         (WKContextMenuCopySubmenuItems):
3188         * Shared/API/c/WKDictionary.cpp:
3189         (WKDictionaryCopyKeys):
3190         * Shared/API/c/WKMutableArray.cpp:
3191         (WKMutableArrayCreate):
3192         * Shared/Cocoa/WKNSDictionary.mm:
3193         (-[WKNSDictionary keyEnumerator]):
3194         * Shared/SecurityOriginData.cpp:
3195         (WebKit::performAPICallbackWithSecurityOriginDataVector):
3196         * Shared/WebContextMenuItem.cpp:
3197         (WebKit::WebContextMenuItem::submenuItemsAsAPIArray):
3198         * Shared/WebContextMenuItem.h:
3199         * Shared/WebOpenPanelParameters.cpp:
3200         (WebKit::WebOpenPanelParameters::acceptMIMETypes):
3201         (WebKit::WebOpenPanelParameters::selectedFileNames):
3202         * Shared/WebOpenPanelParameters.h:
3203         * UIProcess/API/C/WKBackForwardListRef.cpp:
3204         (WKBackForwardListCopyBackListWithLimit):
3205         (WKBackForwardListCopyForwardListWithLimit):
3206         * UIProcess/API/C/WKGrammarDetail.cpp:
3207         (WKGrammarDetailCopyGuesses):
3208         * UIProcess/API/C/WKOpenPanelParameters.cpp:
3209         (WKOpenPanelParametersCopyAcceptedMIMETypes):
3210         (WKOpenPanelParametersCopySelectedFileNames):
3211         * UIProcess/API/C/WKPage.cpp:
3212         (WKPageSetPageContextMenuClient):
3213         (WKPageCopyRelatedPages):
3214         * UIProcess/API/Cocoa/WKBackForwardList.mm:
3215         (-[WKBackForwardList backList]):
3216         (-[WKBackForwardList forwardList]):
3217         * UIProcess/API/Cocoa/WKBrowsingContextGroup.mm:
3218         (createWKArray):
3219         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
3220         (-[WKWebsiteDataStore fetchDataRecordsOfTypes:completionHandler:]):
3221         * UIProcess/API/gtk/WebKitBackForwardList.cpp:
3222         (webkit_back_forward_list_get_back_list_with_limit):
3223         (webkit_back_forward_list_get_forward_list_with_limit):
3224         * UIProcess/API/gtk/WebKitFileChooserRequest.cpp:
3225         (webkit_file_chooser_request_get_mime_types):
3226         (webkit_file_chooser_request_get_mime_types_filter):
3227         (webkit_file_chooser_request_select_files):
3228         * UIProcess/API/gtk/WebKitNotificationProvider.cpp:
3229         (WebKitNotificationProvider::notificationCloseCallback):
3230         * UIProcess/Notifications/WebNotificationManagerProxy.cpp:
3231         (WebKit::WebNotificationManagerProxy::populateCopyOfNotificationPermissions):
3232         * UIProcess/Notifications/WebNotificationProvider.cpp:
3233         (WebKit::WebNotificationProvider::clearNotifications):
3234         * UIProcess/Plugins/WebPluginSiteDataManager.cpp:
3235         (WebKit::WebPluginSiteDataManager::didGetSitesWithData):
3236         * UIProcess/StatisticsRequest.cpp:
3237         (WebKit::StatisticsRequest::completedRequest):
3238         * UIProcess/UserContent/WebUserContentControllerProxy.cpp:
3239         (WebKit::WebUserContentControllerProxy::WebUserContentControllerProxy):
3240         * UIProcess/WebBackForwardList.cpp:
3241         (WebKit::WebBackForwardList::backList):
3242         (WebKit::WebBackForwardList::forwardList):
3243         (WebKit::WebBackForwardList::backListAsAPIArrayWithLimit):
3244         (WebKit::WebBackForwardList::forwardListAsAPIArrayWithLimit):
3245         * UIProcess/WebBackForwardList.h:
3246         * UIProcess/WebCookieManagerProxy.cpp:
3247         (WebKit::WebCookieManagerProxy::didGetHostnamesWithCookies):
3248         * UIProcess/WebDatabaseManagerProxy.cpp:
3249         (WebKit::WebDatabaseManagerProxy::didGetDatabasesByOrigin):
3250         (WebKit::WebDatabaseManagerProxy::didGetDatabaseOrigins):
3251         * UIProcess/WebGrammarDetail.cpp:
3252         (WebKit::WebGrammarDetail::guesses):
3253         * UIProcess/WebGrammarDetail.h:
3254         * UIProcess/WebKeyValueStorageManager.cpp:
3255         (WebKit::WebKeyValueStorageManager::getKeyValueStorageOrigins):
3256         (WebKit::WebKeyValueStorageManager::getStorageDetailsByOrigin):
3257         * UIProcess/WebMediaCacheManagerProxy.cpp:
3258         (WebKit::WebMediaCacheManagerProxy::didGetHostnamesWithMediaCache):
3259         * UIProcess/WebOriginDataManagerProxy.cpp:
3260         (WebKit::WebOriginDataManagerProxy::didGetOrigins):
3261         * UIProcess/WebPageProxy.cpp:
3262         (WebKit::WebPageProxy::didFindStringMatches):
3263         * UIProcess/WebProcessPool.cpp:
3264         (WebKit::WebProcessPool::pluginInfoStoreDidLoadPlugins):
3265         * UIProcess/ios/forms/WKFileUploadPanel.mm:
3266         (-[WKFileUploadPanel _chooseFiles:displayString:iconImage:]):
3267         (-[WKFileUploadPanel presentWithParameters:resultListener:]):
3268         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.mm:
3269         (-[WKWebProcessPlugInFrame childFrames]):
3270         * WebProcess/InjectedBundle/API/c/WKBundleBackForwardListItem.cpp:
3271         (WKBundleBackForwardListItemCopyChildren):
3272         * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
3273         (WKBundleFrameCopyChildFrames):
3274         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
3275         (WKBundlePageCopyTrackedRepaintRects):
3276         * WebProcess/InjectedBundle/InjectedBundleBackForwardListItem.cpp:
3277         (WebKit::InjectedBundleBackForwardListItem::children):
3278         * WebProcess/InjectedBundle/InjectedBundleBackForwardListItem.h:
3279         * WebProcess/InjectedBundle/InjectedBundlePageContextMenuClient.cpp:
3280         (WebKit::InjectedBundlePageContextMenuClient::getCustomMenuFromDefaultItems):
3281         * WebProcess/InjectedBundle/InjectedBundlePageFormClient.cpp:
3282         (WebKit::InjectedBundlePageFormClient::didAssociateFormControls):
3283         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp:
3284         (WebKit::InjectedBundlePageLoaderClient::featuresUsedInPage):
3285         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3286         (WebKit::findLargestFrameInFrameSet):
3287         * WebProcess/WebPage/WebFrame.cpp:
3288         (WebKit::WebFrame::childFrames):
3289         * WebProcess/WebPage/WebFrame.h:
3290         * WebProcess/WebPage/WebPage.cpp:
3291         (WebKit::WebPage::trackedRepaintRects):
3292         * WebProcess/WebPage/WebPage.h:
3293
3294 2015-04-21  Eric Carlson  <eric.carlson@apple.com>
3295
3296         [Mac] Use one playback target for all web processes
3297         https://bugs.webkit.org/show_bug.cgi?id=144009
3298
3299         Reviewed by Tim Horton.
3300
3301         Every WebPageProxy uses the WebMediaSessionManager singleton to talk to the playback target
3302         picker.
3303
3304         * UIProcess/PageClient.h:
3305         * UIProcess/WebPageProxy.cpp:
3306         (WebKit::WebPageProxy::WebPageProxy):
3307         (WebKit::WebPageProxy::resetState):
3308         (WebKit::WebPageProxy::isPlayingMediaDidChange):
3309         (WebKit::WebPageProxy::addPlaybackTargetPickerClient):
3310         (WebKit::WebPageProxy::removePlaybackTargetPickerClient):
3311         (WebKit::WebPageProxy::showPlaybackTargetPicker):
3312         (WebKit::WebPageProxy::playbackTargetPickerClientStateDidChange):
3313         (WebKit::WebPageProxy::setPlaybackTarget):
3314         (WebKit::WebPageProxy::externalOutputDeviceAvailableDidChange):
3315         (WebKit::WebPageProxy::setShouldPlayToPlaybackTarget):
3316         (WebKit::WebPageProxy::devicePickerProxy): Deleted.
3317         (WebKit::WebPageProxy::startingMonitoringPlaybackTargets): Deleted.
3318         (WebKit::WebPageProxy::stopMonitoringPlaybackTargets): Deleted.
3319         (WebKit::WebPageProxy::didChoosePlaybackTarget): Deleted.
3320         * UIProcess/WebPageProxy.h:
3321         (WebKit::WebPageProxy::isPlayingAudio):
3322         * UIProcess/WebPageProxy.messages.in:
3323         * UIProcess/mac/PageClientImpl.h:
3324         * UIProcess/mac/PageClientImpl.mm:
3325         (WebKit::PageClientImpl::mediaSessionManager):
3326         (WebKit::PageClientImpl::createPlaybackTargetPicker): Deleted.
3327         * UIProcess/mac/WebMediaSessionManagerMac.cpp: Added.
3328         (WebKit::WebMediaSessionManagerMac::singleton):
3329         (WebKit::WebMediaSessionManagerMac::WebMediaSessionManagerMac):
3330         (WebKit::WebMediaSessionManagerMac::~WebMediaSessionManagerMac):
3331         (WebKit::WebMediaSessionManagerMac::targetPicker):
3332         * UIProcess/mac/WebMediaSessionManagerMac.h: Added.
3333         * WebProcess/Plugins/PluginView.h:
3334         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3335         (WebKit::WebChromeClient::isPlayingMediaDidChange):
3336         (WebKit::WebChromeClient::addPlaybackTargetPickerClient):
3337         (WebKit::WebChromeClient::removePlaybackTargetPickerClient):
3338         (WebKit::WebChromeClient::showPlaybackTargetPicker):
3339         (WebKit::WebChromeClient::playbackTargetPickerClientStateDidChange):
3340         (WebKit::WebChromeClient::startingMonitoringPlaybackTargets): Deleted.
3341         (WebKit::WebChromeClient::stopMonitoringPlaybackTargets): Deleted.
3342         * WebProcess/WebCoreSupport/WebChromeClient.h:
3343         * WebProcess/WebPage/WebPage.h:
3344         * WebProcess/WebPage/WebPage.messages.in:
3345         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
3346         (WebKit::TiledCoreAnimationDrawingArea::dispatchAfterEnsuringUpdatedScrollPosition):
3347         * WebProcess/WebPage/mac/WebPageMac.mm:
3348         (WebKit::WebPage::playbackTargetSelected):
3349         (WebKit::WebPage::playbackTargetAvailabilityDidChange):
3350         (WebKit::WebPage::setShouldPlayToPlaybackTarget):
3351
3352 2015-04-21  Anders Carlsson  <andersca@apple.com>
3353
3354         WKWebsiteDataStore doesn't track and remove IndexedDB databases
3355         https://bugs.webkit.org/show_bug.cgi?id=144032
3356         rdar://problem/20242856
3357
3358         Reviewed by Tim Horton.
3359
3360         * DatabaseProcess/DatabaseProcess.cpp:
3361         (WebKit::DatabaseProcess::fetchWebsiteData):
3362         (WebKit::DatabaseProcess::deleteWebsiteData):
3363         (WebKit::DatabaseProcess::deleteWebsiteDataForOrigins):
3364         * DatabaseProcess/DatabaseProcess.h:
3365         * DatabaseProcess/DatabaseProcess.messages.in:
3366         * Shared/WebsiteData/WebsiteDataTypes.h:
3367         * UIProcess/API/Cocoa/WKWebsiteDataRecord.h:
3368         * UIProcess/API/Cocoa/WKWebsiteDataRecord.mm:
3369         (dataTypesToString):
3370         * UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h:
3371         (WebKit::toWebsiteDataTypes):
3372         (WebKit::toWKWebsiteDataTypes):
3373         * UIProcess/Databases/DatabaseProcessProxy.cpp:
3374         (WebKit::generateCallbackID):
3375         (WebKit::DatabaseProcessProxy::~DatabaseProcessProxy):
3376         (WebKit::DatabaseProcessProxy::fetchWebsiteData):
3377         (WebKit::DatabaseProcessProxy::deleteWebsiteData):
3378         (WebKit::DatabaseProcessProxy::deleteWebsiteDataForOrigins):
3379         (WebKit::DatabaseProcessProxy::didClose):
3380         (WebKit::DatabaseProcessProxy::didFetchWebsiteData):
3381         (WebKit::DatabaseProcessProxy::didDeleteWebsiteData):
3382         (WebKit::DatabaseProcessProxy::didDeleteWebsiteDataForOrigins):
3383         * UIProcess/Databases/DatabaseProcessProxy.h:
3384         * UIProcess/Databases/DatabaseProcessProxy.messages.in:
3385         * UIProcess/WebProcessPool.h:
3386         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3387         (WebKit::WebsiteDataStore::fetchData):
3388         (WebKit::WebsiteDataStore::removeData):
3389
3390 2015-04-21  Anders Carlsson  <andersca@apple.com>
3391
3392         Add module maps for WebKit
3393         https://bugs.webkit.org/show_bug.cgi?id=144026
3394         rdar://problem/19665428
3395
3396         Reviewed by Dan Bernstein.
3397
3398         * Configurations/WebKit.xcconfig:
3399         * Modules/OSX.modulemap: Added.
3400         * Modules/iOS.modulemap: Added.
3401
3402 2015-04-21  Tim Horton  <timothy_horton@apple.com>
3403
3404         Long pause under _takeViewSnapshot when screen updates are disabled
3405         https://bugs.webkit.org/show_bug.cgi?id=144017
3406         <rdar://problem/20548397>
3407
3408         Reviewed by Simon Fraser.
3409
3410         * UIProcess/API/mac/WKView.mm:
3411         (-[WKView _takeViewSnapshot]):
3412         Use CGSHWCaptureWindowList, for snapshotting that doesn't block on
3413         the next commit, and can succeed while screen updates are disabled
3414         without blocking.
3415
3416 2015-04-21  Chris Dumez  <cdumez@apple.com>
3417
3418         [WK2][NetworkCache] Better account of resource revalidations in efficacy logging
3419         https://bugs.webkit.org/show_bug.cgi?id=144014
3420
3421         Reviewed by Antti Koivisto.
3422
3423         Better account of resource revalidations in efficacy logging.
3424         Prevously, resources that were in the cache but needed revalidation
3425         were counted as retrieval successes, which is not entirely accurate.
3426
3427         We now distinguish "is in the cache and is directly usable" from
3428         "is in the cache but needs revalidation". We also log how many of these
3429         revalidations are successful.
3430
3431         * NetworkProcess/NetworkResourceLoader.cpp:
3432         (WebKit::NetworkResourceLoader::didReceiveResponseAsync):
3433         * NetworkProcess/cache/NetworkCache.cpp:
3434         (WebKit::NetworkCache::Cache::update):
3435         * NetworkProcess/cache/NetworkCache.h:
3436         * NetworkProcess/cache/NetworkCacheStatistics.cpp:
3437         (WebKit::NetworkCache::Statistics::recordRetrievedCachedEntry):
3438         (WebKit::NetworkCache::Statistics::recordRevalidationSuccess):
3439         * NetworkProcess/cache/NetworkCacheStatistics.h:
3440
3441 2015-04-21  Dan Bernstein  <mitz@apple.com>
3442
3443         [Cocoa] Framework header postprocessing should respect additional definitions
3444         https://bugs.webkit.org/show_bug.cgi?id=144018
3445
3446         Reviewed by Anders Carlsson.
3447
3448         * mac/postprocess-framework-headers.sh: Read definitons from
3449         /usr/local/include/WebKitAdditions/Scripts/postprocess-framework-headers-definitions, and
3450         have them take precedence over OSX_VERSION and IOS_VERSION and supply additional options to
3451         sed.
3452
3453 2015-04-21  Anders Carlsson  <andersca@apple.com>
3454
3455         Fix block signatures
3456         https://bugs.webkit.org/show_bug.cgi?id=144002
3457
3458         Reviewed by Andreas Kling.
3459
3460         * UIProcess/API/Cocoa/WKUIDelegate.h:
3461         * UIProcess/API/Cocoa/WKWebsiteDataStore.h:
3462         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
3463         (-[WKWebsiteDataStore removeDataOfTypes:modifiedSince:completionHandler:]):
3464         (-[WKWebsiteDataStore removeDataOfTypes:forDataRecords:completionHandler:]):
3465         * UIProcess/API/Cocoa/_WKWebsiteDataStore.h:
3466         * UIProcess/API/Cocoa/_WKWebsiteDataStore.mm:
3467         (-[_WKWebsiteDataStore removeDataOfTypes:forDataRecords:completionHandler:]):
3468         (-[_WKWebsiteDataStore removeDataOfTypes:modifiedSince:completionHandler:]):
3469         * UIProcess/ios/WKPDFView.mm:
3470         (-[WKPDFView _highlightLinkAnnotation:forDuration:completionHandler:]):
3471         * UIProcess/ios/forms/WKFileUploadPanel.mm:
3472         (-[WKFileUploadPanel _processMediaInfoDictionaries:successBlock:failureBlock:]):
3473         (-[WKFileUploadPanel _processMediaInfoDictionaries:atIndex:processedResults:processedImageCount:processedVideoCount:successBlock:failureBlock:]):
3474         (-[WKFileUploadPanel _uploadItemFromMediaInfo:successBlock:failureBlock:]):
3475
3476 2015-04-21  Timothy Horton  <timothy_horton@apple.com>
3477
3478         PDFs still don't snapshot properly in iOS Safari
3479         https://bugs.webkit.org/show_bug.cgi?id=143976
3480         <rdar://problem/18283459>
3481
3482         Reviewed by Anders Carlsson.
3483
3484         * UIProcess/WebPageProxy.cpp:
3485         (WebKit::WebPageProxy::didLayoutForCustomContentProvider):
3486         * UIProcess/WebPageProxy.h:
3487        &nb