1 2015-04-16 Tim Horton <timothy_horton@apple.com>
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>
7 Reviewed by Simon Fraser.
9 * Shared/VisibleContentRectUpdateInfo.h:
10 (WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo):
11 No cats in transaction (more of these below, too).
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.
30 2015-04-16 Sungmann Cho <sungmann.cho@navercorp.com>
32 Remove PluginController::isPluginVisible().
33 https://bugs.webkit.org/show_bug.cgi?id=143830
35 Reviewed by Darin Adler.
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.
41 No new tests, no behavior change.
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:
51 2015-04-16 Gyuyoung Kim <gyuyoung.kim@webkit.org>
53 [EFL] Disable a flaky ewk_context_network_process_model() API test
54 https://bugs.webkit.org/show_bug.cgi?id=143824
56 Reviewed by Csaba Osztrogonác.
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.
62 * UIProcess/API/efl/tests/test_ewk2_context.cpp:
65 2015-04-16 Csaba Osztrogonác <ossy@webkit.org>
67 [WK2] Forwarding headers generator shouldn't generate unnecessary headers
68 https://bugs.webkit.org/show_bug.cgi?id=143820
70 Reviewed by Carlos Garcia Campos.
72 * Scripts/generate-forwarding-headers.pl:
73 (collectNeededHeaders):
75 2015-04-16 Csaba Osztrogonác <ossy@webkit.org>
77 [GTK] Run forwarding headers generator unconditionally
78 https://bugs.webkit.org/show_bug.cgi?id=143819
80 Reviewed by Carlos Garcia Campos.
84 2015-04-15 Brent Fulgham <bfulgham@apple.com>
86 [Mac] Disable "Save to Downloads" option for local files
87 https://bugs.webkit.org/show_bug.cgi?id=143794
89 Reviewed by Tim Horton.
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.
95 * UIProcess/mac/WKActionMenuController.mm:
96 (-[WKActionMenuController _defaultMenuItemsForVideo]):
97 (-[WKActionMenuController _defaultMenuItemsForImage]):
99 2015-04-15 Anders Carlsson <andersca@apple.com>
101 Make websiteDataStore on WKWebViewConfiguration public
102 https://bugs.webkit.org/show_bug.cgi?id=143810
104 Reviewed by Dan Bernstein.
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:]):
116 2015-04-15 Anders Carlsson <andersca@apple.com>
118 Make WKWebsiteDataStore public
119 https://bugs.webkit.org/show_bug.cgi?id=143805
121 Reviewed by Dan Bernstein.
123 Rename the current _WKWebsiteDataStore to WKWebsiteDataStore. Make init unavailable and tighten up the
124 types of the defaultDataStore and nonPersistentDataStore class methods.
126 Add a new _WKWebsiteDataStore @interface and @implementation that derives from WKWebsiteDataStore
127 and forwards the defaultDataStore and nonPersistentDataStore method calls.
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]):
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.
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:
162 2015-04-15 Timothy Horton <timothy_horton@apple.com>
164 Custom CSS cursors do not use -webkit-image-set on retina displays
165 https://bugs.webkit.org/show_bug.cgi?id=120783
167 Reviewed by Beth Dakin.
168 Patch by Evan Wallace <evan.exe@gmail.com>.
170 Serialize the cursor image scale for SetCursor messages so custom
171 CSS cursors work with -webkit-image-set on retina displays.
173 * Shared/WebCoreArgumentCoders.cpp:
174 (CoreIPC::ArgumentCoder<Cursor>::encode):
175 (CoreIPC::ArgumentCoder<Cursor>::decode):
177 2015-04-15 Alex Christensen <achristensen@webkit.org>
179 Progress towards CMake on Mac.
180 https://bugs.webkit.org/show_bug.cgi?id=143785
182 Reviewed by Csaba Osztrogonác.
188 2015-04-15 Anders Carlsson <andersca@apple.com>
190 Make WKWebsiteDataRecord public
191 https://bugs.webkit.org/show_bug.cgi?id=143796
193 Reviewed by Dan Bernstein.
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.
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]):
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.
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:
220 2015-04-13 Jer Noble <jer.noble@apple.com>
222 [Fullscreen] ChromeClient::exitVideoFullscreen() should take a pointer to a HTMLVideoElement.
223 https://bugs.webkit.org/show_bug.cgi?id=143674
225 Reviewed by Darin Adler.
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.
240 2015-04-15 Antti Koivisto <antti@apple.com>
242 Network Cache: Inline small body data to record file
243 https://bugs.webkit.org/show_bug.cgi?id=143783
245 Reviewed by Chris Dumez.
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.
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):
256 Add WorkQueue argument to allow specifying which queue the result is submitted to.
258 * NetworkProcess/cache/NetworkCacheStorage.cpp:
259 (WebKit::NetworkCache::decodeRecordMetaData):
261 Add a boolean indicating whether the body is inlined.
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):
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.
275 (WebKit::NetworkCache::shouldStoreBodyAsBlob):
277 The current threshold for saving a separate blob is 16KB.
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:
285 2015-04-15 Tim Horton <timothy_horton@apple.com>
287 Non-local keyboards don't update scroll view parameters
288 https://bugs.webkit.org/show_bug.cgi?id=143791
289 <rdar://problem/18974020>
291 * Platform/spi/ios/UIKitSPI.h:
294 2015-04-15 Tim Horton <timothy_horton@apple.com>
296 Non-local keyboards don't update scroll view parameters
297 https://bugs.webkit.org/show_bug.cgi?id=143791
298 <rdar://problem/18974020>
300 Reviewed by Enrica Casucci.
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.
309 2015-04-15 Dan Bernstein <mitz@apple.com>
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
314 Reviewed by Anders Carlsson.
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
323 2015-04-14 Anders Carlsson <andersca@apple.com>
325 Make creating send rights from shared memory more robust
326 https://bugs.webkit.org/show_bug.cgi?id=143730
327 rdar://problem/16595870
329 Reviewed by Darin Adler.
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.
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.
340 (WebKit::SharedMemory::create):
341 Call makeMemoryEntry.
343 (WebKit::SharedMemory::createHandle):
344 Call createSendRight.
346 (WebKit::SharedMemory::createSendRight):
347 Call makeMemoryEntry and add the necessary assertions.
349 2015-04-15 Eric Carlson <eric.carlson@apple.com>
351 Generalize "isPlayingAudio" to include other media characteristics
352 https://bugs.webkit.org/show_bug.cgi?id=143713
354 Reviewed by Jer Noble.
356 * UIProcess/API/C/WKPage.cpp:
357 (toGenericCallbackFunction): Scope CallbackBase.
358 (WKPageForceRepaint): Ditto.
359 (WKPageValidateCommand): Ditto.
360 (WKPageComputePagesForPrinting): Ditto.
362 * UIProcess/API/Cocoa/_WKThumbnailView.mm:
363 (-[_WKThumbnailView _requestSnapshotIfNeeded]): Ditto.
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.
377 * UIProcess/WebPageProxy.cpp:
378 (WebKit::WebPageProxy::isPlayingMediaDidChange): Rename from isPlayingAudioDidChange.
379 (WebKit::WebPageProxy::isPlayingAudioDidChange): Deleted.
380 * UIProcess/WebPageProxy.h:
382 * UIProcess/WebPageProxy.messages.in:
384 * UIProcess/mac/WKFullScreenWindowController.mm:
385 (-[WKFullScreenWindowController dealloc]): Scope CallbackBase.
386 (-[WKFullScreenWindowController finishedExitFullScreenAnimation:]): Ditto.
388 * UIProcess/mac/WKPrintingView.mm:
389 (-[WKPrintingView _preparePDFDataForPrintingOnSecondaryThread]): Ditto.
390 (-[WKPrintingView _askPageToComputePageRects]): Ditto.
391 (-[WKPrintingView _drawPreview:]): Ditto.
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:
400 2015-04-15 Antti Koivisto <antti@apple.com>
402 Network Cache: Add thread-safe accessors for storage paths
403 https://bugs.webkit.org/show_bug.cgi?id=143668
405 Reviewed by Darin Adler.
407 Less need to use StringCapture.
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.
432 2015-04-14 Tim Horton <timothy_horton@apple.com>
434 Update gesture swipe shadow style
435 https://bugs.webkit.org/show_bug.cgi?id=143616
436 <rdar://problem/19295843>
438 Reviewed by Darin Adler.
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.
446 Add a dimming layer over the lower layer of content which fades in/out
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.
453 (WebKit::ViewGestureController::removeSwipeSnapshot):
454 Unparent the new layers.
456 * WebKit2.xcodeproj/project.pbxproj:
457 * Resources/SwipeShadow.png:
458 * Resources/SwipeShadow@2x.png:
459 Add the new resources.
461 2015-04-14 Brian Weinstein <bweinstein@apple.com>
463 Add SPI to clear HSTS hosts added since a date.
464 https://bugs.webkit.org/show_bug.cgi?id=143726
466 rdar://problem/16664597
468 Reviewed by Anders Carlsson.
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:
478 2015-04-14 Anders Carlsson <andersca@apple.com>
480 More work on making the SharedMemory interface more sane
481 https://bugs.webkit.org/show_bug.cgi?id=143718
483 Reviewed by Andreas Kling.
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.
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):
499 2015-04-14 Antti Koivisto <antti@apple.com>
501 Network Cache: Deduplicate body data
502 https://bugs.webkit.org/show_bug.cgi?id=143652
504 Reviewed by Darin Adler.
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.
510 We can improve disk space efficiency and use less memory by sharing identical body data between cache entries.
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.
517 The new disk structure looks like this:
522 0A3C9A970ADA27FAE9BD7BC630BAD0B929C293C0
523 0A6B8060BA77DF92C82A2FD7AF58F79524D8F34C
527 0B8645B04E7EC78C178B7460052601C2
528 0B8645B04E7EC78C178B7460052601C2-body
529 0CB1A3638D1C5A09C5E3283A74FA040B
530 0CB1A3638D1C5A09C5E3283A74FA040B-body
533 Each record file has an associated -body which is a hard link to a file in the Blobs directory.
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.
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.
541 * NetworkProcess/cache/NetworkCache.cpp:
542 (WebKit::NetworkCache::Cache::store):
543 (WebKit::NetworkCache::Cache::update):
545 Adopt the new storage interface.
547 (WebKit::NetworkCache::Cache::dumpContentsToFile):
548 * NetworkProcess/cache/NetworkCacheBlobStorage.cpp: Added.
549 (WebKit::NetworkCache::BlobStorage::BlobStorage):
550 (WebKit::NetworkCache::BlobStorage::synchronize):
552 Compute size and delete unused files from the Blobs directory (link count == 1).
554 (WebKit::NetworkCache::BlobStorage::blobPath):
555 (WebKit::NetworkCache::BlobStorage::add):
556 (WebKit::NetworkCache::BlobStorage::get):
558 Interface for storing and retrieving data blobs. Blobs are deduplicated on add.
560 (WebKit::NetworkCache::BlobStorage::remove):
562 Removes the link but doesn't remove the blob even if there are no other clients. That happens on next synchronize().
564 (WebKit::NetworkCache::BlobStorage::shareCount):
566 Checks the link count to get the number of clients.
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):
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):
607 Read both the blob and the record entry.
609 (WebKit::NetworkCache::Storage::finishReadOperation):
611 Factor to a function.
613 (WebKit::NetworkCache::Storage::store):
614 (WebKit::NetworkCache::Storage::traverse):
615 (WebKit::NetworkCache::Storage::dispatchPendingWriteOperations):
616 (WebKit::NetworkCache::Storage::dispatchWriteOperation):
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.
621 This simplifies the code and data structures.
623 (WebKit::NetworkCache::Storage::finishWriteOperation):
625 Factor to a function.
627 (WebKit::NetworkCache::Storage::clear):
628 (WebKit::NetworkCache::deletionProbability):
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.
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.
642 No need for separate update interface anymore. Regular store() avoids unnecessary body write.
644 (WebKit::NetworkCache::Storage::dispatchFullWriteOperation): Deleted.
645 (WebKit::NetworkCache::Storage::dispatchHeaderWriteOperation): Deleted.
646 * NetworkProcess/cache/NetworkCacheStorage.h:
647 * WebKit2.xcodeproj/project.pbxproj:
649 2015-04-14 Chris Dumez <cdumez@apple.com>
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
654 Reviewed by Darin Adler.
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.
662 * WebProcess/WebPage/WebPage.cpp:
663 (WebKit::WebPage::didChangeSelection):
665 2015-04-13 Alexey Proskuryakov <ap@apple.com>
667 Build fixes after r182772.
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.
676 2015-04-13 Alexey Proskuryakov <ap@apple.com>
680 * UIProcess/mac/PageClientImpl.mm:
681 (WebKit::PageClientImpl::setDragImage):
683 2015-04-13 Hunseop Jeong <hs85.jeong@samsung.com>
685 [EFL][GTK] Fix build break after r182753
686 https://bugs.webkit.org/show_bug.cgi?id=143689
688 Reviewed by Anders Carlsson.
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.
699 2015-04-13 Alexey Proskuryakov <ap@apple.com>
703 * UIProcess/mac/PageClientImpl.mm: (WebKit::PageClientImpl::setDragImage):
705 2015-04-13 Anders Carlsson <andersca@apple.com>
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
710 Reviewed by Tim Horton.
712 * Platform/SharedMemory.h:
713 * Platform/mac/SharedMemoryMac.cpp:
714 (WebKit::machProtection):
715 (WebKit::SharedMemory::create):
716 (WebKit::SharedMemory::map):
717 (WebKit::SharedMemory::createHandle):
719 2015-04-13 Tim Horton <timothy_horton@apple.com>
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>
725 Reviewed by Darin Adler.
727 Add a new "view" scale factor to WKView and WKWebView.
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
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.
740 * UIProcess/WebPageProxy.cpp:
741 (WebKit::WebPageProxy::scaleView):
742 Add scaleView, which updates our cached viewScaleFactor and pushes it to the Web process.
744 (WebKit::WebPageProxy::creationParameters):
745 Plumb viewScaleFactor through the page creation parameters.
747 * UIProcess/WebPageProxy.h:
748 (WebKit::WebPageProxy::viewScaleFactor): Added.
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.
755 (WebKit::WebPage::scalePage):
756 Multiply the page scale factor by the view scale factor before passing it to WebCore.
758 (WebKit::WebPage::scalePageInViewCoordinates):
759 Early returns need to check the total scale, not just the new page scale.
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).
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.
770 (WebKit::WebPage::scaleView):
771 Apply a new view scale, maintaining the current scroll position.
773 * WebProcess/WebPage/WebPage.h:
774 (WebKit::WebPage::viewScaleFactor):
775 * WebProcess/WebPage/WebPage.messages.in:
777 * Shared/WebPageCreationParameters.cpp:
778 (WebKit::WebPageCreationParameters::encode):
779 (WebKit::WebPageCreationParameters::decode):
780 * Shared/WebPageCreationParameters.h:
781 Plumb viewScaleFactor through the page creation parameters.
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.
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.
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.
816 2015-04-10 Brent Fulgham <bfulgham@apple.com>
818 Expand test infrastructure to support scrolling tests
819 https://bugs.webkit.org/show_bug.cgi?id=143286
820 <rdar://problem/20375516>
822 Reviewed by Simon Fraser.
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.
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:
832 2015-04-13 Enrica Casucci <enrica@apple.com>
834 Clients of WKWebView should be able to override drag functions.
835 https://bugs.webkit.org/show_bug.cgi?id=143618
837 Reviewed by Darin Adler.
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.
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):
859 2015-04-13 Alex Christensen <achristensen@webkit.org>
861 [iOS] Unreviewed build fix after r182760.
863 * Shared/WebCoreArgumentCoders.cpp:
864 (IPC::encodeSharedBuffer):
865 (IPC::decodeSharedBuffer):
866 Update SharedMemory function names.
868 2015-04-13 Anders Carlsson <andersca@apple.com>
870 Rename SharedMemory::create overloads
871 https://bugs.webkit.org/show_bug.cgi?id=143679
873 Reviewed by Beth Dakin.
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.
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):
916 2015-04-13 Brady Eidson <beidson@apple.com>
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
921 Reviewed by Darin Adler.
923 Refactor existing Sharing Service Picker code to also be used for the Share menu NSMenuItem.
925 * UIProcess/WebPageProxy.cpp:
926 (WebKit::WebPageProxy::internalShowContextMenu):
927 (WebKit::WebPageProxy::platformInitializeShareMenuItem):
928 * UIProcess/WebPageProxy.h:
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:]):
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.
957 * UIProcess/mac/WebPageProxyMac.mm:
958 (WebKit::WebPageProxy::platformInitializeShareMenuItem):
960 * WebKit2.xcodeproj/project.pbxproj:
962 2015-04-13 Anders Carlsson <andersca@apple.com>
964 Begin cleaning up the shared memory interface
965 https://bugs.webkit.org/show_bug.cgi?id=143677
967 Reviewed by Andreas Kling.
969 Rename createFromVMBuffer to create and add a protection parameter (which is currently unused).
970 Also, turn SharedMemory::Protection into a proper enum class.
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):
1026 2015-04-10 Jon Honeycutt <jhoneycutt@apple.com>
1028 Cannot click "Next" button on Google two-factor auth setup page
1030 <https://bugs.webkit.org/show_bug.cgi?id=143624>
1031 <rdar://problem/19175714>
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
1038 To fix this, only assist input types that we know are assistable,
1039 including text fields, select and date elements, etc.
1041 Reviewed by Darin Adler.
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.
1050 2015-04-13 Beth Dakin <bdakin@apple.com>
1052 Add force property to MouseEvents
1053 https://bugs.webkit.org/show_bug.cgi?id=143569
1055 rdar://problem/20472954
1057 Reviewed by Darin Adler.
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
1063 NativeWebMouseEvent now requires a second NSEvent for the pressureEvent.
1064 * Shared/NativeWebMouseEvent.h:
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):
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:]):
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):
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):
1105 The functions that dispatch the force events no longer take a PlatformMouseEvent
1107 * WebProcess/WebPage/mac/WebPageMac.mm:
1108 (WebKit::WebPage::inputDeviceForceDidChange):
1109 (WebKit::WebPage::immediateActionDidCancel):
1111 2015-04-13 Andreas Kling <akling@apple.com>
1113 Don't segregate heap objects based on Structure immortality.
1114 <https://webkit.org/b/143638>
1116 Reviewed by Darin Adler.
1118 * WebProcess/Plugins/Netscape/JSNPObject.h:
1120 2015-04-13 Timothy Horton <timothy_horton@apple.com>
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>
1126 Reviewed by Darin Adler.
1128 * WebProcess/Plugins/PDF/PDFPlugin.mm:
1129 (WebKit::PDFPlugin::clickedLink):
1130 Don't follow javascript: URLs.
1132 2015-04-10 Alex Christensen <achristensen@webkit.org>
1134 [Content Extensions] Don't unmap shared memory while using it.
1135 https://bugs.webkit.org/show_bug.cgi?id=143625
1137 Reviewed by Darin Adler.
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.
1147 2015-04-12 Darin Adler <darin@apple.com>
1149 [Cocoa] Localizable strings are inconsistent and need to be regenerated
1150 https://bugs.webkit.org/show_bug.cgi?id=143661
1152 Reviewed by Dan Bernstein.
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.
1158 2015-04-12 Sungmann Cho <sungmann.cho@navercorp.com>
1160 Fix trival typos related to the word "coordinate".
1161 https://bugs.webkit.org/show_bug.cgi?id=143644
1163 Reviewed by Alexey Proskuryakov.
1165 No new tests, no behavior change.
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):
1175 2015-04-12 Sungmann Cho <sungmann.cho@navercorp.com>
1177 Remove PluginModuleInfo.cpp from WebKit2
1178 https://bugs.webkit.org/show_bug.cgi?id=143643
1180 Reviewed by Darin Adler.
1182 Remove PluginModuleInfo.cpp from WebKit2 because it is totally empty.
1184 No new tests, no behavior change.
1187 * Shared/Plugins/PluginModuleInfo.cpp: Removed.
1188 * WebKit2.xcodeproj/project.pbxproj:
1190 2015-04-11 Yusuke Suzuki <utatane.tea@gmail.com>
1192 [ES6] Enable Symbol in web pages
1193 https://bugs.webkit.org/show_bug.cgi?id=143375
1195 Reviewed by Ryosuke Niwa.
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):
1206 2015-04-08 Sam Weinig <sam@webkit.org>
1208 Allow LaunchServices to handle URLs on link navigations
1209 <rdar://problem/19446826>
1210 https://bugs.webkit.org/show_bug.cgi?id=143544
1212 Reviewed by Anders Carlsson.
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
1221 2015-04-10 Tim Horton <timothy_horton@apple.com>
1223 Replace setFixedLayoutSizeEnabled: with an enum of layout modes
1224 https://bugs.webkit.org/show_bug.cgi?id=143576
1226 Reviewed by Simon Fraser.
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.
1247 2015-04-10 Anders Carlsson <andersca@apple.com>
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
1253 Reviewed by Andreas Kling.
1255 * Shared/WebsiteData/WebsiteDataTypes.h:
1256 Add WebsiteDataTypeOfflineWebApplicationCache.
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.
1266 * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1267 (WebKit::WebsiteDataStore::fetchData):
1268 Create a custom application cache storage and fetch the origins from it.
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.
1274 2015-04-10 Eric Carlson <eric.carlson@apple.com>
1276 [Mac] Refactor MediaPlaybackTarget
1277 https://bugs.webkit.org/show_bug.cgi?id=143571
1279 Reviewed by Jer Noble.
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>&&.
1298 2015-04-10 Hunseop Jeong <hs85.jeong@samsung.com>
1300 Fix some minor typos related to the WebProcessCreationParameter.
1301 https://bugs.webkit.org/show_bug.cgi?id=143598
1303 Reviewed by Csaba Osztrogonác.
1305 No new tests, no behavior change.
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):
1316 2015-04-09 Andy Estes <aestes@apple.com>
1318 [Cocoa] Add a HAVE(AVKIT) and use it
1319 https://bugs.webkit.org/show_bug.cgi?id=143593
1321 Reviewed by David Kilzer.
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).
1334 2015-04-09 Hunseop Jeong <hs85.jeong@samsung.com>
1336 Use modern loops in WebProcess
1337 https://bugs.webkit.org/show_bug.cgi?id=143302
1339 Reviewed by Darin Adler.
1341 Use modern range for-loops in WebProcess.
1343 No new tests, no behavior change.
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):
1353 2015-04-09 Gordon Sheridan <gordon_sheridan@apple.com>
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.
1358 Reviewed by Brady Eidson.
1360 * UIProcess/WebIconDatabase.messages.in:
1361 Move RetainIconForPageURL and ReleaseIconForPageURL messages to WebProcessProxy so they can be associated with the appropriate web process.
1363 * UIProcess/WebProcessProxy.cpp:
1364 (WebKit::WebProcessProxy::connectionDidClose):
1365 Call releaseRemainingIconsForPageURLs() to balance retains/releases for this process.
1367 (WebKit::WebProcessProxy::retainIconForPageURL):
1368 Track retain counts for page URLs and call through to WebIconDatabase.
1370 (WebKit::WebProcessProxy::releaseIconForPageURL):
1373 (WebKit::WebProcessProxy::releaseRemainingIconsForPageURLs):
1374 Call releaseIconForPageURL() once for each outstanding retain count, for each page URL.
1376 * UIProcess/WebProcessProxy.h:
1377 Declare methods for retainIconForPageURL(), releaseIconForPageURL(), and releaseRemainingIconsForPageURLs().
1378 Declare hash map to track number of retains per page URL.
1380 * UIProcess/WebProcessProxy.messages.in:
1381 Moved RetainIconForPageURL and ReleaseIconForPageURL messages here from WebIconDatabase.
1383 * WebProcess/IconDatabase/WebIconDatabaseProxy.cpp:
1384 (WebKit::WebIconDatabaseProxy::retainIconForPageURL):
1385 Modify the receiver of the message to be WebProcessProxy.
1387 (WebKit::WebIconDatabaseProxy::releaseIconForPageURL):
1390 2015-04-09 Chris Dumez <cdumez@apple.com>
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>
1396 Reviewed by Andreas Kling.
1398 After r182194, the NetworkProcess is calling the memory pressure
1399 handler before getting suspended to free-up as much memory as possible
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.
1406 * NetworkProcess/NetworkProcess.cpp:
1407 (WebKit::NetworkProcess::lowMemoryHandler):
1408 (WebKit::NetworkProcess::initializeNetworkProcess):
1409 (WebKit::NetworkProcess::processWillSuspend):
1410 * NetworkProcess/NetworkProcess.h:
1412 2015-04-09 Brady Eidson <beidson@apple.com>
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
1417 Reviewed by Brent Fulgham.
1419 * Shared/WebHitTestResult.cpp:
1420 (WebKit::WebHitTestResult::Data::Data): Clear up a name scoping issue.
1422 2015-04-09 Chris Dumez <cdumez@apple.com>
1424 [WK2][iOS] editorState() should not cause a synchronous layout
1425 https://bugs.webkit.org/show_bug.cgi?id=142536
1426 <rdar://problem/20041506>
1428 Reviewed by Enrica Casucci.
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
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.
1441 With this change, I see a 38% improvement on Speedometer (26.4 +/- 0.37
1442 -> 36.5 +/- 0.54) on iPhone 6 Plus.
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):
1486 2015-04-09 Antti Koivisto <antti@apple.com>
1488 Network Cache: Crash in WebCore::CachedResource::tryReplaceEncodedData
1489 https://bugs.webkit.org/show_bug.cgi?id=143562
1491 Reviewed by Anders Carlsson.
1493 If another thread comes and truncates the file before we map it we end up with a map that crashes when accessed.
1495 * NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:
1496 (WebKit::NetworkCache::IOChannel::IOChannel):
1498 When creating a new file unlink any existing file instead of using O_TRUNC.
1500 2015-04-09 Csaba Osztrogonác <ossy@webkit.org>
1502 [EFL][GTK] WebKit2's generate-forwarding-headers.pl runs too many times
1503 https://bugs.webkit.org/show_bug.cgi?id=142907
1505 Unreviewed typo fix after r182595.
1507 * PlatformGTK.cmake:
1509 2015-04-09 Csaba Osztrogonác <ossy@webkit.org>
1511 [EFL][GTK] WebKit2's generate-forwarding-headers.pl runs too many times
1512 https://bugs.webkit.org/show_bug.cgi?id=142907
1514 Reviewed by Carlos Garcia Campos.
1516 * PlatformEfl.cmake:
1517 * PlatformGTK.cmake:
1518 * Scripts/generate-forwarding-headers.pl: Make it work with more path and platform arguments.
1520 2015-04-08 Joseph Pecoraro <pecoraro@apple.com>
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
1525 Reviewed by Brady Eidson.
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.
1531 * UIProcess/WebPageProxy.cpp:
1532 (WebKit::WebPageProxy::internalShowContextMenu):
1533 Gracefully handle a null share context menu item.
1535 2015-04-08 Brent Fulgham <bfulgham@apple.com>
1537 [Mac] Unreviewed test fix after r182584
1538 https://bugs.webkit.org/show_bug.cgi?id=143452
1540 Correct bit comparison to use the correct value for the Control-key
1542 * Shared/mac/WebEventFactory.mm:
1543 (WebKit::typeForEvent):
1545 2015-04-08 Jaehun Lim <ljaehun.lim@samsung.com>
1547 [EFL] Create PageUIClientEfl after sending CreateWebPage message
1548 https://bugs.webkit.org/show_bug.cgi?id=143514
1550 Reviewed by Gyuyoung Kim.
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().
1555 * UIProcess/API/efl/EwkView.cpp:
1558 2015-04-08 Brent Fulgham <bfulgham@apple.com>
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>
1564 Reviewed by Tim Horton.
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.
1570 * Shared/mac/WebEventFactory.mm:
1571 (WebKit::mouseButtonForEvent): Ask NSMenu what kind of button press we have received.
1573 2015-04-08 Brady Eidson <beidson@apple.com>
1575 Expose the "Share" menu for links, images, and media.
1576 <rdar://problem/20435340> and https://bugs.webkit.org/show_bug.cgi?id=143502
1578 Reviewed by Tim Horton.
1580 * Shared/ContextMenuContextData.cpp:
1581 (WebKit::ContextMenuContextData::ContextMenuContextData):
1583 * Shared/WebHitTestResult.cpp:
1584 (WebKit::WebHitTestResult::Data::Data):
1585 * Shared/WebHitTestResult.h:
1587 * UIProcess/WebPageProxy.cpp:
1588 (WebKit::WebPageProxy::internalShowContextMenu):
1590 * WebProcess/WebCoreSupport/WebContextMenuClient.cpp:
1591 (WebKit::WebContextMenuClient::shareMenuItem):
1592 * WebProcess/WebCoreSupport/WebContextMenuClient.h:
1594 * WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm:
1595 (WebKit::WebContextMenuClient::shareSelectedTextMenuItem): Deleted.
1597 * WebProcess/WebPage/mac/WebPageMac.mm:
1598 (WebKit::WebPage::performActionMenuHitTestAtLocation):
1600 2015-04-08 Anders Carlsson <andersca@apple.com>
1602 Add encoding and decoding of ints to WKRemoteObjectCoder
1603 https://bugs.webkit.org/show_bug.cgi?id=143538
1605 Reviewed by Tim Horton.
1607 * Shared/API/Cocoa/WKRemoteObjectCoder.mm:
1608 (-[WKRemoteObjectEncoder encodeInt:forKey:]):
1609 (-[WKRemoteObjectDecoder decodeIntForKey:]):
1611 2015-04-08 Anders Carlsson <andersca@apple.com>
1613 Delete ApplicationCache static member functions
1614 https://bugs.webkit.org/show_bug.cgi?id=143534
1616 Reviewed by Tim Horton.
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):
1625 2015-04-08 Enrica Casucci <enrica@apple.com>
1627 32-bit build fix after r182554.
1629 * UIProcess/API/mac/WKView.mm:
1630 (-[WKView resignFirstResponder]):
1632 2015-04-08 Beth Dakin <bdakin@apple.com>
1634 Force events should not require preventDefault in order to fire
1635 https://bugs.webkit.org/show_bug.cgi?id=143503
1637 rdar://problem/20458916
1639 Reviewed by Tim Horton.
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):
1651 2015-04-08 Enrica Casucci <enrica@apple.com>
1653 Calling makeFirstResponder on WKWebView doesn't work.
1654 https://bugs.webkit.org/show_bug.cgi?id=143482
1655 rdar://problem/20298166
1657 Reviewed by Dan Bernstein.
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.
1664 * UIProcess/API/Cocoa/WKWebView.mm:
1665 (-[WKWebView becomeFirstResponder]):
1666 (-[WKWebView acceptsFirstResponder]):
1667 * UIProcess/API/mac/WKView.mm:
1668 (-[WKView becomeFristResponder]):
1669 (-[WKView resignFirstResponder]):
1671 2015-04-07 Tim Horton <timothy_horton@apple.com>
1675 * UIProcess/API/mac/WKView.mm:
1676 (-[WKView _setFixedLayoutSize:]):
1678 2015-04-07 Tim Horton <timothy_horton@apple.com>
1680 Expose and test fixedLayoutSize via modern WebKit SPI
1681 https://bugs.webkit.org/show_bug.cgi?id=143500
1683 Reviewed by Simon Fraser.
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.
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.
1705 Persist the fixedLayoutSize through view creation; we already persist the enabled state,
1706 but not the size, which doesn't make any sense.
1708 * WebProcess/WebPage/WebPage.cpp:
1709 (WebKit::WebPage::fixedLayoutSize):
1710 * WebProcess/WebPage/WebPage.h:
1711 Add a fixedLayoutSize() getter.
1713 2015-04-07 Brady Eidson <beidson@apple.com>
1715 ContextMenuItem refactoring
1716 https://bugs.webkit.org/show_bug.cgi?id=143485
1718 Reviewed by Beth Dakin.
1720 * Shared/mac/NativeContextMenuItem.mm:
1721 (WebKit::NativeContextMenuItem::NativeContextMenuItem):
1723 2015-04-07 Simon Fraser <simon.fraser@apple.com>
1725 Add a new setting, AntialiasedFontDilationEnabled, exposed via WK2.
1726 https://bugs.webkit.org/show_bug.cgi?id=143495
1728 Reviewed by Tim Horton.
1730 Exposed the antialiasedFontDilationEnabled setting via WK C SPI and Objective-C SPI.
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):
1744 2015-04-07 Beth Dakin <bdakin@apple.com>
1746 Should only propagate pressure events with relevant phases
1747 https://bugs.webkit.org/show_bug.cgi?id=143494
1749 rdar://problem/20453738
1751 Reviewed by Tim Horton.
1753 We only care about the changed, began, and ended phases.
1754 * UIProcess/API/mac/WKView.mm:
1755 (-[WKView pressureChangeWithEvent:]):
1757 2015-04-07 Jer Noble <jer.noble@apple.com>
1759 Unreviewed build fix; make calls to new SPI conditional on iOS version.
1761 * UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
1762 (WebKit::WebVideoFullscreenManagerProxy::setVideoLayerFrame):
1764 2015-04-06 Anders Carlsson <andersca@apple.com>
1766 Create the web inspector process pool lazily
1767 https://bugs.webkit.org/show_bug.cgi?id=143456
1768 rdar://problem/20146520
1770 Reviewed by Mark Lam.
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.
1775 This should speed up initialization somewhat and avoid creating a storage manager for example.
1777 * UIProcess/WebInspectorProxy.cpp:
1778 (WebKit::WebInspectorProxy::inspectorProcessPool):
1779 (WebKit::WebInspectorProxy::isInspectorProcessPool):
1780 * UIProcess/WebInspectorProxy.h:
1781 * UIProcess/WebProcessProxy.cpp:
1782 (WebKit::WebProcessProxy::getLaunchOptions):
1784 2015-04-06 Brady Eidson <beidson@apple.com>
1786 Combine ActionMenuHitTestResult with WebHitTestResult
1787 https://bugs.webkit.org/show_bug.cgi?id=143444
1789 Reviewed by Beth Dakin.
1791 * Shared/mac/ActionMenuHitTestResult.h: Removed.
1792 * Shared/mac/ActionMenuHitTestResult.mm: Removed.
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):
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):
1848 2015-04-06 Jer Noble <jer.noble@apple.com>
1850 Synchronize fullscreen animation between processes.
1851 https://bugs.webkit.org/show_bug.cgi?id=143131
1853 Reviewed by Simon Fraser.
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.
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.
1873 2015-04-06 Chris Dumez <cdumez@apple.com>
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>
1879 Reviewed by Anders Carlsson.
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.
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.
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:
1903 2015-04-06 Beth Dakin <bdakin@apple.com>
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.
1909 * UIProcess/API/mac/WKView.mm:
1910 (-[WKView pressureChangeWithEvent:]):
1912 2015-04-06 Commit Queue <commit-queue@webkit.org>
1914 Unreviewed, rolling out r182296.
1915 https://bugs.webkit.org/show_bug.cgi?id=143448
1917 This will disturb network cache efficacy logging, we should
1918 reland this later. (Requested by cdumez__ on #webkit).
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
1926 2015-04-06 Žan Doberšek <zdobersek@igalia.com>
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
1931 Reviewed by Darin Adler.
1933 Move the Vector<> object containing the copied elements into the Array::create()
1934 call, avoiding copying all the elements again.
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
1943 * Shared/API/APIArray.cpp:
1944 (API::Array::create):
1946 (API::Array::Array): Deleted.
1947 * Shared/API/APIArray.h:
1949 2015-04-06 Žan Doberšek <zdobersek@igalia.com>
1951 UserScript, UserStyleSheet constructors should take in Vector<String> rvalues
1952 https://bugs.webkit.org/show_bug.cgi?id=143411
1954 Reviewed by Darin Adler.
1956 Move the whitelist and blacklist Vector<String> objects into the
1957 UserScript and UserStyleSheet constructors in ArgumentCoder<T>::decode
1960 * Shared/WebCoreArgumentCoders.cpp:
1961 (IPC::ArgumentCoder<UserStyleSheet>::decode):
1962 (IPC::ArgumentCoder<UserScript>::decode):
1964 2015-04-05 Darin Adler <darin@apple.com>
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
1970 Reviewed by Alexey Proskuryakov.
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.
1978 2015-04-05 Gyuyoung Kim <gyuyoung.kim@samsung.com>
1980 Use constants of sqlite3 directly for status of SQL result in webdatabase
1981 https://bugs.webkit.org/show_bug.cgi?id=143329
1983 Reviewed by Darin Adler.
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.
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):
2033 2015-04-05 Simon Fraser <simon.fraser@apple.com>
2035 Remove "go ahead and" from comments
2036 https://bugs.webkit.org/show_bug.cgi?id=143421
2038 Reviewed by Darin Adler, Benjamin Poulain.
2040 Remove the phrase "go ahead and" from comments where it doesn't add
2041 anything (which is almost all of them).
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):
2053 2015-04-05 Antti Koivisto <antti@apple.com>
2055 Bloom filter should support longer hashes
2056 https://bugs.webkit.org/show_bug.cgi?id=143419
2058 Reviewed by Dan Bernstein.
2060 Use the hash digest directly in the contents filter instead of going via shortHash.
2062 * NetworkProcess/cache/NetworkCacheKey.h:
2063 (WebKit::NetworkCache::Key::hash):
2064 (WebKit::NetworkCache::Key::shortHash): Deleted.
2065 (WebKit::NetworkCache::Key::toShortHash): Deleted.
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:
2075 2015-04-05 Antti Koivisto <antti@apple.com>
2077 Network cache Bloom filter is too big
2078 https://bugs.webkit.org/show_bug.cgi?id=143400
2080 Follow-up: Fix an ineffective assert.
2082 * NetworkProcess/cache/NetworkCacheStorage.cpp:
2083 (WebKit::NetworkCache::Storage::setMaximumSize): Average resource size is closer to 50KB than 50MB.
2085 2015-04-05 Antti Koivisto <antti@apple.com>
2087 Rename Cache::setMaximumSize to setCapacity
2088 https://bugs.webkit.org/show_bug.cgi?id=143418
2090 Reviewed by Dan Bernstein.
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):
2108 2015-04-04 Antti Koivisto <antti@apple.com>
2110 Network cache Bloom filter is too big
2111 https://bugs.webkit.org/show_bug.cgi?id=143400
2113 Reviewed by Chris Dumez.
2115 It is currently 1MB.
2117 This patch switches the cache from a counting filter (CountingBloomFilter) to a bit filter (BloomFilter).
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.
2123 The new filter size is 32KB.
2125 * NetworkProcess/cache/NetworkCacheStorage.cpp:
2126 (WebKit::NetworkCache::Storage::Storage):
2127 (WebKit::NetworkCache::Storage::synchronize):
2129 Turn initialization function into general purpose synchronization function.
2131 (WebKit::NetworkCache::Storage::addToContentsFilter):
2133 Collect newly added hashes so we don't miss entries that were added during synchronization.
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):
2147 Non-counting Bloom filter does not support removals so this requires a new strategy.
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.
2152 (WebKit::NetworkCache::Storage::initialize): Deleted.
2153 * NetworkProcess/cache/NetworkCacheStorage.h:
2154 (WebKit::NetworkCache::Storage::mayContain):
2155 (WebKit::NetworkCache::Storage::cacheMayContain): Deleted.
2157 2015-04-04 Andy Estes <aestes@apple.com>
2159 [Content Filtering] Blocked page is not always displayed when it should be
2160 https://bugs.webkit.org/show_bug.cgi?id=143410
2162 Reviewed by Andreas Kling.
2164 * UIProcess/WebFrameProxy.cpp:
2165 (WebKit::WebFrameProxy::didStartProvisionalLoad): Stopped clearing m_contentFilterUnblockHandler here.
2166 (WebKit::WebFrameProxy::didHandleContentFilterUnblockNavigation): Started doing it here instead.
2168 2015-04-04 Chris Dumez <cdumez@apple.com>
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>
2174 Reviewed by Antti Koivisto.
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.
2180 This is in addition to the existing "WebKitNetworkCacheEnabled"
2182 webkitNetworkCacheIsEnabled = [defaults boolForKey:WebKitNetworkCacheEnabledDefaultsKey]
2183 && ![defaults boolForKey:WebKitNetworkCacheTemporarilyDisabledForTestingKey];
2185 * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2186 (WebKit::WebProcessPool::platformInitializeNetworkProcess):
2188 2015-04-04 Simon Fraser <simon.fraser@apple.com>
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
2194 Reviewed by Tim Horton.
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.
2200 Fix by calling computeNonFastScrollableRegion() lazily, just before scrolling tree commit.
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.
2207 * WebProcess/Scrolling/RemoteScrollingCoordinator.mm:
2208 (WebKit::RemoteScrollingCoordinator::buildTransaction):
2209 * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
2210 (WebKit::TiledCoreAnimationDrawingArea::flushLayers): Outdent #ifdefs.
2212 2015-04-03 Beth Dakin <bdakin@apple.com>
2214 Attempted build fix.
2216 * UIProcess/API/mac/WKView.mm:
2218 2015-04-03 Simon Fraser <simon.fraser@apple.com>
2220 Fix the firing of the ReachedSessionRestorationRenderTreeSizeThreshold milestone on iOS
2221 https://bugs.webkit.org/show_bug.cgi?id=143394
2223 Reviewed by Tim Horton.
2225 A client reshuffle at some point broke the dispatch of the ReachedSessionRestorationRenderTreeSizeThreshold
2226 milestone. Fix by using WebPageProxy::didLayout() to fire the milestone.
2228 * UIProcess/ios/WebPageProxyIOS.mm:
2229 (WebKit::WebPageProxy::didCommitLayerTree):
2231 2015-04-03 Beth Dakin <bdakin@apple.com>
2233 https://bugs.webkit.org/show_bug.cgi?id=143387
2234 Improvements to webkitmouseforce web API
2236 rdar://problem/20281808
2237 rdar://problem/20281853
2239 Reviewed by Darin Adler.
2242 1. Dispatches webkitmouseforceup and webkitmouseforceclick at the right time.
2243 2. Dispatches webkitmouseforcechanged from mousedown all the way through through
2245 3. Uses force values from pressureChangeWithEvent instead of the immediate action
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:
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:]):
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:
2269 New message for InputDeviceForceDidChange and modified message for
2270 ImmediateActionDidUpdate
2271 * WebProcess/WebPage/WebPage.messages.in:
2273 inputDeviceForceDidChange now takes care of dispatching mouseforcechanged,
2274 mouseforcedown, mouseforceup, and mouseforceclick.
2275 * WebProcess/WebPage/mac/WebPageMac.mm:
2276 (WebKit::WebPage::inputDeviceForceDidChange):
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):
2285 2015-04-03 Said Abou-Hallawa <sabouhallawa@apple.com>
2287 InjectedBundleNodeHandle::renderedImage() needs to be exposed from the Cocoa WebAPI layer.
2288 https://bugs.webkit.org/show_bug.cgi?id=143341.
2290 Reviewed by Anders Carlsson.
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.
2298 2015-04-03 Chris Dumez <cdumez@apple.com>
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>
2304 Reviewed by Anders Carlsson.
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.
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.
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:
2339 2015-04-03 Antti Koivisto <antti@apple.com>
2341 Add non-counting Bloom filter implementation
2342 https://bugs.webkit.org/show_bug.cgi?id=143366
2344 Reviewed by Sam Weinig.
2346 * NetworkProcess/cache/NetworkCacheStorage.h:
2348 2015-04-03 Zan Dobersek <zdobersek@igalia.com>
2350 Fix the EFL and GTK build after r182243
2351 https://bugs.webkit.org/show_bug.cgi?id=143361
2353 Reviewed by Csaba Osztrogonác.
2355 * PlatformGTK.cmake: Add a custom command that copies the
2356 InspectorBackendCommands.js file into the proper directory
2357 under DerivedSources/WebInspectorUI/.
2359 2015-04-03 Philippe Normand <pnormand@igalia.com>
2361 Unreviewed, GTK build fix.
2363 * UIProcess/API/gtk/WebKitContextMenuClient.cpp:
2364 * UIProcess/gtk/WebContextMenuProxyGtk.cpp:
2365 * UIProcess/gtk/WebContextMenuProxyGtk.h:
2367 2015-04-02 Csaba Osztrogonác <ossy@webkit.org>
2371 * PlatformGTK.cmake:
2373 2015-04-02 Csaba Osztrogonác <ossy@webkit.org>
2375 URTBF after r182303, stub NativeContextMenuItem implemetations added for EFL and GTK.
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):
2384 2015-04-02 Timothy Horton <timothy_horton@apple.com>
2386 De-PLATFORM(IOS)-ify LayerHostingContext::setFencePort
2387 https://bugs.webkit.org/show_bug.cgi?id=143342
2389 * Platform/mac/LayerHostingContext.h:
2390 * Platform/mac/LayerHostingContext.mm:
2391 Actually, not available on Mavericks. Fix the build.
2393 2015-04-02 Brady Eidson <beidson@apple.com>
2395 Unreviewed: Re-applied change after rollout.
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
2400 * Shared/API/c/WKContextMenuItemTypes.h: Add a constant for the Share menu.
2401 * Shared/API/c/WKSharedAPICast.h:
2405 * Shared/ContextMenuContextData.cpp:
2406 (WebKit::ContextMenuContextData::ContextMenuContextData):
2407 (WebKit::ContextMenuContextData::encode):
2408 (WebKit::ContextMenuContextData::decode):
2409 * Shared/ContextMenuContextData.h:
2410 (WebKit::ContextMenuContextData::selectedText):
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):
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):
2426 * UIProcess/API/APIContextMenuClient.h:
2427 (API::ContextMenuClient::getContextMenuFromProposedMenu):
2428 (API::ContextMenuClient::showContextMenu):
2430 * UIProcess/API/C/WKPage.cpp:
2431 (WKPageSetPageContextMenuClient):
2433 * UIProcess/WebContextMenuProxy.h:
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.
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):
2448 * WebKit2.xcodeproj/project.pbxproj:
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.
2455 2015-04-02 Commit Queue <commit-queue@webkit.org>
2457 Unreviewed, rolling out r182293.
2458 https://bugs.webkit.org/show_bug.cgi?id=143355
2460 Broke GTK and EFL builds. (Requested by bfulgham on #webkit).
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
2469 2015-04-02 Chris Dumez <cdumez@apple.com>
2471 [WK2][NetworkCache] Drop HTTP method from NetworkCache::Key
2472 https://bugs.webkit.org/show_bug.cgi?id=143348
2474 Reviewed by Antti Koivisto.
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
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.
2494 2015-04-02 Jer Noble <jer.noble@apple.com>
2496 [Mac][WK2] Fullscreen animation incorrect when initiated on non-primary monitor
2497 https://bugs.webkit.org/show_bug.cgi?id=143237
2499 Reviewed by Brent Fulgham.
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()
2505 * UIProcess/mac/WKFullScreenWindowController.mm:
2506 (-[WKFullScreenWindowController initWithWindow:webView:]):
2509 (-[WKFullScreenWindowController _startEnterFullScreenAnimationWithDuration:]):
2510 (-[WKFullScreenWindowController _startExitFullScreenAnimationWithDuration:]):
2512 2015-04-02 Brady Eidson <beidson@apple.com>
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
2517 Reviewed by Sam Weinig.
2519 * Shared/API/c/WKContextMenuItemTypes.h: Add a constant for the Share menu.
2520 * Shared/API/c/WKSharedAPICast.h:
2524 * Shared/ContextMenuContextData.cpp:
2525 (WebKit::ContextMenuContextData::ContextMenuContextData):
2526 (WebKit::ContextMenuContextData::encode):
2527 (WebKit::ContextMenuContextData::decode):
2528 * Shared/ContextMenuContextData.h:
2529 (WebKit::ContextMenuContextData::selectedText):
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):
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):
2545 * UIProcess/API/APIContextMenuClient.h:
2546 (API::ContextMenuClient::getContextMenuFromProposedMenu):
2547 (API::ContextMenuClient::showContextMenu):
2549 * UIProcess/API/C/WKPage.cpp:
2550 (WKPageSetPageContextMenuClient):
2552 * UIProcess/WebContextMenuProxy.h:
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.
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):
2567 * WebKit2.xcodeproj/project.pbxproj:
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.
2574 2015-04-02 Timothy Horton <timothy_horton@apple.com>
2576 De-PLATFORM(IOS)-ify LayerHostingContext::setFencePort
2577 https://bugs.webkit.org/show_bug.cgi?id=143342
2579 Reviewed by Myles C. Maxfield.
2581 * Platform/mac/LayerHostingContext.h:
2582 * Platform/mac/LayerHostingContext.mm:
2583 (WebKit::LayerHostingContext::setFencePort):
2584 There's nothing iOS specific about this.
2586 2015-04-02 Oliver Hunt <oliver@apple.com>
2588 Ensure that we always set network ATS context in the network process
2589 https://bugs.webkit.org/show_bug.cgi?id=143343
2591 Reviewed by Dan Bernstein.
2593 If a custom cache location or size we were early returning before setting
2594 the CFNetwork ATS context. This is clearly an error.
2596 * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
2597 (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
2599 2015-04-02 Alexey Proskuryakov <ap@apple.com>
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
2605 Reviewed by Sam Weinig.
2607 * UIProcess/WebProcessProxy.cpp:
2608 (WebKit::WebProcessProxy::checkURLReceivedFromWebProcess):
2610 2015-04-02 Yusuke Suzuki <utatane.tea@gmail.com>
2612 Clean up EnumerationMode to easily extend
2613 https://bugs.webkit.org/show_bug.cgi?id=143276
2615 Reviewed by Geoffrey Garen.
2617 Use default EnumerationMode().
2619 * WebProcess/Plugins/Netscape/NPJSObject.cpp:
2620 (WebKit::NPJSObject::enumerate):
2622 2015-04-02 Chris Dumez <cdumez@apple.com>
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>
2628 Reviewed by Alexey Proskuryakov.
2630 Update the WebContent process' sandbox profile for AWD.
2632 * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2634 2015-04-01 Antti Koivisto <antti@apple.com>
2636 Use std::chrono types to represent time in response and cache classes
2637 https://bugs.webkit.org/show_bug.cgi?id=143316
2639 Reviewed by Andreas Kling.
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):
2657 Sanity check the timestamp on decode.
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.
2669 2015-04-01 Chris Dumez <cdumez@apple.com>
2671 [WK2][Cocoa] Add didFailProvisionalLoadWithErrorForFrame callback to WKWebProcessPlugInLoadDelegate
2672 https://bugs.webkit.org/show_bug.cgi?id=143319
2673 <rdar://problem/19463834>
2675 Reviewed by Dan Bernstein.
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
2684 Note that this event is already exposed on UIProcess side via the
2685 WKPageLoaderClient.didFailLoadWithErrorForFrame callback.
2687 * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInLoadDelegate.h:
2688 * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
2689 (didFailProvisionalLoadWithErrorForFrame):
2690 (setUpPageLoaderClient):
2692 2015-04-01 Enrica Casucci <enrica@apple.com>
2694 Injected bundle messages should be at the page level.
2695 https://bugs.webkit.org/show_bug.cgi?id=143283
2697 Reviewed by Alexey Proskuryakov.
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.
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:
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:
2734 2015-04-01 Alexey Proskuryakov <ap@apple.com>
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
2740 Reviewed by Oliver Hunt.
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):
2765 2015-04-01 Timothy Horton <timothy_horton@apple.com>
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>
2771 Reviewed by Dean Jackson.
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.
2778 2015-03-31 Simon Fraser <simon.fraser@apple.com>
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
2784 Reviewed by Beth Dakin.
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.
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.
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:
2808 2015-03-31 Dan Bernstein <mitz@apple.com>
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
2813 Reviewed by Tim Horton.
2815 * UIProcess/API/Cocoa/_WKElementAction.h: Excluded _WKElementActionTypeAddToReadingList from
2816 the _WKElementActionType enum when Reading List is not supported.
2818 * UIProcess/API/Cocoa/_WKElementAction.mm:
2819 (+[_WKElementAction elementActionWithType:customTitle:]): Made Add to Reading List code
2820 conditional on HAVE(SAFARI_SERVICES_FRAMEWORK).
2822 * UIProcess/ios/WKActionSheetAssistant.mm:
2823 (-[WKActionSheetAssistant showImageSheet]): Ditto.
2824 (-[WKActionSheetAssistant showLinkSheet]): Ditto.
2826 * config.h: Defined HAVE_SAFARI_SERVICES_FRAMEWORK.
2828 2015-03-31 Timothy Horton <timothy_horton@apple.com>
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>
2834 Reviewed by Beth Dakin.
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.
2841 2015-03-31 Timothy Horton <timothy_horton@apple.com>
2843 WKView should stop using endGestureWithEvent
2844 https://bugs.webkit.org/show_bug.cgi?id=143285
2845 <rdar://problem/20357007>
2847 Reviewed by Simon Fraser.
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.
2860 2015-03-31 Timothy Horton <timothy_horton@apple.com>
2862 Swipes occur in the wrong direction in RTL
2863 https://bugs.webkit.org/show_bug.cgi?id=143257
2864 <rdar://problem/20300862>
2866 Reviewed by Simon Fraser.
2868 * UIProcess/ios/ViewGestureControllerIOS.mm:
2869 (-[WKSwipeTransitionController gestureRecognizerForInteractiveTransition:WithTarget:action:]):
2870 When choosing which edge to attach our gesture recognizers to,
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.
2886 2015-03-31 Myles C. Maxfield <mmaxfield@apple.com>
2888 Move ExpansionBehaviorFlags and TextDirection to their own file
2889 https://bugs.webkit.org/show_bug.cgi?id=143273
2891 Reviewed by Simon Fraser.
2893 This is a mechanical change. It just moves code around.
2895 This is getting ready for https://bugs.webkit.org/show_bug.cgi?id=142608
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:
2903 2015-03-31 Yusuke Suzuki <utatane.tea@gmail.com>
2905 Clean up Identifier factories to clarify the meaning of StringImpl*
2906 https://bugs.webkit.org/show_bug.cgi?id=143146
2908 Reviewed by Filip Pizlo.
2910 Just change to Identifier::fromString.
2912 * WebProcess/Plugins/Netscape/JSNPObject.cpp:
2913 (WebKit::JSNPObject::getOwnPropertyNames):
2914 * WebProcess/Plugins/Netscape/NPJSObject.cpp:
2915 (WebKit::identifierFromIdentifierRep):
2917 2015-03-31 Timothy Horton <timothy_horton@apple.com>
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>
2923 Reviewed by Dan Bernstein.
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.
2929 This fixes the problem on iOS, where UI-side compositing makes it easy to fix,
2930 but not yet on OS X.
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.
2938 * UIProcess/API/Cocoa/WKWebViewInternal.h:
2939 Expose _updateScrollViewBackground.
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.
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).
2960 Store the background color associated with the current snapshot.
2962 Let WKWebView know that it needs to recompute the background color.
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.
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.
2977 2015-03-31 Timothy Horton <timothy_horton@apple.com>
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>
2983 Reviewed by Dan Bernstein.
2985 * UIProcess/ios/WKPDFView.mm:
2986 (-[WKPDFView web_setMinimumSize:]):
2987 Maintan the relative top/left within the rescaled document.
2989 2015-03-31 Chris Dumez <cdumez@apple.com>
2991 [WK2][iOS] Extend ProcessThrottler use to the NetworkProcess
2992 https://bugs.webkit.org/show_bug.cgi?id=143249
2993 <rdar://problem/20231539>
2995 Reviewed by Gavin Barraclough.
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).
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.
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:
3047 2015-03-31 Csaba Osztrogonác <ossy@webkit.org>
3049 Unreviewed, revert accidental change by r182138.
3051 * Scripts/generate-forwarding-headers.pl:
3052 (createForwardingHeadersForFramework):
3054 2015-03-31 Carlos Garcia Campos <cgarcia@igalia.com>
3056 Unreviewed. Fix GTK+ build with REDIRECTED_XCOMPOSITE_WINDOW disabled in X11 platform.
3058 Also fix some unused parameter warnings when
3059 REDIRECTED_XCOMPOSITE_WINDOW is disabled.
3061 * UIProcess/API/gtk/WebKitWebViewBase.cpp:
3062 (webkitWebViewRenderAcceleratedCompositingResults):
3063 (resizeWebKitWebViewBaseFromAllocation):
3065 2015-03-31 Carlos Garcia Campos <cgarcia@igalia.com>
3067 [GTK] DnD icon/widget has odd background
3068 https://bugs.webkit.org/show_bug.cgi?id=143217
3070 Reviewed by Martin Robinson.
3072 Use gtk_drag_set_icon_surface() to set the drag icon image,
3073 instead of DragIcon class.
3075 * UIProcess/API/gtk/WebKitWebView.cpp:
3076 * UIProcess/gtk/DragAndDropHandler.cpp:
3077 (WebKit::DragAndDropHandler::startDrag):
3078 * UIProcess/gtk/DragAndDropHandler.h:
3080 2015-03-30 Commit Queue <commit-queue@webkit.org>
3082 Unreviewed, rolling out r182172.
3083 https://bugs.webkit.org/show_bug.cgi?id=143250
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).
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
3095 2015-03-30 Andreas Kling <akling@apple.com>
3097 WebBackForwardList doesn't need to manually clear the snapshot of an entry when removing it.
3098 <https://webkit.org/b/143231>
3100 Reviewed by Tim Horton.
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.
3106 * UIProcess/WebBackForwardList.cpp:
3107 (WebKit::WebBackForwardList::didRemoveItem):
3109 2015-03-30 Enrica Casucci <enrica@apple.com>
3111 [iOS] WebContent crashing at WebCore: WebCore::Range::collectSelectionRects.
3112 https://bugs.webkit.org/show_bug.cgi?id=143234
3113 <rdar://problem/18571345>
3115 Reviewed by Tim Horton.
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.
3121 * WebProcess/WebPage/ios/WebPageIOS.mm:
3122 (WebKit::WebPage::platformEditorState):
3124 2015-03-30 Sam Weinig <sam@webkit.org>
3126 [Content Extensions] Flesh out the UserContentExtensionStore
3127 https://bugs.webkit.org/show_bug.cgi?id=143123
3129 Reviewed by Benjamin Poulain.
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.
3143 * UIProcess/API/APIUserContentExtensionStore.h:
3144 * UIProcess/API/APIUserContentExtensionStore.cpp:
3145 (API::UserContentExtensionStore::defaultStore):
3146 Add accessor for the processes default shared store.
3148 (API::constructedPath):
3149 Helper for constructing the path to a file in the store based on identifier.
3151 (API::encodeContentExtensionMetaData):
3152 (API::decodeContentExtensionMetaData):
3153 Helpers for encoding/decoding the file metadata (version, bytecode size, actions size).
3155 (API::openAndMapContentExtension):
3156 Helper to open and map a filed back content extension.
3158 (API::writeDataToFile):
3159 Helper to write a Data object to a file.
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.
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.
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
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.
3183 (API::UserContentExtensionStore::synchronousRemoveAllContentExtensions):
3184 Helper for testing which synchronously unlinks all the files in the store.
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.
3190 * UIProcess/API/Cocoa/APIUserContentExtensionStoreCocoa.mm: Added.
3191 (API::UserContentExtensionStore::defaultStorePath):
3192 Helper to get the platform specific path for the store.
3194 * UIProcess/API/C/WKUserContentExtensionStoreRef.cpp:
3195 (WKUserContentExtensionStoreGetTypeID):
3196 Add ENABLE(CONTENT_EXTENSIONS) guards.
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.
3211 * WebKit2.xcodeproj/project.pbxproj:
3214 2015-03-30 Antti Koivisto <antti@apple.com>
3216 Don't cache resources that are very unlikely to be reused
3217 https://bugs.webkit.org/show_bug.cgi?id=143226
3219 Reviewed by Chris Dumez.
3221 Follow-up to cover Cache-control: no-cache case which also has zero cache lifetime.
3223 * NetworkProcess/cache/NetworkCache.cpp:
3224 (WebKit::NetworkCache::makeStoreDecision):
3226 2015-03-30 Antti Koivisto <antti@apple.com>
3228 Include cache entry worth to json dump
3229 https://bugs.webkit.org/show_bug.cgi?id=143202
3233 * NetworkProcess/cache/NetworkCacheStorage.cpp:
3234 (WebKit::NetworkCache::computeRecordWorth):
3236 This accidentally gave the error case worth 1 rather than 0 as it should be.
3238 2015-03-30 Antti Koivisto <antti@apple.com>
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>
3244 Reviewed by Geoff Garen.
3246 We are writing lots of resources to the cache that are never used again.
3248 In browse-around-randomly test this reduced number of cache entries created by ~20% and bytes written by ~5%.
3250 * NetworkProcess/cache/NetworkCache.cpp:
3251 (WebKit::NetworkCache::makeUseDecision):
3252 (WebKit::NetworkCache::makeRetrieveDecision):
3256 (WebKit::NetworkCache::makeStoreDecision):
3258 Store only if the resource has non-zero expiration or has validation headers.
3260 Very High priority resources (main resources) keep the existing policy to minimize impact
3261 on back navigation and tab restore.
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):
3272 2015-03-30 Tim Horton <timothy_horton@apple.com>
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>
3278 Reviewed by Dan Bernstein.
3280 Make ViewGestureControllerIOS's snapshot removal timing behave more like the Mac version.
3282 * UIProcess/API/Cocoa/WKWebView.mm:
3283 (-[WKWebView _didCommitLayerTree:]):
3284 Let ViewGestureController know when the page has finished state restoration.
3286 (-[WKWebView _didFinishLoadForMainFrame]):
3287 (-[WKWebView _didSameDocumentNavigationForMainFrame:]):
3288 Forward these to ViewGestureController.
3290 * UIProcess/API/Cocoa/WKWebViewInternal.h:
3291 * UIProcess/ios/PageClientImplIOS.mm:
3292 (WebKit::PageClientImpl::didFinishLoadForMainFrame):
3293 Forward didFinishLoadForMainFrame to WKWebView.
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.
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).
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.
3318 * UIProcess/mac/ViewGestureController.h:
3319 * UIProcess/mac/ViewGestureControllerMac.mm:
3320 (WebKit::ViewGestureController::ViewGestureController):
3322 2015-03-30 Chris Dumez <cdumez@apple.com>
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>
3328 Reviewed by Antti Koivisto.
3330 Add support for "Cache-Control: max-stale" request header:
3331 https://tools.ietf.org/html/rfc7234#section-5.2.1.2
3333 * NetworkProcess/cache/NetworkCache.cpp:
3334 (WebKit::NetworkCache::responseHasExpired):
3335 (WebKit::NetworkCache::requestRequiresRevalidation):
3336 (WebKit::NetworkCache::canUse):
3338 2015-03-30 Csaba Osztrogonác <ossy@webkit.org>
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
3343 Reviewed by Philippe Normand.
3345 * Scripts/generate-forwarding-headers.pl:
3346 (createForwardingHeadersForFramework):
3348 2015-03-29 Antti Koivisto <antti@apple.com>
3350 Include cache entry worth to json dump
3351 https://bugs.webkit.org/show_bug.cgi?id=143202
3353 Reviewed by Darin Adler.
3355 This is useful for analyzing cache performance.
3356 Also include the body size, total item count and average worth.
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):
3367 Add flags for specificying what sort of information is needed.
3369 (WebKit::NetworkCache::computeRecordWorth):
3371 Factor to a function.
3373 (WebKit::NetworkCache::deletionProbability):
3374 * NetworkProcess/cache/NetworkCacheStorage.h:
3376 2015-03-29 Simon Fraser <simon.fraser@apple.com>
3378 Fix iOS scrollperf crash after a web process crash
3379 https://bugs.webkit.org/show_bug.cgi?id=143110
3381 Reviewed by Dean Jackson.
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.
3386 * UIProcess/WebPageProxy.cpp:
3387 (WebKit::WebPageProxy::resetState):
3389 2015-03-29 Simon Fraser <simon.fraser@apple.com>
3391 Convert arguments to ScrollingCoordinator functions to references
3392 https://bugs.webkit.org/show_bug.cgi?id=143198
3394 Reviewed by Darin Adler.
3396 Convert all the FrameView* and ScrollableArea* arguments to ScrollingCoordinator functions to
3397 references, and use references in a few other places.
3399 * WebProcess/Scrolling/RemoteScrollingCoordinator.h:
3400 * WebProcess/Scrolling/RemoteScrollingCoordinator.mm:
3401 (WebKit::RemoteScrollingCoordinator::coordinatesScrollingForFrameView):
3403 2015-03-29 Enrica Casucci <enrica@apple.com>
3405 [iOS WK2] WKContentView should implement _selectionClipRect
3406 https://bugs.webkit.org/show_bug.cgi?id=143143
3407 rdar://problem/20330075
3409 Reviewed by Benjamin Poulain.
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.
3415 * UIProcess/ios/WKContentViewInteraction.mm:
3416 (-[WKContentView _selectionClipRect]):
3418 2015-03-29 Antti Koivisto <antti@apple.com>
3420 Use st_mtime instead of st_atime to track file access time
3421 https://bugs.webkit.org/show_bug.cgi?id=143200
3423 Reviewed by Darin Adler.
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.
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:
3440 2015-03-27 Gwang Yoon Hwang <yoon@igalia.com>
3442 [TexMap] Seperate BitmapTexture related classes implementations from TextureMapper
3443 https://bugs.webkit.org/show_bug.cgi?id=142386
3445 Reviewed by Žan Doberšek.
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
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.
3457 * Shared/CoordinatedGraphics/WebCoordinatedSurface.cpp: Include BitmapTextureGL.h explicitly
3459 2015-03-27 Anders Carlsson <andersca@apple.com>
3461 Use a typedef for the WKPluginLoadClientPolicy enum
3462 https://bugs.webkit.org/show_bug.cgi?id=143161
3464 Reviewed by Tim Horton.
3466 * UIProcess/API/C/WKPluginLoadPolicy.h:
3468 2015-03-27 Chris Dumez <cdumez@apple.com>
3470 [WK2][NetworkCache] Use WTF::WorkQueue abstraction inside NetworkCacheStatistics
3471 https://bugs.webkit.org/show_bug.cgi?id=143154
3473 Reviewed by Antti Koivisto.
3475 Use WTF::WorkQueue abstraction inside NetworkCacheStatistics, like we
3476 already do in NetworkCacheStorage.
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:
3504 2015-03-27 Ryosuke Niwa <rniwa@webkit.org>
3506 Safari clears selection when its window gets activated via mouse down
3507 https://bugs.webkit.org/show_bug.cgi?id=143157
3509 Reviewed by Anders Carlsson.
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.
3514 Fixed the bug by storing [NSEvent eventNumber] in WebMouseEvent on Mac in WebKit2 as done in WebKit1.
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):
3527 2015-03-27 Anders Carlsson <andersca@apple.com>
3529 Only do the Connection::setShouldCloseConnectionOnMachExceptions() hack where necessary
3530 https://bugs.webkit.org/show_bug.cgi?id=143141
3531 rdar://problem/19471284
3533 Reviewed by Andreas Kling.
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):
3545 2015-03-27 Tim Horton <timothy_horton@apple.com>
3547 Implement iOS WebKit2 PDF Find-in-Page
3548 https://bugs.webkit.org/show_bug.cgi?id=143065
3549 <rdar://problem/16793370>
3551 Reviewed by Dan Bernstein.
3553 * Platform/spi/ios/CorePDFSPI.h:
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.
3562 * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3563 * UIProcess/API/Cocoa/_WKFindOptions.h:
3564 Move _WKFindOptions into its own file.
3566 * UIProcess/Cocoa/WKWebViewContentProvider.h:
3567 Add find-related methods to the WKWebViewContentProvider protocol.
3569 * UIProcess/ios/WKPDFView.mm:
3570 (-[WKPDFView web_initWithFrame:webView:]):
3571 (-[WKPDFView dealloc]):
3572 Maintain a dispatch queue for searching the PDF.
3574 (-[WKPDFView web_setContentProviderData:suggestedFilename:]):
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.
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.
3587 (-[WKPDFView _computePageAndDocumentFrames]):
3588 Put the page index in PDFPageInfo, for reference elsewhere.
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).
3597 (-[WKPDFView web_countStringMatches:options:maxCount:]):
3598 Count the number of matches for the given string, and inform the FindClient
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.
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.
3614 (-[WKPDFView web_hideFindUI]):
3615 Dismiss the selection and clear some state so we start the next search afresh.
3617 * WebKit2.xcodeproj/project.pbxproj:
3619 2015-03-27 Andreas Kling <akling@apple.com>
3621 WebProcessProxy should not retain WebBackForwardListItems forever.
3622 <https://webkit.org/b/143152>
3623 <rdar://problem/19925709>
3625 Reviewed by Anders Carlsson.
3627 Have WebProcessProxy actually forget about a WebBackForwardListItem after it's removed from
3628 the WebBackForwardList.
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.
3633 We already have graceful handling of the case where an incoming IPC message references
3634 a removed back/forward list item.
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:
3644 2015-03-27 Simon Fraser <simon.fraser@apple.com>
3646 Use the correct timebase to log scrollperf blank pixel counts on iOS
3647 https://bugs.webkit.org/show_bug.cgi?id=143149
3649 Reviewed by Tim Horton.
3651 MobileSafari and WebKit need to collect scrollperf data using the same timebase;
3652 MobileSafari can't call WTF::monotonicallyIncreasingTime(), so use CFAbsoluteTimeGetCurrent()
3655 * UIProcess/Cocoa/RemoteLayerTreeScrollingPerformanceData.mm:
3656 (WebKit::RemoteLayerTreeScrollingPerformanceData::appendBlankPixelCount):
3658 2015-03-27 Chris Dumez <cdumez@apple.com>
3660 [WK2][NetworkCache] Rename requestNeedsRevalidation() to requestRequiresRevalidation()
3661 https://bugs.webkit.org/show_bug.cgi?id=143137
3663 Reviewed by Antti Koivisto.
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.
3669 * NetworkProcess/cache/NetworkCache.cpp:
3670 (WebKit::NetworkCache::requestRequiresRevalidation):
3671 (WebKit::NetworkCache::canUse):
3672 (WebKit::NetworkCache::requestNeedsRevalidation): Deleted.
3674 2015-03-27 Oliver Hunt <oliver@apple.com>
3676 Forward additional CFNetwork ATS information to child processes
3677 https://bugs.webkit.org/show_bug.cgi?id=143136
3679 Reviewed by Anders Carlsson.
3681 Add additional process creation parameter information, and pass it
3682 to the child processes that actually use CFNetwork.
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):
3706 2015-03-27 Chris Dumez <cdumez@apple.com>
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>
3712 Reviewed by Antti Koivisto.
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
3718 - 'Expires' header field
3719 - 'max-age' response directive
3721 This patch updates our caching policy accordingly to improve efficiency.
3723 [1] http://tools.ietf.org/html/rfc7231#page-48
3724 [2] http://tools.ietf.org/html/rfc7234#section-4.3.2
3726 Test: http/tests/cache/disk-cache/disk-cache-307-status-code.html
3728 * NetworkProcess/cache/NetworkCache.cpp:
3729 (WebKit::NetworkCache::canStore):
3731 2015-03-26 Antti Koivisto <antti@apple.com>
3733 Respect cache-control directives in request
3734 https://bugs.webkit.org/show_bug.cgi?id=143121
3735 rdar://problem/19714040
3737 Reviewed by Chris Dumez.
3739 Better support for https://tools.ietf.org/html/rfc7234#section-5.2.1
3741 * NetworkProcess/cache/NetworkCache.cpp:
3742 (WebKit::NetworkCache::canUse):
3744 Consider requests with Cache-control: no-cache and max-age=0 expired.
3746 (WebKit::NetworkCache::canStore):
3748 Don't store requests with Cache-control: no-store.
3750 (WebKit::NetworkCache::Cache::store):
3751 * NetworkProcess/cache/NetworkCache.h:
3752 * NetworkProcess/cache/NetworkCacheStatisticsCocoa.mm:
3753 (WebKit::NetworkCache::storeDecisionToDiagnosticKey):
3755 2015-03-25 Jon Honeycutt <jhoneycutt@apple.com>
3757 iOS file upload panel menu items need icons
3758 <https://bugs.webkit.org/show_bug.cgi?id=143042>
3759 <rdar://problem/20178678>
3761 Reviewed by Andy Estes.
3763 * Platform/spi/ios/UIKitSPI.h:
3764 Declare new SPI methods _UIImageGetWebKitTakePhotoOrVideoIcon and
3765 _UIImageGetWebKitPhotoLibraryIcon().
3767 * UIProcess/ios/forms/WKFileUploadPanel.mm:
3770 If UIKit SPI exists, use it. Otherwise, return nil.
3772 (-[WKFileUploadPanel _showDocumentPickerMenu]):
3775 2015-03-26 Enrica Casucci <enrica@apple.com>
3777 OS X build fix after r182037.
3781 * UIProcess/API/mac/WKView.mm:
3782 (-[WKView _addFontPanelObserver]):
3783 (-[WKView removeWindowObservers]):
3784 (-[WKView observeValueForKeyPath:ofObject:change:context:]):
3786 2015-03-26 Enrica Casucci <enrica@apple.com>
3788 iOS build fix after r182037.
3792 * UIProcess/API/Cocoa/WKWebView.mm:
3793 (-[WKWebView _setEditable:]):
3795 2015-03-26 Enrica Casucci <enrica@apple.com>
3797 REGRESSION(r1807689): Slower startup time for WKWebView.
3798 https://bugs.webkit.org/show_bug.cgi?id=143115
3799 rdar://problem/20233711
3801 Reviewed by Anders Carlsson.
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
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:
3822 2015-03-26 Alex Christensen <achristensen@webkit.org>
3824 Progress towards CMake on Mac.
3825 https://bugs.webkit.org/show_bug.cgi?id=143112
3827 Reviewed by Chris Dumez.
3830 * PlatformMac.cmake:
3831 * UIProcess/Cocoa/WebPageProxyCocoa.mm:
3833 2015-03-26 Chris Dumez <cdumez@apple.com>
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>
3839 Reviewed by Antti Koivisto.
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.
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:
3870 2015-03-26 Andreas Kling <akling@apple.com>
3872 [Darwin] Boost the web process QoS level while handling a synchronous IPC message.
3873 <https://webkit.org/b/142988>
3874 <rdar://problem/20264346>
3876 Reviewed by Antti Koivisto and Anders Carlsson.
3878 Add a mechanism for IPC::Connection to boost the main thread for the duration
3879 of processing a synchronous message.
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.
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.
3888 (IPC::Connection::processIncomingMessage): Optionally boost the main thread when
3889 processing an incoming message with the IsSyncMessage flag set.
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.
3897 * Platform/IPC/MessageDecoder.cpp:
3898 (IPC::MessageDecoder::~MessageDecoder): Remove any QoS override owned by this message.
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.
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.
3908 2015-03-26 Ryosuke Niwa <rniwa@webkit.org>
3910 Cursor doesn't change back to pointer when leaving Mail
3911 https://bugs.webkit.org/show_bug.cgi?id=132038
3913 Reviewed by Anders Carlsson.
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.
3918 We use nil cursor here since we manually update the cursor by calling [NSCursor set].
3920 * UIProcess/API/mac/WKView.mm:
3921 (-[WKView initWithFrame:processPool:configuration:webView:]):
3922 * UIProcess/mac/PageClientImpl.mm:
3923 (WebKit::PageClientImpl::recommendedScrollbarStyleDidChange):
3925 2015-03-26 Michael Catanzaro <mcatanzaro@igalia.com>
3927 [Linux] SeccompFilters: improve the port-agnostic whitelist
3928 https://bugs.webkit.org/show_bug.cgi?id=140064
3930 Reviewed by Žan Doberšek.
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.
3936 * Shared/linux/SeccompFilters/SyscallPolicy.cpp:
3937 (WebKit::SyscallPolicy::addDefaultWebProcessPolicy):
3939 2015-03-26 Antti Koivisto <antti@apple.com>
3941 Remove unneeded isConditionalRequest check from NetworkResourceLoader
3942 https://bugs.webkit.org/show_bug.cgi?id=143096
3944 Reviewed by Anders Carlsson.
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.
3950 * NetworkProcess/NetworkResourceLoader.cpp:
3951 (WebKit::NetworkResourceLoader::didReceiveResponseAsync):
3952 (WebKit::isConditionalRequest): Deleted.
3954 2015-03-26 Antti Koivisto <antti@apple.com>
3956 Rename Storage::Entry to Storage::Record
3957 https://bugs.webkit.org/show_bug.cgi?id=143101
3959 Reviewed by Chris Dumez.
3961 Lets have just one type called Entry in the cache code.
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:
4005 2015-03-26 Chris Dumez <cdumez@apple.com>
4007 [WK2] Let the compiler generate the NetworkCache::Key move constructor
4008 https://bugs.webkit.org/show_bug.cgi?id=143079
4010 Reviewed by Antti Koivisto.
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>).
4017 Also have the compiler generate a move assignment operator for
4018 consistency. Although it is not currently useful, it could be at some
4021 * NetworkProcess/cache/NetworkCacheKey.cpp:
4022 (WebKit::NetworkCache::Key::Key): Deleted.
4023 * NetworkProcess/cache/NetworkCacheKey.h:
4025 2015-03-26 Chris Dumez <cdumez@apple.com>
4027 [WK2][NetworkCache] Compute if a cached response has expired only when actually needed
4028 https://bugs.webkit.org/show_bug.cgi?id=143070
4030 Reviewed by Antti Koivisto.
4032 Compute if a cached response has expired only when actually needed:
4033 - This is not a history navigation
4035 - It does not have "Cache-Control: no-cache" header
4037 Previously, we would always determine if the response has expired and
4038 we often end up not using this information.
4040 * NetworkProcess/cache/NetworkCache.cpp:
4041 (WebKit::NetworkCache::responseHasExpired):
4042 (WebKit::NetworkCache::canUse):
4044 2015-03-26 Zan Dobersek <zdobersek@igalia.com>
4046 Avoid the Vector<> copy in WebTouchEvent constructor
4047 https://bugs.webkit.org/show_bug.cgi?id=143043
4049 Reviewed by Carlos Garcia Campos.
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.
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):
4069 2015-03-25 Chris Dumez <cdumez@apple.com>
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>
4076 Reviewed by Alexey Proskuryakov.
4078 WebFrameLoaderClient::dispatchDecidePolicyForResponse() should always
4079 call the FramePolicyFunction. Previously, it would fail to do in 2
4081 - m_frame->page() returns null
4083 - webPage->sendSync() returns false