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