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