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