[iOS][WK2] Rotating a zoomed PDF leads to weird scrolling behavior
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2014-06-25  Timothy Horton  <timothy_horton@apple.com>
2
3         [iOS][WK2] Rotating a zoomed PDF leads to weird scrolling behavior
4         https://bugs.webkit.org/show_bug.cgi?id=134286
5
6         Reviewed by Benjamin Poulain.
7
8         * UIProcess/ios/WKPDFView.mm:
9         (-[WKPDFView _computePageAndDocumentFrames]):
10         The WKPDFView frame and scroll view content size need to be scaled.
11
12         (-[WKPDFView web_setScrollView:]): Deleted.
13
14         (-[WKPDFView web_initWithFrame:webView:]):
15         Get rid of _documentFrame, and don't set it at initWithFrame: time (it's not useful yet).
16
17 2014-06-25  Laszlo Gombos  <l.gombos@samsung.com>
18
19         Remove build guard for progress element
20         https://bugs.webkit.org/show_bug.cgi?id=134292
21
22         Reviewed by Benjamin Poulain.
23
24         * Configurations/FeatureDefines.xcconfig:
25
26 2014-06-24  Carlos Garcia Campos  <cgarcia@igalia.com>
27
28         [GTK] Windowed plugins visibility doesn't work
29         https://bugs.webkit.org/show_bug.cgi?id=131487
30
31         Reviewed by Anders Carlsson.
32
33         Implement plugins visibility changes and add a new message to
34         notify the UI process when a windowed plugin is shown/hidden to
35         show/hide the plugin widget.
36
37         * PluginProcess/PluginControllerProxy.cpp:
38         (WebKit::PluginControllerProxy::visibilityDidChange): Add
39         implementation to notify the plugin about visibility change.
40         (WebKit::PluginControllerProxy::windowedPluginVisibilityDidChange):
41         Send WindowedPluginVisibilityDidChange to the plugin proxy.
42         * PluginProcess/PluginControllerProxy.h:
43         * PluginProcess/PluginControllerProxy.messages.in: Add VisibilityDidChange message.
44         * UIProcess/WebPageProxy.h: Add windowedPluginVisibilityDidChange
45         to handle WindowedPluginVisibilityDidChange message.
46         * UIProcess/WebPageProxy.messages.in: Add WindowedPluginVisibilityDidChange message.
47         * UIProcess/efl/WebPageProxyEfl.cpp:
48         (WebKit::WebPageProxy::windowedPluginVisibilityDidChange):
49         * UIProcess/gtk/WebPageProxyGtk.cpp:
50         (WebKit::WebPageProxy::createPluginContainer): Do not show the
51         plugins by default.
52         (WebKit::WebPageProxy::windowedPluginVisibilityDidChange): Show or hide the plugin widget.
53         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
54         (WebKit::NetscapePlugin::NetscapePlugin): Initialize m_isVisible.
55         (WebKit::NetscapePlugin::visibilityDidChange): Add visible parameter and save it in m_isVisible
56         member, calling platformVisibilityDidChange() only when it has actually changed.
57         * WebProcess/Plugins/Netscape/NetscapePlugin.h:
58         * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:
59         (WebKit::NetscapePlugin::platformVisibilityDidChange): Notify the controller about visibility change.
60         * WebProcess/Plugins/PDF/PDFPlugin.h:
61         * WebProcess/Plugins/Plugin.h:
62         * WebProcess/Plugins/PluginController.h:
63         * WebProcess/Plugins/PluginProxy.cpp:
64         (WebKit::PluginProxy::visibilityDidChange): Send VisibilityDidChange message to the plugin controller proxy.
65         (WebKit::PluginProxy::windowedPluginVisibilityDidChange): Notify the controller about visibility change.
66         * WebProcess/Plugins/PluginProxy.h:
67         * WebProcess/Plugins/PluginProxy.messages.in: Add WindowedPluginVisibilityDidChange message.
68         * WebProcess/Plugins/PluginView.cpp:
69         (WebKit::PluginView::didInitializePlugin): Also call viewVisibilityDidChange() when the plugin is initialized.
70         (WebKit::PluginView::setParentVisible): Override this Widget method to update the plugin visibility when parent
71         widget is shown/hidden.
72         (WebKit::PluginView::viewVisibilityDidChange): Pass visible parameter to visibilityDidChange().
73         (WebKit::PluginView::windowedPluginVisibilityDidChange): Send WindowedPluginVisibilityDidChange message to the UI process.
74         * WebProcess/Plugins/PluginView.h:
75
76 2014-06-24  Benjamin Poulain  <bpoulain@apple.com>
77
78         [iOS][WK2] We should not start potential tap activation unless the tap gesture recognizer succeed
79         https://bugs.webkit.org/show_bug.cgi?id=134277
80         <rdar://problem/17439973>
81
82         Reviewed by Anders Carlsson.
83
84         * UIProcess/ios/WKSyntheticClickTapGestureRecognizer.m:
85         (-[WKSyntheticClickTapGestureRecognizer setState:]):
86         We were calling the _gestureRecognizedAction even for failure states. The potential activation work
87         is not light on the Web Process, we should not start if we don't care about the result.
88
89 2014-06-24  Benjamin Poulain  <bpoulain@apple.com>
90
91         [iOS][WK2] Adopt the C API of UIWebTouchEventsGestureRecognizer for touch event mapping
92         https://bugs.webkit.org/show_bug.cgi?id=134234
93
94         Reviewed by Tim Horton.
95
96         The C API is more efficient and expose properties we will need for other patches. This patch moves from
97         getting each value independently on UIWebTouchEventsGestureRecognizer to the single structure exposed
98         by _UIWebTouchEvent.
99
100         * Shared/NativeWebTouchEvent.h:
101         * Shared/ios/NativeWebTouchEventIOS.mm:
102         (WebKit::convertTouchPhase):
103         (WebKit::extractWebTouchPoint):
104         (WebKit::NativeWebTouchEvent::NativeWebTouchEvent):
105         * UIProcess/ios/WKContentViewInteraction.mm:
106         (-[WKContentView _webTouchEventsRecognized:]):
107
108 2014-06-24  Joseph Pecoraro  <pecoraro@apple.com>
109
110         [iOS]: WK2 Inspector Node Highlighting
111         https://bugs.webkit.org/show_bug.cgi?id=134257
112
113         Reviewed by Timothy Hatcher.
114
115         * Scripts/webkit2/messages.py:
116         (struct_or_class):
117         (headers_for_type):
118         * Shared/WebCoreArgumentCoders.h:
119         * Shared/WebCoreArgumentCoders.cpp:
120         (IPC::ArgumentCoder<Highlight>::encode):
121         (IPC::ArgumentCoder<Highlight>::decode):
122         Add a way to encode a WebCore::Highlight struct.
123
124         * UIProcess/API/Cocoa/WKWebViewInternal.h:
125         * UIProcess/API/Cocoa/WKWebView.mm:
126         (-[WKWebView _showInspectorHighlight:WebCore::]):
127         (-[WKWebView _hideInspectorHighlight]):
128         * UIProcess/PageClient.h:
129         * UIProcess/WebPageProxy.h:
130         * UIProcess/WebPageProxy.messages.in:
131         * UIProcess/ios/PageClientImplIOS.h:
132         * UIProcess/ios/PageClientImplIOS.mm:
133         (WebKit::PageClientImpl::showInspectorHighlight):
134         (WebKit::PageClientImpl::hideInspectorHighlight):
135         * UIProcess/ios/WebPageProxyIOS.mm:
136         (WebKit::WebPageProxy::showInspectorHighlight):
137         (WebKit::WebPageProxy::hideInspectorHighlight):
138         * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
139         (WebKit::WebInspectorClient::highlight):
140         (WebKit::WebInspectorClient::hideHighlight):
141         * WebProcess/WebPage/WebPage.h:
142         * WebProcess/WebPage/ios/WebPageIOS.mm:
143         (WebKit::WebPage::showInspectorHighlight):
144         (WebKit::WebPage::hideInspectorHighlight):
145         Send web process highlight / hideHighlight messages up to
146         the UIProcess so it can highlight in the WKContentView.
147         Pass up a WebCore::Highlight in Document coordinates.
148
149         * UIProcess/ios/WKContentView.h:
150         * UIProcess/ios/WKContentView.mm:
151         (-[WKInspectorHighlightView initWithFrame:]):
152         (-[WKInspectorHighlightView dealloc]):
153         (-[WKInspectorHighlightView _removeAllLayers]):
154         (-[WKInspectorHighlightView _createLayers:]):
155         (findIntersectionOnLineBetweenPoints):
156         (quadIntersection):
157         (layerPathWithHole):
158         (layerPath):
159         (-[WKInspectorHighlightView _layoutForNodeHighlight:]):
160         (-[WKInspectorHighlightView _layoutForRectsHighlight:]):
161         (-[WKInspectorHighlightView update:]):
162         Reuse the WebKit1 code to turn highlight float quads into CAShapeLayers.
163
164         (-[WKContentView _showInspectorHighlight:WebCore::]):
165         (-[WKContentView _hideInspectorHighlight]):
166         Show and hide the highlight view with the respective WebCore::Highlight.
167
168 2014-06-24  Anders Carlsson  <andersca@apple.com>
169
170         Simplify decodeLegacySessionState
171         https://bugs.webkit.org/show_bug.cgi?id=134280
172
173         Reviewed by Andreas Kling.
174
175         There's no need to use a LegacySessionStateDecoder object with a single member,
176         just make all functions static and only export a single entry point; decodeLegacySessionState.
177
178         No functionality change, just moving code around.
179
180         * UIProcess/API/C/WKSessionStateRef.cpp:
181         (WKSessionStateCreateFromData):
182         * UIProcess/mac/LegacySessionStateCoding.cpp:
183         (WebKit::decodeSessionHistoryEntryData):
184         (WebKit::decodeSessionHistoryEntry):
185         (WebKit::decodeSessionHistoryEntries):
186         (WebKit::decodeV0SessionHistory):
187         (WebKit::decodeV1SessionHistory):
188         (WebKit::decodeSessionHistory):
189         (WebKit::decodeLegacySessionState):
190         (WebKit::LegacySessionStateDecoder::LegacySessionStateDecoder): Deleted.
191         (WebKit::LegacySessionStateDecoder::~LegacySessionStateDecoder): Deleted.
192         (WebKit::LegacySessionStateDecoder::decodeSessionState): Deleted.
193         (WebKit::LegacySessionStateDecoder::decodeSessionHistory): Deleted.
194         (WebKit::LegacySessionStateDecoder::decodeV0SessionHistory): Deleted.
195         (WebKit::LegacySessionStateDecoder::decodeV1SessionHistory): Deleted.
196         (WebKit::LegacySessionStateDecoder::decodeSessionHistoryEntries): Deleted.
197         (WebKit::LegacySessionStateDecoder::decodeSessionHistoryEntry): Deleted.
198         (WebKit::LegacySessionStateDecoder::decodeSessionHistoryEntryData): Deleted.
199         * UIProcess/mac/LegacySessionStateCoding.h:
200
201 2014-06-24  Brady Eidson  <beidson@apple.com>
202
203         Enable GAMEPAD in the Mac build, but disabled at runtime.
204         https://bugs.webkit.org/show_bug.cgi?id=134255
205
206         Reviewed by Dean Jackson.
207
208         * Configurations/FeatureDefines.xcconfig:
209
210         * Shared/WebPreferencesDefinitions.h:
211         * UIProcess/API/C/WKPreferences.cpp:
212         (WKPreferencesSetGamepadsEnabled):
213         (WKPreferencesGetGamepadsEnabled):
214         * UIProcess/API/C/WKPreferencesRefPrivate.h:
215
216         * WebProcess/WebPage/WebPage.cpp:
217         (WebKit::WebPage::updatePreferences):
218
219 2014-06-24  Anders Carlsson  <andersca@apple.com>
220
221         Add support for v0 legacy decoding
222         https://bugs.webkit.org/show_bug.cgi?id=134275
223
224         Reviewed by Andreas Kling.
225
226         * Shared/SessionState.h:
227         * UIProcess/mac/LegacySessionStateCoding.cpp:
228         (WebKit::LegacySessionStateDecoder::decodeV0SessionHistory):
229         (WebKit::LegacySessionStateDecoder::decodeV1SessionHistory):
230
231 2014-06-24  Anders Carlsson  <andersca@apple.com>
232
233         Add SPI for clearing an entire back-forward list
234         https://bugs.webkit.org/show_bug.cgi?id=134274
235
236         Reviewed by Dan Bernstein.
237
238         Add -[WKBackForwardList _clear] which only clears the back-forward items, and
239         change -[WKBackForwardList _removeAllItems] to remove all items including the current one.
240
241         * UIProcess/API/Cocoa/WKBackForwardList.mm:
242         (-[WKBackForwardList _removeAllItems]):
243         (-[WKBackForwardList _clear]):
244         * UIProcess/API/Cocoa/WKBackForwardListPrivate.h:
245         * UIProcess/WebBackForwardList.cpp:
246         (WebKit::WebBackForwardList::removeAllItems):
247         * UIProcess/WebBackForwardList.h:
248
249 2014-06-24  Anders Carlsson  <andersca@apple.com>
250
251         Add iOS specific frame state member variables
252         https://bugs.webkit.org/show_bug.cgi?id=134268
253
254         Reviewed by Andreas Kling.
255
256         * Shared/SessionState.cpp:
257         (WebKit::FrameState::encode):
258         (WebKit::FrameState::decode):
259         * Shared/SessionState.h:
260         * UIProcess/mac/LegacySessionStateCoding.cpp:
261         (WebKit::HistoryEntryDataDecoder::operator>>):
262         (WebKit::decodeBackForwardTreeNode):
263         * WebProcess/WebCoreSupport/SessionStateConversion.cpp:
264         (WebKit::toFrameState):
265         (WebKit::applyFrameState):
266
267 2014-06-24  Enrica Casucci  <enrica@apple.com>
268
269         iOS WebKit2: block selection tends to prefer block to single words even when the page is zoomed.
270         https://bugs.webkit.org/show_bug.cgi?id=134267
271         <rdar://problem/17138059>
272
273         Reviewed by Benjamin Poulain.
274
275         When trying to find the best selection match for the position where the tap occurs,
276         we need to take into account the page scale. This patch applies the scale factor
277         to the selection rect before comparing it with the desired size.
278
279         * WebProcess/WebPage/ios/WebPageIOS.mm:
280         (WebKit::WebPage::rangeForWebSelectionAtPosition):
281
282 2014-06-24  Anders Carlsson  <andersca@apple.com>
283
284         Add code to convert HistoryItem to PageState
285         https://bugs.webkit.org/show_bug.cgi?id=134263
286
287         Reviewed by Andreas Kling.
288
289         * WebProcess/WebCoreSupport/SessionStateConversion.cpp:
290         (WebKit::toHTTPBody):
291         (WebKit::toFrameState):
292         (WebKit::toPageState):
293         * WebProcess/WebCoreSupport/SessionStateConversion.h:
294
295 2014-06-24  Andreas Kling  <akling@apple.com>
296
297         [iOS WebKit2] Disable screen font substitution by default.
298         <https://webkit.org/b/134266>
299         <rdar://problem/17427740>
300
301         Just like OS X >= 10.9, screen font substitution should be disabled
302         by default in WebKit2 for iOS.
303
304         Reviewed by Anders Carlsson.
305
306         * Shared/WebPreferencesDefinitions.h:
307
308 2014-06-24  Anders Carlsson  <andersca@apple.com>
309
310         Add PageState to HistoryItem conversion code
311         https://bugs.webkit.org/show_bug.cgi?id=134259
312
313         Reviewed by Andreas Kling.
314
315         * Shared/SessionState.h:
316         * UIProcess/mac/LegacySessionStateCoding.cpp:
317         (WebKit::decodeBackForwardTreeNode):
318         * WebKit2.xcodeproj/project.pbxproj:
319         * WebProcess/WebCoreSupport/SessionStateConversion.cpp: Added.
320         (WebKit::toFormData):
321         (WebKit::applyFrameState):
322         (WebKit::toHistoryItem):
323         * WebProcess/WebCoreSupport/SessionStateConversion.h: Added.
324
325 2014-06-24  Antti Koivisto  <antti@apple.com>
326
327         Only flush layers when the exposed rect actually changes
328         https://bugs.webkit.org/show_bug.cgi?id=134248
329
330         Reviewed by Anders Carlsson.
331
332         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
333         (WebKit::RemoteLayerTreeDrawingArea::setExposedContentRect):
334
335 2014-06-24  Martin Hock  <mhock@apple.com>
336
337         [iOS] DOMWindow::outerWidth and outerHeight don't return useful values, so return 0.
338         Also, revert r169281.
339         https://bugs.webkit.org/show_bug.cgi?id=134233
340         <rdar://problem/17060183>
341
342         Reviewed by Benjamin Poulain.
343
344         * UIProcess/Cocoa/UIDelegate.h:
345         * UIProcess/Cocoa/UIDelegate.mm:
346         (WebKit::UIDelegate::UIClient::windowFrame): Deleted.
347         * UIProcess/ios/PageClientImplIOS.mm:
348         (WebKit::PageClientImpl::convertToUserSpace):
349
350 2014-06-24  Jeremy Jones  <jeremyj@apple.com>
351
352         Initialize WKWebViewConfiguration properties to their default values.
353         https://bugs.webkit.org/show_bug.cgi?id=134216
354
355         Reviewed by Anders Carlsson.
356
357         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
358         (-[WKWebViewConfiguration init]):
359         add -init method to initialize _mediaPlaybackRequiresUserAction and _mediaPlaybackAllowsAirPlay.
360
361 2014-06-24  Anders Carlsson  <andersca@apple.com>
362
363         Add missing semicolon.
364
365         * UIProcess/API/Cocoa/WKWebView.mm:
366         (-[WKWebView _updateVisibleContentRects]):
367
368 2014-06-24  Eva Balazsfalvi  <evab.u-szeged@partner.samsung.com>
369
370         Fix unused parameter warnings if inspector is disabled
371         https://bugs.webkit.org/show_bug.cgi?id=134244
372
373         Reviewed by Zalan Bujtas.
374
375         * WebProcess/InjectedBundle/API/c/WKBundleInspector.cpp:
376         (WKBundleInspectorShow):
377         (WKBundleInspectorClose):
378         (WKBundleInspectorEvaluateScriptForTest):
379         (WKBundleInspectorSetPageProfilingEnabled):
380
381 2014-06-24  Anders Carlsson  <andersca@apple.com>
382
383         WKWebView doesn't respect -[UIScrollView contentInset]
384         https://bugs.webkit.org/show_bug.cgi?id=134230
385         <rdar://problem/17429107>
386
387         Reviewed by Tim Horton.
388
389         * UIProcess/API/Cocoa/WKWebView.mm:
390         (-[WKWebView _setHasCustomContentView:loadedMIMEType:WTF::]):
391         Call initWithFrame and pass the WKWebView along.
392
393         (-[WKWebView _adjustedContentOffset:]):
394         New helper method that takes a content offset as a CGPoint and offsets it by the computed content inset.
395
396         (-[WKWebView _computedContentInset]):
397         New helper method that returns the _obscuredInsets, or if it's zero, the scroll view's content inset.
398
399         (-[WKWebView _processDidExit]):
400         Use _computedContentInset.
401
402         (-[WKWebView _didCommitLayerTree:WebKit::]):
403         use _computedContentInset.
404
405         (-[WKWebView _dynamicViewportUpdateChangedTargetToScale:position:]):
406         Use _computedContentInset.
407
408         (-[WKWebView _scrollToContentOffset:WebCore::]):
409         Use _computedContentInset.
410
411         (-[WKWebView _updateVisibleContentRects]):
412         If we have a custom content view, call web_computedContentInsetDidChange.
413
414         (-[WKWebView _setObscuredInsets:]):
415         Don't call web_setObscuredInsets: if we have a custom content view.
416
417         * UIProcess/API/Cocoa/WKWebViewInternal.h:
418         Add new methods.
419
420         * UIProcess/Cocoa/WKWebViewContentProvider.h:
421         Add new methods.
422
423         * UIProcess/ios/WKPDFView.mm:
424         (-[WKPDFView web_initWithFrame:webView:]):
425         Set the _webView and _scrollView ivars.
426
427         (-[WKPDFView _offsetForPageNumberIndicator]):
428         Get the computed content offset from the WKWebView.
429
430         (-[WKPDFView web_computedContentInsetDidChange]):
431         Update the page indicator.
432         
433         (-[WKPDFView initWithFrame:]): Deleted.
434         (-[WKPDFView web_setObscuredInsets:]): Deleted.
435
436         * UIProcess/ios/WKScrollView.mm:
437         (-[WKScrollView setContentInset:]):
438         Call _updateVisibleContentRects.
439
440 2014-06-23  Jaehun Lim  <ljaehun.lim@samsung.com>
441
442         Unreviewed, fix build warning.
443
444         Source/WebKit2/WebProcess/WebPage/DrawingArea.h:117:18: warning: unused parameter ‘wantsDidUpdateViewState’ [-Wunused-parameter]
445
446         * WebProcess/WebPage/DrawingArea.h:
447         (WebKit::DrawingArea::viewStateDidChange):
448
449 2014-06-23  Ryuan Choi  <ryuan.choi@samsung.com>
450
451         [EFL] Replace RefPtr<Evas_Object> with UniquePtrEfl
452         https://bugs.webkit.org/show_bug.cgi?id=134236
453
454         Reviewed by Gyuyoung Kim.
455
456         * PlatformEfl.cmake:
457         * UIProcess/API/efl/EwkView.cpp:
458         (EwkView::updateCursor):
459         * UIProcess/API/efl/EwkView.h:
460         * UIProcess/API/efl/SnapshotImageGL.cpp:
461         * UIProcess/API/efl/ewk_favicon_database.cpp:
462         (ewk_favicon_database_icon_get):
463         * UIProcess/API/efl/tests/test_ewk2_refptr_evas_object.cpp: Removed.
464
465 2014-06-23  Daniel Bates  <dabates@apple.com>
466
467         [iOS][WK2] REGRESSION (r169324): Page jumps to top when you type into a text field
468         https://bugs.webkit.org/show_bug.cgi?id=134219
469         <rdar://problem/17279113>
470
471         Reviewed by Benjamin Poulain.
472
473         Fixes an issue where typing into a text field may cause a noticeable jump to the top of
474         the page.
475
476         Currently when updating the visual content rectangles we always constrain the scroll offset
477         (s_x, s_y) such that 0 <= s_x <= "content width" - "visible width" and 0 <= s_y <= "content height" - "visible height".
478         However the UIProcess may want to scroll the page by an offset outside of this range to
479         create a visually pleasing result. In particular, on iOS we may scroll the page slightly
480         outside of this range (e.g. s_y > 0 = "content height" - "visible height") when a form
481         control is focused so as to be consistent with platform convention.
482
483         * WebProcess/WebPage/ios/WebPageIOS.mm:
484         (WebKit::WebPage::updateVisibleContentRects): Temporarily disable content edge constraint when
485         updating scroll offset.
486
487 2014-06-23  Dan Bernstein  <mitz@apple.com>
488
489         <rdar://problem/17413374> [iOS] Application cache size per origin is not limited
490         https://bugs.webkit.org/show_bug.cgi?id=134229
491
492         Reviewed by Anders Carlsson.
493
494         * UIProcess/WebContext.cpp:
495         (WebKit::WebContext::createNewWebProcess): Set the default quota per origin to the same
496         value it is set in Legacy WebKit.
497
498 2014-06-23  Ryuan Choi  <ryuan.choi@samsung.com>
499
500         Unreviewed, EFL build fix after r170330.
501
502         * WebProcess/WebPage/WebPage.cpp: Guard WKStringCF.h with PLATFORM(COCOA) macro.
503
504 2014-06-23  Timothy Horton  <timothy_horton@apple.com>
505
506         [WK2] Use the page background color instead of white when swipe snapshots were purged (134218)
507         https://bugs.webkit.org/show_bug.cgi?id=134218
508         <rdar://problem/17426454>
509
510         Reviewed by Benjamin Poulain.
511
512         * UIProcess/API/Cocoa/WKWebView.mm:
513         (-[WKWebView _updateScrollViewBackground]):
514         (-[WKWebView WebKit::]):
515         * UIProcess/API/mac/WKView.mm:
516         (-[WKView _takeViewSnapshot]):
517         * UIProcess/ios/ViewGestureControllerIOS.mm:
518         (WebKit::ViewGestureController::beginSwipeGesture):
519         * UIProcess/mac/ViewGestureControllerMac.mm:
520         (WebKit::ViewGestureController::shouldUseSnapshotForSize):
521         (WebKit::ViewGestureController::beginSwipeGesture):
522         (WebKit::ViewGestureController::retrieveSnapshotForItem): Deleted.
523         * UIProcess/mac/ViewSnapshotStore.h:
524         Store a color along with each snapshot.
525         Set the background color of the swipe snapshot layer accordingly.
526
527 2014-06-23  Anders Carlsson  <andersca@apple.com>
528
529         Add -[WKBackForwardList _removeAllItems]
530         https://bugs.webkit.org/show_bug.cgi?id=134227
531         <rdar://problem/17291623>
532
533         Reviewed by Tim Horton.
534
535         * UIProcess/API/Cocoa/WKBackForwardList.mm:
536         (-[WKBackForwardList _removeAllItems]):
537         * UIProcess/API/Cocoa/WKBackForwardListPrivate.h: Added.
538         * WebKit2.xcodeproj/project.pbxproj:
539
540 2014-06-23  Dan Bernstein  <mitz@apple.com>
541
542         <rdar://problem/17413498> [Cocoa] Expose WebPreferences::offlineWebApplicationCacheEnabled
543         https://bugs.webkit.org/show_bug.cgi?id=134217
544
545         Reviewed by Anders Carlsson.
546
547         * UIProcess/API/Cocoa/WKPreferences.mm:
548         (-[WKPreferences _offlineApplicationCacheIsEnabled]):
549         (-[WKPreferences _setOfflineApplicationCacheIsEnabled:]):
550         * UIProcess/API/Cocoa/WKPreferencesPrivate.h: Added _offlineWebApplicationCacheIsEnabled
551         property.
552
553 2014-06-23  Grant Kennell  <gkennell@apple.com>
554
555         Add SPI for Injected Bundle to provide user agent for a given URL.
556         https://bugs.webkit.org/show_bug.cgi?id=133562
557
558         Reviewed by Sam Weinig.
559
560         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInLoadDelegate.h: 
561           Added delegate method to WebProcess PluIn protocol to provide UserAgent per URL.
562         * WebProcess/InjectedBundle/API/c/WKBundlePageLoaderClient.h:
563           Added new typedef for function pointer for this new delegate call.
564           Added new version (V8) of bundle loader client struct containing
565           a function pointer of that new type.
566         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
567         (userAgentForURL): Makes delegate call with the new method.
568         (setUpPageLoaderClient): Sets the struct's new function pointer to the new method.
569         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp:
570         (WebKit::InjectedBundlePageLoaderClient::userAgentForURL):
571         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h:
572         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
573         (WebKit::WebFrameLoaderClient::userAgent):
574         * WebProcess/WebPage/WebPage.cpp:
575         (WebKit::WebPage::userAgent): Began using the new API to ask for user agent
576           instead of simply returning what had been stored.
577         * WebProcess/WebPage/WebPage.h:
578         (WebKit::WebPage::userAgent): Deleted.
579
580 2014-06-23  Commit Queue  <commit-queue@webkit.org>
581
582         Unreviewed, rolling out r170324.
583         https://bugs.webkit.org/show_bug.cgi?id=134223
584
585         lots of build breakage (Requested by bradeeoh on #webkit).
586
587         Reverted changeset:
588
589         "Unreviewed, revert an unintentional change committed with
590         r170323."
591         http://trac.webkit.org/changeset/170324
592
593 2014-06-23  Timothy Horton  <timothy_horton@apple.com>
594
595         [iOS][wk2] Don't use view snapshots if the destination layer is a different size
596         https://bugs.webkit.org/show_bug.cgi?id=134210
597         <rdar://problem/17369463>
598
599         Reviewed by Benjamin Poulain.
600
601         * UIProcess/ios/ViewGestureControllerIOS.mm:
602         (WebKit::ViewGestureController::beginSwipeGesture):
603         Only use the view snapshot if the snapshot is the same (in device space) size
604         as the layer it's going to be put into, and only if the device scale factor is
605         the same as it was when the snapshot was taken.
606
607 2014-06-23  Benjamin Poulain  <bpoulain@apple.com>
608
609         [iOS][WK2] Make the state restore from HistoryItem more precise and reliable
610         https://bugs.webkit.org/show_bug.cgi?id=134150
611
612         Reviewed by Tim Horton.
613
614         This patch make several little improvements to improve how we restore the visible content rect and scale
615         from the HistoryItem.
616
617         The biggest architectural change is that the exposed rect is now restored on the UIProcess instead of the WebProcess,
618         this ensure we restore the same position regardless of any modification of obscured areas.
619
620         * Shared/VisibleContentRectUpdateInfo.cpp:
621         (WebKit::VisibleContentRectUpdateInfo::encode):
622         (WebKit::VisibleContentRectUpdateInfo::decode):
623         * Shared/VisibleContentRectUpdateInfo.h:
624         (WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo):
625         (WebKit::VisibleContentRectUpdateInfo::lastLayerTreeTransactionId):
626         (WebKit::WebPage::updateVisibleContentRects):
627         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
628         A race between the UIProcess and the WebProcess could cause the viewport of the next page to be influenced by updates
629         of the previous page. To avoid that, VisibleContentRectUpdateInfo keeps track of the last transaction seen at the time
630         of the update.
631
632         The WebProcess updates the size and scale of the content through layer tree updates. If an update was generated for a layer tree
633         update of the old page, none of the information is valid for the current content. Since the UIProcess drives the state in case of conflicts,
634         the WebProcess was updating the scale of the current page based on incorrect information.
635
636         To avoid the problems, we save the layer tree transaction ID when we commit a new page. Only updates after that transaction are useful
637         for the current page.
638
639         * UIProcess/API/Cocoa/WKWebView.mm:
640         (-[WKWebView _processDidExit]):
641         (withinEpsilon):
642         (changeContentOffsetBoundedInValidRange):
643         (-[WKWebView _didCommitLayerTree:WebKit::]):
644         (-[WKWebView _restorePageStateToExposedRect:WebCore::scale:]):
645         (-[WKWebView _restorePageStateToUnobscuredCenter:WebCore::scale:]):
646         * UIProcess/API/Cocoa/WKWebViewInternal.h:
647         * UIProcess/PageClient.h:
648         * UIProcess/WebPageProxy.h:
649         * UIProcess/WebPageProxy.messages.in:
650         * UIProcess/ios/PageClientImplIOS.h:
651         * UIProcess/ios/PageClientImplIOS.mm:
652         (WebKit::PageClientImpl::restorePageState):
653         (WebKit::PageClientImpl::restorePageCenterAndScale):
654         Restoring the state is now done by WKWebView. The state is only updated on the next layer tree commit,
655         this is done to avoid any jumping if the page has scrolled since we tried to restore its state.
656
657         Both update path end up calling _updateVisibleContentRects. This is because the update on the WebProcess
658         never sets the ScrollPosition (because it does not know the current state of the obscured insets). Pushing
659         a new VisibleContentRect will nicely udpates the exposed rect, scroll position, fixed elements, etc.
660
661         * UIProcess/ios/WKContentView.mm:
662         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:]):
663         * UIProcess/ios/WebPageProxyIOS.mm:
664         (WebKit::WebPageProxy::restorePageState):
665         (WebKit::WebPageProxy::restorePageCenterAndScale):
666         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
667         (WebKit::RemoteLayerTreeDrawingAreaProxy::lastCommittedLayerTreeTransactionID):
668         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
669         (WebKit::RemoteLayerTreeDrawingAreaProxy::RemoteLayerTreeDrawingAreaProxy):
670         * WebProcess/WebCoreSupport/ios/WebFrameLoaderClientIOS.mm:
671         (WebKit::WebFrameLoaderClient::saveViewStateToItem):
672         (WebKit::WebFrameLoaderClient::restoreViewState):
673         * WebProcess/WebPage/WebPage.cpp:
674         (WebKit::WebPage::WebPage):
675         (WebKit::WebPage::didCommitLoad):
676         * WebProcess/WebPage/WebPage.h:
677         Get rid of m_obscuredTopInset. It was a bad idea. The UIProcess updates the obscured insets a lot during
678         page load, the value we used to restore the scroll position was frequently stale.
679
680         (WebKit::WebPage::userHasChangedPageScaleFactor): Deleted.
681         * WebProcess/WebPage/ios/WebPageIOS.mm:
682         (WebKit::WebPage::savePageState):
683         (WebKit::scaleAfterViewportWidthChange):
684         (WebKit::relativeCenterAfterContentSizeChange):
685         (WebKit::adjustExposedRectForNewScale):
686         Extract this out of dynamicViewportSizeUpdate(). It is useful to adjust the exposed rect when restoring a HistoryItem
687         to a ViewportConfiguration that is different from when it was saved.
688
689         (WebKit::WebPage::restorePageState):
690         There are two variations of restorePage:
691         1) If the viewport configuration is compatible, restore the exact scale and position of the page.
692         2) Otherwise, restore the scale and position similarily to dynamicViewportSizeUpdate().
693
694         (WebKit::WebPage::dynamicViewportSizeUpdate):
695         (WebKit::WebPage::viewportConfigurationChanged):
696         (WebKit::adjustExposedRectForBoundedScale):
697         (WebKit::RemoteLayerTreeDrawingArea::currentTransactionID):
698         Expose the transactionID for the race issue on VisibleRectUpdate.
699
700         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
701         (WebKit::RemoteLayerTreeDrawingArea::setExposedContentRect):
702         Store the exposed rect in floating point coordinates. This makes it possible to restore that exact
703         position when needed.
704
705 2014-06-23  Eric Carlson  <eric.carlson@apple.com>
706
707         Unreviewed, revert an unintentional change committed with r170323.
708
709         * UIProcess/API/Cocoa/WKBackForwardList.mm:
710
711 2014-06-23  Anders Carlsson  <andersca@apple.com>
712
713         Policy delegate methods should use CompletionHandlerCallChecker
714         https://bugs.webkit.org/show_bug.cgi?id=134215
715
716         Reviewed by Dan Bernstein.
717
718         * UIProcess/Cocoa/NavigationState.mm:
719         (WebKit::NavigationState::PolicyClient::decidePolicyForNavigationAction):
720         (WebKit::NavigationState::PolicyClient::decidePolicyForResponse):
721
722 2014-06-23  Anders Carlsson  <andersca@apple.com>
723
724         Don't use the WK prefix for internal C++ types
725         https://bugs.webkit.org/show_bug.cgi?id=134214
726
727         Reviewed by Dan Bernstein.
728
729         * Shared/AssistedNodeInformation.cpp:
730         (WebKit::OptionItem::encode):
731         (WebKit::OptionItem::decode):
732         (WebKit::WKOptionItem::encode): Deleted.
733         (WebKit::WKOptionItem::decode): Deleted.
734         * Shared/AssistedNodeInformation.h:
735         (WebKit::OptionItem::OptionItem):
736         (WebKit::AssistedNodeInformation::AssistedNodeInformation):
737         (WebKit::WKOptionItem::WKOptionItem): Deleted.
738         * UIProcess/ios/WKContentViewInteraction.h:
739         * UIProcess/ios/WKContentViewInteraction.mm:
740         (-[WKContentView _requiresKeyboardWhenFirstResponder]):
741         (-[WKContentView inputView]):
742         (-[WKContentView requiresAccessoryView]):
743         (-[WKContentView _updateAccessory]):
744         (-[WKContentView textInputTraits]):
745         (-[WKContentView assistedNodeSelectOptions]):
746         (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:userObject:]):
747         (-[WKContentView _stopAssistingNode]):
748         * UIProcess/ios/forms/WKFormInputControl.mm:
749         (-[WKDateTimePicker initWithView:datePickerMode:]):
750         (-[WKFormInputControl initWithView:]):
751         * UIProcess/ios/forms/WKFormSelectControl.h:
752         * UIProcess/ios/forms/WKFormSelectControl.mm:
753         (adjustedFontSize):
754         * UIProcess/ios/forms/WKFormSelectPicker.mm:
755         (-[WKOptionPickerCell initWithOptionItem:]):
756         (-[WKOptionGroupPickerCell initWithOptionItem:]):
757         (-[WKMultipleSelectPicker initWithView:]):
758         (-[WKMultipleSelectPicker pickerView:viewForRow:forComponent:reusingView:]):
759         (-[WKMultipleSelectPicker pickerView:row:column:checked:]):
760         (-[WKSelectSinglePicker pickerView:attributedTitleForRow:forComponent:]):
761         (-[WKSelectSinglePicker pickerView:didSelectRow:inComponent:]):
762         * UIProcess/ios/forms/WKFormSelectPopover.mm:
763         (-[WKSelectTableViewController initWithView:hasGroups:]):
764         (-[WKSelectTableViewController tableView:numberOfRowsInSection:]):
765         (-[WKSelectTableViewController tableView:titleForHeaderInSection:]):
766         (-[WKSelectTableViewController populateCell:withItem:]):
767         (-[WKSelectTableViewController findItemIndexAt:]):
768         (-[WKSelectTableViewController findItemAt:]):
769         (-[WKSelectTableViewController tableView:cellForRowAtIndexPath:]):
770         (-[WKSelectTableViewController tableView:didSelectRowAtIndexPath:]):
771         * WebProcess/WebPage/ios/WebPageIOS.mm:
772         (WebKit::WebPage::getAssistedNodeInformation):
773
774 2014-06-23  Dan Bernstein  <mitz@apple.com>
775
776         [Cocoa] No way to grant storage quotas for web application cache
777         https://bugs.webkit.org/show_bug.cgi?id=134213
778
779         Reviewed by Anders Carlsson.
780
781         * UIProcess/API/APIUIClient.h:
782         (API::UIClient::reachedApplicationCacheOriginQuota): Added this new client function, with
783         a default implementation that calls the completion handler with the current quota.
784
785         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: Declared a new delegate method.
786
787         * UIProcess/API/Cocoa/_WKSecurityOrigin.mm:
788         (-[_WKSecurityOrigin _initWithSecurityOrigin:WebCore::]): Changed the parameter into a const
789         reference, since we copy it.
790         * UIProcess/API/Cocoa/_WKSecurityOriginInternal.h:
791
792         * UIProcess/Cocoa/UIDelegate.h: Override API::UIClient::reachedApplicationCacheOriginQuota.
793         Added flag to m_delegateMethods struct for new delegate method.
794         * UIProcess/Cocoa/UIDelegate.mm:
795         (WebKit::UIDelegate::setDelegate): Set new flag in m_delegateMethods struct.
796         (WebKit::UIDelegate::UIClient::exceededDatabaseQuota): Updated for change in
797         _WKSecurityOrigin initializer.
798         (WebKit::UIDelegate::UIClient::reachedApplicationCacheOriginQuota): Added. Calls the new
799         delegate method.
800
801         * UIProcess/WebPageProxy.cpp:
802         (WebKit::WebPageProxy::reachedApplicationCacheOriginQuota): Added. Forwards the message to
803         the UI client.
804         * UIProcess/WebPageProxy.h:
805
806         * UIProcess/WebPageProxy.messages.in: Added ReachedApplicationCacheOriginQuota message.
807
808         * WebProcess/InjectedBundle/API/APIInjectedBundlePageUIClient.h:
809         (API::InjectedBundle::PageUIClient::didReachApplicationCacheOriginQuota): Changed the return
810         type to bool, indicating whether the client handled the callback.
811
812         * WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp:
813         (WebKit::InjectedBundlePageUIClient::didReachApplicationCacheOriginQuota): Return the
814         appropriate value.
815         * WebProcess/InjectedBundle/InjectedBundlePageUIClient.h:
816
817         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
818         (WebKit::WebChromeClient::reachedApplicationCacheOriginQuota): If the bundle client didn’t
819         handle the callback, send a message the the UI process, and update the quota with the reply.
820
821 2014-06-23  Tim Horton  <timothy_horton@apple.com>
822
823         [wk2] Synchronously wait a short time for a layer tree update after bringing a web view in-window
824         https://bugs.webkit.org/show_bug.cgi?id=134189
825
826         Reviewed by Simon Fraser.
827
828         Make the old behavior of -[WKView endDeferringViewInWindowChangesSync] the default; synchronously wait
829         for a fraction of a second when a page that was previously in-window but currently isn't comes back in-window,
830         until new content is painted (or we hit a timeout).
831         
832         * UIProcess/DrawingAreaProxy.h:
833         (WebKit::DrawingAreaProxy::waitForDidUpdateViewState):
834         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h:
835         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
836         (WebKit::TiledCoreAnimationDrawingAreaProxy::waitForDidUpdateViewState):
837         Delegate waitForDidUpdateViewState to the DrawingAreaProxys, because behavior is very dependent on them.
838
839         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
840         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
841         (WebKit::RemoteLayerTreeDrawingAreaProxy::coreAnimationDidCommitLayers):
842         (WebKit::RemoteLayerTreeDrawingAreaProxy::waitForDidUpdateViewState):
843         Implement waitForDidUpdateViewState for the RemoteLayerTree; it waits for CommitLayerTree.
844
845         * UIProcess/WebPageProxy.cpp:
846         (WebKit::WebPageProxy::WebPageProxy):
847         (WebKit::WebPageProxy::updateViewState):
848         (WebKit::WebPageProxy::viewStateDidChange):
849         (WebKit::WebPageProxy::dispatchViewStateChange):
850         (WebKit::WebPageProxy::waitForDidUpdateViewState):
851         (WebKit::WebPageProxy::resetStateAfterProcessExited):
852         (WebKit::WebPageProxy::viewSize): Deleted.
853         * UIProcess/WebPageProxy.h:
854         (WebKit::WebPageProxy::didUpdateViewState):
855         * UIProcess/API/mac/WKView.mm:
856         (-[WKView endDeferringViewInWindowChangesSync]):
857         Always waitForDidUpdateViewState when a page that was previously in-window but currently isn't comes back in-window.
858
859         * WebProcess/WebPage/DrawingArea.h:
860         (WebKit::DrawingArea::viewStateDidChange):
861         * WebProcess/WebPage/WebPage.cpp:
862         (WebKit::WebPage::WebPage):
863         (WebKit::WebPage::setViewState):
864         (WebKit::WebPage::didUpdateViewStateTimerFired): Deleted.
865         * WebProcess/WebPage/WebPage.h:
866         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
867         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
868         (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
869         (WebKit::RemoteLayerTreeDrawingArea::viewStateDidChange):
870         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
871         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
872         (WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
873         (WebKit::TiledCoreAnimationDrawingArea::viewStateDidChange):
874         (WebKit::TiledCoreAnimationDrawingArea::didUpdateViewStateTimerFired):
875         * WebProcess/WebPage/mac/WebPageMac.mm:
876         (WebKit::WebPage::didUpdateViewStateTimerFired): Deleted.
877         Delegate sending of didUpdateViewState to the DrawingAreas (RemoteLayerTreeDrawingArea won't send it,
878             because the UI process waits for CommitLayerTree instead).
879
880 2014-06-23  Timothy Horton  <timothy_horton@apple.com>
881
882         [iOS][wk2] Ensure that layers are marked volatile before allowing the process to suspend
883         https://bugs.webkit.org/show_bug.cgi?id=134004
884         <rdar://problem/17186342>
885
886         Reviewed by Simon Fraser.
887
888         WebKit tries to make layers volatile when unparented, but sometimes isn't given
889         a chance to do so before the process gets suspended, so we end up with lots of
890         non-volatile surfaces that should really be volatile.
891
892         * Shared/mac/RemoteLayerBackingStoreCollection.h:
893         * Shared/mac/RemoteLayerBackingStoreCollection.mm:
894         (WebKit::RemoteLayerBackingStoreCollection::markBackingStoreVolatileImmediately):
895         (WebKit::RemoteLayerBackingStoreCollection::markAllBackingStoreVolatileImmediatelyIfPossible):
896         Add markAllBackingStoreVolatileImmediatelyIfPossible, which tries to mark *all*
897         buffers of *all* backing store, (live and unreachable), (front, back, and secondary),
898         volatile right away. It returns false if any buffer isn't marked volatile (because it was in-use).
899
900         * UIProcess/ios/ProcessThrottler.h:
901         * UIProcess/ios/ProcessThrottler.mm:
902         (WebKit::ProcessThrottler::updateAssertion):
903         (WebKit::ProcessThrottler::processReadyToSuspend):
904         (WebKit::ProcessThrottler::didCancelProcessSuspension):
905         * UIProcess/ios/WebProcessProxyIOS.mm:
906         (WebKit::WebProcessProxy::sendCancelProcessWillSuspend):
907         (WebKit::WebProcessProxy::didCancelProcessSuspension):
908         * UIProcess/WebProcessProxy.h:
909         * UIProcess/WebProcessProxy.messages.in:
910         * WebProcess/WebProcess.h:
911         * WebProcess/WebProcess.messages.in:
912         If the UI process is waiting for the Web process to confirm that it can suspend
913         and something happens (the view is reparented) that cancels the suspension, inform
914         the Web process that this happened, so that it can cancel any cleanup that might still be taking place.
915
916         * UIProcess/WebPageProxy.cpp:
917         (WebKit::WebPageProxy::viewStateDidChange):
918         If a view goes in-window, dispatch the view state change immediately without delay,
919         to minimize the latency between coming in-window and being ready to go.
920
921         * WebProcess/WebPage/DrawingArea.h:
922         (WebKit::DrawingArea::markLayersVolatileImmediatelyIfPossible):
923         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
924         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
925         (WebKit::RemoteLayerTreeDrawingArea::setRootCompositingLayer):
926         Schedule a flush when we change the root layer; otherwise, we can end up
927         detaching the root layer but changing nothing else, and never committing that change.
928
929         (WebKit::RemoteLayerTreeDrawingArea::markLayersVolatileImmediatelyIfPossible):
930
931         * WebProcess/WebProcess.cpp:
932         (WebKit::WebProcess::WebProcess):
933         (WebKit::WebProcess::processWillSuspend):
934         (WebKit::WebProcess::cancelProcessWillSuspend):
935         (WebKit::WebProcess::markAllLayersVolatileIfPossible):
936         (WebKit::WebProcess::processSuspensionCleanupTimerFired):
937         When the UI process is going to suspend the process, it sends us ProcessWillSuspend,
938         and defers the suspension until we send a ProcessReadyToSuspend back.
939         Delay ProcessReadyToSuspend until all layers in our process have been marked volatile.
940         We'll keep trying every 20ms until they're all volatile. For safety, the UI process will eventually
941         stop waiting for us, but the volatility change is usually applied successfully within the first
942         or second timer callback.
943
944 2014-06-23  Oliver Hunt  <oliver@apple.com>
945
946         Ensure that we always use symlink free paths when specifying cache directories
947         https://bugs.webkit.org/show_bug.cgi?id=134206
948
949         Reviewed by Anders Carlsson.
950
951         Sandboxing will deny symlink based paths, so we use realpath to create extensions.
952         This leaves us in the position of an extension using a visually different path
953         from other parts of the process code.  This patch simply makes sure that we always
954         use the realpath for cache directories, so making debugging easier and also ensuring
955         that we don't ever accidentally try to use a path with symlinks that will thus get
956         denied.
957
958         * Shared/SandboxExtension.h:
959         (WebKit::stringByResolvingSymlinksInPath):
960         * Shared/mac/SandboxExtensionMac.mm:
961         (WebKit::stringByResolvingSymlinksInPath):
962         * UIProcess/WebContext.cpp:
963         (WebKit::WebContext::ensureNetworkProcess):
964         * UIProcess/mac/WebContextMac.mm:
965         (WebKit::WebContext::platformDefaultApplicationCacheDirectory):
966         (WebKit::WebContext::platformDefaultDiskCacheDirectory):
967         (WebKit::WebContext::platformDefaultWebSQLDatabaseDirectory):
968         (WebKit::WebContext::platformDefaultIconDatabasePath):
969         (WebKit::WebContext::platformDefaultLocalStorageDirectory):
970
971 2014-06-23  Roger Fong  <roger_fong@apple.com>
972
973         Unregister notification observer registered in r170156.
974         https://bugs.webkit.org/show_bug.cgi?id=134204.
975
976         Reviewed by Tim Horton.
977
978         * UIProcess/API/mac/WKView.mm:
979         (-[WKView dealloc]):
980
981 2014-06-23  Dan Bernstein  <mitz@apple.com>
982
983         [Cocoa] No way to grant storage quotas for WebSQL
984         https://bugs.webkit.org/show_bug.cgi?id=134175
985
986         Reviewed by Anders Carlsson.
987
988         * Shared/WebSecurityOrigin.h:
989         (WebKit::WebSecurityOrigin::securityOrigin): Changed to return a non-const reference.
990
991         * UIProcess/API/APIUIClient.h:
992         (API::UIClient::exceededDatabaseQuota): Added a completion handler parameter than takes the
993         new quota, and changed the return type to void.
994
995         * UIProcess/API/C/WKPage.cpp:
996         (WKPageSetPageUIClient): Changed the override of exceededDatabaseQuota to call the
997         completion handler with the new quota, or with the existing quota if the client doesn’t
998         implement the callback.
999
1000         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: Declared new delegate method.
1001
1002         * UIProcess/API/Cocoa/_WKSecurityOrigin.h: Added.
1003         * UIProcess/API/Cocoa/_WKSecurityOrigin.mm: Added.
1004         (-[_WKSecurityOrigin _initWithSecurityOrigin:WebCore::]): Store the origin in an ivar.
1005         (-[_WKSecurityOrigin protocol]): Added this accessor.
1006         (-[_WKSecurityOrigin host]): Ditto.
1007         (-[_WKSecurityOrigin port]): Ditto.
1008         * UIProcess/API/Cocoa/_WKSecurityOriginInternal.h: Added.
1009
1010         * UIProcess/Cocoa/UIDelegate.h: Override API::UIClient::exceededDatabaseQuota. Added flag
1011         to m_delegateMethods struct for new delegate method.
1012         * UIProcess/Cocoa/UIDelegate.mm:
1013         (WebKit::UIDelegate::setDelegate): Set new flag in m_delegateMethods struct.
1014         (WebKit::UIDelegate::UIClient::exceededDatabaseQuota): Added. Calls the new delegate method.
1015
1016         * UIProcess/WebPageProxy.cpp:
1017         (WebKit::WebPageProxy::exceededDatabaseQuota): Updated for the new client interface: now
1018         passing a completion handler that replies with the new quota.
1019
1020         * WebKit2.xcodeproj/project.pbxproj: Added references to new files, sorted a group.
1021
1022 2014-06-23  Simon Fraser  <simon.fraser@apple.com>
1023
1024         More build fixing after r170295.
1025
1026         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
1027         (InitWebCoreSystemInterface):
1028
1029 2014-06-23  Anders Carlsson  <andersca@apple.com>
1030
1031         Give read-only properties proper ownership attributes
1032         https://bugs.webkit.org/show_bug.cgi?id=134197
1033         <rdar://problem/16830117>
1034
1035         Reviewed by Dan Bernstein.
1036
1037         Also, make WKFrameInfo conform to NSCopying since it's a data-only object and thus intended to be copied.
1038
1039         * UIProcess/API/Cocoa/WKBackForwardList.h:
1040         * UIProcess/API/Cocoa/WKBackForwardListItem.h:
1041         * UIProcess/API/Cocoa/WKFrameInfo.h:
1042         * UIProcess/API/Cocoa/WKFrameInfo.mm:
1043         (-[WKFrameInfo copyWithZone:]):
1044         (-[WKFrameInfo setRequest:]): Deleted.
1045         * UIProcess/API/Cocoa/WKNavigation.h:
1046         * UIProcess/API/Cocoa/WKNavigationAction.h:
1047         * UIProcess/API/Cocoa/WKNavigationAction.mm:
1048         (-[WKNavigationAction setSourceFrame:]):
1049         (-[WKNavigationAction setTargetFrame:]):
1050         * UIProcess/API/Cocoa/WKNavigationActionInternal.h:
1051         * UIProcess/API/Cocoa/WKNavigationResponse.h:
1052         * UIProcess/API/Cocoa/WKScriptMessage.h:
1053         * UIProcess/API/Cocoa/WKUserContentController.h:
1054         * UIProcess/API/Cocoa/WKUserScript.h:
1055         * UIProcess/API/Cocoa/WKWebView.h:
1056
1057 2014-06-23  Gwang Yoon Hwang  <yoon@igalia.com>
1058
1059         Unreviewed, GTK build fix after r170274.
1060
1061         * WebProcess/WebPage/DrawingAreaImpl.cpp:
1062         Drawing::m_webPage changed to reference.
1063
1064         (WebKit::DrawingAreaImpl::DrawingAreaImpl):
1065         (WebKit::DrawingAreaImpl::setNeedsDisplay):
1066         (WebKit::DrawingAreaImpl::setNeedsDisplayInRect):
1067         (WebKit::DrawingAreaImpl::forceRepaint):
1068         (WebKit::DrawingAreaImpl::updatePreferences):
1069         (WebKit::DrawingAreaImpl::layerHostDidFlushLayers):
1070         (WebKit::DrawingAreaImpl::updateBackingStoreState):
1071         (WebKit::DrawingAreaImpl::sendDidUpdateBackingStoreState):
1072         (WebKit::DrawingAreaImpl::enterAcceleratedCompositingMode):
1073         (WebKit::DrawingAreaImpl::exitAcceleratedCompositingMode):
1074         (WebKit::DrawingAreaImpl::display):
1075         * WebProcess/WebPage/DrawingAreaImpl.h:
1076
1077 2014-06-22  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
1078
1079         REGRESSION(r170163): It made everything crash on EFL
1080         https://bugs.webkit.org/show_bug.cgi?id=134097
1081
1082         Unreviewed EFL layout test and perforamcne crash fix.
1083
1084         * WebProcess/WebPage/WebPage.cpp: Add a null check for m_mainFrame.
1085         (WebKit::WebPage::didCompletePageTransition):
1086
1087 2014-06-22  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
1088
1089         Unreviewed EFL build fix since r170274. Use reference for m_webPage member variable.
1090
1091         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.cpp:
1092         (WebKit::CoordinatedDrawingArea::CoordinatedDrawingArea):
1093         (WebKit::CoordinatedDrawingArea::setNeedsDisplay):
1094         (WebKit::CoordinatedDrawingArea::setNeedsDisplayInRect):
1095         (WebKit::CoordinatedDrawingArea::forceRepaint):
1096         (WebKit::CoordinatedDrawingArea::updatePreferences):
1097         (WebKit::CoordinatedDrawingArea::mainFrameContentSizeChanged):
1098         (WebKit::CoordinatedDrawingArea::layerHostDidFlushLayers):
1099         (WebKit::CoordinatedDrawingArea::updateBackingStoreState):
1100         (WebKit::CoordinatedDrawingArea::sendDidUpdateBackingStoreState):
1101         (WebKit::CoordinatedDrawingArea::suspendPainting):
1102         (WebKit::CoordinatedDrawingArea::resumePainting):
1103         (WebKit::CoordinatedDrawingArea::enterAcceleratedCompositingMode):
1104         (WebKit::CoordinatedDrawingArea::display):
1105         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.h:
1106
1107 2014-06-22  Tim Horton  <timothy_horton@apple.com>
1108
1109         [iOS][wk2] Swiping back sometimes results in a missing (not blank) swipe snapshot
1110         https://bugs.webkit.org/show_bug.cgi?id=134181
1111
1112         Reviewed by Benjamin Poulain.
1113
1114         * UIProcess/ios/ViewGestureControllerIOS.mm:
1115         (WebKit::ViewGestureController::ViewGestureController):
1116         (WebKit::ViewGestureController::endSwipeGesture):
1117         (WebKit::ViewGestureController::setRenderTreeSize):
1118         (WebKit::ViewGestureController::removeSwipeSnapshot):
1119         * UIProcess/mac/ViewGestureController.h:
1120         Make it explicit that we should only remove the swipe snapshot when a
1121         big-enough render tree size arrives *after the swipe ends*.
1122
1123 2014-06-22  Tim Horton  <timothy_horton@apple.com>
1124
1125         Thread some references through the remote layer tree code
1126         https://bugs.webkit.org/show_bug.cgi?id=134177
1127
1128         Reviewed by Zalan Bujtas.
1129
1130         A first pass at references for never-null things (first pass because I didn't touch the collections).
1131         Things that aren't straightforward reference-threading:
1132
1133         * Shared/mac/RemoteLayerBackingStoreCollection.h:
1134         * Shared/mac/RemoteLayerBackingStoreCollection.mm:
1135         Remove the unimplemented/nonexistant RemoteLayerBackingStoreCollection::create.
1136         Make RemoteLayerBackingStoreCollection constructor not take a context, because m_context is never used.
1137
1138         * WebProcess/WebPage/mac/RemoteLayerTreeContext.h:
1139         * WebProcess/WebPage/mac/RemoteLayerTreeContext.mm:
1140         Factor out grabbing the PlatformLayerID in a few places.
1141
1142         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
1143         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
1144         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
1145         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
1146         Use WebPage::mainFrameView() instead of WebPage::corePage()->mainFrame().view().
1147
1148         * Shared/mac/RemoteLayerTreeTransaction.h:
1149         * Shared/mac/RemoteLayerTreeTransaction.mm:
1150         * WebProcess/WebPage/DrawingArea.cpp:
1151         * WebProcess/WebPage/DrawingArea.h:
1152         * WebProcess/WebPage/WebPage.cpp:
1153         * WebProcess/WebPage/mac/GraphicsLayerCARemote.h:
1154         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
1155         * WebProcess/WebPage/mac/PlatformCALayerRemote.h:
1156         * WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.h:
1157         * WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.mm:om):
1158         * WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.cpp:
1159         * WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.h:
1160         * Shared/mac/RemoteLayerBackingStore.mm:
1161         References.
1162         
1163 2014-06-22  Anders Carlsson  <andersca@apple.com>
1164
1165         Replace a couple of uses of bind with lambdas
1166         https://bugs.webkit.org/show_bug.cgi?id=134172
1167
1168         Reviewed by Sam Weinig.
1169
1170         * Platform/IPC/Connection.cpp:
1171         (IPC::Connection::postConnectionDidCloseOnConnectionWorkQueue):
1172         (IPC::Connection::connectionDidClose):
1173         (IPC::Connection::dispatchMessage):
1174         (IPC::Connection::dispatchConnectionDidClose): Deleted.
1175         * Platform/IPC/Connection.h:
1176         * Shared/Plugins/NPObjectProxy.cpp:
1177         (WebKit::NPObjectProxy::NP_Deallocate):
1178         * UIProcess/Storage/LocalStorageDatabase.cpp:
1179         (WebKit::LocalStorageDatabase::scheduleDatabaseUpdate):
1180         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
1181         (WebKit::NetscapePlugin::pluginThreadAsyncCall):
1182         (WebKit::NetscapePlugin::handlePluginThreadAsyncCall): Deleted.
1183         * WebProcess/Plugins/Netscape/NetscapePlugin.h:
1184         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
1185         (WebKit::TiledCoreAnimationDrawingArea::forceRepaintAsync):
1186         (WebKit::TiledCoreAnimationDrawingArea::dispatchAfterEnsuringUpdatedScrollPosition):
1187
1188 2014-06-20  Simon Fraser  <simon.fraser@apple.com>
1189
1190         Have scrollingTreeAsText() dump the non-fast-scrollable region
1191         https://bugs.webkit.org/show_bug.cgi?id=134149
1192
1193         Reviewed by Sam Weinig.
1194
1195         Dump the non-fast-scrollable region (as an array of rects).
1196
1197         * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp:
1198         (WebKit::RemoteScrollingTreeTextStream::dump):
1199
1200 2014-06-22  Anders Carlsson  <andersca@apple.com>
1201
1202         Add IPC decoding support to BackForwardListState
1203         https://bugs.webkit.org/show_bug.cgi?id=134171
1204
1205         Reviewed by Dan Bernstein.
1206
1207         * Shared/SessionState.cpp:
1208         (WebKit::isValidEnum):
1209         (WebKit::HTTPBody::Element::decode):
1210         (WebKit::HTTPBody::decode):
1211         (WebKit::FrameState::decode):
1212         (WebKit::PageState::decode):
1213         (WebKit::BackForwardListState::decode):
1214         * Shared/SessionState.h:
1215
1216 2014-06-22  Anders Carlsson  <andersca@apple.com>
1217
1218         Address a review comment.
1219
1220         * UIProcess/mac/LegacySessionStateCoding.cpp:
1221         (WebKit::HistoryEntryDataDecoder::markInvalid):
1222         (WebKit::decodeFormDataElement):
1223
1224 2014-06-21  Anders Carlsson  <andersca@apple.com>
1225
1226         Implement the rest of back forward tree decoding
1227         https://bugs.webkit.org/show_bug.cgi?id=134166
1228
1229         Reviewed by Sam Weinig.
1230
1231         * UIProcess/mac/LegacySessionStateCoding.cpp:
1232         (WebKit::HistoryEntryDataDecoder::operator>>):
1233         (WebKit::decodeFormDataElement):
1234         (WebKit::decodeFormData):
1235         (WebKit::decodeBackForwardTreeNode):
1236
1237 2014-06-22  Dan Bernstein  <mitz@apple.com>
1238
1239         [iOS] WKWebViewConfiguration.allowsInlineMediaPlayback has no effect
1240         https://bugs.webkit.org/show_bug.cgi?id=134170
1241
1242         Reviewed by Anders Carlsson.
1243
1244         * UIProcess/API/Cocoa/WKWebView.mm:
1245         (-[WKWebView initWithFrame:configuration:]): Fixed a typo.
1246
1247 2014-06-21  Zan Dobersek  <zdobersek@igalia.com>
1248
1249         Unreviewed. Fixing the GTK+ build after r170253.
1250
1251         * UIProcess/API/gtk/WebKitSettings.cpp:
1252         (_WebKitSettingsPrivate::_WebKitSettingsPrivate): WebPreferences::create()
1253         now takes an additional String argument.
1254
1255 2014-06-21  Dan Bernstein  <mitz@apple.com>
1256
1257         CallbackMap::put should be able to take an unwrapped function
1258         https://bugs.webkit.org/show_bug.cgi?id=134104
1259
1260         Reviewed by Anders Carlsson.
1261
1262         * UIProcess/GenericCallback.h:
1263         (WebKit::CallbackMap::put): Added an overload that takes a function and creates and puts a
1264         callback. Changed both overloads of put() to return the callback ID.
1265
1266         * UIProcess/WebPageProxy.cpp:
1267         (WebKit::WebPageProxy::validateCommand):
1268         (WebKit::WebPageProxy::runJavaScriptInMainFrame):
1269         (WebKit::WebPageProxy::getRenderTreeExternalRepresentation):
1270         (WebKit::WebPageProxy::getSourceForFrame):
1271         (WebKit::WebPageProxy::getContentsAsString):
1272         (WebKit::WebPageProxy::getBytecodeProfile):
1273         (WebKit::WebPageProxy::getContentsAsMHTMLData):
1274         (WebKit::WebPageProxy::getSelectionOrContentsAsString):
1275         (WebKit::WebPageProxy::getSelectionAsWebArchiveData):
1276         (WebKit::WebPageProxy::getMainResourceDataOfFrame):
1277         (WebKit::WebPageProxy::getResourceDataFromFrame):
1278         (WebKit::WebPageProxy::getWebArchiveOfFrame):
1279         (WebKit::WebPageProxy::getMarkedRangeAsync):
1280         (WebKit::WebPageProxy::getSelectedRangeAsync):
1281         (WebKit::WebPageProxy::characterIndexForPointAsync):
1282         (WebKit::WebPageProxy::firstRectForCharacterRangeAsync):
1283         (WebKit::WebPageProxy::takeSnapshot):
1284
1285 2014-06-21  Anders Carlsson  <andersca@apple.com>
1286
1287         Make it possible to override debug preferences on a per-identifier basis as well as globally
1288         https://bugs.webkit.org/show_bug.cgi?id=134164
1289
1290         Reviewed by Dan Bernstein.
1291
1292         * Shared/WebPreferencesDefinitions.h:
1293         * Shared/WebPreferencesKeys.cpp:
1294         * Shared/WebPreferencesKeys.h:
1295         * Shared/WebPreferencesStore.cpp:
1296         (WebKit::defaults):
1297         * UIProcess/API/C/WKPreferences.cpp:
1298         (WKPreferencesCreate):
1299         (WKPreferencesCreateWithIdentifier):
1300         * UIProcess/API/Cocoa/WKPreferences.mm:
1301         (-[WKPreferences init]):
1302         * UIProcess/WebPageGroup.cpp:
1303         (WebKit::WebPageGroup::WebPageGroup):
1304         * UIProcess/WebPreferences.cpp:
1305         (WebKit::WebPreferences::create):
1306         (WebKit::WebPreferences::createWithLegacyDefaults):
1307         (WebKit::WebPreferences::WebPreferences):
1308         * UIProcess/WebPreferences.h:
1309         * UIProcess/mac/WebPreferencesMac.mm:
1310         (WebKit::makeKey):
1311         (WebKit::debugUserDefaultsValue):
1312         (WebKit::setDebugBoolValueIfInUserDefaults):
1313         (WebKit::WebPreferences::platformInitializeStore):
1314
1315 2014-06-21  Anders Carlsson  <andersca@apple.com>
1316
1317         Begin work on decoding form data
1318         https://bugs.webkit.org/show_bug.cgi?id=134163
1319
1320         Reviewed by Sam Weinig.
1321
1322         * UIProcess/mac/LegacySessionStateCoding.cpp:
1323         (WebKit::HistoryEntryDataDecoder::operator>>):
1324         (WebKit::HistoryEntryDataDecoder::isValid):
1325         (WebKit::isValidEnum):
1326         (WebKit::decodeFormDataElement):
1327         (WebKit::decodeFormData):
1328         (WebKit::decodeBackForwardTreeNode):
1329
1330 2014-06-21  Anders Carlsson  <andersca@apple.com>
1331
1332         Only initialize WebPreferences from NSUserDefaults if there's an identifier
1333         https://bugs.webkit.org/show_bug.cgi?id=134162
1334
1335         Reviewed by Sam Weinig.
1336
1337         We don't want to allow changing preferences by registering user defaults.
1338
1339         * UIProcess/mac/WebPreferencesMac.mm:
1340         (WebKit::makeKey):
1341         (WebKit::WebPreferences::platformInitializeStore):
1342
1343 2014-06-21  Anders Carlsson  <andersca@apple.com>
1344
1345         Begin work on decoding the back/forward tree
1346         https://bugs.webkit.org/show_bug.cgi?id=134161
1347
1348         Reviewed by Sam Weinig.
1349
1350         * UIProcess/mac/LegacySessionStateCoding.cpp:
1351         (WebKit::LegacySessionStateDecoder::decodeSessionHistoryEntries):
1352         (WebKit::HistoryEntryDataDecoder::operator>>):
1353         (WebKit::HistoryEntryDataDecoder::decodeArithmeticType):
1354         (WebKit::HistoryEntryDataDecoder::bufferIsLargeEnoughToContain):
1355         (WebKit::decodeBackForwardTreeNode):
1356         (WebKit::LegacySessionStateDecoder::decodeSessionHistoryEntryData):
1357         (WebKit::HistoryEntryDataDecoder::decode): Deleted.
1358
1359 2014-06-21  Brady Eidson  <beidson@apple.com>
1360
1361         Gamepad API - Deprecate the existing implementation
1362         https://bugs.webkit.org/show_bug.cgi?id=134108
1363
1364         Reviewed by Timothy Hatcher.
1365
1366         -Add new "GAMEPAD_DEPRECATED" build flag, moving the existing implementation to use it
1367         -Move some implementation files into a "deprecated" subdirectory.
1368
1369         * Configurations/FeatureDefines.xcconfig:
1370
1371 2014-06-20  Anders Carlsson  <andersca@apple.com>
1372
1373         Implement more of HistoryEntryDataDecoder
1374         https://bugs.webkit.org/show_bug.cgi?id=134146
1375
1376         Reviewed by Sam Weinig.
1377
1378         * UIProcess/mac/LegacySessionStateCoding.cpp:
1379         (WebKit::HistoryEntryDataDecoder::HistoryEntryDataDecoder):
1380         (WebKit::HistoryEntryDataDecoder::operator>>):
1381         (WebKit::HistoryEntryDataDecoder::decode):
1382         (WebKit::HistoryEntryDataDecoder::decodeFixedLengthData):
1383         (WebKit::HistoryEntryDataDecoder::alignBufferPosition):
1384         (WebKit::HistoryEntryDataDecoder::alignedBuffer):
1385         (WebKit::HistoryEntryDataDecoder::alignedBufferIsLargeEnoughToContain):
1386         (WebKit::HistoryEntryDataDecoder::markInvalid):
1387         (WebKit::LegacySessionStateDecoder::decodeSessionHistoryEntryData):
1388
1389 2014-06-21  Commit Queue  <commit-queue@webkit.org>
1390
1391         Unreviewed, rolling out r170244.
1392         https://bugs.webkit.org/show_bug.cgi?id=134157
1393
1394         GTK/EFL bindings generator works differently, making this
1395         patch not work there.  Will fix entire patch after a rollout.
1396         (Requested by bradee-oh on #webkit).
1397
1398         Reverted changeset:
1399
1400         "Gamepad API - Deprecate the existing implementation"
1401         https://bugs.webkit.org/show_bug.cgi?id=134108
1402         http://trac.webkit.org/changeset/170244
1403
1404 2014-06-21  Brady Eidson  <beidson@apple.com>
1405
1406         Gamepad API - Deprecate the existing implementation
1407         https://bugs.webkit.org/show_bug.cgi?id=134108
1408
1409         Reviewed by Timothy Hatcher.
1410
1411         -Add new "GAMEPAD_DEPRECATED" build flag, moving the existing implementation to use it
1412         -Add the "Deprecated" suffix to some implementation files
1413
1414         * Configurations/FeatureDefines.xcconfig:
1415
1416 2014-06-21  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
1417
1418         [CoordinatedGraphics][WK2][EFL] Page is moved to (0,0) position before rendering content
1419         https://bugs.webkit.org/show_bug.cgi?id=133300
1420
1421         Reviewed by Csaba Osztrogonác.
1422
1423         When new page is loaded, PageViewportController::didCommitLoad() calls PageViewportController::syncVisibleContents()
1424         with initial position via applyPositionAfterRenderingContents() before starting to render
1425         new page by PageViewportController::didRenderFrame(). This call flow causes that webview shows
1426         incomplete tiles to the user during a few milliseconds. To fix showing incomplete tiles during
1427         the page loading, this patch adds a flag so that we don't show the incomplete tiles until showing
1428         new page.
1429
1430         * UIProcess/API/efl/EwkView.cpp:
1431         (EwkView::EwkView):
1432         * UIProcess/API/efl/EwkView.h:
1433         (EwkView::setWaitingForNewPage):
1434         (EwkView::waitingForNewPage):
1435         * UIProcess/efl/PageLoadClientEfl.cpp:
1436         (WebKit::PageLoadClientEfl::didCommitLoadForFrame):
1437         * UIProcess/efl/PageViewportControllerClientEfl.cpp:
1438         (WebKit::PageViewportControllerClientEfl::didChangeVisibleContents):
1439         * UIProcess/efl/ViewClientEfl.cpp:
1440         (WebKit::ViewClientEfl::didRenderFrame):
1441         (WebKit::ViewClientEfl::didCompletePageTransition):
1442
1443 2014-06-21  Ryosuke Niwa  <rniwa@webkit.org>
1444
1445         Commit queue has been failing due to a build failure in WKFoundation.h
1446         https://bugs.webkit.org/show_bug.cgi?id=134152
1447
1448         Reviewed by Csaba Osztrogonác.
1449         Landed by Brady Eidson.
1450
1451         The build failure was caused by WKFoundation.h erroneously redefining
1452         NSURLSessionAuthChallengeDisposition even when building with 10.9 SDK.
1453
1454         The availability of this type depends on the version of SDK,
1455         not the target operating system.
1456
1457         * Shared/API/Cocoa/WKFoundation.h:
1458
1459 2014-06-21  Eva Balazsfalvi  <evab.u-szeged@partner.samsung.com>
1460
1461         Removing PAGE_VISIBILITY_API compile guard.
1462         https://bugs.webkit.org/show_bug.cgi?id=133844
1463
1464         Reviewed by Gavin Barraclough.
1465
1466         * Configurations/FeatureDefines.xcconfig:
1467         * WebProcess/WebPage/WebPage.cpp:
1468         (WebKit::WebPage::updatePreferences):
1469
1470 2014-06-20  Anders Carlsson  <andersca@apple.com>
1471
1472         Implement more of LegacySessionStateDecoder
1473         https://bugs.webkit.org/show_bug.cgi?id=134145
1474
1475         Reviewed by Sam Weinig.
1476
1477         * Shared/SessionState.h:
1478         * UIProcess/mac/LegacySessionStateCoding.cpp:
1479         (WebKit::LegacySessionStateDecoder::decodeSessionHistoryEntry):
1480         (WebKit::HistoryEntryDataDecoder::HistoryEntryDataDecoder):
1481         (WebKit::HistoryEntryDataDecoder::finishDecoding):
1482         (WebKit::LegacySessionStateDecoder::decodeSessionHistoryEntryData):
1483         * UIProcess/mac/LegacySessionStateCoding.h:
1484
1485 2014-06-20  Anders Carlsson  <andersca@apple.com>
1486
1487         Implement more of LegacySessionStateDecoder
1488         https://bugs.webkit.org/show_bug.cgi?id=134144
1489
1490         Reviewed by Sam Weinig.
1491
1492         * Shared/SessionState.cpp:
1493         (WebKit::BackForwardListState::encode):
1494         (WebKit::SessionState::encode): Deleted.
1495         * Shared/SessionState.h:
1496         * UIProcess/mac/LegacySessionStateCoding.cpp:
1497         (WebKit::LegacySessionStateDecoder::decodeSessionState):
1498         (WebKit::LegacySessionStateDecoder::decodeSessionHistory):
1499         (WebKit::LegacySessionStateDecoder::decodeV0SessionHistory):
1500         (WebKit::LegacySessionStateDecoder::decodeV1SessionHistory):
1501         (WebKit::LegacySessionStateDecoder::decodeSessionHistoryEntries):
1502         (WebKit::LegacySessionStateDecoder::decodeSessionHistoryEntry):
1503         * UIProcess/mac/LegacySessionStateCoding.h:
1504
1505 2014-06-20  Ryuan Choi  <ryuan.choi@samsung.com>
1506
1507         Unreviewed. build fix for the cmake based ports since r170188
1508
1509         * CMakeLists.txt: Added LegacySessionState.cpp in source list.
1510
1511 2014-06-20  Dan Bernstein  <mitz@apple.com>
1512
1513         [Cocoa] No way to get the main frame’s main resource’s data
1514         https://bugs.webkit.org/show_bug.cgi?id=134113
1515
1516         Reviewed by Sam Weinig.
1517
1518         * UIProcess/API/Cocoa/WKWebView.mm:
1519         (-[WKWebView _getMainResourceDataWithCompletionHandler:]): Added. Calls
1520         WebPageProxy::getMainResourceDataOfFrame and invokes the completion handler form the
1521         callback.
1522         * UIProcess/API/Cocoa/WKWebViewPrivate.h: Declared new method.
1523
1524         * UIProcess/WebPageProxy.cpp:
1525         (WebKit::WebPageProxy::getMainResourceDataOfFrame): Made it safe to pass a NULL frame into
1526         this function.
1527
1528 2014-06-20  Anders Carlsson  <andersca@apple.com>
1529
1530         Introduce a WKSessionStateRef object
1531         https://bugs.webkit.org/show_bug.cgi?id=134136
1532
1533         Reviewed by Tim Horton.
1534
1535         WKSessionStateRef is going to hold session state, making it possible to migrate state from one 
1536         webpage to another without having to do any serialization/deserialization.
1537
1538         * Shared/API/c/WKBase.h:
1539         * Shared/APIObject.h:
1540         * Shared/SessionState.cpp:
1541         (WebKit::SessionState::encode):
1542         * Shared/SessionState.h:
1543         * UIProcess/API/APISessionState.cpp: Added.
1544         (API::SessionState::create):
1545         (API::SessionState::SessionState):
1546         (API::SessionState::~SessionState):
1547         * UIProcess/API/APISessionState.h:
1548         * UIProcess/API/C/WKAPICast.h:
1549         * UIProcess/API/C/WKSessionStateRef.cpp:
1550         (WKSessionStateCreateFromData):
1551         * UIProcess/API/C/WKSessionStateRef.h:
1552         * UIProcess/mac/LegacySessionStateCoding.cpp:
1553         (WebKit::LegacySessionStateDecoder::LegacySessionStateDecoder):
1554         (WebKit::LegacySessionStateDecoder::~LegacySessionStateDecoder):
1555         (WebKit::LegacySessionStateDecoder::decodeSessionState):
1556         * UIProcess/mac/LegacySessionStateCoding.h:
1557         * WebKit2.xcodeproj/project.pbxproj:
1558
1559 2014-06-19  Enrica Casucci  <enrica@apple.com>
1560
1561         iOS WebKit2: selection handles become too large when zooming a page.
1562         https://bugs.webkit.org/show_bug.cgi?id=134084
1563         <rdar://problem/16799164>
1564
1565         Reviewed by Benjamin Poulain.
1566
1567         Since the document view is zoomed, we add a subview that has the inverse transform
1568         of the document view. This new view becomes the root for the selection hierarchy.
1569         The new view has zero size, not to interfere with the existing gestures on the WKContenView
1570         therefore we implement hitTest to detect interaction with the selection elements.
1571
1572         * UIProcess/ios/WKContentView.mm:
1573         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:]):
1574         * UIProcess/ios/WKContentViewInteraction.h:
1575         * UIProcess/ios/WKContentViewInteraction.mm:
1576         (-[WKContentView setupInteraction]):
1577         (-[WKContentView cleanupInteraction]):
1578         (-[WKContentView unscaledView]):
1579         (-[WKContentView inverseScale]):
1580         (-[WKContentView _updateUnscaledView]):
1581         (-[WKContentView hitTest:withEvent:::]):
1582         (-[WKContentView selectedTextRange]):
1583
1584 2014-06-20  Timothy Horton  <timothy_horton@apple.com>
1585
1586         Snapshotting WKThumbnailViews should not tell Web processes backing unparented WKViews that they're in window
1587         https://bugs.webkit.org/show_bug.cgi?id=134134
1588         <rdar://problem/17402119>
1589
1590         Reviewed by Anders Carlsson.
1591
1592         * UIProcess/API/mac/WKView.mm:
1593         (-[WKView _setThumbnailView:]):
1594         Re-evaluating our in-window state is only useful if we're going to use the live layer tree;
1595         snapshots can be taken of unparented views with no trouble. Plus, doing so sets off a chain of
1596         expensive things in the Web process which we can avoid if using snapshots.
1597
1598 2014-06-20  Timothy Horton  <timothy_horton@apple.com>
1599
1600         WKThumbnailView should only use live layer trees before the snapshot arrives for parented WKViews
1601         https://bugs.webkit.org/show_bug.cgi?id=134129
1602         <rdar://problem/17401591>
1603
1604         Reviewed by Anders Carlsson.
1605
1606         * UIProcess/API/Cocoa/_WKThumbnailView.mm:
1607         (-[_WKThumbnailView initWithFrame:fromWKView:]):
1608         Add a white background to WKThumbnailView, so that if we have no snapshot and no layer tree,
1609         the view isn't transparent.
1610
1611         * UIProcess/API/mac/WKView.mm:
1612         (-[WKView _updateThumbnailViewLayer]):
1613         We currently pull the live layer tree into the WKThumbnailView even in snapshot mode,
1614         before the snapshot arrives, to avoid flashing when transitioning a live WKView to a thumbnail view.
1615         This is, however, not useful for unparented WKViews, because their layer tree will be detached
1616         and we'll flash anyway. So, only do that when the WKView is parented.
1617
1618 2014-06-20  Geoffrey Garen  <ggaren@apple.com>
1619
1620         WebKit delegate methods should document their default behaviors
1621         https://bugs.webkit.org/show_bug.cgi?id=134132
1622
1623         Reviewed by Dan Bernstein.
1624
1625         * UIProcess/API/Cocoa/WKNavigationDelegate.h:
1626         * UIProcess/API/Cocoa/WKUIDelegate.h:
1627
1628 2014-06-20  Simon Fraser  <simon.fraser@apple.com>
1629
1630         Fix lots of WK2 test crashes.
1631
1632         We don't always have a ScrollingCoordinator.
1633
1634         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
1635         (WebKit::TiledCoreAnimationDrawingArea::flushLayers):
1636
1637 2014-06-20  Anders Carlsson  <andersca@apple.com>
1638
1639         Always use XPC on iOS
1640         https://bugs.webkit.org/show_bug.cgi?id=134130
1641
1642         Reviewed by Sam Weinig.
1643
1644         * UIProcess/ios/WebProcessProxyIOS.mm:
1645         (WebKit::WebProcessProxy::platformGetLaunchOptions):
1646         (WebKit::shouldUseXPC): Deleted.
1647
1648 2014-06-20  Anders Carlsson  <andersca@apple.com>
1649
1650         Fix build.
1651
1652         * Shared/SessionState.cpp:
1653
1654 2014-06-20  Anders Carlsson  <andersca@apple.com>
1655
1656         Add ArgumentEncoder support to PageState and friends
1657         https://bugs.webkit.org/show_bug.cgi?id=134128
1658
1659         Reviewed by Andreas Kling.
1660
1661         Change the classes to structs, get rid of the constructors/destructors
1662         and add encode member functions.
1663
1664         * Shared/SessionState.cpp:
1665         (WebKit::HTTPBody::Element::encode):
1666         (WebKit::HTTPBody::encode):
1667         (WebKit::FrameState::encode):
1668         (WebKit::PageState::encode):
1669         (WebKit::HTTPBody::Element::Element): Deleted.
1670         (WebKit::HTTPBody::Element::~Element): Deleted.
1671         (WebKit::FrameState::FrameState): Deleted.
1672         (WebKit::FrameState::~FrameState): Deleted.
1673         (WebKit::PageState::PageState): Deleted.
1674         (WebKit::PageState::~PageState): Deleted.
1675         * Shared/SessionState.h:
1676         (WebKit::HTTPBody::Element::type): Deleted.
1677
1678 2014-06-20  Anders Carlsson  <andersca@apple.com>
1679
1680         Add encoding and decoding support for WTF::Optional
1681         https://bugs.webkit.org/show_bug.cgi?id=134125
1682
1683         Reviewed by Andreas Kling.
1684
1685         * Platform/IPC/ArgumentCoders.h:
1686         (IPC::ArgumentCoder<WTF::Optional<T>>::encode):
1687         (IPC::ArgumentCoder<WTF::Optional<T>>::decode):
1688
1689 2014-06-20  Anders Carlsson  <andersca@apple.com>
1690
1691         Give NPAPI post requests a default content type
1692         https://bugs.webkit.org/show_bug.cgi?id=134120
1693
1694         Reviewed by Andreas Kling.
1695
1696         * WebProcess/Plugins/PluginView.cpp:
1697         (WebKit::PluginView::loadURL):
1698
1699 2014-06-20  Simon Fraser  <simon.fraser@apple.com>
1700
1701         Always commit the scrolling tree when we flush layers
1702         https://bugs.webkit.org/show_bug.cgi?id=134115
1703
1704         Reviewed by Beth Dakin.
1705         
1706         The scrolling state tree contains bare pointers to GraphicsLayers, which get
1707         converted to CALayers at commit time. To avoid a window of time where those
1708         GraphicsLayer pointers go stale, commit the scrolling tree whenever we flush the
1709         compositing layer tree.
1710
1711         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
1712         (WebKit::TiledCoreAnimationDrawingArea::flushLayers):
1713
1714 2014-06-19  Simon Fraser  <simon.fraser@apple.com>
1715
1716         [iOS WebKit2] Make -webkit-overflow-scrolling:touch work in iframes (breaks MSWord previews)
1717         https://bugs.webkit.org/show_bug.cgi?id=134085
1718         <rdar://problem/16440586>
1719
1720         Reviewed by Tim Horton.
1721         
1722         Add some debug-only assertions that check that the number of nodes we encoded is
1723         the expected number.
1724
1725         * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp:
1726         (WebKit::encodeNodeAndDescendants):
1727         (WebKit::RemoteScrollingCoordinatorTransaction::encode):
1728
1729 2014-06-19  Simon Fraser  <simon.fraser@apple.com>
1730
1731         Handle scrolling tree modifications which remove intermediate nodes
1732         https://bugs.webkit.org/show_bug.cgi?id=134082
1733
1734         Reviewed by Tim Horton.
1735
1736         When updating the scrolling tree from the state tree, we failed to maintain
1737         the children arrays correctly. Fix by removing all children on scrolling nodes,
1738         and allowing the calls on children to add them back. A temporary hash map
1739         keeps the nodes alive.
1740         
1741         The state tree's m_nodesRemovedSinceLastCommit was also made into a HashSet,
1742         to make it easier to handle removal followed by re-insertion.
1743
1744         * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp:
1745         (WebKit::RemoteScrollingCoordinatorTransaction::decode):
1746         (WebKit::RemoteScrollingTreeTextStream::dump):
1747
1748 2014-06-19  Simon Fraser  <simon.fraser@apple.com>
1749
1750         Make ScrollingTreeNodes refounted, for easier tree reconfiguration
1751         https://bugs.webkit.org/show_bug.cgi?id=134075
1752
1753         Reviewed by Tim Horton.
1754
1755         Make ScrollingTreeNode be ref-counted.
1756
1757         * UIProcess/Scrolling/RemoteScrollingTree.cpp:
1758         (WebKit::RemoteScrollingTree::createNode):
1759         * UIProcess/Scrolling/RemoteScrollingTree.h:
1760         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
1761         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
1762         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::create):
1763         * WebProcess/Scrolling/RemoteScrollingCoordinator.h:
1764         * WebProcess/Scrolling/RemoteScrollingCoordinator.mm:
1765         (WebKit::RemoteScrollingCoordinator::createScrollingTreeNode):
1766
1767 2014-06-20  Dan Bernstein  <mitz@apple.com>
1768
1769         [Cocoa] No way to get the MIME type of the main frame
1770         https://bugs.webkit.org/show_bug.cgi?id=134111
1771
1772         Reviewed by Anders Carlsson.
1773
1774         * UIProcess/API/Cocoa/WKWebView.mm:
1775         (-[WKWebView _MIMEType]): Added. Returns the MIME type of the main frame, or nil.
1776         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1777
1778 2014-06-20  Joseph Pecoraro  <pecoraro@apple.com>
1779
1780         [iOS]: Overrelease of RetainPtr object in file upload
1781         https://bugs.webkit.org/show_bug.cgi?id=134072
1782
1783         Reviewed by Brady Eidson.
1784
1785         This ivar is a RetainPtr, the release will be done automatically
1786         for us when we assign to nil or destruct.
1787
1788         * UIProcess/ios/WKContentViewInteraction.mm:
1789         (-[WKContentView fileUploadPanelDidDismiss:]):
1790
1791 2014-06-20  Anders Carlsson  <andersca@apple.com>
1792
1793         Begin stubbing out new session state classes
1794         https://bugs.webkit.org/show_bug.cgi?id=134110
1795
1796         Reviewed by Geoffrey Garen.
1797
1798         The basic idea is that these classes will replace the data blobs representing HistoryItems
1799         that we currently send back and forth between the web and UI processes.
1800         
1801         * Shared/SessionState.cpp: Added.
1802         (WebKit::HTTPBody::Element::Element):
1803         (WebKit::HTTPBody::Element::~Element):
1804         (WebKit::FrameState::FrameState):
1805         (WebKit::FrameState::~FrameState):
1806         (WebKit::PageState::PageState):
1807         (WebKit::PageState::~PageState):
1808         * Shared/SessionState.h: Added.
1809         (WebKit::HTTPBody::Element::type):
1810         * WebKit2.xcodeproj/project.pbxproj:
1811
1812 2014-06-20  Anders Carlsson  <andersca@apple.com>
1813
1814         Rename SessionState to LegacySessionState
1815         https://bugs.webkit.org/show_bug.cgi?id=134107
1816
1817         Reviewed by Dan Bernstein.
1818
1819         * Shared/LegacySessionState.cpp: Renamed from Source/WebKit2/Shared/SessionState.cpp.
1820         (IPC::ArgumentCoder<RefPtr<T>>::encode):
1821         (IPC::ArgumentCoder<RefPtr<T>>::decode):
1822         (WebKit::LegacySessionState::LegacySessionState):
1823         (WebKit::LegacySessionState::isEmpty):
1824         (WebKit::LegacySessionState::encode):
1825         (WebKit::LegacySessionState::decode):
1826         * Shared/LegacySessionState.h: Renamed from Source/WebKit2/Shared/SessionState.h.
1827         (WebKit::LegacySessionState::list):
1828         (WebKit::LegacySessionState::currentIndex):
1829         * Shared/WebPageCreationParameters.h:
1830         * UIProcess/WebPageProxy.cpp:
1831         (WebKit::WebPageProxy::creationParameters):
1832         * UIProcess/cf/WebPageProxyCF.cpp:
1833         (WebKit::WebPageProxy::restoreFromSessionStateData):
1834         * WebKit2.xcodeproj/project.pbxproj:
1835         * WebProcess/WebPage/WebPage.cpp:
1836         (WebKit::WebPage::restoreSession):
1837         (WebKit::WebPage::restoreSessionAndNavigateToCurrentItem):
1838         * WebProcess/WebPage/WebPage.h:
1839         * WebProcess/WebPage/WebPage.messages.in:
1840
1841 2014-06-20  Anders Carlsson  <andersca@apple.com>
1842
1843         Document the underlying types of the WKWindowFeatures rect properties
1844         https://bugs.webkit.org/show_bug.cgi?id=134103
1845
1846         Reviewed by Dan Bernstein.
1847
1848         * UIProcess/API/Cocoa/WKWindowFeatures.h:
1849
1850 2014-06-20  Zan Dobersek  <zdobersek@igalia.com>
1851
1852         PluginProcessMainUnix should only scan for plugins when X11 plugin architecture is enabled
1853         https://bugs.webkit.org/show_bug.cgi?id=134098
1854
1855         Reviewed by Carlos Garcia Campos.
1856
1857         * PluginProcess/unix/PluginProcessMainUnix.cpp: Guard the call to NetscapePluginModule::scanPlugin()
1858         with PLUGIN_ARCHITECTURE(X11) since the declaration has the same build guard. In case the X11 plugin
1859         architecture is not enabled the program exits with EXIT_FAILURE.
1860
1861 2014-06-20  Tim Horton  <timothy_horton@apple.com>
1862
1863         LayerPool’d PlatformCALayerRemote/RemoteLayerBackingStore can have stale context pointers
1864         https://bugs.webkit.org/show_bug.cgi?id=134050
1865         <rdar://problem/17315114>
1866
1867         Reviewed by Simon Fraser.
1868
1869         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
1870         (WebKit::PlatformCALayerRemote::recursiveBuildTransaction):
1871         (WebKit::PlatformCALayerRemote::layerPool):
1872         * WebProcess/WebPage/mac/PlatformCALayerRemote.h:
1873         * WebProcess/WebPage/mac/RemoteLayerTreeContext.h:
1874         (WebKit::RemoteLayerTreeContext::layerPool):
1875         * WebProcess/WebPage/mac/RemoteLayerTreeContext.mm:
1876         (WebKit::RemoteLayerTreeContext::buildTransaction):
1877         Ensure that layers being committed are always in the context that is committing them.
1878         Use a LayerPool per RemoteLayerTreeContext, to avoid moving layers between contexts.
1879
1880 2014-06-20  Tim Horton  <timothy_horton@apple.com>
1881
1882         WKContentViewInteraction isn't cleaned up when the Web Content process crashes
1883         https://bugs.webkit.org/show_bug.cgi?id=134080
1884         <rdar://problem/17387652> and <rdar://problem/16848360>
1885
1886         Reviewed by Benjamin Poulain.
1887
1888         * UIProcess/ios/WKContentView.mm:
1889         (-[WKContentView _processDidExit]):
1890         Tear down WKContentViewInteraction when the process crashes.
1891
1892         (-[WKContentView _didRelaunchProcess]):
1893         Set WKContentViewInteraction back up when the process is relaunched.
1894
1895         * UIProcess/ios/WKContentViewInteraction.mm:
1896         (-[WKContentView cleanupInteraction]):
1897         Clear the SmartMagnificationController, which is a message receiver and thus must be re-created with the new page.
1898         Remove all gesture recognizers from the content view.
1899         Clear _fileUploadPanel, else we'll get an assert the next time we try to open one.
1900
1901         * UIProcess/WebPageProxy.cpp:
1902         (WebKit::WebPageProxy::resetStateAfterProcessExited):
1903         Give the PageClient a chance to clean up *before* we clean up internals;
1904         it is at a higher level and some cleanup depends on WebPageProxy members
1905         not having been cleared yet.
1906
1907 2014-06-19  Dan Bernstein  <mitz@apple.com>
1908
1909         Removed unused SPI -[WKWebView _runJavaScriptInMainFrame:].
1910
1911         Rubber-stamped by Simon Fraser.
1912
1913         * UIProcess/API/Cocoa/WKWebView.mm:
1914         (-[WKWebView _runJavaScriptInMainFrame:]): Deleted.
1915         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1916
1917 2014-06-19  Dan Bernstein  <mitz@apple.com>
1918
1919         Use a single map for all callback types in WebPageProxy
1920         https://bugs.webkit.org/show_bug.cgi?id=134069
1921
1922         Reviewed by Tim Horton.
1923
1924         * UIProcess/GenericCallback.h:
1925         (WebKit::CallbackMap::take):
1926         * UIProcess/WebPageProxy.cpp:
1927         (WebKit::WebPageProxy::printFinishedCallback):
1928         (WebKit::WebPageProxy::resetState):
1929         (WebKit::WebPageProxy::drawPagesForPrinting):
1930         * UIProcess/WebPageProxy.h:
1931         * UIProcess/mac/WebPageProxyMac.mm:
1932         (WebKit::WebPageProxy::attributedSubstringForCharacterRangeAsync):
1933         (WebKit::WebPageProxy::attributedStringForCharacterRangeCallback):
1934
1935 2014-06-19  Anders Carlsson  <andersca@apple.com>
1936
1937         Another build fix attempt.
1938
1939         * Shared/API/Cocoa/WKFoundation.h:
1940
1941 2014-06-19  Dan Bernstein  <mitz@apple.com>
1942
1943         [iOS] Legacy processes are installed inside WebKit.framework
1944         https://bugs.webkit.org/show_bug.cgi?id=134079
1945
1946         Reviewed by Anders Carlsson.
1947
1948         * Configurations/All.xcconfig: Exclude the legacy processes on iOS so they don’t get copied.
1949         * Configurations/BaseLegacyProcess.xcconfig: Set SKIP_INSTALL to YES on iOS.
1950
1951 2014-06-19  Anders Carlsson  <andersca@apple.com>
1952
1953         It's OS X, not OSX...
1954
1955         * Shared/API/Cocoa/WKFoundation.h:
1956
1957 2014-06-19  Antti Koivisto  <antti@apple.com>
1958
1959         Unfreeze the layer tree on DidFirstVisuallyNonEmptyLayout
1960         https://bugs.webkit.org/show_bug.cgi?id=134073
1961
1962         Reviewed by Simon Fraser.
1963         
1964         DidFirstLayout is too early and we usually get a blank page. This doesn't match the existing iOS behavior either.
1965
1966         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1967         (WebKit::WebFrameLoaderClient::dispatchDidLayout):
1968         * WebProcess/WebPage/WebPage.cpp:
1969         (WebKit::WebPage::WebPage):
1970
1971 2014-06-19  Anders Carlsson  <andersca@apple.com>
1972
1973         Try to fix the Mavericks build.
1974
1975         * Shared/API/Cocoa/WKFoundation.h:
1976
1977 2014-06-19  Sam Weinig  <sam@webkit.org>
1978
1979         [Cocoa] Need SPI to determine if the WKWebView is displaying a standalone image
1980         https://bugs.webkit.org/show_bug.cgi?id=134071
1981
1982         Reviewed by Anders Carlsson.
1983
1984         * UIProcess/API/Cocoa/WKWebView.mm:
1985         (-[WKWebView _isDisplayingStandaloneImageDocument]):
1986         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1987
1988 2014-06-19  Dan Bernstein  <mitz@apple.com>
1989
1990         Use a single map for all callback types in WebPageProxy
1991         https://bugs.webkit.org/show_bug.cgi?id=134069
1992
1993         Reviewed by Anders Carlsson.
1994
1995         * UIProcess/GenericCallback.h:
1996         (WebKit::CallbackBase::as): Added. Performs a dynamic cast to a specific callback type.
1997         (WebKit::CallbackBase::CallbackBase): Added a type parameter, which is used to initialize
1998         the new m_type member.
1999         (WebKit::GenericCallback::GenericCallback): Pass the type to the base class constructor.
2000         (WebKit::GenericCallback::type): Added. Returns a unique type.
2001         (WebKit::GenericCallback::invalidate): Now virtual.
2002
2003         (WebKit::CallbackMap::put): Adds the callback to the map.
2004         (WebKit::CallbackMap::take): Removes the callback from the map, and dynamically casts it to
2005         the specified type.
2006         (WebKit::CallbackMap::invalidate): Invalidates the map.
2007
2008         * UIProcess/WebPageProxy.cpp:
2009         (WebKit::WebPageProxy::validateCommand):
2010         (WebKit::WebPageProxy::runJavaScriptInMainFrame):
2011         (WebKit::WebPageProxy::getRenderTreeExternalRepresentation):
2012         (WebKit::WebPageProxy::getSourceForFrame):
2013         (WebKit::WebPageProxy::getContentsAsString):
2014         (WebKit::WebPageProxy::getBytecodeProfile):
2015         (WebKit::WebPageProxy::getSelectionOrContentsAsString):
2016         (WebKit::WebPageProxy::getSelectionAsWebArchiveData):
2017         (WebKit::WebPageProxy::getMainResourceDataOfFrame):
2018         (WebKit::WebPageProxy::getResourceDataFromFrame):
2019         (WebKit::WebPageProxy::getWebArchiveOfFrame):
2020         (WebKit::WebPageProxy::forceRepaint):
2021         (WebKit::WebPageProxy::clearLoadDependentCallbacks):
2022         (WebKit::WebPageProxy::voidCallback):
2023         (WebKit::WebPageProxy::dataCallback):
2024         (WebKit::WebPageProxy::imageCallback):
2025         (WebKit::WebPageProxy::stringCallback):
2026         (WebKit::WebPageProxy::scriptValueCallback):
2027         (WebKit::WebPageProxy::computedPagesCallback):
2028         (WebKit::WebPageProxy::validateCommandCallback):
2029         (WebKit::WebPageProxy::unsignedCallback):
2030         (WebKit::WebPageProxy::editingRangeCallback):
2031         (WebKit::WebPageProxy::rectForCharacterRangeCallback):
2032         (WebKit::WebPageProxy::resetState):
2033         (WebKit::WebPageProxy::computePagesForPrinting):
2034         (WebKit::WebPageProxy::drawRectToImage):
2035         (WebKit::WebPageProxy::drawPagesToPDF):
2036         (WebKit::WebPageProxy::getMarkedRangeAsync):
2037         (WebKit::WebPageProxy::getSelectedRangeAsync):
2038         (WebKit::WebPageProxy::characterIndexForPointAsync):
2039         (WebKit::WebPageProxy::firstRectForCharacterRangeAsync):
2040         (WebKit::WebPageProxy::takeSnapshot):
2041         * UIProcess/WebPageProxy.h:
2042         * UIProcess/ios/WebPageProxyIOS.mm:
2043         (WebKit::WebPageProxy::gestureCallback):
2044         (WebKit::WebPageProxy::touchesCallback):
2045         (WebKit::WebPageProxy::autocorrectionDataCallback):
2046         (WebKit::WebPageProxy::dictationContextCallback):
2047         (WebKit::WebPageProxy::autocorrectionContextCallback):
2048         (WebKit::WebPageProxy::selectWithGesture):
2049         (WebKit::WebPageProxy::updateSelectionWithTouches):
2050         (WebKit::WebPageProxy::requestAutocorrectionData):
2051         (WebKit::WebPageProxy::applyAutocorrection):
2052         (WebKit::WebPageProxy::requestDictationContext):
2053         (WebKit::WebPageProxy::requestAutocorrectionContext):
2054         (WebKit::WebPageProxy::selectWithTwoTouches):
2055
2056 2014-06-19  Anders Carlsson  <andersca@apple.com>
2057
2058         No way to handle HTTP Authentication with WKWebView
2059         https://bugs.webkit.org/show_bug.cgi?id=134067
2060         <rdar://problem/17317874>
2061
2062         Reviewed by Dan Bernstein.
2063
2064         Add a public webView:didReceiveAuthenticationChallenge:completionHandler: delegate method and get rid of the SPI.
2065         
2066         * Shared/API/Cocoa/WKFoundation.h:
2067         * UIProcess/API/Cocoa/WKNavigationDelegate.h:
2068         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
2069         * UIProcess/Cocoa/NavigationState.mm:
2070         (WebKit::NavigationState::setNavigationDelegate):
2071         (WebKit::NavigationState::LoaderClient::didReceiveAuthenticationChallengeInFrame):
2072
2073 2014-06-18  Roger Fong  <roger_fong@apple.com>
2074
2075         Don't kill the UIProcess until all local storage transactions have been committed.
2076         https://bugs.webkit.org/show_bug.cgi?id=134042.
2077         <rdar://problem/16660724>.
2078
2079         Reviewed by Anders Carlsson.
2080
2081         * UIProcess/API/mac/WKView.mm: Add a listener for the application will terminate notification.
2082         (-[WKView _applicationWillTerminate:]):
2083         (-[WKView initWithFrame:context:configuration:webView:]):
2084         * UIProcess/WebContext.cpp: Calls code in StorageManager to cleanup local storage transactions upon application termination.
2085         (WebKit::WebContext::applicationWillTerminate):
2086         * UIProcess/WebContext.h:
2087
2088         * UIProcess/Storage/StorageManager.cpp:
2089         (WebKit::StorageManager::applicationWillTerminate):
2090         Dispatch local storage cleanup task to background thread and make sure the UIProcess can't exit early.
2091         * UIProcess/Storage/StorageManager.h:
2092
2093 2014-06-19  Oliver Hunt  <oliver@apple.com>
2094
2095         Switch to using the process parameters during initialisation
2096         to determine whether we hsould be using the network process.
2097
2098         RS=Sam Weinig
2099
2100         * WebProcess/cocoa/WebProcessCocoa.mm:
2101         (WebKit::WebProcess::platformInitializeWebProcess):
2102
2103 2014-06-19  Pratik Solanki  <psolanki@apple.com>
2104
2105         Copy SharedBuffer data into IPC message directly
2106         https://bugs.webkit.org/show_bug.cgi?id=133920
2107
2108         Reviewed by Anders Carlsson.
2109
2110         When data array callbacks are enabled, we currently merge all the CFDataRefs in SharedBuffer
2111         into one contiguous memory buffer when creating IPC::DataReference. This patch creates a
2112         subclass of DataReference that uses SharedBuffer::getSomeData() to copy the data directly
2113         into the IPC message.
2114
2115         * NetworkProcess/AsynchronousNetworkLoaderClient.cpp:
2116         (WebKit::AsynchronousNetworkLoaderClient::didReceiveBuffer):
2117         * Platform/IPC/ArgumentEncoder.cpp:
2118         (IPC::ArgumentEncoder::reserve): Added.
2119         (IPC::ArgumentEncoder::grow):
2120         * Platform/IPC/ArgumentEncoder.h:
2121         * Platform/IPC/DataReference.cpp:
2122         (IPC::SharedBufferDataReference::encode):
2123         * Platform/IPC/DataReference.h:
2124         (IPC::DataReference::~DataReference):
2125
2126 2014-06-18  Zan Dobersek  <zdobersek@igalia.com>
2127
2128         Unreviewed. Fixing the GTK+ build after r170114.
2129
2130         * UIProcess/API/gtk/WebKitAuthenticationRequest.cpp:
2131         (webkit_authentication_request_get_proposed_credential):
2132         The core() accessor has been renamed to credential().
2133
2134 2014-06-18  Dan Bernstein  <mitz@apple.com>
2135
2136         Try to fix the Mountain Lion build.
2137
2138         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
2139         * UIProcess/Cocoa/NavigationState.mm:
2140         (WebKit::NavigationState::LoaderClient::didReceiveAuthenticationChallengeInFrame):
2141
2142 2014-06-18  Tim Horton  <timothy_horton@apple.com>
2143
2144         Remove RemoteLayerBackingStore’s RemoteLayerTreeContext pointer
2145         https://bugs.webkit.org/show_bug.cgi?id=134055
2146
2147         Reviewed by Simon Fraser.
2148
2149         * Shared/mac/RemoteLayerBackingStore.h:
2150         * Shared/mac/RemoteLayerBackingStore.mm:
2151         (WebKit::RemoteLayerBackingStore::RemoteLayerBackingStore):
2152         (WebKit::RemoteLayerBackingStore::~RemoteLayerBackingStore):
2153         (WebKit::RemoteLayerBackingStore::ensureBackingStore):
2154         (WebKit::RemoteLayerBackingStore::display):
2155         (WebKit::RemoteLayerBackingStore::drawInContext):
2156         Remove RemoteLayerBackingStore's RemoteLayerTreeContext pointer. Instead, use the PlatformCALayer's.
2157         Pass the PlatformCALayer in to the constructor, and remove it from ensureBackingStore();
2158         RemoteLayerBackingStore is (for now) strictly tied to a single layer.
2159
2160         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
2161         (WebKit::PlatformCALayerRemote::ensureBackingStore):
2162         (WebKit::PlatformCALayerRemote::updateBackingStore):
2163         * WebProcess/WebPage/mac/PlatformCALayerRemote.h:
2164         (WebKit::PlatformCALayerRemote::context):
2165
2166 2014-06-18  Dan Bernstein  <mitz@apple.com>
2167
2168         [Cocoa] Modernize one-method authentication
2169         https://bugs.webkit.org/show_bug.cgi?id=134051
2170
2171         Reviewed by Anders Carlsson.
2172
2173         Instead of an NSURLConnection-style delegate method that takes a challenge and responds to
2174         its sender, provide an NSURLSession-style method that takes a challenge and a completion
2175         handler.
2176
2177         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h: Declared new delegate method, replacing
2178         old unused method.
2179         * UIProcess/Cocoa/NavigationState.h: Renamed flag in m_navigationDelegateMethods struct.
2180         * UIProcess/Cocoa/NavigationState.mm:
2181         (WebKit::NavigationState::setNavigationDelegate): Check for new delegate method and update
2182         new flag.
2183
2184         (WebKit::NavigationState::LoaderClient::canAuthenticateAgainstProtectionSpaceInFrame): If
2185         the delegate implements the new method, return true (if it cannot handle the protection
2186         space, it can reject it through the completion handler), except for server-trust
2187         authentication, which is not supported yet.
2188         (WebKit::NavigationState::LoaderClient::didReceiveAuthenticationChallengeInFrame): If the
2189         delegate implements the new method, call it, passing a completion handler that calls the
2190         right AuthenticationDecisionListener function based on its disposition and credential
2191         parameters.
2192
2193 2014-06-18  Anders Carlsson  <andersca@apple.com>
2194
2195         Make FrameLoadType a strongly typed enum
2196         https://bugs.webkit.org/show_bug.cgi?id=134047
2197
2198         Reviewed by Andreas Kling.
2199
2200         * UIProcess/WebPageProxy.cpp:
2201         (WebKit::WebPageProxy::didCommitLoadForFrame):
2202         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2203         (WebKit::WebFrameLoaderClient::dispatchDidCommitLoad):
2204         * WebProcess/WebPage/WebPage.cpp:
2205         (WebKit::WebPage::goForward):
2206         (WebKit::WebPage::goBack):
2207         (WebKit::WebPage::goToBackForwardItem):
2208         (WebKit::shouldReuseCommittedSandboxExtension):
2209         (WebKit::WebPage::didCommitLoad):
2210
2211 2014-06-18  Anders Carlsson  <andersca@apple.com>
2212
2213         Simplify WebSecurityOrigin
2214         https://bugs.webkit.org/show_bug.cgi?id=134049
2215
2216         Reviewed by Andreas Kling.
2217
2218         * Shared/API/c/WKSecurityOrigin.cpp:
2219         (WKSecurityOriginCreateFromString):
2220         (WKSecurityOriginCreateFromDatabaseIdentifier):
2221         (WKSecurityOriginCopyDatabaseIdentifier):
2222         (WKSecurityOriginCopyToString):
2223         (WKSecurityOriginCopyProtocol):
2224         (WKSecurityOriginCopyHost):
2225         (WKSecurityOriginGetPort):
2226         * Shared/WebSecurityOrigin.h:
2227         (WebKit::WebSecurityOrigin::securityOrigin):
2228         (WebKit::WebSecurityOrigin::createFromDatabaseIdentifier): Deleted.
2229         (WebKit::WebSecurityOrigin::protocol): Deleted.
2230         (WebKit::WebSecurityOrigin::host): Deleted.
2231         (WebKit::WebSecurityOrigin::port): Deleted.
2232         (WebKit::WebSecurityOrigin::databaseIdentifier): Deleted.
2233         (WebKit::WebSecurityOrigin::toString): Deleted.
2234         * UIProcess/Notifications/WebNotificationManagerProxy.cpp:
2235         (WebKit::WebNotificationManagerProxy::providerDidUpdateNotificationPolicy):
2236         (WebKit::WebNotificationManagerProxy::providerDidRemoveNotificationPolicies):
2237         * UIProcess/Storage/StorageManager.cpp:
2238         (WebKit::StorageManager::deleteEntriesForOrigin):
2239         * UIProcess/Storage/StorageManager.h:
2240         * UIProcess/WebApplicationCacheManagerProxy.cpp:
2241         (WebKit::WebApplicationCacheManagerProxy::deleteEntriesForOrigin):
2242         * UIProcess/WebDatabaseManagerProxy.cpp:
2243         (WebKit::WebDatabaseManagerProxy::didGetDatabasesByOrigin):
2244         (WebKit::WebDatabaseManagerProxy::didGetDatabaseOrigins):
2245         (WebKit::WebDatabaseManagerProxy::deleteDatabaseWithNameForOrigin):
2246         (WebKit::WebDatabaseManagerProxy::deleteDatabasesForOrigin):
2247         (WebKit::WebDatabaseManagerProxy::setQuotaForOrigin):
2248         (WebKit::WebDatabaseManagerProxy::didModifyOrigin):
2249         (WebKit::WebDatabaseManagerProxy::didModifyDatabase):
2250         * UIProcess/WebKeyValueStorageManager.cpp:
2251         (WebKit::didGetStorageDetailsByOrigin):
2252         * UIProcess/WebOriginDataManagerProxy.cpp:
2253         (WebKit::WebOriginDataManagerProxy::deleteEntriesForOrigin):
2254         * UIProcess/WebPageProxy.cpp:
2255         (WebKit::WebPageProxy::exceededDatabaseQuota):
2256         (WebKit::WebPageProxy::requestGeolocationPermissionForFrame):
2257         * UIProcess/WebResourceCacheManagerProxy.cpp:
2258         (WebKit::WebResourceCacheManagerProxy::clearCacheForOrigin):
2259         * UIProcess/ios/WKGeolocationProviderIOS.mm:
2260         (-[WKGeolocationProviderIOS decidePolicyForGeolocationRequestFromOrigin:frame:request:window:]):
2261         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2262         (WebKit::WebChromeClient::exceededDatabaseQuota):
2263
2264 2014-06-18  Anders Carlsson  <andersca@apple.com>
2265
2266         Add back WKPageRunJavaScriptInMainFrame_b for now
2267         https://bugs.webkit.org/show_bug.cgi?id=134045
2268         <rdar://problem/17368879>
2269
2270         Reviewed by Tim Horton.
2271
2272         Reverted changeset:
2273
2274         "Remove WKPageRunJavaScriptInMainFrame_b"
2275         https://bugs.webkit.org/show_bug.cgi?id=133926
2276         http://trac.webkit.org/changeset/169991
2277
2278 2014-06-18  Anders Carlsson  <andersca@apple.com>
2279
2280         Simplify WebPageProxy::saveRecentSearches and WebPageProxy::loadRecentSearches
2281         https://bugs.webkit.org/show_bug.cgi?id=134041
2282
2283         Reviewed by Andreas Kling.
2284
2285         * UIProcess/cf/WebPageProxyCF.cpp:
2286         (WebKit::WebPageProxy::saveRecentSearches):
2287         (WebKit::WebPageProxy::loadRecentSearches):
2288
2289 2014-06-18  Simon Fraser  <simon.fraser@apple.com>
2290
2291         Make ScrollingStateNodes refcounted, and other minor cleanup
2292         https://bugs.webkit.org/show_bug.cgi?id=134040
2293
2294         Reviewed by Beth Dakin.
2295
2296         * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp:
2297         (WebKit::encodeNodeAndDescendants):
2298
2299 2014-06-18  Benjamin Poulain  <benjamin@webkit.org>
2300
2301         [iOS][WK2] Do not add padding when magnifying replaced elements
2302         https://bugs.webkit.org/show_bug.cgi?id=134019
2303
2304         Reviewed by Tim Horton.
2305
2306         Having margins for regular blocks make sense to improve readability. For replaced elements,
2307         we should follow iOS's UI and display edge to edge.
2308
2309         * UIProcess/ios/SmartMagnificationController.mm:
2310         (WebKit::SmartMagnificationController::didCollectGeometryForSmartMagnificationGesture):
2311
2312 2014-06-18  Benjamin Poulain  <bpoulain@apple.com>
2313
2314         [iOS][WK2] Re-sync didCommitLoadForMainFrame with its corresponding tile update
2315         https://bugs.webkit.org/show_bug.cgi?id=134009
2316
2317         Reviewed by Tim Horton.
2318
2319         WKWebView assumed the first _didCommitLayerTree: after _didCommitLoadForMainFrame
2320         had the state of the page being loaded.
2321
2322         This is not always true. Sometimes, a set of tiles can be rendering asynchronously while the next
2323         page is loaded, and does not flush the queue until after didCommitLoadForMainFrame is executed.
2324
2325         Tim introduced a transactionID with each layer tree update. This patch uses that to synchronize
2326         WKWebView with the right set of tiles.
2327
2328         * UIProcess/API/Cocoa/WKWebView.mm:
2329         (-[WKWebView _didCommitLoadForMainFrame]):
2330         (-[WKWebView _didCommitLayerTree:WebKit::]):
2331         (-[WKWebView _updateVisibleContentRects]):
2332         * UIProcess/WebPageProxy.h:
2333         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
2334         (WebKit::RemoteLayerTreeDrawingAreaProxy::nextLayerTreeTransactionID):
2335         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.messages.in:
2336         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
2337         (WebKit::RemoteLayerTreeDrawingAreaProxy::RemoteLayerTreeDrawingAreaProxy):
2338         (WebKit::RemoteLayerTreeDrawingAreaProxy::willCommitLayerTree):
2339         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
2340         (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
2341
2342 2014-06-18  Anders Carlsson  <andersca@apple.com>
2343
2344         Simplify WebCredential
2345         https://bugs.webkit.org/show_bug.cgi?id=134036
2346
2347         Reviewed by Andreas Kling.
2348
2349         * UIProcess/API/C/WKCredential.cpp:
2350         (WKCredentialCreate):
2351         (WKCredentialCreateWithCertificateInfo):
2352         (WKCredentialCopyUser):
2353         * UIProcess/Authentication/AuthenticationChallengeProxy.cpp:
2354         (WebKit::AuthenticationChallengeProxy::useCredential):
2355         * UIProcess/Authentication/WebCredential.cpp:
2356         (WebKit::WebCredential::credential):
2357         (WebKit::WebCredential::core): Deleted.
2358         (WebKit::WebCredential::user): Deleted.
2359         * UIProcess/Authentication/WebCredential.h:
2360         (WebKit::WebCredential::create): Deleted.
2361
2362 2014-06-18  Anders Carlsson  <andersca@apple.com>
2363
2364         Adopt modern C++11 loops and fix WebArchive creation functions
2365         https://bugs.webkit.org/show_bug.cgi?id=134032
2366
2367         Reviewed by Andreas Kling.
2368
2369         * Shared/APIWebArchive.cpp:
2370         (API::WebArchive::WebArchive):
2371
2372 2014-06-18  Anders Carlsson  <andersca@apple.com>
2373
2374         Give WKWebView on iOS a mobile user agent
2375         https://bugs.webkit.org/show_bug.cgi?id=134034
2376         <rdar://problem/17346489>
2377
2378         Reviewed by Enrica Casucci.
2379
2380         * UIProcess/API/Cocoa/WKWebView.mm:
2381         (-[WKWebView initWithFrame:configuration:]):
2382
2383 2014-06-18  Joseph Pecoraro  <pecoraro@apple.com>
2384
2385         Remove stale include, header was removed in r170101.
2386
2387         Unreviewed build fix.
2388
2389         * Shared/API/Cocoa/WebKitPrivate.h:
2390
2391 2014-06-18  Anders Carlsson  <andersca@apple.com>
2392
2393         Add CF type cast function templates and use them in KeyedDecoder in WebKit2
2394         https://bugs.webkit.org/show_bug.cgi?id=134033
2395
2396         Reviewed by Sam Weinig.
2397
2398         * Shared/cf/KeyedDecoder.cpp:
2399         (WebKit::KeyedDecoder::KeyedDecoder):
2400         (WebKit::KeyedDecoder::decodeBytes):
2401         (WebKit::KeyedDecoder::decodeBool):
2402         (WebKit::KeyedDecoder::decodeInt32):
2403         (WebKit::KeyedDecoder::decodeInt64):
2404         (WebKit::KeyedDecoder::decodeFloat):
2405         (WebKit::KeyedDecoder::decodeDouble):
2406         (WebKit::KeyedDecoder::decodeString):
2407         (WebKit::KeyedDecoder::beginObject):
2408         (WebKit::KeyedDecoder::beginArray):
2409         (WebKit::KeyedDecoder::beginArrayElement):
2410
2411 2014-06-18  Dan Bernstein  <mitz@apple.com>
2412
2413         Remove the unused _WKBackForwardListDidChangeNotification.
2414
2415         Reviewed by Anders Carlsson.
2416
2417         * UIProcess/API/Cocoa/WKBackForwardList.mm:
2418         * UIProcess/API/Cocoa/WKBackForwardListInternal.h:
2419         * UIProcess/API/Cocoa/WKBackForwardListPrivate.h: Removed.
2420         * UIProcess/Cocoa/NavigationState.h:
2421         * UIProcess/Cocoa/NavigationState.mm:
2422         (WebKit::NavigationState::LoaderClient::didChangeBackForwardList): Deleted.
2423         * WebKit2.xcodeproj/project.pbxproj:
2424
2425 2014-06-18  Andreas Kling  <akling@apple.com>
2426
2427         Set main thread QoS policies after IPC initialization.
2428         <https://webkit.org/b/134014>
2429
2430         Something was flipping the QoS level back to "unspecified" after
2431         setting it in the ChildProcess initialization code. Pending a better
2432         understanding of what really happens, move the code to a later stage,
2433         after IPC channels are up and running. Now the priority sticks.
2434
2435         Reviewed by Anders Carlsson.
2436
2437         * NetworkProcess/NetworkProcess.cpp:
2438         (WebKit::NetworkProcess::initializeNetworkProcess):
2439         * Shared/ChildProcess.cpp:
2440         (WebKit::ChildProcess::initialize):
2441         * WebProcess/WebProcess.cpp:
2442         (WebKit::WebProcess::initializeWebProcess):
2443
2444 2014-06-17  Dan Bernstein  <mitz@apple.com>
2445
2446         [Cocoa] WKWebView's _privateBrowsingEnabled property is unused
2447         https://bugs.webkit.org/show_bug.cgi?id=134013
2448
2449         Reviewed by Sam Weinig.
2450
2451         * UIProcess/API/Cocoa/WKWebView.mm:
2452         (-[WKWebView _privateBrowsingEnabled]): Deleted.
2453         (-[WKWebView _setPrivateBrowsingEnabled:]): Deleted.
2454         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2455
2456 2014-06-17  Tim Horton  <timothy_horton@apple.com>
2457
2458         [iOS][wk2] Use ImageDocument to display subframe PDFs
2459         https://bugs.webkit.org/show_bug.cgi?id=133944
2460         <rdar://problem/17205983>
2461
2462         Reviewed by Dan Bates.
2463
2464         * WebProcess/WebPage/WebPage.cpp:
2465         (WebKit::WebPage::updatePreferences):
2466         Always use ImageDocument for subframe PDFs in WebKit2 on iOS.
2467
2468 2014-06-17  Anders Carlsson  <andersca@apple.com>
2469
2470         Make it possible to use -[NSBundle classNamed:] to find WebKitLegacy classes
2471         https://bugs.webkit.org/show_bug.cgi?id=134008
2472         <rdar://problem/17037600>
2473
2474         Reviewed by Dan Bernstein.
2475
2476         * UIProcess/API/Cocoa/LegacyBundleForClass.mm: Added.
2477         * WebKit2.xcodeproj/project.pbxproj:
2478
2479 2014-06-17  Anders Carlsson  <andersca@apple.com>
2480
2481         Expose the location of website data
2482         https://bugs.webkit.org/show_bug.cgi?id=134000
2483         <rdar://problem/17350498>
2484
2485         Reviewed by Dan Bernstein.
2486
2487         Also, remove the bundle ID from the website data path for containerized apps.
2488
2489         * Shared/mac/SandboxUtilities.cpp:
2490         (WebKit::processIsAppSandboxed):
2491         * Shared/mac/SandboxUtilities.h:
2492         * UIProcess/API/Cocoa/WKProcessPool.mm:
2493         (+[WKProcessPool _websiteDataURLForContainerWithURL:]):
2494         (websiteDataDirectoryURL):
2495         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
2496
2497 2014-06-17  Jeremy Jones  <jeremyj@apple.com>
2498
2499         Improve enter and exit fullscreen transition by using two step transition.
2500         https://bugs.webkit.org/show_bug.cgi?id=133706
2501
2502         Reviewed by Simon Fraser.
2503
2504         Add setupFullscreen()/didSetupFullscreen() and cleanupFullscreen()/didCleanupFullscreen()
2505         to the proxies. And refactor enter/exit fullscreen to do some of the work in setup/cleanup.
2506
2507         * UIProcess/ios/WebVideoFullscreenManagerProxy.h:
2508         Add four methods mentioned above.
2509         * UIProcess/ios/WebVideoFullscreenManagerProxy.messages.in:
2510         Add Setup/Cleanup functions.
2511         * UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
2512         (WebKit::WebVideoFullscreenManagerProxy::setupFullscreenWithID): does what enterFullscreen used to do.
2513         (WebKit::WebVideoFullscreenManagerProxy::didCleanupFullscreen): forward IPC.
2514         (WebKit::WebVideoFullscreenManagerProxy::didSetupFullscreen): forward IPC.
2515         (WebKit::WebVideoFullscreenManagerProxy::enterFullscreenWithID): changed to enterFullscreen
2516         * WebProcess/ios/WebVideoFullscreenManager.h: Add didSetup/didCleanup
2517         * WebProcess/ios/WebVideoFullscreenManager.messages.in: Add didSetup/didCleanup
2518         * WebProcess/ios/WebVideoFullscreenManager.mm: 
2519         (WebKit::WebVideoFullscreenManager::enterFullscreenForNode): refactored,
2520         some implementation moves to didSetupFullscreen.
2521         (WebKit::WebVideoFullscreenManager::didSetupFullscreen):
2522         Moves the video layer over to the hosted layer, and initiates fullscreen.
2523         (WebKit::WebVideoFullscreenManager::didExitFullscreen): refactored,
2524         some implementation moves to didCleanupFullscreen, and initiates cleanup.
2525         (WebKit::WebVideoFullscreenManager::didCleanupFullscreen):
2526         Final cleanup refactored from didExitFullscreen()
2527
2528 2014-06-17  Eric Carlson  <eric.carlson@apple.com>
2529
2530         [iOS] enable background audio in WK2
2531         https://bugs.webkit.org/show_bug.cgi?id=133996
2532
2533         Reviewed by Jer Noble.
2534
2535         * WebProcess/EntryPoint/mac/XPCService/WebContentService.Development/Info-iOS.plist: Mark as
2536             allowed to play audio when in the background.
2537         * WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-iOS.plist: Ditto.
2538
2539 2014-06-17  Simon Fraser  <simon.fraser@apple.com>
2540
2541         [UI-side compositing] fix reflections on composited layers
2542         https://bugs.webkit.org/show_bug.cgi?id=133942
2543
2544         Reviewed by Tim Horton.
2545         
2546         Fix reflections on composited layers. There are two main set of changes.
2547         
2548         First, a PlatformCALayerRemote which is a clone has to track the layer
2549         it is a clone of, so it knows where to grab the contents from in the UI process.
2550         This layer may be told that its contents need updating out of order during
2551         recursiveBuildTransaction(), so we need some small changes in RemoteLayerTreeContext
2552         to allow a layer to add itself to the set of layers requiring commit.
2553         
2554         In the UI process, a new step is added to RemoteLayerTreeHost::updateLayerTree()
2555         to go through clones, and copy their contents from the origin layer.
2556         
2557         The second set of changes makes platformCALayerLayerDidDisplay() work for
2558         UI-side compositing by not taking a PlatformLayer*, but instead a PlatformCALayer*.
2559         PlatformCALayer::setContentsChanged() changed to copyContentsFromLayer() so we know
2560         what the origin layer is.
2561
2562         * Shared/mac/RemoteLayerBackingStore.mm:
2563         (WebKit::RemoteLayerBackingStore::display): Remove the early return so we can always
2564         call platformCALayerLayerDidDisplay().
2565         * Shared/mac/RemoteLayerTreeTransaction.h:
2566         * Shared/mac/RemoteLayerTreeTransaction.mm:
2567         (WebKit::RemoteLayerTreeTransaction::LayerProperties::LayerProperties):
2568         (WebKit::RemoteLayerTreeTransaction::LayerProperties::encode):
2569         (WebKit::RemoteLayerTreeTransaction::LayerProperties::decode):
2570         (WebKit::dumpChangedLayers):
2571         * UIProcess/mac/RemoteLayerTreeHost.mm:
2572         (WebKit::RemoteLayerTreeHost::updateLayerTree):
2573         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
2574         (WebKit::PlatformCALayerRemote::clone):
2575         (WebKit::PlatformCALayerRemote::recursiveBuildTransaction):
2576         (WebKit::PlatformCALayerRemote::copyContentsFromLayer):
2577         (WebKit::PlatformCALayerRemote::setClonedLayer):
2578         (WebKit::PlatformCALayerRemote::setContentsChanged): Deleted.
2579         * WebProcess/WebPage/mac/PlatformCALayerRemote.h:
2580         (WebKit::PlatformCALayerRemote::properties):
2581         (WebKit::PlatformCALayerRemote::context):
2582
2583 2014-06-17  Anders Carlsson  <andersca@apple.com>
2584
2585         Remove session state methods from WKBrowsingContextController
2586         https://bugs.webkit.org/show_bug.cgi?id=133995
2587
2588         Reviewed by Dan Bernstein.
2589
2590         * UIProcess/API/Cocoa/WKBrowsingContextController.h:
2591         * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
2592         (-[WKBrowsingContextController sessionState]): Deleted.
2593         (-[WKBrowsingContextController restoreFromSessionState:]): Deleted.
2594
2595 2014-06-17  Brady Eidson  <beidson@apple.com>
2596
2597         Only show telephone number highlights if only one number is selected
2598         <rdar://problem/16874568> and https://bugs.webkit.org/show_bug.cgi?id=133989
2599
2600         Reviewed by Tim Horton.
2601
2602         Add a flag to TelephoneNumberData to remember if it was hovered over:
2603         * WebProcess/WebPage/TelephoneNumberOverlayController.h:
2604         (WebKit::TelephoneNumberData::hovered):
2605         (WebKit::TelephoneNumberData::setHovered):
2606         (WebKit::TelephoneNumberData::TelephoneNumberData):
2607
2608         * WebProcess/WebPage/mac/TelephoneNumberOverlayControllerMac.mm:
2609         (WebKit::TelephoneNumberOverlayController::drawRect): Only draw the highlight if one
2610           phone number is selected.
2611         (WebKit::TelephoneNumberOverlayController::mouseEvent): Update the hover state of the
2612           current phone number, and setNeedsDisplay if the hover state changes.
2613         (WebKit::TelephoneNumberOverlayController::clearHighlights):
2614
2615 2014-06-17  Tim Horton  <timothy_horton@apple.com>
2616
2617         Remove WKContentView _setFindIndicator:fadeOut:animate:
2618         https://bugs.webkit.org/show_bug.cgi?id=133976
2619
2620         Reviewed by Anders Carlsson.
2621
2622         Find indicators are totally internal to FindController on iOS,
2623         we don't need to push them to the content view via PageClient,
2624         so this code was unused.
2625
2626         * UIProcess/ios/PageClientImplIOS.mm:
2627         (WebKit::PageClientImpl::setFindIndicator):
2628         * UIProcess/ios/WKContentView.h:
2629         * UIProcess/ios/WKContentView.mm:
2630         (-[WKContentView _setFindIndicator:WebKit::fadeOut:animate:]): Deleted.
2631
2632 2014-06-17  Andreas Kling  <akling@apple.com>
2633
2634         Web process main thread priority is lower than some network process threads.
2635         <https://webkit.org/b/133987>
2636         <rdar://problem/17330300>
2637
2638         Mark the main thread as "user initiated" in process entry.
2639
2640         Reviewed by Maciej Stachowiak.
2641
2642         * Shared/ChildProcess.cpp:
2643         (WebKit::ChildProcess::initialize):
2644
2645 2014-06-17  Anders Carlsson  <andersca@apple.com>
2646
2647         Add SPI to get the NSURLRequest from a WKNavigationResponse
2648         https://bugs.webkit.org/show_bug.cgi?id=133984
2649         <rdar://problem/17006399>
2650
2651         Reviewed by Dan Bernstein.
2652
2653         * UIProcess/API/Cocoa/WKNavigationResponse.mm:
2654         (-[WKNavigationResponse _request]):
2655         * UIProcess/API/Cocoa/WKNavigationResponseInternal.h:
2656         * UIProcess/API/Cocoa/WKNavigationResponsePrivate.h:
2657         * UIProcess/Cocoa/NavigationState.mm:
2658         (WebKit::NavigationState::PolicyClient::decidePolicyForResponse):
2659
2660 2014-06-17  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
2661
2662         [EFL][WK2] Skip failing EFL API tests
2663         https://bugs.webkit.org/show_bug.cgi?id=133981
2664
2665         Reviewed by Csaba Osztrogonác.
2666
2667         UserMessage, WillLoad and test_ewk2_view have been failed since r169784.
2668
2669         * PlatformEfl.cmake:
2670
2671 2014-06-17  Zan Dobersek  <zdobersek@igalia.com>
2672
2673         Unreviewed build fix for the GTK+ port. Removing the *Callback::create() wrappings
2674         for lambda callbacks that aren't required anymore after the changes in r170041.
2675
2676         * UIProcess/API/gtk/WebKitWebView.cpp:
2677         (webkit_web_view_can_execute_editing_command):
2678         (webkit_web_view_run_javascript):
2679         (resourcesStreamReadCallback):
2680         (webkit_web_view_save):
2681         (webkit_web_view_save_to_file):
2682
2683 2014-06-16  Jaehun Lim  <ljaehun.lim@samsung.com>
2684
2685         Unreviewed build fix when MHTML is enabled after r170041
2686
2687         * UIProcess/API/C/WKPage.cpp:
2688         (WKPageGetContentsAsMHTMLData):
2689
2690 2014-06-16  Dan Bernstein  <mitz@apple.com>
2691
2692         Part 2 of: Change GenericCallback<> function parameters into std::function<>
2693         https://bugs.webkit.org/show_bug.cgi?id=133927
2694
2695         Reviewed by Sam Weinig.
2696
2697         * UIProcess/API/C/WKPage.cpp:
2698         (WKPageRunJavaScriptInMainFrame):
2699         (WKPageRenderTreeExternalRepresentation):
2700         (WKPageGetSourceForFrame):
2701         (WKPageGetContentsAsString):
2702         (WKPageGetBytecodeProfile):
2703         (WKPageGetSelectionAsWebArchiveData):
2704         (WKPageValidateCommand):
2705         * UIProcess/API/C/WKPluginSiteDataManager.cpp:
2706         (WKPluginSiteDataManagerClearSiteData):
2707         (WKPluginSiteDataManagerClearAllSiteData):
2708         * UIProcess/API/Cocoa/WKWebView.mm:
2709         (-[WKWebView evaluateJavaScript:completionHandler:]):
2710         * UIProcess/API/mac/WKView.mm:
2711         (-[WKView validateUserInterfaceItem:]):
2712         (-[WKView startSpeaking:]):
2713         (-[WKView selectedRangeWithCompletionHandler:]):
2714         (-[WKView markedRangeWithCompletionHandler:]):
2715         (-[WKView hasMarkedTextWithCompletionHandler:]):
2716         (-[WKView firstRectForCharacterRange:completionHandler:]):
2717         (-[WKView characterIndexForPoint:completionHandler:]):
2718         * UIProcess/Plugins/WebPluginSiteDataManager.cpp:
2719         (WebKit::WebPluginSiteDataManager::clearSiteData):
2720         * UIProcess/Plugins/WebPluginSiteDataManager.h:
2721         * UIProcess/WebPageProxy.cpp:
2722         (WebKit::WebPageProxy::validateCommand):
2723         (WebKit::WebPageProxy::runJavaScriptInMainFrame):
2724         (WebKit::WebPageProxy::getRenderTreeExternalRepresentation):
2725         (WebKit::WebPageProxy::getSourceForFrame):
2726         (WebKit::WebPageProxy::getContentsAsString):
2727         (WebKit::WebPageProxy::getBytecodeProfile):
2728         (WebKit::WebPageProxy::getContentsAsMHTMLData):
2729         (WebKit::WebPageProxy::getSelectionOrContentsAsString):
2730         (WebKit::WebPageProxy::getSelectionAsWebArchiveData):
2731         (WebKit::WebPageProxy::getMarkedRangeAsync):
2732         (WebKit::WebPageProxy::getSelectedRangeAsync):
2733         (WebKit::WebPageProxy::characterIndexForPointAsync):
2734         (WebKit::WebPageProxy::firstRectForCharacterRangeAsync):
2735         (WebKit::WebPageProxy::takeSnapshot):
2736         * UIProcess/WebPageProxy.h:
2737         * UIProcess/ios/WKContentViewInteraction.mm:
2738         (-[WKContentView _define:]):
2739         (-[WKContentView changeSelectionWithTouchAt:withSelectionTouch:baseIsStart:]):
2740         (-[WKContentView requestAutocorrectionRectsForString:withCompletionHandler:]):
2741         (-[WKContentView requestDictationContext:]):
2742         (-[WKContentView applyAutocorrection:toString:withCompletionHandler:]):
2743         (-[WKContentView requestAutocorrectionContextWithCompletionHandler:]):
2744         * UIProcess/ios/WebPageProxyIOS.mm:
2745         (WebKit::WebPageProxy::updateSelectionWithTouches):
2746         (WebKit::WebPageProxy::requestAutocorrectionData):
2747         (WebKit::WebPageProxy::applyAutocorrection):
2748         (WebKit::WebPageProxy::requestDictationContext):
2749         (WebKit::WebPageProxy::requestAutocorrectionContext):
2750
2751 2014-06-16  Jaehun Lim  <ljaehun.lim@samsung.com>
2752
2753         Unreviewed build fix after r170029
2754
2755         Use String() instead of AtomicString().
2756
2757         * UIProcess/InspectorServer/HTTPRequest.cpp:
2758         (WebKit::HTTPRequest::parseHeaders):
2759
2760 2014-06-16  Brent Fulgham  <bfulgham@apple.com>
2761
2762         [Win] Use TileController on Windows
2763         https://bugs.webkit.org/show_bug.cgi?id=133895
2764
2765         Reviewed by Tim Horton.
2766
2767         * WebProcess/WebPage/mac/PlatformCALayerRemote.h: Remove
2768         unneeded overload.
2769
2770 2014-06-16  Timothy Horton  <timothy_horton@apple.com>
2771
2772         [iOS][wk2] Swipe snapshots are removed too quickly if there is no saved render tree size
2773         https://bugs.webkit.org/show_bug.cgi?id=133891
2774
2775         Reviewed by Simon Fraser.
2776
2777         * UIProcess/ios/ViewGestureControllerIOS.mm:
2778         (WebKit::ViewGestureController::endSwipeGesture):
2779         (WebKit::ViewGestureController::setRenderTreeSize):
2780         If we don't know the target render tree size, wait until the first layer tree commit
2781         that comes in, instead of removing the snapshot when the gesture ends.
2782
2783 2014-06-16  Timothy Horton  <timothy_horton@apple.com>
2784
2785         [iOS][wk2] Swiping back briefly shows the previous page before loading the new one
2786         https://bugs.webkit.org/show_bug.cgi?id=133885
2787
2788         Reviewed by Simon Fraser.
2789
2790         Remove a race between the UI and Web processes when removing the swipe snapshot.
2791         Previously, it was possible to get a commit from the Web process with layer content
2792         (and render tree size) from the previous page *after* sending the navigation request
2793         to the page, because of the asynchronicity of layer tree commits. This could cause
2794         the snapshot to be removed early (if the previous fully-loaded page had a sufficiently
2795         large render tree size), revealing the old tiles underneath the snapshot.
2796
2797         * Shared/mac/RemoteLayerTreeTransaction.h:
2798         (WebKit::RemoteLayerTreeTransaction::transactionID):
2799         (WebKit::RemoteLayerTreeTransaction::setTransactionID):
2800         * Shared/mac/RemoteLayerTreeTransaction.mm:
2801         (WebKit::RemoteLayerTreeTransaction::encode):
2802         (WebKit::RemoteLayerTreeTransaction::decode):
2803         * UIProcess/DrawingAreaProxy.h:
2804         (WebKit::DrawingAreaProxy::lastVisibleTransactionID):
2805         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
2806         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
2807         (WebKit::RemoteLayerTreeDrawingAreaProxy::RemoteLayerTreeDrawingAreaProxy):
2808         (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
2809         (WebKit::RemoteLayerTreeDrawingAreaProxy::coreAnimationDidCommitLayers):
2810         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
2811         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
2812         (WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
2813         (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
2814         (WebKit::RemoteLayerTreeDrawingArea::didUpdate):
2815         Keep track of an ever-increasing transaction ID in RemoteLayerTreeDrawingArea(Proxy).
2816         It increments in the UI process at didUpdate time, because the Web process cannot
2817         have started on a new layer tree commit until didUpdate is sent.
2818         It increments in the Web process at commit time.
2819
2820         * UIProcess/ios/ViewGestureControllerIOS.mm:
2821         (WebKit::ViewGestureController::endSwipeGesture):
2822         (WebKit::ViewGestureController::setRenderTreeSize):
2823         * UIProcess/mac/ViewGestureController.h:
2824         Adopt transaction IDs; don't remove the snapshot until the commit
2825         that includes the navigation arrives.
2826
2827 2014-06-16  Dan Bernstein  <mitz@apple.com>
2828
2829         <rdar://problem/17327707> [Cocoa] Expose WebPreferences::storageBlockingPolicy
2830         https://bugs.webkit.org/show_bug.cgi?id=133958
2831
2832         Reviewed by Anders Carlsson.
2833
2834         * UIProcess/API/Cocoa/WKPreferences.mm:
2835         (toStorageBlockingPolicy): Added this helper conversion function.
2836         (toAPI): Ditto.
2837         (-[WKPreferences _storageBlockingPolicy]): Added this getter.
2838         (-[WKPreferences _setStorageBlockingPolicy:]): Added this setter.
2839         * UIProcess/API/Cocoa/WKPreferencesPrivate.h: Declared new _storageBlockingPolicy property
2840         and _WKStorageBlockingPolicy enum. 
2841
2842 2014-06-16  Anders Carlsson  <andersca@apple.com>
2843
2844         Don't use AtomicString in HTTPHeaderMap
2845         https://bugs.webkit.org/show_bug.cgi?id=133957
2846         <rdar://problem/15256572>
2847
2848         Reviewed by Andreas Kling.
2849
2850         Update for WebCore changes.
2851
2852         * Shared/WebCoreArgumentCoders.cpp:
2853         (IPC::ArgumentCoder<HTTPHeaderMap>::decode):
2854
2855 2014-06-15  Anders Carlsson  <andersca@apple.com>
2856
2857         Change ResourceRequestBase::addHTTPHeaderFields to setHTTPHeaderFields instead
2858         https://bugs.webkit.org/show_bug.cgi?id=133925
2859
2860         Reviewed by Sam Weinig.
2861
2862         * PluginProcess/PluginControllerProxy.h:
2863         * Shared/WebCoreArgumentCoders.cpp:
2864         (IPC::ArgumentCoder<ResourceRequest>::decode):
2865         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
2866         (WebKit::NPN_PostURL):
2867         * WebProcess/Plugins/PluginView.cpp:
2868         (WebKit::PluginView::loadURL):
2869         * WebProcess/Plugins/PluginView.h:
2870
2871 2014-06-16  Anders Carlsson  <andersca@apple.com>
2872
2873         Add HTTPHeaderName overloads on ResourceResponseBase
2874         https://bugs.webkit.org/show_bug.cgi?id=133946
2875
2876         Reviewed by Andreas Kling.
2877
2878         * WebProcess/Plugins/PluginView.cpp:
2879         (WebKit::buildHTTPHeaders):
2880
2881 2014-06-16  Dan Bernstein  <mitz@apple.com>
2882
2883         Fixed a typo in the last change.
2884
2885         * UIProcess/API/Cocoa/WKPreferences.mm:
2886         (-[WKPreferences init]):
2887
2888 2014-06-16  Dan Bernstein  <mitz@apple.com>
2889
2890         [Cocoa] Remove WKPreferences persistence in user defaults
2891         https://bugs.webkit.org/show_bug.cgi?id=133945
2892
2893         Reviewed by Anders Carlsson.
2894
2895         * UIProcess/API/Cocoa/WKPreferences.h: Removed userDefaultsKeyPrefix property and
2896         initializer with userDefaultsKeyPrefix parameter.
2897         * UIProcess/API/Cocoa/WKPreferences.mm:
2898         (-[WKPreferences init]): Changed to initialize an instance with an empty identifier, which
2899         means that it won’t persist to user defaults.
2900         (-[WKPreferences initWithUserDefaultsKeyPrefix:]): Deleted.
2901         (-[WKPreferences userDefaultsKeyPrefix]): Deleted.
2902
2903 2014-06-16  Zan Dobersek  <zdobersek@igalia.com>
2904
2905         Page::findStringMatchingRanges() should take Vector<RefPtr<Range>> by reference instead of pointer
2906         https://bugs.webkit.org/show_bug.cgi?id=133677
2907
2908         Reviewed by Anders Carlsson.
2909
2910         * WebProcess/WebPage/FindController.cpp:
2911         (WebKit::FindController::findString): Update the call to Page::findStringMatchingRanges() to pass
2912         in a Vector<RefPtr<Range>> reference instead of a pointer.
2913         (WebKit::FindController::findStringMatches): Ditto.
2914
2915 2014-06-16  Zan Dobersek  <zdobersek@igalia.com>
2916
2917         Unreviewed build fixes for the EFL and GTK+ ports after r169994 and 170000.
2918
2919         * UIProcess/API/C/WKPluginSiteDataManager.cpp: Undefine the None macro under X11.
2920         * UIProcess/API/gtk/WebKitCookieManager.cpp:
2921         (webkit_cookie_manager_get_accept_policy): Remove unnecessary ::create() wrappings.
2922         (webkit_cookie_manager_get_domains_with_cookies): Ditto.
2923         * UIProcess/API/gtk/WebKitWebResource.cpp:
2924         (webkit_web_resource_get_data): Ditto.
2925
2926 2014-06-15  Dan Bernstein  <mitz@apple.com>
2927
2928         Part 1 of: Change GenericCallback<> function parameters into std::function<>
2929         https://bugs.webkit.org/show_bug.cgi?id=133927
2930
2931         Reviewed by Sam Weinig.
2932
2933         * UIProcess/API/C/WKApplicationCacheManager.cpp:
2934         (WKApplicationCacheManagerGetApplicationCacheOrigins):
2935         * UIProcess/API/C/WKContext.cpp:
2936         (WKContextGetStatistics):
2937         (WKContextGetStatisticsWithOptions):
2938         * UIProcess/API/C/WKCookieManager.cpp:
2939         (WKCookieManagerGetHostnamesWithCookies):
2940         (WKCookieManagerGetHTTPCookieAcceptPolicy):
2941         * UIProcess/API/C/WKDatabaseManager.cpp:
2942         (WKDatabaseManagerGetDatabasesByOrigin):
2943         (WKDatabaseManagerGetDatabaseOrigins):
2944         * UIProcess/API/C/WKFrame.cpp:
2945         (WKFrameGetMainResourceData):
2946         (WKFrameGetResourceData):
2947         (WKFrameGetWebArchive):
2948         * UIProcess/API/C/WKKeyValueStorageManager.cpp:
2949         (WKKeyValueStorageManagerGetKeyValueStorageOrigins):
2950         (WKKeyValueStorageManagerGetStorageDetailsByOrigin):
2951         * UIProcess/API/C/WKMediaCacheManager.cpp:
2952         (WKMediaCacheManagerGetHostnamesWithMediaCache):
2953         * UIProcess/API/C/WKOriginDataManager.cpp:
2954         (WKOriginDataManagerGetOrigins):
2955         * UIProcess/API/C/WKPluginSiteDataManager.cpp:
2956         (WKPluginSiteDataManagerGetSitesWithData):
2957         * UIProcess/API/C/WKResourceCacheManager.cpp:
2958         (WKResourceCacheManagerGetCacheOrigins):
2959         * UIProcess/API/Cocoa/WKWebView.mm:
2960         (-[WKWebView _getWebArchiveDataWithCompletionHandler:]):
2961         * UIProcess/API/mac/WKView.mm:
2962         (-[WKView attributedSubstringForProposedRange:completionHandler:]):
2963         * UIProcess/Plugins/WebPluginSiteDataManager.cpp:
2964         (WebKit::WebPluginSiteDataManager::getSitesWithData):
2965         * UIProcess/Plugins/WebPluginSiteDataManager.h:
2966         * UIProcess/WebApplicationCacheManagerProxy.cpp:
2967         (WebKit::WebApplicationCacheManagerProxy::getApplicationCacheOrigins):
2968         * UIProcess/WebApplicationCacheManagerProxy.h:
2969         * UIProcess/WebContext.cpp:
2970         (WebKit::WebContext::getStatistics):
2971         * UIProcess/WebContext.h:
2972         * UIProcess/WebCookieManagerProxy.cpp:
2973         (WebKit::WebCookieManagerProxy::getHostnamesWithCookies):
2974         (WebKit::WebCookieManagerProxy::getHTTPCookieAcceptPolicy):
2975         * UIProcess/WebCookieManagerProxy.h:
2976         * UIProcess/WebDatabaseManagerProxy.cpp:
2977         (WebKit::WebDatabaseManagerProxy::getDatabasesByOrigin):
2978         (WebKit::WebDatabaseManagerProxy::getDatabaseOrigins):
2979         * UIProcess/WebDatabaseManagerProxy.h:
2980         * UIProcess/WebFrameProxy.cpp:
2981         (WebKit::WebFrameProxy::getWebArchive):
2982         (WebKit::WebFrameProxy::getMainResourceData):
2983         (WebKit::WebFrameProxy::getResourceData):
2984         * UIProcess/WebFrameProxy.h:
2985         * UIProcess/WebKeyValueStorageManager.cpp:
2986         (WebKit::WebKeyValueStorageManager::getKeyValueStorageOrigins):
2987         (WebKit::WebKeyValueStorageManager::getStorageDetailsByOrigin):
2988         * UIProcess/WebKeyValueStorageManager.h:
2989         * UIProcess/WebMediaCacheManagerProxy.cpp:
2990         (WebKit::WebMediaCacheManagerProxy::getHostnamesWithMediaCache):
2991         * UIProcess/WebMediaCacheManagerProxy.h:
2992         * UIProcess/WebOriginDataManagerProxy.cpp:
2993         (WebKit::WebOriginDataManagerProxy::getOrigins):
2994         * UIProcess/WebOriginDataManagerProxy.h:
2995         * UIProcess/WebPageProxy.cpp:
2996         (WebKit::WebPageProxy::getMainResourceDataOfFrame):
2997         (WebKit::WebPageProxy::getResourceDataFromFrame):
2998         (WebKit::WebPageProxy::getWebArchiveOfFrame):
2999         * UIProcess/WebPageProxy.h:
3000         * UIProcess/WebResourceCacheManagerProxy.cpp:
3001         (WebKit::WebResourceCacheManagerProxy::getCacheOrigins):
3002         * UIProcess/WebResourceCacheManagerProxy.h:
3003         * UIProcess/ios/WKContentViewInteraction.mm:
3004         (-[WKContentView changeSelectionWithGestureAt:withGesture:withState:]):
3005         (-[WKContentView changeSelectionWithTouchesFrom:to:withGesture:withState:]):
3006         * UIProcess/ios/WebPageProxyIOS.mm:
3007         (WebKit::WebPageProxy::selectWithGesture):
3008         (WebKit::WebPageProxy::selectWithTwoTouches):
3009         * UIProcess/mac/WebPageProxyMac.mm:
3010         (WebKit::WebPageProxy::attributedSubstringForCharacterRangeAsync):
3011
3012 2014-06-15  Dan Bernstein  <mitz@apple.com>
3013
3014         <rdar://problem/17291697> [Cocoa] Can’t tell at policy decision time whether WebKit can handle the request
3015         https://bugs.webkit.org/show_bug.cgi?id=133930
3016
3017         Reviewed by Sam Weinig.
3018
3019         * Shared/NavigationActionData.cpp:
3020         (WebKit::NavigationActionData::NavigationActionData): Initialize new member canHandleRequest
3021         to false.
3022         (WebKit::NavigationActionData::encode): Encode canHandleRequest.
3023         (WebKit::NavigationActionData::decode): Decode it.
3024         * Shared/NavigationActionData.h: Declared new boolean member canHandleRequest.
3025
3026         * UIProcess/API/Cocoa/WKNavigationAction.mm:
3027         (-[WKNavigationAction _initWithNavigationActionData:]): Set new ivar _canHandleRequest from
3028         the action data.
3029         (-[WKNavigationAction _canHandleRequest]): Added this getter.
3030         * UIProcess/API/Cocoa/WKNavigationActionPrivate.h: Declared new property _canHandleRequest.
3031
3032         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3033         (WebKit::WebChromeClient::createWindow): Set canHandleRequest in the NavigationActionData.
3034
3035         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3036         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction): Ditto.
3037         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): Ditto.
3038
3039 2014-06-15  Ryuan Choi  <ryuan.choi@samsung.com>
3040
3041         [EFL][WK2] Change ewk_view_settings_get to ewk_page_group_settings_get
3042         https://bugs.webkit.org/show_bug.cgi?id=133841
3043
3044         Reviewed by Gyuyoung Kim.
3045
3046         Ewk_Settings object is a member of Ewk_Page_Group.
3047         So, Ewk_Page_Group is better place for the getter of Ewk_Settings.
3048
3049         * UIProcess/API/efl/ewk_page_group.cpp:
3050         (ewk_page_group_settings_get): Added instead of ewk_view_settings_get.
3051         * UIProcess/API/efl/ewk_page_group.h:
3052         * UIProcess/API/efl/ewk_view.cpp:
3053         (ewk_view_settings_get): Deleted.
3054         * UIProcess/API/efl/ewk_view.h:
3055         * UIProcess/API/efl/tests/test_ewk2_page_group.cpp:
3056         (TEST_F):
3057         * UIProcess/API/efl/tests/test_ewk2_settings.cpp:
3058         (TEST_F):
3059         * UIProcess/API/efl/tests/test_ewk2_view.cpp:
3060         (TEST_F): Deleted.
3061
3062 2014-06-15  Anders Carlsson  <andersca@apple.com>
3063
3064         Add an autorelease() member function to RetainPtr
3065         https://bugs.webkit.org/show_bug.cgi?id=133929
3066
3067         Reviewed by Dan Bernstein.
3068
3069         * Shared/API/Cocoa/_WKRemoteObjectRegistry.mm:
3070         (-[_WKRemoteObjectRegistry remoteObjectProxyWithInterface:]):
3071         * UIProcess/API/Cocoa/WKWebView.mm:
3072         (-[WKWebView navigationDelegate]):
3073         (-[WKWebView UIDelegate]):
3074         (-[WKWebView loadRequest:]):
3075         (-[WKWebView loadHTMLString:baseURL:]):
3076         (-[WKWebView goToBackForwardListItem:]):
3077         (-[WKWebView goBack]):
3078         (-[WKWebView goForward]):
3079         (-[WKWebView reload]):
3080         (-[WKWebView reloadFromOrigin]):
3081         (-[WKWebView _historyDelegate]):
3082         * WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm:
3083         (WebKit::animationValueFromKeyframeValue):
3084
3085 2014-06-15  Dan Bernstein  <mitz@apple.com>
3086
3087         Get rid of VoidAPICallback
3088         https://bugs.webkit.org/show_bug.cgi?id=133928
3089
3090         Reviewed by Sam Weinig.
3091
3092         * UIProcess/API/C/WKPage.cpp:
3093         (WKPageForceRepaint): Wrap the API callback in a generic callback here.
3094
3095         * UIProcess/API/C/WKPluginSiteDataManager.cpp:
3096         (WKPluginSiteDataManagerClearSiteData): Ditto.
3097         (WKPluginSiteDataManagerClearAllSiteData): Ditto.
3098
3099         * UIProcess/GenericCallback.h:
3100         (WebKit::GenericCallback::performCallback): Added this helper for 0-argument callbacks.
3101         (WebKit::VoidCallback::create): Deleted.
3102         (WebKit::VoidCallback::~VoidCallback): Deleted.
3103         (WebKit::VoidCallback::performCallback): Deleted.
3104         (WebKit::VoidCallback::invalidate): Deleted.
3105         (WebKit::VoidCallback::VoidCallback): Deleted.
3106         (WebKit::VoidAPICallback::create): Deleted.
3107
3108         * UIProcess/mac/WKFullScreenWindowController.h:
3109
3110 2014-06-15  Zan Dobersek  <zdobersek@igalia.com>
3111
3112         Unreviewed build fix for the GTK+ port after r169990.
3113
3114         * UIProcess/WebPageProxy.cpp:
3115         (WebKit::WebPageProxy::resetState): Pass the error value to
3116         the rest of invalidateCallbackMap calls.
3117
3118 2014-06-15  Anders Carlsson  <andersca@apple.com>
3119
3120         Remove WKPageRunJavaScriptInMainFrame_b
3121         https://bugs.webkit.org/show_bug.cgi?id=133926
3122
3123         Reviewed by Dan Bernstein.
3124
3125         * UIProcess/API/C/WKPage.cpp:
3126         (callRunJavaScriptBlockAndRelease): Deleted.
3127         (WKPageRunJavaScriptInMainFrame_b): Deleted.
3128         * UIProcess/API/C/WKPage.h:
3129
3130 2014-06-15  Anders Carlsson  <andersca@apple.com>
3131
3132         invalidateCallbackMap doesn’t pass the error parameter on to invalidate(), so script completion handler is passed the wrong error
3133         https://bugs.webkit.org/show_bug.cgi?id=133921
3134         <rdar://problem/17316653>
3135
3136         Reviewed by Dan Bernstein.
3137
3138         * UIProcess/GenericCallback.h:
3139         (WebKit::VoidCallback::performCallback):
3140         (WebKit::VoidCallback::invalidate):
3141         (WebKit::VoidAPICallback::create):
3142         (WebKit::invalidateCallbackMap):
3143         * UIProcess/Plugins/WebPluginSiteDataManager.cpp:
3144         (WebKit::WebPluginSiteDataManager::invalidate):
3145         (WebKit::WebPluginSiteDataManager::clearSiteData):
3146         * UIProcess/WebApplicationCacheManagerProxy.cpp:
3147         (WebKit::WebApplicationCacheManagerProxy::contextDestroyed):
3148         (WebKit::WebApplicationCacheManagerProxy::processDidClose):
3149         * UIProcess/WebContext.cpp:
3150         (WebKit::WebContext::~WebContext):
3151         * UIProcess/WebCookieManagerProxy.cpp:
3152         (WebKit::WebCookieManagerProxy::contextDestroyed):
3153         (WebKit::WebCookieManagerProxy::processDidClose):
3154         * UIProcess/WebDatabaseManagerProxy.cpp:
3155         (WebKit::WebDatabaseManagerProxy::contextDestroyed):
3156         (WebKit::WebDatabaseManagerProxy::processDidClose):
3157         * UIProcess/WebMediaCacheManagerProxy.cpp:
3158         (WebKit::WebMediaCacheManagerProxy::contextDestroyed):
3159         (WebKit::WebMediaCacheManagerProxy::processDidClose):
3160         * UIProcess/WebOriginDataManagerProxy.cpp:
3161         (WebKit::WebOriginDataManagerProxy::contextDestroyed):
3162         (WebKit::WebOriginDataManagerProxy::processDidClose):
3163         * UIProcess/WebPageProxy.cpp:
3164         (WebKit::WebPageProxy::forceRepaint):
3165         (WebKit::WebPageProxy::resetState):
3166         * UIProcess/WebResourceCacheManagerProxy.cpp:
3167         (WebKit::WebResourceCacheManagerProxy::contextDestroyed):
3168         (WebKit::WebResourceCacheManagerProxy::processDidClose):
3169         * UIProcess/mac/WKFullScreenWindowController.mm:
3170         (-[WKFullScreenWindowController dealloc]):
3171         (-[WKFullScreenWindowController finishedExitFullScreenAnimation:]):
3172
3173 2014-06-15  Zan Dobersek  <zdobersek@igalia.com>
3174
3175         Unreviewed build fix for the GTK+ port after r169987.
3176
3177         * UIProcess/API/gtk/WebKitWebView.cpp:
3178         (webkit_web_view_can_execute_editing_command): The first passed-in parameter
3179         is now a reference to a const String object.
3180
3181 2014-06-14  Dan Bernstein  <mitz@apple.com>
3182
3183         Replace StringImpl* callback parameters with const String&
3184         https://bugs.webkit.org/show_bug.cgi?id=133922
3185
3186         Reviewed by Sam Weinig.
3187
3188         * UIProcess/API/C/WKPage.cpp:
3189         (toGenericCallbackFunction): Added this helper function to wrap a WKStringRef-returning
3190         API callback in a generic const String&-returning callback.
3191         (WKPageRenderTreeExternalRepresentation):
3192         (WKPageGetSourceForFrame):
3193         (WKPageGetContentsAsString):
3194         (WKPageGetBytecodeProfile):
3195         (WKPageValidateCommand):
3196         * UIProcess/API/mac/WKView.mm:
3197         (-[WKView validateUserInterfaceItem:]):
3198         (-[WKView startSpeaking:]):
3199         * UIProcess/WebPageProxy.h:
3200         * UIProcess/ios/WKContentViewInteraction.mm:
3201         (-[WKContentView _define:]):
3202         (-[WKContentView applyAutocorrection:toString:withCompletionHandler:]):
3203
3204 2014-06-14  Dan Bernstein  <mitz@apple.com>
3205
3206         Additional iOS build fix.
3207
3208         * UIProcess/ios/WKContentViewInteraction.mm:
3209         (-[WKContentView _define:]):
3210         (selectionChangedWithGesture):
3211         (selectionChangedWithTouch):
3212         (-[WKContentView changeSelectionWithGestureAt:withGesture:withState:]):
3213         (-[WKContentView changeSelectionWithTouchAt:withSelectionTouch:baseIsStart:]):
3214         (-[WKContentView changeSelectionWithTouchesFrom:to:withGesture:withState:]):
3215         (-[WKContentView applyAutocorrection:toString:withCompletionHandler:]):
3216
3217 2014-06-14  Dan Bernstein  <mitz@apple.com>
3218
3219         iOS build fix.
3220
3221         * UIProcess/API/Cocoa/WKWebView.mm:
3222         (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]):
3223
3224 2014-06-14  Dan Bernstein  <mitz@apple.com>
3225
3226         Get rid of GenericAPICallback
3227         https://bugs.webkit.org/show_bug.cgi?id=133909
3228
3229         Reviewed by Sam Weinig.
3230
3231         In preparation for passing callbacks as functions, replace GenericAPICallback::create, which
3232         returned a GenericCallback, with a function template that returns an appropriate callback
3233         function.
3234
3235         * UIProcess/API/C/WKApplicationCacheManager.cpp:
3236         (WKApplicationCacheManagerGetApplicationCacheOrigins):
3237         * UIProcess/API/C/WKContext.cpp:
3238         (WKContextGetStatistics):
3239         (WKContextGetStatisticsWithOptions):
3240         * UIProcess/API/C/WKCookieManager.cpp:
3241         (WKCookieManagerGetHostnamesWithCookies):
3242         (WKCookieManagerGetHTTPCookieAcceptPolicy):
3243         * UIProcess/API/C/WKDatabaseManager.cpp:
3244         (WKDatabaseManagerGetDatabasesByOrigin):
3245         (WKDatabaseManagerGetDatabaseOrigins):
3246         * UIProcess/API/C/WKFrame.cpp:
3247         (WKFrameGetMainResourceData):
3248         (WKFrameGetResourceData):
3249         (WKFrameGetWebArchive):
3250         * UIProcess/API/C/WKKeyValueStorageManager.cpp:
3251         (WKKeyValueStorageManagerGetKeyValueStorageOrigins):
3252         (WKKeyValueStorageManagerGetStorageDetailsByOrigin):
3253         * UIProcess/API/C/WKMediaCacheManager.cpp:
3254         (WKMediaCacheManagerGetHostnamesWithMediaCache):
3255         * UIProcess/API/C/WKOriginDataManager.cpp:
3256         (WKOriginDataManagerGetOrigins):
3257         * UIProcess/API/C/WKPage.cpp:
3258         (WKPageRunJavaScriptInMainFrame):
3259         (WKPageRenderTreeExternalRepresentation):
3260         (WKPageGetSourceForFrame):
3261         (WKPageGetContentsAsString):
3262         (WKPageGetBytecodeProfile):
3263         (WKPageGetSelectionAsWebArchiveData):
3264         (WKPageGetContentsAsMHTMLData):
3265         (WKPageDrawPagesToPDF):
3266         * UIProcess/API/C/WKPluginSiteDataManager.cpp:
3267         (WKPluginSiteDataManagerGetSitesWithData):
3268         * UIProcess/API/C/WKResourceCacheManager.cpp:
3269         (WKResourceCacheManagerGetCacheOrigins):
3270
3271         * UIProcess/GenericCallback.h:
3272         (WebKit::toGenericCallbackFunction): Added. Given a C SPI callback function, returns a generic
3273         callback function that wraps it.
3274
3275 2014-06-14  Dan Bernstein  <mitz@apple.com>
3276
3277         Reverted the last change, which broken the Mac build.
3278
3279         * UIProcess/GenericCallback.h:
3280         (WebKit::invalidateCallbackMap):
3281
3282 2014-06-14  Dan Bernstein  <mitz@apple.com>
3283
3284         Tried to fix the GTK build.
3285
3286         * UIProcess/GenericCallback.h:
3287         (WebKit::invalidateCallbackMap):
3288
3289 2014-06-14  Anders Carlsson  <andersca@apple.com>
3290
3291         Fix build.
3292
3293         * UIProcess/API/mac/WKView.mm:
3294         (-[WKView selectedRangeWithCompletionHandler:]):
3295         (-[WKView markedRangeWithCompletionHandler:]):
3296         (-[WKView hasMarkedTextWithCompletionHandler:]):
3297         (-[WKView attributedSubstringForProposedRange:completionHandler:]):
3298         (-[WKView firstRectForCharacterRange:completionHandler:]):
3299         (-[WKView characterIndexForPoint:completionHandler:]):
3300
3301 2014-06-14  Zan Dobersek  <zdobersek@igalia.com>
3302
3303         Unreviewed build fix for the GTK+ port.
3304         Fixing the callback lambda parameters after r169962.
3305
3306         * UIProcess/API/gtk/WebKitPrintOperation.cpp:
3307         (webkitPrintOperationPrintPagesForFrame):
3308         * UIProcess/API/gtk/WebKitWebResource.cpp:
3309         (webkit_web_resource_get_data):
3310         * UIProcess/API/gtk/WebKitWebView.cpp:
3311         (webkit_web_view_can_execute_editing_command):
3312         (webkit_web_view_run_javascript):
3313         (resourcesStreamReadCallback):
3314         (webkit_web_view_save):
3315         (webkit_web_view_save_to_file):
3316
3317 2014-06-14  Csaba Osztrogonác  <ossy@webkit.org>
3318
3319         URTBF after r169943 and r169946, use the format of set/get.
3320
3321         * UIProcess/InspectorServer/WebInspectorServer.cpp:
3322         (WebKit::WebInspectorServer::didReceiveUnrecognizedHTTPRequest):
3323         * UIProcess/InspectorServer/WebSocketServerConnection.cpp:
3324         (WebKit::WebSocketServerConnection::readHTTPMessage):
3325         (WebKit::WebSocketServerConnection::upgradeToWebSocketServerConnection):
3326
3327 2014-06-13  Andreas Kling  <akling@apple.com>
3328
3329         REGRESSION (r167635): Reference leak in NetworkResourceLoader while loads are being deferred.
3330         <https://webkit.org/b/133894>
3331         <rdar://problem/17312299>
3332
3333         Don't self-ref() in start() until we actually start; if page loads are being
3334         deferred, start() will be called again once deferral stops.
3335
3336         This was causing us to leak the entire NetworkResourceLoader object graph.
3337
3338         Reviewed by Brady Eidson.
3339
3340         * NetworkProcess/NetworkResourceLoader.cpp:
3341         (WebKit::NetworkResourceLoader::start):
3342
3343 2014-06-13  Dan Bernstein  <mitz@apple.com>
3344
3345         Make GenericCallback variadic
3346         https://bugs.webkit.org/show_bug.cgi?id=133897
3347
3348         Reviewed by Sam Weinig.
3349
3350         Also eliminated legacy callback functions and all CallbackBase derived classes outside of
3351         GenericCallback.h.
3352
3353         * UIProcess/API/C/WKPage.cpp:
3354         (WKPageValidateCommand): Changed legacy callback (with leading bool parameter) into modern
3355         callback (with trailing error parameter).
3356         (WKPageComputePagesForPrinting): Ditto.
3357
3358         * UIProcess/API/Cocoa/WKWebView.mm:
3359         (-[WKWebView _getWebArchiveDataWithCompletionHandler:]): Ditto.
3360         (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]): Ditto.
3361
3362         * UIProcess/API/Cocoa/_WKThumbnailView.mm:
3363         (-[_WKThumbnailView _requestSnapshotIfNeeded]): Ditto.
3364
3365         * UIProcess/API/mac/WKView.mm:
3366         (-[WKView validateUserInterfaceItem:]): Ditto.
3367         (-[WKView startSpeaking:]): Ditto.
3368
3369         * UIProcess/AutoCorrectionCallback.h: Replaced CallbackBase derived classes with
3370         GenericCallback specializations.
3371
3372         * UIProcess/GenericCallback.h:
3373         - Made GenericCallback variadic:
3374         (WebKit::GenericCallback::performCallbackWithReturnValue):
3375         (WebKit::GenericCallback::invalidate):
3376         (WebKit::GenericAPICallback::create):
3377
3378         - Replaced CallbackBase derived classes with GenericCallback specializations:
3379         (WebKit::GenericCallback::create): Deleted.
3380         (WebKit::ComputedPagesCallback::create): Deleted.
3381         (WebKit::ComputedPagesCallback::~ComputedPagesCallback): Deleted.
3382         (WebKit::ComputedPagesCallback::performCallbackWithReturnValue): Deleted.
3383         (WebKit::ComputedPagesCallback::invalidate): Deleted.
3384         (WebKit::ComputedPagesCallback::ComputedPagesCallback): Deleted.
3385         (WebKit::ImageCallback::create): Deleted.
3386         (WebKit::ImageCallback::~ImageCallback): Deleted.
3387         (WebKit::ImageCallback::performCallbackWithReturnValue): Deleted.
3388         (WebKit::ImageCallback::invalidate): Deleted.
3389         (WebKit::ImageCallback::ImageCallback): Deleted.
3390
3391         * UIProcess/WebPageProxy.h: Replaced CallbackBase derived classes with GenericCallback
3392         specializations.
3393
3394         * UIProcess/ios/WKContentViewInteraction.mm:
3395         (-[WKContentView requestAutocorrectionRectsForString:withCompletionHandler:]): Changed
3396         legacy callback (with leading bool parameter) into modern callback (with trailing error
3397         parameter).
3398         (-[WKContentView requestDictationContext:]): Ditto.
3399         (-[WKContentView requestAutocorrectionContextWithCompletionHandler:]): Ditto.
3400
3401         * UIProcess/mac/WKPrintingView.mm:
3402         (-[WKPrintingView _preparePDFDataForPrintingOnSecondaryThread]): Ditto.
3403         (-[WKPrintingView _askPageToComputePageRects]): Ditto.
3404         (-[WKPrintingView _drawPreview:]): Ditto.
3405
3406 2014-06-13  Tim Horton  <timothy_horton@apple.com>
3407
3408         Unreviewed; fix the build.
3409
3410         * Shared/mac/RemoteLayerBackingStore.mm:
3411         (WebKit::RemoteLayerBackingStore::drawInContext):
3412
3413 2014-06-13  Martin Hock  <mhock@apple.com>
3414
3415         Clean up layers in RemoteLayerTreeHost::clearLayers().
3416         https://bugs.webkit.org/show_bug.cgi?id=133888
3417
3418         Reviewed by Tim Horton.
3419
3420         * UIProcess/mac/RemoteLayerTreeHost.mm:
3421         (WebKit::RemoteLayerTreeHost::clearLayers):
3422
3423 2014-06-13  Anders Carlsson  <andersca@apple.com>
3424
3425         Add a HTTPHeaderMap::get overload that takes an HTTPHeaderName
3426         https://bugs.webkit.org/show_bug.cgi?id=133877
3427
3428         Reviewed by Andreas Kling.
3429
3430         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
3431         (WebKit::parsePostBuffer):
3432
3433 2014-06-13  Dan Bernstein  <mitz@apple.com>
3434
3435         [iOS] Networking process always decodes keys
3436         https://bugs.webkit.org/show_bug.cgi?id=133863
3437
3438         Reviewed by Anders Carlsson.
3439
3440         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h:
3441         (WebKit::XPCServiceInitializer): Call checkEntitlements on iOS, too.
3442         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.mm:
3443         (WebKit::XPCServiceInitializerDelegate::checkEntitlements): On iOS, allow decoding keys
3444         if the application has the appropriate keychain access group.
3445
3446         * Shared/cf/ArgumentCodersCF.cpp:
3447         (IPC::setAllowsDecodingSecKeyRef): Added. Sets static bool.
3448         (IPC::decode): Check the secKeyRefDecodingAllowed bool before decoding a key.
3449         * Shared/cf/ArgumentCodersCF.h:
3450
3451 2014-06-12  Anders Carlsson  <andersca@apple.com>
3452
3453         Add overloads of HTTPHeaderMap::find and remove that take enums
3454         https://bugs.webkit.org/show_bug.cgi?id=133823
3455
3456         Reviewed by Sam Weinig.
3457
3458         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
3459         (WebKit::parsePostBuffer):
3460         Update for WebCore changes.
3461
3462 2014-06-12  Benjamin Poulain  <bpoulain@apple.com>
3463
3464         [iOS][WK2] Do not update the viewport configuration on load until the first viewport arguments is received
3465         https://bugs.webkit.org/show_bug.cgi?id=133719
3466         <rdar://problem/17008149>
3467
3468         Reviewed by Simon Fraser.
3469
3470         When pages are loaded from the page cache, we were updating the viewport to the initial values
3471         in WebPage::dynamicViewportSizeUpdate(), then update the viewport again when the page's viewport argument
3472         are received.
3473
3474         The problem is that was messing up with text autosizing. The page would relayout with the default viewport
3475         configuration, adopt the text autosizing parameters from that size, then remain in that state when
3476         the actual viewport configuration would be set.
3477
3478         With this patch, the viewport configuration is updated from the values in WebCore instead of with default values.
3479         For new documents, this is strictly equivalent. For documents coming from the page cache, the values are from
3480         the previous state of the page, which ensure we do not restart negotiating a viewport configuration from scratch.
3481
3482         * WebProcess/WebPage/WebPage.cpp:
3483         (WebKit::WebPage::didCommitLoad):
3484
3485 2014-06-12  Gavin Barraclough  <barraclough@apple.com>
3486
3487         Add support for thread/WorkQueue QoS
3488         https://bugs.webkit.org/show_bug.cgi?id=130688
3489
3490         Reviewed by Anders Carlson & Simon Fraser.
3491
3492         The EventDispatcher's WorkQueue should be UserInteractive.
3493
3494         * Platform/WorkQueue.cpp:
3495         (WorkQueue::create):
3496             - pass QOS to constructor.
3497         (WorkQueue::WorkQueue):
3498             - pass QOS to platformInitialize.
3499         * Platform/WorkQueue.h: