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