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