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