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