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