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