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