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