f4d47b4b64ca5f3d2a94465ab0ad5fc21ebad2e4
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2015-03-31  Dan Bernstein  <mitz@apple.com>
2
3         <rdar://problem/20365675> [iOS] Include Add to Reading List link action only where supported
4         https://bugs.webkit.org/show_bug.cgi?id=143289
5
6         Reviewed by Tim Horton.
7
8         * UIProcess/API/Cocoa/_WKElementAction.h: Excluded _WKElementActionTypeAddToReadingList from
9         the _WKElementActionType enum when Reading List is not supported.
10
11         * UIProcess/API/Cocoa/_WKElementAction.mm:
12         (+[_WKElementAction elementActionWithType:customTitle:]): Made Add to Reading List code
13         conditional on HAVE(SAFARI_SERVICES_FRAMEWORK).
14
15         * UIProcess/ios/WKActionSheetAssistant.mm:
16         (-[WKActionSheetAssistant showImageSheet]): Ditto.
17         (-[WKActionSheetAssistant showLinkSheet]): Ditto.
18
19         * config.h: Defined HAVE_SAFARI_SERVICES_FRAMEWORK.
20
21 2015-03-31  Timothy Horton  <timothy_horton@apple.com>
22
23         TextIndicator for <span> inside an <a> only highlights the <span>, should highlight the whole <a>
24         https://bugs.webkit.org/show_bug.cgi?id=143287
25         <rdar://problem/20318342>
26
27         Reviewed by Beth Dakin.
28
29         * WebProcess/WebPage/mac/WebPageMac.mm:
30         (WebKit::WebPage::performActionMenuHitTestAtLocation):
31         Instead of just highlighting the hit element, highlight the whole
32         element that the link URL comes from.
33
34 2015-03-31  Timothy Horton  <timothy_horton@apple.com>
35
36         WKView should stop using endGestureWithEvent
37         https://bugs.webkit.org/show_bug.cgi?id=143285
38         <rdar://problem/20357007>
39
40         Reviewed by Simon Fraser.
41
42         * UIProcess/API/mac/WKView.mm:
43         (-[WKView magnifyWithEvent:]):
44         (-[WKView endGestureWithEvent:]): Deleted.
45         * UIProcess/mac/ViewGestureController.h:
46         * UIProcess/mac/ViewGestureControllerMac.mm:
47         (WebKit::ViewGestureController::endMagnificationGesture):
48         (WebKit::ViewGestureController::endActiveGesture): Deleted.
49         While there is no visible symptom, it is recommended that we check
50         the phase of normal magnification events instead of using the
51         special gesture end events.
52
53 2015-03-31  Timothy Horton  <timothy_horton@apple.com>
54
55         Swipes occur in the wrong direction in RTL
56         https://bugs.webkit.org/show_bug.cgi?id=143257
57         <rdar://problem/20300862>
58
59         Reviewed by Simon Fraser.
60
61         * UIProcess/ios/ViewGestureControllerIOS.mm:
62         (-[WKSwipeTransitionController gestureRecognizerForInteractiveTransition:WithTarget:action:]):
63         When choosing which edge to attach our gesture recognizers to,
64         flip them in RTL.
65
66         (-[WKSwipeTransitionController directionForTransition:]):
67         (WebKit::ViewGestureController::beginSwipeGesture):
68         (WebKit::ViewGestureController::canSwipeInDirection):
69         * UIProcess/mac/ViewGestureController.h:
70         * UIProcess/mac/ViewGestureControllerMac.mm:
71         (WebKit::ViewGestureController::scrollEventCanBecomeSwipe):
72         (WebKit::ViewGestureController::trackSwipeGesture):
73         (WebKit::ViewGestureController::determineLayerAdjacentToSnapshotForParent):
74         (WebKit::ViewGestureController::beginSwipeGesture):
75         (WebKit::ViewGestureController::handleSwipeGesture):
76         Adjust SwipeDirection to be in logical back-forward list direction
77         instead of physical edge direction.
78
79 2015-03-31  Myles C. Maxfield  <mmaxfield@apple.com>
80
81         Move ExpansionBehaviorFlags and TextDirection to their own file
82         https://bugs.webkit.org/show_bug.cgi?id=143273
83
84         Reviewed by Simon Fraser.
85
86         This is a mechanical change. It just moves code around.
87
88         This is getting ready for https://bugs.webkit.org/show_bug.cgi?id=142608
89
90         * Shared/WebPopupItem.h:
91         * UIProcess/API/C/efl/WKAPICastEfl.h:
92         * UIProcess/API/efl/EwkView.h:
93         * UIProcess/WebPopupMenuProxy.h:
94         * UIProcess/efl/WebUIPopupMenuClient.h:
95
96 2015-03-31  Yusuke Suzuki  <utatane.tea@gmail.com>
97
98         Clean up Identifier factories to clarify the meaning of StringImpl*
99         https://bugs.webkit.org/show_bug.cgi?id=143146
100
101         Reviewed by Filip Pizlo.
102
103         Just change to Identifier::fromString.
104
105         * WebProcess/Plugins/Netscape/JSNPObject.cpp:
106         (WebKit::JSNPObject::getOwnPropertyNames):
107         * WebProcess/Plugins/Netscape/NPJSObject.cpp:
108         (WebKit::identifierFromIdentifierRep):
109
110 2015-03-31  Timothy Horton  <timothy_horton@apple.com>
111
112         WebKit briefly shows wrong webpage after swiping back (gigaom.com, or any site on a slow network)
113         https://bugs.webkit.org/show_bug.cgi?id=143256
114         <rdar://problem/19458648>
115
116         Reviewed by Dan Bernstein.
117
118         Instead of allowing a flash of the previous page when the swipe snapshot
119         timeouts fire (removing the snapshot before the new page is loaded), show
120         the snapshotted background color.
121
122         This fixes the problem on iOS, where UI-side compositing makes it easy to fix,
123         but not yet on OS X.
124
125         * UIProcess/API/Cocoa/WKWebView.mm:
126         (baseScrollViewBackgroundColor):
127         (scrollViewBackgroundColor):
128         If the ViewGestureController returns a valid background color, use that
129         instead of the page's background color.
130
131         * UIProcess/API/Cocoa/WKWebViewInternal.h:
132         Expose _updateScrollViewBackground.
133
134         * UIProcess/PageClient.h:
135         * UIProcess/ios/PageClientImplIOS.h:
136         * UIProcess/ios/PageClientImplIOS.mm:
137         (WebKit::PageClientImpl::didChangeBackgroundColor):
138         * UIProcess/mac/PageClientImpl.h:
139         * UIProcess/mac/PageClientImpl.mm:
140         (WebKit::PageClientImpl::didChangeBackgroundColor):
141         * UIProcess/WebPageProxy.cpp:
142         (WebKit::WebPageProxy::didChangeBackgroundColor):
143         * UIProcess/WebPageProxy.h:
144         Add and plumb didChangeBackgroundColor, which calls
145         _updateScrollViewBackground on iOS.
146         
147         * UIProcess/ios/ViewGestureControllerIOS.mm:
148         (WebKit::ViewGestureController::endSwipeGesture):
149         Hide the content of the drawing area until the next commit. This way,
150         even if the snapshot is removed (say, because a timeout fired), we won't
151         ever show the old page content (but we will show background color).
152
153         Store the background color associated with the current snapshot.
154
155         Let WKWebView know that it needs to recompute the background color.
156
157         (WebKit::ViewGestureController::removeSwipeSnapshot):
158         Clear the background color so that the next time we commit, WKWebView
159         will get an invalid color from ViewGestureController and fall back
160         to the page's extended background color instead.
161
162         * UIProcess/mac/ViewGestureController.h:
163         (WebKit::ViewGestureController::backgroundColorForCurrentSnapshot):
164         * UIProcess/mac/ViewGestureControllerMac.mm:
165         (WebKit::ViewGestureController::beginSwipeGesture):
166         (WebKit::ViewGestureController::removeSwipeSnapshot):
167         Keep backgroundColorForCurrentSnapshot up to date on Mac too, even
168         though we don't use it yet.
169
170 2015-03-31  Timothy Horton  <timothy_horton@apple.com>
171
172         [iOS] Rotating PDF in Safari scrolls to the wrong position
173         https://bugs.webkit.org/show_bug.cgi?id=143259
174         <rdar://problem/19872693>
175
176         Reviewed by Dan Bernstein.
177
178         * UIProcess/ios/WKPDFView.mm:
179         (-[WKPDFView web_setMinimumSize:]):
180         Maintan the relative top/left within the rescaled document.
181
182 2015-03-31  Chris Dumez  <cdumez@apple.com>
183
184         [WK2][iOS] Extend ProcessThrottler use to the NetworkProcess
185         https://bugs.webkit.org/show_bug.cgi?id=143249
186         <rdar://problem/20231539>
187
188         Reviewed by Gavin Barraclough.
189
190         Extend ProcessThrottler use to the NetworkProcess instead of only the
191         WebProcesses. This is needed so that the NetworkProcess gets notified
192         before suspension. We now use this notification to free-up memory
193         before suspending by calling the critical memory pressure handler, as
194         we already do for WebProcesses (rdar://problem/20231539). In the
195         future, this infrastructure will be used to delay suspension until the
196         pending SQL transactions are done as well (rdar://problem/20180799).
197
198         Previously, the NetworkProcessProxy would hold a foreground assertion
199         on behalf of the NetworkProcess but would never release that assertion.
200         In this patch, we change this so that WebProcessProxies hold assertions
201         on behalf of the NetworkProcess, and release those assertions before
202         suspending. As a result, the NetworkProcess gets suspended when all
203         WebProcesses are suspended.
204
205         * NetworkProcess/NetworkProcess.cpp:
206         (WebKit::NetworkProcess::processWillSuspend):
207         (WebKit::NetworkProcess::cancelProcessWillSuspend):
208         (WebKit::NetworkProcess::processDidResume):
209         * NetworkProcess/NetworkProcess.h:
210         * NetworkProcess/NetworkProcess.messages.in:
211         * UIProcess/Network/NetworkProcessProxy.cpp:
212         (WebKit::NetworkProcessProxy::NetworkProcessProxy):
213         (WebKit::NetworkProcessProxy::didFinishLaunching):
214         (WebKit::NetworkProcessProxy::sendProcessWillSuspend):
215         (WebKit::NetworkProcessProxy::sendCancelProcessWillSuspend):
216         (WebKit::NetworkProcessProxy::didCancelProcessSuspension):
217         (WebKit::NetworkProcessProxy::sendProcessDidResume):
218         (WebKit::NetworkProcessProxy::processReadyToSuspend):
219         * UIProcess/Network/NetworkProcessProxy.h:
220         (WebKit::NetworkProcessProxy::throttler):
221         * UIProcess/Network/NetworkProcessProxy.messages.in:
222         * UIProcess/ProcessThrottler.cpp:
223         (WebKit::ProcessThrottler::ProcessThrottler):
224         (WebKit::ProcessThrottler::didConnectToProcess):
225         (WebKit::ProcessThrottler::didConnnectToProcess): Deleted.
226         * UIProcess/ProcessThrottler.h:
227         * UIProcess/ProcessThrottlerClient.h: Added.
228         (WebKit::ProcessThrottlerClient::~ProcessThrottlerClient):
229         * UIProcess/WebProcessPool.cpp:
230         (WebKit::WebProcessPool::ensureNetworkProcess):
231         * UIProcess/WebProcessPool.h:
232         * UIProcess/WebProcessProxy.cpp:
233         (WebKit::WebProcessProxy::didFinishLaunching):
234         (WebKit::WebProcessProxy::initializeNetworkProcessActivityToken):
235         (WebKit::WebProcessProxy::sendProcessDidResume):
236         (WebKit::WebProcessProxy::processReadyToSuspend):
237         * UIProcess/WebProcessProxy.h:
238         * WebKit2.xcodeproj/project.pbxproj:
239
240 2015-03-31  Csaba Osztrogonác  <ossy@webkit.org>
241
242         Unreviewed, revert accidental change by r182138.
243
244         * Scripts/generate-forwarding-headers.pl:
245         (createForwardingHeadersForFramework):
246
247 2015-03-31  Carlos Garcia Campos  <cgarcia@igalia.com>
248
249         Unreviewed. Fix GTK+ build with REDIRECTED_XCOMPOSITE_WINDOW disabled in X11 platform.
250
251         Also fix some unused parameter warnings when
252         REDIRECTED_XCOMPOSITE_WINDOW is disabled.
253
254         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
255         (webkitWebViewRenderAcceleratedCompositingResults):
256         (resizeWebKitWebViewBaseFromAllocation):
257
258 2015-03-31  Carlos Garcia Campos  <cgarcia@igalia.com>
259
260         [GTK] DnD icon/widget has odd background
261         https://bugs.webkit.org/show_bug.cgi?id=143217
262
263         Reviewed by Martin Robinson.
264
265         Use gtk_drag_set_icon_surface() to set the drag icon image,
266         instead of DragIcon class.
267
268         * UIProcess/API/gtk/WebKitWebView.cpp:
269         * UIProcess/gtk/DragAndDropHandler.cpp:
270         (WebKit::DragAndDropHandler::startDrag):
271         * UIProcess/gtk/DragAndDropHandler.h:
272
273 2015-03-30  Commit Queue  <commit-queue@webkit.org>
274
275         Unreviewed, rolling out r182172.
276         https://bugs.webkit.org/show_bug.cgi?id=143250
277
278         Since this class is an API object, we don't know for sure when
279         it will be destroyed. (Requested by kling on #webkit).
280
281         Reverted changeset:
282
283         "WebBackForwardList doesn't need to manually clear the
284         snapshot of an entry when removing it."
285         https://bugs.webkit.org/show_bug.cgi?id=143231
286         http://trac.webkit.org/changeset/182172
287
288 2015-03-30  Andreas Kling  <akling@apple.com>
289
290         WebBackForwardList doesn't need to manually clear the snapshot of an entry when removing it.
291         <https://webkit.org/b/143231>
292
293         Reviewed by Tim Horton.
294
295         Now that we don't keep WebBackForwardListItem objects alive forever, it's not necessary
296         to clear the snapshot when removing them from the WebBackForwardList, since the entire
297         object will be deleted shortly after that anyway.
298
299         * UIProcess/WebBackForwardList.cpp:
300         (WebKit::WebBackForwardList::didRemoveItem):
301
302 2015-03-30  Enrica Casucci  <enrica@apple.com>
303
304         [iOS] WebContent crashing at WebCore: WebCore::Range::collectSelectionRects.
305         https://bugs.webkit.org/show_bug.cgi?id=143234
306         <rdar://problem/18571345>
307
308         Reviewed by Tim Horton.
309
310         This is a speculative fix that adds a null check before referencing the range.
311         In both places where the check has been added the range returned by the call
312         that should create it could be null.
313
314         * WebProcess/WebPage/ios/WebPageIOS.mm:
315         (WebKit::WebPage::platformEditorState):
316
317 2015-03-30  Sam Weinig  <sam@webkit.org>
318
319         [Content Extensions] Flesh out the UserContentExtensionStore
320         https://bugs.webkit.org/show_bug.cgi?id=143123
321
322         Reviewed by Benjamin Poulain.
323
324         * Shared/WebCompiledContentExtension.cpp:
325         (WebKit::WebCompiledContentExtension::createFromCompiledContentExtensionData):
326         * Shared/WebCompiledContentExtensionData.cpp:
327         (WebKit::WebCompiledContentExtensionData::encode):
328         (WebKit::WebCompiledContentExtensionData::decode):
329         * Shared/WebCompiledContentExtensionData.h:
330         (WebKit::WebCompiledContentExtensionData::WebCompiledContentExtensionData):
331         Switch the order in memory of actions and bytecode (and switch the order of the
332         variables as well, to keep it clear). This will become necessary when streaming
333         the data to disk, as actions are created before the bytecode and we would have to keep them
334         in memory until the bytecode was finished compiling if they didn't come before in the file.
335
336         * UIProcess/API/APIUserContentExtensionStore.h:
337         * UIProcess/API/APIUserContentExtensionStore.cpp:
338         (API::UserContentExtensionStore::defaultStore):
339         Add accessor for the processes default shared store.
340
341         (API::constructedPath):
342         Helper for constructing the path to a file in the store based on identifier.
343
344         (API::encodeContentExtensionMetaData):
345         (API::decodeContentExtensionMetaData):
346         Helpers for encoding/decoding the file metadata (version, bytecode size, actions size).
347
348         (API::openAndMapContentExtension):
349         Helper to open and map a filed back content extension.
350
351         (API::writeDataToFile):
352         Helper to write a Data object to a file.
353
354         (API::compiledToFile):
355         Helper to run the content extension compiler and write it to disk. It first
356         writes it to a temporary file and then does an atomic rename operation to put
357         the file in the final location. Doing this means that if the process crashes while
358         the compile is taking place, the partially written file won't end up in the cache, 
359         but rather, will be cleaned up by the OS.
360  
361         (API::UserContentExtensionStore::lookupContentExtension):
362         API entry point to lookup an extension that has been compiled to disk. On a background queue,
363         it attempts to open and map the extension (based on the identifier passed in) and return it
364         to the caller via the callback function passed in.
365         
366         (API::UserContentExtensionStore::compileContentExtension):
367         API entry point to compile an extension and write it to store. On a background queue, it 
368         compiles the file to disk and if successful, returns the memory mapped data via the callback
369         function passed in.
370
371         (API::UserContentExtensionStore::removeContentExtension):
372         API entry point to remove an extension from the store. On a background queue, it 
373         unlinks the extension (based on the identifier passed in) and tells the caller it completed
374         the action vial the callback function passed in.
375
376         (API::UserContentExtensionStore::synchronousRemoveAllContentExtensions):
377         Helper for testing which synchronously unlinks all the files in the store.
378
379         (API::userContentExtensionStoreErrorCategory):
380         std::error_code adaptor for some generic errors that can happen in the store. We will want
381         to flesh these out further.
382
383         * UIProcess/API/Cocoa/APIUserContentExtensionStoreCocoa.mm: Added.
384         (API::UserContentExtensionStore::defaultStorePath):
385         Helper to get the platform specific path for the store.
386
387         * UIProcess/API/C/WKUserContentExtensionStoreRef.cpp:
388         (WKUserContentExtensionStoreGetTypeID):
389         Add ENABLE(CONTENT_EXTENSIONS) guards.
390
391         * UIProcess/API/Cocoa/_WKUserContentExtensionStore.h:
392         * UIProcess/API/Cocoa/_WKUserContentExtensionStore.mm:
393         (-[_WKUserContentExtensionStore dealloc]):
394         (+[_WKUserContentExtensionStore defaultStore]):
395         (-[_WKUserContentExtensionStore compileContentExtensionForIdentifier:encodedContentExtension:completionHandler:]):
396         (-[_WKUserContentExtensionStore lookupContentExtensionForIdentifier:completionHandler:]):
397         (-[_WKUserContentExtensionStore removeContentExtensionForIdentifier:completionHandler:]):
398         (-[_WKUserContentExtensionStore _removeAllContentExtensions]):
399         (-[_WKUserContentExtensionStore init]): Deleted.
400         * UIProcess/API/Cocoa/_WKUserContentExtensionStoreInternal.h:
401         * UIProcess/API/Cocoa/_WKUserContentExtensionStorePrivate.h: Added.
402         SPI wrappers for the store.
403
404         * WebKit2.xcodeproj/project.pbxproj:
405         Add new files.
406
407 2015-03-30  Antti Koivisto  <antti@apple.com>
408
409         Don't cache resources that are very unlikely to be reused
410         https://bugs.webkit.org/show_bug.cgi?id=143226
411
412         Reviewed by Chris Dumez.
413
414         Follow-up to cover Cache-control: no-cache case which also has zero cache lifetime.
415
416         * NetworkProcess/cache/NetworkCache.cpp:
417         (WebKit::NetworkCache::makeStoreDecision):
418
419 2015-03-30  Antti Koivisto  <antti@apple.com>
420
421         Include cache entry worth to json dump
422         https://bugs.webkit.org/show_bug.cgi?id=143202
423
424         Follow-up fix.
425
426         * NetworkProcess/cache/NetworkCacheStorage.cpp:
427         (WebKit::NetworkCache::computeRecordWorth):
428
429             This accidentally gave the error case worth 1 rather than 0 as it should be.
430
431 2015-03-30  Antti Koivisto  <antti@apple.com>
432
433         Don't cache resources that are very unlikely to be reused
434         https://bugs.webkit.org/show_bug.cgi?id=143226
435         <rdar://problem/20347160>
436
437         Reviewed by Geoff Garen.
438
439         We are writing lots of resources to the cache that are never used again.
440
441         In browse-around-randomly test this reduced number of cache entries created by ~20% and bytes written by ~5%.
442
443         * NetworkProcess/cache/NetworkCache.cpp:
444         (WebKit::NetworkCache::makeUseDecision):
445         (WebKit::NetworkCache::makeRetrieveDecision):
446
447             Rename for clarity.
448
449         (WebKit::NetworkCache::makeStoreDecision):
450
451             Store only if the resource has non-zero expiration or has validation headers.
452
453             Very High priority resources (main resources) keep the existing policy to minimize impact
454             on back navigation and tab restore.
455
456         (WebKit::NetworkCache::Cache::retrieve):
457         (WebKit::NetworkCache::Cache::store):
458         (WebKit::NetworkCache::canUse): Deleted.
459         (WebKit::NetworkCache::canRetrieve): Deleted.
460         (WebKit::NetworkCache::canStore): Deleted.
461         * NetworkProcess/cache/NetworkCache.h:
462         * NetworkProcess/cache/NetworkCacheStatistics.cpp:
463         (WebKit::NetworkCache::storeDecisionToDiagnosticKey):
464
465 2015-03-30  Tim Horton  <timothy_horton@apple.com>
466
467         Swipe snapshot removed too early (jumps around) on arstechnica and NYT
468         https://bugs.webkit.org/show_bug.cgi?id=143199
469         <rdar://problem/18420467>
470
471         Reviewed by Dan Bernstein.
472
473         Make ViewGestureControllerIOS's snapshot removal timing behave more like the Mac version.
474
475         * UIProcess/API/Cocoa/WKWebView.mm:
476         (-[WKWebView _didCommitLayerTree:]):
477         Let ViewGestureController know when the page has finished state restoration.
478
479         (-[WKWebView _didFinishLoadForMainFrame]):
480         (-[WKWebView _didSameDocumentNavigationForMainFrame:]):
481         Forward these to ViewGestureController.
482
483         * UIProcess/API/Cocoa/WKWebViewInternal.h:
484         * UIProcess/ios/PageClientImplIOS.mm:
485         (WebKit::PageClientImpl::didFinishLoadForMainFrame):
486         Forward didFinishLoadForMainFrame to WKWebView.
487
488         * UIProcess/ios/ViewGestureControllerIOS.mm:
489         (WebKit::ViewGestureController::ViewGestureController):
490         (WebKit::ViewGestureController::endSwipeGesture):
491         Split the swipe snapshot removal state into a bunch of bools.
492
493         (WebKit::ViewGestureController::willCommitPostSwipeTransitionLayerTree):
494         (WebKit::ViewGestureController::setRenderTreeSize):
495         (WebKit::ViewGestureController::removeSwipeSnapshotIfReady):
496         (WebKit::ViewGestureController::removeSwipeSnapshot):
497         Unify the snapshot removal logic into one function; removeSwipeSnapshotIfReady
498         completely owns the decision. For now, we're waiting for everything, but
499         we can do better in the future (using firstVisuallyNonEmptyLayout like Mac used to).
500
501         (WebKit::ViewGestureController::didRestoreScrollPosition):
502         (WebKit::ViewGestureController::didFinishLoadForMainFrame):
503         (WebKit::ViewGestureController::didSameDocumentNavigationForMainFrame):
504         (WebKit::ViewGestureController::activeLoadMonitoringTimerFired):
505         Add more conditions for swipe snapshot removal. We'll now wait for
506         didFinishLoadForMainFrame (or didSameDocumentNavigationForMainFrame),
507         for active loads to finish, and for the scroll position to be restored.
508         This brings the iOS implementation in line with the slightly better Mac
509         implementation, and also sets the stage for deduplication of all of this code.
510         
511         * UIProcess/mac/ViewGestureController.h:
512         * UIProcess/mac/ViewGestureControllerMac.mm:
513         (WebKit::ViewGestureController::ViewGestureController):
514
515 2015-03-30  Chris Dumez  <cdumez@apple.com>
516
517         [WK2][NetworkCache] Add support for "Cache-Control: max-stale" request header
518         https://bugs.webkit.org/show_bug.cgi?id=143159
519         <rdar://problem/20333296>
520
521         Reviewed by Antti Koivisto.
522
523         Add support for "Cache-Control: max-stale" request header:
524         https://tools.ietf.org/html/rfc7234#section-5.2.1.2
525
526         * NetworkProcess/cache/NetworkCache.cpp:
527         (WebKit::NetworkCache::responseHasExpired):
528         (WebKit::NetworkCache::requestRequiresRevalidation):
529         (WebKit::NetworkCache::canUse):
530
531 2015-03-30  Csaba Osztrogonác  <ossy@webkit.org>
532
533         [EFL][GTK] WebKit2's generate-forwarding-headers.pl should fail if clashing headers found
534         https://bugs.webkit.org/show_bug.cgi?id=142909
535
536         Reviewed by Philippe Normand.
537
538         * Scripts/generate-forwarding-headers.pl:
539         (createForwardingHeadersForFramework):
540
541 2015-03-29  Antti Koivisto  <antti@apple.com>
542
543         Include cache entry worth to json dump
544         https://bugs.webkit.org/show_bug.cgi?id=143202
545
546         Reviewed by Darin Adler.
547
548         This is useful for analyzing cache performance.
549         Also include the body size, total item count and average worth.
550
551         * NetworkProcess/cache/NetworkCache.cpp:
552         (WebKit::NetworkCache::Cache::traverse):
553         (WebKit::NetworkCache::Cache::dumpContentsToFile):
554         * NetworkProcess/cache/NetworkCacheEntry.cpp:
555         (WebKit::NetworkCache::Entry::asJSON):
556         * NetworkProcess/cache/NetworkCacheEntry.h:
557         * NetworkProcess/cache/NetworkCacheStorage.cpp:
558         (WebKit::NetworkCache::Storage::traverse):
559
560             Add flags for specificying what sort of information is needed.
561
562         (WebKit::NetworkCache::computeRecordWorth):
563
564             Factor to a function.
565
566         (WebKit::NetworkCache::deletionProbability):
567         * NetworkProcess/cache/NetworkCacheStorage.h:
568
569 2015-03-29  Simon Fraser  <simon.fraser@apple.com>
570
571         Fix iOS scrollperf crash after a web process crash
572         https://bugs.webkit.org/show_bug.cgi?id=143110
573
574         Reviewed by Dean Jackson.
575         
576         When we destroy the drawing area after a web process crash, we also need to destroy
577         the scrollingPerformanceData which has a reference to the drawing area.
578
579         * UIProcess/WebPageProxy.cpp:
580         (WebKit::WebPageProxy::resetState):
581
582 2015-03-29  Simon Fraser  <simon.fraser@apple.com>
583
584         Convert arguments to ScrollingCoordinator functions to references
585         https://bugs.webkit.org/show_bug.cgi?id=143198
586
587         Reviewed by Darin Adler.
588
589         Convert all the FrameView* and ScrollableArea* arguments to ScrollingCoordinator functions to
590         references, and use references in a few other places.
591
592         * WebProcess/Scrolling/RemoteScrollingCoordinator.h:
593         * WebProcess/Scrolling/RemoteScrollingCoordinator.mm:
594         (WebKit::RemoteScrollingCoordinator::coordinatesScrollingForFrameView):
595
596 2015-03-29  Enrica Casucci  <enrica@apple.com>
597
598         [iOS WK2] WKContentView should implement _selectionClipRect
599         https://bugs.webkit.org/show_bug.cgi?id=143143
600         rdar://problem/20330075
601
602         Reviewed by Benjamin Poulain.
603
604         UIKit checks if the text delegate responds to this selector
605         to retrieve the clipping rectangle for the editable element
606         where the selection is being create.
607
608         * UIProcess/ios/WKContentViewInteraction.mm:
609         (-[WKContentView _selectionClipRect]):
610
611 2015-03-29  Antti Koivisto  <antti@apple.com>
612
613         Use st_mtime instead of st_atime to track file access time
614         https://bugs.webkit.org/show_bug.cgi?id=143200
615
616         Reviewed by Darin Adler.
617
618         On OS X atime updates automatically on read so calling Storage::traverse() would always ends up updating access times
619         for all cache entries to the current time. This would make entry worth computation produce unexpected results.
620         We update mtime manually on successful cache retrieve only so switching to it fixes the problem.
621
622         * NetworkProcess/cache/NetworkCacheFileSystemPosix.h:
623         (WebKit::NetworkCache::fileTimes):
624         (WebKit::NetworkCache::updateFileModificationTimeIfNeeded):
625         (WebKit::NetworkCache::updateFileAccessTimeIfNeeded): Deleted.
626         * NetworkProcess/cache/NetworkCacheStorage.cpp:
627         (WebKit::NetworkCache::Storage::updateFileModificationTime):
628         (WebKit::NetworkCache::Storage::dispatchReadOperation):
629         (WebKit::NetworkCache::deletionProbability):
630         (WebKit::NetworkCache::Storage::updateFileAccessTime): Deleted.
631         * NetworkProcess/cache/NetworkCacheStorage.h:
632
633 2015-03-27  Gwang Yoon Hwang  <yoon@igalia.com>
634
635         [TexMap] Seperate BitmapTexture related classes implementations from TextureMapper
636         https://bugs.webkit.org/show_bug.cgi?id=142386
637
638         Reviewed by Žan Doberšek.
639
640         TextureMapper and TextureMapperGL are bloated and tightly coupled with
641         BitmapTexture. We should move these classes to seperated file of their own.
642         Also, this patch removes friend relationship from TextureMapperGL and  its
643         subsidiary classes.
644
645         The main purpose of this refactoring is to expose BitmapTexturePool to
646         renderers of platformlayers like Video and Canvas. By doing this, each
647         renderer can acquire textures from the global texture pool to paint
648         their contents directly.
649
650         * Shared/CoordinatedGraphics/WebCoordinatedSurface.cpp: Include BitmapTextureGL.h explicitly
651
652 2015-03-27  Anders Carlsson  <andersca@apple.com>
653
654         Use a typedef for the WKPluginLoadClientPolicy enum
655         https://bugs.webkit.org/show_bug.cgi?id=143161
656
657         Reviewed by Tim Horton.
658
659         * UIProcess/API/C/WKPluginLoadPolicy.h:
660
661 2015-03-27  Chris Dumez  <cdumez@apple.com>
662
663         [WK2][NetworkCache] Use WTF::WorkQueue abstraction inside NetworkCacheStatistics
664         https://bugs.webkit.org/show_bug.cgi?id=143154
665
666         Reviewed by Antti Koivisto.
667
668         Use WTF::WorkQueue abstraction inside NetworkCacheStatistics, like we
669         already do in NetworkCacheStorage.
670
671         * NetworkProcess/cache/NetworkCacheStatistics.cpp: Renamed from Source/WebKit2/NetworkProcess/cache/NetworkCacheStatisticsCocoa.mm.
672         (WebKit::NetworkCache::executeSQLCommand):
673         (WebKit::NetworkCache::executeSQLStatement):
674         (WebKit::NetworkCache::Statistics::open):
675         (WebKit::NetworkCache::Statistics::Statistics):
676         (WebKit::NetworkCache::Statistics::initialize):
677         (WebKit::NetworkCache::Statistics::bootstrapFromNetworkCache):
678         (WebKit::NetworkCache::Statistics::shrinkIfNeeded):
679         (WebKit::NetworkCache::Statistics::recordRetrievalRequest):
680         (WebKit::NetworkCache::Statistics::recordNotCachingResponse):
681         (WebKit::NetworkCache::retrieveDecisionToDiagnosticKey):
682         (WebKit::NetworkCache::Statistics::recordNotUsingCacheForRequest):
683         (WebKit::NetworkCache::storeDecisionToDiagnosticKey):
684         (WebKit::NetworkCache::Statistics::recordRetrievalFailure):
685         (WebKit::NetworkCache::cachedEntryReuseFailureToDiagnosticKey):
686         (WebKit::NetworkCache::Statistics::recordRetrievedCachedEntry):
687         (WebKit::NetworkCache::Statistics::markAsRequested):
688         (WebKit::NetworkCache::Statistics::writeTimerFired):
689         (WebKit::NetworkCache::Statistics::queryWasEverRequested):
690         (WebKit::NetworkCache::Statistics::clear):
691         (WebKit::NetworkCache::Statistics::addHashesToDatabase):
692         (WebKit::NetworkCache::Statistics::addStoreDecisionsToDatabase):
693         * NetworkProcess/cache/NetworkCacheStatistics.h:
694         (WebKit::NetworkCache::Statistics::serialBackgroundIOQueue):
695         * WebKit2.xcodeproj/project.pbxproj:
696
697 2015-03-27  Ryosuke Niwa  <rniwa@webkit.org>
698
699         Safari clears selection when its window gets activated via mouse down
700         https://bugs.webkit.org/show_bug.cgi?id=143157
701
702         Reviewed by Anders Carlsson.
703
704         The bug was caused by PlatformMouseEvent created in WebKit2 not having its event number
705         even though we were correctly calling setActivationEventNumber in WebPage::acceptsFirstMouse.
706
707         Fixed the bug by storing [NSEvent eventNumber] in WebMouseEvent on Mac in WebKit2 as done in WebKit1.
708
709         * Shared/WebEvent.h:
710         (WebKit::WebMouseEvent::eventNumber):
711         * Shared/WebEventConversion.cpp:
712         (WebKit::WebKit2PlatformMouseEvent::WebKit2PlatformMouseEvent):
713         * Shared/WebMouseEvent.cpp:
714         (WebKit::WebMouseEvent::WebMouseEvent):
715         (WebKit::WebMouseEvent::encode):
716         (WebKit::WebMouseEvent::decode):
717         * Shared/mac/WebEventFactory.mm:
718         (WebKit::WebEventFactory::createWebMouseEvent):
719
720 2015-03-27  Anders Carlsson  <andersca@apple.com>
721
722         Only do the Connection::setShouldCloseConnectionOnMachExceptions() hack where necessary
723         https://bugs.webkit.org/show_bug.cgi?id=143141
724         rdar://problem/19471284
725
726         Reviewed by Andreas Kling.
727
728         * Platform/IPC/Connection.h:
729         * Platform/IPC/mac/ConnectionMac.mm:
730         (IPC::Connection::platformInvalidate):
731         (IPC::Connection::platformInitialize):
732         (IPC::Connection::open):
733         * Shared/ChildProcessProxy.cpp:
734         (WebKit::ChildProcessProxy::didFinishLaunching):
735         * UIProcess/Plugins/PluginProcessProxy.cpp:
736         (WebKit::PluginProcessProxy::didFinishLaunching):
737
738 2015-03-27  Tim Horton  <timothy_horton@apple.com>
739
740         Implement iOS WebKit2 PDF Find-in-Page
741         https://bugs.webkit.org/show_bug.cgi?id=143065
742         <rdar://problem/16793370>
743
744         Reviewed by Dan Bernstein.
745
746         * Platform/spi/ios/CorePDFSPI.h:
747         Add some SPI.
748
749         * UIProcess/API/Cocoa/WKWebView.mm:
750         (-[WKWebView _countStringMatches:options:maxCount:]):
751         (-[WKWebView _findString:options:maxCount:]):
752         (-[WKWebView _hideFindUI]):
753         If we have a custom content view, forward find-in-page methods to it.
754         
755         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
756         * UIProcess/API/Cocoa/_WKFindOptions.h:
757         Move _WKFindOptions into its own file.
758
759         * UIProcess/Cocoa/WKWebViewContentProvider.h:
760         Add find-related methods to the WKWebViewContentProvider protocol.
761
762         * UIProcess/ios/WKPDFView.mm:
763         (-[WKPDFView web_initWithFrame:webView:]):
764         (-[WKPDFView dealloc]):
765         Maintain a dispatch queue for searching the PDF.
766
767         (-[WKPDFView web_setContentProviderData:suggestedFilename:]):
768         Fix a type.
769
770         (-[WKPDFView _ensureViewForPage:]):
771         Split the code to create/parent a page view out from _revalidateViews,
772         so that the find code can create/parent the targetted UIPDFPageView
773         in order to install the find highlight in it, but before it is scrolled into view.
774
775         (-[WKPDFView _revalidateViews]):
776         Use the stored page index instead of counting again.
777         Don't unparent page views that have find-in-page highlights in them, because
778         we won't know enough to recreate them later.
779
780         (-[WKPDFView _computePageAndDocumentFrames]):
781         Put the page index in PDFPageInfo, for reference elsewhere.
782
783         (-[WKPDFView _stringCompareOptionsFromWKFindOptions:]):
784         (-[WKPDFView _computeMatchesForString:options:maxCount:completionHandler:]):
785         Asynchronously (and on our serial queue) search the PDF for the given string.
786         We'll cache the most recent results to avoid searching more than once,
787         cancel existing searches when another begins (since it's a serial queue,
788         this ensures we'll only have one search active at a time).
789
790         (-[WKPDFView web_countStringMatches:options:maxCount:]):
791         Count the number of matches for the given string, and inform the FindClient
792         of the result.
793
794         (-[WKPDFView _didFindMatch:]):
795         When we find a match, create a view for it, highlight the match, and
796         zoom so that it's in-view.
797
798         (-[WKPDFView web_findString:options:maxCount:]):
799         Incrementally search the document for the given string. We do an incremental
800         search even if we have all of the results so that we can anchor the search
801         in the right place if the new string is a prefix of the old string, etc.
802         Wrap around appropriately when searching past the beginning or end of the
803         document. If we have all of the results (there were less than maxCount results),
804         look through the cached matches for the incrementally-found result and
805         report its index to the client.
806
807         (-[WKPDFView web_hideFindUI]):
808         Dismiss the selection and clear some state so we start the next search afresh.
809
810         * WebKit2.xcodeproj/project.pbxproj:
811
812 2015-03-27  Andreas Kling  <akling@apple.com>
813
814         WebProcessProxy should not retain WebBackForwardListItems forever.
815         <https://webkit.org/b/143152>
816         <rdar://problem/19925709>
817
818         Reviewed by Anders Carlsson.
819
820         Have WebProcessProxy actually forget about a WebBackForwardListItem after it's removed from
821         the WebBackForwardList.
822
823         This ensures that we don't accumulate too many of these objects, which can get quite large
824         due to the session state encoded in them.
825
826         We already have graceful handling of the case where an incoming IPC message references
827         a removed back/forward list item.
828
829         * UIProcess/WebBackForwardList.cpp:
830         (WebKit::WebBackForwardList::didRemoveItem):
831         * UIProcess/WebPageProxy.cpp:
832         (WebKit::WebPageProxy::backForwardRemovedItem):
833         * UIProcess/WebProcessProxy.cpp:
834         (WebKit::WebProcessProxy::removeBackForwardItem):
835         * UIProcess/WebProcessProxy.h:
836
837 2015-03-27  Simon Fraser  <simon.fraser@apple.com>
838
839         Use the correct timebase to log scrollperf blank pixel counts on iOS
840         https://bugs.webkit.org/show_bug.cgi?id=143149
841
842         Reviewed by Tim Horton.
843         
844         MobileSafari and WebKit need to collect scrollperf data using the same timebase;
845         MobileSafari can't call WTF::monotonicallyIncreasingTime(), so use CFAbsoluteTimeGetCurrent()
846         everywhere.
847
848         * UIProcess/Cocoa/RemoteLayerTreeScrollingPerformanceData.mm:
849         (WebKit::RemoteLayerTreeScrollingPerformanceData::appendBlankPixelCount):
850
851 2015-03-27  Chris Dumez  <cdumez@apple.com>
852
853         [WK2][NetworkCache] Rename requestNeedsRevalidation() to requestRequiresRevalidation()
854         https://bugs.webkit.org/show_bug.cgi?id=143137
855
856         Reviewed by Antti Koivisto.
857
858         Rename requestNeedsRevalidation() to requestRequiresRevalidation() as I
859         think it is more accurate. It is not the request that needs revalidating.
860         The requests just requires us to revalidate the response.
861
862         * NetworkProcess/cache/NetworkCache.cpp:
863         (WebKit::NetworkCache::requestRequiresRevalidation):
864         (WebKit::NetworkCache::canUse):
865         (WebKit::NetworkCache::requestNeedsRevalidation): Deleted.
866
867 2015-03-27  Oliver Hunt  <oliver@apple.com>
868
869         Forward additional CFNetwork ATS information to child processes
870         https://bugs.webkit.org/show_bug.cgi?id=143136
871
872         Reviewed by Anders Carlsson.
873
874         Add additional process creation parameter information, and pass it
875         to the child processes that actually use CFNetwork.
876
877         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
878         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
879         * Shared/Network/NetworkProcessCreationParameters.cpp:
880         (WebKit::NetworkProcessCreationParameters::encode):
881         (WebKit::NetworkProcessCreationParameters::decode):
882         * Shared/Network/NetworkProcessCreationParameters.h:
883         * Shared/Plugins/PluginProcessCreationParameters.cpp:
884         (WebKit::PluginProcessCreationParameters::encode):
885         (WebKit::PluginProcessCreationParameters::decode):
886         * Shared/Plugins/PluginProcessCreationParameters.h:
887         * Shared/WebProcessCreationParameters.cpp:
888         (WebKit::WebProcessCreationParameters::encode):
889         (WebKit::WebProcessCreationParameters::decode):
890         * Shared/WebProcessCreationParameters.h:
891         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
892         (WebKit::WebProcessPool::platformInitializeWebProcess):
893         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
894         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
895         (WebKit::PluginProcessProxy::platformInitializePluginProcess):
896         * WebProcess/cocoa/WebProcessCocoa.mm:
897         (WebKit::WebProcess::platformInitializeWebProcess):
898
899 2015-03-27  Chris Dumez  <cdumez@apple.com>
900
901         [WK2][NetworkCache] We only cache responses with status codes that are cacheable by default
902         https://bugs.webkit.org/show_bug.cgi?id=143125
903         <rdar://problem/20321172>
904
905         Reviewed by Antti Koivisto.
906
907         We Previously only cached responses with status codes that are cacheable
908         by default [1]. However, RFC 7234 [2] allows us to cache responses with
909         other status codes, as long as they have explicit headers allowing
910         caching:
911         - 'Expires' header field
912         - 'max-age' response directive
913
914         This patch updates our caching policy accordingly to improve efficiency.
915
916         [1] http://tools.ietf.org/html/rfc7231#page-48
917         [2] http://tools.ietf.org/html/rfc7234#section-4.3.2
918
919         Test: http/tests/cache/disk-cache/disk-cache-307-status-code.html
920
921         * NetworkProcess/cache/NetworkCache.cpp:
922         (WebKit::NetworkCache::canStore):
923
924 2015-03-26  Antti Koivisto  <antti@apple.com>
925
926         Respect cache-control directives in request
927         https://bugs.webkit.org/show_bug.cgi?id=143121
928         rdar://problem/19714040
929
930         Reviewed by Chris Dumez.
931
932         Better support for https://tools.ietf.org/html/rfc7234#section-5.2.1
933
934         * NetworkProcess/cache/NetworkCache.cpp:
935         (WebKit::NetworkCache::canUse):
936
937             Consider requests with Cache-control: no-cache and max-age=0 expired.
938
939         (WebKit::NetworkCache::canStore):
940
941             Don't store requests with Cache-control: no-store.
942
943         (WebKit::NetworkCache::Cache::store):
944         * NetworkProcess/cache/NetworkCache.h:
945         * NetworkProcess/cache/NetworkCacheStatisticsCocoa.mm:
946         (WebKit::NetworkCache::storeDecisionToDiagnosticKey):
947
948 2015-03-25  Jon Honeycutt  <jhoneycutt@apple.com>
949
950         iOS file upload panel menu items need icons
951         <https://bugs.webkit.org/show_bug.cgi?id=143042>
952         <rdar://problem/20178678>
953
954         Reviewed by Andy Estes.
955
956         * Platform/spi/ios/UIKitSPI.h:
957         Declare new SPI methods _UIImageGetWebKitTakePhotoOrVideoIcon and
958         _UIImageGetWebKitPhotoLibraryIcon().
959
960         * UIProcess/ios/forms/WKFileUploadPanel.mm:
961         (photoLibraryIcon):
962         (cameraIcon):
963         If UIKit SPI exists, use it. Otherwise, return nil.
964
965         (-[WKFileUploadPanel _showDocumentPickerMenu]):
966         Use icons.
967
968 2015-03-26  Enrica Casucci  <enrica@apple.com>
969
970         OS X build fix after r182037.
971
972         Unreviewed.
973
974         * UIProcess/API/mac/WKView.mm:
975         (-[WKView _addFontPanelObserver]):
976         (-[WKView removeWindowObservers]):
977         (-[WKView observeValueForKeyPath:ofObject:change:context:]):
978
979 2015-03-26  Enrica Casucci  <enrica@apple.com>
980
981         iOS build fix after r182037.
982
983         Unreviewed.
984
985         * UIProcess/API/Cocoa/WKWebView.mm:
986         (-[WKWebView _setEditable:]):
987
988 2015-03-26  Enrica Casucci  <enrica@apple.com>
989
990         REGRESSION(r1807689): Slower startup time for WKWebView.
991         https://bugs.webkit.org/show_bug.cgi?id=143115
992         rdar://problem/20233711
993
994         Reviewed by Anders Carlsson.
995
996         In http://trac.webkit.org/changeset/180768 we added an observer to
997         track visibility of the NSFontPanel to ensure we could fetch the font
998         information for the current selection when the panel first becomes visible.
999         It turns out that adding the observer requires the shared font panel
1000         object to be created.
1001         That is apparently a very expensive operation that is regressing
1002         the initialization time for the WKWebView.
1003         We should initialize the NSFontPanel lazily, only when we make the entire
1004         view editable.
1005
1006         * UIProcess/API/Cocoa/WKWebView.mm:
1007         (-[WKWebView _setEditable:]):
1008         * UIProcess/API/mac/WKView.mm:
1009         (-[WKView addWindowObserversForWindow:]):
1010         (-[WKView _addFontPanelObserver]):
1011         (-[WKView removeWindowObservers]):
1012         (-[WKView observeValueForKeyPath:ofObject:change:context:]):
1013         * UIProcess/API/mac/WKViewInternal.h:
1014
1015 2015-03-26  Alex Christensen  <achristensen@webkit.org>
1016
1017         Progress towards CMake on Mac.
1018         https://bugs.webkit.org/show_bug.cgi?id=143112
1019
1020         Reviewed by Chris Dumez.
1021
1022         * CMakeLists.txt:
1023         * PlatformMac.cmake:
1024         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
1025
1026 2015-03-26  Chris Dumez  <cdumez@apple.com>
1027
1028         [WK2][Cocoa] Add private API to override the network disk cache size
1029         https://bugs.webkit.org/show_bug.cgi?id=143113
1030         <rdar://problem/20315669>
1031
1032         Reviewed by Antti Koivisto.
1033
1034         Add private API to let the client override the network disk cache size.
1035         By default, the network disk cache is automatically determined based on
1036         the CacheModel and the available disk space. However, for testing
1037         purposes, it can be used for the client-side to be able to override
1038         the disk cache size.
1039
1040         * NetworkProcess/NetworkProcess.cpp:
1041         (WebKit::NetworkProcess::initializeNetworkProcess):
1042         * NetworkProcess/NetworkProcess.h:
1043         * NetworkProcess/cache/NetworkCache.cpp:
1044         (WebKit::NetworkCache::Cache::setMaximumSize):
1045         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
1046         (WebKit::NetworkProcess::platformSetCacheModel):
1047         * Shared/Network/NetworkProcessCreationParameters.cpp:
1048         (WebKit::NetworkProcessCreationParameters::encode):
1049         (WebKit::NetworkProcessCreationParameters::decode):
1050         * Shared/Network/NetworkProcessCreationParameters.h:
1051         * UIProcess/API/APIProcessPoolConfiguration.cpp:
1052         (API::ProcessPoolConfiguration::copy):
1053         * UIProcess/API/APIProcessPoolConfiguration.h:
1054         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
1055         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
1056         (-[_WKProcessPoolConfiguration diskCacheSizeOverride]):
1057         (-[_WKProcessPoolConfiguration setDiskCacheSizeOverride:]):
1058         * UIProcess/WebProcessPool.cpp:
1059         (WebKit::WebProcessPool::WebProcessPool):
1060         (WebKit::WebProcessPool::ensureNetworkProcess):
1061         * UIProcess/WebProcessPool.h:
1062
1063 2015-03-26  Andreas Kling  <akling@apple.com>
1064
1065         [Darwin] Boost the web process QoS level while handling a synchronous IPC message.
1066         <https://webkit.org/b/142988>
1067         <rdar://problem/20264346>
1068
1069         Reviewed by Antti Koivisto and Anders Carlsson.
1070
1071         Add a mechanism for IPC::Connection to boost the main thread for the duration
1072         of processing a synchronous message.
1073
1074         This fixes an issue where the UI process would block on a synchronous request
1075         to the web process that was being carried out at a lower QoS level.
1076
1077         * Platform/IPC/Connection.cpp:
1078         (IPC::Connection::Connection): Save the main thread's pthread_t while we have
1079         a chance to retreive it.
1080
1081         (IPC::Connection::processIncomingMessage): Optionally boost the main thread when
1082         processing an incoming message with the IsSyncMessage flag set.
1083
1084         * Platform/IPC/Connection.h:
1085         (IPC::Connection::setShouldBoostMainThreadOnSyncMessage): Added. When this mode is
1086         enabled, Connection will give a temporary QoS override to the main thread when
1087         receiving a synchronous message. Ownership of the override is handed to the
1088         MessageDecoder, which resets the main thread QoS in its destructor.
1089
1090         * Platform/IPC/MessageDecoder.cpp:
1091         (IPC::MessageDecoder::~MessageDecoder): Remove any QoS override owned by this message.
1092
1093         * Platform/IPC/MessageDecoder.h:
1094         (IPC::MessageDecoder::setQOSClassOverride): Added. Takes ownership of a QoS override
1095         to make sure it stays in effect until this message has been dispatched.
1096
1097         * WebProcess/WebProcess.cpp:
1098         (WebKit::WebProcess::initializeConnection): Set up main thread QoS boosting for the
1099         web process's connection to the UI process.
1100
1101 2015-03-26  Ryosuke Niwa  <rniwa@webkit.org>
1102
1103         Cursor doesn't change back to pointer when leaving Mail
1104         https://bugs.webkit.org/show_bug.cgi?id=132038
1105
1106         Reviewed by Anders Carlsson.
1107
1108         Fixed the bug by adding a cursor rect and making the primary tracking area update the cursor so that
1109         AppKit will reset the cursor as it leaves the WebView.
1110
1111         We use nil cursor here since we manually update the cursor by calling [NSCursor set].
1112
1113         * UIProcess/API/mac/WKView.mm:
1114         (-[WKView initWithFrame:processPool:configuration:webView:]):
1115         * UIProcess/mac/PageClientImpl.mm:
1116         (WebKit::PageClientImpl::recommendedScrollbarStyleDidChange):
1117
1118 2015-03-26  Michael Catanzaro  <mcatanzaro@igalia.com>
1119
1120         [Linux] SeccompFilters: improve the port-agnostic whitelist
1121         https://bugs.webkit.org/show_bug.cgi?id=140064
1122
1123         Reviewed by Žan Doberšek.
1124
1125         Allow the web process to access several files and directories that it
1126         was previously prohibited from accessing. This makes the web process
1127         much less likely to break.
1128
1129         * Shared/linux/SeccompFilters/SyscallPolicy.cpp:
1130         (WebKit::SyscallPolicy::addDefaultWebProcessPolicy):
1131
1132 2015-03-26  Antti Koivisto  <antti@apple.com>
1133
1134         Remove unneeded isConditionalRequest check from NetworkResourceLoader
1135         https://bugs.webkit.org/show_bug.cgi?id=143096
1136
1137         Reviewed by Anders Carlsson.
1138
1139         This check is leftover from implementation that allowed disk cache to validate conditional
1140         request itself. The case can't happen as NetworkCache canRetrieve test does not allow
1141         conditional requests in the first place.
1142
1143         * NetworkProcess/NetworkResourceLoader.cpp:
1144         (WebKit::NetworkResourceLoader::didReceiveResponseAsync):
1145         (WebKit::isConditionalRequest): Deleted.
1146
1147 2015-03-26  Antti Koivisto  <antti@apple.com>
1148
1149         Rename Storage::Entry to Storage::Record
1150         https://bugs.webkit.org/show_bug.cgi?id=143101
1151
1152         Reviewed by Chris Dumez.
1153
1154         Lets have just one type called Entry in the cache code.
1155
1156         * NetworkProcess/cache/NetworkCache.cpp:
1157         (WebKit::NetworkCache::Cache::retrieve):
1158         (WebKit::NetworkCache::Cache::store):
1159         (WebKit::NetworkCache::Cache::update):
1160         (WebKit::NetworkCache::Cache::traverse):
1161         (WebKit::NetworkCache::Cache::dumpContentsToFile):
1162         * NetworkProcess/cache/NetworkCacheEntry.cpp:
1163         (WebKit::NetworkCache::Entry::Entry):
1164         (WebKit::NetworkCache::Entry::encodeAsStorageRecord):
1165         (WebKit::NetworkCache::Entry::decodeStorageRecord):
1166         (WebKit::NetworkCache::Entry::initializeBufferFromStorageRecord):
1167         (WebKit::NetworkCache::Entry::buffer):
1168         (WebKit::NetworkCache::Entry::shareableResourceHandle):
1169         (WebKit::NetworkCache::Entry::encode): Deleted.
1170         (WebKit::NetworkCache::Entry::decode): Deleted.
1171         (WebKit::NetworkCache::Entry::initializeBufferFromStorageEntry): Deleted.
1172         * NetworkProcess/cache/NetworkCacheEntry.h:
1173         (WebKit::NetworkCache::Entry::sourceStorageRecord):
1174         (WebKit::NetworkCache::Entry::sourceStorageEntry): Deleted.
1175         * NetworkProcess/cache/NetworkCacheStorage.cpp:
1176         (WebKit::NetworkCache::RecordMetaData::RecordMetaData):
1177         (WebKit::NetworkCache::decodeRecordMetaData):
1178         (WebKit::NetworkCache::decodeRecordHeader):
1179         (WebKit::NetworkCache::decodeRecord):
1180         (WebKit::NetworkCache::encodeRecordMetaData):
1181         (WebKit::NetworkCache::encodeRecordHeader):
1182         (WebKit::NetworkCache::Storage::dispatchReadOperation):
1183         (WebKit::NetworkCache::retrieveFromMemory):
1184         (WebKit::NetworkCache::Storage::store):
1185         (WebKit::NetworkCache::Storage::update):
1186         (WebKit::NetworkCache::Storage::traverse):
1187         (WebKit::NetworkCache::Storage::dispatchPendingWriteOperations):
1188         (WebKit::NetworkCache::Storage::dispatchFullWriteOperation):
1189         (WebKit::NetworkCache::Storage::dispatchHeaderWriteOperation):
1190         (WebKit::NetworkCache::EntryMetaData::EntryMetaData): Deleted.
1191         (WebKit::NetworkCache::decodeEntryMetaData): Deleted.
1192         (WebKit::NetworkCache::decodeEntryHeader): Deleted.
1193         (WebKit::NetworkCache::decodeEntry): Deleted.
1194         (WebKit::NetworkCache::encodeEntryMetaData): Deleted.
1195         (WebKit::NetworkCache::encodeEntryHeader): Deleted.
1196         * NetworkProcess/cache/NetworkCacheStorage.h:
1197
1198 2015-03-26  Chris Dumez  <cdumez@apple.com>
1199
1200         [WK2] Let the compiler generate the NetworkCache::Key move constructor
1201         https://bugs.webkit.org/show_bug.cgi?id=143079
1202
1203         Reviewed by Antti Koivisto.
1204
1205         Let the compiler generate the NetworkCache::Key move constructor. The
1206         generated one will do exactly the same thing as the one we had except
1207         that it will move the m_hash member as well. I don't see any reason why
1208         we weren't moving this member before (it is an std::array<uint8_t, 16>).
1209
1210         Also have the compiler generate a move assignment operator for
1211         consistency. Although it is not currently useful, it could be at some
1212         point.
1213
1214         * NetworkProcess/cache/NetworkCacheKey.cpp:
1215         (WebKit::NetworkCache::Key::Key): Deleted.
1216         * NetworkProcess/cache/NetworkCacheKey.h:
1217
1218 2015-03-26  Chris Dumez  <cdumez@apple.com>
1219
1220         [WK2][NetworkCache] Compute if a cached response has expired only when actually needed
1221         https://bugs.webkit.org/show_bug.cgi?id=143070
1222
1223         Reviewed by Antti Koivisto.
1224
1225         Compute if a cached response has expired only when actually needed:
1226         - This is not a history navigation
1227         and
1228         - It does not have "Cache-Control: no-cache" header
1229
1230         Previously, we would always determine if the response has expired and
1231         we often end up not using this information.
1232
1233         * NetworkProcess/cache/NetworkCache.cpp:
1234         (WebKit::NetworkCache::responseHasExpired):
1235         (WebKit::NetworkCache::canUse):
1236
1237 2015-03-26  Zan Dobersek  <zdobersek@igalia.com>
1238
1239         Avoid the Vector<> copy in WebTouchEvent constructor
1240         https://bugs.webkit.org/show_bug.cgi?id=143043
1241
1242         Reviewed by Carlos Garcia Campos.
1243
1244         Have the WebTouchEvent accept a Vector<> rvalue.
1245         The relevant code is updated so the Vector<> object is moved
1246         through the call chain and finally into the WebTouchEvent constructor.
1247
1248         * Shared/NativeWebTouchEvent.h:
1249         * Shared/WebEvent.h:
1250         * Shared/WebTouchEvent.cpp:
1251         (WebKit::WebTouchEvent::WebTouchEvent):
1252         * Shared/efl/WebEventFactory.cpp:
1253         (WebKit::WebEventFactory::createWebTouchEvent):
1254         * Shared/gtk/NativeWebTouchEventGtk.cpp:
1255         (WebKit::NativeWebTouchEvent::NativeWebTouchEvent):
1256         * Shared/gtk/WebEventFactory.cpp:
1257         (WebKit::WebEventFactory::createWebTouchEvent):
1258         * Shared/gtk/WebEventFactory.h:
1259         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
1260         (webkitWebViewBaseTouchEvent):
1261
1262 2015-03-25  Chris Dumez  <cdumez@apple.com>
1263
1264         [WK2] WebFrameLoaderClient::dispatchDecidePolicyForResponse() should always call the FramePolicyFunction
1265         https://bugs.webkit.org/show_bug.cgi?id=143036
1266         <rdar://problem/20252438>
1267         <rdar://problem/13811738>
1268
1269         Reviewed by Alexey Proskuryakov.
1270
1271         WebFrameLoaderClient::dispatchDecidePolicyForResponse() should always
1272         call the FramePolicyFunction. Previously, it would fail to do in 2
1273         cases:
1274         - m_frame->page() returns null
1275         or
1276         - webPage->sendSync() returns false
1277
1278         If the FramePolicyFunction is not called, we will fail to clear the
1279         callback in the PolicyChecker and
1280         DocumentLoader::continueAfterContentPolicy() will not be called.
1281
1282         DocumentLoader::continueAfterContentPolicy() is in charge of resetting
1283         m_waitingForContentPolicy flag to false. This could therefore explain
1284         the following assertion being hit in DocumentLoader::detachFromFrame()
1285         (see <rdar://problem/20252438>):
1286         RELEASE_ASSERT(!m_waitingForContentPolicy)
1287
1288         Also, as the PolicyChecker callback is not cleared, it could make it
1289         possible for DocumentLoader::continueAfterContentPolicy() to be called
1290         *after* the load is finished, when later canceling the PolicyCallback:
1291         FrameLoader::stopAllLoaders()
1292          -> PolicyChecker::stopCheck()
1293           -> PolicyCallback::cancel()
1294            -> DocumentLoader::continueAfterContentPolicy(PolicyIgnore)
1295
1296         Calling continueAfterContentPolicy(PolicyIgnore) after the load is
1297         finished would be bad and could explain some of the crashes we've seen
1298         in DocumentLoader::continueAfterContentPolicy() ->
1299         DocumentLoader:: stopLoadingForPolicyChange() (see
1300         <rdar://problem/13811738>).
1301
1302         This patch also applies the same fix to
1303         dispatchDecidePolicyForNewWindowAction() and
1304         dispatchDecidePolicyForNavigationAction() as they use the same pattern.
1305
1306         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1307         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
1308         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction):
1309         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
1310
1311 2015-03-25  Tim Horton  <timothy_horton@apple.com>
1312
1313         Add a preference to prevent "user-scalable=no" from having any effect
1314         https://bugs.webkit.org/show_bug.cgi?id=143032
1315
1316         Reviewed by Sam Weinig.
1317
1318         * Shared/WebPreferencesDefinitions.h:
1319         * WebProcess/WebPage/WebPage.cpp:
1320         (WebKit::WebPage::updatePreferences):
1321         Add a preference and push it to the ViewportConfiguration.
1322
1323 2015-03-25  Beth Dakin  <bdakin@apple.com>
1324
1325         REGRESSION (r181660): Force click url preview doesn't have a TextIndicator in Mail
1326         https://bugs.webkit.org/show_bug.cgi?id=143064
1327         -and corresponding-
1328         rdar://problem/20251440
1329
1330         Reviewed by Tim Horton.
1331
1332         The TextIndicator was getting set to nil by the call to 
1333         _dismissContentRelativeChildWindows in mouseDown. That line of code was added by 
1334         http://trac.webkit.org/changeset/177242 to work around a bug in another component 
1335         that has now been resolved, so it no longer appears to be necessary. 
1336
1337         * UIProcess/API/mac/WKView.mm:
1338         (-[WKView mouseDown:]):
1339
1340 2015-03-25  Anders Carlsson  <andersca@apple.com>
1341
1342         Add network and application cache directories to WebsiteDataStore
1343         https://bugs.webkit.org/show_bug.cgi?id=143063
1344
1345         Reviewed by Sam Weinig.
1346
1347         Create a WebKit directory under ~/Library/Caches/<Bundle ID> for non-sandboxed applications,
1348         and ~/Library/Caches for sandboxed applications. Create NetworkCache and OfflineWebApplicationCache
1349         subdirectories. These directories will be used with the modern WebKit API.
1350
1351         * UIProcess/API/APIWebsiteDataStore.h:
1352         * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
1353         (API::WebsiteDataStore::cacheDirectoryFileSystemRepresentation):
1354         (API::WebsiteDataStore::defaultDataStoreConfiguration):
1355         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1356         (WebKit::WebsiteDataStore::WebsiteDataStore):
1357         * UIProcess/WebsiteData/WebsiteDataStore.h:
1358
1359 2015-03-25  Sam Weinig  <sam@webkit.org>
1360
1361         Address additional review feedback from https://bugs.webkit.org/show_bug.cgi?id=143059.
1362
1363         * Shared/WebCompiledContentExtension.cpp:
1364         (WebKit::WebCompiledContentExtension::createFromCompiledContentExtensionData):
1365         * UIProcess/API/C/WKUserContentFilterRef.cpp:
1366         (WKUserContentFilterCreate):
1367         * UIProcess/API/Cocoa/_WKUserContentFilter.mm:
1368         (-[_WKUserContentFilter initWithName:serializedRules:]):
1369
1370 2015-03-25  Sam Weinig  <sam@webkit.org>
1371
1372         [Content Extensions] Convert content extension compiling to return error codes and write its output using a client
1373         https://bugs.webkit.org/show_bug.cgi?id=143059
1374
1375         Reviewed by Alex Christensen.
1376
1377         * Shared/WebCompiledContentExtension.cpp:
1378         * Shared/WebCompiledContentExtension.h:
1379         (WebKit::LegacyContentExtensionCompilationClient::LegacyContentExtensionCompilationClient):
1380         (WebKit::LegacyContentExtensionCompilationClient::writeBytecode):
1381         (WebKit::LegacyContentExtensionCompilationClient::writeActions):
1382         Add subclass of ContentExtensionCompilationClient for use with the non-file backed content
1383         extensions.
1384
1385         * UIProcess/API/C/WKUserContentFilterRef.cpp:
1386         (WKUserContentFilterCreate):
1387         * UIProcess/API/Cocoa/_WKUserContentFilter.mm:
1388         (-[_WKUserContentFilter initWithName:serializedRules:]):
1389         Update to use the new interface of compileRuleList().
1390
1391 2015-03-25  Ryosuke Niwa  <rniwa@webkit.org>
1392
1393         Web Inspector: Switching tabs to window with inspector open prohibits typing into console
1394         https://bugs.webkit.org/show_bug.cgi?id=126800
1395
1396         Reviewed by Anders Carlsson.
1397
1398         This is a regression from r85356 and r83814. These two patches made WKWebView clear its selection
1399         when WKView resigns the first responder without ever restoring it even if WKView later becomes
1400         the first responder again. This is problematic when a text field or a editing host element had been
1401         focused and selected prior to the resignation since the editing code uses the selection to determine
1402         the editability of the element.
1403
1404         Fixed the bug by restoring selection in [WKView becomeFirstResponder] if the selection is empty.
1405
1406         * UIProcess/API/mac/WKView.mm:
1407         (-[WKView becomeFirstResponder]):
1408         * UIProcess/WebPageProxy.cpp:
1409         (WebKit::WebPageProxy::restoreSelectionInFocusedEditableElement):
1410         * UIProcess/WebPageProxy.h:
1411         * WebProcess/WebPage/WebPage.cpp:
1412         (WebKit::WebPage::restoreSelectionInFocusedEditableElement):
1413         * WebProcess/WebPage/WebPage.h:
1414         * WebProcess/WebPage/WebPage.messages.in:
1415
1416 2015-03-25  Beth Dakin  <bdakin@apple.com>
1417
1418         REGRESSION (r181660): Safari navigates to link after a starting and canceling a 
1419         force preview
1420         https://bugs.webkit.org/show_bug.cgi?id=143057
1421         -and corresponding-
1422         rdar://problem/20251436
1423
1424         Reviewed by Tim Horton.
1425
1426         Always call _page->immediateActionDidUpdate() so that the EventHandler’s 
1427         ImmediateActionStage is appropriately updated.
1428         * UIProcess/mac/WKImmediateActionController.mm:
1429         (-[WKImmediateActionController immediateActionRecognizerDidUpdateAnimation:]):
1430
1431         Update the EventHandler’s ImmediateActionStage.
1432         * WebProcess/WebPage/mac/WebPageMac.mm:
1433         (WebKit::WebPage::immediateActionDidUpdate):
1434
1435 2015-03-25  Antti Koivisto  <antti@apple.com>
1436
1437         Separate entry decoding from validation
1438         https://bugs.webkit.org/show_bug.cgi?id=143052
1439
1440         Reviewed by Chris Dumez.
1441
1442         Make NetworkCache::Cache a class and move it to a file of its own.
1443         Move the encoding/decoding code there.
1444
1445         * NetworkProcess/NetworkProcess.cpp:
1446         (WebKit::fetchDiskCacheEntries):
1447         (WebKit::clearDiskCacheEntries):
1448         * NetworkProcess/NetworkResourceLoader.cpp:
1449         (WebKit::sendReplyToSynchronousRequest):
1450         (WebKit::NetworkResourceLoader::start):
1451         (WebKit::NetworkResourceLoader::sendBufferMaybeAborting):
1452         (WebKit::NetworkResourceLoader::didRetrieveCacheEntry):
1453         (WebKit::NetworkResourceLoader::validateCacheEntry):
1454         * NetworkProcess/NetworkResourceLoader.h:
1455         * NetworkProcess/cache/NetworkCache.cpp:
1456         (WebKit::NetworkCache::collectVaryingRequestHeaders):
1457         (WebKit::NetworkCache::canUse):
1458
1459             Focused function for deciding if we can use a cache entry and if it needs validation.
1460
1461         (WebKit::NetworkCache::Cache::retrieve):
1462         (WebKit::NetworkCache::Cache::store):
1463         (WebKit::NetworkCache::Cache::update):
1464         (WebKit::NetworkCache::Cache::traverse):
1465         (WebKit::NetworkCache::encodeStorageEntry): Deleted.
1466         (WebKit::NetworkCache::decodeStorageEntry): Deleted.
1467         * NetworkProcess/cache/NetworkCache.h:
1468         * NetworkProcess/cache/NetworkCacheEntry.cpp: Added.
1469         (WebKit::NetworkCache::Entry::Entry):
1470         (WebKit::NetworkCache::Entry::encode):
1471         (WebKit::NetworkCache::Entry::decode):
1472         (WebKit::NetworkCache::Entry::initializeBufferFromStorageEntry):
1473         (WebKit::NetworkCache::Entry::buffer):
1474         (WebKit::NetworkCache::Entry::shareableResourceHandle):
1475         (WebKit::NetworkCache::Entry::needsValidation):
1476         (WebKit::NetworkCache::Entry::setNeedsValidation):
1477         * NetworkProcess/cache/NetworkCacheEntry.h: Added.
1478         (WebKit::NetworkCache::Entry::key):
1479         (WebKit::NetworkCache::Entry::timeStamp):
1480         (WebKit::NetworkCache::Entry::response):
1481         (WebKit::NetworkCache::Entry::varyingRequestHeaders):
1482         (WebKit::NetworkCache::Entry::sourceStorageEntry):
1483         * NetworkProcess/cache/NetworkCacheStatistics.h:
1484         * NetworkProcess/cache/NetworkCacheStatisticsCocoa.mm:
1485         (WebKit::NetworkCache::cachedEntryReuseFailureToDiagnosticKey):
1486         (WebKit::NetworkCache::Statistics::recordRetrievedCachedEntry):
1487         * WebKit2.xcodeproj/project.pbxproj:
1488
1489 2015-03-25  David Hyatt  <hyatt@apple.com>
1490
1491         Add a pref to enable the new block-inside-inline model
1492         https://bugs.webkit.org/show_bug.cgi?id=143050
1493
1494         Reviewed by Sam Weinig.
1495
1496         * Shared/WebPreferencesDefinitions.h:
1497         * UIProcess/API/C/WKPreferences.cpp:
1498         (WKPreferencesSetNewBlockInsideInlineModelEnabled):
1499         (WKPreferencesGetNewBlockInsideInlineModelEnabled):
1500         * UIProcess/API/C/WKPreferencesRefPrivate.h:
1501         * WebProcess/WebPage/WebPage.cpp:
1502         (WebKit::WebPage::updatePreferences):
1503
1504 2015-03-25  Zan Dobersek  <zdobersek@igalia.com>
1505
1506         [WK2] WebUserMediaClient::pageDestroyed() virtual method should be marked as override
1507         https://bugs.webkit.org/show_bug.cgi?id=143046
1508
1509         Reviewed by Carlos Garcia Campos.
1510
1511         * WebProcess/WebCoreSupport/WebUserMediaClient.h: Mark the WebUserMediaClient::pageDestroyed()
1512         method, inherited from the WebCore::UserMediaClient, as an override.
1513
1514 2015-03-25  Zan Dobersek  <zdobersek@igalia.com>
1515
1516         [GTK][WK2] WebPageProxy::failedToShowPopupMenu() virtual method should be marked as override
1517         https://bugs.webkit.org/show_bug.cgi?id=143045
1518
1519         Reviewed by Carlos Garcia Campos.
1520
1521         * UIProcess/WebPageProxy.h: Mark the failedToShowPopupMenu(), inherited from
1522         the WebPopupMenuProxy::Client class, as overridden.
1523
1524 2015-03-25  Zan Dobersek  <zdobersek@igalia.com>
1525
1526         [WK2] Clean up DrawingAreaImpl vtable overrides
1527         https://bugs.webkit.org/show_bug.cgi?id=143044
1528
1529         Reviewed by Carlos Garcia Campos.
1530
1531         Declare virtual methods of the DrawingAreaImpl class as overridden where necessary.
1532
1533         * WebProcess/WebPage/DrawingAreaImpl.h:
1534         (WebKit::DrawingAreaImpl::layerTreeStateIsFrozen): Deleted.
1535         (WebKit::DrawingAreaImpl::layerTreeHost): Deleted.
1536
1537 2015-03-24  Ryosuke Niwa  <rniwa@webkit.org>
1538
1539         Inspector doesn't get focused when opened in dock mode
1540         https://bugs.webkit.org/show_bug.cgi?id=143030
1541
1542         Reviewed by Anders Carlsson.
1543
1544         The bug was caused by platformBringToFront and platformAttach calling makeFirstResponder on WKWebView,
1545         which aren't intended to become the first responder. Fixed the bug by calling makeFirstResponder on the WKView
1546         subview of the WKWebView, which is intended to be used as the first responder on behalf of the web view.
1547
1548         * UIProcess/mac/WebInspectorProxyMac.mm:
1549         (WebKit::WebInspectorProxy::platformBringToFront):
1550         (WebKit::WebInspectorProxy::platformAttach):
1551
1552 2015-03-24  Chris Dumez  <cdumez@apple.com>
1553
1554         [WK2] Responses with 302 HTTP Status Code should not be cached
1555         https://bugs.webkit.org/show_bug.cgi?id=143028
1556         <rdar://problem/19714040>
1557
1558         Reviewed by Antti Koivisto.
1559
1560         Responses with 302 HTTP Status Code should not be cached as per
1561         RFC 7231:
1562         http://tools.ietf.org/html/rfc7231#section-6.1
1563
1564         This patch updates our disk cache policy accordingly.
1565
1566         Test: http/tests/cache/disk-cache/disk-cache-302-status-code.html
1567
1568         * NetworkProcess/cache/NetworkCache.cpp:
1569         (WebKit::NetworkCache::canStore):
1570
1571 2015-03-24  Anders Carlsson  <andersca@apple.com>
1572
1573         Fix crash in WebKit::RemoteObjectRegistry::sendInvocation
1574         https://bugs.webkit.org/show_bug.cgi?id=143027
1575         rdar://problem/20208674
1576
1577         Reviewed by Sam Weinig.
1578
1579         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
1580         (-[WKWebProcessPlugInBrowserContextController dealloc]):
1581         Make sure to invalidate the _WKRemoteObjectRegistry like we do in the UI process.
1582
1583 2015-03-24  Chris Dumez  <cdumez@apple.com>
1584
1585         [WK2] Responses with 204 HTTP Status Code should be cacheable by default
1586         https://bugs.webkit.org/show_bug.cgi?id=143020
1587         <rdar://problem/20281529>
1588
1589         Reviewed by Antti Koivisto.
1590
1591         Make responses with 204 HTTP Status Code cacheable by default, as
1592         per RFC 7231:
1593         http://tools.ietf.org/html/rfc7231#section-6.3.5
1594
1595         Test: http/tests/cache/disk-cache/disk-cache-204-status-code.html
1596
1597         * NetworkProcess/cache/NetworkCache.cpp:
1598         (WebKit::NetworkCache::canStore):
1599
1600 2015-03-24  Enrica Casucci  <enrica@apple.com>
1601
1602         [iOS] Remove unused keyboard code in WKSelectPopover class.
1603         https://bugs.webkit.org/show_bug.cgi?id=143021
1604
1605         Reviewed by Joseph Pecoraro.
1606
1607         WKSelectPopover created an instance of UIKeyboard that was
1608         initialized in initWithView but never used. Removing the
1609         obsolete code.
1610
1611         * UIProcess/ios/forms/WKFormSelectPopover.mm:
1612         (-[WKSelectPopover initWithView:hasGroups:]):
1613
1614 2015-03-24  Dan Bernstein  <mitz@apple.com>
1615
1616         WebKit2 part of <rdar://problem/20282863> Transforms are flattened in snapshots of on-screen WKWebViews
1617         https://bugs.webkit.org/show_bug.cgi?id=143023
1618
1619         Reviewed by Tim Horton.
1620
1621         * UIProcess/API/Cocoa/WKWebView.mm:
1622         (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]): If the view is in a
1623         window, use CARenderServerRenderLayerWithTransform to synchronously capture a snapshot of
1624         its layer tree into an IOSurfcae, then call the completion handler with an image created
1625         from the IOSurface.
1626
1627 2015-03-24  Beth Dakin  <bdakin@apple.com>
1628
1629         Add events related to force click gesture
1630         https://bugs.webkit.org/show_bug.cgi?id=142836
1631         -and corresponding-
1632         rdar://problem/20210239
1633
1634         Reviewed by Dean Jackson.
1635
1636         ActionMenuHitTestResult has a new bool indicating whether to not the HitTestResult 
1637         will prevent default. 
1638         * Shared/mac/ActionMenuHitTestResult.h:
1639         * Shared/mac/ActionMenuHitTestResult.mm:
1640         (WebKit::ActionMenuHitTestResult::encode):
1641         (WebKit::ActionMenuHitTestResult::decode):
1642
1643         Send immediateActionDidUpdate and the normalized force over the the WebProcess.
1644         * UIProcess/WebPageProxy.cpp:
1645         (WebKit::WebPageProxy::immediateActionDidUpdate):
1646         * UIProcess/WebPageProxy.h:
1647
1648         We need a dummy animation controller when web content is overriding the default 
1649         behavior.
1650         * UIProcess/mac/WKImmediateActionController.mm:
1651
1652         Send along the update information.
1653         (-[WKImmediateActionController immediateActionRecognizerDidUpdateAnimation:]):
1654
1655         Use the dummy animation controller if default has been prevented.
1656         (-[WKImmediateActionController _defaultAnimationController]):
1657         (-[WKImmediateActionController _updateImmediateActionItem]):
1658
1659         Keep track of whether m_lastActionMenuHitTes prevented the default immediate 
1660         action behavior.
1661         * WebProcess/WebPage/WebPage.cpp:
1662         (WebKit::WebPage::WebPage):
1663         * WebProcess/WebPage/WebPage.h:
1664         * WebProcess/WebPage/WebPage.messages.in:
1665
1666         Call dispatchMouseForceMayBegin() at hit test time.
1667         * WebProcess/WebPage/mac/WebPageMac.mm:
1668         (WebKit::WebPage::performActionMenuHitTestAtLocation):
1669
1670         Call dispatchMouseForceChanged() if appropriate.
1671         (WebKit::WebPage::immediateActionDidUpdate):
1672
1673         Call dispatchMouseForceCancelled() if appropriate.
1674         (WebKit::WebPage::immediateActionDidCancel):
1675
1676         Call dispatchMouseForceDown() if appropriate.
1677         (WebKit::WebPage::immediateActionDidComplete):
1678
1679 2015-03-24  Anders Carlsson  <andersca@apple.com>
1680
1681         Fix designated initializer violations
1682         https://bugs.webkit.org/show_bug.cgi?id=143016
1683         rdar://problem/20268858
1684
1685         Reviewed by Dan Bernstein.
1686
1687         Move -[WKProcessPool _initWithConfiguration:] to a class extension so we can make it the designated initializer.
1688
1689         * UIProcess/API/Cocoa/WKProcessPool.mm:
1690         (-[WKProcessPool _initWithConfiguration:]):
1691         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
1692
1693 2015-03-24  Chris Dumez  <cdumez@apple.com>
1694
1695         [WK2] Responses with 404 HTTP Status Code should be cacheable by default
1696         https://bugs.webkit.org/show_bug.cgi?id=143014
1697         <rdar://problem/20280310>
1698
1699         Reviewed by Antti Koivisto.
1700
1701         Make responses with 404 HTTP Status Code cacheable by default, as
1702         per RFC 7231:
1703         http://tools.ietf.org/html/rfc7231#section-6.5.4
1704
1705         Test: http/tests/cache/disk-cache/disk-cache-404-status-code.html
1706
1707         * NetworkProcess/cache/NetworkCache.cpp:
1708         (WebKit::NetworkCache::canStore):
1709
1710 2015-03-24  Chris Dumez  <cdumez@apple.com>
1711
1712         [WK2] Remove NetworkCache FIXME comment about caching responses to OPTIONS requests
1713         https://bugs.webkit.org/show_bug.cgi?id=143009
1714
1715         Reviewed by Andreas Kling.
1716
1717         Remove NetworkCache FIXME comment about caching responses to OPTIONS
1718         method as RFC 7234 says "Responses to the OPTIONS method are not
1719         cacheable" [1].
1720
1721         [1] http://tools.ietf.org/html/rfc7231#page-31
1722
1723         * NetworkProcess/cache/NetworkCache.cpp:
1724         (WebKit::NetworkCache::canRetrieve):
1725
1726 2015-03-24  Chris Dumez  <cdumez@apple.com>
1727
1728         [WK2] NetworkCache retrievals fail for entries with no body
1729         https://bugs.webkit.org/show_bug.cgi?id=142979
1730         <rdar://problem/20264100>
1731
1732         Reviewed by Antti Koivisto.
1733
1734         NetworkCache retrievals were failing for entries with no body because
1735         decodeEntry() doesn't correctly handle this case. In particular, the
1736         following check fails:
1737         "metaData.bodyOffset + metaData.bodySize == fileData.size()".
1738         This is because bodyOffset is pageSize-aligned.
1739
1740         As a result, the following resource on apple.com is stored in the cache
1741         but we fail to reuse it and reload it from the network every time:
1742         http://images.apple.com/home/styles/promos.css
1743
1744         This patch updates decodeEntry() to create a null Data object for the
1745         body if bodySize is 0.
1746
1747         * NetworkProcess/cache/NetworkCacheDataCocoa.mm:
1748         (WebKit::NetworkCache::Data::data):
1749         Do not attempt to initialize m_data if m_dispatchData is null as the
1750         call to dispatch_data_create_map() would then crash. We now return
1751         null in this case. This is needed as decodeStorageEntry() in
1752         NetworkCache.cpp constructs a SharedBuffer from
1753         storageEntry.body.data() and the body may be null.
1754
1755         * NetworkProcess/cache/NetworkCacheStorage.cpp:
1756         (WebKit::NetworkCache::decodeEntry):
1757
1758 2015-03-24  Chris Dumez  <cdumez@apple.com>
1759
1760         [WK2] The WebKit network cache does not cache responses with "Content-Disposition: attachment" header
1761         https://bugs.webkit.org/show_bug.cgi?id=142989
1762         <rdar://problem/20265992>
1763
1764         Reviewed by Antti Koivisto.
1765
1766         Update our WebKit network cache policy to cache responses with
1767         "Content-Disposition: attachment" header. There is no reason we cannot
1768         cache these and our memory cache already does.
1769
1770         This was causing a decent amount of cache misses in the wild. I have
1771         noticed for example that when loading disney.com, we fail to cache the
1772         following resources because of this policy:
1773         http://pagead2.googlesyndication.com/pagead/osd.js
1774         http://pagead2.googlesyndication.com/pagead/show_companion_ad.js
1775
1776         Those resources have Cache-Control headers that indicate they are meant
1777         to be cacheable.
1778
1779         Test: http/tests/cache/disk-cache-validation-attachment.html
1780
1781         * NetworkProcess/cache/NetworkCache.cpp:
1782         (WebKit::NetworkCache::canStore):
1783
1784 2015-03-23  Joseph Pecoraro  <pecoraro@apple.com>
1785
1786         Unreviewed, another attempt to fix 32-bit build after r181881.
1787
1788         * UIProcess/WebInspectorProxy.h:
1789
1790 2015-03-23  Joseph Pecoraro  <pecoraro@apple.com>
1791
1792         Unreviewed, attempt to fix 32-bit build after r181881.
1793
1794         * UIProcess/API/Cocoa/WKViewPrivate.h:
1795         * UIProcess/API/mac/WKView.mm:
1796
1797 2015-03-19  Timothy Hatcher  <timothy@apple.com>
1798
1799         Web Inspector: Support attaching to another view other than the WKView
1800         https://bugs.webkit.org/show_bug.cgi?id=142892
1801
1802         Reviewed by Tim Horton.
1803
1804         * UIProcess/API/C/WKInspector.cpp:
1805         (WKInspectorAttach): Drive by fix so it used the last attachment side.
1806
1807         * UIProcess/API/Cocoa/WKViewPrivate.h:
1808         * UIProcess/API/mac/WKView.mm:
1809         (-[WKView _inspectorAttachmentView]): Added.
1810         (-[WKView _setInspectorAttachmentView:]): Added.
1811
1812         * UIProcess/WebInspectorProxy.cpp:
1813         (WebKit::WebInspectorProxy::createInspectorPage):
1814         (WebKit::WebInspectorProxy::attachAvailabilityChanged):
1815         Use platformCanAttach as a final check incase there is a different
1816         attachment view that the platform knows about.
1817
1818         * UIProcess/WebInspectorProxy.h:
1819         (WebKit::WebInspectorProxy::attachmentSide): Added.
1820         (WebKit::WebInspectorProxy::platformCanAttach): Added.
1821
1822         * UIProcess/mac/WebInspectorProxyMac.mm:
1823         (WebKit::WebInspectorProxy::attachmentViewDidChange): Added.
1824         (WebKit::WebInspectorProxy::closeTimerFired):
1825         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
1826         (WebKit::WebInspectorProxy::platformCanAttach):
1827         (WebKit::WebInspectorProxy::inspectedViewFrameDidChange):
1828         (WebKit::WebInspectorProxy::platformInspectedWindowHeight):
1829         (WebKit::WebInspectorProxy::platformInspectedWindowWidth):
1830         (WebKit::WebInspectorProxy::platformAttach):
1831         (WebKit::WebInspectorProxy::platformDetach):
1832         Use the _inspectorAttachmentView and change how the frame change notification
1833         is observed and follow the attachment view as it changes.
1834
1835 2015-03-23  Tim Horton  <timothy_horton@apple.com>
1836
1837         Images shared to photos via action menu are padded with zeroes at the end
1838         https://bugs.webkit.org/show_bug.cgi?id=142985
1839
1840         Reviewed by Anders Carlsson.
1841
1842         * Shared/mac/ActionMenuHitTestResult.h:
1843         * Shared/mac/ActionMenuHitTestResult.mm:
1844         (WebKit::ActionMenuHitTestResult::encode):
1845         (WebKit::ActionMenuHitTestResult::decode):
1846         * WebProcess/WebPage/mac/WebPageMac.mm:
1847         (WebKit::WebPage::performActionMenuHitTestAtLocation):
1848         Send the size of the image separately from the SharedMemory.
1849         The SharedMemory's size can be rounded up, so we need to keep the original
1850         size around in order to write the data to disk.
1851
1852         * UIProcess/mac/WKActionMenuController.mm:
1853         (-[WKActionMenuController _hitTestResultImage]):
1854         (-[WKActionMenuController _addImageToPhotos:]):
1855         Use the image size instead of the SharedMemory size.
1856
1857 2015-03-23  Enrica Casucci  <enrica@apple.com>
1858
1859         [iOS] WebContent crash attempting to select text with a gesture at RenderObject::absoluteBoundingBoxRect.
1860         https://bugs.webkit.org/show_bug.cgi?id=142913
1861         rdar://problem/16400033
1862
1863         Reviewed by Sam Weinig.
1864
1865         When looking for the best candidate range at the given position,
1866         we should skip nodes that don't have a renderer.
1867         This is a speculative fix.
1868
1869         * WebProcess/WebPage/ios/WebPageIOS.mm:
1870         (WebKit::WebPage::rangeForWebSelectionAtPosition):
1871
1872 2015-03-23  Alexey Proskuryakov  <ap@apple.com>
1873
1874         REGRESSION (Yosemite): WKView visibility notifications are messed up
1875         https://bugs.webkit.org/show_bug.cgi?id=142945
1876
1877         Reviewed by Tim Horton.
1878
1879         As these notifications cannot be used by NSView subclasses, create a separate
1880         object for observing them.
1881
1882         * UIProcess/API/mac/WKView.mm:
1883         (-[WKWindowVisibilityObserver initWithView:]):
1884         (-[WKWindowVisibilityObserver startObserving:]):
1885         (-[WKWindowVisibilityObserver stopObserving:]):
1886         (-[WKWindowVisibilityObserver _windowDidOrderOnScreen:]):
1887         (-[WKWindowVisibilityObserver _windowDidOrderOffScreen:]):
1888         (-[WKView addWindowObserversForWindow:]):
1889         (-[WKView removeWindowObservers]): Also, don't try to remove NSWindowWillOrderOffScreenNotification,
1890         which we never start to observe.
1891         (-[WKView initWithFrame:processPool:configuration:webView:]):
1892         * UIProcess/API/mac/WKViewInternal.h:
1893
1894 2015-03-23  Anders Carlsson  <andersca@apple.com>
1895
1896         Make platform/mac-wk2/plugins/destroy-during-async-npp-new.html work again.
1897         https://bugs.webkit.org/show_bug.cgi?id=133692
1898         rdar://problem/17255947
1899
1900         Reviewed by Alexey Proskuryakov.
1901
1902         Add plug-in destruction protectors around message receiver code that can call out to NPObjects or JavaScript
1903         where we need the plug-in to stay around after the call.
1904
1905         * Shared/Plugins/NPObjectMessageReceiver.cpp:
1906         (WebKit::NPObjectMessageReceiver::invoke):
1907         (WebKit::NPObjectMessageReceiver::invokeDefault):
1908         (WebKit::NPObjectMessageReceiver::getProperty):
1909         (WebKit::NPObjectMessageReceiver::setProperty):
1910         (WebKit::NPObjectMessageReceiver::construct):
1911
1912 2015-03-23  Anders Carlsson  <andersca@apple.com>
1913
1914         Put the WK_NULLABLE_SPECIFIER in the right place for block parameters
1915         https://bugs.webkit.org/show_bug.cgi?id=142975
1916         rdar://problem/19863930
1917
1918         Reviewed by Dan Bernstein.
1919
1920         * UIProcess/API/Cocoa/WKNavigationDelegate.h:
1921         * UIProcess/API/Cocoa/WKUIDelegate.h:
1922         * UIProcess/API/Cocoa/WKWebView.h:
1923
1924 2015-03-23  Tim Horton  <timothy_horton@apple.com>
1925
1926         Add a share item to the link action menu
1927         https://bugs.webkit.org/show_bug.cgi?id=142961
1928         <rdar://problem/19198374>
1929
1930         Reviewed by Beth Dakin.
1931
1932         * UIProcess/mac/WKActionMenuController.mm:
1933         (-[WKActionMenuController _hitLinkURL]):
1934         Factor out _hitLinkURL from various places.
1935
1936         (-[WKActionMenuController _openURLFromActionMenu:]):
1937         (-[WKActionMenuController _addToReadingListFromActionMenu:]):
1938         (-[WKActionMenuController _defaultMenuItemsForVideo]):
1939         (-[WKActionMenuController _defaultMenuItemsForImage]):
1940         (-[WKActionMenuController _createActionMenuItemForTag:]):
1941         (-[WKActionMenuController _createShareActionMenuItemForTag:withItems:]):
1942         Adopt -[NSMenuItem standardShareMenuItemWithItems].
1943         All of the null-checking is unnecessary as it's impossible to enter
1944         these functions with a null image/etc.
1945
1946         (-[WKActionMenuController _defaultMenuItemsForLink]):
1947         * Shared/API/c/WKActionMenuItemTypes.h:
1948         Add a 'Share' item to the link menu.
1949
1950 2015-03-23  Zan Dobersek  <zdobersek@igalia.com>
1951
1952         [GTK] Use std::abs() in ClickCounter::currentClickCountForGdkButtonEvent()
1953         https://bugs.webkit.org/show_bug.cgi?id=142964
1954
1955         Reviewed by Carlos Garcia Campos.
1956
1957         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
1958         (ClickCounter::currentClickCountForGdkButtonEvent): Use the STL's std::abs()
1959         instead of C's abs(). The templated nature of std::abs() ensures the proper
1960         computation that matches the types of the passed-in values, and shuts down
1961         a warning when compiling with Clang.
1962
1963 2015-03-23  Zan Dobersek  <zdobersek@igalia.com>
1964
1965         [GTK][WK2] webkitBackForwardListChanged() should operate on a Vector reference
1966         https://bugs.webkit.org/show_bug.cgi?id=142963
1967
1968         Reviewed by Carlos Garcia Campos.
1969
1970         * UIProcess/API/gtk/WebKitBackForwardList.cpp:
1971         (webkitBackForwardListChanged): This function only reads from the passed-in
1972         Vector of removed items, so only a const lvalue reference to the Vector
1973         is needed.
1974         * UIProcess/API/gtk/WebKitBackForwardListPrivate.h:
1975
1976 2015-03-23  Carlos Garcia Campos  <cgarcia@igalia.com>
1977
1978         [GTK] Add a configure option to build without Redirected XComposite Window
1979         https://bugs.webkit.org/show_bug.cgi?id=142865
1980
1981         Reviewed by Žan Doberšek.
1982
1983         Use USE(REDIRECTED_XCOMPOSITE_WINDOW) instead of
1984         USE(TEXTURE_MAPPER_GL) && PLATFORM(X11).
1985
1986         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
1987         (webkitWebViewBaseRealize): Use the XID of the WebKitWebView
1988         window as native surface handle when REDIRECTED_XCOMPOSITE_WINDOW
1989         is disabled.
1990         (webkitWebViewRenderAcceleratedCompositingResults):
1991         (resizeWebKitWebViewBaseFromAllocation):
1992         (webkitWebViewBaseEnterAcceleratedCompositingMode):
1993         (webkitWebViewBaseExitAcceleratedCompositingMode):
1994         * UIProcess/gtk/RedirectedXCompositeWindow.cpp:
1995         * UIProcess/gtk/RedirectedXCompositeWindow.h:
1996
1997 2015-03-22  Eric Carlson  <eric.carlson@apple.com>
1998
1999         [Mac] Enable WIRELESS_PLAYBACK_TARGET for WK1
2000         https://bugs.webkit.org/show_bug.cgi?id=142940
2001
2002         Reviewed by Sam Weinig.
2003
2004         * WebProcess/WebPage/mac/WebPageMac.mm:
2005         (WebKit::WebPage::playbackTargetSelected): Argument to didChoosePlaybackTarget is now const.
2006
2007 2015-03-22  Anders Carlsson  <andersca@apple.com>
2008
2009         _WKWebsiteDataStore should clear WebSQL databases
2010         https://bugs.webkit.org/show_bug.cgi?id=142947
2011         rdar://problem/20242174
2012
2013         Reviewed by Sam Weinig.
2014
2015         * Shared/WebsiteData/WebsiteDataTypes.h:
2016         Add WebsiteDataTypeWebSQLDatabases.
2017
2018         * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
2019         (API::WebsiteDataStore::defaultDataStoreConfiguration):
2020         Initialize configuration.webSQLDatabaseDirectory.
2021
2022         * UIProcess/API/Cocoa/_WKWebsiteDataRecord.h:
2023         Add WKWebsiteDataTypeWebSQLDatabases.
2024
2025         * UIProcess/API/Cocoa/_WKWebsiteDataRecord.mm:
2026         (dataTypesToString):
2027         Handle WKWebsiteDataTypeWebSQLDatabases.
2028
2029         * UIProcess/API/Cocoa/_WKWebsiteDataRecordInternal.h:
2030         (WebKit::toWebsiteDataTypes):
2031         (WebKit::toWKWebsiteDataTypes):
2032         Handle WKWebsiteDataTypeWebSQLDatabases and WebsiteDataTypes::WebsiteDataTypeWebSQLDatabases.
2033
2034         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2035         (WebKit::WebsiteDataStore::WebsiteDataStore):
2036         Initialize m_webSQLDatabaseDirectory and add a queue member variable.
2037
2038         (WebKit::WebsiteDataStore::fetchData):
2039         Fetch database origins.
2040     
2041         (WebKit::WebsiteDataStore::removeData):
2042         Remove databases.
2043
2044         * UIProcess/WebsiteData/WebsiteDataStore.h:
2045         Add new members.
2046
2047 2015-03-22  Dan Bernstein  <mitz@apple.com>
2048
2049         [iOS] Expose WebPageProxy::setInitialFocus as SPI
2050         https://bugs.webkit.org/show_bug.cgi?id=142951
2051
2052         Reviewed by Anders Carlsson.
2053
2054         * UIProcess/API/Cocoa/WKWebView.mm:
2055         (-[WKWebView _becomeFirstResponderWithSelectionMovingForward:completionHandler:]): New SPI.
2056         Just calls through to WKWebContentView, but allows a nil completion handler.
2057         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2058
2059         * UIProcess/API/mac/WKView.mm:
2060         (-[WKView becomeFirstResponder]): Pass an empty lambda for the new callback parameter to
2061         WebPageProxy::setInitialFocus.
2062
2063         * UIProcess/WebPageProxy.cpp:
2064         (WebKit::WebPageProxy::setInitialFocus): Added a void callback parameter and made sure to
2065         call it.
2066         * UIProcess/WebPageProxy.h:
2067
2068         * UIProcess/ios/WKContentViewInteraction.h:
2069         * UIProcess/ios/WKContentViewInteraction.mm:
2070         (-[WKContentView _becomeFirstResponderWithSelectionMovingForward:completionHandler:]):
2071         Added. Calls WebPageProxy::setInitialFocus, and once that completes, checks if anything was
2072         focused and if so, becomes first responder, then calls the completion handler.
2073
2074         * WebProcess/WebPage/WebPage.cpp:
2075         (WebKit::WebPage::setInitialFocus): Added a callbackID parameter, and made sure to send the
2076         callback message. Added a temporary change of m_userIsInteracting to true, so that the UI
2077         process won’t ignore any StartAssistingNode message resulting from the focus change.
2078         * WebProcess/WebPage/WebPage.h:
2079
2080         * WebProcess/WebPage/WebPage.messages.in: Added a callbackID parameter to SetInitialFocus.
2081
2082 2015-03-21  Dean Jackson  <dino@apple.com>
2083
2084         Remove the prefix for CSS Transforms
2085         https://bugs.webkit.org/show_bug.cgi?id=142927
2086         <rdar://problem/11568151>
2087
2088         Reviewed by Simon Fraser.
2089
2090         Rename AnimatedPropertyWebkitTransform to AnimatedPropertyTransform.
2091
2092         * Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp:
2093         (IPC::ArgumentCoder<TextureMapperAnimation>::encode):
2094
2095 2015-03-21  Csaba Osztrogonác  <ossy@webkit.org>
2096
2097         [EFL][GTK] Make WebKit2's generate-forwarding-headers.pl less verbose
2098         https://bugs.webkit.org/show_bug.cgi?id=142908
2099
2100         Reviewed by Žan Doberšek.
2101
2102         * Scripts/generate-forwarding-headers.pl:
2103         (createForwardingHeadersForFramework):
2104
2105 2015-03-21  Commit Queue  <commit-queue@webkit.org>
2106
2107         Unreviewed, rolling out r181824.
2108         https://bugs.webkit.org/show_bug.cgi?id=142935
2109
2110         Broke Windows build (Requested by ap on #webkit).
2111
2112         Reverted changeset:
2113
2114         "Remove the prefix for CSS Transforms"
2115         https://bugs.webkit.org/show_bug.cgi?id=142927
2116         http://trac.webkit.org/changeset/181824
2117
2118 2015-03-20  Dean Jackson  <dino@apple.com>
2119
2120         Remove the prefix for CSS Transforms
2121         https://bugs.webkit.org/show_bug.cgi?id=142927
2122         <rdar://problem/11568151>
2123
2124         Reviewed by Simon Fraser.
2125
2126         Rename AnimatedPropertyWebkitTransform to AnimatedPropertyTransform.
2127
2128         * Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp:
2129         (IPC::ArgumentCoder<TextureMapperAnimation>::encode):
2130
2131 2015-03-20  Chris Dumez  <cdumez@apple.com>
2132
2133         [WK2] NetworkCache retrievals sometimes fail on browser startup
2134         https://bugs.webkit.org/show_bug.cgi?id=142925
2135         <rdar://problem/20245368>
2136
2137         Reviewed by Antti Koivisto.
2138
2139         NetworkCache retrievals sometimes fail on browser startup for resources
2140         that are actually cached. The reason is that we are using a bloom filter
2141         for performance reasons to avoid unnecessary disk I/O and this bloom
2142         filter is populated on start up in a background thread by traversing the
2143         cache files on disk. However, when restoring the tabs on start-up we
2144         sometimes query this bloom filter before it is completely populated and
2145         we thus fail to retrieve cached entries because we think they don't
2146         exist and don't check the disk.
2147
2148         This patch adds an "isPopulatingContentsFilter" flag that is turned ON
2149         on start up while we are populating the bloon filter. We then bypass
2150         the bloom filter and send queries directly to disk on start up if this
2151         flag is ON.
2152
2153         * NetworkProcess/cache/NetworkCacheStorage.cpp:
2154         (WebKit::NetworkCache::Storage::initialize):
2155         (WebKit::NetworkCache::Storage::retrieve):
2156         (WebKit::NetworkCache::Storage::dispatchPendingWriteOperations):
2157         (WebKit::NetworkCache::Storage::dispatchHeaderWriteOperation):
2158         * NetworkProcess/cache/NetworkCacheStorage.h:
2159         (WebKit::NetworkCache::Storage::cacheMayContain):
2160
2161 2015-03-20  Chris Dumez  <cdumez@apple.com>
2162
2163         [WK2] Allow stale content when restoring the browser's session state
2164         https://bugs.webkit.org/show_bug.cgi?id=142916
2165         <rdar://problem/20243493>
2166
2167         Reviewed by Darin Adler.
2168
2169         Allow stale content when restoring the browser's session state
2170         (restoring all tabs from previous session), e.g.
2171         - Via History > Reopen All windows from previous session on Safari
2172         - Happens on startup for MobileSafari
2173
2174         I have verified that using "Open in tabs" on a bookmarks folder
2175         still does fresh loads (rdar://problem/8131355) as it is not using
2176         the restoreFromSessionState() code path.
2177
2178         * UIProcess/WebPageProxy.cpp:
2179         (WebKit::WebPageProxy::reattachToWebProcessForReload):
2180         (WebKit::WebPageProxy::reattachToWebProcessWithItem):
2181         (WebKit::WebPageProxy::goForward):
2182         (WebKit::WebPageProxy::goBack):
2183         (WebKit::WebPageProxy::goToBackForwardItem):
2184         (WebKit::WebPageProxy::restoreFromSessionState):
2185         * UIProcess/WebPageProxy.h:
2186         * WebProcess/WebPage/WebPage.cpp:
2187         (WebKit::WebPage::goToBackForwardItem):
2188         * WebProcess/WebPage/WebPage.h:
2189         * WebProcess/WebPage/WebPage.messages.in:
2190
2191 2015-03-20  Beth Dakin  <bdakin@apple.com>
2192
2193         [Immediate Actions] Should re-enable immediate actions for iBooks
2194         https://bugs.webkit.org/show_bug.cgi?id=142915
2195         -and corresponding-
2196         rdar://problem/19585689
2197
2198         Reviewed by Tim Horton.
2199
2200         * UIProcess/API/mac/WKView.mm:
2201         (-[WKView initWithFrame:processPool:configuration:webView:]):
2202
2203 2015-03-20  Alex Christensen  <achristensen@webkit.org>
2204
2205         Progress towards CMake on Mac.
2206         https://bugs.webkit.org/show_bug.cgi?id=136003
2207
2208         Reviewed by Chris Dumez.
2209
2210         * PlatformMac.cmake:
2211         Add include directories and forwarding headers.
2212         * Shared/API/APIObject.h:
2213         (API::ObjectImpl::operator new):
2214         * UIProcess/DrawingAreaProxy.h:
2215         (WebKit::DrawingAreaProxy::intrinsicContentSizeDidChange):
2216         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h:
2217         Fix some unused parameter warnings.
2218
2219 2015-03-20  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
2220
2221         [CMake] Remove duplicated cmake function calls in WebKit2/CMakeLists.txt
2222         https://bugs.webkit.org/show_bug.cgi?id=142901
2223
2224         Reviewed by Csaba Osztrogonác.
2225
2226         add_depencencies(), install() can support multiple targets or location.
2227         We don't need to call it twice.
2228
2229         * CMakeLists.txt: Additionaly move -DBUILDING_WEBKIT to PlatformGTK.cmake,
2230         because it is only used by GTK port.
2231
2232 2015-03-20  Zan Dobersek  <zdobersek@igalia.com>
2233
2234         [GTK] Disable accelerated compositing on Wayland
2235         https://bugs.webkit.org/show_bug.cgi?id=142877
2236
2237         Reviewed by Carlos Garcia Campos.
2238
2239         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
2240         (webkitWebViewBaseCreateWebPage): As was done in the past, we should disable
2241         accelerated compositing on Wayland until the proper support for it lands.
2242
2243 2015-03-19  Andy Estes  <aestes@apple.com>
2244
2245         [Content Filtering] Add tests for unblock requests
2246         https://bugs.webkit.org/show_bug.cgi?id=142900
2247
2248         Reviewed by Andreas Kling.
2249
2250         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
2251         (WebKit::WebPageProxy::contentFilterDidBlockLoadForFrame): Called WebFrameProxy::contentFilterDidBlockLoad.
2252         * UIProcess/WebFrameProxy.cpp:
2253         (WebKit::WebFrameProxy::didStartProvisionalLoad): Assigned a default-constructed ContentFilterUnblockHandler instead of calling clear().
2254         (WebKit::WebFrameProxy::didHandleContentFilterUnblockNavigation): Renamed from contentFilterDidHandleNavigationAction.
2255         Updated to use ContentFilterUnblockHandler's new API.
2256         (WebKit::WebFrameProxy::contentFilterDidHandleNavigationAction): Deleted.
2257         * UIProcess/WebFrameProxy.h:
2258         (WebKit::WebFrameProxy::contentFilterDidBlockLoad): Renamed from setContentFilterUnblockHandler.
2259         (WebKit::WebFrameProxy::setContentFilterUnblockHandler): Deleted.
2260         * UIProcess/WebPageProxy.cpp:
2261         (WebKit::WebPageProxy::decidePolicyForNavigationAction): Called WebFrameProxy::didHandleContentFilterUnblockNavigation.
2262         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2263         (WebKit::WebFrameLoaderClient::contentFilterDidBlockLoad): If the unblock handler needs the UI process,
2264         send WebPageProxy::ContentFilterDidBlockLoadForFrame. Oterwise, call PolicyChecker::setContentFilterUnblockHandler.
2265
2266 2015-03-20  Zan Dobersek  <zdobersek@igalia.com>
2267
2268         [GTK] Properly guard X11-specific code in BackingStore::createBackend()
2269         https://bugs.webkit.org/show_bug.cgi?id=142875
2270
2271         Reviewed by Martin Robinson.
2272
2273         * UIProcess/cairo/BackingStoreCairo.cpp:
2274         (WebKit::BackingStore::createBackend): Guard the GTK- and X11-specific
2275         bit of code with PLATFORM(GTK) and PLATFORM(X11). Testing GDK_WINDOWING_X11
2276         ensures that the GTK+ dependency has X11 support, but does not ensure
2277         that WebKitGTK+ has been configured to build for X11 environments (which
2278         is what PLATFORM(X11) ensures).
2279
2280 2015-03-19  Chris Dumez  <cdumez@apple.com>
2281
2282         [WK2] We should allow stale content when restoring a killed / crashed WebProcess
2283         https://bugs.webkit.org/show_bug.cgi?id=142893
2284         <rdar://problem/19633737>
2285         <rdar://problem/19869257>
2286
2287         Reviewed by Antti Koivisto.
2288
2289         Allow stale content when restoring a killed / crashed WebProcess
2290         (similarly to a history navigation). This is actually what was intended
2291         as we call WebPage::goToBackForwardItem() in this case, which uses
2292         IndexedBackForward load type. However, this value was then ignored in
2293         FrameLoader::loadDifferentDocumentItem().
2294
2295         This patch gets rid of the special casing in
2296         FrameLoader::loadDifferentDocumentItem() and makes it clear at call
2297         sites when calling goToBackForwardItem() if we should allow stale
2298         content or not. If goToBackForwardItem() is called with the
2299         allowStaleContent flag off, we'll keep using the IndexedBackForward
2300         frame load type. However, if the flag is on, we'll use the Standard
2301         frame load type and do a fresh load.
2302
2303         * UIProcess/WebPageProxy.cpp:
2304         (WebKit::WebPageProxy::reattachToWebProcessForReload):
2305         Set allowStaleContent flag to true as we want to allow stale content
2306         when reloading a WebProcess after it crashed or was killed (behavior
2307         change).
2308
2309         (WebKit::WebPageProxy::reattachToWebProcessWithItem):
2310         Add allowStaleContent parameter so that call sites can decide which
2311         policy to use.
2312
2313         (WebKit::WebPageProxy::goForward):
2314         (WebKit::WebPageProxy::goBack):
2315         Set allowStaleContent flag to true as this is our policy for history
2316         navigations.
2317
2318         (WebKit::WebPageProxy::goToBackForwardItem):
2319         Add allowStaleContent parameter so that the call site can let us know
2320         what to do. This is useful as this is called not only for indexed
2321         back / forward navigations (allowing stale content) but also for
2322         restoring session state (forbidding state content:
2323         <rdar://problem/8131355>).
2324
2325         (WebKit::WebPageProxy::restoreFromSessionState):
2326         Call goToBackForwardItem() with allowStaleContent flag set to false
2327         as users expect fresh contents in this case. This method is called
2328         when:
2329         - Tabs are restored on Safari / MobileSafari startup
2330         - Tabs are restored via "History > Reopen All windows from last session"
2331
2332         * UIProcess/WebPageProxy.h:
2333         * WebProcess/WebPage/WebPage.cpp:
2334         (WebKit::WebPage::goToBackForwardItem):
2335         Add allowStaleContent parameter and use "Standard" frame load type
2336         instead of "IndexedBackForward" if it is false. This is needed as
2337         "IndexedBackForward" frame load type allows using stale content.
2338
2339         * WebProcess/WebPage/WebPage.h:
2340         * WebProcess/WebPage/WebPage.messages.in:
2341         Add allowStaleContent flag to GoToBackForwardItem message.
2342
2343 2015-03-19  Eric Carlson  <eric.carlson@apple.com>
2344
2345         [Mac] Move MediaPlaybackTargetPicker
2346         https://bugs.webkit.org/show_bug.cgi?id=142889
2347
2348         Move WebMediaPlaybackTargetPickerProxy to WebCore so it can be used by
2349         both WK2 and WK1.
2350
2351         Reviewed by Tim Horton.
2352
2353         * UIProcess/PageClient.h:
2354         * UIProcess/WebMediaPlaybackTargetPickerProxy.cpp: Removed.
2355         * UIProcess/WebMediaPlaybackTargetPickerProxy.h: Removed.
2356         * UIProcess/WebPageProxy.cpp:
2357         (WebKit::WebPageProxy::devicePickerProxy):
2358         * UIProcess/WebPageProxy.h:
2359         * UIProcess/mac/PageClientImpl.h:
2360         * UIProcess/mac/PageClientImpl.mm:
2361         (WebKit::PageClientImpl::createPlaybackTargetPicker):
2362         * UIProcess/mac/WebMediaPlaybackTargetPickerProxyMac.h: Removed.
2363         * UIProcess/mac/WebMediaPlaybackTargetPickerProxyMac.mm: Removed.
2364         * WebKit2.xcodeproj/project.pbxproj:
2365
2366 2015-03-19  Jessie Berlin  <jberlin@webkit.org>
2367
2368         32-bit build fix after r181770.
2369
2370         * UIProcess/mac/WKFullScreenWindowController.mm:
2371         (-[WKFullScreenWindowController initWithWindow:webView:]):
2372
2373 2015-03-19  Anders Carlsson  <andersca@apple.com>
2374
2375         Add support for deleting individual cache entries
2376         https://bugs.webkit.org/show_bug.cgi?id=142886
2377
2378         Reviewed by Antti Koivisto.
2379
2380         * NetworkProcess/NetworkProcess.cpp:
2381         (WebKit::fetchDiskCacheEntries):
2382         Remove an unnecessary call to cfURLCacheOrigins().
2383
2384         (WebKit::clearDiskCacheEntries):
2385         Helper function for clearing disk cache entries. This handles both the old and new cache implementations.
2386
2387         (WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
2388         Call clearDiskCacheEntries if needed.
2389
2390 2015-03-19  Jer Noble  <jer.noble@apple.com>
2391
2392         [WK2][Mac] Fullscreen animations with mismatched aspect ratios are "squished".
2393         https://bugs.webkit.org/show_bug.cgi?id=142132
2394
2395         Reviewed by Tim Horton.
2396
2397         Use CALayer animations for the transition into and out of fullscreen.
2398
2399         The fullscreen transition consists of three separate animations:
2400         1. An opacity animation for the black backdrop behind the fullscreen content
2401         2. A scale/translation animation from fullscreen element's initial screen to its final one.
2402         3. A clip animation from the fullscreen element's initial aspect ratio to its final one.
2403
2404         The opacity animation will apply to the fullscreen window's content view's layer's
2405         background color. To separately animate the transform and mask of the web view's content, a
2406         layer-backed subview is added to the content view, and the scale/translation & clip
2407         animations are applied to its transform property and mask layer respectively.
2408
2409         Utility methods to create each animation have been added, and each includes a parameter for
2410         the direction of the animation, so that the same methods can be used for entering and
2411         exiting fullscreen transitions.
2412
2413         The user-visible changes to this new transition are when the aspect ratios of the initial
2414         and final screen locations are different: previously the transition would use a scale
2415         transform to "squish" the fullscreen content into the initial aspect ratio. The new
2416         transition instead "clips" the fullscreen content to the initial aspect ratio. For common
2417         operations such a <video> element with a different aspect ratio than the screen, this makes
2418         the black letterbox "grow" during the transition, and makes the transition overall much
2419         smoother.
2420
2421         * UIProcess/mac/WKFullScreenWindowController.h:
2422         * UIProcess/mac/WKFullScreenWindowController.mm:
2423         (-[WKFullScreenWindowController initWithWindow:webView:]): Create and initialze the clipping view.
2424         (-[WKFullScreenWindowController applicationDidChangeScreenParameters:]): _backgroundWindow was removed.
2425         (-[WKFullScreenWindowController enterFullScreen:]): Add the webView to the _clipView, not the contentView.
2426         (-[WKFullScreenWindowController beganEnterFullScreenWithInitialFrame:finalFrame:]): _backgroundWindow,
2427                 _fadeAnimation, and _scaleAnimation are all removed.
2428         (-[WKFullScreenWindowController finishedEnterFullScreenAnimation:]): Ditto.
2429         (-[WKFullScreenWindowController finishedExitFullScreenAnimation:]): Ditto.  Hide the contentView's
2430                 layer. Pause visibility updates.
2431         (-[WKFullScreenWindowController completeFinishExitFullScreenAnimationAfterRepaint]): Resume visibility updates.
2432         (-[WKFullScreenWindowController close]): _fadeAnimation and _scaleAnimation are removed.
2433         (-[WKFullScreenWindowController customWindowsToEnterFullScreenForWindow:]): Return only the fullscreen
2434                 window.
2435         (-[WKFullScreenWindowController customWindowsToExitFullScreenForWindow:]): Ditto.
2436         (zoomAnimation): Added.
2437         (maskAnimation): Added.
2438         (fadeAnimation): Added.
2439         (-[WKFullScreenWindowController _startEnterFullScreenAnimationWithDuration:]): Use the utility
2440                 methods above to set up the animation.
2441         (-[WKFullScreenWindowController _startExitFullScreenAnimationWithDuration:]): Ditto.
2442         (createBackgroundFullscreenWindow): Deleted.
2443         (windowFrameFromApparentFrames): Deleted.
2444
2445 2015-03-19  Enrica Casucci  <enrica@apple.com>
2446
2447         <attachment> should put URLs on the pasteboard so that Finder can accept drops.
2448         https://bugs.webkit.org/show_bug.cgi?id=142801
2449         rdar://problem/19982527
2450
2451         Reviewed by Tim Horton.
2452
2453         This patch adds all the necessary support to write attachment elements into
2454         the pasteboard, including the promised type in WK2.
2455
2456         * UIProcess/API/mac/WKView.mm:
2457         (-[WKView _setPromisedDataForImage:withFileName:withExtension:withTitle:withURL:withVisibleURL:withArchive:forPasteboard:]):
2458         (-[WKView _setPromisedDataForAttachment:withExtension:withTitle:withURL:withVisibleURL:forPasteboard:]):
2459         (-[WKView namesOfPromisedFilesDroppedAtDestination:]):
2460         (-[WKView _setPromisedData:withFileName:withExtension:withTitle:withURL:withVisibleURL:withArchive:forPasteboard:]): Deleted.
2461         * UIProcess/API/mac/WKViewInternal.h:
2462         * UIProcess/PageClient.h:
2463         * UIProcess/WebPageProxy.h:
2464         * UIProcess/WebPageProxy.messages.in:
2465         * UIProcess/mac/PageClientImpl.h:
2466         * UIProcess/mac/PageClientImpl.mm:
2467         (WebKit::PageClientImpl::setPromisedDataForImage):
2468         (WebKit::PageClientImpl::setPromisedDataForAttachment):
2469         (WebKit::PageClientImpl::setPromisedData): Deleted.
2470         * UIProcess/mac/WebPageProxyMac.mm:
2471         (WebKit::WebPageProxy::setPromisedDataForImage):
2472         (WebKit::WebPageProxy::setPromisedDataForAttachment):
2473         (WebKit::WebPageProxy::setPromisedData): Deleted.
2474         * WebProcess/WebCoreSupport/WebDragClient.h:
2475         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
2476         (WebKit::WebDragClient::declareAndWriteAttachment):
2477         (WebKit::WebDragClient::declareAndWriteDragImage):
2478
2479 2015-03-19  Anders Carlsson  <andersca@apple.com>
2480
2481         Cache::remove should take a Key instead of an entry
2482         https://bugs.webkit.org/show_bug.cgi?id=142878
2483
2484         Reviewed by Antti Koivisto.
2485
2486         * NetworkProcess/cache/NetworkCache.cpp:
2487         (WebKit::NetworkCache::Cache::remove):
2488         * NetworkProcess/cache/NetworkCache.h:
2489
2490 2015-03-19  Chris Dumez  <cdumez@apple.com>
2491
2492         Clean up DOMTimer related settings
2493         https://bugs.webkit.org/show_bug.cgi?id=142837
2494
2495         Reviewed by Darin Adler.
2496
2497         Stop setting the DOMTimers' default minimum interval to 4ms as this
2498         is now the default.
2499
2500         * WebProcess/WebPage/WebPage.cpp:
2501         (WebKit::WebPage::WebPage):
2502
2503 2015-03-19  Chris Dumez  <cdumez@apple.com>
2504
2505         The network cache should ignore "cache-control: no-cache, must-revalidate" on history navigation
2506         https://bugs.webkit.org/show_bug.cgi?id=142831
2507         <rdar://problem/20209957>
2508
2509         Reviewed by Antti Koivisto.
2510
2511         The network cache should ignore "no-cache" and "must-revalidate" as
2512         Cache-Control policy for history navigations to avoid unnecessary
2513         revalidation in this case. Our memory cache already behaves this way.
2514
2515         On history navigation, our disk cache implementation currently
2516         revalidates unconditionally resources if "cache-control: no-cache" is
2517         used. It also revalidates expired resources if "cache-control:
2518         must-revalidate" is used. This is sub-optimal.
2519
2520         RFC 7234 does not require us to do so [1]:
2521         """
2522           User agents often have history mechanisms, such as "Back" buttons and
2523           history lists, that can be used to redisplay a representation
2524           retrieved earlier in a session.
2525
2526           The freshness model (Section 4.2) does not necessarily apply to
2527           history mechanisms.  That is, a history mechanism can display a
2528           previous representation even if it has expired.
2529         """
2530
2531         Chrome and IE9+ [2] already ignore "cache-control: must-revalidate" on history navigation.
2532
2533         [1] https://tools.ietf.org/html/rfc7234#page-32
2534         [2] http://blogs.msdn.com/b/ie/archive/2010/07/14/caching-improvements-in-internet-explorer-9.aspx
2535
2536         Test: http/tests/cache/disk-cache-validation-back-navigation-policy.html
2537
2538         * NetworkProcess/cache/NetworkCache.cpp:
2539         (WebKit::NetworkCache::decodeStorageEntry):
2540
2541 2015-03-18  Simon Fraser  <simon.fraser@apple.com>
2542
2543         Don't paint PDFs on every scroll
2544         https://bugs.webkit.org/show_bug.cgi?id=142857
2545         rdar://problem/20130207
2546
2547         Reviewed by Tim Horton.
2548         
2549         Don't push a scale factor onto the PDF layer controller if it hasn't
2550         changed, since doing so causes a repaint.
2551
2552         * WebProcess/Plugins/PDF/PDFPlugin.mm:
2553         (WebKit::PDFPlugin::updatePageAndDeviceScaleFactors):
2554
2555 2015-03-18  Anders Carlsson  <andersca@apple.com>
2556
2557         Use && instead of & when deciding if the network cache should be cleared
2558         https://bugs.webkit.org/show_bug.cgi?id=142845
2559
2560         Reviewed by Antti Koivisto.
2561
2562         * NetworkProcess/NetworkProcess.cpp:
2563         (WebKit::NetworkProcess::deleteWebsiteData):
2564
2565 2015-03-18  Anders Carlsson  <andersca@apple.com>
2566
2567         Add WKContextGetWebsiteDataStore API
2568         https://bugs.webkit.org/show_bug.cgi?id=142832
2569         rdar://problem/16544715
2570
2571         Reviewed by Sam Weinig.
2572
2573         Also add WKWebsiteDataStoreRef which is toll-free bridged to _WKWebsiteDataStore.
2574
2575         * Shared/API/c/WKBase.h:
2576         Add new declaration.
2577
2578         * UIProcess/API/APIWebsiteDataStore.cpp:
2579         (API::WebsiteDataStore::create):
2580         * UIProcess/API/APIWebsiteDataStore.h:
2581         Add a new function that takes a configuration.
2582
2583         * UIProcess/API/C/WKAPICast.h:
2584         Add cast.
2585
2586         * UIProcess/API/C/WKContext.cpp:
2587         (WKContextGetWebsiteDataStore):
2588         Return the context's website data store.
2589
2590         * UIProcess/API/C/WKContext.h:
2591         Add new declaration.
2592
2593         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp: Added.
2594         * UIProcess/API/C/WKWebsiteDataStoreRef.h: Added.
2595         Add new files.
2596
2597         * UIProcess/WebKeyValueStorageManager.cpp:
2598         (WebKit::WebKeyValueStorageManager::getKeyValueStorageOrigins):
2599         (WebKit::WebKeyValueStorageManager::getStorageDetailsByOrigin):
2600         (WebKit::WebKeyValueStorageManager::deleteEntriesForOrigin):
2601         (WebKit::WebKeyValueStorageManager::deleteAllEntries):
2602         Update now that WebProcessPool holds on to an API::WebsiteDataStore.
2603
2604         * UIProcess/WebProcessPool.cpp:
2605         (WebKit::WebProcessPool::WebProcessPool):
2606         (WebKit::WebProcessPool::createWebPage):
2607         * UIProcess/WebProcessPool.h:
2608         WebProcessPool should hold on to an API::WebsiteDataStore instead of a WebKit::WebsiteDataStore.
2609
2610         * WebKit2.xcodeproj/project.pbxproj:
2611         Add new files.
2612
2613 2015-03-18  Tim Horton  <timothy_horton@apple.com>
2614
2615         Cannot invoke action menus anymore
2616         https://bugs.webkit.org/show_bug.cgi?id=142797
2617         <rdar://problem/20032670>
2618
2619         * UIProcess/API/mac/WKView.mm:
2620         Need one more respondsToSelector check.
2621
2622 2015-03-18  Chris Dumez  <cdumez@apple.com>
2623
2624         [WK2] Log the number of network cache requests that we have never seen before
2625         https://bugs.webkit.org/show_bug.cgi?id=142828
2626         <rdar://problem/19632130>
2627
2628         Reviewed by Antti Koivisto.
2629
2630         Log the number of network cache requests that we have never seen before
2631         using diagnostic logging.
2632
2633         * NetworkProcess/cache/NetworkCacheStatisticsCocoa.mm:
2634         (WebKit::NetworkCache::Statistics::recordNotUsingCacheForRequest):
2635         (WebKit::NetworkCache::Statistics::recordRetrievalFailure):
2636
2637 2015-03-17  Antti Koivisto  <antti@apple.com>
2638
2639         Prune least valuable cache entries first
2640         https://bugs.webkit.org/show_bug.cgi?id=142810
2641         rdar://problem/19632130
2642
2643         Reviewed by Darin Adler.
2644
2645         When pruning the cache estimate relative value of each entry using formula
2646
2647         age = current time - creation time
2648         accessAge = last access time - creation time
2649         value = accessAge / age
2650
2651         That is, we value entries that have been accessed recently and survived in the cache longest.
2652
2653         The most valuable entries don't get deleted at all while the deletion probablity ramps up for
2654         lower value entries.
2655
2656         * NetworkProcess/cache/NetworkCacheFileSystemPosix.h:
2657         (WebKit::NetworkCache::fileTimes):
2658
2659             Get the creation time and access time for a file.
2660
2661         (WebKit::NetworkCache::updateFileAccessTimeIfNeeded):
2662
2663             Update access time manually if the file system doesn't do it automatically.
2664
2665         * NetworkProcess/cache/NetworkCacheIOChannel.h:
2666         (WebKit::NetworkCache::IOChannel::path):
2667         (WebKit::NetworkCache::IOChannel::type):
2668         * NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:
2669         (WebKit::NetworkCache::IOChannel::IOChannel):
2670         (WebKit::NetworkCache::IOChannel::open):
2671
2672             Remember the file path and move most of the work to constructor.
2673
2674         * NetworkProcess/cache/NetworkCacheStorage.cpp:
2675         (WebKit::NetworkCache::Storage::Storage):
2676         (WebKit::NetworkCache::Storage::remove):
2677         (WebKit::NetworkCache::Storage::updateFileAccessTime):
2678         (WebKit::NetworkCache::Storage::dispatchReadOperation):
2679         (WebKit::NetworkCache::deletionProbability):
2680
2681             Compute the probability based on entry age and access time.
2682
2683         (WebKit::NetworkCache::Storage::shrinkIfNeeded):
2684         * NetworkProcess/cache/NetworkCacheStorage.h:
2685         (WebKit::NetworkCache::Storage::serialBackgroundIOQueue):
2686         (WebKit::NetworkCache::Storage::deleteQueue): Deleted.
2687
2688             More generic name.
2689
2690 2015-03-18  Chris Dumez  <cdumez@apple.com>
2691
2692         [WK2] Log total number of network cache queries using diagnostic logging
2693         https://bugs.webkit.org/show_bug.cgi?id=142803
2694         <rdar://problem/19632130>
2695
2696         Reviewed by Antti Koivisto.
2697
2698         Log total number of network cache queries using diagnostic logging.
2699
2700         * NetworkProcess/cache/NetworkCache.cpp:
2701         (WebKit::NetworkCache::Cache::retrieve):
2702         * NetworkProcess/cache/NetworkCacheStatistics.h:
2703         * NetworkProcess/cache/NetworkCacheStatisticsCocoa.mm:
2704         (WebKit::NetworkCache::Statistics::recordCacheRetrievalRequest):
2705
2706 2015-03-18  Chris Dumez  <cdumez@apple.com>
2707
2708         [WK2] We should not even try the network cache for non-HTTP protocol requests
2709         https://bugs.webkit.org/show_bug.cgi?id=142802
2710         <rdar://problem/19632130>
2711
2712         Reviewed by Antti Koivisto.
2713
2714         We should not even try the network cache for non-HTTP protocol requests
2715         and the network cache cannot handle those.
2716
2717         * NetworkProcess/NetworkResourceLoader.cpp:
2718         (WebKit::NetworkResourceLoader::start):
2719         * NetworkProcess/cache/NetworkCache.cpp:
2720         (WebKit::NetworkCache::canRetrieve):
2721         (WebKit::NetworkCache::Cache::retrieve):
2722         * NetworkProcess/cache/NetworkCache.h:
2723         * NetworkProcess/cache/NetworkCacheStatisticsCocoa.mm:
2724         (WebKit::NetworkCache::retrieveDecisionToDiagnosticKey):
2725
2726 2015-03-17  Conrad Shultz  <conrad_shultz@apple.com>
2727
2728         Ignore some deprecation warnings
2729         https://bugs.webkit.org/show_bug.cgi?id=142813
2730
2731         Reviewed by Mark Rowe.
2732
2733         Fixing the deprecations is tracked by: <rdar://problem/20201450>
2734
2735         * UIProcess/mac/WebPopupMenuProxyMac.mm:
2736         (WebKit::WebPopupMenuProxyMac::populate):
2737
2738 2015-03-17  Ryuan Choi  <ryuan.choi@navercorp.com>
2739
2740         [EFL] Expose JavaScript binding interface through ewk_extension
2741         https://bugs.webkit.org/show_bug.cgi?id=142033
2742
2743         Reviewed by Gyuyoung Kim.
2744
2745         * PlatformEfl.cmake:
2746         * UIProcess/API/efl/tests/extensions/extension_sample.cpp: Registered test object for new test case.
2747         * UIProcess/API/efl/tests/test_ewk2_javascript_binding.cpp: Added simple binding API test case.
2748         (EWK2ContextTestWithExtension::messageReceivedCallback):
2749         (EWK2ContextTestWithExtension::EWK2ContextTestWithExtension):
2750         (TEST_F):
2751         * WebProcess/InjectedBundle/API/efl/EWebKit_Extension.h:
2752         * WebProcess/InjectedBundle/API/efl/ewk_extension.cpp:
2753         (EwkExtension::didCreatePage):
2754         (EwkExtension::willDestroyPage):
2755         * WebProcess/InjectedBundle/API/efl/ewk_extension.h:
2756         * WebProcess/InjectedBundle/API/efl/ewk_extension_private.h:
2757         * WebProcess/InjectedBundle/API/efl/ewk_page.cpp: Added.
2758         (toEwkPage):
2759         (EwkPage::EwkPage):
2760         (EwkPage::append):
2761         (EwkPage::remove):
2762         (EwkPage::didFinishDocumentLoadForFrame):
2763         (ewk_page_js_global_context_get):
2764         (ewk_page_client_register):
2765         (ewk_page_client_unregister):
2766         * WebProcess/InjectedBundle/API/efl/ewk_page.h: Added.
2767         * WebProcess/InjectedBundle/API/efl/ewk_page_private.h: Added.
2768         (EwkPage::page):
2769         * efl/ewebkit2-extension.pc.in:
2770
2771 2015-03-17  Tim Horton  <timothy_horton@apple.com>
2772
2773         Cannot invoke action menus anymore
2774         https://bugs.webkit.org/show_bug.cgi?id=142797
2775         <rdar://problem/20032670>
2776
2777         * UIProcess/API/mac/WKView.mm:
2778         Need a respondsToSelector check.
2779
2780 2015-03-17  Tim Horton  <timothy_horton@apple.com>
2781
2782         Cannot invoke action menus anymore
2783         https://bugs.webkit.org/show_bug.cgi?id=142797
2784         <rdar://problem/20032670>
2785
2786         Reviewed by Beth Dakin.
2787
2788         * UIProcess/API/mac/WKView.mm:
2789         Don't process mouse events that would make an action menu; call super
2790         and let AppKit take care of it. We have to duplicate the macro so that
2791         we can avoid calling super for the internal-only methods.
2792         Also, otherMouseMoved is simply not a thing, so remove it.
2793
2794 2015-03-17  Beth Dakin  <bdakin@apple.com>
2795
2796         DOM mouse events have weird timing for force clickable elements in Safari 8.0.3 on 
2797         10.10.2
2798         https://bugs.webkit.org/show_bug.cgi?id=142700
2799         -and corresponding-
2800         rdar://problem/20165168
2801
2802         Reviewed by Tim Horton.
2803
2804         No need to tell the WKImmediateActionController about mouse down any more since we 
2805         are expecting it at the beginning of an immediate action interaction.
2806         * UIProcess/API/mac/WKView.mm:
2807         (-[WKView mouseDown:]):
2808
2809         Set the delaysPrimaryMouseButtonEvents to NO for the 
2810         _immediateActionGestureRecognizer. This will cause AppKit to send up the mouse 
2811         events at the expected time.
2812         (-[WKView initWithFrame:processPool:configuration:webView:]):
2813
2814         WebCore::EventHandler now needs to know if an immediate action cancelled or 
2815         completed. This plumbs that information down.
2816         * UIProcess/WebPageProxy.cpp:
2817         (WebKit::WebPageProxy::immediateActionDidCancel):
2818         (WebKit::WebPageProxy::immediateActionDidComplete):
2819         * UIProcess/WebPageProxy.h:
2820         * UIProcess/mac/WKImmediateActionController.h:
2821         * UIProcess/mac/WKImmediateActionController.mm:
2822         (-[WKImmediateActionController immediateActionRecognizerDidCancelAnimation:]):
2823         (-[WKImmediateActionController immediateActionRecognizerDidCompleteAnimation:]):
2824         (-[WKImmediateActionController wkView:willHandleMouseDown:]): Deleted.
2825         * WebProcess/WebPage/WebPage.h:
2826         * WebProcess/WebPage/WebPage.messages.in:
2827
2828         Call EventHandler::setImmediateActionStage() with the appropriate stage.
2829         * WebProcess/WebPage/mac/WebPageMac.mm:
2830         (WebKit::WebPage::performActionMenuHitTestAtLocation):
2831         (WebKit::WebPage::immediateActionDidCancel):
2832         (WebKit::WebPage::immediateActionDidComplete):
2833
2834 2015-03-17  Timothy Horton  <timothy_horton@apple.com>
2835
2836         Reproducible null deref under ScriptedAnimationController::createDisplayRefreshMonitor
2837         https://bugs.webkit.org/show_bug.cgi?id=142776
2838         <rdar://problem/18921338>
2839
2840         Reviewed by Alexey Proskuryakov.
2841
2842         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2843         (WebKit::WebChromeClient::createDisplayRefreshMonitor):
2844         * WebProcess/WebCoreSupport/WebChromeClient.h:
2845         Adjust to the new signature.
2846
2847 2015-03-17  Antti Koivisto  <antti@apple.com>
2848
2849         Disk cache should support Vary: Cookie
2850         https://bugs.webkit.org/show_bug.cgi?id=142770
2851         rdar://problem/19764945
2852
2853         Reviewed by Anders Carlsson.
2854
2855         Cookies are not part of the original request but are added by the networking layer when submitting the request.
2856         Fetch them explicitly when resolving Vary: Cookie.
2857
2858         The implementation is not perfect as it fetches the cookie for the cache entry when saving a Vary:Cookie response,
2859         not when making the request. In principle the cookie may have changed in-between. This should be enough to handle
2860         reasonable cases though. Fetching cookies for every request might be too expensive for this rarely used feature.
2861
2862         * NetworkProcess/cache/NetworkCache.cpp:
2863         (WebKit::NetworkCache::headerValueForVary):
2864         (WebKit::NetworkCache::encodeStorageEntry):
2865         (WebKit::NetworkCache::verifyVaryingRequestHeaders):
2866
2867 2015-03-17  Zan Dobersek  <zdobersek@igalia.com>
2868
2869         [WK2] Use C++ lambdas in IPC::Connection
2870         https://bugs.webkit.org/show_bug.cgi?id=138018
2871
2872         Reviewed by Anders Carlsson.
2873
2874         Replace uses of WTF::bind() in the IPC::Connection class with C++ lambdas.
2875
2876         * Platform/IPC/Connection.cpp:
2877         (IPC::Connection::dispatchWorkQueueMessageReceiverMessage):
2878         (IPC::Connection::invalidate):
2879         (IPC::Connection::sendMessage):
2880         (IPC::Connection::processIncomingMessage): Simplify the error messages so we
2881         don't have to format strings on-the-fly, removing the issues of cross-thread
2882         string copying altogether.
2883         (IPC::Connection::dispatchDidReceiveInvalidMessage): The parameters are now
2884         of the StringReference type.
2885         (IPC::Connection::enqueueIncomingMessage):
2886         * Platform/IPC/Connection.h:
2887         * Platform/IPC/mac/ConnectionMac.mm:
2888         (IPC::Connection::receiveSourceEventHandler):
2889         * Platform/IPC/unix/ConnectionUnix.cpp:
2890         (IPC::Connection::open):
2891
2892 2015-03-17  Zan Dobersek  <zdobersek@igalia.com>
2893
2894         [CMake] Use a forwarding header for ANGLE's ShaderLang.h to avoid picking up ANGLE's EGL headers
2895         https://bugs.webkit.org/show_bug.cgi?id=142530
2896
2897         Reviewed by Darin Adler.
2898
2899         * CMakeLists.txt: Replace the Source/ThirdParty/ANGLE/include/GLSLANG entry
2900         in the list of inclusion directories for WebKit2 with Source/ThirdParty/ANGLE,
2901         possible due to the new forwarding header for ANGLE's ShaderLang.h.
2902
2903 2015-03-17  Gwang Yoon Hwang  <yoon@igalia.com>
2904
2905         REGRESSION(r180924): Unable to build WebKitGTK+ with threaded compositor
2906
2907         Unreviewed build fix.
2908
2909         * WebProcess/WebPage/LayerTreeHost.h:
2910         Remove duplicated declaration of setNativeSurfaceHandleForCompositing.
2911
2912 2015-03-16  Ryosuke Niwa  <rniwa@webkit.org>
2913
2914         Enable ES6 classes by default
2915         https://bugs.webkit.org/show_bug.cgi?id=142774
2916
2917         Reviewed by Gavin Barraclough.
2918
2919         * Configurations/FeatureDefines.xcconfig:
2920
2921 2015-03-16  Conrad Shultz  <conrad_shultz@apple.com>
2922
2923         Don't pass nil as a fireDate for NSTimer
2924         https://bugs.webkit.org/show_bug.cgi?id=142765
2925
2926         Reviewed by Dan Bernstein.
2927
2928         While we're here, switch to a selector that conforms to documented NSTimer API.
2929
2930         * UIProcess/mac/WKFullScreenWindowController.mm:
2931         (-[WKFullScreenWindowController cancelOperation:]):
2932         Set the timer's fireDate as the future date matching the former interval; update the selector.
2933         (-[WKFullScreenWindowController _watchdogTimerFired:]):
2934         Timer callback; wrap -exitFullScreen.
2935
2936 2015-03-16  Alex Christensen  <achristensen@webkit.org>
2937
2938         Progress towards CMake on Mac
2939         https://bugs.webkit.org/show_bug.cgi?id=142747
2940
2941         Reviewed by Chris Dumez.
2942
2943         * PlatformMac.cmake:
2944         Started adding Mac-specific directories and headers.
2945
2946 2015-03-16  Alexey Proskuryakov  <ap@apple.com>
2947
2948         ASSERT(m_plugin) on plugins/snapshotting/snapshot-plugin-not-quite-blocked-by-image.html
2949         https://bugs.webkit.org/show_bug.cgi?id=142637
2950
2951         Reviewed by Dean Jackson.
2952
2953         * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::pluginSnapshotTimerFired):
2954         m_plugin can be legitimately null.
2955
2956 2015-03-16  Csaba Osztrogonác  <ossy@webkit.org>
2957
2958         One more URTBF after r181578.
2959
2960         * WebProcess/WebPage/WebPage.cpp:
2961         (WebKit::WebPage::updatePreferences):
2962
2963 2015-03-16  Csaba Osztrogonác  <ossy@webkit.org>
2964
2965         URTBF after r181578.
2966
2967         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2968         (WebKit::InjectedBundle::setCSSAnimationTriggersEnabled): Copy/paste error fixed.
2969
2970 2015-03-16  Dean Jackson  <dino@apple.com>
2971
2972         Expose WK2 preference for Animation Triggers runtime flag
2973         https://bugs.webkit.org/show_bug.cgi?id=142744
2974
2975         Reviewed by Anders Carlsson.
2976
2977         Expose CSSAnimationTriggersEnabled, linking it to the runtime enabled
2978         feature flag.
2979
2980         * Shared/WebPreferencesDefinitions.h:
2981         * UIProcess/API/C/WKPreferences.cpp:
2982         (WKPreferencesSetCSSAnimationTriggersEnabled):
2983         (WKPreferencesGetCSSAnimationTriggersEnabled):
2984         * UIProcess/API/C/WKPreferencesRefPrivate.h:
2985         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2986         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
2987         (WebKit::InjectedBundle::setCSSAnimationTriggersEnabled):
2988         * WebProcess/InjectedBundle/InjectedBundle.h:
2989         * WebProcess/WebPage/WebPage.cpp:
2990         (WebKit::WebPage::updatePreferences):
2991
2992 2015-03-16  Conrad Shultz  <conrad_shultz@apple.com>
2993
2994         Allow clients to selectively disable plug-ins
2995         https://bugs.webkit.org/show_bug.cgi?id=142506
2996
2997         Reviewed by Anders Carlsson.
2998
2999         Add new functionality allow clients to declaratively disable individual plug-ins (in a manner that conceals them
3000         from the page). As part of this:
3001
3002         1) Introduce the concept of web-visible plug-ins and related concepts, as distinct from the real underlying
3003            set of plug-ins.
3004
3005         2) Where applicable, plumb additional information about plug-ins (specifically, bundle identification) deeper
3006            down the stack.
3007
3008         3) Add generic functionality to PluginStrategy to support filtering plug-ins for visibility and introduce
3009            a concrete implementation thereof in WebPlatformStrategies in WebKit2.
3010
3011         4) Add messaging infrastructure to allow clients to set and clear plug-in policies.
3012
3013         While currently only used in a very limited manner, the new declarative plug-in policies are written generically
3014         so that they could be easily used in the future to reduce synchronous messaging to the client when loading plug-ins.
3015
3016         * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
3017         (WebKit::NetscapePluginModule::getPluginInfo):
3018         Set new PluginInfo members.
3019
3020         * Shared/WebCoreArgumentCoders.cpp:
3021         (IPC::ArgumentCoder<PluginInfo>::encode):
3022         Handle new PluginInfo members.
3023         (IPC::ArgumentCoder<PluginInfo>::decode):
3024         Ditto.
3025
3026         * Shared/WebProcessCreationParameters.h:
3027         Declare a member to store client plug-in policies.
3028
3029         * Shared/WebProcessCreationParameters.cpp:
3030         (WebKit::WebProcessCreationParameters::encode):
3031         Encode the policies.
3032         (WebKit::WebProcessCreationParameters::decode):
3033         Decode the policies.
3034
3035         * UIProcess/API/C/WKAPICast.h:
3036         (WebKit::toWKPluginLoadClientPolicy):
3037         Teach how to cast between WebCore and WebKit2 policy definitions.
3038         (WebKit::toPluginLoadClientPolicy):
3039         Ditto.
3040
3041         * UIProcess/API/C/WKPluginLoadPolicy.h:
3042         Declare WKPluginLoadClientPolicy, matching PluginLoadClientPolicy in WebCore.
3043
3044         * UIProcess/API/C/mac/WKContextPrivateMac.h:
3045         * UIProcess/API/C/mac/WKContextPrivateMac.mm:
3046         (WKContextSetPluginLoadClientPolicy):
3047         New function; wrap WebProcessPool::setPluginLoadClientPolicy().
3048         (WKContextClearPluginClientPolicies):
3049         New function; wrap WebProcessPool::clearPluginClientPolicies().
3050
3051         * UIProcess/WebProcessPool.h:
3052         * UIProcess/WebProcessPool.cpp:
3053         (WebKit::WebProcessPool::createNewWebProcess):
3054         Copy any client plug-in policies to the new process' creation parameters.
3055         (WebKit::WebProcessPool::setPluginLoadClientPolicy):
3056         Send SetPluginLoadClientPolicy to all processes and stash the passed-in policy info.
3057         (WebKit::WebProcessPool::clearPluginClientPolicies):
3058         Send ClearPluginClientPolicies to all processes and clear any stashed policy info.
3059
3060         * WebProcess/Plugins/PDF/PDFPlugin.mm:
3061         (WebKit::PDFPlugin::pluginInfo):
3062         Set new PluginInfo member.
3063
3064         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3065         (WebKit::pluginSupportsExtension):
3066         Adopt getWebVisibleMimesAndPluginIndices().
3067         (WebKit::WebFrameLoaderClient::objectContentType):
3068         Update to reflect reflect function rename.
3069
3070         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
3071         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
3072         (WebKit::WebPlatformStrategies::getPluginInfo):
3073         Pass the Page to populatePluginCache().
3074         (WebKit::WebPlatformStrategies::getWebVisiblePluginInfo):
3075         New member function; wrap getPluginInfo(); if appropriate, filter out plug-ins the client has asked
3076         to block on the current page.
3077         (WebKit::WebPlatformStrategies::setPluginLoadClientPolicy):
3078         New member function; map empty inputs to a wildcard character and insert the new policy into the nested map.
3079         (WebKit::WebPlatformStrategies::clearPluginClientPolicies):
3080         New member function; empty m_hostsToPluginIdentifierData.
3081         (WebKit::WebPlatformStrategies::pluginLoadClientPolicyForHost):
3082         New member function; look up the most specific policy for the given plug-in and host.
3083         (WebKit::WebPlatformStrategies::populatePluginCache):
3084         If appropriate, set the client load policy on the plug-ins; do this irrespective of whether the cache has
3085         been populated since the Page, and therefore host, may change.
3086
3087         * WebProcess/WebPage/WebPage.cpp:
3088         (WebKit::WebPage::canShowMIMEType):
3089         Update to reflect function rename.
3090
3091         * WebProcess/WebProcess.h:
3092         * WebProcess/WebProcess.cpp:
3093         (WebKit::WebProcess::initializeWebProcess):
3094         Enumerate and process the client plug-in policies in the creation parameters.
3095         (WebKit::WebProcess::setPluginLoadClientPolicy):
3096         New member function; wrap PluginStrategy::setPluginLoadClientPolicy.
3097         (WebKit::WebProcess::clearPluginClientPolicies):
3098         New member function; wrap PluginStrategy::clearPluginClientPolicies().
3099
3100         * WebProcess/WebProcess.messages.in:
3101         Add messages for setting and clearing policies.
3102
3103 2015-03-16  Carlos Garcia Campos  <cgarcia@igalia.com>
3104
3105         Unreviewed. Add new Notification classes to GTK+ API documentation.
3106
3107         Add WebKitNotification and WebKitNotificationPermissionRequest to
3108         the documentation and fix some other typos causing warnings when
3109         generating HTML documentation.
3110
3111         * UIProcess/API/gtk/WebKitUserContent.cpp:
3112         * UIProcess/API/gtk/WebKitWebView.cpp:
3113         (webkit_web_view_class_init):
3114         * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml:
3115
3116 2015-03-16  Przemyslaw Piorkowski  <p.piorkowski@samsung.com>
3117
3118         [EFL][WK2] REGRESSION(r178526): test_ewk2_storage_manager has been failed for a long time
3119         https://bugs.webkit.org/show_bug.cgi?id=141249
3120
3121         Reviewed by Gyuyoung Kim.
3122
3123         * PlatformEfl.cmake: Enable test_ewk2_storage_manager for EFL port - it is passing now.
3124
3125 2015-03-16  David Kilzer  <ddkilzer@apple.com>
3126
3127         [iOS] REGRESSION (r181511): Most layout tests crash with a NULL deref
3128
3129         Follow-up fix for:
3130         [iOS] Presenting a modal sheet on top of a WKWebView causes it to lose focused, active state
3131         <http://webkit.org/b/142702>
3132
3133         * UIProcess/ios/PageClientImplIOS.mm:
3134         (WebKit::PageClientImpl::isViewWindowActive): Add NULL check for m_webView.
3135         (WebKit::PageClientImpl::isViewFocused): Ditto.
3136
3137 2015-03-15  Simon Fraser  <simon.fraser@apple.com>
3138
3139         Clean up related to wheelEvent names
3140         https://bugs.webkit.org/show_bug.cgi?id=142713
3141
3142         Reviewed by Anders Carlsson.
3143
3144         Add EventNames::isWheelEventType() and use it in places that test for the
3145         two wheel event names.
3146
3147         * WebProcess/Plugins/PluginView.cpp:
3148         (WebKit::PluginView::handleEvent):
3149
3150 2015-03-15  Dan Bernstein  <mitz@apple.com>
3151
3152         [iOS] Presenting a modal sheet on top of a WKWebView causes it to lose focused, active state
3153         https://bugs.webkit.org/show_bug.cgi?id=142702
3154
3155         Reviewed by Anders Carlsson.
3156
3157         * UIProcess/API/Cocoa/WKWebView.mm:
3158         (-[WKWebView becomeFirstResponder]): Override to delegate first responder status to the
3159         WKContentView if possible.
3160         (-[WKWebView _retainActiveFocusedState]): New SPI that prevents view hierarchy changes from
3161         affecting the active and focused state of the view. Increments a counter ivar and returns a
3162         completion block (which callers must call when they’re done) that decrements it back.
3163         * UIProcess/API/Cocoa/WKWebViewInternal.h: Declared new _activeFocusedStateRetainCount ivar
3164         with @package access.
3165         * UIProcess/API/Cocoa/WKWebViewPrivate.h: Declared new method.
3166
3167         * UIProcess/ios/PageClientImplIOS.mm:
3168         (WebKit::PageClientImpl::isViewWindowActive): Return true if active/focused state is to be
3169         maintained despite not being visible.
3170         (WebKit::PageClientImpl::isViewFocused): Return true if active/focused state is to be
3171         maintained despite not being active.
3172
3173         * UIProcess/ios/WKContentViewInteraction.mm:
3174         (-[WKContentView resignFirstResponder]): Don’t blur the assisted node if active/focused
3175         state is to be maintained.
3176
3177 2015-03-14  Simon Fraser  <simon.fraser@apple.com>
3178
3179         Clean up use of flags in localToContainer-type functions
3180         https://bugs.webkit.org/show_bug.cgi?id=142704
3181
3182         Reviewed by Alexey Proskuryakov.
3183         
3184         Pass UseTransforms explicitly to localToContainerPoint()
3185
3186         * WebProcess/WebPage/ios/WebPageIOS.mm:
3187         (WebKit::WebPage::getAssistedNodeInformation):
3188
3189 2015-03-14  Brent Fulgham  <bfulgham@apple.com>
3190
3191         [iOS] scroll snap points are animating to the wrong positions.
3192         https://bugs.webkit.org/show_bug.cgi?id=142705
3193         <rdar://problem/20136946>
3194
3195         Reviewed by Simon Fraser.
3196
3197         Scroll snapping was landing in the wrong place on iOS because of two problems:
3198         (1) It was searching for the closest snap offset point using unscaled 'screen' pixels,
3199         which caused it to always choose one of the earliest snap point options.
3200         (2) It was then selecting a scaled snap point coordinate and passing it back to UIKit
3201         to animate the snap. This caused it to select a target point beyond the 'screen' pixel
3202         we want to hit.
3203         
3204         The solution to both problems are to scale the scroll destination UIKit suggests so that
3205         we search among the scaled points with a valid value. Then, we need to scale the returned
3206         value back to screen units before handing it back to UIKit to process.
3207
3208         * UIProcess/API/Cocoa/WKWebView.mm:
3209         (-[WKWebView scrollViewWillBeginDragging:]): Drive-by fix. Get rid of extra ';' at
3210         the end of the line.
3211         * UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm:
3212         (WebKit::RemoteScrollingCoordinatorProxy::closestSnapOffsetForMainFrameScrolling):
3213
3214 2015-03-14  Dean Jackson  <dino@apple.com>
3215
3216         Feature flag for Animations Level 2
3217         https://bugs.webkit.org/show_bug.cgi?id=142699
3218         <rdar://problem/20165097>
3219
3220         Reviewed by Brent Fulgham.
3221
3222         Add ENABLE_CSS_ANIMATIONS_LEVEL_2 and a runtime flag animationTriggersEnabled.
3223
3224         * Configurations/FeatureDefines.xcconfig:
3225
3226 2015-03-14  Víctor Manuel Jáquez Leal  <vjaquez@igalia.com>
3227
3228         [GStreamer] share GL context in pipeline
3229         https://bugs.webkit.org/show_bug.cgi?id=142693
3230
3231         Reviewed by Philippe Normand.
3232
3233         * WebProcess/gtk/WebProcessMainGtk.cpp: Enable XInitThreads() if
3234         GSTREAMER_GL is used, since GstGL elements use another thread for
3235         queuing GL operations.
3236
3237 2015-03-13  Alex Christensen  <achristensen@webkit.org>
3238
3239         Progress towards CMake on Mac.
3240         https://bugs.webkit.org/show_bug.cgi?id=142680
3241
3242         Reviewed by Gyuyoung Kim.
3243
3244         * PlatformMac.cmake: Added.
3245
3246 2015-03-13  Commit Queue  <commit-queue@webkit.org>
3247
3248         Unreviewed, rolling out r181483.
3249         https://bugs.webkit.org/show_bug.cgi?id=142688
3250
3251         Caused use-after-free on many tests (Requested by ap on
3252         #webkit).
3253
3254         Reverted changeset:
3255
3256         "Allow clients to selectively disable plug-ins"
3257         https://bugs.webkit.org/show_bug.cgi?id=142506
3258         http://trac.webkit.org/changeset/181483
3259
3260 2015-03-13  Eric Carlson  <eric.carlson@apple.com>
3261
3262         [Mac] Enable WIRELESS_PLAYBACK_TARGET
3263         https://bugs.webkit.org/show_bug.cgi?id=142635
3264
3265         Reviewed by Darin Adler.
3266
3267         * Configurations/FeatureDefines.xcconfig:
3268
3269 2015-03-13  Timothy Horton  <timothy_horton@apple.com>
3270
3271         Sites that use a device-width viewport but don't have enough height to fill the view are scaled up
3272         https://bugs.webkit.org/show_bug.cgi?id=142664
3273         <rdar://problem/18859470>
3274
3275         Reviewed by Benjamin Poulain.
3276
3277         * UIProcess/ios/WKScrollView.mm:
3278         (-[WKScrollView _rubberBandOffsetForOffset:maxOffset:minOffset:range:outside:]):
3279         Now that the WKContentView can (without pinching) be smaller than the unobscured
3280         region of the WKWebView, we need to take that into account when deciding where
3281         to retarget scrolling.
3282
3283 2015-03-13  Mark Lam  <mark.lam@apple.com>
3284
3285         Replace TCSpinLock with a new WTF::SpinLock based on WTF::Atomic.
3286         <https://webkit.org/b/142674>
3287
3288         Reviewed by Filip Pizlo.
3289
3290         * WebProcess/WebPage/EventDispatcher.cpp:
3291         (WebKit::EventDispatcher::EventDispatcher):
3292         * WebProcess/WebPage/EventDispatcher.h:
3293         * WebProcess/WebPage/ViewUpdateDispatcher.cpp:
3294         (WebKit::ViewUpdateDispatcher::ViewUpdateDispatcher):
3295         * WebProcess/WebPage/ViewUpdateDispatcher.h:
3296
3297 2015-03-10  Conrad Shultz  <conrad_shultz@apple.com>
3298
3299         Allow clients to selectively disable plug-ins
3300         https://bugs.webkit.org/show_bug.cgi?id=142506
3301
3302         Reviewed by Anders Carlsson.
3303
3304         Add new functionality allow clients to declaratively disable individual plug-ins (in a manner that conceals them
3305         from the page). As part of this:
3306
3307         1) Introduce the concept of web-visible plug-ins and related concepts, as distinct from the real underlying
3308            set of plug-ins.
3309
3310         2) Where applicable, plumb additional information about plug-ins (specifically, bundle identification) deeper
3311            down the stack.
3312
3313         3) Add generic functionality to PluginStrategy to support filtering plug-ins for visibility and introduce
3314            a concrete implementation thereof in WebPlatformStrategies in WebKit2.
3315
3316         4) Add messaging infrastructure to allow clients to set and clear plug-in policies.
3317
3318         While currently only used in a very limited manner, the new declarative plug-in policies are written generically
3319         so that they could be easily used in the future to reduce synchronous messaging to the client when loading plug-ins.
3320
3321         * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
3322         (WebKit::NetscapePluginModule::getPluginInfo):
3323         Set new PluginInfo members.
3324
3325         * Shared/WebCoreArgumentCoders.cpp:
3326         (IPC::ArgumentCoder<PluginInfo>::encode):
3327         Handle new PluginInfo members.
3328         (IPC::ArgumentCoder<PluginInfo>::decode):
3329         Ditto.
3330
3331         * Shared/WebProcessCreationParameters.h:
3332         Declare a member to store client plug-in policies.
3333
3334         * Shared/WebProcessCreationParameters.cpp:
3335         (WebKit::WebProcessCreationParameters::encode):
3336         Encode the policies.
3337         (WebKit::WebProcessCreationParameters::decode):
3338         Decode the policies.
3339
3340         * UIProcess/API/C/WKAPICast.h:
3341         (WebKit::toWKPluginLoadClientPolicy):
3342         Teach how to cast between WebCore and WebKit2 policy definitions.
3343         (WebKit::toPluginLoadClientPolicy):
3344         Ditto.
3345
3346         * UIProcess/API/C/WKPluginLoadPolicy.h:
3347         Declare WKPluginLoadClientPolicy, matching PluginLoadClientPolicy in WebCore.
3348
3349         * UIProcess/API/C/mac/WKContextPrivateMac.h:
3350         * UIProcess/API/C/mac/WKContextPrivateMac.mm:
3351         (WKContextSetPluginLoadClientPolicy):
3352         New function; wrap WebProcessPool::setPluginLoadClientPolicy().
3353         (WKContextClearPluginClientPolicies):
3354         New function; wrap WebProcessPool::clearPluginClientPolicies().
3355
3356         * UIProcess/WebProcessPool.h:
3357         * UIProcess/WebProcessPool.cpp:
3358         (WebKit::WebProcessPool::createNewWebProcess):
3359         Copy any client plug-in policies to the new process' creation parameters.
3360         (WebKit::WebProcessPool::setPluginLoadClientPolicy):
3361         Send SetPluginLoadClientPolicy to all processes and stash the passed-in policy info.
3362         (WebKit::WebProcessPool::clearPluginClientPolicies):
3363         Send ClearPluginClientPolicies to all processes and clear any stashed policy info.
3364
3365         * WebProcess/Plugins/PDF/PDFPlugin.mm:
3366         (WebKit::PDFPlugin::pluginInfo):
3367         Set new PluginInfo member.
3368
3369         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3370         (WebKit::pluginSupportsExtension):
3371         Adopt getWebVisibleMimesAndPluginIndices().
3372         (WebKit::WebFrameLoaderClient::objectContentType):
3373         Update to reflect reflect function rename.
3374
3375         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
3376         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
3377         (WebKit::WebPlatformStrategies::getPluginInfo):
3378         Pass the Page to populatePluginCache().
3379         (WebKit::WebPlatformStrategies::getWebVisiblePluginInfo):
3380         New member function; wrap getPluginInfo(); if appropriate, filter out plug-ins the client has asked
3381         to block on the current page.
3382         (WebKit::WebPlatformStrategies::setPluginLoadClientPolicy):
3383         New member function; map empty inputs to a wildcard character and insert the new policy into the nested map.
3384         (WebKit::WebPlatformStrategies::clearPluginClientPolicies):
3385         New member function; empty m_hostsToPluginIdentifierData.
3386         (WebKit::WebPlatformStrategies::pluginLoadClientPolicyForHost):
3387         New member function; look up the most specific policy for the given plug-in and host.
3388         (WebKit::WebPlatformStrategies::populatePluginCache):
3389         If appropriate, set the client load policy on the plug-ins; do this irrespective of whether the cache has
3390         been populated since the Page, and therefore host, may change.
3391
3392         * WebProcess/WebPage/WebPage.cpp:
3393         (WebKit::WebPage::canShowMIMEType):
3394         Update to reflect function rename.
3395
3396         * WebProcess/WebProcess.h:
3397         * WebProcess/WebProcess.cpp:
3398         (WebKit::WebProcess::initializeWebProcess):
3399         Enumerate and process the client plug-in policies in the creation parameters.
3400         (WebKit::WebProcess::setPluginLoadClientPolicy):
3401         New member function; wrap PluginStrategy::setPluginLoadClientPolicy.
3402         (WebKit::WebProcess::clearPluginClientPolicies):
3403         New member function; wrap PluginStrategy::clearPluginClientPolicies().
3404
3405         * WebProcess/WebProcess.messages.in:
3406         Add messages for setting and clearing policies.
3407
3408 2015-03-12  Jon Honeycutt  <jhoneycutt@apple.com>
3409
3410         Use UIDocumentMenuViewController to allow selection of files from
3411         iCloud Drive in WKFileUploadPanel
3412
3413         Part of <https://bugs.webkit.org/show_bug.cgi?id=142596> WebKit on
3414         iOS should support file upload from iCloud Drive
3415         <rdar://problem/12178991>
3416
3417         Reviewed by Andy Estes.
3418
3419         * Platform/spi/ios/UIKitSPI.h:
3420         Include UIDocumentMenuViewController_Private.h if it exists. If not,
3421         declare this new SPI.
3422
3423         * UIProcess/ios/forms/WKFileUploadPanel.mm:
3424         (fallbackIconForFile):
3425         Create a UIDocumentInteractionController for the file, and return a
3426         thumbnail image from its smallest icon.
3427
3428         (iconForImageFile):
3429         If we can get a UIImage from the file, create a thumbnail from it.
3430         Otherwise, call fallbackIconForFile().
3431
3432         (iconForVideoFile):
3433         Code moved from -[_WKVideoFileUploadItem displayImage].
3434
3435         (iconForFile):
3436         Get the file's extension, and get the extension's preferred UTI. If the
3437         UTI is an image type, call iconForImageFile(). If it's a video type,
3438         call iconForVideoFile(). Otherwise, return the fallback icon.
3439
3440         (-[_WKFileUploadItem initWithFileURL:]):
3441         Added an initializer that takes a file URL.
3442
3443         (-[_WKFileUploadItem fileURL]):
3444         (-[_WKImageFileUploadItem initWithFileURL:originalImage:]):
3445         (-[_WKVideoFileUploadItem displayImage]):
3446         (WKFileUploadPanel):
3447         Inherit from UIDocumentPickerDelegate and UIDocumentMenuDelegate. Add
3448         an ivar for the document menu controller.
3449
3450         (-[WKFileUploadPanel dealloc]):
3451         (-[WKFileUploadPanel presentWithParameters:resultListener:]):
3452         If instances of UIDocumentMenuViewController respond to
3453         -_setIgnoreApplicationEntitlementForImport:, meaning we can disable the
3454         assertion that the current app has the iCloud Documents entitlement,
3455         then show the document picker menu. Otherwise, show the current source
3456         selection UI. The runtime check will be removed when a newer UIKit is
3457         available.
3458
3459         (UTIsForMIMETypes):
3460         Return the UTIs for the <input> element's "accept" attribute's MIME
3461         type list.
3462
3463         (-[WKFileUploadPanel _mediaTypesForPickerSourceType:]):
3464         Call UTIsForMIMETypes(). Fall back to available source types for this
3465         picker type.
3466
3467         (-[WKFileUploadPanel _documentPickerMenuMediaTypes]):
3468         Call UTIsForMIMETypes(). Fall back to the all-encompassing
3469         "public.item" UTI.
3470
3471         (-[WKFileUploadPanel _photoLibraryButtonLabel]):
3472         (-[WKFileUploadPanel _cameraButtonLabel]):
3473         Factored out of -_showMediaSourceSelectionSheet. Return the
3474         appropriate label for the camera button, based on whether it can take a
3475         photo or video, or return nil if the camera is not available.
3476
3477         (-[WKFileUploadPanel _showMediaSourceSelectionSheet]):
3478         Changed to use -_cameraButtonLabel and
3479         -_presentForCurrentInterfaceIdiom:.
3480
3481         (-[WKFileUploadPanel _showDocumentPickerMenu]):
3482         Create a UIDocumentMenuViewController, and populate it with options to
3483         open the photo library or take a picture or video. If iCloud Drive or
3484         other document sources are available, they will be added automatically.
3485
3486         (-[WKFileUploadPanel _presentForCurrentInterfaceIdiom:]):
3487         (-[WKFileUploadPanel documentMenu:didPickDocumentPicker:]):
3488         (-[WKFileUploadPanel documentMenuWasCancelled:]):
3489         (-[WKFileUploadPanel documentPicker:didPickDocumentAtURL:]):
3490         (-[WKFileUploadPanel documentPickerWasCancelled:]):
3491         (-[WKFileUploadPanel _uploadItemFromMediaInfo:successBlock:failureBlock:]):
3492
3493         (-[_WKImageFileUploadItem initWithFilePath:originalImage:]): Deleted.
3494         (-[_WKImageFileUploadItem fileURL]): Deleted.
3495         (-[_WKVideoFileUploadItem initWithFilePath:mediaURL:]): Deleted.
3496         (-[_WKVideoFileUploadItem fileURL]): Deleted.
3497
3498 2015-03-11  Enrica Casucci  <enrica@apple.com>
3499
3500         Adopt new API for keyboard event handling.
3501         https://bugs.webkit.org/show_bug.cgi?id=142602
3502         rdar://problem/19966087
3503
3504         Reviewed by Sam Weinig.
3505
3506         Adopts the new API.
3507
3508         * UIProcess/ios/WKContentViewInteraction.mm:
3509         (-[WKContentView _didHandleKeyEvent:]):
3510
3511 2015-03-12  Alexey Proskuryakov  <ap@apple.com>
3512
3513         testRunner.setAlwaysAcceptCookies does not work with NetworkProcess
3514         https://bugs.webkit.org/show_bug.cgi?id=138687
3515
3516         Reviewed by Carlos Garcia Campos.
3517
3518         * UIProcess/WebCookieManagerProxy.cpp:
3519         (WebKit::WebCookieManagerProxy::setHTTPCookieAcceptPolicy): Don't change system-wide
3520         cookie accept policy when in testing mode. Also, update the policy in WebProcesses too,
3521         as we still do some networking there.
3522
3523         * UIProcess/WebProcessPool.h:
3524         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
3525         (WKBundleSetAlwaysAcceptCookies): Deleted.
3526         * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
3527         * WebProcess/InjectedBundle/InjectedBundle.cpp:
3528         (WebKit::InjectedBundle::setAlwaysAcceptCookies): Deleted.
3529         * WebProcess/InjectedBundle/InjectedBundle.h:
3530         Remove WKBundleSetAlwaysAcceptCookies SPI, as WKTR now uses an API in UI process.
3531
3532 2015-03-12  Anders Carlsson  <andersca@apple.com>
3533
3534         WKErrorDomain should be declared nonnull
3535         https://bugs.webkit.org/show_bug.cgi?id=142628
3536
3537         Reviewed by Antti Koivisto.
3538
3539         Add WK_ASSUME_NONNULL_BEGIN and WK_ASSUME_NONNULL_END so everything will be implicitly nonnull.
3540
3541         * UIProcess/API/Cocoa/WKError.h:
3542
3543 2015-03-12  Ian Henderson  <ian@ianhenderson.org>
3544
3545         PDFs don't snapshot properly in iOS Safari
3546         https://bugs.webkit.org/show_bug.cgi?id=142623
3547
3548         Reviewed by Tim Horton.
3549
3550         * UIProcess/API/Cocoa/WKWebView.mm:
3551         (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]):
3552         If we have a _customContentView, use UIView snapshotting instead of
3553         trying to snapshot the web page.
3554
3555 2015-03-12  Eric Carlson  <eric.carlson@apple.com>
3556
3557         [Mac] Update AirPlay handling
3558         https://bugs.webkit.org/show_bug.cgi?id=142541
3559
3560         Unreviewed, respond to post-review comments and add previously reviewed changes
3561         missed by a bungled merge.
3562
3563         * Shared/mac/WebCoreArgumentCodersMac.mm:
3564         * UIProcess/WebMediaPlaybackTargetPickerProxy.cpp:
3565         (WebKit::WebMediaPlaybackTargetPickerProxy::~WebMediaPlaybackTargetPickerProxy):
3566         * UIProcess/mac/PageClientImpl.h:
3567         * UIProcess/mac/PageClientImpl.mm:
3568         (WebKit::PageClientImpl::createPlaybackTargetPicker):
3569         * UIProcess/mac/WebMediaPlaybackTargetPickerProxyMac.h: Added.
3570         * UIProcess/mac/WebMediaPlaybackTargetPickerProxyMac.mm: Added.
3571         * WebKit2.xcodeproj/project.pbxproj:
3572         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3573         * WebProcess/WebCoreSupport/WebChromeClient.h:
3574         * WebProcess/WebPage/WebPage.h:
3575         * WebProcess/WebPage/WebPage.messages.in:
3576         * WebProcess/WebPage/mac/WebPageMac.mm:
3577         * WebProcess/com.apple.WebProcess.sb.in:
3578
3579 2015-03-11  Antti Koivisto  <antti@apple.com>
3580
3581         Cache traversal missing large entries
3582         https://bugs.webkit.org/show_bug.cgi?id=142601
3583
3584         Reviewed by Andreas Kling.
3585
3586         When traversing cache entries we only read the header data from disk. This didn't work
3587         correctly for entries larger than the read size.
3588
3589         * NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:
3590         (WebKit::NetworkCache::IOChannel::read):
3591
3592             Partial reads only receive one callback with 'done' set to true.
3593             Ensure we actually return data in this case.
3594
3595         * NetworkProcess/cache/NetworkCacheStorage.cpp:
3596         (WebKit::NetworkCache::decodeEntryHeader):
3597
3598             Add some logging.
3599
3600 2015-03-11  Eric Carlson  <eric.carlson@apple.com>
3601
3602         [Mac] Update AirPlay handling
3603         https://bugs.webkit.org/show_bug.cgi?id=142541
3604
3605         Reviewed by Sam Weinig.
3606
3607         * Shared/WebCoreArgumentCoders.h:
3608         * Shared/mac/WebCoreArgumentCodersMac.mm:
3609         (IPC::ArgumentCoder<AVPlaybackTarget>::encode):
3610         (IPC::ArgumentCoder<AVPlaybackTarget>::decode):
3611         * UIProcess/PageClient.h:
3612         * UIProcess/WebAVPlaybackTargetPickerProxy.cpp: Added.
3613         (WebKit::WebAVPlaybackTargetPickerProxy::WebAVPlaybackTargetPickerProxy):
3614         (WebKit::WebAVPlaybackTargetPickerProxy::~WebAVPlaybackTargetPickerProxy):
3615         (WebKit::WebAVPlaybackTargetPickerProxy::showPlaybackTargetPicker):
3616         (WebKit::WebAVPlaybackTargetPickerProxy::startingMonitoringPlaybackTargets):
3617         (WebKit::WebAVPlaybackTargetPickerProxy::stopMonitoringPlaybackTargets):
3618         * UIProcess/WebAVPlaybackTargetPickerProxy.h: Added.
3619         (WebKit::WebAVPlaybackTargetPickerProxy::Client::~Client):
3620         * UIProcess/WebPageProxy.cpp:
3621         (WebKit::WebPageProxy::devicePickerProxy):
3622         (WebKit::WebPageProxy::showPlaybackTargetPicker):
3623         (WebKit::WebPageProxy::startingMonitoringPlaybackTargets):
3624         (WebKit::WebPageProxy::stopMonitoringPlaybackTargets):
3625         (WebKit::WebPageProxy::didChoosePlaybackTarget):
3626         (WebKit::WebPageProxy::externalOutputDeviceAvailableDidChange):
3627         * UIProcess/WebPageProxy.h:
3628         * UIProcess/WebPageProxy.messages.in:
3629         * UIProcess/mac/PageClientImpl.h:
3630         * UIProcess/mac/PageClientImpl.mm:
3631         (WebKit::PageClientImpl::createPlaybackTargetPicker):
3632         * UIProcess/mac/WebAVPlaybackTargetPickerProxyMac.h: Added.
3633         * UIProcess/mac/WebAVPlaybackTargetPickerProxyMac.mm: Added.
3634         (WebKit::WebAVPlaybackTargetPickerProxyMac::create):
3635         (WebKit::WebAVPlaybackTargetPickerProxyMac::WebAVPlaybackTargetPickerProxyMac):
3636         (WebKit::WebAVPlaybackTargetPickerProxyMac::~WebAVPlaybackTargetPickerProxyMac):
3637         (WebKit::WebAVPlaybackTargetPickerProxyMac::outputeDeviceAvailabilityChangedTimerFired):
3638         (WebKit::WebAVPlaybackTargetPickerProxyMac::availableDevicesDidChange):
3639         (WebKit::WebAVPlaybackTargetPickerProxyMac::devicePicker):
3640         (WebKit::WebAVPlaybackTargetPickerProxyMac::showPlaybackTargetPicker):
3641         (WebKit::WebAVPlaybackTargetPickerProxyMac::currentDeviceDidChange):
3642         (WebKit::WebAVPlaybackTargetPickerProxyMac::startingMonitoringPlaybackTargets):
3643         (WebKit::WebAVPlaybackTargetPickerProxyMac::stopMonitoringPlaybackTargets):
3644         (-[WebAVOutputDevicePickerMenuControllerHelper initWithCallback:]):
3645         (-[WebAVOutputDevicePickerMenuControllerHelper clearCallback]):
3646         (-[WebAVOutputDevicePickerMenuControllerHelper observeValueForKeyPath:ofObject:change:context:]):
3647         * WebKit2.xcodeproj/project.pbxproj:
3648         * WebProcess/WebCoreSupport/WebAVPlaybackTargetPicker.cpp: Added.
3649         (WebKit::WebAVPlaybackTargetPicker::WebAVPlaybackTargetPicker):
3650         (WebKit::WebAVPlaybackTargetPicker::showPlaybackDevicePicker):
3651         (WebKit::WebAVPlaybackTargetPicker::configureWireLessTargetMonitoring):
3652         (WebKit::WebAVPlaybackTargetPicker::addClient):
3653         (WebKit::WebAVPlaybackTargetPicker::removeClient):
3654         (WebKit::WebAVPlaybackTargetPicker::didChoosePlaybackTarget):
3655         (WebKit::WebAVPlaybackTargetPicker::playbackTargetAvailabilityDidChange):
3656         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3657         (WebKit::WebChromeClient::showPlaybackTargetPicker):
3658         (WebKit::WebChromeClient::startingMonitoringPlaybackTargets):
3659         (WebKit::WebChromeClient::stopMonitoringPlaybackTargets):
3660         * WebProcess/WebCoreSupport/WebChromeClient.h:
3661         * WebProcess/WebPage/WebPage.h:
3662         * WebProcess/WebPage/WebPage.messages.in:
3663         * WebProcess/WebPage/mac/WebPageMac.mm:
3664         (WebKit::WebPage::playbackTargetSelected):
3665         (WebKit::WebPage::playbackTargetAvailabilityDidChange):
3666         * WebProcess/com.apple.WebProcess.sb.in:
3667
3668 2015-03-11  Myles C. Maxfield  <mmaxfield@apple.com>
3669
3670         Fix the build
3671
3672         Unreviewed.
3673
3674         * Shared/Downloads/mac/DownloadMac.mm:
3675         (WebKit::Download::start):
3676         (WebKit::Download::resume):
3677
3678 2015-03-10  Sam Weinig  <sam@webkit.org>
3679
3680         Allow adding a button in input elements for auto fill related functionality
3681         <rdar://problem/19782066>
3682         https://bugs.webkit.org/show_bug.cgi?id=142564
3683
3684         Reviewed by Anders Carlsson.
3685
3686         - Adds new SPI to respond to clicks on the AutoFill button (both bundle and UIProcess).
3687         - Adds new SPI to enable/disable the display of the AutoFill button on an element.
3688         - Adds new SPI to get the bounds of the AutoFill button.
3689         - Updates spelling of AutoFill to be consistent.
3690
3691         * UIProcess/API/APIUIClient.h:
3692         (API::UIClient::didClickAutoFillButton):
3693         * UIProcess/API/C/WKPage.cpp:
3694         (WKPageSetPageUIClient):
3695         * UIProcess/API/C/WKPageUIClient.h:
3696         * UIProcess/WebPageProxy.cpp:
3697         (WebKit::WebPageProxy::handleAutoFillButtonClick):
3698         * UIProcess/WebPageProxy.h:
3699         * UIProcess/WebPageProxy.messages.in:
3700         * WebProcess/InjectedBundle/API/APIInjectedBundlePageUIClient.h:
3701         (API::InjectedBundle::PageUIClient::didClickAutoFillButton):
3702         * WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp:
3703         (WebKit::InjectedBundlePageUIClient::didClickAutoFillButton):
3704         * WebProcess/InjectedBundle/InjectedBundlePageUIClient.h:
3705         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3706         (WebKit::WebChromeClient::handleAutoFillButtonClick):
3707         * WebProcess/WebCoreSupport/WebChromeClient.h:
3708         * WebProcess/InjectedBundle/API/c/WKBundlePageUIClient.h:
3709         Pipe the didClickAutoFillButton to the SPI layer.
3710
3711         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.mm:
3712         (-[WKWebProcessPlugInNodeHandle HTMLInputElementIsAutoFilled]):
3713         (-[WKWebProcessPlugInNodeHandle setHTMLInputElementIsAutoFilled:]):
3714         Update for new spelling of AutoFill.
3715
3716         * WebProcess/InjectedBundle/API/c/WKBundleNodeHandlePrivate.h:
3717         * WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp:
3718         (WKBundleNodeHandleGetHTMLInputElementAutoFilled):
3719         (WKBundleNodeHandleSetHTMLInputElementAutoFilled):
3720         Added. Replaces WKBundleNodeHandleGetHTMLInputElementAutofilled/WKBundleNodeHandleSetHTMLInputElementAutofilled
3721         which are now deprecated due to inconsistent spelling of AutoFill.
3722
3723         (WKBundleNodeHandleGetHTMLInputElementAutoFillButtonEnabled):
3724         (WKBundleNodeHandleSetHTMLInputElementAutoFillButtonEnabled):
3725         (WKBundleNodeHandleGetHTMLInputElementAutoFillButtonBounds):
3726         Added.
3727
3728         (WKBundleNodeHandleGetHTMLInputElementAutofilled):
3729         (WKBundleNodeHandleSetHTMLInputElementAutofilled):
3730         Deprecated.
3731
3732         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
3733         (WebKit::InjectedBundleNodeHandle::getOrCreate):
3734         (WebKit::InjectedBundleNodeHandle::create):
3735         (WebKit::InjectedBundleNodeHandle::InjectedBundleNodeHandle):
3736         (WebKit::InjectedBundleNodeHandle::~InjectedBundleNodeHandle):
3737         (WebKit::InjectedBundleNodeHandle::coreNode):
3738         (WebKit::InjectedBundleNodeHandle::document):
3739         (WebKit::InjectedBundleNodeHandle::elementBounds):
3740         (WebKit::InjectedBundleNodeHandle::renderRect):
3741         (WebKit::InjectedBundleNodeHandle::renderedImage):
3742         (WebKit::InjectedBundleNodeHandle::visibleRange):
3743         (WebKit::InjectedBundleNodeHandle::setHTMLInputElementValueForUser):
3744         (WebKit::InjectedBundleNodeHandle::isHTMLInputElementAutoFilled):
3745         (WebKit::InjectedBundleNodeHandle::setHTMLInputElementAutoFilled):
3746         (WebKit::InjectedBundleNodeHandle::isHTMLInputElementAutoFillButtonEnabled):
3747         (WebKit::InjectedBundleNodeHandle::setHTMLInputElementAutoFillButtonEnabled):
3748         (WebKit::InjectedBundleNodeHandle::htmlInputElementAutoFillButtonBounds):
3749         (WebKit::InjectedBundleNodeHandle::htmlInputElementLastChangeWasUserEdit):
3750         (WebKit::InjectedBundleNodeHandle::htmlTextAreaElementLastChangeWasUserEdit):
3751         (WebKit::InjectedBundleNodeHandle::isTextField):
3752         (WebKit::InjectedBundleNodeHandle::htmlTableCellElementCellAbove):
3753         (WebKit::InjectedBundleNodeHandle::documentFrame):
3754         (WebKit::InjectedBundleNodeHandle::htmlFrameElementContentFrame):
3755         (WebKit::InjectedBundleNodeHandle::htmlIFrameElementContentFrame):
3756         (WebKit::InjectedBundleNodeHandle::isHTMLInputElementAutofilled): Deleted.
3757         (WebKit::InjectedBundleNodeHandle::setHTMLInputElementAutofilled): Deleted.
3758         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h:
3759         Fix-up InjectedBundleNodeHandle to store its underlying Node in a Ref, rather than a RefPtr.
3760         Add helpers to implement the new SPI for WKBundleNodeHandleRef.
3761
3762 2015-03-11  Timothy Horton  <timothy_horton@apple.com>
3763
3764         Make it possible to zoom on pages that claim to lay out to device size and then fail to do so
3765         https://bugs.webkit.org/show_bug.cgi?id=142549
3766
3767         Reviewed by Simon Fraser.
3768
3769         * Shared/WebPreferencesDefinitions.h:
3770         * WebProcess/WebPage/WebPage.cpp:
3771         (WebKit::WebPage::updatePreferences):
3772         Flip the pref on by default.
3773
3774 2015-03-11  Carlos Garcia Campos  <cgarcia@igalia.com>
3775
3776         [GTK] Do not look for child processes in the UI process binary path
3777         https://bugs.webkit.org/show_bug.cgi?id=135752
3778
3779         Reviewed by Gustavo Noronha Silva.
3780
3781         It's only useful for internal tools and tests, but never when
3782         installed, since we don't install the processes in the bin dir but
3783         in the libexec dir.
3784
3785         * Shared/gtk/ProcessExecutablePathGtk.cpp:
3786         (WebKit::findWebKitProcess): Only look or the executables in the
3787         UI process binary path or WEBKIT_EXEC_PATH for development builds.
3788         * UIProcess/API/gtk/WebKitWebContext.cpp:
3789         (injectedBundleDirectory): Only check
3790         WEBKIT_INJECTED_BUNDLE_PATH env var for development builds.
3791
3792 2015-03-10  Antti Koivisto  <antti@apple.com>
3793
3794         Add interface to delete disk cache entries
3795         https://bugs.webkit.org/show_bug.cgi?id=142546
3796
3797         Reviewed by Anders Carlsson.
3798
3799         * NetworkProcess/cache/NetworkCache.cpp:
3800         (WebKit::NetworkCache::Cache::remove):
3801         * NetworkProcess/cache/NetworkCache.h:
3802         * NetworkProcess/cache/NetworkCacheStorage.cpp:
3803         (WebKit::NetworkCache::Storage::Storage):
3804         (WebKit::NetworkCache::Storage::remove):
3805
3806             Move deletion to a serial queue so we can't create large number of threads.
3807
3808         (WebKit::NetworkCache::Storage::dispatchReadOperation):
3809         (WebKit::NetworkCache::Storage::dispatchHeaderWriteOperation):
3810         (WebKit::NetworkCache::Storage::removeEntry): Deleted.
3811         * NetworkProcess/cache/NetworkCacheStorage.h:
3812         (WebKit::NetworkCache::Storage::deleteQueue):
3813
3814 2015-03-10  Chris Dumez  <cdumez@apple.com>
3815
3816         5 tests fail on Apple Mac WK2 performance bots
3817         https://bugs.webkit.org/show_bug.cgi?id=142485
3818
3819         Reviewed by Andreas Kling.
3820
3821         Only log errors in debug builds if SandboxExtension::createHandle() fails
3822         so that performance tests don't fail because of it. Such error is not
3823         fatal and is expected under certain circumstances. In particular,
3824         SandboxExtension::createHandle() is sometimes called for non-existing
3825         files (e.g. from NetworkResourceLoadParameters::encode()).
3826
3827         * Shared/mac/SandboxExtensionMac.mm:
3828         (WebKit::SandboxExtension::createHandle):
3829
3830 2015-03-10  Timothy Horton  <timothy_horton@apple.com>
3831
3832         Fix the build
3833
3834         * Shared/Downloads/ios/DownloadIOS.mm:
3835         (WebKit::Download::startWithHandle):
3836         * UIProcess/Network/CustomProtocols/mac/CustomProtocolManagerProxyMac.mm:
3837         (-[WKCustomProtocolLoader initWithCustomProtocolManagerProxy:customProtocolID:request:connection:]):
3838
3839 2015-03-10  Carlos Garcia Campos  <cgarcia@igalia.com>
3840
3841         [GTK] Contents not shown when entering AC mode unless the window is resized
3842         https://bugs.webkit.org/show_bug.cgi?id=142347
3843
3844         Reviewed by Žan Doberšek.
3845
3846         The problem is once again that we are now creating the redirected
3847         X window in realize method. When entering AC mode we resize the
3848         redirected window to the drawing area size. Since the size hasn't
3849         changed from the drawing area point of view, the web process is
3850         not notified. The WebProcess always uses the window size, instead
3851         of the root layer size, to make sure it's in sync, see the comment
3852         in LayerTreeHostGtk::compositeLayersToContext(). So, we need to
3853         enforce a resize when we change the size of the redirected window
3854         when entering AC mode.
3855
3856         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
3857         (webkitWebViewBaseEnterAcceleratedCompositingMode):
3858         * UIProcess/DrawingAreaProxyImpl.h:
3859         (WebKit::DrawingAreaProxyImpl::forceResize):
3860
3861 2015-03-10  Csaba Osztrogonác  <ossy@webkit.org>
3862
3863         [cmake] Handle unused parameter warnings as build errors except in WebKit2
3864         https://bugs.webkit.org/show_bug.cgi?id=142338
3865
3866         Reviewed by Gyuyoung Kim.
3867
3868         * CMakeLists.txt:
3869
3870 2015-03-10  Dan Bernstein  <mitz@apple.com>
3871
3872         WebKit2 part of <rdar://problem/20086546> [Cocoa] Add an option to treat certificate chains with SHA1-signed certificates as insecure
3873         https://bugs.webkit.org/show_bug.cgi?id=142461
3874
3875         Reviewed by Sam Weinig.
3876
3877         * UIProcess/API/Cocoa/WKWebView.mm:
3878         (-[WKWebView initWithFrame:configuration:]): Initialize
3879         webPageConfiguration.treatsSHA1SignedCertificatesAsInsecure from the WKWebViewConfiguration.
3880
3881         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
3882         Added _treatsSHA1SignedCertificatesAsInsecure ivar.
3883         (-[WKWebViewConfiguration copyWithZone:]): Copy _treatsSHA1SignedCertificatesAsInsecure.
3884         (-[WKWebViewConfiguration _treatsSHA1SignedCertificatesAsInsecure]): Added this getter.
3885         (-[WKWebViewConfiguration _setTreatsSHA1SignedCertificatesAsInsecure:]): Added this setter.
3886
3887         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h: Declared new
3888         _treatsSHA1SignedCertificatesAsInsecure property.
3889
3890         * UIProcess/PageLoadState.cpp:
3891         (WebKit::PageLoadState::didCommitLoad): Use new hasInsecureContent parameter to initialize
3892         hasInsecureContent parameter in the uncommitted state.
3893         * UIProcess/PageLoadState.h:
3894
3895         * UIProcess/WebPageProxy.cpp:
3896         (WebKit::WebPageProxy::WebPageProxy): Initialize new m_treatsSHA1CertificatesAsInsecure
3897         member variable from the WebPageConfiguration.
3898         (WebKit::WebPageProxy::didCommitLoadForFrame): Pass true for the new hasInsecureContent to
3899         PageLoadState::didCommitLoad if we are treating SHA1-signed certificates as insecure and
3900         the certificate info contains a non-root SHA1-signed certificate.
3901         * UIProcess/WebPageProxy.h: Added m_treatsSHA1CertificatesAsInsecure member variable.
3902
3903 2015-03-09  Geoffrey Garen  <ggaren@apple.com>
3904
3905         bmalloc: tryFastMalloc shouldn't crash
3906         https://bugs.webkit.org/show_bug.cgi?id=142443
3907
3908         Reviewed by Anders Carlsson.
3909
3910         Part 1: Stop using tryFastRealloc.
3911
3912         * Shared/ShareableBitmap.cpp:
3913         (WebKit::ShareableBitmap::resize): Deleted.
3914         * Shared/ShareableBitmap.h: Removed the resize function because it has
3915         no clients.
3916
3917         * WebProcess/Plugins/PluginProxy.cpp:
3918         (WebKit::PluginProxy::updateBackingStore): Changed to allocate a new
3919         backing store instead of resizing the old one. This has three advantages:
3920
3921         (1) Might be more memory-efficient, since you don't have to keep the old
3922         one around while allocating the new one.
3923
3924         (2) Avoids the overhead of realloc() copying the contents of the old
3925         backing store even though we only want uninitialized memory.
3926
3927         (3) Makes resize failure consistent with initial allocation failure.
3928         Previously, while initial allocation failure would set the backing store
3929         to null, resize failure would keep the old wrong backing store and then
3930         tell it not to paint. Now, resize failure also sets the backing store to
3931         null.
3932
3933 2015-03-09  Martin Robinson  <mrobinson@igalia.com>
3934
3935         [EFL] Move DispatchQueue to WTF
3936         https://bugs.webkit.org/show_bug.cgi?id=142493
3937
3938         Reviewed by Csaba Osztrogonác.
3939
3940         * PlatformEfl.cmake: Remove DispatchQueue from the source list.
3941
3942 2015-03-08  Dean Jackson  <dino@apple.com>
3943
3944         [iOS Media] Video buffer progress missing on iPhones
3945         https://bugs.webkit.org/show_bug.cgi?id=142462
3946
3947         Reviewed by Eric Carlson.
3948
3949         Coordinate the SetBufferedTime message between the Web and UI
3950         processes.
3951
3952         * UIProcess/ios/WebVideoFullscreenManagerProxy.messages.in: New message SetBufferedTime.
3953         * WebProcess/ios/WebVideoFullscreenManager.h:
3954         * WebProcess/ios/WebVideoFullscreenManager.mm:
3955         (WebKit::WebVideoFullscreenManager::setBufferedTime):
3956
3957 2015-03-08  Sam Weinig  <sam@webkit.org>
3958
3959         [Content Extensions] Add scaffolding for the WKUserContentExtensionStore
3960         https://bugs.webkit.org/show_bug.cgi?id=142464
3961
3962         Reviewed by Dan Bernstein.
3963
3964         * Shared/API/APIObject.h:
3965         Add a UserContentExtensionStore type and move the UserContentExtension type into the correct section (UIProcess).
3966
3967         * Shared/API/c/WKBase.h:
3968         Add the WKUserContentExtensionStoreRef C-SPI type.
3969
3970         * Shared/Cocoa/APIObject.mm:
3971         (API::Object::newObject):
3972         Add allocation support for UserContentExtensionStore (and UserContentExtension while we are there, it will be
3973         needed shortly).
3974
3975         * UIProcess/API/APIUserContentExtensionStore.cpp: Added.
3976         (API::UserContentExtensionStore::UserContentExtensionStore):
3977         (API::UserContentExtensionStore::~UserContentExtensionStore):
3978         * UIProcess/API/APIUserContentExtensionStore.h: Added.
3979         Stub out the UserContentExtensionStore.
3980
3981         * UIProcess/API/C/WKAPICast.h:
3982         Add casting for the UserContentExtensionStore.
3983
3984         * UIProcess/API/C/WKUserContentExtensionStoreRef.cpp: Added.
3985         (WKUserContentExtensionStoreGetTypeID):
3986         * UIProcess/API/C/WKUserContentExtensionStoreRef.h: Added.
3987         * UIProcess/API/Cocoa/_WKUserContentExtensionStore.h: Added.
3988         * UIProcess/API/Cocoa/_WKUserContentExtensionStore.mm: Added.
3989         (-[_WKUserContentExtensionStore init]):
3990         (-[_WKUserContentExtensionStore dealloc]):
3991         (-[_WKUserContentExtensionStore _apiObject]):
3992         * UIProcess/API/Cocoa/_WKUserContentExtensionStoreInternal.h: Added.
3993         (WebKit::wrapper):
3994         Stub out SPI for the UserContentExtensionStore.
3995
3996         * WebKit2.xcodeproj/project.pbxproj:
3997         * CMakeLists.txt:
3998         Add new files.
3999
4000 2015-03-08  Sam Weinig  <sam@webkit.org>
4001
4002         AX: Expose a frame's accessible name through WK2 C SPI
4003         <rdar://problem/19653068>
4004         https://bugs.webkit.org/show_bug.cgi?id=142468
4005
4006         Reviewed by Dan Bernstein.
4007
4008         * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
4009         (WKBundleFrameSetAccessibleName):
4010         * WebProcess/InjectedBundle/API/c/WKBundleFrame.h:
4011         * WebProcess/WebPage/WebFrame.cpp:
4012         (WebKit::WebFrame::setAccessibleName):
4013         * WebProcess/WebPage/WebFrame.h:
4014         Add SPI to set a frame's accessible name. This matches the Legacy WebKit SPI -[WebFrame setAccessibleName:]. 
4015
4016 2015-03-08  Sam Weinig  <sam@webkit.org>
4017
4018         [Content Extensions] Pass compiled content extensions as read-only shared memory rather than copying them
4019         https://bugs.webkit.org/show_bug.cgi?id=142458
4020
4021         Reviewed by Dan Bernstein.
4022
4023         * Shared/WebCompiledContentExtensionData.cpp:
4024         (WebKit::WebCompiledContentExtensionData::encode):
4025         (WebKit::WebCompiledContentExtensionData::decode):
4026         * Shared/WebCompiledContentExtensionData.h:
4027         (WebKit::WebCompiledContentExtensionData::WebCompiledContentExtensionData):
4028         Store the compiled data as a SharedMemory block with offset/size pairs for the
4029         bytecode and actions. While the bytecode offset is currently always 0, this won't
4030         be the case when we map these in from files due to metadata that will be placed
4031         at the top of the files.
4032
4033         * Shared/WebCompiledContentExtension.h:
4034         * Shared/WebCompiledContentExtension.cpp:
4035         (WebKit::WebCompiledContentExtension::createFromCompiledContentExtensionData):
4036         Temporary creation helper. In subsequent patches, this will be removed and replaced
4037         by always passing in shared/mapped data.
4038
4039         (WebKit::WebCompiledContentExtension::create):
4040         (WebKit::WebCompiledContentExtension::WebCompiledContentExtension):
4041         (WebKit::WebCompiledContentExtension::bytecode):
4042         (WebKit::WebCompiledContentExtension::bytecodeLength):
4043         (WebKit::WebCompiledContentExtension::actions):
4044         (WebKit::WebCompiledContentExtension::actionsLength):
4045         Convert to work with the new WebCompiledContentExtension format.
4046         
4047         * UIProcess/API/C/WKUserContentFilterRef.cpp:
4048         (WKUserContentFilterCreate):
4049         * UIProcess/API/Cocoa/_WKUserContentFilter.mm:
4050         (-[_WKUserContentFilter initWithName:serializedRules:]):
4051         Switch to using WebCompiledContentExtension::createFromCompiledContentExtensionData().
4052
4053         * WebProcess/UserContent/WebUserContentController.cpp:
4054         (WebKit::WebUserContentController::addUserContentExtensions):
4055         * WebProcess/WebPage/WebPageGroupProxy.cpp:
4056         (WebKit::WebPageGroupProxy::addUserContentExtension):
4057         Update to pass the WebCompiledContentExtensionData directly to the WebCompiledContentExtension.
4058
4059 2015-03-08  Carlos Garcia Campos  <cgarcia@igalia.com>
4060
4061         Remove willDestroyFrame in WKBundlePageLoaderClient
4062         https://bugs.webkit.org/show_bug.cgi?id=142389
4063
4064         Reviewed by Anders Carlsson.
4065
4066         I added willDestroyFrame in r154540 but I realized recently that
4067         it has never actually worked. Adding the callback to
4068         WKBundlePageLoaderClient was the first mistake, since frames are
4069         handled by WebProcess and DidDestroyFrame message is indeed a
4070         WebProcessProxy not a WebPageProxy one. Second mistake was calling
4071         the callback from WebFrameLoaderClient::frameLoaderDestroyed(),
4072         since at that point the frame has already been detached from the
4073         page and so WebFrame::page() always returns nullptr. So, this in
4074         fact dead code and since r180211 nobody is using it.
4075
4076         * WebProcess/InjectedBundle/API/c/WKBundlePageLoaderClient.h:
4077         * WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp:
4078         (webkitWebPageCreate): Use verion 6 instead of version 7 of loader client.
4079         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp:
4080         (WebKit::InjectedBundlePageLoaderClient::willDestroyFrame): Deleted.
4081         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
4082      &nb