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