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