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