Non-local keyboards don't update scroll view parameters
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2015-04-15  Tim Horton  <timothy_horton@apple.com>
2
3         Non-local keyboards don't update scroll view parameters
4         https://bugs.webkit.org/show_bug.cgi?id=143791
5         <rdar://problem/18974020>
6
7         * Platform/spi/ios/UIKitSPI.h:
8         Fix the build.
9
10 2015-04-15  Tim Horton  <timothy_horton@apple.com>
11
12         Non-local keyboards don't update scroll view parameters
13         https://bugs.webkit.org/show_bug.cgi?id=143791
14         <rdar://problem/18974020>
15
16         Reviewed by Enrica Casucci.
17
18         * UIProcess/API/Cocoa/WKWebView.mm:
19         (-[WKWebView _shouldUpdateKeyboardWithInfo:]):
20         (-[WKWebView _keyboardWillChangeFrame:]):
21         (-[WKWebView _keyboardWillShow:]):
22         Make sure that we update scroll view parameters (obscured insets, etc.)
23         if we have a non-local keyboard, in addition to the cases where we have an assisted node.
24
25 2015-04-15  Dan Bernstein  <mitz@apple.com>
26
27         <rdar://problem/20549298> No matching __NSi_ definition for postprocessed value of WK_{MAC,IOS}_TBA
28         https://bugs.webkit.org/show_bug.cgi?id=143786
29
30         Reviewed by Anders Carlsson.
31
32         * Shared/API/Cocoa/WKFoundation.h: Added a placeholder for the postprocessing script to
33         insert a definition of __NSi_* for the current deployment target. Import CoreFoundation.h so
34         that we can check if the macro is already defined.
35         * WebKit2.xcodeproj/project.pbxproj: In the Postprocess WKFoundation.h script build phase,
36         replace the placeholder with a definition of __NSi_{current deployment target} if not
37         already defined.
38
39 2015-04-14  Anders Carlsson  <andersca@apple.com>
40
41         Make creating send rights from shared memory more robust
42         https://bugs.webkit.org/show_bug.cgi?id=143730
43         rdar://problem/16595870
44
45         Reviewed by Darin Adler.
46
47         This cleans up creation of handles and send rights and also fixes a bug where it would be impossible
48         to send more than 128 MB of shared memory in a single object.
49
50         * Platform/SharedMemory.h:
51         * Platform/mac/SharedMemoryMac.cpp:
52         (WebKit::makeMemoryEntry):
53         New helper function that creates a memory entry send right. This uses MAP_MEM_VM_SHARE which ensures
54         that memory objects larger than 128 MB will be handled correctly.
55
56         (WebKit::SharedMemory::create):
57         Call makeMemoryEntry.
58
59         (WebKit::SharedMemory::createHandle):
60         Call createSendRight.
61
62         (WebKit::SharedMemory::createSendRight):
63         Call makeMemoryEntry and add the necessary assertions.
64
65 2015-04-15  Eric Carlson  <eric.carlson@apple.com>
66
67         Generalize "isPlayingAudio" to include other media characteristics
68         https://bugs.webkit.org/show_bug.cgi?id=143713
69
70         Reviewed by Jer Noble.
71
72         * UIProcess/API/C/WKPage.cpp:
73         (toGenericCallbackFunction): Scope CallbackBase.
74         (WKPageForceRepaint): Ditto.
75         (WKPageValidateCommand): Ditto.
76         (WKPageComputePagesForPrinting): Ditto.
77
78         * UIProcess/API/Cocoa/_WKThumbnailView.mm:
79         (-[_WKThumbnailView _requestSnapshotIfNeeded]): Ditto.
80
81         * UIProcess/API/mac/WKView.mm:
82         (-[WKView becomeFirstResponder]): Ditto.
83         (-[WKView updateFontPanelIfNeeded]): Ditto.
84         (-[WKView validateUserInterfaceItem:]): Ditto.
85         (-[WKView startSpeaking:]): Ditto.
86         (-[WKView selectedRangeWithCompletionHandler:]): Ditto.
87         (-[WKView markedRangeWithCompletionHandler:]): Ditto.
88         (-[WKView hasMarkedTextWithCompletionHandler:]): Ditto.
89         (-[WKView attributedSubstringForProposedRange:completionHandler:]): Ditto.
90         (-[WKView firstRectForCharacterRange:completionHandler:]): Ditto.
91         (-[WKView characterIndexForPoint:completionHandler:]): Ditto.
92
93         * UIProcess/WebPageProxy.cpp:
94         (WebKit::WebPageProxy::isPlayingMediaDidChange): Rename from isPlayingAudioDidChange.
95         (WebKit::WebPageProxy::isPlayingAudioDidChange): Deleted.
96         * UIProcess/WebPageProxy.h:
97
98         * UIProcess/WebPageProxy.messages.in:
99
100         * UIProcess/mac/WKFullScreenWindowController.mm:
101         (-[WKFullScreenWindowController dealloc]): Scope CallbackBase.
102         (-[WKFullScreenWindowController finishedExitFullScreenAnimation:]): Ditto.
103
104         * UIProcess/mac/WKPrintingView.mm:
105         (-[WKPrintingView _preparePDFDataForPrintingOnSecondaryThread]): Ditto.
106         (-[WKPrintingView _askPageToComputePageRects]): Ditto.
107         (-[WKPrintingView _drawPreview:]): Ditto.
108
109         * WebProcess/Plugins/PluginView.cpp:
110         (WebKit::PluginView::setPluginIsPlayingAudio):
111         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
112         (WebKit::WebChromeClient::isPlayingMediaDidChange):
113         (WebKit::WebChromeClient::isPlayingAudioDidChange): Deleted.
114         * WebProcess/WebCoreSupport/WebChromeClient.h:
115
116 2015-04-15  Antti Koivisto  <antti@apple.com>
117
118         Network Cache: Add thread-safe accessors for storage paths
119         https://bugs.webkit.org/show_bug.cgi?id=143668
120
121         Reviewed by Darin Adler.
122
123         Less need to use StringCapture.
124
125         * NetworkProcess/cache/NetworkCache.cpp:
126         (WebKit::NetworkCache::Cache::dumpFilePath):
127         (WebKit::NetworkCache::Cache::storagePath):
128         * NetworkProcess/cache/NetworkCacheStorage.cpp:
129         (WebKit::NetworkCache::makeRecordsDirectoryPath):
130         (WebKit::NetworkCache::Storage::Storage):
131         (WebKit::NetworkCache::Storage::basePath):
132         (WebKit::NetworkCache::Storage::versionPath):
133         (WebKit::NetworkCache::Storage::recordsPath):
134         (WebKit::NetworkCache::Storage::synchronize):
135         (WebKit::NetworkCache::Storage::remove):
136         (WebKit::NetworkCache::Storage::dispatchReadOperation):
137         (WebKit::NetworkCache::Storage::finishReadOperation):
138         (WebKit::NetworkCache::Storage::dispatchWriteOperation):
139         (WebKit::NetworkCache::Storage::traverse):
140         (WebKit::NetworkCache::Storage::clear):
141         (WebKit::NetworkCache::Storage::shrink):
142         (WebKit::NetworkCache::Storage::deleteOldVersions):
143         (WebKit::NetworkCache::makeRecordDirectoryPath): Deleted.
144         * NetworkProcess/cache/NetworkCacheStorage.h:
145         (WebKit::NetworkCache::Storage::baseDirectoryPath): Deleted.
146         (WebKit::NetworkCache::Storage::directoryPath): Deleted.
147
148 2015-04-14  Tim Horton  <timothy_horton@apple.com>
149
150         Update gesture swipe shadow style
151         https://bugs.webkit.org/show_bug.cgi?id=143616
152         <rdar://problem/19295843>
153
154         Reviewed by Darin Adler.
155
156         * UIProcess/mac/ViewGestureController.h:
157         * UIProcess/mac/ViewGestureControllerMac.mm:
158         (WebKit::ViewGestureController::beginSwipeGesture):
159         For the modern shadow style, use a layer stretched along the edge of the swiping content
160         with the newly added PNGs as the layer contents.
161
162         Add a dimming layer over the lower layer of content which fades in/out
163         during the swipe.
164
165         (WebKit::ViewGestureController::handleSwipeGesture):
166         Fade the dimming layer in and out during the entire swipe.
167         Fade the shadow layer out during the last few pixels of the swipe.
168
169         (WebKit::ViewGestureController::removeSwipeSnapshot):
170         Unparent the new layers.
171
172         * WebKit2.xcodeproj/project.pbxproj:
173         * Resources/SwipeShadow.png:
174         * Resources/SwipeShadow@2x.png:
175         Add the new resources.
176
177 2015-04-14  Brian Weinstein  <bweinstein@apple.com>
178
179         Add SPI to clear HSTS hosts added since a date.
180         https://bugs.webkit.org/show_bug.cgi?id=143726
181         and
182         rdar://problem/16664597
183
184         Reviewed by Anders Carlsson.
185
186         * UIProcess/API/C/mac/WKContextPrivateMac.h:
187         * UIProcess/API/C/mac/WKContextPrivateMac.mm:
188         (WKContextResetHSTSHostsAddedAfterDate): Call into the WebProcessPool.
189         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
190         (WebKit::WebProcessPool::resetHSTSHostsAddedAfterDate): Call CFNetwork SPI to clear HSTS hosts added
191         after the given date.
192         * UIProcess/WebProcessPool.h:
193
194 2015-04-14  Anders Carlsson  <andersca@apple.com>
195
196         More work on making the SharedMemory interface more sane
197         https://bugs.webkit.org/show_bug.cgi?id=143718
198
199         Reviewed by Andreas Kling.
200
201         Get rid of m_shouldVMDeallocateData. The idea is that shared memory created by calling
202         SharedMemory::allocate has a non-null m_data pointer, and a null m_port. Shared memory created
203         by calling SharedMemory::create with a pointer and a length has a non-null port but a null m_data
204         since the data can be unmapped by the caller and we don't want to hold on to dangling pointers.
205
206         * Platform/SharedMemory.h:
207         (WebKit::SharedMemory::data):
208         * Platform/mac/SharedMemoryMac.cpp:
209         (WebKit::SharedMemory::allocate):
210         (WebKit::SharedMemory::create):
211         (WebKit::SharedMemory::map):
212         (WebKit::SharedMemory::~SharedMemory):
213         (WebKit::SharedMemory::createHandle):
214
215 2015-04-14  Antti Koivisto  <antti@apple.com>
216
217         Network Cache: Deduplicate body data
218         https://bugs.webkit.org/show_bug.cgi?id=143652
219
220         Reviewed by Darin Adler.
221
222         It is common to have cache entries with identical body data. This happens when the same resource is loaded from
223         a different URL (https vs http, slash vs no-slash at end, etc.). It also happens when the same URL is
224         referenced from different cache partitions.
225
226         We can improve disk space efficiency and use less memory by sharing identical body data between cache entries.
227
228         This patch splits the body data out from the record file. The new record file contains meta data and response
229         headers only. Body data is stored using the new BlobStorage interface. Files are deduplicated by computing
230         SHA1 hash over the data and looking for an existing blob with the same hash. If found the existing entry
231         is reused by creating a hard link to it.
232
233         The new disk structure looks like this:
234
235         WebKitCache/
236             Version 3/
237                 Blobs/
238                     0A3C9A970ADA27FAE9BD7BC630BAD0B929C293C0
239                     0A6B8060BA77DF92C82A2FD7AF58F79524D8F34C
240                     ...
241                 Records/
242                     apple.com/
243                         0B8645B04E7EC78C178B7460052601C2
244                         0B8645B04E7EC78C178B7460052601C2-body
245                         0CB1A3638D1C5A09C5E3283A74FA040B
246                         0CB1A3638D1C5A09C5E3283A74FA040B-body
247                         ...
248
249         Each record file has an associated -body which is a hard link to a file in the Blobs directory.
250
251         The patch increases effective capacity by 10-20% with a typical cache. It also saves memory especially when identical
252         resources are used in multiple tabs.
253
254         Currently all >0 sized resources are stored as shared blobs. In future small resources should be integrated into record
255         files and blobs used for larger files only.
256
257         * NetworkProcess/cache/NetworkCache.cpp:
258         (WebKit::NetworkCache::Cache::store):
259         (WebKit::NetworkCache::Cache::update):
260
261             Adopt the new storage interface.
262
263         (WebKit::NetworkCache::Cache::dumpContentsToFile):
264         * NetworkProcess/cache/NetworkCacheBlobStorage.cpp: Added.
265         (WebKit::NetworkCache::BlobStorage::BlobStorage):
266         (WebKit::NetworkCache::BlobStorage::synchronize):
267
268             Compute size and delete unused files from the Blobs directory (link count == 1).
269
270         (WebKit::NetworkCache::BlobStorage::blobPath):
271         (WebKit::NetworkCache::BlobStorage::add):
272         (WebKit::NetworkCache::BlobStorage::get):
273
274             Interface for storing and retrieving data blobs. Blobs are deduplicated on add.
275
276         (WebKit::NetworkCache::BlobStorage::remove):
277
278             Removes the link but doesn't remove the blob even if there are no other clients. That happens on next synchronize().
279
280         (WebKit::NetworkCache::BlobStorage::shareCount):
281
282             Checks the link count to get the number of clients.
283
284         * NetworkProcess/cache/NetworkCacheBlobStorage.h: Added.
285         (WebKit::NetworkCache::BlobStorage::approximateSize):
286         * NetworkProcess/cache/NetworkCacheCoders.cpp:
287         (WebKit::NetworkCache::Coder<SHA1::Digest>::encode):
288         (WebKit::NetworkCache::Coder<SHA1::Digest>::decode):
289         * NetworkProcess/cache/NetworkCacheCoders.h:
290         * NetworkProcess/cache/NetworkCacheData.h:
291         (WebKit::NetworkCache::Data::isEmpty):
292         * NetworkProcess/cache/NetworkCacheDataCocoa.mm:
293         (WebKit::NetworkCache::Data::empty):
294         (WebKit::NetworkCache::Data::fromMap):
295         (WebKit::NetworkCache::mapFile):
296         (WebKit::NetworkCache::computeSHA1):
297         (WebKit::NetworkCache::bytesEqual):
298
299             Add some helpers.
300
301         * NetworkProcess/cache/NetworkCacheEntry.cpp:
302         (WebKit::NetworkCache::Entry::asJSON):
303         * NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:
304         (WebKit::NetworkCache::IOChannel::IOChannel):
305         * NetworkProcess/cache/NetworkCacheStorage.cpp:
306         (WebKit::NetworkCache::makeRecordDirectoryPath):
307         (WebKit::NetworkCache::makeBlobDirectoryPath):
308         (WebKit::NetworkCache::Storage::Storage):
309         (WebKit::NetworkCache::Storage::approximateSize):
310         (WebKit::NetworkCache::Storage::synchronize):
311         (WebKit::NetworkCache::partitionPathForKey):
312         (WebKit::NetworkCache::recordPathForKey):
313         (WebKit::NetworkCache::bodyPath):
314         (WebKit::NetworkCache::decodeRecordMetaData):
315         (WebKit::NetworkCache::decodeRecordHeader):
316         (WebKit::NetworkCache::createRecord):
317         (WebKit::NetworkCache::encodeRecordMetaData):
318         (WebKit::NetworkCache::encodeRecordHeader):
319         (WebKit::NetworkCache::Storage::remove):
320         (WebKit::NetworkCache::Storage::updateFileModificationTime):
321         (WebKit::NetworkCache::Storage::dispatchReadOperation):
322
323             Read both the blob and the record entry.
324
325         (WebKit::NetworkCache::Storage::finishReadOperation):
326
327             Factor to a function.
328
329         (WebKit::NetworkCache::Storage::store):
330         (WebKit::NetworkCache::Storage::traverse):
331         (WebKit::NetworkCache::Storage::dispatchPendingWriteOperations):
332         (WebKit::NetworkCache::Storage::dispatchWriteOperation):
333
334             We don't need separate full write and header write paths anymore. Everything is treated
335             as a full write and deduplication stops us writing the body again.
336
337             This simplifies the code and data structures.
338
339         (WebKit::NetworkCache::Storage::finishWriteOperation):
340
341             Factor to a function.
342
343         (WebKit::NetworkCache::Storage::clear):
344         (WebKit::NetworkCache::deletionProbability):
345
346             Take the sharing count into account when computing deletion probability.
347             It is less useful to delete a record that shares its body with others as data won't get deleted.
348
349         (WebKit::NetworkCache::Storage::shrinkIfNeeded):
350         (WebKit::NetworkCache::Storage::shrink):
351         (WebKit::NetworkCache::Storage::deleteOldVersions):
352         (WebKit::NetworkCache::directoryPathForKey): Deleted.
353         (WebKit::NetworkCache::filePathForKey): Deleted.
354         (WebKit::NetworkCache::openFileForKey): Deleted.
355         (WebKit::NetworkCache::decodeRecord): Deleted.
356         (WebKit::NetworkCache::Storage::update): Deleted.
357
358             No need for separate update interface anymore. Regular store() avoids unnecessary body write.
359
360         (WebKit::NetworkCache::Storage::dispatchFullWriteOperation): Deleted.
361         (WebKit::NetworkCache::Storage::dispatchHeaderWriteOperation): Deleted.
362         * NetworkProcess/cache/NetworkCacheStorage.h:
363         * WebKit2.xcodeproj/project.pbxproj:
364
365 2015-04-14  Chris Dumez  <cdumez@apple.com>
366
367         REGRESSION(r182603): [GTK] More than 500 crashes on the layout tests with the debug build.
368         https://bugs.webkit.org/show_bug.cgi?id=143715
369
370         Reviewed by Darin Adler.
371
372         Enable assertions checking that calling editorState() does not cause a
373         synchronous layout only on Mac and iOS. This assertion does not
374         necessarily hold true on other ports as each one as its own
375         platformEditorState() implementation. In particular, this assertion
376         was being hit on GTK.
377
378         * WebProcess/WebPage/WebPage.cpp:
379         (WebKit::WebPage::didChangeSelection):
380
381 2015-04-13  Alexey Proskuryakov  <ap@apple.com>
382
383         Build fixes after r182772.
384
385         * UIProcess/API/mac/WKView.mm:
386         (-[WKView _updateAutomaticallyComputedFixedLayoutSize]): Make a CGSize, not an NSSize.
387         (-[WKView _setAutomaticallyComputesFixedLayoutSizeFromViewScale:]): Moved implementation
388         to the correct place.
389         (-[WKView _automaticallyComputesFixedLayoutSizeFromViewScale]): Ditto.
390         (-[WKView _layoutMode]): Use a memeber from _data directly, not via a method.
391
392 2015-04-13  Alexey Proskuryakov  <ap@apple.com>
393
394         More build fix.
395
396         * UIProcess/mac/PageClientImpl.mm:
397         (WebKit::PageClientImpl::setDragImage):
398
399 2015-04-13  Hunseop Jeong  <hs85.jeong@samsung.com>
400
401         [EFL][GTK] Fix build break after r182753 
402         https://bugs.webkit.org/show_bug.cgi?id=143689
403
404         Reviewed by Anders Carlsson.
405
406         * Platform/IPC/unix/ConnectionUnix.cpp:
407         (IPC::Connection::processMessage):
408         (IPC::Connection::sendOutgoingMessage):
409         * Platform/unix/SharedMemoryUnix.cpp:
410         (WebKit::SharedMemory::allocate):
411         (WebKit::accessModeMMap):
412         (WebKit::SharedMemory::map):
413         (WebKit::SharedMemory::create): Deleted.
414
415 2015-04-13  Alexey Proskuryakov  <ap@apple.com>
416
417         Build fix.
418
419         * UIProcess/mac/PageClientImpl.mm: (WebKit::PageClientImpl::setDragImage):
420
421 2015-04-13  Anders Carlsson  <andersca@apple.com>
422
423         Keep track of each shared memory object's protection when deciding whether to return our existing port
424         https://bugs.webkit.org/show_bug.cgi?id=143687
425
426         Reviewed by Tim Horton.
427
428         * Platform/SharedMemory.h:
429         * Platform/mac/SharedMemoryMac.cpp:
430         (WebKit::machProtection):
431         (WebKit::SharedMemory::create):
432         (WebKit::SharedMemory::map):
433         (WebKit::SharedMemory::createHandle):
434
435 2015-04-13  Tim Horton  <timothy_horton@apple.com>
436
437         Add a persistent, fixed scale factor to make it easy to scale down WK(Web)Views
438         https://bugs.webkit.org/show_bug.cgi?id=143560
439         <rdar://problem/16302047>
440
441         Reviewed by Darin Adler.
442
443         Add a new "view" scale factor to WKView and WKWebView.
444
445         Unlike page scale (or "magnification" in the API), view scale:
446             - persists between page loads
447             - persists between Web process crashes
448             - is not user adjustable
449             - can reliably be < 1
450
451         The page scale and view scale are multiplied together whenever we push
452         a new page scale down into WebCore, so the implementation of view scale
453         is transparent to WebCore, and acts effectively as a constant multiplier
454         for the (user-adjustable) page scale factor.
455
456         * UIProcess/WebPageProxy.cpp:
457         (WebKit::WebPageProxy::scaleView):
458         Add scaleView, which updates our cached viewScaleFactor and pushes it to the Web process.
459
460         (WebKit::WebPageProxy::creationParameters):
461         Plumb viewScaleFactor through the page creation parameters.
462
463         * UIProcess/WebPageProxy.h:
464         (WebKit::WebPageProxy::viewScaleFactor): Added.
465
466         * WebProcess/WebPage/WebPage.cpp:
467         (WebKit::WebPage::WebPage):
468         If the viewScaleFactor is not 1 at creation time, call scalePage with a page scale of 1.
469         Internally, scalePage will multiply in the viewScaleFactor and push it all to the Web process.
470
471         (WebKit::WebPage::scalePage):
472         Multiply the page scale factor by the view scale factor before passing it to WebCore.
473
474         (WebKit::WebPage::scalePageInViewCoordinates):
475         Early returns need to check the total scale, not just the new page scale.
476
477         (WebKit::WebPage::totalScaleFactor):
478         The scale that we get back from WebCore::Page::pageScaleFactor is the product
479         of WebKit2's view and page scales. So, here we'll call that the totalScaleFactor.
480         (Might need a different name because it seems like "total" should include deviceScale too).
481
482         (WebKit::WebPage::pageScaleFactor):
483         WebKit2's notion of the pageScaleFactor does not include the view scale, so
484         divide it out of WebCore's page scale.
485
486         (WebKit::WebPage::scaleView):
487         Apply a new view scale, maintaining the current scroll position.
488
489         * WebProcess/WebPage/WebPage.h:
490         (WebKit::WebPage::viewScaleFactor):
491         * WebProcess/WebPage/WebPage.messages.in:
492
493         * Shared/WebPageCreationParameters.cpp:
494         (WebKit::WebPageCreationParameters::encode):
495         (WebKit::WebPageCreationParameters::decode):
496         * Shared/WebPageCreationParameters.h:
497         Plumb viewScaleFactor through the page creation parameters.
498
499         * UIProcess/API/Cocoa/WKViewPrivate.h:
500         * UIProcess/API/Cocoa/WKWebView.mm:
501         (-[WKWebView _viewScale]):
502         (-[WKWebView _setViewScale:]):
503         * UIProcess/API/mac/WKView.mm:
504         (-[WKView _viewScale]):
505         (-[WKView _setViewScale:]):
506         Push the new view scale to WebPage.
507
508         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
509         * UIProcess/API/Cocoa/WKWebView.mm:
510         (-[WKWebView _setAutomaticallyComputesFixedLayoutSizeFromViewScale:]):
511         (-[WKWebView _automaticallyComputesFixedLayoutSizeFromViewScale]):
512         * UIProcess/API/mac/WKView.mm:
513         (-[WKView setFrameSize:]):
514         (-[WKView _updateAutomaticallyComputedFixedLayoutSize]):
515         (-[WKView _setAutomaticallyComputesFixedLayoutSizeFromViewScale:]):
516         (-[WKView _automaticallyComputesFixedLayoutSizeFromViewScale]):
517         * UIProcess/API/mac/WKViewInternal.h:
518         Add a new layout mode, "DynamicSizeComputedFromViewScale",
519         which turns on fixed layout size mode, and sets the fixed layout size
520         based on the view's frame and view scale. The fixed layout size is maintained
521         as the frame of the view scaled by the inverse of the view scale. This
522         makes it very easy to maintain a WK(Web)View that is scaled down by
523         a constant amount, but is laid out as if it were not.
524         
525         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
526         (WebKit::TiledCoreAnimationDrawingArea::adjustTransientZoom):
527         (WebKit::TiledCoreAnimationDrawingArea::commitTransientZoom):
528         (WebKit::TiledCoreAnimationDrawingArea::applyTransientZoomToPage):
529         Because the transient zoom mechanism touches layers that WebCore owns,
530         it mostly need to operate with totalScaleFactor, because that is what WebCore sees.
531
532 2015-04-10  Brent Fulgham  <bfulgham@apple.com>
533
534         Expand test infrastructure to support scrolling tests
535         https://bugs.webkit.org/show_bug.cgi?id=143286
536         <rdar://problem/20375516>
537
538         Reviewed by Simon Fraser.
539
540         Extend the WK2 testing API to include a method for setting a JSC callback function to be triggered
541         by the new WebCore::WheelEventTestTrigger singleton.
542
543         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
544         (WKBundlePageStartMonitoringScrollOperations): WK2 method that causes the testing system to begin tracking wheel events.
545         (WKBundlePageRegisterScrollOperationCompletionCallback): WK2 method to set the callback function for testing.
546         * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
547
548 2015-04-13  Enrica Casucci  <enrica@apple.com>
549
550         Clients of WKWebView should be able to override drag functions.
551         https://bugs.webkit.org/show_bug.cgi?id=143618
552
553         Reviewed by Darin Adler.
554
555         WKWebView now implements the drag protocol functions and
556         forwards the calls to the inner WKView.
557         In the page client, when we receive a request to start drag
558         from the WebProcess, we call _dragImageForView in WKView with
559         the target view. The function calls dragImage on the given view,
560         so that its clients can override the dragImage function.
561
562         * UIProcess/API/Cocoa/WKWebView.mm:
563         (-[WKWebView draggingEntered:]):
564         (-[WKWebView draggingUpdated:]):
565         (-[WKWebView draggingExited:]):
566         (-[WKWebView prepareForDragOperation:]):
567         (-[WKWebView performDragOperation:]):
568         * UIProcess/API/mac/WKView.mm:
569         (-[WKView _dragImageForView:withImage:at:linkDrag:]):
570         (-[WKView _setDragImage:at:linkDrag:]): Deleted.
571         * UIProcess/API/mac/WKViewInternal.h:
572         * UIProcess/mac/PageClientImpl.mm:
573         (WebKit::PageClientImpl::setDragImage):
574
575 2015-04-13  Alex Christensen  <achristensen@webkit.org>
576
577         [iOS] Unreviewed build fix after r182760.
578
579         * Shared/WebCoreArgumentCoders.cpp:
580         (IPC::encodeSharedBuffer):
581         (IPC::decodeSharedBuffer):
582         Update SharedMemory function names.
583
584 2015-04-13  Anders Carlsson  <andersca@apple.com>
585
586         Rename SharedMemory::create overloads
587         https://bugs.webkit.org/show_bug.cgi?id=143679
588
589         Reviewed by Beth Dakin.
590
591         Rename the SharedMemory::create overload that allocates memory to SharedMemory::allocate,
592         and the SharedMemory::create overload that maps in a handle to SharedMemory::map.
593
594         * Platform/SharedMemory.h:
595         * Platform/mac/SharedMemoryMac.cpp:
596         (WebKit::SharedMemory::allocate):
597         (WebKit::SharedMemory::map):
598         (WebKit::SharedMemory::create): Deleted.
599         * Shared/ShareableBitmap.cpp:
600         (WebKit::ShareableBitmap::createShareable):
601         (WebKit::ShareableBitmap::create):
602         * Shared/ShareableResource.cpp:
603         (WebKit::ShareableResource::create):
604         * Shared/ShareableResource.h:
605         * Shared/WebCompiledContentExtension.cpp:
606         (WebKit::WebCompiledContentExtension::createFromCompiledContentExtensionData):
607         * Shared/WebCompiledContentExtensionData.cpp:
608         (WebKit::WebCompiledContentExtensionData::decode):
609         * Shared/WebHitTestResult.cpp:
610         (WebKit::WebHitTestResult::Data::Data):
611         (WebKit::WebHitTestResult::Data::decode):
612         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
613         (WebKit::WebPasteboardProxy::getPasteboardBufferForType):
614         (WebKit::WebPasteboardProxy::setPasteboardBufferForType):
615         * UIProcess/VisitedLinkProvider.cpp:
616         (WebKit::VisitedLinkProvider::resizeTable):
617         * UIProcess/mac/WebPageProxyMac.mm:
618         (WebKit::WebPageProxy::dataSelectionForPasteboard):
619         (WebKit::WebPageProxy::setPromisedDataForImage):
620         * WebProcess/Plugins/PDF/PDFPlugin.mm:
621         (WebKit::PDFPlugin::writeItemsToPasteboard):
622         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
623         (WebKit::WebPlatformStrategies::bufferForType):
624         (WebKit::WebPlatformStrategies::setBufferForType):
625         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
626         (WebKit::WebDragClient::declareAndWriteDragImage):
627         * WebProcess/WebPage/VisitedLinkTableController.cpp:
628         (WebKit::VisitedLinkTableController::setVisitedLinkTable):
629         * WebProcess/WebPage/mac/WebPageMac.mm:
630         (WebKit::WebPage::getDataSelectionForPasteboard):
631
632 2015-04-13  Brady Eidson  <beidson@apple.com>
633
634         Share sheets from Share menus appear outside the browser window.
635         <rdar://problem/20455592> and https://bugs.webkit.org/show_bug.cgi?id=143620
636
637         Reviewed by Darin Adler.
638
639         Refactor existing Sharing Service Picker code to also be used for the Share menu NSMenuItem.
640
641         * UIProcess/WebPageProxy.cpp:
642         (WebKit::WebPageProxy::internalShowContextMenu):
643         (WebKit::WebPageProxy::platformInitializeShareMenuItem):
644         * UIProcess/WebPageProxy.h:
645
646         * UIProcess/mac/WKSharingServicePickerDelegate.h: Added.
647         * UIProcess/mac/WKSharingServicePickerDelegate.mm: Added.
648         (+[WKSharingServicePickerDelegate sharedSharingServicePickerDelegate]):
649         (-[WKSharingServicePickerDelegate menuProxy]):
650         (-[WKSharingServicePickerDelegate setMenuProxy:]):
651         (-[WKSharingServicePickerDelegate setPicker:]):
652         (-[WKSharingServicePickerDelegate setFiltersEditingServices:]):
653         (-[WKSharingServicePickerDelegate setHandlesEditingReplacement:]):
654         (-[WKSharingServicePickerDelegate sharingServicePicker:sharingServicesForItems:mask:proposedSharingServices:]):
655         (-[WKSharingServicePickerDelegate sharingServicePicker:delegateForSharingService:]):
656         (-[WKSharingServicePickerDelegate sharingService:willShareItems:]):
657         (-[WKSharingServicePickerDelegate sharingService:didShareItems:]):
658         (-[WKSharingServicePickerDelegate sharingService:sourceWindowForShareItems:sharingContentScope:]):
659
660         * UIProcess/mac/WebContextMenuProxyMac.mm:
661         (WebKit::WebContextMenuProxyMac::setupServicesMenu):
662         (+[WKSharingServicePickerDelegate sharedSharingServicePickerDelegate]): Deleted.
663         (-[WKSharingServicePickerDelegate menuProxy]): Deleted.
664         (-[WKSharingServicePickerDelegate setMenuProxy:]): Deleted.
665         (-[WKSharingServicePickerDelegate setPicker:]): Deleted.
666         (-[WKSharingServicePickerDelegate setIncludeEditorServices:]): Deleted.
667         (-[WKSharingServicePickerDelegate sharingServicePicker:sharingServicesForItems:mask:proposedSharingServices:]): Deleted.
668         (-[WKSharingServicePickerDelegate sharingServicePicker:delegateForSharingService:]): Deleted.
669         (-[WKSharingServicePickerDelegate sharingService:willShareItems:]): Deleted.
670         (-[WKSharingServicePickerDelegate sharingService:didShareItems:]): Deleted.
671         (-[WKSharingServicePickerDelegate sharingService:sourceWindowForShareItems:sharingContentScope:]): Deleted.
672
673         * UIProcess/mac/WebPageProxyMac.mm:
674         (WebKit::WebPageProxy::platformInitializeShareMenuItem):
675
676         * WebKit2.xcodeproj/project.pbxproj:
677
678 2015-04-13  Anders Carlsson  <andersca@apple.com>
679
680         Begin cleaning up the shared memory interface
681         https://bugs.webkit.org/show_bug.cgi?id=143677
682
683         Reviewed by Andreas Kling.
684
685         Rename createFromVMBuffer to create and add a protection parameter (which is currently unused).
686         Also, turn SharedMemory::Protection into a proper enum class.
687
688         * NetworkProcess/cache/NetworkCache.cpp:
689         (WebKit::NetworkCache::Cache::store):
690         * NetworkProcess/cache/NetworkCacheEntry.cpp:
691         (WebKit::NetworkCache::Entry::initializeBufferFromStorageRecord):
692         * NetworkProcess/mac/NetworkResourceLoaderMac.mm:
693         (WebKit::tryGetShareableHandleFromCFData):
694         * Platform/SharedMemory.h:
695         * Platform/mac/SharedMemoryMac.cpp:
696         (WebKit::SharedMemory::create):
697         (WebKit::machProtection):
698         (WebKit::SharedMemory::createHandle):
699         (WebKit::SharedMemory::createFromVMBuffer): Deleted.
700         * Shared/ContextMenuContextData.cpp:
701         (WebKit::ContextMenuContextData::encode):
702         (WebKit::ContextMenuContextData::decode):
703         * Shared/ShareableBitmap.h:
704         * Shared/ShareableResource.cpp:
705         (WebKit::ShareableResource::create):
706         (WebKit::ShareableResource::createHandle):
707         * Shared/WebCompiledContentExtensionData.cpp:
708         (WebKit::WebCompiledContentExtensionData::encode):
709         (WebKit::WebCompiledContentExtensionData::decode):
710         * Shared/WebHitTestResult.cpp:
711         (WebKit::WebHitTestResult::Data::encode):
712         (WebKit::WebHitTestResult::Data::decode):
713         * UIProcess/API/APIUserContentExtensionStore.cpp:
714         (API::createExtension):
715         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
716         (WebKit::WebPasteboardProxy::getPasteboardBufferForType):
717         (WebKit::WebPasteboardProxy::setPasteboardBufferForType):
718         (WebKit::WebPasteboardProxy::readBufferFromPasteboard):
719         * UIProcess/VisitedLinkProvider.cpp:
720         (WebKit::VisitedLinkProvider::sendTable):
721         * UIProcess/mac/WKPrintingView.mm:
722         (pageDidDrawToImage):
723         * UIProcess/mac/WebPageProxyMac.mm:
724         (WebKit::WebPageProxy::dataSelectionForPasteboard):
725         (WebKit::WebPageProxy::setPromisedDataForImage):
726         * WebProcess/Plugins/PDF/PDFPlugin.mm:
727         (WebKit::PDFPlugin::writeItemsToPasteboard):
728         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
729         (WebKit::WebPlatformStrategies::bufferForType):
730         (WebKit::WebPlatformStrategies::setBufferForType):
731         (WebKit::WebPlatformStrategies::readBufferFromPasteboard):
732         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
733         (WebKit::WebDragClient::declareAndWriteDragImage):
734         * WebProcess/WebPage/VisitedLinkTableController.cpp:
735         (WebKit::VisitedLinkTableController::setVisitedLinkTable):
736         * WebProcess/WebPage/WebPage.cpp:
737         (WebKit::WebPage::takeSnapshot):
738         (WebKit::WebPage::drawRectToImage):
739         * WebProcess/WebPage/mac/WebPageMac.mm:
740         (WebKit::WebPage::getDataSelectionForPasteboard):
741
742 2015-04-10  Jon Honeycutt  <jhoneycutt@apple.com>
743
744         Cannot click "Next" button on Google two-factor auth setup page
745
746         <https://bugs.webkit.org/show_bug.cgi?id=143624>
747         <rdar://problem/19175714>
748
749         This issue occurs when this site focuses the submit button. When it
750         receives focus, we try to assist it. While we consider ourselves to be
751         assisting it, we ignore further gesture inputs for that node, including
752         the tap gesture.
753
754         To fix this, only assist input types that we know are assistable,
755         including text fields, select and date elements, etc.
756
757         Reviewed by Darin Adler.
758
759         * UIProcess/ios/WKContentViewInteraction.mm:
760         (isAssistableInputType):
761         If the type is a known-assistable type, return true.
762         (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:userObject:]):
763         Call isAssistableInputType() to determine whether we should do any kind
764         of assistance for this node.
765
766 2015-04-13  Beth Dakin  <bdakin@apple.com>
767
768         Add force property to MouseEvents
769         https://bugs.webkit.org/show_bug.cgi?id=143569
770         -and corresponding-
771         rdar://problem/20472954
772
773         Reviewed by Darin Adler.
774
775         In order to accommodate adding force to all PlatformMouseEvents, we have to add it 
776         to pass a caches pressure event to NativeWebMouseEvent and add force to 
777         WebMouseEvent.
778
779         NativeWebMouseEvent now requires a second NSEvent for the pressureEvent. 
780         * Shared/NativeWebMouseEvent.h:
781
782         WebMouseEvent takes a force parameter.
783         * Shared/WebEvent.h:
784         (WebKit::WebMouseEvent::force):
785         * Shared/WebEventConversion.cpp:
786         (WebKit::WebKit2PlatformMouseEvent::WebKit2PlatformMouseEvent):
787         * Shared/WebMouseEvent.cpp:
788         (WebKit::WebMouseEvent::WebMouseEvent):
789         (WebKit::WebMouseEvent::encode):
790         (WebKit::WebMouseEvent::decode):
791         * Shared/mac/NativeWebMouseEventMac.mm:
792         (WebKit::NativeWebMouseEvent::NativeWebMouseEvent):
793         * Shared/mac/WebEventFactory.h:
794         * Shared/mac/WebEventFactory.mm:
795         (WebKit::WebEventFactory::createWebMouseEvent):
796
797         Cache the most recent pressureEvent in _data so that it can be sent along to the 
798         NativeWebMouseEvent constructor.
799         * UIProcess/API/mac/WKView.mm:
800         (-[WKView pressureChangeWithEvent:]):
801         (-[WKView acceptsFirstMouse:]):
802         (-[WKView shouldDelayWindowOrderingForEvent:]):
803         (-[WKView _postFakeMouseMovedEventForFlagsChangedEvent:]):
804         (-[WKView initWithFrame:processPool:configuration:webView:]):
805
806         WebMouseEvent takes a force parameter.
807         * WebProcess/Plugins/PDF/PDFPlugin.mm:
808         (WebKit::PDFPlugin::showContextMenuAtPoint):
809         * WebProcess/Plugins/PluginView.cpp:
810         (WebKit::PluginView::createWebEvent):
811
812         MouseEvent and PlatformMouseEvent both take force parameters too.
813         * WebProcess/WebPage/WebPage.cpp:
814         (WebKit::WebPage::navigateToURLWithSimulatedClick):
815         (WebKit::WebPage::contextMenuAtPointInWindow):
816         (WebKit::WebPage::dragEnded):
817         (WebKit::WebPage::simulateMouseDown):
818         (WebKit::WebPage::simulateMouseUp):
819         (WebKit::WebPage::simulateMouseMotion):
820
821         The functions that dispatch the force events no longer take a PlatformMouseEvent 
822         as a parameter.
823         * WebProcess/WebPage/mac/WebPageMac.mm:
824         (WebKit::WebPage::inputDeviceForceDidChange):
825         (WebKit::WebPage::immediateActionDidCancel):
826
827 2015-04-13  Andreas Kling  <akling@apple.com>
828
829         Don't segregate heap objects based on Structure immortality.
830         <https://webkit.org/b/143638>
831
832         Reviewed by Darin Adler.
833
834         * WebProcess/Plugins/Netscape/JSNPObject.h:
835
836 2015-04-13  Timothy Horton  <timothy_horton@apple.com>
837
838         javascript: links in inline PDFs shouldn't execute JavaScript in the context of the host website
839         https://bugs.webkit.org/show_bug.cgi?id=143642
840         <rdar://problem/18259355>
841
842         Reviewed by Darin Adler.
843
844         * WebProcess/Plugins/PDF/PDFPlugin.mm:
845         (WebKit::PDFPlugin::clickedLink):
846         Don't follow javascript: URLs.
847
848 2015-04-10  Alex Christensen  <achristensen@webkit.org>
849
850         [Content Extensions] Don't unmap shared memory while using it.
851         https://bugs.webkit.org/show_bug.cgi?id=143625
852
853         Reviewed by Darin Adler.
854
855         * Shared/WebCompiledContentExtension.cpp:
856         (WebKit::WebCompiledContentExtension::createFromCompiledContentExtensionData):
857         * Shared/WebCompiledContentExtensionData.h:
858         (WebKit::WebCompiledContentExtensionData::WebCompiledContentExtensionData):
859         * UIProcess/API/APIUserContentExtensionStore.cpp:
860         (API::createExtension):
861         Keep the Data object alive as long as the SharedMemory that uses it.
862
863 2015-04-12  Darin Adler  <darin@apple.com>
864
865         [Cocoa] Localizable strings are inconsistent and need to be regenerated
866         https://bugs.webkit.org/show_bug.cgi?id=143661
867
868         Reviewed by Dan Bernstein.
869
870         * UIProcess/WebEditCommandProxy.cpp:
871         (WebKit::WebEditCommandProxy::nameForEditAction): Also added a comment
872         about the fact that we have two copies of all the localizable strings.
873
874 2015-04-12  Sungmann Cho  <sungmann.cho@navercorp.com>
875
876         Fix trival typos related to the word "coordinate".
877         https://bugs.webkit.org/show_bug.cgi?id=143644
878
879         Reviewed by Alexey Proskuryakov.
880
881         No new tests, no behavior change.
882
883         * Shared/WebHitTestResult.cpp:
884         (WebKit::WebHitTestResult::Data::encode):
885         (WebKit::WebHitTestResult::Data::decode):
886         * Shared/WebHitTestResult.h:
887         * WebProcess/WebPage/mac/WebPageMac.mm:
888         (WebKit::WebPage::performActionMenuHitTestAtLocation):
889         (WebKit::WebPage::lookupTextAtLocation):
890
891 2015-04-12  Sungmann Cho  <sungmann.cho@navercorp.com>
892
893         Remove PluginModuleInfo.cpp from WebKit2
894         https://bugs.webkit.org/show_bug.cgi?id=143643
895
896         Reviewed by Darin Adler.
897
898         Remove PluginModuleInfo.cpp from WebKit2 because it is totally empty.
899
900         No new tests, no behavior change.
901
902         * CMakeLists.txt:
903         * Shared/Plugins/PluginModuleInfo.cpp: Removed.
904         * WebKit2.xcodeproj/project.pbxproj:
905
906 2015-04-11  Yusuke Suzuki  <utatane.tea@gmail.com>
907
908         [ES6] Enable Symbol in web pages
909         https://bugs.webkit.org/show_bug.cgi?id=143375
910
911         Reviewed by Ryosuke Niwa.
912
913         * UIProcess/API/C/WKPreferencesRefPrivate.h:
914         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
915         * UIProcess/efl/WebInspectorProxyEfl.cpp:
916         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
917         * UIProcess/gtk/WebInspectorProxyGtk.cpp:
918         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
919         * UIProcess/mac/WebInspectorProxyMac.mm:
920         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
921
922 2015-04-08  Sam Weinig  <sam@webkit.org>
923
924         Allow LaunchServices to handle URLs on link navigations
925         <rdar://problem/19446826>
926         https://bugs.webkit.org/show_bug.cgi?id=143544
927
928         Reviewed by Anders Carlsson.
929
930         * UIProcess/Cocoa/NavigationState.mm:
931         (WebKit::tryAppLink):
932         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
933         Only let LaunchServices have a crack at the URL if the navigation is:
934             1) a main frame navigation
935             2) a result of a user gesture
936
937 2015-04-10  Tim Horton  <timothy_horton@apple.com>
938
939         Replace setFixedLayoutSizeEnabled: with an enum of layout modes
940         https://bugs.webkit.org/show_bug.cgi?id=143576
941
942         Reviewed by Simon Fraser.
943
944         * UIProcess/API/C/WKLayoutMode.h: Added.
945         * UIProcess/API/Cocoa/WKViewPrivate.h:
946         * UIProcess/API/Cocoa/WKWebView.mm:
947         (-[WKWebView _layoutMode]):
948         (-[WKWebView _setLayoutMode:]):
949         (-[WKWebView _isFixedLayoutEnabled]): Deleted.
950         (-[WKWebView _setFixedLayoutEnabled:]): Deleted.
951         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
952         * UIProcess/API/Cocoa/_WKLayoutMode.h: Added.
953         * UIProcess/API/mac/WKView.mm:
954         (-[WKView _layoutMode]):
955         (-[WKView _setLayoutMode:]):
956         (-[WKView _isFixedLayoutEnabled]): Deleted.
957         (-[WKView _setFixedLayoutEnabled:]): Deleted.
958         * WebKit2.xcodeproj/project.pbxproj:
959         Add enums for "layout mode". Currently we have two values: "ViewSize",
960         which is the normal behavior, and "FixedSize", which is fixed layout mode.
961         More values will come in the future.
962
963 2015-04-10  Anders Carlsson  <andersca@apple.com>
964
965         _WKWebsiteDataStore doesn't track and remove offline application cache entries
966         https://bugs.webkit.org/show_bug.cgi?id=143614
967         rdar://problem/20243235
968
969         Reviewed by Andreas Kling.
970
971         * Shared/WebsiteData/WebsiteDataTypes.h:
972         Add WebsiteDataTypeOfflineWebApplicationCache.
973
974         * UIProcess/API/Cocoa/_WKWebsiteDataRecord.h:
975         * UIProcess/API/Cocoa/_WKWebsiteDataRecord.mm:
976         (dataTypesToString):
977         * UIProcess/API/Cocoa/_WKWebsiteDataRecordInternal.h:
978         (WebKit::toWebsiteDataTypes):
979         (WebKit::toWKWebsiteDataTypes):
980         Add WKWebsiteDataTypeOfflineWebApplicationCache.
981
982         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
983         (WebKit::WebsiteDataStore::fetchData):
984         Create a custom application cache storage and fetch the origins from it.
985
986         (WebKit::WebsiteDataStore::removeData):
987         Delete either all the cache entries (since we don't track time in the application cache),
988         or the ones specified by the given entries.
989
990 2015-04-10  Eric Carlson  <eric.carlson@apple.com>
991
992         [Mac] Refactor MediaPlaybackTarget
993         https://bugs.webkit.org/show_bug.cgi?id=143571
994
995         Reviewed by Jer Noble.
996
997         Pass a MediaPlaybackTargetContext across process boundary instead of a MediaPlaybackTarget.
998         * Shared/WebCoreArgumentCoders.h:
999         (IPC::ArgumentCoder<MediaPlaybackTargetContext>::encode): New.
1000         (IPC::ArgumentCoder<MediaPlaybackTargetContext>::decode): New.
1001         * Shared/mac/WebCoreArgumentCoders.cpp:
1002         (IPC::ArgumentCoder<MediaPlaybackTargetContext>::encodePlatformData): New.
1003         (IPC::ArgumentCoder<MediaPlaybackTargetContext>::decodePlatformData): New.
1004         (IPC::ArgumentCoder<MediaPlaybackTarget>::encode): Deleted.
1005         (IPC::ArgumentCoder<MediaPlaybackTarget>::decode): Deleted.
1006         * UIProcess/WebPageProxy.cpp:
1007         (WebKit::WebPageProxy::didChoosePlaybackTarget): Take a Ref<MediaPlaybackTarget>&&.
1008         * UIProcess/WebPageProxy.h:
1009         * WebProcess/WebPage/WebPage.h:
1010         * WebProcess/WebPage/WebPage.messages.in:
1011         * WebProcess/WebPage/mac/WebPageMac.mm:
1012         (WebKit::WebPage::playbackTargetSelected): Take a Ref<MediaPlaybackTarget>&&.
1013
1014 2015-04-10  Hunseop Jeong  <hs85.jeong@samsung.com>
1015
1016         Fix some minor typos related to the WebProcessCreationParameter. 
1017         https://bugs.webkit.org/show_bug.cgi?id=143598
1018
1019         Reviewed by Csaba Osztrogonác.
1020
1021         No new tests, no behavior change.
1022
1023         * Shared/WebProcessCreationParameters.cpp:
1024         (WebKit::WebProcessCreationParameters::encode):
1025         (WebKit::WebProcessCreationParameters::decode):
1026         * Shared/WebProcessCreationParameters.h:
1027         * UIProcess/WebProcessPool.cpp:
1028         (WebKit::WebProcessPool::createNewWebProcess):
1029         * WebProcess/WebProcess.cpp:
1030         (WebKit::WebProcess::initializeWebProcess):
1031
1032 2015-04-09  Andy Estes  <aestes@apple.com>
1033
1034         [Cocoa] Add a HAVE(AVKIT) and use it
1035         https://bugs.webkit.org/show_bug.cgi?id=143593
1036
1037         Reviewed by David Kilzer.
1038
1039         * UIProcess/API/Cocoa/WKWebView.mm:
1040         (-[WKWebView _mayAutomaticallyShowVideoOptimized]): Returned false if !HAVE(AVKIT).
1041         * UIProcess/WebPageProxy.cpp:
1042         (WebKit::WebPageProxy::WebPageProxy): Removed the check for < iOS 8.2.
1043         (WebKit::WebPageProxy::reattachToWebProcess): Ditto.
1044         * UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
1045         (WebKit::WebVideoFullscreenManagerProxy::create): Created a version of this function that returns nullptr if
1046         the minimum required version of iOS is less than 8.2 or if !HAVE(AVKIT).
1047         * WebProcess/WebPage/WebPage.cpp:
1048         (WebKit::WebPage::updatePreferences): Only called Settings::setAVKitEnabled(true) if HAVE(AVKIT).
1049
1050 2015-04-09  Hunseop Jeong  <hs85.jeong@samsung.com>
1051
1052         Use modern loops in WebProcess 
1053         https://bugs.webkit.org/show_bug.cgi?id=143302
1054
1055         Reviewed by Darin Adler.
1056
1057         Use modern range for-loops in WebProcess.
1058
1059         No new tests, no behavior change.
1060
1061         * WebProcess/WebProcess.cpp:
1062         (WebKit::WebProcess::initializeConnection):
1063         (WebKit::WebProcess::initializeWebProcess):
1064         (WebKit::WebProcess::focusedWebPage):
1065         (WebKit::WebProcess::webPageGroup):
1066         (WebKit::WebProcess::setTextCheckerState):
1067         (WebKit::WebProcess::resetAllGeolocationPermissions):
1068
1069 2015-04-09  Gordon Sheridan  <gordon_sheridan@apple.com>
1070
1071         Track IconDatabase retain counts for WebContent processes. Balance retain/releases for processes that terminate before successfully doing it themselves.
1072         https://bugs.webkit.org/show_bug.cgi?id=143517.
1073
1074         Reviewed by Brady Eidson.
1075
1076         * UIProcess/WebIconDatabase.messages.in:
1077         Move RetainIconForPageURL and ReleaseIconForPageURL messages to WebProcessProxy so they can be associated with the appropriate web process.
1078
1079         * UIProcess/WebProcessProxy.cpp:
1080         (WebKit::WebProcessProxy::connectionDidClose):
1081         Call releaseRemainingIconsForPageURLs() to balance retains/releases for this process.
1082
1083         (WebKit::WebProcessProxy::retainIconForPageURL):
1084         Track retain counts for page URLs and call through to WebIconDatabase.
1085
1086         (WebKit::WebProcessProxy::releaseIconForPageURL):
1087         Ditto.
1088
1089         (WebKit::WebProcessProxy::releaseRemainingIconsForPageURLs):
1090         Call releaseIconForPageURL() once for each outstanding retain count, for each page URL.
1091
1092         * UIProcess/WebProcessProxy.h:
1093         Declare methods for retainIconForPageURL(), releaseIconForPageURL(), and releaseRemainingIconsForPageURLs().
1094         Declare hash map to track number of retains per page URL.
1095
1096         * UIProcess/WebProcessProxy.messages.in:
1097         Moved RetainIconForPageURL and ReleaseIconForPageURL messages here from WebIconDatabase.
1098
1099         * WebProcess/IconDatabase/WebIconDatabaseProxy.cpp:
1100         (WebKit::WebIconDatabaseProxy::retainIconForPageURL):
1101         Modify the receiver of the message to be WebProcessProxy.
1102
1103         (WebKit::WebIconDatabaseProxy::releaseIconForPageURL):
1104         Ditto.
1105
1106 2015-04-09  Chris Dumez  <cdumez@apple.com>
1107
1108         [WK2] Regression(r182194): The NetworkProcess is calling the wrong memory pressure handler before suspending
1109         https://bugs.webkit.org/show_bug.cgi?id=143575
1110         <rdar://problem/20484338>
1111
1112         Reviewed by Andreas Kling.
1113
1114         After r182194, the NetworkProcess is calling the memory pressure
1115         handler before getting suspended to free-up as much memory as possible
1116         at this point.
1117
1118         However, we were calling the default memory pressure handling code
1119         instead of the custom handler registered by the NetworkProcess. This
1120         patch fixes the problem.
1121
1122         * NetworkProcess/NetworkProcess.cpp:
1123         (WebKit::NetworkProcess::lowMemoryHandler):
1124         (WebKit::NetworkProcess::initializeNetworkProcess):
1125         (WebKit::NetworkProcess::processWillSuspend):
1126         * NetworkProcess/NetworkProcess.h:
1127
1128 2015-04-09  Brady Eidson  <beidson@apple.com>
1129
1130         REGRESSION (r182573): Action Menus no longer appear for WebKit2 views displaying an image
1131         rdar://problem/20486551 and https://bugs.webkit.org/show_bug.cgi?id=143574
1132
1133         Reviewed by Brent Fulgham.
1134
1135         * Shared/WebHitTestResult.cpp:
1136         (WebKit::WebHitTestResult::Data::Data): Clear up a name scoping issue.
1137
1138 2015-04-09  Chris Dumez  <cdumez@apple.com>
1139
1140         [WK2][iOS] editorState() should not cause a synchronous layout
1141         https://bugs.webkit.org/show_bug.cgi?id=142536
1142         <rdar://problem/20041506>
1143
1144         Reviewed by Enrica Casucci.
1145
1146         platformEditorState() on iOS does a synchronous layout to compute some
1147         of the EditorState members (e.g. caretRectAtStart / caretRectAtEnd).
1148         This is bad for performance as this is called every time the selection
1149         is changed (which happens for e.g. when you set the value of a focused
1150         HTMLInputElement).
1151
1152         This patch updates the behavior on iOS to only send a partial EditorState
1153         on selection change so that the UIProcess gets most of the information
1154         (the ones that do not require style recalc or layout) ASAP. A full Editor
1155         state is then sent after the asynchronous layout is done.
1156
1157         With this change, I see a 38% improvement on Speedometer (26.4 +/- 0.37
1158         -> 36.5 +/- 0.54) on iPhone 6 Plus.
1159
1160         * Shared/EditorState.cpp:
1161         (WebKit::EditorState::encode):
1162         (WebKit::EditorState::decode):
1163         (WebKit::EditorState::PostLayoutData::encode):
1164         (WebKit::EditorState::PostLayoutData::decode):
1165         * Shared/EditorState.h:
1166         (WebKit::EditorState::EditorState): Deleted.
1167         * UIProcess/ios/WKContentView.mm:
1168         (-[WKContentView _didCommitLayerTree:]):
1169         * UIProcess/ios/WKContentViewInteraction.mm:
1170         (WebKit::WKSelectionDrawingInfo::WKSelectionDrawingInfo):
1171         (-[WKContentView webSelectionRects]):
1172         (-[WKContentView _addShortcut:]):
1173         (-[WKContentView selectedText]):
1174         (-[WKContentView isReplaceAllowed]):
1175         (-[WKContentView _promptForReplace:]):
1176         (-[WKContentView _transliterateChinese:]):
1177         (-[WKContentView textStylingAtPosition:inDirection:]):
1178         (-[WKContentView canPerformAction:withSender:]):
1179         (-[WKContentView _showDictionary:]):
1180         (-[WKContentView _characterBeforeCaretSelection]):
1181         (-[WKContentView _characterInRelationToCaretSelection:]):
1182         (-[WKContentView _selectionAtDocumentStart]):
1183         (-[WKContentView selectedTextRange]):
1184         (-[WKContentView hasContent]):
1185         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
1186         (WebKit::WebEditorClient::didChangeSelectionAndUpdateLayout):
1187         * WebProcess/WebCoreSupport/WebEditorClient.h:
1188         * WebProcess/WebPage/WebPage.cpp:
1189         (WebKit::WebPage::editorState):
1190         (WebKit::WebPage::didChangeSelection):
1191         (WebKit::WebPage::sendPostLayoutEditorStateIfNeeded):
1192         * WebProcess/WebPage/WebPage.h:
1193         * WebProcess/WebPage/efl/WebPageEfl.cpp:
1194         (WebKit::WebPage::platformEditorState):
1195         * WebProcess/WebPage/gtk/WebPageGtk.cpp:
1196         (WebKit::WebPage::platformEditorState):
1197         * WebProcess/WebPage/ios/WebPageIOS.mm:
1198         (WebKit::WebPage::platformEditorState):
1199         * WebProcess/WebPage/mac/WebPageMac.mm:
1200         (WebKit::WebPage::platformEditorState):
1201
1202 2015-04-09  Antti Koivisto  <antti@apple.com>
1203
1204         Network Cache: Crash in WebCore::CachedResource::tryReplaceEncodedData
1205         https://bugs.webkit.org/show_bug.cgi?id=143562
1206
1207         Reviewed by Anders Carlsson.
1208
1209         If another thread comes and truncates the file before we map it we end up with a map that crashes when accessed.
1210
1211         * NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:
1212         (WebKit::NetworkCache::IOChannel::IOChannel):
1213
1214             When creating a new file unlink any existing file instead of using O_TRUNC.
1215
1216 2015-04-09  Csaba Osztrogonác  <ossy@webkit.org>
1217
1218         [EFL][GTK] WebKit2's generate-forwarding-headers.pl runs too many times
1219         https://bugs.webkit.org/show_bug.cgi?id=142907
1220
1221         Unreviewed typo fix after r182595.
1222
1223         * PlatformGTK.cmake:
1224
1225 2015-04-09  Csaba Osztrogonác  <ossy@webkit.org>
1226
1227         [EFL][GTK] WebKit2's generate-forwarding-headers.pl runs too many times
1228         https://bugs.webkit.org/show_bug.cgi?id=142907
1229
1230         Reviewed by Carlos Garcia Campos.
1231
1232         * PlatformEfl.cmake:
1233         * PlatformGTK.cmake:
1234         * Scripts/generate-forwarding-headers.pl: Make it work with more path and platform arguments.
1235
1236 2015-04-08  Joseph Pecoraro  <pecoraro@apple.com>
1237
1238         Exception in console and broken right click after attempting to show context menu in Inspector
1239         https://bugs.webkit.org/show_bug.cgi?id=143556
1240
1241         Reviewed by Brady Eidson.
1242
1243         * Shared/mac/NativeContextMenuItem.mm:
1244         (WebKit::NativeContextMenuItem::NativeContextMenuItem):
1245         Add an ASSERT to immediately catch a menu item created with a nil native menu item.
1246
1247         * UIProcess/WebPageProxy.cpp:
1248         (WebKit::WebPageProxy::internalShowContextMenu):
1249         Gracefully handle a null share context menu item.
1250
1251 2015-04-08  Brent Fulgham  <bfulgham@apple.com>
1252
1253         [Mac] Unreviewed test fix after r182584
1254         https://bugs.webkit.org/show_bug.cgi?id=143452
1255
1256         Correct bit comparison to use the correct value for the Control-key
1257
1258         * Shared/mac/WebEventFactory.mm:
1259         (WebKit::typeForEvent):
1260
1261 2015-04-08  Jaehun Lim  <ljaehun.lim@samsung.com>
1262
1263         [EFL] Create PageUIClientEfl after sending CreateWebPage message
1264         https://bugs.webkit.org/show_bug.cgi?id=143514
1265
1266         Reviewed by Gyuyoung Kim.
1267
1268         UIProcess sends some messages to WebPage before WebPage is created. It makes some error logs on debug build.
1269         So this patch moves the initialization of m_pageUIClient after calling WKViewInitialize().
1270
1271         * UIProcess/API/efl/EwkView.cpp:
1272         (EwkView::EwkView):
1273
1274 2015-04-08  Brent Fulgham  <bfulgham@apple.com>
1275
1276         [Mac] WebKit is not honoring OS preferences for secondary click behaviors
1277         https://bugs.webkit.org/show_bug.cgi?id=143452
1278         <rdar://problem/20437483>
1279
1280         Reviewed by Tim Horton.
1281
1282         We cannot rely on the event's button number to decide behavior. The OS settings might have
1283         mapped middle button to context menu, etc. Instead, we should ask the OS (via NSMenu) what
1284         the proper button press behavior is.
1285
1286         * Shared/mac/WebEventFactory.mm:
1287         (WebKit::mouseButtonForEvent): Ask NSMenu what kind of button press we have received.
1288
1289 2015-04-08  Brady Eidson  <beidson@apple.com>
1290
1291         Expose the "Share" menu for links, images, and media.
1292         <rdar://problem/20435340> and https://bugs.webkit.org/show_bug.cgi?id=143502
1293
1294         Reviewed by Tim Horton.
1295
1296         * Shared/ContextMenuContextData.cpp:
1297         (WebKit::ContextMenuContextData::ContextMenuContextData):
1298
1299         * Shared/WebHitTestResult.cpp:
1300         (WebKit::WebHitTestResult::Data::Data):
1301         * Shared/WebHitTestResult.h:
1302
1303         * UIProcess/WebPageProxy.cpp:
1304         (WebKit::WebPageProxy::internalShowContextMenu):
1305
1306         * WebProcess/WebCoreSupport/WebContextMenuClient.cpp:
1307         (WebKit::WebContextMenuClient::shareMenuItem):
1308         * WebProcess/WebCoreSupport/WebContextMenuClient.h:
1309
1310         * WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm:
1311         (WebKit::WebContextMenuClient::shareSelectedTextMenuItem): Deleted.
1312
1313         * WebProcess/WebPage/mac/WebPageMac.mm:
1314         (WebKit::WebPage::performActionMenuHitTestAtLocation):
1315
1316 2015-04-08  Anders Carlsson  <andersca@apple.com>
1317
1318         Add encoding and decoding of ints to WKRemoteObjectCoder
1319         https://bugs.webkit.org/show_bug.cgi?id=143538
1320
1321         Reviewed by Tim Horton.
1322
1323         * Shared/API/Cocoa/WKRemoteObjectCoder.mm:
1324         (-[WKRemoteObjectEncoder encodeInt:forKey:]):
1325         (-[WKRemoteObjectDecoder decodeIntForKey:]):
1326
1327 2015-04-08  Anders Carlsson  <andersca@apple.com>
1328
1329         Delete ApplicationCache static member functions
1330         https://bugs.webkit.org/show_bug.cgi?id=143534
1331
1332         Reviewed by Tim Horton.
1333
1334         * WebProcess/ApplicationCache/WebApplicationCacheManager.cpp:
1335         (WebKit::WebApplicationCacheManager::deleteEntriesForOrigin):
1336         (WebKit::WebApplicationCacheManager::deleteAllEntries):
1337         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1338         (WebKit::InjectedBundle::clearApplicationCacheForOrigin):
1339         (WebKit::InjectedBundle::appCacheUsageForOrigin):
1340
1341 2015-04-08  Enrica Casucci  <enrica@apple.com>
1342
1343         32-bit build fix after r182554.
1344
1345         * UIProcess/API/mac/WKView.mm:
1346         (-[WKView resignFirstResponder]):
1347
1348 2015-04-08  Beth Dakin  <bdakin@apple.com>
1349
1350         Force events should not require preventDefault in order to fire
1351         https://bugs.webkit.org/show_bug.cgi?id=143503
1352         -and corresponding-
1353         rdar://problem/20458916
1354
1355         Reviewed by Tim Horton.
1356
1357         We no longer need m_lastActionMenuHitTestPreventsDefault since we’ll always 
1358         dispatch the events to Element.
1359         * WebProcess/WebPage/WebPage.cpp:
1360         (WebKit::WebPage::WebPage):
1361         * WebProcess/WebPage/WebPage.h:
1362         * WebProcess/WebPage/mac/WebPageMac.mm:
1363         (WebKit::WebPage::performActionMenuHitTestAtLocation):
1364         (WebKit::WebPage::inputDeviceForceDidChange):
1365         (WebKit::WebPage::immediateActionDidCancel):
1366
1367 2015-04-08  Enrica Casucci  <enrica@apple.com>
1368
1369         Calling makeFirstResponder on WKWebView doesn't work.
1370         https://bugs.webkit.org/show_bug.cgi?id=143482
1371         rdar://problem/20298166
1372
1373         Reviewed by Dan Bernstein.
1374
1375         Adding forwarding of the responder status to the WKView.
1376         We also need to avoid doing any cleanup in resignFirstResponder
1377         if we know we are about to regain responder status again.
1378         Same goes for becomeFirstResponder.
1379
1380         * UIProcess/API/Cocoa/WKWebView.mm:
1381         (-[WKWebView becomeFirstResponder]):
1382         (-[WKWebView acceptsFirstResponder]):
1383         * UIProcess/API/mac/WKView.mm:
1384         (-[WKView becomeFristResponder]):
1385         (-[WKView resignFirstResponder]):
1386
1387 2015-04-07  Tim Horton  <timothy_horton@apple.com>
1388
1389         Fix the build.
1390
1391         * UIProcess/API/mac/WKView.mm:
1392         (-[WKView _setFixedLayoutSize:]):
1393
1394 2015-04-07  Tim Horton  <timothy_horton@apple.com>
1395
1396         Expose and test fixedLayoutSize via modern WebKit SPI
1397         https://bugs.webkit.org/show_bug.cgi?id=143500
1398
1399         Reviewed by Simon Fraser.
1400
1401         * UIProcess/API/Cocoa/WKViewPrivate.h:
1402         * UIProcess/API/Cocoa/WKWebView.mm:
1403         (-[WKWebView _isFixedLayoutEnabled]):
1404         (-[WKWebView _setFixedLayoutEnabled:]):
1405         (-[WKWebView _fixedLayoutSize]):
1406         (-[WKWebView _setFixedLayoutSize:]):
1407         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1408         * UIProcess/API/mac/WKView.mm:
1409         (-[WKView _isFixedLayoutEnabled]):
1410         (-[WKView _setFixedLayoutEnabled:]):
1411         (-[WKView _fixedLayoutSize]):
1412         (-[WKView _setFixedLayoutSize:]):
1413         Add API for adjusting the fixed layout size, and whether or not we use it.
1414
1415         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1416         (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage):
1417         Repair a mistake I made in r139822, where I brought odd TILED_BACKING_STORE-only
1418         logic (which disables scrollbars if fixedLayoutSize is enabled) to the rest of the ports.
1419         Put it back as TILED_BACKING_STORE-only.
1420
1421         Persist the fixedLayoutSize through view creation; we already persist the enabled state,
1422         but not the size, which doesn't make any sense.
1423
1424         * WebProcess/WebPage/WebPage.cpp:
1425         (WebKit::WebPage::fixedLayoutSize):
1426         * WebProcess/WebPage/WebPage.h:
1427         Add a fixedLayoutSize() getter.
1428
1429 2015-04-07  Brady Eidson  <beidson@apple.com>
1430
1431         ContextMenuItem refactoring
1432         https://bugs.webkit.org/show_bug.cgi?id=143485
1433
1434         Reviewed by Beth Dakin.
1435
1436         * Shared/mac/NativeContextMenuItem.mm:
1437         (WebKit::NativeContextMenuItem::NativeContextMenuItem):
1438
1439 2015-04-07  Simon Fraser  <simon.fraser@apple.com>
1440
1441         Add a new setting, AntialiasedFontDilationEnabled, exposed via WK2.
1442         https://bugs.webkit.org/show_bug.cgi?id=143495
1443
1444         Reviewed by Tim Horton.
1445         
1446         Exposed the antialiasedFontDilationEnabled setting via WK C SPI and Objective-C SPI.
1447
1448         * Shared/WebPreferencesDefinitions.h:
1449         * UIProcess/API/C/WKPreferences.cpp:
1450         (WKPreferencesSetAntialiasedFontDilationEnabled):
1451         (WKPreferencesGetAntialiasedFontDilationEnabled):
1452         * UIProcess/API/C/WKPreferencesRefPrivate.h:
1453         * UIProcess/API/Cocoa/WKPreferences.mm:
1454         (-[WKPreferences _antialiasedFontDilationEnabled]):
1455         (-[WKPreferences _setAntialiasedFontDilationEnabled:]):
1456         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
1457         * WebProcess/WebPage/WebPage.cpp:
1458         (WebKit::WebPage::updatePreferences):
1459
1460 2015-04-07  Beth Dakin  <bdakin@apple.com>
1461
1462         Should only propagate pressure events with relevant phases
1463         https://bugs.webkit.org/show_bug.cgi?id=143494
1464         -and corresponding-
1465         rdar://problem/20453738
1466
1467         Reviewed by Tim Horton.
1468
1469         We only care about the changed, began, and ended phases. 
1470         * UIProcess/API/mac/WKView.mm:
1471         (-[WKView pressureChangeWithEvent:]):
1472
1473 2015-04-07  Jer Noble  <jer.noble@apple.com>
1474
1475         Unreviewed build fix; make calls to new SPI conditional on iOS version.
1476
1477         * UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
1478         (WebKit::WebVideoFullscreenManagerProxy::setVideoLayerFrame):
1479
1480 2015-04-06  Anders Carlsson  <andersca@apple.com>
1481
1482         Create the web inspector process pool lazily
1483         https://bugs.webkit.org/show_bug.cgi?id=143456
1484         rdar://problem/20146520
1485
1486         Reviewed by Mark Lam.
1487
1488         Add and implement WebInspectorProxy::isInspectorProcessPool instead of always creating the inspector process pool
1489         when trying to determine if a given process pool is the inspector process pool.
1490
1491         This should speed up initialization somewhat and avoid creating a storage manager for example.
1492
1493         * UIProcess/WebInspectorProxy.cpp:
1494         (WebKit::WebInspectorProxy::inspectorProcessPool):
1495         (WebKit::WebInspectorProxy::isInspectorProcessPool):
1496         * UIProcess/WebInspectorProxy.h:
1497         * UIProcess/WebProcessProxy.cpp:
1498         (WebKit::WebProcessProxy::getLaunchOptions):
1499
1500 2015-04-06  Brady Eidson  <beidson@apple.com>
1501
1502         Combine ActionMenuHitTestResult with WebHitTestResult
1503         https://bugs.webkit.org/show_bug.cgi?id=143444
1504
1505         Reviewed by Beth Dakin.
1506
1507         * Shared/mac/ActionMenuHitTestResult.h: Removed.
1508         * Shared/mac/ActionMenuHitTestResult.mm: Removed.
1509
1510         * Shared/WebHitTestResult.cpp:
1511         (WebKit::WebHitTestResult::Data::Data):
1512         (WebKit::WebHitTestResult::Data::encode):
1513         (WebKit::WebHitTestResult::Data::decode):
1514         (WebKit::WebHitTestResult::Data::platformEncode):
1515         (WebKit::WebHitTestResult::Data::platformDecode):
1516         * Shared/WebHitTestResult.h:
1517         * Shared/mac/WebHitTestResult.mm: Added.
1518         (WebKit::WebHitTestResult::Data::platformEncode):
1519         (WebKit::WebHitTestResult::Data::platformDecode):
1520
1521         * UIProcess/API/mac/WKView.mm:
1522         (-[WKView _didPerformActionMenuHitTest:forImmediateAction:contentPreventsDefault:userData:]):
1523         (-[WKView _didPerformActionMenuHitTest:forImmediateAction:userData:]): Deleted.
1524         * UIProcess/API/mac/WKViewInternal.h:
1525         * UIProcess/PageClient.h:
1526         * UIProcess/WebPageProxy.cpp:
1527         (WebKit::WebPageProxy::didPerformActionMenuHitTest):
1528         * UIProcess/WebPageProxy.h:
1529         * UIProcess/WebPageProxy.messages.in:
1530         * UIProcess/mac/PageClientImpl.h:
1531         * UIProcess/mac/PageClientImpl.mm:
1532         (WebKit::PageClientImpl::didPerformActionMenuHitTest):
1533         * UIProcess/mac/WKActionMenuController.h:
1534         * UIProcess/mac/WKActionMenuController.mm:
1535         (-[WKActionMenuController willDestroyView:]):
1536         (-[WKActionMenuController _clearActionMenuState]):
1537         (-[WKActionMenuController didPerformActionMenuHitTest:userData:]):
1538         (-[WKActionMenuController _hitTestResultDataImage]):
1539         (-[WKActionMenuController _defaultMenuItemsForImage]):
1540         (-[WKActionMenuController _copyImage:]):
1541         (-[WKActionMenuController _addImageToPhotos:]):
1542         (-[WKActionMenuController _defaultMenuItemsForDataDetectedText]):
1543         (-[WKActionMenuController _defaultMenuItemsForEditableTextWithSuggestions]):
1544         (-[WKActionMenuController _defaultMenuItemsForDataDetectableLink]):
1545         (-[WKActionMenuController _webHitTestResult]):
1546         (-[WKActionMenuController _defaultMenuItems]):
1547         (-[WKActionMenuController _hitTestResultImage]): Deleted.
1548         * UIProcess/mac/WKImmediateActionController.h:
1549         * UIProcess/mac/WKImmediateActionController.mm:
1550         (-[WKImmediateActionController willDestroyView:]):
1551         (-[WKImmediateActionController _clearImmediateActionState]):
1552         (-[WKImmediateActionController didPerformActionMenuHitTest:contentPreventsDefault:userData:]):
1553         (-[WKImmediateActionController immediateActionRecognizerDidUpdateAnimation:]):
1554         (-[WKImmediateActionController _webHitTestResult]):
1555         (-[WKImmediateActionController _defaultAnimationController]):
1556         (-[WKImmediateActionController _updateImmediateActionItem]):
1557         (-[WKImmediateActionController _menuItemForDataDetectedText]):
1558         (-[WKImmediateActionController _animationControllerForText]):
1559         (-[WKImmediateActionController didPerformActionMenuHitTest:userData:]): Deleted.
1560         * WebKit2.xcodeproj/project.pbxproj:
1561         * WebProcess/WebPage/mac/WebPageMac.mm:
1562         (WebKit::WebPage::performActionMenuHitTestAtLocation):
1563
1564 2015-04-06  Jer Noble  <jer.noble@apple.com>
1565
1566         Synchronize fullscreen animation between processes.
1567         https://bugs.webkit.org/show_bug.cgi?id=143131
1568
1569         Reviewed by Simon Fraser.
1570
1571         Support synchronize resizing by animating within the UIProcess. Since setVideoLayerFrameFenced() is now only
1572         ever called from within a 0-duration transaction, make that the official contract of the function and wrap
1573         the WebProcess side of that method in its own 0-duration transaction.
1574
1575         * Platform/spi/ios/BackBoardServicesSPI.h: Added.
1576         * Platform/spi/ios/UIKitSPI.h:
1577         * UIProcess/ios/WebVideoFullscreenManagerProxy.h:
1578         * UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
1579         (WebKit::WebVideoFullscreenManagerProxy::setupFullscreenWithID): Remember the initial rect.
1580         (WebKit::WebVideoFullscreenManagerProxy::videoLayerFrame): Added; simple getter.
1581         (WebKit::WebVideoFullscreenManagerProxy::setVideoLayerFrame): Use a different synchronization fence primative.
1582             Save the cached frame value.
1583         (WebKit::WebVideoFullscreenManagerProxy::videoLayerGravity): Added; simple getter.
1584         (WebKit::WebVideoFullscreenManagerProxy::setVideoLayerGravity): Save the cached gravity value.
1585         * WebKit2.xcodeproj/project.pbxproj:
1586         * WebProcess/ios/WebVideoFullscreenManager.mm:
1587         (WebKit::WebVideoFullscreenManager::setVideoLayerFrameFenced): Wrap in a 0-length transaction.
1588
1589 2015-04-06  Chris Dumez  <cdumez@apple.com>
1590
1591         [WK2][iOS] Regression(r182323): ASSERTION FAILED: WebCore::SQLiteDatabaseTracker::hasTransactionInProgress() in NetworkCache::Statistics::initialize()
1592         https://bugs.webkit.org/show_bug.cgi?id=143451
1593         <rdar://problem/20437994>
1594
1595         Reviewed by Anders Carlsson.
1596
1597         Initialize WebProcess::m_webSQLiteDatabaseTracker and
1598         NetworkProcess::m_webSQLiteDatabaseTracker in their respective class
1599         constructors instead of doing it later in the initializeWebProcess() /
1600         initializeNetworkProcess() methods.
1601
1602         If we do it later, it can happen that the tracker gets set after
1603         a SQLiteTransactionInProgressAutoCounter initialization and before
1604         the actual transaction. When this happens, the
1605         SQLiteTransactionInProgressAutoCounter variable fails to increment the
1606         transaction count. Then when the transaction is executed,
1607         SQLiteDatabaseTracker::hasTransactionInProgress() can return false.
1608         This would lead to possible assertions on start up on iOS.
1609
1610         * NetworkProcess/NetworkProcess.cpp:
1611         (WebKit::NetworkProcess::NetworkProcess):
1612         (WebKit::NetworkProcess::initializeNetworkProcess):
1613         * NetworkProcess/NetworkProcess.h:
1614         * WebProcess/WebProcess.cpp:
1615         (WebKit::WebProcess::WebProcess):
1616         (WebKit::WebProcess::initializeConnection):
1617         * WebProcess/WebProcess.h:
1618
1619 2015-04-06  Beth Dakin  <bdakin@apple.com>
1620
1621         https://trac.webkit.org/changeset/182338 introduced a build failure that I 
1622         attempted to fix with https://trac.webkit.org/changeset/182341 , but that disabled 
1623         the feature accidentally.  This should do the right thing.
1624
1625         * UIProcess/API/mac/WKView.mm:
1626         (-[WKView pressureChangeWithEvent:]):
1627
1628 2015-04-06  Commit Queue  <commit-queue@webkit.org>
1629
1630         Unreviewed, rolling out r182296.
1631         https://bugs.webkit.org/show_bug.cgi?id=143448
1632
1633         This will disturb network cache efficacy logging, we should
1634         reland this later. (Requested by cdumez__ on #webkit).
1635
1636         Reverted changeset:
1637
1638         "[WK2][NetworkCache] Drop HTTP method from NetworkCache::Key"
1639         https://bugs.webkit.org/show_bug.cgi?id=143348
1640         http://trac.webkit.org/changeset/182296
1641
1642 2015-04-06  Žan Doberšek  <zdobersek@igalia.com>
1643
1644         [WK2] API::Array::copy() should move the resulting Vector<> of copies into the Array::create() call
1645         https://bugs.webkit.org/show_bug.cgi?id=143413
1646
1647         Reviewed by Darin Adler.
1648
1649         Move the Vector<> object containing the copied elements into the Array::create()
1650         call, avoiding copying all the elements again.
1651
1652         While here, change the Vector<> parameters for Array::create() and the Array
1653         constructor to rvalue references. This will ensure that the passed-in object
1654         is moved into the Array::create() call if possible, or explicitly copied
1655         otherwise. The constructor is moved into the header for inlining opportunities
1656         and the unnecessary parameter in the create(Vector<>&&) method declaration
1657         removed.
1658
1659         * Shared/API/APIArray.cpp:
1660         (API::Array::create):
1661         (API::Array::copy):
1662         (API::Array::Array): Deleted.
1663         * Shared/API/APIArray.h:
1664
1665 2015-04-06  Žan Doberšek  <zdobersek@igalia.com>
1666
1667         UserScript, UserStyleSheet constructors should take in Vector<String> rvalues
1668         https://bugs.webkit.org/show_bug.cgi?id=143411
1669
1670         Reviewed by Darin Adler.
1671
1672         Move the whitelist and blacklist Vector<String> objects into the
1673         UserScript and UserStyleSheet constructors in ArgumentCoder<T>::decode
1674         functions.
1675
1676         * Shared/WebCoreArgumentCoders.cpp:
1677         (IPC::ArgumentCoder<UserStyleSheet>::decode):
1678         (IPC::ArgumentCoder<UserScript>::decode):
1679
1680 2015-04-05  Darin Adler  <darin@apple.com>
1681
1682         [Mac] Spins seen in WKSetApplicationInformationItem, so it should not be called on the main thread
1683         https://bugs.webkit.org/show_bug.cgi?id=143423
1684         rdar://problem/18773785
1685
1686         Reviewed by Alexey Proskuryakov.
1687
1688         * WebProcess/cocoa/WebProcessCocoa.mm:
1689         (WebKit::origin): Factored out this helper function from updateActivePages below, so
1690         the function below is easier to read.
1691         (WebKit::WebProcess::updateActivePages): Refactored to use the new origin function.
1692         Use dispatch_async to call WKSetApplicationInformationItem without blocking.
1693
1694 2015-04-05  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
1695
1696         Use constants of sqlite3 directly for status of SQL result in webdatabase
1697         https://bugs.webkit.org/show_bug.cgi?id=143329
1698
1699         Reviewed by Darin Adler.
1700
1701         In webdatabase, it has used own constant variables as well as using sqlite3 constants directly.
1702         If sqlite3 constants are changed in the library, we should modify many files as well. Besides
1703         it can cause to use if~else statement which consumes more cpu cycles compared to switch~case.
1704
1705         * DatabaseProcess/IndexedDB/sqlite/SQLiteIDBCursor.cpp:
1706         (WebKit::SQLiteIDBCursor::createSQLiteStatement):
1707         (WebKit::SQLiteIDBCursor::resetAndRebindStatement):
1708         (WebKit::SQLiteIDBCursor::bindArguments):
1709         (WebKit::SQLiteIDBCursor::internalAdvanceOnce):
1710         * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp:
1711         (WebKit::createOrMigrateRecordsTableIfNecessary):
1712         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::createAndPopulateInitialMetadata):
1713         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::extractExistingMetadata):
1714         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::changeDatabaseVersion):
1715         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::createObjectStore):
1716         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::deleteObjectStore):
1717         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::clearObjectStore):
1718         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::createIndex):
1719         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::deleteIndex):
1720         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::generateKeyNumber):
1721         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::updateKeyGeneratorNumber):
1722         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::keyExistsInObjectStore):
1723         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::putRecord):
1724         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::uncheckedPutIndexRecord):
1725         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::deleteRecord):
1726         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::getKeyRecordFromObjectStore):
1727         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::getKeyRangeRecordFromObjectStore):
1728         * NetworkProcess/cache/NetworkCacheStatistics.cpp:
1729         (WebKit::NetworkCache::executeSQLStatement):
1730         (WebKit::NetworkCache::Statistics::initialize):
1731         (WebKit::NetworkCache::Statistics::queryWasEverRequested):
1732         (WebKit::NetworkCache::Statistics::addHashesToDatabase):
1733         (WebKit::NetworkCache::Statistics::addStoreDecisionsToDatabase):
1734         * UIProcess/Storage/LocalStorageDatabase.cpp:
1735         (WebKit::LocalStorageDatabase::importItems):
1736         (WebKit::LocalStorageDatabase::updateDatabaseWithChangedItems):
1737         (WebKit::LocalStorageDatabase::databaseIsEmpty):
1738         * UIProcess/Storage/LocalStorageDatabaseTracker.cpp:
1739         (WebKit::LocalStorageDatabaseTracker::deleteAllDatabases):
1740         (WebKit::LocalStorageDatabaseTracker::importOriginIdentifiers):
1741         (WebKit::LocalStorageDatabaseTracker::addDatabaseWithOriginIdentifier):
1742         (WebKit::LocalStorageDatabaseTracker::removeDatabaseWithOriginIdentifier):
1743         (WebKit::LocalStorageDatabaseTracker::pathForDatabaseWithOriginIdentifier):
1744         * WebProcess/Cookies/soup/WebKitSoupCookieJarSqlite.cpp:
1745         (webkitSoupCookieJarSqliteLoad):
1746         (webkitSoupCookieJarSqliteInsertCookie):
1747         (webkitSoupCookieJarSqliteDeleteCookie):
1748
1749 2015-04-05  Simon Fraser  <simon.fraser@apple.com>
1750
1751         Remove "go ahead and" from comments
1752         https://bugs.webkit.org/show_bug.cgi?id=143421
1753
1754         Reviewed by Darin Adler, Benjamin Poulain.
1755
1756         Remove the phrase "go ahead and" from comments where it doesn't add
1757         anything (which is almost all of them).
1758
1759         * Platform/unix/EnvironmentUtilities.cpp:
1760         (WebKit::EnvironmentUtilities::stripValuesEndingWithString):
1761         * PluginProcess/PluginProcess.cpp:
1762         (WebKit::PluginProcess::didClose):
1763         * UIProcess/API/mac/WKView.mm:
1764         (-[WKView insertText:replacementRange:]):
1765         (-[WKView _pluginFocusOrWindowFocusChanged:pluginComplexTextInputIdentifier:]):
1766         * UIProcess/Storage/LocalStorageDatabaseTracker.cpp:
1767         (WebKit::LocalStorageDatabaseTracker::removeDatabaseWithOriginIdentifier):
1768
1769 2015-04-05  Antti Koivisto  <antti@apple.com>
1770
1771         Bloom filter should support longer hashes
1772         https://bugs.webkit.org/show_bug.cgi?id=143419
1773
1774         Reviewed by Dan Bernstein.
1775
1776         Use the hash digest directly in the contents filter instead of going via shortHash.
1777
1778         * NetworkProcess/cache/NetworkCacheKey.h:
1779         (WebKit::NetworkCache::Key::hash):
1780         (WebKit::NetworkCache::Key::shortHash): Deleted.
1781         (WebKit::NetworkCache::Key::toShortHash): Deleted.
1782
1783             No longer needed.
1784
1785         * NetworkProcess/cache/NetworkCacheStorage.cpp:
1786         (WebKit::NetworkCache::Storage::synchronize):
1787         (WebKit::NetworkCache::Storage::addToContentsFilter):
1788         (WebKit::NetworkCache::Storage::mayContain):
1789         * NetworkProcess/cache/NetworkCacheStorage.h:
1790
1791 2015-04-05  Antti Koivisto  <antti@apple.com>
1792
1793         Network cache Bloom filter is too big
1794         https://bugs.webkit.org/show_bug.cgi?id=143400
1795
1796         Follow-up: Fix an ineffective assert.
1797
1798         * NetworkProcess/cache/NetworkCacheStorage.cpp:
1799         (WebKit::NetworkCache::Storage::setMaximumSize): Average resource size is closer to 50KB than 50MB.
1800
1801 2015-04-05  Antti Koivisto  <antti@apple.com>
1802
1803         Rename Cache::setMaximumSize to setCapacity
1804         https://bugs.webkit.org/show_bug.cgi?id=143418
1805
1806         Reviewed by Dan Bernstein.
1807
1808         * NetworkProcess/cache/NetworkCache.cpp:
1809         (WebKit::NetworkCache::Cache::setCapacity):
1810         (WebKit::NetworkCache::Cache::setMaximumSize): Deleted.
1811         * NetworkProcess/cache/NetworkCache.h:
1812         * NetworkProcess/cache/NetworkCacheStorage.cpp:
1813         (WebKit::NetworkCache::Storage::retrieve):
1814         (WebKit::NetworkCache::Storage::store):
1815         (WebKit::NetworkCache::Storage::update):
1816         (WebKit::NetworkCache::Storage::setCapacity):
1817         (WebKit::NetworkCache::Storage::shrinkIfNeeded):
1818         (WebKit::NetworkCache::Storage::shrink):
1819         (WebKit::NetworkCache::Storage::setMaximumSize): Deleted.
1820         * NetworkProcess/cache/NetworkCacheStorage.h:
1821         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
1822         (WebKit::NetworkProcess::platformSetCacheModel):
1823
1824 2015-04-04  Antti Koivisto  <antti@apple.com>
1825
1826         Network cache Bloom filter is too big
1827         https://bugs.webkit.org/show_bug.cgi?id=143400
1828
1829         Reviewed by Chris Dumez.
1830
1831         It is currently 1MB.
1832
1833         This patch switches the cache from a counting filter (CountingBloomFilter) to a bit filter (BloomFilter).
1834
1835         It also reduces the filter size from 2^20 to 2^18 elements which is good for ~26000 cache entries while
1836         still keeping false positive rate below 1%. The current cache capacity allows around 4000 entries
1837         with typical web contents.
1838
1839         The new filter size is 32KB.
1840
1841         * NetworkProcess/cache/NetworkCacheStorage.cpp:
1842         (WebKit::NetworkCache::Storage::Storage):
1843         (WebKit::NetworkCache::Storage::synchronize):
1844
1845             Turn initialization function into general purpose synchronization function.
1846
1847         (WebKit::NetworkCache::Storage::addToContentsFilter):
1848
1849             Collect newly added hashes so we don't miss entries that were added during synchronization.
1850
1851         (WebKit::NetworkCache::Storage::mayContain):
1852         (WebKit::NetworkCache::Storage::remove):
1853         (WebKit::NetworkCache::Storage::retrieve):
1854         (WebKit::NetworkCache::Storage::store):
1855         (WebKit::NetworkCache::Storage::dispatchPendingWriteOperations):
1856         (WebKit::NetworkCache::Storage::dispatchFullWriteOperation):
1857         (WebKit::NetworkCache::Storage::dispatchHeaderWriteOperation):
1858         (WebKit::NetworkCache::Storage::setMaximumSize):
1859         (WebKit::NetworkCache::Storage::clear):
1860         (WebKit::NetworkCache::Storage::shrinkIfNeeded):
1861         (WebKit::NetworkCache::Storage::shrink):
1862
1863             Non-counting Bloom filter does not support removals so this requires a new strategy.
1864
1865             Shrink code now simply deletes entries. The filter is updated by calling synchronize() at the end.
1866             While we could synchronize the filter during traversal it is better to just have one function for that.
1867
1868         (WebKit::NetworkCache::Storage::initialize): Deleted.
1869         * NetworkProcess/cache/NetworkCacheStorage.h:
1870         (WebKit::NetworkCache::Storage::mayContain):
1871         (WebKit::NetworkCache::Storage::cacheMayContain): Deleted.
1872
1873 2015-04-04  Andy Estes  <aestes@apple.com>
1874
1875         [Content Filtering] Blocked page is not always displayed when it should be
1876         https://bugs.webkit.org/show_bug.cgi?id=143410
1877
1878         Reviewed by Andreas Kling.
1879
1880         * UIProcess/WebFrameProxy.cpp:
1881         (WebKit::WebFrameProxy::didStartProvisionalLoad): Stopped clearing m_contentFilterUnblockHandler here.
1882         (WebKit::WebFrameProxy::didHandleContentFilterUnblockNavigation): Started doing it here instead.
1883
1884 2015-04-04  Chris Dumez  <cdumez@apple.com>
1885
1886         [WK2][Cocoa] Add a way to temporarily disable the WebKit Network Cache for testing
1887         https://bugs.webkit.org/show_bug.cgi?id=143392
1888         <rdar://problem/20315669>
1889
1890         Reviewed by Antti Koivisto.
1891
1892         Add a way to temporarily disable the WebKit Network Cache for testing.
1893         It will be used temporarily for comparing page load times with and
1894         without the WebKit network disk cache enabled.
1895
1896         This is in addition to the existing "WebKitNetworkCacheEnabled"
1897         NSUserDefaults:
1898         webkitNetworkCacheIsEnabled = [defaults boolForKey:WebKitNetworkCacheEnabledDefaultsKey]
1899             && ![defaults boolForKey:WebKitNetworkCacheTemporarilyDisabledForTestingKey];
1900
1901         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1902         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
1903
1904 2015-04-04  Simon Fraser  <simon.fraser@apple.com>
1905
1906         REGRESSION (r182215): Feedly crashes when closing article
1907         https://bugs.webkit.org/show_bug.cgi?id=143405
1908         rdar://problem/20382734, rdar://problem/20395497
1909
1910         Reviewed by Tim Horton.
1911         
1912         Calling computeNonFastScrollableRegion() eagerly when scrollable areas come and go
1913         is bad, because it can cause FrameView::layout() to get called in the middle of
1914         RenderObject destruction, which leaves the render tree in a bad state.
1915         
1916         Fix by calling computeNonFastScrollableRegion() lazily, just before scrolling tree commit.
1917         
1918         AsyncScrollingCoordinator::frameViewNonFastScrollableRegionChanged() now just sets
1919         a flag to say that the non-fast region needs to be recomputed, and that schedules
1920         a scrolling tree commit. When the commit happens, we recompute the region. If the
1921         region didn't change, and no other changes are pending, there's no need to commit.
1922
1923         * WebProcess/Scrolling/RemoteScrollingCoordinator.mm:
1924         (WebKit::RemoteScrollingCoordinator::buildTransaction):
1925         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
1926         (WebKit::TiledCoreAnimationDrawingArea::flushLayers): Outdent #ifdefs.
1927
1928 2015-04-03  Beth Dakin  <bdakin@apple.com>
1929
1930         Attempted build fix.
1931
1932         * UIProcess/API/mac/WKView.mm:
1933
1934 2015-04-03  Simon Fraser  <simon.fraser@apple.com>
1935
1936         Fix the firing of the ReachedSessionRestorationRenderTreeSizeThreshold milestone on iOS
1937         https://bugs.webkit.org/show_bug.cgi?id=143394
1938
1939         Reviewed by Tim Horton.
1940         
1941         A client reshuffle at some point broke the dispatch of the ReachedSessionRestorationRenderTreeSizeThreshold
1942         milestone. Fix by using WebPageProxy::didLayout() to fire the milestone.
1943
1944         * UIProcess/ios/WebPageProxyIOS.mm:
1945         (WebKit::WebPageProxy::didCommitLayerTree):
1946
1947 2015-04-03  Beth Dakin  <bdakin@apple.com>
1948
1949         https://bugs.webkit.org/show_bug.cgi?id=143387
1950         Improvements to webkitmouseforce web API
1951         -and corresponding-
1952         rdar://problem/20281808
1953         rdar://problem/20281853
1954
1955         Reviewed by Darin Adler.
1956
1957         This patch:
1958         1. Dispatches webkitmouseforceup and webkitmouseforceclick at the right time.
1959         2. Dispatches webkitmouseforcechanged from mousedown all the way through through 
1960         mouseup.
1961         3. Uses force values from pressureChangeWithEvent instead of the immediate action 
1962         gesture recognizer.
1963
1964         Listen for this NSResponder method, and pass the relevant info to WebPageProxy to 
1965         dispatch to the web process.
1966         * UIProcess/API/mac/WKView.mm:
1967         (-[WKView pressureChangeWithEvent:]):
1968         * UIProcess/WebPageProxy.cpp:
1969         (WebKit::WebPageProxy::inputDeviceForceDidChange):
1970         (WebKit::WebPageProxy::immediateActionDidUpdate):
1971         * UIProcess/WebPageProxy.h:
1972
1973         The web process still needs to know when the immediate action gesture recognizer 
1974         is updating, but it doesn’t need the force information. That will come from 
1975         pressureChangeWithEvent.
1976         * UIProcess/mac/WKImmediateActionController.mm:
1977         (-[WKImmediateActionController immediateActionRecognizerDidUpdateAnimation:]):
1978
1979         Cache m_lastForceStage so that we can determine if we are 
1980         transitioning to a new stage.
1981         * WebProcess/WebPage/WebPage.cpp:
1982         (WebKit::WebPage::WebPage):
1983         * WebProcess/WebPage/WebPage.h:
1984
1985         New message for InputDeviceForceDidChange and modified message for 
1986         ImmediateActionDidUpdate
1987         * WebProcess/WebPage/WebPage.messages.in:
1988
1989         inputDeviceForceDidChange now takes care of dispatching mouseforcechanged, 
1990         mouseforcedown, mouseforceup, and mouseforceclick.
1991         * WebProcess/WebPage/mac/WebPageMac.mm:
1992         (WebKit::WebPage::inputDeviceForceDidChange):
1993
1994         We still need to keep track of the ImmediateActionStages in WebCore::EventHandler 
1995         so that we can have the right default behavior on mouseup based on whether or not 
1996         that action began and was completed. (In other words, to ensure we don’t navigate 
1997         to a link after force clicking it.)
1998         (WebKit::WebPage::immediateActionDidUpdate):
1999         (WebKit::WebPage::immediateActionDidComplete):
2000
2001 2015-04-03  Said Abou-Hallawa  <sabouhallawa@apple.com>
2002
2003         InjectedBundleNodeHandle::renderedImage() needs to be exposed from the Cocoa WebAPI layer.
2004         https://bugs.webkit.org/show_bug.cgi?id=143341.
2005
2006         Reviewed by Anders Carlsson.
2007
2008         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.h:
2009         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.mm:
2010         (-[WKWebProcessPlugInNodeHandle renderedImageWithOptions:]): Expose rendered
2011         image injected bundle API from the Cocoa layer. A node in the page can be
2012         rendered to an NSImage on MacOS and to a UIImage on iOS.
2013
2014 2015-04-03  Chris Dumez  <cdumez@apple.com>
2015
2016         [WK2][iOS] We should prevent NetworkProcess suspension while it has pending SQL transactions
2017         https://bugs.webkit.org/show_bug.cgi?id=143278
2018         <rdar://problem/20180799>
2019
2020         Reviewed by Anders Carlsson.
2021
2022         Prevent NetworkProcess suspension while it has pending SQL transactions,
2023         similarly to what we already did for WebProcesses. This patch moves the
2024         WebSQLiteDatabaseTracker from WebProcess/ to Shared/ and make it usable
2025         by the NetworkProcess class as well.
2026
2027         Whenever there are locked files to due SQL transactions, the
2028         NetworkProcess will send an IPC message to the NetworkProcessProxy
2029         which will hold a background process assertion until the NetworkProcess'
2030         SQL transactions are complete. This way, it is no longer possible for
2031         the NetworkProcess to get suspended while SQL transactions are running
2032         and a database file is locked.
2033
2034         * NetworkProcess/NetworkProcess.cpp:
2035         (WebKit::NetworkProcess::initializeNetworkProcess):
2036         * NetworkProcess/NetworkProcess.h:
2037         * Shared/WebSQLiteDatabaseTracker.cpp: Renamed from Source/WebKit2/WebProcess/WebCoreSupport/WebSQLiteDatabaseTracker.cpp.
2038         (WebKit::WebSQLiteDatabaseTracker::WebSQLiteDatabaseTracker):
2039         (WebKit::m_childProcessType):
2040         (WebKit::WebSQLiteDatabaseTracker::willBeginFirstTransaction):
2041         (WebKit::WebSQLiteDatabaseTracker::didFinishLastTransaction):
2042         (WebKit::WebSQLiteDatabaseTracker::hysteresisUpdated):
2043         * Shared/WebSQLiteDatabaseTracker.h: Renamed from Source/WebKit2/WebProcess/WebCoreSupport/WebSQLiteDatabaseTracker.h.
2044         * UIProcess/Network/NetworkProcessProxy.cpp:
2045         (WebKit::NetworkProcessProxy::didClose):
2046         (WebKit::NetworkProcessProxy::setIsHoldingLockedFiles):
2047         * UIProcess/Network/NetworkProcessProxy.h:
2048         * UIProcess/Network/NetworkProcessProxy.messages.in:
2049         * WebKit2.xcodeproj/project.pbxproj:
2050         * WebProcess/WebProcess.cpp:
2051         (WebKit::WebProcess::WebProcess):
2052         (WebKit::WebProcess::initializeConnection):
2053         * WebProcess/WebProcess.h:
2054
2055 2015-04-03  Antti Koivisto  <antti@apple.com>
2056
2057         Add non-counting Bloom filter implementation
2058         https://bugs.webkit.org/show_bug.cgi?id=143366
2059
2060         Reviewed by Sam Weinig.
2061
2062         * NetworkProcess/cache/NetworkCacheStorage.h:
2063
2064 2015-04-03  Zan Dobersek  <zdobersek@igalia.com>
2065
2066         Fix the EFL and GTK build after r182243
2067         https://bugs.webkit.org/show_bug.cgi?id=143361
2068
2069         Reviewed by Csaba Osztrogonác.
2070
2071         * PlatformGTK.cmake: Add a custom command that copies the
2072         InspectorBackendCommands.js file into the proper directory
2073         under DerivedSources/WebInspectorUI/.
2074
2075 2015-04-03  Philippe Normand  <pnormand@igalia.com>
2076
2077         Unreviewed, GTK build fix.
2078
2079         * UIProcess/API/gtk/WebKitContextMenuClient.cpp:
2080         * UIProcess/gtk/WebContextMenuProxyGtk.cpp:
2081         * UIProcess/gtk/WebContextMenuProxyGtk.h:
2082
2083 2015-04-02  Csaba Osztrogonác  <ossy@webkit.org>
2084
2085         Typo fix.
2086
2087         * PlatformGTK.cmake:
2088
2089 2015-04-02  Csaba Osztrogonác  <ossy@webkit.org>
2090
2091         URTBF after r182303, stub NativeContextMenuItem implemetations added for EFL and GTK.
2092
2093         * PlatformEfl.cmake:
2094         * PlatformGTK.cmake:
2095         * Shared/efl/NativeContextMenuItemEfl.cpp: Added.
2096         (WebKit::NativeContextMenuItem::NativeContextMenuItem):
2097         * Shared/gtk/NativeContextMenuItemGtk.cpp: Added.
2098         (WebKit::NativeContextMenuItem::NativeContextMenuItem):
2099
2100 2015-04-02  Timothy Horton  <timothy_horton@apple.com>
2101
2102         De-PLATFORM(IOS)-ify LayerHostingContext::setFencePort
2103         https://bugs.webkit.org/show_bug.cgi?id=143342
2104
2105         * Platform/mac/LayerHostingContext.h:
2106         * Platform/mac/LayerHostingContext.mm:
2107         Actually, not available on Mavericks. Fix the build.
2108
2109 2015-04-02  Brady Eidson  <beidson@apple.com>
2110
2111         Unreviewed: Re-applied change after rollout.
2112
2113         Expose the "Share" menu for text selections on platforms where it's available.
2114         rdar://problem/20034174 and https://bugs.webkit.org/show_bug.cgi?id=143318
2115
2116         * Shared/API/c/WKContextMenuItemTypes.h: Add a constant for the Share menu.
2117         * Shared/API/c/WKSharedAPICast.h:
2118         (WebKit::toAPI):
2119         (WebKit::toImpl):
2120
2121         * Shared/ContextMenuContextData.cpp:
2122         (WebKit::ContextMenuContextData::ContextMenuContextData):
2123         (WebKit::ContextMenuContextData::encode):
2124         (WebKit::ContextMenuContextData::decode):
2125         * Shared/ContextMenuContextData.h:
2126         (WebKit::ContextMenuContextData::selectedText):
2127
2128         Add a "cross platform" menu item wrapper, right now only for NSMenuItem.
2129         * Shared/NativeContextMenuItem.h:
2130         (WebKit::NativeContextMenuItem::~NativeContextMenuItem):
2131         (WebKit::NativeContextMenuItem::nsMenuItem):
2132         * Shared/mac/NativeContextMenuItem.mm:
2133         (WebKit::NativeContextMenuItem::NativeContextMenuItem):
2134
2135         Let WebContextMenuItem hold on to a NativeContextMenuItem to maintain full fidelity of the platform.
2136         * Shared/WebContextMenuItem.cpp:
2137         (WebKit::WebContextMenuItem::WebContextMenuItem):
2138         * Shared/WebContextMenuItem.h:
2139         (WebKit::WebContextMenuItem::create):
2140         (WebKit::WebContextMenuItem::nativeContextMenuItem):
2141
2142         * UIProcess/API/APIContextMenuClient.h:
2143         (API::ContextMenuClient::getContextMenuFromProposedMenu):
2144         (API::ContextMenuClient::showContextMenu):
2145
2146         * UIProcess/API/C/WKPage.cpp:
2147         (WKPageSetPageContextMenuClient):
2148
2149         * UIProcess/WebContextMenuProxy.h:
2150
2151         * UIProcess/WebPageProxy.cpp:
2152         (WebKit::WebPageProxy::internalShowContextMenu): Translate the placeholder item from the web process into the
2153           native Share menu before consulting the context menu client. Also create the API items here so the native NSMenuItem
2154           can be attached to them.
2155
2156         * UIProcess/mac/WebContextMenuProxyMac.h:
2157         * UIProcess/mac/WebContextMenuProxyMac.mm:
2158         (-[WKMenuTarget forwardContextMenuAction:]):
2159         (WebKit::nsMenuItem):
2160         (WebKit::nsMenuItemVector):
2161         (WebKit::WebContextMenuProxyMac::populate):
2162         (WebKit::WebContextMenuProxyMac::showContextMenu):
2163
2164         * WebKit2.xcodeproj/project.pbxproj:
2165
2166         * WebProcess/WebCoreSupport/WebContextMenuClient.h:
2167         * WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm:
2168         (WebKit::WebContextMenuClient::shareSelectedTextMenuItem): In the web process, mark the Share menu's place in the
2169           context menu with a placeholder item. It will be translated into the real Share menu in the UI process.
2170
2171 2015-04-02  Commit Queue  <commit-queue@webkit.org>
2172
2173         Unreviewed, rolling out r182293.
2174         https://bugs.webkit.org/show_bug.cgi?id=143355
2175
2176         Broke GTK and EFL builds. (Requested by bfulgham on #webkit).
2177
2178         Reverted changeset:
2179
2180         "Expose the "Share" menu for text selections on platforms
2181         where it's available."
2182         https://bugs.webkit.org/show_bug.cgi?id=143318
2183         http://trac.webkit.org/changeset/182293
2184
2185 2015-04-02  Chris Dumez  <cdumez@apple.com>
2186
2187         [WK2][NetworkCache] Drop HTTP method from NetworkCache::Key
2188         https://bugs.webkit.org/show_bug.cgi?id=143348
2189
2190         Reviewed by Antti Koivisto.
2191
2192         Drop HTTP method from NetworkCache::Key as we only cache GET responses
2193         for now. Even when we start caching HEAD responses, we likely will not
2194         want the method to be part of the key because:
2195         - A HEAD response can be used to update the headers of a previously cached response to GET
2196         - A cached GET response may be used to satisfy subsequent HEAD requests
2197
2198         * NetworkProcess/cache/NetworkCache.cpp:
2199         (WebKit::NetworkCache::makeCacheKey):
2200         * NetworkProcess/cache/NetworkCacheKey.cpp:
2201         (WebKit::NetworkCache::Key::Key):
2202         (WebKit::NetworkCache::Key::operator=):
2203         (WebKit::NetworkCache::Key::computeHash):
2204         (WebKit::NetworkCache::Key::operator==):
2205         (WebKit::NetworkCache::Key::encode):
2206         (WebKit::NetworkCache::Key::decode):
2207         * NetworkProcess/cache/NetworkCacheKey.h:
2208         (WebKit::NetworkCache::Key::method): Deleted.
2209
2210 2015-04-02  Jer Noble  <jer.noble@apple.com>
2211
2212         [Mac][WK2] Fullscreen animation incorrect when initiated on non-primary monitor
2213         https://bugs.webkit.org/show_bug.cgi?id=143237
2214
2215         Reviewed by Brent Fulgham.
2216
2217         The animation calculations have an implicit assumptions of a screen whose origin is 0,0. Account
2218         for the screen origin by passing the window's screen's frame into the zoomAnimation() and maskAnimation()
2219         methods.
2220
2221         * UIProcess/mac/WKFullScreenWindowController.mm:
2222         (-[WKFullScreenWindowController initWithWindow:webView:]):
2223         (zoomAnimation):
2224         (maskAnimation):
2225         (-[WKFullScreenWindowController _startEnterFullScreenAnimationWithDuration:]):
2226         (-[WKFullScreenWindowController _startExitFullScreenAnimationWithDuration:]):
2227
2228 2015-04-02  Brady Eidson  <beidson@apple.com>
2229
2230         Expose the "Share" menu for text selections on platforms where it's available.
2231         rdar://problem/20034174 and https://bugs.webkit.org/show_bug.cgi?id=143318
2232
2233         Reviewed by Sam Weinig.
2234
2235         * Shared/API/c/WKContextMenuItemTypes.h: Add a constant for the Share menu.
2236         * Shared/API/c/WKSharedAPICast.h:
2237         (WebKit::toAPI):
2238         (WebKit::toImpl):
2239
2240         * Shared/ContextMenuContextData.cpp:
2241         (WebKit::ContextMenuContextData::ContextMenuContextData):
2242         (WebKit::ContextMenuContextData::encode):
2243         (WebKit::ContextMenuContextData::decode):
2244         * Shared/ContextMenuContextData.h:
2245         (WebKit::ContextMenuContextData::selectedText):
2246
2247         Add a "cross platform" menu item wrapper, right now only for NSMenuItem.
2248         * Shared/NativeContextMenuItem.h:
2249         (WebKit::NativeContextMenuItem::~NativeContextMenuItem):
2250         (WebKit::NativeContextMenuItem::nsMenuItem):
2251         * Shared/mac/NativeContextMenuItem.mm:
2252         (WebKit::NativeContextMenuItem::NativeContextMenuItem):
2253
2254         Let WebContextMenuItem hold on to a NativeContextMenuItem to maintain full fidelity of the platform.
2255         * Shared/WebContextMenuItem.cpp:
2256         (WebKit::WebContextMenuItem::WebContextMenuItem):
2257         * Shared/WebContextMenuItem.h:
2258         (WebKit::WebContextMenuItem::create):
2259         (WebKit::WebContextMenuItem::nativeContextMenuItem):
2260
2261         * UIProcess/API/APIContextMenuClient.h:
2262         (API::ContextMenuClient::getContextMenuFromProposedMenu):
2263         (API::ContextMenuClient::showContextMenu):
2264
2265         * UIProcess/API/C/WKPage.cpp:
2266         (WKPageSetPageContextMenuClient):
2267
2268         * UIProcess/WebContextMenuProxy.h:
2269
2270         * UIProcess/WebPageProxy.cpp:
2271         (WebKit::WebPageProxy::internalShowContextMenu): Translate the placeholder item from the web process into the
2272           native Share menu before consulting the context menu client. Also create the API items here so the native NSMenuItem
2273           can be attached to them.
2274
2275         * UIProcess/mac/WebContextMenuProxyMac.h:
2276         * UIProcess/mac/WebContextMenuProxyMac.mm:
2277         (-[WKMenuTarget forwardContextMenuAction:]):
2278         (WebKit::nsMenuItem):
2279         (WebKit::nsMenuItemVector):
2280         (WebKit::WebContextMenuProxyMac::populate):
2281         (WebKit::WebContextMenuProxyMac::showContextMenu):
2282
2283         * WebKit2.xcodeproj/project.pbxproj:
2284
2285         * WebProcess/WebCoreSupport/WebContextMenuClient.h:
2286         * WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm:
2287         (WebKit::WebContextMenuClient::shareSelectedTextMenuItem): In the web process, mark the Share menu's place in the
2288           context menu with a placeholder item. It will be translated into the real Share menu in the UI process.
2289
2290 2015-04-02  Timothy Horton  <timothy_horton@apple.com>
2291
2292         De-PLATFORM(IOS)-ify LayerHostingContext::setFencePort
2293         https://bugs.webkit.org/show_bug.cgi?id=143342
2294
2295         Reviewed by Myles C. Maxfield.
2296
2297         * Platform/mac/LayerHostingContext.h:
2298         * Platform/mac/LayerHostingContext.mm:
2299         (WebKit::LayerHostingContext::setFencePort):
2300         There's nothing iOS specific about this.
2301
2302 2015-04-02  Oliver Hunt  <oliver@apple.com>
2303
2304         Ensure that we always set network ATS context in the network process
2305         https://bugs.webkit.org/show_bug.cgi?id=143343
2306
2307         Reviewed by Dan Bernstein.
2308
2309         If a custom cache location or size we were early returning before setting
2310         the CFNetwork ATS context. This is clearly an error.
2311
2312         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
2313         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
2314
2315 2015-04-02  Alexey Proskuryakov  <ap@apple.com>
2316
2317         Make checkURLReceivedFromWebProcess not rely on details of platform URL implementation.
2318         https://bugs.webkit.org/show_bug.cgi?id=143222
2319         rdar://problem/19978997
2320
2321         Reviewed by Sam Weinig.
2322
2323         * UIProcess/WebProcessProxy.cpp:
2324         (WebKit::WebProcessProxy::checkURLReceivedFromWebProcess):
2325
2326 2015-04-02  Yusuke Suzuki  <utatane.tea@gmail.com>
2327
2328         Clean up EnumerationMode to easily extend
2329         https://bugs.webkit.org/show_bug.cgi?id=143276
2330
2331         Reviewed by Geoffrey Garen.
2332
2333         Use default EnumerationMode().
2334
2335         * WebProcess/Plugins/Netscape/NPJSObject.cpp:
2336         (WebKit::NPJSObject::enumerate):
2337
2338 2015-04-02  Chris Dumez  <cdumez@apple.com>
2339
2340         [WK2][iOS] Update the WebContent process' sandbox profile for AWD
2341         https://bugs.webkit.org/show_bug.cgi?id=143340
2342         <rdar://problem/20375170>
2343
2344         Reviewed by Alexey Proskuryakov.
2345
2346         Update the WebContent process' sandbox profile for AWD.
2347
2348         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2349
2350 2015-04-01  Antti Koivisto  <antti@apple.com>
2351
2352         Use std::chrono types to represent time in response and cache classes
2353         https://bugs.webkit.org/show_bug.cgi?id=143316
2354
2355         Reviewed by Andreas Kling.
2356
2357         * NetworkProcess/NetworkResourceLoader.cpp:
2358         (WebKit::NetworkResourceLoader::didFinishLoading):
2359         * NetworkProcess/cache/NetworkCache.cpp:
2360         (WebKit::NetworkCache::responseHasExpired):
2361         (WebKit::NetworkCache::responseNeedsRevalidation):
2362         (WebKit::NetworkCache::makeStoreDecision):
2363         (WebKit::NetworkCache::Cache::store):
2364         * NetworkProcess/cache/NetworkCacheEntry.cpp:
2365         (WebKit::NetworkCache::Entry::Entry):
2366         (WebKit::NetworkCache::Entry::asJSON):
2367         * NetworkProcess/cache/NetworkCacheEntry.h:
2368         (WebKit::NetworkCache::Entry::timeStamp):
2369         * NetworkProcess/cache/NetworkCacheStorage.cpp:
2370         (WebKit::NetworkCache::decodeRecordMetaData):
2371         (WebKit::NetworkCache::decodeRecord):
2372
2373             Sanity check the timestamp on decode.
2374
2375         (WebKit::NetworkCache::encodeRecordMetaData):
2376         (WebKit::NetworkCache::encodeRecordHeader):
2377         (WebKit::NetworkCache::Storage::traverse):
2378         * NetworkProcess/cache/NetworkCacheStorage.h:
2379         * WebProcess/Plugins/PluginView.cpp:
2380         (WebKit::lastModifiedDateMS):
2381         (WebKit::PluginView::Stream::didReceiveResponse):
2382         (WebKit::PluginView::manualLoadDidReceiveResponse):
2383         (WebKit::lastModifiedDate): Deleted.
2384
2385 2015-04-01  Chris Dumez  <cdumez@apple.com>
2386
2387         [WK2][Cocoa] Add didFailProvisionalLoadWithErrorForFrame callback to WKWebProcessPlugInLoadDelegate
2388         https://bugs.webkit.org/show_bug.cgi?id=143319
2389         <rdar://problem/19463834>
2390
2391         Reviewed by Dan Bernstein.
2392
2393         Add didFailProvisionalLoadWithErrorForFrame callback to
2394         WKWebProcessPlugInLoadDelegate so that the client side can track all
2395         types page load completions:
2396         - didFailProvisionalLoadWithErrorForFrame
2397         - didFailLoadWithErrorForFrame
2398         - didFinishLoadForFrame
2399
2400         Note that this event is already exposed on UIProcess side via the
2401         WKPageLoaderClient.didFailLoadWithErrorForFrame callback.
2402
2403         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInLoadDelegate.h:
2404         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
2405         (didFailProvisionalLoadWithErrorForFrame):
2406         (setUpPageLoaderClient):
2407
2408 2015-04-01  Enrica Casucci  <enrica@apple.com>
2409
2410         Injected bundle messages should be at the page level.
2411         https://bugs.webkit.org/show_bug.cgi?id=143283
2412
2413         Reviewed by Alexey Proskuryakov.
2414
2415         All the messages between the injected bundle and the UI
2416         process should be page level messages instead of context.
2417         The author of this patch is Tim Horton, I just finished it.
2418
2419         * UIProcess/API/C/WKPage.cpp:
2420         (WKPageSetPageInjectedBundleClient):
2421         * UIProcess/API/C/WKPage.h:
2422         * UIProcess/API/C/WKPageInjectedBundleClient.h: Added.
2423         * UIProcess/API/Cocoa/WKWebView.mm:
2424         (-[WKWebView _pageForTesting]):
2425         * UIProcess/API/Cocoa/WKWebViewInternal.h:
2426         * UIProcess/WebPageInjectedBundleClient.cpp: Added.
2427         (WebKit::WebPageInjectedBundleClient::didReceiveMessageFromInjectedBundle):
2428         (WebKit::WebPageInjectedBundleClient::didReceiveSynchronousMessageFromInjectedBundle):
2429         * UIProcess/WebPageInjectedBundleClient.h: Added.
2430         * UIProcess/WebPageProxy.cpp:
2431         (WebKit::WebPageProxy::setInjectedBundleClient):
2432         (WebKit::WebPageProxy::handleMessage):
2433         (WebKit::WebPageProxy::handleSynchronousMessage):
2434         * UIProcess/WebPageProxy.h:
2435         (WebKit::WebPageProxy::injectedBundleClient):
2436         * UIProcess/WebPageProxy.messages.in:
2437         * UIProcess/WebProcessPool.cpp:
2438         (WebKit::WebProcessPool::handleMessage):
2439         * WebKit2.xcodeproj/project.pbxproj:
2440         * CMakeLists.txt:
2441         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
2442         (WKBundlePagePostMessage):
2443         (WKBundlePagePostSynchronousMessage):
2444         * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
2445         * WebProcess/WebPage/WebPage.cpp:
2446         (WebKit::WebPage::postMessage):
2447         (WebKit::WebPage::postSynchronousMessage):
2448         * WebProcess/WebPage/WebPage.h:
2449
2450 2015-04-01  Alexey Proskuryakov  <ap@apple.com>
2451
2452         [iOS] WebContent should have access to the entirety of its caches directory
2453         https://bugs.webkit.org/show_bug.cgi?id=143312
2454         rdar://problem/20314916
2455
2456         Reviewed by Oliver Hunt.
2457
2458         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
2459         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
2460         * Shared/Network/NetworkProcessCreationParameters.cpp:
2461         (WebKit::NetworkProcessCreationParameters::encode):
2462         (WebKit::NetworkProcessCreationParameters::decode):
2463         * Shared/Network/NetworkProcessCreationParameters.h:
2464         * Shared/WebProcessCreationParameters.cpp:
2465         (WebKit::WebProcessCreationParameters::encode):
2466         (WebKit::WebProcessCreationParameters::decode):
2467         * Shared/WebProcessCreationParameters.h:
2468         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2469         (WebKit::WebProcessPool::networkingCachesDirectory):
2470         (WebKit::WebProcessPool::webContentCachesDirectory):
2471         (WebKit::WebProcessPool::openGLCacheDirectory): Deleted.
2472         (WebKit::WebProcessPool::networkingHSTSDatabasePath): Deleted.
2473         (WebKit::WebProcessPool::webContentHSTSDatabasePath): Deleted.
2474         * UIProcess/WebProcessPool.cpp:
2475         (WebKit::WebProcessPool::ensureNetworkProcess):
2476         (WebKit::WebProcessPool::createNewWebProcess):
2477         * UIProcess/WebProcessPool.h:
2478         * WebProcess/cocoa/WebProcessCocoa.mm:
2479         (WebKit::WebProcess::platformInitializeWebProcess):
2480
2481 2015-04-01  Timothy Horton  <timothy_horton@apple.com>
2482
2483         Smart magnification gesture sometimes shoots to the middle of the page
2484         https://bugs.webkit.org/show_bug.cgi?id=143296
2485         <rdar://problem/18209280>
2486
2487         Reviewed by Dean Jackson.
2488
2489         * UIProcess/mac/ViewGestureControllerMac.mm:
2490         (WebKit::ViewGestureController::didCollectGeometryForSmartMagnificationGesture):
2491         Constrain the target rect to the viewport, and if it had overflowed the viewport,
2492         scroll halfway towards the gesture origin.
2493
2494 2015-03-31  Simon Fraser  <simon.fraser@apple.com>
2495
2496         Remove scrolling tree dependency on wheel event handler counts, and use fast scrolling even when there are wheel handlers
2497         https://bugs.webkit.org/show_bug.cgi?id=143288
2498         rdar://problem/16049624
2499
2500         Reviewed by Beth Dakin.
2501
2502         Remove the wheel event counting that Document does, and passes into the scrolling tree.
2503         The ScrollingTree now just uses the non-fast scrollable region to determine when to
2504         fast scroll on pages with wheel event handlers.
2505         
2506         If a handler includes position:fixed renderers, we just cover the whole document
2507         with the slow-scrolling region currently. This could be improved.
2508
2509         * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp:
2510         (ArgumentCoder<ScrollingStateFrameScrollingNode>::encode):
2511         (ArgumentCoder<ScrollingStateFrameScrollingNode>::decode):
2512         (WebKit::RemoteScrollingTreeTextStream::dump):
2513         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2514         (WebKit::WebChromeClient::wheelEventHandlersChanged):
2515         (WebKit::WebChromeClient::numWheelEventHandlersChanged): Deleted.
2516         * WebProcess/WebCoreSupport/WebChromeClient.h:
2517         * WebProcess/WebPage/WebPage.cpp:
2518         (WebKit::WebPage::WebPage):
2519         (WebKit::WebPage::wheelEventHandlersChanged):
2520         (WebKit::WebPage::recomputeShortCircuitHorizontalWheelEventsState):
2521         (WebKit::WebPage::numWheelEventHandlersChanged): Deleted.
2522         * WebProcess/WebPage/WebPage.h:
2523
2524 2015-03-31  Dan Bernstein  <mitz@apple.com>
2525
2526         <rdar://problem/20365675> [iOS] Include Add to Reading List link action only where supported
2527         https://bugs.webkit.org/show_bug.cgi?id=143289
2528
2529         Reviewed by Tim Horton.
2530
2531         * UIProcess/API/Cocoa/_WKElementAction.h: Excluded _WKElementActionTypeAddToReadingList from
2532         the _WKElementActionType enum when Reading List is not supported.
2533
2534         * UIProcess/API/Cocoa/_WKElementAction.mm:
2535         (+[_WKElementAction elementActionWithType:customTitle:]): Made Add to Reading List code
2536         conditional on HAVE(SAFARI_SERVICES_FRAMEWORK).
2537
2538         * UIProcess/ios/WKActionSheetAssistant.mm:
2539         (-[WKActionSheetAssistant showImageSheet]): Ditto.
2540         (-[WKActionSheetAssistant showLinkSheet]): Ditto.
2541
2542         * config.h: Defined HAVE_SAFARI_SERVICES_FRAMEWORK.
2543
2544 2015-03-31  Timothy Horton  <timothy_horton@apple.com>
2545
2546         TextIndicator for <span> inside an <a> only highlights the <span>, should highlight the whole <a>
2547         https://bugs.webkit.org/show_bug.cgi?id=143287
2548         <rdar://problem/20318342>
2549
2550         Reviewed by Beth Dakin.
2551
2552         * WebProcess/WebPage/mac/WebPageMac.mm:
2553         (WebKit::WebPage::performActionMenuHitTestAtLocation):
2554         Instead of just highlighting the hit element, highlight the whole
2555         element that the link URL comes from.
2556
2557 2015-03-31  Timothy Horton  <timothy_horton@apple.com>
2558
2559         WKView should stop using endGestureWithEvent
2560         https://bugs.webkit.org/show_bug.cgi?id=143285
2561         <rdar://problem/20357007>
2562
2563         Reviewed by Simon Fraser.
2564
2565         * UIProcess/API/mac/WKView.mm:
2566         (-[WKView magnifyWithEvent:]):
2567         (-[WKView endGestureWithEvent:]): Deleted.
2568         * UIProcess/mac/ViewGestureController.h:
2569         * UIProcess/mac/ViewGestureControllerMac.mm:
2570         (WebKit::ViewGestureController::endMagnificationGesture):
2571         (WebKit::ViewGestureController::endActiveGesture): Deleted.
2572         While there is no visible symptom, it is recommended that we check
2573         the phase of normal magnification events instead of using the
2574         special gesture end events.
2575
2576 2015-03-31  Timothy Horton  <timothy_horton@apple.com>
2577
2578         Swipes occur in the wrong direction in RTL
2579         https://bugs.webkit.org/show_bug.cgi?id=143257
2580         <rdar://problem/20300862>
2581
2582         Reviewed by Simon Fraser.
2583
2584         * UIProcess/ios/ViewGestureControllerIOS.mm:
2585         (-[WKSwipeTransitionController gestureRecognizerForInteractiveTransition:WithTarget:action:]):
2586         When choosing which edge to attach our gesture recognizers to,
2587         flip them in RTL.
2588
2589         (-[WKSwipeTransitionController directionForTransition:]):
2590         (WebKit::ViewGestureController::beginSwipeGesture):
2591         (WebKit::ViewGestureController::canSwipeInDirection):
2592         * UIProcess/mac/ViewGestureController.h:
2593         * UIProcess/mac/ViewGestureControllerMac.mm:
2594         (WebKit::ViewGestureController::scrollEventCanBecomeSwipe):
2595         (WebKit::ViewGestureController::trackSwipeGesture):
2596         (WebKit::ViewGestureController::determineLayerAdjacentToSnapshotForParent):
2597         (WebKit::ViewGestureController::beginSwipeGesture):
2598         (WebKit::ViewGestureController::handleSwipeGesture):
2599         Adjust SwipeDirection to be in logical back-forward list direction
2600         instead of physical edge direction.
2601
2602 2015-03-31  Myles C. Maxfield  <mmaxfield@apple.com>
2603
2604         Move ExpansionBehaviorFlags and TextDirection to their own file
2605         https://bugs.webkit.org/show_bug.cgi?id=143273
2606
2607         Reviewed by Simon Fraser.
2608
2609         This is a mechanical change. It just moves code around.
2610
2611         This is getting ready for https://bugs.webkit.org/show_bug.cgi?id=142608
2612
2613         * Shared/WebPopupItem.h:
2614         * UIProcess/API/C/efl/WKAPICastEfl.h:
2615         * UIProcess/API/efl/EwkView.h:
2616         * UIProcess/WebPopupMenuProxy.h:
2617         * UIProcess/efl/WebUIPopupMenuClient.h:
2618
2619 2015-03-31  Yusuke Suzuki  <utatane.tea@gmail.com>
2620
2621         Clean up Identifier factories to clarify the meaning of StringImpl*
2622         https://bugs.webkit.org/show_bug.cgi?id=143146
2623
2624         Reviewed by Filip Pizlo.
2625
2626         Just change to Identifier::fromString.
2627
2628         * WebProcess/Plugins/Netscape/JSNPObject.cpp:
2629         (WebKit::JSNPObject::getOwnPropertyNames):
2630         * WebProcess/Plugins/Netscape/NPJSObject.cpp:
2631         (WebKit::identifierFromIdentifierRep):
2632
2633 2015-03-31  Timothy Horton  <timothy_horton@apple.com>
2634
2635         WebKit briefly shows wrong webpage after swiping back (gigaom.com, or any site on a slow network)
2636         https://bugs.webkit.org/show_bug.cgi?id=143256
2637         <rdar://problem/19458648>
2638
2639         Reviewed by Dan Bernstein.
2640
2641         Instead of allowing a flash of the previous page when the swipe snapshot
2642         timeouts fire (removing the snapshot before the new page is loaded), show
2643         the snapshotted background color.
2644
2645         This fixes the problem on iOS, where UI-side compositing makes it easy to fix,
2646         but not yet on OS X.
2647
2648         * UIProcess/API/Cocoa/WKWebView.mm:
2649         (baseScrollViewBackgroundColor):
2650         (scrollViewBackgroundColor):
2651         If the ViewGestureController returns a valid background color, use that
2652         instead of the page's background color.
2653
2654         * UIProcess/API/Cocoa/WKWebViewInternal.h:
2655         Expose _updateScrollViewBackground.
2656
2657         * UIProcess/PageClient.h:
2658         * UIProcess/ios/PageClientImplIOS.h:
2659         * UIProcess/ios/PageClientImplIOS.mm:
2660         (WebKit::PageClientImpl::didChangeBackgroundColor):
2661         * UIProcess/mac/PageClientImpl.h:
2662         * UIProcess/mac/PageClientImpl.mm:
2663         (WebKit::PageClientImpl::didChangeBackgroundColor):
2664         * UIProcess/WebPageProxy.cpp:
2665         (WebKit::WebPageProxy::didChangeBackgroundColor):
2666         * UIProcess/WebPageProxy.h:
2667         Add and plumb didChangeBackgroundColor, which calls
2668         _updateScrollViewBackground on iOS.
2669         
2670         * UIProcess/ios/ViewGestureControllerIOS.mm:
2671         (WebKit::ViewGestureController::endSwipeGesture):
2672         Hide the content of the drawing area until the next commit. This way,
2673         even if the snapshot is removed (say, because a timeout fired), we won't
2674         ever show the old page content (but we will show background color).
2675
2676         Store the background color associated with the current snapshot.
2677
2678         Let WKWebView know that it needs to recompute the background color.
2679
2680         (WebKit::ViewGestureController::removeSwipeSnapshot):
2681         Clear the background color so that the next time we commit, WKWebView
2682         will get an invalid color from ViewGestureController and fall back
2683         to the page's extended background color instead.
2684
2685         * UIProcess/mac/ViewGestureController.h:
2686         (WebKit::ViewGestureController::backgroundColorForCurrentSnapshot):
2687         * UIProcess/mac/ViewGestureControllerMac.mm:
2688         (WebKit::ViewGestureController::beginSwipeGesture):
2689         (WebKit::ViewGestureController::removeSwipeSnapshot):
2690         Keep backgroundColorForCurrentSnapshot up to date on Mac too, even
2691         though we don't use it yet.
2692
2693 2015-03-31  Timothy Horton  <timothy_horton@apple.com>
2694
2695         [iOS] Rotating PDF in Safari scrolls to the wrong position
2696         https://bugs.webkit.org/show_bug.cgi?id=143259
2697         <rdar://problem/19872693>
2698
2699         Reviewed by Dan Bernstein.
2700
2701         * UIProcess/ios/WKPDFView.mm:
2702         (-[WKPDFView web_setMinimumSize:]):
2703         Maintan the relative top/left within the rescaled document.
2704
2705 2015-03-31  Chris Dumez  <cdumez@apple.com>
2706
2707         [WK2][iOS] Extend ProcessThrottler use to the NetworkProcess
2708         https://bugs.webkit.org/show_bug.cgi?id=143249
2709         <rdar://problem/20231539>
2710
2711         Reviewed by Gavin Barraclough.
2712
2713         Extend ProcessThrottler use to the NetworkProcess instead of only the
2714         WebProcesses. This is needed so that the NetworkProcess gets notified
2715         before suspension. We now use this notification to free-up memory
2716         before suspending by calling the critical memory pressure handler, as
2717         we already do for WebProcesses (rdar://problem/20231539). In the
2718         future, this infrastructure will be used to delay suspension until the
2719         pending SQL transactions are done as well (rdar://problem/20180799).
2720
2721         Previously, the NetworkProcessProxy would hold a foreground assertion
2722         on behalf of the NetworkProcess but would never release that assertion.
2723         In this patch, we change this so that WebProcessProxies hold assertions
2724         on behalf of the NetworkProcess, and release those assertions before
2725         suspending. As a result, the NetworkProcess gets suspended when all
2726         WebProcesses are suspended.
2727
2728         * NetworkProcess/NetworkProcess.cpp:
2729         (WebKit::NetworkProcess::processWillSuspend):
2730         (WebKit::NetworkProcess::cancelProcessWillSuspend):
2731         (WebKit::NetworkProcess::processDidResume):
2732         * NetworkProcess/NetworkProcess.h:
2733         * NetworkProcess/NetworkProcess.messages.in:
2734         * UIProcess/Network/NetworkProcessProxy.cpp:
2735         (WebKit::NetworkProcessProxy::NetworkProcessProxy):
2736         (WebKit::NetworkProcessProxy::didFinishLaunching):
2737         (WebKit::NetworkProcessProxy::sendProcessWillSuspend):
2738         (WebKit::NetworkProcessProxy::sendCancelProcessWillSuspend):
2739         (WebKit::NetworkProcessProxy::didCancelProcessSuspension):
2740         (WebKit::NetworkProcessProxy::sendProcessDidResume):
2741         (WebKit::NetworkProcessProxy::processReadyToSuspend):
2742         * UIProcess/Network/NetworkProcessProxy.h:
2743         (WebKit::NetworkProcessProxy::throttler):
2744         * UIProcess/Network/NetworkProcessProxy.messages.in:
2745         * UIProcess/ProcessThrottler.cpp:
2746         (WebKit::ProcessThrottler::ProcessThrottler):
2747         (WebKit::ProcessThrottler::didConnectToProcess):
2748         (WebKit::ProcessThrottler::didConnnectToProcess): Deleted.
2749         * UIProcess/ProcessThrottler.h:
2750         * UIProcess/ProcessThrottlerClient.h: Added.
2751         (WebKit::ProcessThrottlerClient::~ProcessThrottlerClient):
2752         * UIProcess/WebProcessPool.cpp:
2753         (WebKit::WebProcessPool::ensureNetworkProcess):
2754         * UIProcess/WebProcessPool.h:
2755         * UIProcess/WebProcessProxy.cpp:
2756         (WebKit::WebProcessProxy::didFinishLaunching):
2757         (WebKit::WebProcessProxy::initializeNetworkProcessActivityToken):
2758         (WebKit::WebProcessProxy::sendProcessDidResume):
2759         (WebKit::WebProcessProxy::processReadyToSuspend):
2760         * UIProcess/WebProcessProxy.h:
2761         * WebKit2.xcodeproj/project.pbxproj:
2762
2763 2015-03-31  Csaba Osztrogonác  <ossy@webkit.org>
2764
2765         Unreviewed, revert accidental change by r182138.
2766
2767         * Scripts/generate-forwarding-headers.pl:
2768         (createForwardingHeadersForFramework):
2769
2770 2015-03-31  Carlos Garcia Campos  <cgarcia@igalia.com>
2771
2772         Unreviewed. Fix GTK+ build with REDIRECTED_XCOMPOSITE_WINDOW disabled in X11 platform.
2773
2774         Also fix some unused parameter warnings when
2775         REDIRECTED_XCOMPOSITE_WINDOW is disabled.
2776
2777         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
2778         (webkitWebViewRenderAcceleratedCompositingResults):
2779         (resizeWebKitWebViewBaseFromAllocation):
2780
2781 2015-03-31  Carlos Garcia Campos  <cgarcia@igalia.com>
2782
2783         [GTK] DnD icon/widget has odd background
2784         https://bugs.webkit.org/show_bug.cgi?id=143217
2785
2786         Reviewed by Martin Robinson.
2787
2788         Use gtk_drag_set_icon_surface() to set the drag icon image,
2789         instead of DragIcon class.
2790
2791         * UIProcess/API/gtk/WebKitWebView.cpp:
2792         * UIProcess/gtk/DragAndDropHandler.cpp:
2793         (WebKit::DragAndDropHandler::startDrag):
2794         * UIProcess/gtk/DragAndDropHandler.h:
2795
2796 2015-03-30  Commit Queue  <commit-queue@webkit.org>
2797
2798         Unreviewed, rolling out r182172.
2799         https://bugs.webkit.org/show_bug.cgi?id=143250
2800
2801         Since this class is an API object, we don't know for sure when
2802         it will be destroyed. (Requested by kling on #webkit).
2803
2804         Reverted changeset:
2805
2806         "WebBackForwardList doesn't need to manually clear the
2807         snapshot of an entry when removing it."
2808         https://bugs.webkit.org/show_bug.cgi?id=143231
2809         http://trac.webkit.org/changeset/182172
2810
2811 2015-03-30  Andreas Kling  <akling@apple.com>
2812
2813         WebBackForwardList doesn't need to manually clear the snapshot of an entry when removing it.
2814         <https://webkit.org/b/143231>
2815
2816         Reviewed by Tim Horton.
2817
2818         Now that we don't keep WebBackForwardListItem objects alive forever, it's not necessary
2819         to clear the snapshot when removing them from the WebBackForwardList, since the entire
2820         object will be deleted shortly after that anyway.
2821
2822         * UIProcess/WebBackForwardList.cpp:
2823         (WebKit::WebBackForwardList::didRemoveItem):
2824
2825 2015-03-30  Enrica Casucci  <enrica@apple.com>
2826
2827         [iOS] WebContent crashing at WebCore: WebCore::Range::collectSelectionRects.
2828         https://bugs.webkit.org/show_bug.cgi?id=143234
2829         <rdar://problem/18571345>
2830
2831         Reviewed by Tim Horton.
2832
2833         This is a speculative fix that adds a null check before referencing the range.
2834         In both places where the check has been added the range returned by the call
2835         that should create it could be null.
2836
2837         * WebProcess/WebPage/ios/WebPageIOS.mm:
2838         (WebKit::WebPage::platformEditorState):
2839
2840 2015-03-30  Sam Weinig  <sam@webkit.org>
2841
2842         [Content Extensions] Flesh out the UserContentExtensionStore
2843         https://bugs.webkit.org/show_bug.cgi?id=143123
2844
2845         Reviewed by Benjamin Poulain.
2846
2847         * Shared/WebCompiledContentExtension.cpp:
2848         (WebKit::WebCompiledContentExtension::createFromCompiledContentExtensionData):
2849         * Shared/WebCompiledContentExtensionData.cpp:
2850         (WebKit::WebCompiledContentExtensionData::encode):
2851         (WebKit::WebCompiledContentExtensionData::decode):
2852         * Shared/WebCompiledContentExtensionData.h:
2853         (WebKit::WebCompiledContentExtensionData::WebCompiledContentExtensionData):
2854         Switch the order in memory of actions and bytecode (and switch the order of the
2855         variables as well, to keep it clear). This will become necessary when streaming
2856         the data to disk, as actions are created before the bytecode and we would have to keep them
2857         in memory until the bytecode was finished compiling if they didn't come before in the file.
2858
2859         * UIProcess/API/APIUserContentExtensionStore.h:
2860         * UIProcess/API/APIUserContentExtensionStore.cpp:
2861         (API::UserContentExtensionStore::defaultStore):
2862         Add accessor for the processes default shared store.
2863
2864         (API::constructedPath):
2865         Helper for constructing the path to a file in the store based on identifier.
2866
2867         (API::encodeContentExtensionMetaData):
2868         (API::decodeContentExtensionMetaData):
2869         Helpers for encoding/decoding the file metadata (version, bytecode size, actions size).
2870
2871         (API::openAndMapContentExtension):
2872         Helper to open and map a filed back content extension.
2873
2874         (API::writeDataToFile):
2875         Helper to write a Data object to a file.
2876
2877         (API::compiledToFile):
2878         Helper to run the content extension compiler and write it to disk. It first
2879         writes it to a temporary file and then does an atomic rename operation to put
2880         the file in the final location. Doing this means that if the process crashes while
2881         the compile is taking place, the partially written file won't end up in the cache, 
2882         but rather, will be cleaned up by the OS.
2883  
2884         (API::UserContentExtensionStore::lookupContentExtension):
2885         API entry point to lookup an extension that has been compiled to disk. On a background queue,
2886         it attempts to open and map the extension (based on the identifier passed in) and return it
2887         to the caller via the callback function passed in.
2888         
2889         (API::UserContentExtensionStore::compileContentExtension):
2890         API entry point to compile an extension and write it to store. On a background queue, it 
2891         compiles the file to disk and if successful, returns the memory mapped data via the callback
2892         function passed in.
2893
2894         (API::UserContentExtensionStore::removeContentExtension):
2895         API entry point to remove an extension from the store. On a background queue, it 
2896         unlinks the extension (based on the identifier passed in) and tells the caller it completed
2897         the action vial the callback function passed in.
2898
2899         (API::UserContentExtensionStore::synchronousRemoveAllContentExtensions):
2900         Helper for testing which synchronously unlinks all the files in the store.
2901
2902         (API::userContentExtensionStoreErrorCategory):
2903         std::error_code adaptor for some generic errors that can happen in the store. We will want
2904         to flesh these out further.
2905
2906         * UIProcess/API/Cocoa/APIUserContentExtensionStoreCocoa.mm: Added.
2907         (API::UserContentExtensionStore::defaultStorePath):
2908         Helper to get the platform specific path for the store.
2909
2910         * UIProcess/API/C/WKUserContentExtensionStoreRef.cpp:
2911         (WKUserContentExtensionStoreGetTypeID):
2912         Add ENABLE(CONTENT_EXTENSIONS) guards.
2913
2914         * UIProcess/API/Cocoa/_WKUserContentExtensionStore.h:
2915         * UIProcess/API/Cocoa/_WKUserContentExtensionStore.mm:
2916         (-[_WKUserContentExtensionStore dealloc]):
2917         (+[_WKUserContentExtensionStore defaultStore]):
2918         (-[_WKUserContentExtensionStore compileContentExtensionForIdentifier:encodedContentExtension:completionHandler:]):
2919         (-[_WKUserContentExtensionStore lookupContentExtensionForIdentifier:completionHandler:]):
2920         (-[_WKUserContentExtensionStore removeContentExtensionForIdentifier:completionHandler:]):
2921         (-[_WKUserContentExtensionStore _removeAllContentExtensions]):
2922         (-[_WKUserContentExtensionStore init]): Deleted.
2923         * UIProcess/API/Cocoa/_WKUserContentExtensionStoreInternal.h:
2924         * UIProcess/API/Cocoa/_WKUserContentExtensionStorePrivate.h: Added.
2925         SPI wrappers for the store.
2926
2927         * WebKit2.xcodeproj/project.pbxproj:
2928         Add new files.
2929
2930 2015-03-30  Antti Koivisto  <antti@apple.com>
2931
2932         Don't cache resources that are very unlikely to be reused
2933         https://bugs.webkit.org/show_bug.cgi?id=143226
2934
2935         Reviewed by Chris Dumez.
2936
2937         Follow-up to cover Cache-control: no-cache case which also has zero cache lifetime.
2938
2939         * NetworkProcess/cache/NetworkCache.cpp:
2940         (WebKit::NetworkCache::makeStoreDecision):
2941
2942 2015-03-30  Antti Koivisto  <antti@apple.com>
2943
2944         Include cache entry worth to json dump
2945         https://bugs.webkit.org/show_bug.cgi?id=143202
2946
2947         Follow-up fix.
2948
2949         * NetworkProcess/cache/NetworkCacheStorage.cpp:
2950         (WebKit::NetworkCache::computeRecordWorth):
2951
2952             This accidentally gave the error case worth 1 rather than 0 as it should be.
2953
2954 2015-03-30  Antti Koivisto  <antti@apple.com>
2955
2956         Don't cache resources that are very unlikely to be reused
2957         https://bugs.webkit.org/show_bug.cgi?id=143226
2958         <rdar://problem/20347160>
2959
2960         Reviewed by Geoff Garen.
2961
2962         We are writing lots of resources to the cache that are never used again.
2963
2964         In browse-around-randomly test this reduced number of cache entries created by ~20% and bytes written by ~5%.
2965
2966         * NetworkProcess/cache/NetworkCache.cpp:
2967         (WebKit::NetworkCache::makeUseDecision):
2968         (WebKit::NetworkCache::makeRetrieveDecision):
2969
2970             Rename for clarity.
2971
2972         (WebKit::NetworkCache::makeStoreDecision):
2973
2974             Store only if the resource has non-zero expiration or has validation headers.
2975
2976             Very High priority resources (main resources) keep the existing policy to minimize impact
2977             on back navigation and tab restore.
2978
2979         (WebKit::NetworkCache::Cache::retrieve):
2980         (WebKit::NetworkCache::Cache::store):
2981         (WebKit::NetworkCache::canUse): Deleted.
2982         (WebKit::NetworkCache::canRetrieve): Deleted.
2983         (WebKit::NetworkCache::canStore): Deleted.
2984         * NetworkProcess/cache/NetworkCache.h:
2985         * NetworkProcess/cache/NetworkCacheStatistics.cpp:
2986         (WebKit::NetworkCache::storeDecisionToDiagnosticKey):
2987
2988 2015-03-30  Tim Horton  <timothy_horton@apple.com>
2989
2990         Swipe snapshot removed too early (jumps around) on arstechnica and NYT
2991         https://bugs.webkit.org/show_bug.cgi?id=143199
2992         <rdar://problem/18420467>
2993
2994         Reviewed by Dan Bernstein.
2995
2996         Make ViewGestureControllerIOS's snapshot removal timing behave more like the Mac version.
2997
2998         * UIProcess/API/Cocoa/WKWebView.mm:
2999         (-[WKWebView _didCommitLayerTree:]):
3000         Let ViewGestureController know when the page has finished state restoration.
3001
3002         (-[WKWebView _didFinishLoadForMainFrame]):
3003         (-[WKWebView _didSameDocumentNavigationForMainFrame:]):
3004         Forward these to ViewGestureController.
3005
3006         * UIProcess/API/Cocoa/WKWebViewInternal.h:
3007         * UIProcess/ios/PageClientImplIOS.mm:
3008         (WebKit::PageClientImpl::didFinishLoadForMainFrame):
3009         Forward didFinishLoadForMainFrame to WKWebView.
3010
3011         * UIProcess/ios/ViewGestureControllerIOS.mm:
3012         (WebKit::ViewGestureController::ViewGestureController):
3013         (WebKit::ViewGestureController::endSwipeGesture):
3014         Split the swipe snapshot removal state into a bunch of bools.
3015
3016         (WebKit::ViewGestureController::willCommitPostSwipeTransitionLayerTree):
3017         (WebKit::ViewGestureController::setRenderTreeSize):
3018         (WebKit::ViewGestureController::removeSwipeSnapshotIfReady):
3019         (WebKit::ViewGestureController::removeSwipeSnapshot):
3020         Unify the snapshot removal logic into one function; removeSwipeSnapshotIfReady
3021         completely owns the decision. For now, we're waiting for everything, but
3022         we can do better in the future (using firstVisuallyNonEmptyLayout like Mac used to).
3023
3024         (WebKit::ViewGestureController::didRestoreScrollPosition):
3025         (WebKit::ViewGestureController::didFinishLoadForMainFrame):
3026         (WebKit::ViewGestureController::didSameDocumentNavigationForMainFrame):
3027         (WebKit::ViewGestureController::activeLoadMonitoringTimerFired):
3028         Add more conditions for swipe snapshot removal. We'll now wait for
3029         didFinishLoadForMainFrame (or didSameDocumentNavigationForMainFrame),
3030         for active loads to finish, and for the scroll position to be restored.
3031         This brings the iOS implementation in line with the slightly better Mac
3032         implementation, and also sets the stage for deduplication of all of this code.
3033         
3034         * UIProcess/mac/ViewGestureController.h:
3035         * UIProcess/mac/ViewGestureControllerMac.mm:
3036         (WebKit::ViewGestureController::ViewGestureController):
3037
3038 2015-03-30  Chris Dumez  <cdumez@apple.com>
3039
3040         [WK2][NetworkCache] Add support for "Cache-Control: max-stale" request header
3041         https://bugs.webkit.org/show_bug.cgi?id=143159
3042         <rdar://problem/20333296>
3043
3044         Reviewed by Antti Koivisto.
3045
3046         Add support for "Cache-Control: max-stale" request header:
3047         https://tools.ietf.org/html/rfc7234#section-5.2.1.2
3048
3049         * NetworkProcess/cache/NetworkCache.cpp:
3050         (WebKit::NetworkCache::responseHasExpired):
3051         (WebKit::NetworkCache::requestRequiresRevalidation):
3052         (WebKit::NetworkCache::canUse):
3053
3054 2015-03-30  Csaba Osztrogonác  <ossy@webkit.org>
3055
3056         [EFL][GTK] WebKit2's generate-forwarding-headers.pl should fail if clashing headers found
3057         https://bugs.webkit.org/show_bug.cgi?id=142909
3058
3059         Reviewed by Philippe Normand.
3060
3061         * Scripts/generate-forwarding-headers.pl:
3062         (createForwardingHeadersForFramework):
3063
3064 2015-03-29  Antti Koivisto  <antti@apple.com>
3065
3066         Include cache entry worth to json dump
3067         https://bugs.webkit.org/show_bug.cgi?id=143202
3068
3069         Reviewed by Darin Adler.
3070
3071         This is useful for analyzing cache performance.
3072         Also include the body size, total item count and average worth.
3073
3074         * NetworkProcess/cache/NetworkCache.cpp:
3075         (WebKit::NetworkCache::Cache::traverse):
3076         (WebKit::NetworkCache::Cache::dumpContentsToFile):
3077         * NetworkProcess/cache/NetworkCacheEntry.cpp:
3078         (WebKit::NetworkCache::Entry::asJSON):
3079         * NetworkProcess/cache/NetworkCacheEntry.h:
3080         * NetworkProcess/cache/NetworkCacheStorage.cpp:
3081         (WebKit::NetworkCache::Storage::traverse):
3082
3083             Add flags for specificying what sort of information is needed.
3084
3085         (WebKit::NetworkCache::computeRecordWorth):
3086
3087             Factor to a function.
3088
3089         (WebKit::NetworkCache::deletionProbability):
3090         * NetworkProcess/cache/NetworkCacheStorage.h:
3091
3092 2015-03-29  Simon Fraser  <simon.fraser@apple.com>
3093
3094         Fix iOS scrollperf crash after a web process crash
3095         https://bugs.webkit.org/show_bug.cgi?id=143110
3096
3097         Reviewed by Dean Jackson.
3098         
3099         When we destroy the drawing area after a web process crash, we also need to destroy
3100         the scrollingPerformanceData which has a reference to the drawing area.
3101
3102         * UIProcess/WebPageProxy.cpp:
3103         (WebKit::WebPageProxy::resetState):
3104
3105 2015-03-29  Simon Fraser  <simon.fraser@apple.com>
3106
3107         Convert arguments to ScrollingCoordinator functions to references
3108         https://bugs.webkit.org/show_bug.cgi?id=143198
3109
3110         Reviewed by Darin Adler.
3111
3112         Convert all the FrameView* and ScrollableArea* arguments to ScrollingCoordinator functions to
3113         references, and use references in a few other places.
3114
3115         * WebProcess/Scrolling/RemoteScrollingCoordinator.h:
3116         * WebProcess/Scrolling/RemoteScrollingCoordinator.mm:
3117         (WebKit::RemoteScrollingCoordinator::coordinatesScrollingForFrameView):
3118
3119 2015-03-29  Enrica Casucci  <enrica@apple.com>
3120
3121         [iOS WK2] WKContentView should implement _selectionClipRect
3122         https://bugs.webkit.org/show_bug.cgi?id=143143
3123         rdar://problem/20330075
3124
3125         Reviewed by Benjamin Poulain.
3126
3127         UIKit checks if the text delegate responds to this selector
3128         to retrieve the clipping rectangle for the editable element
3129         where the selection is being create.
3130
3131         * UIProcess/ios/WKContentViewInteraction.mm:
3132         (-[WKContentView _selectionClipRect]):
3133
3134 2015-03-29  Antti Koivisto  <antti@apple.com>
3135
3136         Use st_mtime instead of st_atime to track file access time
3137         https://bugs.webkit.org/show_bug.cgi?id=143200
3138
3139         Reviewed by Darin Adler.
3140
3141         On OS X atime updates automatically on read so calling Storage::traverse() would always ends up updating access times
3142         for all cache entries to the current time. This would make entry worth computation produce unexpected results.
3143         We update mtime manually on successful cache retrieve only so switching to it fixes the problem.
3144
3145         * NetworkProcess/cache/NetworkCacheFileSystemPosix.h:
3146         (WebKit::NetworkCache::fileTimes):
3147         (WebKit::NetworkCache::updateFileModificationTimeIfNeeded):
3148         (WebKit::NetworkCache::updateFileAccessTimeIfNeeded): Deleted.
3149         * NetworkProcess/cache/NetworkCacheStorage.cpp:
3150         (WebKit::NetworkCache::Storage::updateFileModificationTime):
3151         (WebKit::NetworkCache::Storage::dispatchReadOperation):
3152         (WebKit::NetworkCache::deletionProbability):
3153         (WebKit::NetworkCache::Storage::updateFileAccessTime): Deleted.
3154         * NetworkProcess/cache/NetworkCacheStorage.h:
3155
3156 2015-03-27  Gwang Yoon Hwang  <yoon@igalia.com>
3157
3158         [TexMap] Seperate BitmapTexture related classes implementations from TextureMapper
3159         https://bugs.webkit.org/show_bug.cgi?id=142386
3160
3161         Reviewed by Žan Doberšek.
3162
3163         TextureMapper and TextureMapperGL are bloated and tightly coupled with
3164         BitmapTexture. We should move these classes to seperated file of their own.
3165         Also, this patch removes friend relationship from TextureMapperGL and  its
3166         subsidiary classes.
3167
3168         The main purpose of this refactoring is to expose BitmapTexturePool to
3169         renderers of platformlayers like Video and Canvas. By doing this, each
3170         renderer can acquire textures from the global texture pool to paint
3171         their contents directly.
3172
3173         * Shared/CoordinatedGraphics/WebCoordinatedSurface.cpp: Include BitmapTextureGL.h explicitly
3174
3175 2015-03-27  Anders Carlsson  <andersca@apple.com>
3176
3177         Use a typedef for the WKPluginLoadClientPolicy enum
3178         https://bugs.webkit.org/show_bug.cgi?id=143161
3179
3180         Reviewed by Tim Horton.
3181
3182         * UIProcess/API/C/WKPluginLoadPolicy.h:
3183
3184 2015-03-27  Chris Dumez  <cdumez@apple.com>
3185
3186         [WK2][NetworkCache] Use WTF::WorkQueue abstraction inside NetworkCacheStatistics
3187         https://bugs.webkit.org/show_bug.cgi?id=143154
3188
3189         Reviewed by Antti Koivisto.
3190
3191         Use WTF::WorkQueue abstraction inside NetworkCacheStatistics, like we
3192         already do in NetworkCacheStorage.
3193
3194         * NetworkProcess/cache/NetworkCacheStatistics.cpp: Renamed from Source/WebKit2/NetworkProcess/cache/NetworkCacheStatisticsCocoa.mm.
3195         (WebKit::NetworkCache::executeSQLCommand):
3196         (WebKit::NetworkCache::executeSQLStatement):
3197         (WebKit::NetworkCache::Statistics::open):
3198         (WebKit::NetworkCache::Statistics::Statistics):
3199         (WebKit::NetworkCache::Statistics::initialize):
3200         (WebKit::NetworkCache::Statistics::bootstrapFromNetworkCache):
3201         (WebKit::NetworkCache::Statistics::shrinkIfNeeded):
3202         (WebKit::NetworkCache::Statistics::recordRetrievalRequest):
3203         (WebKit::NetworkCache::Statistics::recordNotCachingResponse):
3204         (WebKit::NetworkCache::retrieveDecisionToDiagnosticKey):
3205         (WebKit::NetworkCache::Statistics::recordNotUsingCacheForRequest):
3206         (WebKit::NetworkCache::storeDecisionToDiagnosticKey):
3207         (WebKit::NetworkCache::Statistics::recordRetrievalFailure):
3208         (WebKit::NetworkCache::cachedEntryReuseFailureToDiagnosticKey):
3209         (WebKit::NetworkCache::Statistics::recordRetrievedCachedEntry):
3210         (WebKit::NetworkCache::Statistics::markAsRequested):
3211         (WebKit::NetworkCache::Statistics::writeTimerFired):
3212         (WebKit::NetworkCache::Statistics::queryWasEverRequested):
3213         (WebKit::NetworkCache::Statistics::clear):
3214         (WebKit::NetworkCache::Statistics::addHashesToDatabase):
3215         (WebKit::NetworkCache::Statistics::addStoreDecisionsToDatabase):
3216         * NetworkProcess/cache/NetworkCacheStatistics.h:
3217         (WebKit::NetworkCache::Statistics::serialBackgroundIOQueue):
3218         * WebKit2.xcodeproj/project.pbxproj:
3219
3220 2015-03-27  Ryosuke Niwa  <rniwa@webkit.org>
3221
3222         Safari clears selection when its window gets activated via mouse down
3223         https://bugs.webkit.org/show_bug.cgi?id=143157
3224
3225         Reviewed by Anders Carlsson.
3226
3227         The bug was caused by PlatformMouseEvent created in WebKit2 not having its event number
3228         even though we were correctly calling setActivationEventNumber in WebPage::acceptsFirstMouse.
3229
3230         Fixed the bug by storing [NSEvent eventNumber] in WebMouseEvent on Mac in WebKit2 as done in WebKit1.
3231
3232         * Shared/WebEvent.h:
3233         (WebKit::WebMouseEvent::eventNumber):
3234         * Shared/WebEventConversion.cpp:
3235         (WebKit::WebKit2PlatformMouseEvent::WebKit2PlatformMouseEvent):
3236         * Shared/WebMouseEvent.cpp:
3237         (WebKit::WebMouseEvent::WebMouseEvent):
3238         (WebKit::WebMouseEvent::encode):
3239         (WebKit::WebMouseEvent::decode):
3240         * Shared/mac/WebEventFactory.mm:
3241         (WebKit::WebEventFactory::createWebMouseEvent):
3242
3243 2015-03-27  Anders Carlsson  <andersca@apple.com>
3244
3245         Only do the Connection::setShouldCloseConnectionOnMachExceptions() hack where necessary
3246         https://bugs.webkit.org/show_bug.cgi?id=143141
3247         rdar://problem/19471284
3248
3249         Reviewed by Andreas Kling.
3250
3251         * Platform/IPC/Connection.h:
3252         * Platform/IPC/mac/ConnectionMac.mm:
3253         (IPC::Connection::platformInvalidate):
3254         (IPC::Connection::platformInitialize):
3255         (IPC::Connection::open):
3256         * Shared/ChildProcessProxy.cpp:
3257         (WebKit::ChildProcessProxy::didFinishLaunching):
3258         * UIProcess/Plugins/PluginProcessProxy.cpp:
3259         (WebKit::PluginProcessProxy::didFinishLaunching):
3260
3261 2015-03-27  Tim Horton  <timothy_horton@apple.com>
3262
3263         Implement iOS WebKit2 PDF Find-in-Page
3264         https://bugs.webkit.org/show_bug.cgi?id=143065
3265         <rdar://problem/16793370>
3266
3267         Reviewed by Dan Bernstein.
3268
3269         * Platform/spi/ios/CorePDFSPI.h:
3270         Add some SPI.
3271
3272         * UIProcess/API/Cocoa/WKWebView.mm:
3273         (-[WKWebView _countStringMatches:options:maxCount:]):
3274         (-[WKWebView _findString:options:maxCount:]):
3275         (-[WKWebView _hideFindUI]):
3276         If we have a custom content view, forward find-in-page methods to it.
3277         
3278         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3279         * UIProcess/API/Cocoa/_WKFindOptions.h:
3280         Move _WKFindOptions into its own file.
3281
3282         * UIProcess/Cocoa/WKWebViewContentProvider.h:
3283         Add find-related methods to the WKWebViewContentProvider protocol.
3284
3285         * UIProcess/ios/WKPDFView.mm:
3286         (-[WKPDFView web_initWithFrame:webView:]):
3287         (-[WKPDFView dealloc]):
3288         Maintain a dispatch queue for searching the PDF.
3289
3290         (-[WKPDFView web_setContentProviderData:suggestedFilename:]):
3291         Fix a type.
3292
3293         (-[WKPDFView _ensureViewForPage:]):
3294         Split the code to create/parent a page view out from _revalidateViews,
3295         so that the find code can create/parent the targetted UIPDFPageView
3296         in order to install the find highlight in it, but before it is scrolled into view.
3297
3298         (-[WKPDFView _revalidateViews]):
3299         Use the stored page index instead of counting again.
3300         Don't unparent page views that have find-in-page highlights in them, because
3301         we won't know enough to recreate them later.
3302
3303         (-[WKPDFView _computePageAndDocumentFrames]):
3304         Put the page index in PDFPageInfo, for reference elsewhere.
3305
3306         (-[WKPDFView _stringCompareOptionsFromWKFindOptions:]):
3307         (-[WKPDFView _computeMatchesForString:options:maxCount:completionHandler:]):
3308         Asynchronously (and on our serial queue) search the PDF for the given string.
3309         We'll cache the most recent results to avoid searching more than once,
3310         cancel existing searches when another begins (since it's a serial queue,
3311         this ensures we'll only have one search active at a time).
3312
3313         (-[WKPDFView web_countStringMatches:options:maxCount:]):
3314         Count the number of matches for the given string, and inform the FindClient
3315         of the result.
3316
3317         (-[WKPDFView _didFindMatch:]):
3318         When we find a match, create a view for it, highlight the match, and
3319         zoom so that it's in-view.
3320
3321         (-[WKPDFView web_findString:options:maxCount:]):
3322         Incrementally search the document for the given string. We do an incremental
3323         search even if we have all of the results so that we can anchor the search
3324         in the right place if the new string is a prefix of the old string, etc.
3325         Wrap around appropriately when searching past the beginning or end of the
3326         document. If we have all of the results (there were less than maxCount results),
3327         look through the cached matches for the incrementally-found result and
3328         report its index to the client.
3329
3330         (-[WKPDFView web_hideFindUI]):
3331         Dismiss the selection and clear some state so we start the next search afresh.
3332
3333         * WebKit2.xcodeproj/project.pbxproj:
3334
3335 2015-03-27  Andreas Kling  <akling@apple.com>
3336
3337         WebProcessProxy should not retain WebBackForwardListItems forever.
3338         <https://webkit.org/b/143152>
3339         <rdar://problem/19925709>
3340
3341         Reviewed by Anders Carlsson.
3342
3343         Have WebProcessProxy actually forget about a WebBackForwardListItem after it's removed from
3344         the WebBackForwardList.
3345
3346         This ensures that we don't accumulate too many of these objects, which can get quite large
3347         due to the session state encoded in them.
3348
3349         We already have graceful handling of the case where an incoming IPC message references
3350         a removed back/forward list item.
3351
3352         * UIProcess/WebBackForwardList.cpp:
3353         (WebKit::WebBackForwardList::didRemoveItem):
3354         * UIProcess/WebPageProxy.cpp:
3355         (WebKit::WebPageProxy::backForwardRemovedItem):
3356         * UIProcess/WebProcessProxy.cpp:
3357         (WebKit::WebProcessProxy::removeBackForwardItem):
3358         * UIProcess/WebProcessProxy.h:
3359
3360 2015-03-27  Simon Fraser  <simon.fraser@apple.com>
3361
3362         Use the correct timebase to log scrollperf blank pixel counts on iOS
3363         https://bugs.webkit.org/show_bug.cgi?id=143149
3364
3365         Reviewed by Tim Horton.
3366         
3367         MobileSafari and WebKit need to collect scrollperf data using the same timebase;
3368         MobileSafari can't call WTF::monotonicallyIncreasingTime(), so use CFAbsoluteTimeGetCurrent()
3369         everywhere.
3370
3371         * UIProcess/Cocoa/RemoteLayerTreeScrollingPerformanceData.mm:
3372         (WebKit::RemoteLayerTreeScrollingPerformanceData::appendBlankPixelCount):
3373
3374 2015-03-27  Chris Dumez  <cdumez@apple.com>
3375
3376         [WK2][NetworkCache] Rename requestNeedsRevalidation() to requestRequiresRevalidation()
3377         https://bugs.webkit.org/show_bug.cgi?id=143137
3378
3379         Reviewed by Antti Koivisto.
3380
3381         Rename requestNeedsRevalidation() to requestRequiresRevalidation() as I
3382         think it is more accurate. It is not the request that needs revalidating.
3383         The requests just requires us to revalidate the response.
3384
3385         * NetworkProcess/cache/NetworkCache.cpp:
3386         (WebKit::NetworkCache::requestRequiresRevalidation):
3387         (WebKit::NetworkCache::canUse):
3388         (WebKit::NetworkCache::requestNeedsRevalidation): Deleted.
3389
3390 2015-03-27  Oliver Hunt  <oliver@apple.com>
3391
3392         Forward additional CFNetwork ATS information to child processes
3393         https://bugs.webkit.org/show_bug.cgi?id=143136
3394
3395         Reviewed by Anders Carlsson.
3396
3397         Add additional process creation parameter information, and pass it
3398         to the child processes that actually use CFNetwork.
3399
3400         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
3401         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
3402         * Shared/Network/NetworkProcessCreationParameters.cpp:
3403         (WebKit::NetworkProcessCreationParameters::encode):
3404         (WebKit::NetworkProcessCreationParameters::decode):
3405         * Shared/Network/NetworkProcessCreationParameters.h:
3406         * Shared/Plugins/PluginProcessCreationParameters.cpp:
3407         (WebKit::PluginProcessCreationParameters::encode):
3408         (WebKit::PluginProcessCreationParameters::decode):
3409         * Shared/Plugins/PluginProcessCreationParameters.h:
3410         * Shared/WebProcessCreationParameters.cpp:
3411         (WebKit::WebProcessCreationParameters::encode):
3412         (WebKit::WebProcessCreationParameters::decode):
3413         * Shared/WebProcessCreationParameters.h:
3414         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
3415         (WebKit::WebProcessPool::platformInitializeWebProcess):
3416         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
3417         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
3418         (WebKit::PluginProcessProxy::platformInitializePluginProcess):
3419         * WebProcess/cocoa/WebProcessCocoa.mm:
3420         (WebKit::WebProcess::platformInitializeWebProcess):
3421
3422 2015-03-27  Chris Dumez  <cdumez@apple.com>
3423
3424         [WK2][NetworkCache] We only cache responses with status codes that are cacheable by default
3425         https://bugs.webkit.org/show_bug.cgi?id=143125
3426         <rdar://problem/20321172>
3427
3428         Reviewed by Antti Koivisto.
3429
3430         We Previously only cached responses with status codes that are cacheable
3431         by default [1]. However, RFC 7234 [2] allows us to cache responses with
3432         other status codes, as long as they have explicit headers allowing
3433         caching:
3434         - 'Expires' header field
3435         - 'max-age' response directive
3436
3437         This patch updates our caching policy accordingly to improve efficiency.
3438
3439         [1] http://tools.ietf.org/html/rfc7231#page-48
3440         [2] http://tools.ietf.org/html/rfc7234#section-4.3.2
3441
3442         Test: http/tests/cache/disk-cache/disk-cache-307-status-code.html
3443
3444         * NetworkProcess/cache/NetworkCache.cpp:
3445         (WebKit::NetworkCache::canStore):
3446
3447 2015-03-26  Antti Koivisto  <antti@apple.com>
3448
3449         Respect cache-control directives in request
3450         https://bugs.webkit.org/show_bug.cgi?id=143121
3451         rdar://problem/19714040
3452
3453         Reviewed by Chris Dumez.
3454
3455         Better support for https://tools.ietf.org/html/rfc7234#section-5.2.1
3456
3457         * NetworkProcess/cache/NetworkCache.cpp:
3458         (WebKit::NetworkCache::canUse):
3459
3460             Consider requests with Cache-control: no-cache and max-age=0 expired.
3461
3462         (WebKit::NetworkCache::canStore):
3463
3464             Don't store requests with Cache-control: no-store.
3465
3466         (WebKit::NetworkCache::Cache::store):
3467         * NetworkProcess/cache/NetworkCache.h:
3468         * NetworkProcess/cache/NetworkCacheStatisticsCocoa.mm:
3469         (WebKit::NetworkCache::storeDecisionToDiagnosticKey):
3470
3471 2015-03-25  Jon Honeycutt  <jhoneycutt@apple.com>
3472
3473         iOS file upload panel menu items need icons
3474         <https://bugs.webkit.org/show_bug.cgi?id=143042>
3475         <rdar://problem/20178678>
3476
3477         Reviewed by Andy Estes.
3478
3479         * Platform/spi/ios/UIKitSPI.h:
3480         Declare new SPI methods _UIImageGetWebKitTakePhotoOrVideoIcon&nbs