e1036c2077d56e8b51e289f4078131bdbd825225
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2015-06-11  Myles C. Maxfield  <mmaxfield@apple.com>
2
3         [OS X] Decoding fonts may return nil when using force click
4         https://bugs.webkit.org/show_bug.cgi?id=145890
5
6         Reviewed by Beth Dakin.
7
8         [NSFontDescriptor fontDescriptorWithFontAttributes] might return nil, which
9         causes the encoding of an NSFont to erroneously return true.
10
11         * Shared/mac/ArgumentCodersMac.mm:
12         (IPC::decode):
13
14 2015-06-11  Anders Carlsson  <andersca@apple.com>
15
16         Reimplement WKOriginDataManager in terms of API::WebsiteDataStore
17         https://bugs.webkit.org/show_bug.cgi?id=145889
18
19         Reviewed by Dan Bernstein.
20
21         * UIProcess/API/C/WKAPICast.h:
22         * UIProcess/API/C/WKContext.cpp:
23         (WKContextGetOriginDataManager):
24         * UIProcess/API/C/WKOriginDataManager.cpp:
25         (WKOriginDataManagerGetTypeID):
26         (WKOriginDataManagerGetOrigins):
27         (WKOriginDataManagerDeleteEntriesForOrigin):
28         (WKOriginDataManagerDeleteEntriesModifiedBetweenDates):
29         (WKOriginDataManagerDeleteAllEntries):
30
31 2015-06-11  Brent Fulgham  <bfulgham@apple.com>
32
33         Full screen video space can be resized to 1pt wide
34         https://bugs.webkit.org/show_bug.cgi?id=145895
35         <rdar://problem/20907914>
36
37         Reviewed by Simon Fraser.
38
39         Prior to the upcoming OS X, full screen mode was not resizable. Now that it is,
40         we need to set a minimum window width that is large enough to hold the media
41         controls. This makes our full-screen video behave the same as the QuickTimeX player.
42
43         * UIProcess/mac/WKFullScreenWindowController.mm:
44         (-[WKFullScreenWindowController finishedEnterFullScreenAnimation:]): Active that new
45         kWKLayoutModeDynamicSizeWithMinimumViewSize style, and set the minimum view size to
46         be the width of our media controls, with 20 pixels of padding on either side.
47         (-[WKFullScreenWindowController finishedExitFullScreenAnimation:]): Set the layout
48         mode back to the default style.
49
50 2015-06-11  Jon Lee  <jonlee@apple.com>
51
52         Update media controls JS and CSS to use picture-in-picture
53         https://bugs.webkit.org/show_bug.cgi?id=145827
54         <rdar://problem/21311576>
55
56         Reviewed by Dean Jackson.
57
58         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
59         (InitWebCoreSystemInterface): Deleted GetMediaUIImageData.
60
61 2015-06-11  Alex Christensen  <achristensen@webkit.org>
62
63         Speculative build fix for GTK after r185463.
64
65         * CMakeLists.txt:
66         Remove WebPluginSiteDataManager.cpp from CMake build.
67
68 2015-06-11  Anders Carlsson  <andersca@apple.com>
69
70         Remove WebPluginSiteDataManager
71         https://bugs.webkit.org/show_bug.cgi?id=145884
72
73         Reviewed by Andreas Kling.
74
75         * PluginProcess/PluginProcess.cpp:
76         (WebKit::PluginProcess::clearSiteData): Deleted.
77         * PluginProcess/PluginProcess.h:
78         * PluginProcess/PluginProcess.messages.in:
79         * UIProcess/API/C/WKAPICast.h:
80         * UIProcess/API/C/WKContext.cpp:
81         * UIProcess/API/C/WKPluginSiteDataManager.cpp:
82         * UIProcess/Plugins/PluginProcessManager.cpp:
83         (WebKit::PluginProcessManager::clearSiteData): Deleted.
84         * UIProcess/Plugins/PluginProcessManager.h:
85         * UIProcess/Plugins/PluginProcessProxy.cpp:
86         (WebKit::PluginProcessProxy::clearSiteData): Deleted.
87         (WebKit::PluginProcessProxy::pluginProcessCrashedOrFailedToLaunch): Deleted.
88         (WebKit::PluginProcessProxy::didFinishLaunching): Deleted.
89         (WebKit::PluginProcessProxy::didClearSiteData): Deleted.
90         * UIProcess/Plugins/PluginProcessProxy.h:
91         * UIProcess/Plugins/PluginProcessProxy.messages.in:
92         * UIProcess/Plugins/WebPluginSiteDataManager.cpp: Removed.
93         (WebKit::WebPluginSiteDataManager::GetSitesWithDataState::GetSitesWithDataState): Deleted.
94         (WebKit::WebPluginSiteDataManager::GetSitesWithDataState::getSitesWithDataForNextPlugin): Deleted.
95         (WebKit::WebPluginSiteDataManager::GetSitesWithDataState::didGetSitesWithDataForSinglePlugin): Deleted.
96         (WebKit::WebPluginSiteDataManager::ClearSiteDataState::ClearSiteDataState): Deleted.
97         (WebKit::WebPluginSiteDataManager::ClearSiteDataState::clearSiteDataForNextPlugin): Deleted.
98         (WebKit::WebPluginSiteDataManager::ClearSiteDataState::didClearSiteDataForSinglePlugin): Deleted.
99         (WebKit::WebPluginSiteDataManager::create): Deleted.
100         (WebKit::WebPluginSiteDataManager::WebPluginSiteDataManager): Deleted.
101         (WebKit::WebPluginSiteDataManager::~WebPluginSiteDataManager): Deleted.
102         (WebKit::WebPluginSiteDataManager::invalidate): Deleted.
103         (WebKit::WebPluginSiteDataManager::getSitesWithData): Deleted.
104         (WebKit::WebPluginSiteDataManager::didGetSitesWithData): Deleted.
105         (WebKit::WebPluginSiteDataManager::clearSiteData): Deleted.
106         (WebKit::WebPluginSiteDataManager::didClearSiteData): Deleted.
107         (WebKit::WebPluginSiteDataManager::didGetSitesWithDataForSinglePlugin): Deleted.
108         (WebKit::WebPluginSiteDataManager::didGetSitesWithDataForAllPlugins): Deleted.
109         (WebKit::WebPluginSiteDataManager::didClearSiteDataForSinglePlugin): Deleted.
110         (WebKit::WebPluginSiteDataManager::didClearSiteDataForAllPlugins): Deleted.
111         * UIProcess/Plugins/WebPluginSiteDataManager.h: Removed.
112         (WebKit::WebPluginSiteDataManager::processPool): Deleted.
113         (WebKit::WebPluginSiteDataManager::clearProcessPool): Deleted.
114         * UIProcess/WebProcessPool.cpp:
115         (WebKit::WebProcessPool::~WebProcessPool): Deleted.
116         * UIProcess/WebProcessPool.h:
117         * UIProcess/WebProcessProxy.cpp:
118         * WebKit2.xcodeproj/project.pbxproj:
119
120 2015-06-11  Anders Carlsson  <andersca@apple.com>
121
122         Make WKWebsiteDataStoreRef backed by an API::WebsiteDataStore
123         https://bugs.webkit.org/show_bug.cgi?id=145882
124
125         Reviewed by Dan Bernstein.
126
127         * UIProcess/API/C/WKAPICast.h:
128         * UIProcess/API/C/WKContext.cpp:
129         (WKContextGetPluginSiteDataManager):
130         * UIProcess/API/C/WKPluginSiteDataManager.cpp:
131         (WKPluginSiteDataManagerGetTypeID):
132         (WKPluginSiteDataManagerGetSitesWithData):
133         (WKPluginSiteDataManagerClearSiteData):
134         (WKPluginSiteDataManagerClearAllSiteData):
135
136 2015-06-11  Antti Koivisto  <antti@apple.com>
137
138         Network process crashes decoding invalid cache entry on 32bit system
139         https://bugs.webkit.org/show_bug.cgi?id=145842
140         rdar://problem/21228334
141
142         Reviewed by Anders Carlsson.
143
144         After cache scheme changes we may end up decoding invalid cache entries. This is by design,
145         we should just fail decoding and delete these entries.
146
147         However Decoder::bufferIsLargeEnoughToContain test in some cases would allow corrupted large
148         sizes due to overflow in 32bit pointer math and we would crash when allocating a string.
149
150         * NetworkProcess/cache/NetworkCacheCoders.cpp:
151         (WebKit::NetworkCache::Coder<CString>::decode):
152         (WebKit::NetworkCache::decodeStringText):
153         (WebKit::NetworkCache::Coder<WebCore::CertificateInfo>::decode):
154         (WebKit::NetworkCache::Coder<MD5::Digest>::encode):
155         * NetworkProcess/cache/NetworkCacheCoders.h:
156         * NetworkProcess/cache/NetworkCacheDecoder.cpp:
157         (WebKit::NetworkCache::Decoder::Decoder):
158         (WebKit::NetworkCache::Decoder::bufferIsLargeEnoughToContain):
159
160             Reshuffle to avoid sum.
161
162         (WebKit::NetworkCache::Decoder::decodeFixedLengthData):
163         * NetworkProcess/cache/NetworkCacheDecoder.h:
164         (WebKit::NetworkCache::Decoder::bufferSize):
165         (WebKit::NetworkCache::Decoder::currentOffset):
166         (WebKit::NetworkCache::Decoder::length): Deleted.
167         (WebKit::NetworkCache::Decoder::isInvalid): Deleted.
168         (WebKit::NetworkCache::Decoder::markInvalid): Deleted.
169
170             Remove these, they are not really used or needed.
171
172 2015-06-10  Anders Carlsson  <andersca@apple.com>
173
174         Rewrite WKPluginSiteDataManager using WebsiteDataStore functions
175         https://bugs.webkit.org/show_bug.cgi?id=145868
176
177         Reviewed by Antti Koivisto.
178
179         * UIProcess/API/C/WKPluginSiteDataManager.cpp:
180         (WKPluginSiteDataManagerGetSitesWithData):
181         (WKPluginSiteDataManagerClearSiteData):
182         (WKPluginSiteDataManagerClearAllSiteData):
183         (toNPClearSiteDataFlags): Deleted.
184         * UIProcess/Plugins/WebPluginSiteDataManager.h:
185         (WebKit::WebPluginSiteDataManager::processPool):
186
187 2015-06-11  Antti Koivisto  <antti@apple.com>
188
189         3% cold PLT regression from network cache on iOS
190         https://bugs.webkit.org/show_bug.cgi?id=145694
191         rdar://problem/21158245
192
193         Reviewed by Chris Dumez.
194
195         Cache does not help in cold page loads but it shouldn't' be hurting either. Write I/O needs to be toned down a bit.
196
197         * NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:
198         (WebKit::NetworkCache::IOChannel::IOChannel):
199         (WebKit::NetworkCache::IOChannel::open):
200
201             Dispatch channels inherit their I/O priority from the target queue. Use background queue for write I/O.
202
203         * NetworkProcess/cache/NetworkCacheStorage.cpp:
204         (WebKit::NetworkCache::Storage::Storage):
205         (WebKit::NetworkCache::Storage::dispatchPendingReadOperations):
206         (WebKit::NetworkCache::Storage::dispatchPendingWriteOperations):
207
208             Only write one file at a time instead of maximum of three.
209
210         (WebKit::NetworkCache::Storage::retrieve):
211
212             For consistency with store prepend new entries here too.
213
214         (WebKit::NetworkCache::Storage::store):
215
216             Delay start of the first write operation by 1s.
217             Prepend instead of append to the pending write deque so retrieveFromMemory lookup finds newest entries first in case of duplicates
218
219         (WebKit::NetworkCache::Storage::traverse):
220         * NetworkProcess/cache/NetworkCacheStorage.h:
221
222 2015-06-10  Yongjun Zhang  <yongjun_zhang@apple.com>
223
224         Don't send touch events on link preview.
225         https://bugs.webkit.org/show_bug.cgi?id=145863
226
227         Disable web touch event recognizer on link preview. We do the same when finding nodes in inspector or when long press gesture
228         is recognized (by _cancelAllTouches). 
229
230         Reviewed by Beth Dakin.
231
232         * UIProcess/ios/WKContentViewInteraction.mm:
233         (-[WKContentView willPresentPreviewViewController:forPosition:inSourceView:]): Remove touch event gesture recognizer on preview start.
234         (-[WKContentView didDismissPreviewViewController:committing:]): Add the gesture recognizer back on dismiss.
235
236 2015-06-10  Anders Carlsson  <andersca@apple.com>
237
238         WKWebsiteDataStore should handle removing plug-in data for individual records
239         https://bugs.webkit.org/show_bug.cgi?id=145864
240
241         Reviewed by Beth Dakin.
242
243         * PluginProcess/PluginProcess.cpp:
244         (WebKit::PluginProcess::deleteWebsiteDataForHostNames):
245         * PluginProcess/PluginProcess.h:
246         * PluginProcess/PluginProcess.messages.in:
247         * UIProcess/Plugins/PluginProcessManager.cpp:
248         (WebKit::PluginProcessManager::deleteWebsiteDataForHostNames):
249         * UIProcess/Plugins/PluginProcessManager.h:
250         * UIProcess/Plugins/PluginProcessProxy.cpp:
251         (WebKit::PluginProcessProxy::deleteWebsiteDataForHostNames):
252         (WebKit::PluginProcessProxy::pluginProcessCrashedOrFailedToLaunch):
253         (WebKit::PluginProcessProxy::didFinishLaunching):
254         (WebKit::PluginProcessProxy::didDeleteWebsiteDataForHostNames):
255         * UIProcess/Plugins/PluginProcessProxy.h:
256         * UIProcess/Plugins/PluginProcessProxy.messages.in:
257         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
258         (WebKit::WebsiteDataStore::removeData):
259
260 2015-06-10  Anders Carlsson  <andersca@apple.com>
261
262         WKWebsiteDataStore should handle removing plug-in data
263         https://bugs.webkit.org/show_bug.cgi?id=145862
264
265         Reviewed by Sam Weinig.
266
267         * PluginProcess/PluginProcess.cpp:
268         (WebKit::PluginProcess::deleteWebsiteData):
269         * PluginProcess/PluginProcess.h:
270         * PluginProcess/PluginProcess.messages.in:
271         * UIProcess/Plugins/PluginProcessManager.cpp:
272         (WebKit::PluginProcessManager::deleteWebsiteData):
273         * UIProcess/Plugins/PluginProcessManager.h:
274         * UIProcess/Plugins/PluginProcessProxy.cpp:
275         (WebKit::PluginProcessProxy::~PluginProcessProxy):
276         (WebKit::PluginProcessProxy::deleteWebsiteData):
277         (WebKit::PluginProcessProxy::pluginProcessCrashedOrFailedToLaunch):
278         (WebKit::PluginProcessProxy::didFinishLaunching):
279         (WebKit::PluginProcessProxy::didDeleteWebsiteData):
280         * UIProcess/Plugins/PluginProcessProxy.h:
281         * UIProcess/Plugins/PluginProcessProxy.messages.in:
282         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
283         (WebKit::WebsiteDataStore::removeData):
284
285 2015-06-10  Brent Fulgham  <bfulgham@apple.com>
286
287         [WK2] Do not indicate Media Keys are present when they are not
288         https://bugs.webkit.org/show_bug.cgi?id=145713
289         <rdar://problem/19752566>
290
291         Reviewed by Dean Jackson.
292
293         Correct the reporting of Media Key presence by checking for the actual
294         media key file, not just the directory. Sometimes the directory will exist
295         with no media key files (e.g., if a user navigates to the directory using
296         the Finder).
297
298         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
299         (WebKit::computeMediaKeyFile): Moved earlier in file so it could be used by
300         the 'mediaKeyOrigins' method.
301         (WebKit::WebsiteDataStore::mediaKeyOrigins): Only indicate we have a media key
302         origin if the folder actually contains the media key file.
303         (WebKit::WebsiteDataStore::removeMediaKeys): Use the existing 'computeMediaKeyFile',
304         rather than manually building the file from strings.
305
306 2015-06-09  Anders Carlsson  <andersca@apple.com>
307
308         Support fetching website data
309         https://bugs.webkit.org/show_bug.cgi?id=145828
310
311         Reviewed by Darin Adler.
312
313         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
314         (WebKit::WebsiteDataStore::fetchData):
315         (WebKit::WebsiteDataStore::plugins):
316         * UIProcess/WebsiteData/WebsiteDataStore.h:
317
318 2015-06-10  Zan Dobersek  <zdobersek@igalia.com>
319
320         Unreviewed. Fixing the build for the GTK port with Clang.
321
322         * UIProcess/gtk/InputMethodFilter.h: Add the <functional> header inclusion
323         to avoid compilation errors due to missing std::function<>.
324
325 2015-06-10  Carlos Garcia Campos  <cgarcia@igalia.com>
326
327         [GTK] Move KeyBindingTranslator from platform to WebKit2 layer
328         https://bugs.webkit.org/show_bug.cgi?id=145840
329
330         Reviewed by Martin Robinson.
331
332         It's currently used only by WebKit2 in the UI process and it's
333         another file built twice because of the GTK2 plugin process.
334
335         * PlatformGTK.cmake:
336         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
337         * UIProcess/gtk/KeyBindingTranslator.cpp: Renamed from Source/WebCore/platform/gtk/KeyBindingTranslator.cpp.
338         (WebKit::backspaceCallback):
339         (WebKit::selectAllCallback):
340         (WebKit::cutClipboardCallback):
341         (WebKit::copyClipboardCallback):
342         (WebKit::pasteClipboardCallback):
343         (WebKit::toggleOverwriteCallback):
344         (WebKit::popupMenuCallback):
345         (WebKit::showHelpCallback):
346         (WebKit::deleteFromCursorCallback):
347         (WebKit::moveCursorCallback):
348         (WebKit::KeyBindingTranslator::KeyBindingTranslator):
349         (WebKit::KeyBindingTranslator::commandsForKeyEvent):
350         * UIProcess/gtk/KeyBindingTranslator.h: Renamed from Source/WebCore/platform/gtk/KeyBindingTranslator.h.
351         (WebKit::KeyBindingTranslator::addPendingEditorCommand):
352
353 2015-06-10  Carlos Garcia Campos  <cgarcia@igalia.com>
354
355         [GTK] Get rid of GetEditorCommandsForKeyEvent sync message
356         https://bugs.webkit.org/show_bug.cgi?id=145598
357
358         Reviewed by Žan Doberšek.
359
360         We are sending GetEditorCommandsForKeyEvent sync message from web
361         process to the UI process for every key pressed. And if the
362         keydown event doesn't handle the key, the message is sent again
363         for the keypress event, so in many cases it happens twice per
364         keypress. We can get the list of commands when the key press event
365         happens in the web view, and send it to the web process as part of
366         the keyboard event like mac port does. In the web process,
367         commands not inserting text will be handled by keydown and the
368         rest in keypress without having to use any other IPC message for that.
369
370         * Shared/NativeWebKeyboardEvent.h: Add command list parameter to
371         the constructor.
372         * Shared/WebEvent.h: Add GTK specific constructor that receives a
373         list of commands and whether the event was handled by input methods.
374         (WebKit::WebKeyboardEvent::commands): Returns the list of commands.
375         * Shared/WebEventConversion.cpp:
376         (WebKit::WebKit2PlatformKeyboardEvent::WebKit2PlatformKeyboardEvent):
377         Also copy the commands and handledByInputMethod member.
378         * Shared/WebKeyboardEvent.cpp:
379         (WebKit::WebKeyboardEvent::WebKeyboardEvent): Implement GTK
380         specific constructor that receives a list of commands and whether
381         the event was handled by input methods.
382         (WebKit::WebKeyboardEvent::encode): Encode commands and handledByInputMethod.
383         (WebKit::WebKeyboardEvent::decode): Decode commands and handledByInputMethod.
384         * Shared/gtk/NativeWebKeyboardEventGtk.cpp:
385         (WebKit::NativeWebKeyboardEvent::NativeWebKeyboardEvent): Add
386         command list parameter to the constructor.
387         * Shared/gtk/WebEventFactory.cpp:
388         (WebKit::WebEventFactory::createWebKeyboardEvent): Use the new
389         WebKeyboardEvent constructor and simplify the code. We don't need
390         to explicitly set VK_PROCESSKEY as windows virtual key code when
391         the event was handled by input methods. The WebCore event handler
392         already does that.
393         * Shared/gtk/WebEventFactory.h:
394         * UIProcess/API/gtk/PageClientImpl.cpp:
395         (WebKit::PageClientImpl::getEditorCommandsForKeyEvent): Deleted.
396         * UIProcess/API/gtk/PageClientImpl.h:
397         * UIProcess/API/gtk/WebKitWebViewBase.cpp: Add a
398         KeyBindingTranslator member.
399         (webkitWebViewBaseKeyPressEvent): Use the new
400         InputMethodFilter::filterKeyEvent() API and get the list of
401         commands for the key when events was not handled by input methods.
402         (webkitWebViewBaseKeyReleaseEvent): Use the new
403         InputMethodFilter::filterKeyEvent() API.
404         * UIProcess/PageClient.h:
405         * UIProcess/WebPageProxy.messages.in: Remove GetEditorCommandsForKeyEvent message.
406         * UIProcess/gtk/InputMethodFilter.cpp:
407         (WebKit::InputMethodFilter::handleKeyboardEvent): Call the
408         completation handler.
409         (WebKit::InputMethodFilter::handleKeyboardEventWithCompositionResults): Ditto.
410         (WebKit::InputMethodFilter::filterKeyEvent): Use a completion
411         handler for the task, so that the caller (the web view) can handle
412         the keyboard event.
413         * UIProcess/gtk/InputMethodFilter.h:
414         * UIProcess/gtk/WebPageProxyGtk.cpp:
415         (WebKit::WebPageProxy::getEditorCommandsForKeyEvent): Deleted.
416         * WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp:
417         (WebKit::WebEditorClient::handleKeyboardEvent): Return earlier if
418         the event was handled by input methods. And get the list of
419         commands from the PlatformKeyboardEvent instead of sending a sync
420         message to the UI process.
421         (WebKit::WebEditorClient::handleInputMethodKeydown): If the event
422         was handled by inpout methods, set the event as default handled so
423         that the WebCore event handler sets VK_PROCESSKEY as windows
424         virtual key code.
425         (WebKit::WebEditorClient::getEditorCommandsForKeyEvent): Deleted.
426
427 2015-06-10  Carlos Garcia Campos  <cgarcia@igalia.com>
428
429         Unreviewed. Fix GTK build after r185412.
430
431         Add missing include.
432
433         * NetworkProcess/cache/NetworkCacheFileSystem.cpp:
434
435 2015-06-10  Antti Koivisto  <antti@apple.com>
436
437         NetworkCache: Delete old cache versions
438         https://bugs.webkit.org/show_bug.cgi?id=145800
439
440         Reviewed by Darin Adler.
441
442         * CMakeLists.txt:
443         * NetworkProcess/cache/NetworkCacheBlobStorage.cpp:
444         (WebKit::NetworkCache::BlobStorage::synchronize):
445         * NetworkProcess/cache/NetworkCacheFileSystem.cpp: Added.
446         (WebKit::NetworkCache::directoryEntryType):
447         (WebKit::NetworkCache::traverseDirectory):
448
449             Pass entry type as callback argument.
450
451         (WebKit::NetworkCache::deleteDirectoryRecursively):
452
453             Add helper.
454
455         (WebKit::NetworkCache::fileTimes):
456         (WebKit::NetworkCache::updateFileModificationTimeIfNeeded):
457         * NetworkProcess/cache/NetworkCacheFileSystem.h: Copied from Source/WebKit2/NetworkProcess/cache/NetworkCacheFileSystemPosix.h.
458
459             Move code to cpp.
460
461         (WebKit::NetworkCache::traverseDirectory): Deleted.
462         (WebKit::NetworkCache::traverseCacheFiles): Deleted.
463         (WebKit::NetworkCache::fileTimes): Deleted.
464         (WebKit::NetworkCache::updateFileModificationTimeIfNeeded): Deleted.
465         * NetworkProcess/cache/NetworkCacheFileSystemPosix.h: Removed.
466         * NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:
467         * NetworkProcess/cache/NetworkCacheStatistics.cpp:
468         (WebKit::NetworkCache::Statistics::bootstrapFromNetworkCache):
469         * NetworkProcess/cache/NetworkCacheStorage.cpp:
470         (WebKit::NetworkCache::makeBlobDirectoryPath):
471         (WebKit::NetworkCache::traverseRecordsFiles):
472
473             Move cache hierarchy aware traversal code here from NetworkCacheFileSystem (for better layering).
474             Rename for clarity.
475
476         (WebKit::NetworkCache::deleteEmptyRecordsDirectories):
477
478             Factor to a function.
479
480         (WebKit::NetworkCache::Storage::Storage):
481         (WebKit::NetworkCache::Storage::synchronize):
482         (WebKit::NetworkCache::Storage::traverse):
483         (WebKit::NetworkCache::Storage::clear):
484
485             Use traverseRecordsFiles for traversal.
486
487         (WebKit::NetworkCache::Storage::shrink):
488         (WebKit::NetworkCache::Storage::deleteOldVersions):
489
490             Delete version subdirectories with version number less than the current version.
491             Remove code for clearing unversioned V1 caches. No one should have them.
492
493         * NetworkProcess/cache/NetworkCacheStorage.h:
494         * UIProcess/API/APIUserContentExtensionStore.cpp:
495         * WebKit2.xcodeproj/project.pbxproj:
496
497 2015-06-10  Zan Dobersek  <zdobersek@igalia.com>
498
499         [GTK] Web Inspector is broken
500         https://bugs.webkit.org/show_bug.cgi?id=145836
501
502         Reviewed by Carlos Garcia Campos.
503
504         * PlatformGTK.cmake: Thread the InspectorBackendCommands.js file as a separate
505         dependency of InspectorGResourceBundle.xml. It can't be listed under the InspectorFiles
506         variable and then searched via the CMake glob command because it probably won't exist
507         at the time the command is run (since it's copied into the specified path), so it won't
508         be listed among the dependencies at all.
509
510 2015-06-09  Anders Carlsson  <andersca@apple.com>
511
512         Fix build.
513
514         * UIProcess/Plugins/WebPluginSiteDataManager.cpp:
515         (WebKit::WebPluginSiteDataManager::GetSitesWithDataState::getSitesWithDataForNextPlugin):
516
517 2015-06-09  Anders Carlsson  <andersca@apple.com>
518
519         Change the PluginProcessManager data fetching function to take a completion handler
520         https://bugs.webkit.org/show_bug.cgi?id=145821
521
522         Reviewed by Sam Weinig.
523
524         * UIProcess/Plugins/PluginProcessManager.cpp:
525         (WebKit::PluginProcessManager::fetchWebsiteData):
526         (WebKit::PluginProcessManager::getSitesWithData): Deleted.
527         * UIProcess/Plugins/PluginProcessManager.h:
528         * UIProcess/Plugins/PluginProcessProxy.cpp:
529         (WebKit::generateCallbackID):
530         (WebKit::PluginProcessProxy::~PluginProcessProxy):
531         (WebKit::PluginProcessProxy::fetchWebsiteData):
532         (WebKit::PluginProcessProxy::pluginProcessCrashedOrFailedToLaunch):
533         (WebKit::PluginProcessProxy::didFinishLaunching):
534         (WebKit::PluginProcessProxy::didGetSitesWithData):
535         (WebKit::PluginProcessProxy::getSitesWithData): Deleted.
536         * UIProcess/Plugins/PluginProcessProxy.h:
537         * UIProcess/Plugins/WebPluginSiteDataManager.cpp:
538         (WebKit::WebPluginSiteDataManager::GetSitesWithDataState::getSitesWithDataForNextPlugin):
539
540 2015-06-09  Anders Carlsson  <andersca@apple.com>
541
542         Add code to keep track of plug-in data host names in website data records
543         https://bugs.webkit.org/show_bug.cgi?id=145818
544
545         Reviewed by Andreas Kling.
546
547         * Shared/WebsiteData/WebsiteData.cpp:
548         (WebKit::WebsiteData::encode):
549         (WebKit::WebsiteData::decode):
550         * Shared/WebsiteData/WebsiteData.h:
551         * UIProcess/WebsiteData/WebsiteDataRecord.cpp:
552         (WebKit::WebsiteDataRecord::displayNameForPluginDataHostName):
553         (WebKit::WebsiteDataRecord::addPluginDataHostName):
554         (WebKit::WebsiteDataRecord::displayNameForCookieHostName): Deleted.
555         * UIProcess/WebsiteData/WebsiteDataRecord.h:
556         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
557         (WebKit::WebsiteDataStore::fetchData):
558
559 2015-06-09  Anders Carlsson  <andersca@apple.com>
560
561         Add Plug-in type declarations to WKWebsiteDataRecord and friends
562         https://bugs.webkit.org/show_bug.cgi?id=145816
563
564         Reviewed by Andreas Kling.
565
566         * Shared/WebsiteData/WebsiteDataTypes.h:
567         * UIProcess/API/Cocoa/WKWebsiteDataRecord.mm:
568         (dataTypesToString):
569         * UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h:
570         (WebKit::toWebsiteDataTypes):
571         (WebKit::toWKWebsiteDataTypes):
572         * UIProcess/API/Cocoa/WKWebsiteDataRecordPrivate.h:
573
574 2015-06-09  Antti Koivisto  <antti@apple.com>
575
576         REGRESSION(r185262): NetworkCache is in wrong location on OS X
577         https://bugs.webkit.org/show_bug.cgi?id=145812
578
579         Reviewed by Anders Carlsson.
580
581         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
582         (WebKit::WebProcessPool::legacyPlatformDefaultWebSQLDatabaseDirectory):
583         (WebKit::WebProcessPool::legacyPlatformDefaultLocalStorageDirectory):
584         (WebKit::WebProcessPool::legacyPlatformDefaultMediaKeysStorageDirectory):
585         (WebKit::WebProcessPool::isNetworkCacheEnabled):
586
587             Make sure static functions that use NSUserDefaults call registerUserDefaultsIfNeeded() first.
588
589 2015-06-09  Yusuke Suzuki  <utatane.tea@gmail.com>
590
591         Crash when passing Symbol to NPAPI plugin objects
592         https://bugs.webkit.org/show_bug.cgi?id=145798
593
594         Reviewed by Darin Adler.
595
596         When the symbol is passed, `propertyName.publicName()` becomes nullptr.
597         So dereferencing it causes null dereference errors.
598         At first, this bug appears in the https://bugs.webkit.org/show_bug.cgi?id=145556,
599         plugin[@@toStringTag] ("string" + plugin) causes SEGV in plugins/embed-inside-object.html test.
600
601         This patch avoids it by early returning when the symbols are passed.
602         Methods for symbols are not implemented in the NPObject side, so it works correctly.
603
604         * WebProcess/Plugins/Netscape/JSNPObject.cpp:
605         (WebKit::npIdentifierFromIdentifier):
606         (WebKit::JSNPObject::callMethod):
607         (WebKit::JSNPObject::getOwnPropertySlot):
608         (WebKit::JSNPObject::put):
609         (WebKit::JSNPObject::deleteProperty):
610         (WebKit::JSNPObject::propertyGetter):
611         (WebKit::JSNPObject::methodGetter):
612
613 2015-06-09  Carlos Garcia Campos  <cgarcia@igalia.com>
614
615         [SOUP] Network Cache: Give more priority to reads over writes in IO WorkQueue
616         https://bugs.webkit.org/show_bug.cgi?id=145791
617
618         Reviewed by Sergio Villar Senin.
619
620         Keep using G_PRIORITY_DEFAULT for reads, but use
621         G_PRIORITY_DEFAULT_IDLE for writes now.
622
623         * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:
624         (WebKit::NetworkCache::outputStreamWriteReadyCallback): Use
625         G_PRIORITY_DEFAULT_IDLE for write async operations.
626         (WebKit::NetworkCache::IOChannel::write): Pass
627         G_PRIORITY_DEFAULT_IDLE to runTaskInQueue().
628
629 2015-06-09  Carlos Garcia Campos  <cgarcia@igalia.com>
630
631         [SOUP] Network Cache: run the IO completion handler in the given queue instead of the whole operation
632         https://bugs.webkit.org/show_bug.cgi?id=145797
633
634         Reviewed by Žan Doberšek.
635
636         I misunderstood what the WorkQueue parameter meant in the IO
637         channel operations. It's the queue where the completion handler
638         should be run, not the whole operation. Since our operations are
639         already non-blocking, we can just run the read/writes in the main
640         thread, and schedule the completion handler in the given work
641         queue when the operation finishes.
642
643         * NetworkProcess/cache/NetworkCacheIOChannel.h:
644         * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:
645         (WebKit::NetworkCache::inputStreamReadReadyCallback):
646         (WebKit::NetworkCache::IOChannel::read):
647         (WebKit::NetworkCache::IOChannel::readSync):
648         (WebKit::NetworkCache::outputStreamWriteReadyCallback):
649         (WebKit::NetworkCache::IOChannel::write):
650
651 2015-06-09  David Kilzer  <ddkilzer@apple.com>
652
653         REGRESSION (r185357): Fix build for iOS 8.x
654
655         * UIProcess/ios/forms/WKFileUploadPanel.mm:
656         (fallbackIconForFile): Add cast prior to iOS 9.
657
658 2015-06-09  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
659
660         [EFL] Fix a crash on MiniBrowser when running on debug mode
661         https://bugs.webkit.org/show_bug.cgi?id=145793
662
663         Reviewed by Carlos Garcia Campos.
664
665         r185314 missed to initialize parameters.diskCacheDirectory with configuration's one.
666
667         * UIProcess/efl/WebProcessPoolEfl.cpp:
668         (WebKit::WebProcessPool::platformInitializeWebProcess):
669
670 2015-06-09  Csaba Osztrogonác  <ossy@webkit.org>
671
672         [cmake] Fix the style issues in cmake project files
673         https://bugs.webkit.org/show_bug.cgi?id=145755
674
675         Reviewed by Darin Adler.
676
677         * CMakeLists.txt:
678         * PlatformGTK.cmake:
679         * PlatformMac.cmake:
680
681 2015-06-02  Jon Honeycutt  <jhoneycutt@apple.com>
682
683         [iOS] UI process memory spike, hang when uploading a very large JPEG
684
685         <https://bugs.webkit.org/show_bug.cgi?id=145567>
686         <rdar://problem/21206699>
687
688         When uploading an image, we generate a thumbnail to use for an icon
689         that sits next to the control. To do this, we load the image and draw
690         it into a thumbnail-sized canvas. This can be very expensive for large
691         images.
692
693         To fix this, we'll use CGImageSource API, which will allow us to get
694         any existing thumbnail that exists in the source file.
695
696         Reviewed by Darin Adler.
697
698         * UIProcess/ios/forms/WKFileUploadPanel.mm:
699         (squareCropRectForSize):
700         Use std::round, based on Darin's review feedback that a) rintf is
701         incorrect in 64-bit systems where CGFloat is a double, b) rintf uses a
702         variable rounding mode, which is undesirable.
703         (squareImage):
704         Changed to take a CGImageRef.
705         Use RetainPtr and +[UIImage imageWithCGImage:] to match other code in
706         this file.
707         (thumbnailSizedImageForImage):
708         Changed to take a CGImageRef and to use iconSideLength.
709         (iconForImageFile):
710         Create an image source for the file, then use CGImageSource API to
711         generate a thumbnail.
712         (-[_WKImageFileUploadItem initWithFileURL:originalImage:]): Deleted.
713         (-[_WKImageFileUploadItem displayImage]):
714         Use iconForImageFile() rather than trying to generate an icon from the
715         UIImage.
716         (-[WKFileUploadPanel _uploadItemForImageData:imageName:successBlock:failureBlock:]):
717         Removed originalImage parameter; _WKImageFileUploadItem no longer uses
718         it.
719         (-[WKFileUploadPanel _uploadItemForJPEGRepresentationOfImage:successBlock:failureBlock:]):
720         (-[WKFileUploadPanel _uploadItemForImage:withAssetURL:successBlock:failureBlock:]):
721
722 2015-06-08  Dan Bernstein  <mitz@apple.com>
723
724         [Cocoa] Use generics in framework headers
725         https://bugs.webkit.org/show_bug.cgi?id=145781
726
727         Reviewed by Sam Weinig.
728
729         * mac/postprocess-framework-headers.sh: Use the parameter to WK_ARRAY and WK_SET.
730
731 2015-06-08  Chris Dumez  <cdumez@apple.com>
732
733         Access GCController instance via GCController::singleton() instead of a free function
734         https://bugs.webkit.org/show_bug.cgi?id=145776
735
736         Reviewed by Darin Adler.
737
738         Access GCController instance via GCController::singleton() instead of a
739         free function as per coding style and for consistency with other
740         singleton classes in the codebase.
741
742         * WebProcess/InjectedBundle/InjectedBundle.cpp:
743         (WebKit::InjectedBundle::garbageCollectJavaScriptObjects):
744         (WebKit::InjectedBundle::garbageCollectJavaScriptObjectsOnAlternateThreadForDebugging):
745         * WebProcess/WebProcess.cpp:
746         (WebKit::WebProcess::terminate):
747         (WebKit::WebProcess::didClose):
748         (WebKit::WebProcess::garbageCollectJavaScriptObjects):
749         (WebKit::WebProcess::setJavaScriptGarbageCollectorTimerEnabled):
750
751 2015-06-08  Anders Carlsson  <andersca@apple.com>
752
753         Include IndexedDB databases in -[WKWebsiteDataStore allWebsiteDataTypes]
754         https://bugs.webkit.org/show_bug.cgi?id=145775
755
756         Reviewed by Simon Fraser.
757
758         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
759         (+[WKWebsiteDataStore allWebsiteDataTypes]):
760
761 2015-06-08  Anders Carlsson  <andersca@apple.com>
762
763         Move the snapshot layer contents SPI to the web view
764         https://bugs.webkit.org/show_bug.cgi?id=145771
765
766         Reviewed by Geoffrey Garen.
767
768         We need to potentially ask the web page to take a snapshot of the current item,
769         so move the SPI to WKWebView and name it appropriately.
770
771         * UIProcess/API/Cocoa/WKBackForwardListItem.mm:
772         (-[WKBackForwardListItem _snapshotLayerContents]): Deleted.
773         * UIProcess/API/Cocoa/WKBackForwardListItemPrivate.h: Removed.
774         * UIProcess/API/Cocoa/WKWebView.mm:
775         (-[WKWebView _snapshotLayerContentsForBackForwardListItem:]):
776         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
777         * WebKit2.xcodeproj/project.pbxproj:
778
779 2015-06-08  Brady Eidson  <beidson@apple.com>
780
781         Completely remove all IDB properties/constructors when it is disabled at runtime.
782         rdar://problem/18429374 and https://bugs.webkit.org/show_bug.cgi?id=137034
783
784         Reviewed by Geoffrey Garen.
785
786         * WebProcess/WebProcess.cpp:
787         (WebKit::WebProcess::WebProcess): Enable IDB at runtime if it's enabled at compile time.
788
789 2015-06-08  Michael Catanzaro  <mcatanzaro@igalia.com>
790
791         [SOUP] Performs DNS prefetch when a proxy is configured (information leak)
792         https://bugs.webkit.org/show_bug.cgi?id=145542
793
794         Reviewed by Alexey Proskuryakov.
795
796         Add documentation to webkit_web_context_prefetch_dns to indicate that the function does
797         nothing if the system configuration indicates we should use a proxy to resolve the host.
798
799         * UIProcess/API/gtk/WebKitWebContext.cpp:
800
801 2015-06-08  Carlos Garcia Campos  <cgarcia@igalia.com>
802
803         REGRESSION(r185251): [GTK] webkit_web_context_set_disk_cache_directory() doesn't work when using shared secondary process model after r185251
804         https://bugs.webkit.org/show_bug.cgi?id=145751
805
806         Reviewed by Darin Adler.
807
808         In r185251 the CFNetwork cache was disabled in the web process,
809         but it also removed the disk cache directory web process
810         initialization parameter. While we support networking in the web
811         process when shared secondary process model is used, the network
812         cache should still work. We can remove this if we eventually
813         switch to use the network process unconditionally.
814
815         * Shared/WebProcessCreationParameters.cpp:
816         (WebKit::WebProcessCreationParameters::encode): Encode disk cache directory.
817         (WebKit::WebProcessCreationParameters::decode): Decode disk cache directory.
818         * Shared/WebProcessCreationParameters.h: Bring back disk cache directory only for soup.
819         * UIProcess/gtk/WebProcessPoolGtk.cpp:
820         (WebKit::WebProcessPool::platformInitializeWebProcess): Initialize disk cache directory parameter.
821         * WebProcess/soup/WebProcessSoup.cpp:
822         (WebKit::WebProcess::platformInitializeWebProcess): Use the disck cache directory parameter again.
823
824 2015-06-08  Csaba Osztrogonác  <ossy@webkit.org>
825
826         [GTK] Remove the unused scroll function from WebPageGtk.cpp
827         https://bugs.webkit.org/show_bug.cgi?id=145756
828
829         Reviewed by Carlos Garcia Campos.
830
831         * WebProcess/WebPage/gtk/WebPageGtk.cpp:
832         (WebKit::scroll): Deleted.
833
834 2015-06-08  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
835
836         REGRESSION(r185262): [EFL] Modify legacyPlatformDefaultNetworkCacheDirectory() according to network cache
837         https://bugs.webkit.org/show_bug.cgi?id=145752
838
839         Reviewed by Carlos Garcia Campos.
840
841         EFL port needs to add different prefix for network cache directory since r185262.
842         Modify it basedon GTK port fix.
843
844         * UIProcess/efl/WebProcessPoolEfl.cpp:
845         (WebKit::WebProcessPool::legacyPlatformDefaultNetworkCacheDirectory):
846
847 2015-06-07  Carlos Garcia Campos  <cgarcia@igalia.com>
848
849         REGRESSION(r185262): [GTK] webkit_web_context_set_disk_cache_directory() doesn't work after r185262
850         https://bugs.webkit.org/show_bug.cgi?id=145735
851
852         Reviewed by Darin Adler.
853
854         * NetworkProcess/soup/NetworkProcessSoup.cpp:
855         (WebKit::NetworkProcess::platformInitializeNetworkProcess): Use
856         the directory name to clear the old cache, since the disk cache
857         subdirectory is now added in the UI process.
858         * UIProcess/API/gtk/WebKitWebContext.cpp:
859         (webkit_web_context_set_disk_cache_directory): Update the
860         WebProcessPool configuration to override the disk cache directory.
861         * UIProcess/WebProcessPool.cpp:
862         (WebKit::WebProcessPool::ensureNetworkProcess): Use the
863         configuration to get the disk cache directory.
864         (WebKit::WebProcessPool::WebProcessPool): Remove
865         m_diskCacheDirectory member initialization.
866         * UIProcess/WebProcessPool.h: Remove m_diskCacheDirectory member.
867         * UIProcess/gtk/WebProcessPoolGtk.cpp:
868         (WebKit::WebProcessPool::legacyPlatformDefaultNetworkCacheDirectory):
869         Append the disk cache subdirectory.
870
871 2015-06-07  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
872
873         [EFL][GTK] Fix build  break since r185262
874         https://bugs.webkit.org/show_bug.cgi?id=145724
875
876         Unreviewed, fix build break for EFL and GTK ports.
877
878         * UIProcess/API/APIWebsiteDataStore.cpp:
879         (API::WebsiteDataStore::defaultLocalStorageDirectory):
880         (API::WebsiteDataStore::defaultWebSQLDatabaseDirectory):
881         (API::WebsiteDataStore::defaultNetworkCacheDirectory):
882         (API::WebsiteDataStore::defaultApplicationCacheDirectory):
883         (API::WebsiteDataStore::defaultMediaKeysStorageDirectory):
884         (API::WebsiteDataStore::defaultIndexedDBDatabaseDirectory):
885         * UIProcess/efl/WebProcessPoolEfl.cpp:
886         (WebKit::WebProcessPool::legacyPlatformDefaultNetworkCacheDirectory):
887         (WebKit::WebProcessPool::platformDefaultDiskCacheDirectory): Deleted.
888         * WebProcess/soup/WebProcessSoup.cpp:
889         (WebKit::WebProcess::platformInitializeWebProcess):
890
891 2015-06-06  Dan Bernstein  <mitz@apple.com>
892
893         Don’t enable manual sandboxing in the iOS Simulator. This should fix all the tests timing out.
894
895         * Configurations/DebugRelease.xcconfig:
896
897 2015-06-06  Dan Bernstein  <mitz@apple.com>
898
899         [iOS] Can’t debug with Development XPC services due to automatic sandboxing
900         https://bugs.webkit.org/show_bug.cgi?id=145731
901
902         Rubber-stamped by Darin Adler.
903
904         In iOS, the XPC services are automatically sandboxed based on their entitlements. The
905         sandbox doesn’t allow them to re-exec, which is necessary for linking against engineering
906         builds of the WebKit frameworks placed in a non-system location.
907
908         The solution is to opt Engineering builds into manual sandboxing.
909
910         * Configurations/BaseTarget.xcconfig:
911         - Add ENABLE_MANUAL_SANDBOXING to
912           GCC_PREPROCESSOR_DEFINITIONS when WK_MANUAL_SANDBOXING_ENABLED is YES.
913         - Set WK_MANUAL_SANDBOXING_ENABLED to YES for OS X, because we always use manual
914           sandboxing on that platform.
915
916         * Configurations/DebugRelease.xcconfig: Removed unused definition of DEBUG_OR_RELEASE. Set
917           WK_MANUAL_SANDBOXING_ENABLED to YES for all engineering builds.
918
919         * Configurations/BaseXPCService.xcconfig: Define CODE_SIGN_ENTITLEMENTS for iOS to be empty
920           if the service is not installed; to use the base entitlements file from Configurations if
921           manual sandboxing is not enabled; and to use a derived entitlements file, which doesn’t
922           specify a sandbox profile, if manual sandboxing is enabled.
923
924         * Configurations/DatabaseService.Development.xcconfig: Define
925           WK_XPC_SERVICE_IOS_ENTITLEMENTS_BASE and let BaseXPCService.xcconfig define
926           CODE_SIGN_ENTITLEMENTS for iOS.
927
928         * Configurations/DatabaseService.xcconfig: Ditto.
929         * Configurations/NetworkService.Development.xcconfig: Ditto.
930         * Configurations/NetworkService.xcconfig: Ditto.
931         * Configurations/WebContentService.Development.xcconfig: Ditto.
932         * Configurations/WebContentService.xcconfig: Ditto.
933
934         * WebKit2.xcodeproj/project.pbxproj:
935         - In the Derived Sources target, added a Derive Entitlements for Manual Sandboxing script
936           build phase. When building for iOS with manual sandboxing enabled, it creates copies of
937           the iOS entitlements files with a -no-sandbox suffix and the seatbelt-profiles key
938           removed.
939         - In the WebKit target, added a Copy iOS Sandbox Profiles for Manual Sandboxing script build
940           phase. When building for iOS with manual sandboxing enabled, it copies the iOS sandbox
941           profiles into the framework, so that the services can apply them to themselves at runtime.
942
943         * Shared/ios/ChildProcessIOS.mm:
944         (WebKit::ChildProcess::initializeSandbox): Use ENABLE(MANUAL_SANDBOXING) and don’t define it
945         here.
946
947         * WebProcess/cocoa/WebProcessCocoa.mm:
948         (WebKit::WebProcess::initializeSandbox): Use ENABLE(MANUAL_SANDBOXING) instead of defining
949         and using ENABLE_MANUAL_WEBPROCESS_SANDBOXING here.
950
951 2015-06-06  Anders Carlsson  <andersca@apple.com>
952
953         Remove support from getting plug-in information from Carbon resources
954         https://bugs.webkit.org/show_bug.cgi?id=145730
955
956         Reviewed by Dan Bernstein.
957
958         No current plug-in versions use this feature, and both Chrome and Mozilla for
959         Mac stopped looking at Carbon resources years ago.
960
961         * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
962         (WebKit::NetscapePluginModule::getPluginInfo):
963         (WebKit::ResourceMap::ResourceMap): Deleted.
964         (WebKit::ResourceMap::~ResourceMap): Deleted.
965         (WebKit::ResourceMap::isValid): Deleted.
966         (WebKit::getStringListResource): Deleted.
967         (WebKit::getPluginInfoFromCarbonResources): Deleted.
968
969 2015-06-05  Anders Carlsson  <andersca@apple.com>
970
971         Only allow plug-ins to create custom MIME property lists on older versions of OS X
972         https://bugs.webkit.org/show_bug.cgi?id=145716
973
974         Reviewed by Dan Bernstein.
975
976         * PluginProcess/EntryPoint/mac/LegacyProcess/PluginProcessMain.mm:
977         * Shared/Plugins/Netscape/NetscapePluginModule.h:
978         * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
979         (WebKit::getMIMETypesFromPluginBundle):
980         * UIProcess/Plugins/PluginProcessProxy.h:
981         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
982
983 2015-06-05  Chris Dumez  <cdumez@apple.com>
984
985         [WK2][iOS] Limit the number of vnodes used by the WebContent processes
986         https://bugs.webkit.org/show_bug.cgi?id=145672
987         <rdar://problem/21126637>
988
989         Reviewed by Antti Koivisto.
990
991         Have the WebContent process register a vnode pressure handler on iOS,
992         which calls the memory pressure handler.
993
994         On non-critical pressure, it will prune dead resources from the memory
995         cache, which should free up some vnodes. On critical pressure, the
996         handler will clear the PageCache and do a JS GC, which should free even
997         more vnodes.
998
999         * WebProcess/cocoa/WebProcessCocoa.mm:
1000         (WebKit::WebProcess::platformInitializeWebProcess):
1001
1002 2015-06-05  Anders Carlsson  <andersca@apple.com>
1003
1004         Fix refacto, don't put IndexedDB databases in the cache directory
1005         https://bugs.webkit.org/show_bug.cgi?id=145714
1006
1007         Reviewed by Antti Koivisto.
1008
1009         * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
1010         (API::WebsiteDataStore::defaultIndexedDBDatabaseDirectory):
1011
1012 2015-06-05  Anders Carlsson  <andersca@apple.com>
1013
1014         Make the network cache directory part of WKContextConfigurationRef
1015         https://bugs.webkit.org/show_bug.cgi?id=145711
1016
1017         Reviewed by Antti Koivisto.
1018
1019         Also, make the UI process be in control of where we place the new network cache.
1020         When using the Modern WebKit API, put the cache in ~/Library/Caches/<Bundle ID>/WebKit/NetworkCache,
1021         and put the cache in ~/Library/Caches/<Bundle ID>/WebKitCache otherwise (this is just for Safari).
1022
1023         * NetworkProcess/cache/NetworkCacheStorage.cpp:
1024         (WebKit::NetworkCache::Storage::open):
1025         * UIProcess/API/APIProcessPoolConfiguration.cpp:
1026         (API::ProcessPoolConfiguration::createWithLegacyOptions):
1027         (API::ProcessPoolConfiguration::ProcessPoolConfiguration):
1028         (API::ProcessPoolConfiguration::copy):
1029         * UIProcess/API/APIProcessPoolConfiguration.h:
1030         * UIProcess/API/C/WKContext.cpp:
1031         (WKContextSetDiskCacheDirectory): Deleted.
1032         * UIProcess/API/C/WKContextConfigurationRef.cpp:
1033         (WKContextConfigurationCopyDiskCacheDirectory):
1034         (WKContextConfigurationSetDiskCacheDirectory):
1035         * UIProcess/API/C/WKContextConfigurationRef.h:
1036         * UIProcess/API/C/WKContextPrivate.h:
1037         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1038         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
1039         (WebKit::WebProcessPool::legacyPlatformDefaultNetworkCacheDirectory):
1040         (WebKit::WebProcessPool::isNetworkCacheEnabled):
1041         (WebKit::WebProcessPool::platformDefaultDiskCacheDirectory): Deleted.
1042         * UIProcess/WebProcessPool.cpp:
1043         (WebKit::legacyWebsiteDataStoreConfiguration):
1044         (WebKit::WebProcessPool::WebProcessPool):
1045         (WebKit::WebProcessPool::ensureNetworkProcess):
1046         (WebKit::WebProcessPool::diskCacheDirectory): Deleted.
1047         * UIProcess/WebProcessPool.h:
1048
1049 2015-06-05  Anders Carlsson  <andersca@apple.com>
1050
1051         Make the application cache directory part of WKContextConfigurationRef
1052         https://bugs.webkit.org/show_bug.cgi?id=145704
1053
1054         Reviewed by Geoffrey Garen.
1055
1056         * UIProcess/API/APIProcessPoolConfiguration.cpp:
1057         (API::ProcessPoolConfiguration::createWithLegacyOptions):
1058         (API::ProcessPoolConfiguration::ProcessPoolConfiguration):
1059         (API::ProcessPoolConfiguration::copy):
1060         * UIProcess/API/APIProcessPoolConfiguration.h:
1061         * UIProcess/API/C/WKContext.cpp:
1062         (WKContextSetApplicationCacheDirectory): Deleted.
1063         * UIProcess/API/C/WKContextConfigurationRef.cpp:
1064         (WKContextConfigurationCopyApplicationCacheDirectory):
1065         (WKContextConfigurationSetApplicationCacheDirectory):
1066         * UIProcess/API/C/WKContextConfigurationRef.h:
1067         * UIProcess/API/C/WKContextPrivate.h:
1068         * UIProcess/WebProcessPool.cpp:
1069         (WebKit::WebProcessPool::WebProcessPool):
1070         (WebKit::WebProcessPool::createNewWebProcess):
1071         (WebKit::WebProcessPool::applicationCacheDirectory): Deleted.
1072         * UIProcess/WebProcessPool.h:
1073
1074 2015-06-05  Mark Lam  <mark.lam@apple.com>
1075
1076         finally blocks should not set the exception stack trace when re-throwing the exception.
1077         https://bugs.webkit.org/show_bug.cgi?id=145525
1078
1079         Reviewed by Geoffrey Garen.
1080
1081         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1082         (WebKit::InjectedBundle::reportException):
1083         - Changed to use the new Exception object.
1084
1085 2015-06-05  Anders Carlsson  <andersca@apple.com>
1086
1087         Disable the CFNetwork cache in the web process
1088         https://bugs.webkit.org/show_bug.cgi?id=145700
1089         rdar://problem/20243343
1090
1091         Reviewed by Geoffrey Garen.
1092
1093         * NetworkProcess/cache/NetworkCacheStorage.cpp:
1094         (WebKit::NetworkCache::Storage::open):
1095         * Shared/WebProcessCreationParameters.cpp:
1096         (WebKit::WebProcessCreationParameters::WebProcessCreationParameters): Deleted.
1097         (WebKit::WebProcessCreationParameters::encode): Deleted.
1098         (WebKit::WebProcessCreationParameters::decode): Deleted.
1099         * Shared/WebProcessCreationParameters.h:
1100         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1101         (WebKit::WebProcessPool::platformInitializeWebProcess): Deleted.
1102         * UIProcess/WebProcessPool.cpp:
1103         (WebKit::WebProcessPool::createNewWebProcess): Deleted.
1104         * WebProcess/WebProcess.cpp:
1105         (WebKit::WebProcess::WebProcess): Deleted.
1106         (WebKit::WebProcess::initializeWebProcess): Deleted.
1107         * WebProcess/WebProcess.h:
1108         * WebProcess/cocoa/WebProcessCocoa.mm:
1109         (WebKit::WebProcess::platformClearResourceCaches):
1110         (WebKit::WebProcess::platformInitializeWebProcess):
1111         (WebKit::WebProcess::platformSetCacheModel): Deleted.
1112         (WebKit::WebProcess::platformTerminate): Deleted.
1113
1114 2015-06-05  Anders Carlsson  <andersca@apple.com>
1115
1116         Consolidate default website data directory computations
1117         https://bugs.webkit.org/show_bug.cgi?id=145698
1118
1119         Reviewed by Andreas Kling.
1120
1121         * UIProcess/API/APIProcessPoolConfiguration.cpp:
1122         (API::ProcessPoolConfiguration::ProcessPoolConfiguration):
1123         * UIProcess/API/APIWebsiteDataStore.h:
1124         * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
1125         (API::WebsiteDataStore::defaultApplicationCacheDirectory):
1126         (API::WebsiteDataStore::defaultNetworkCacheDirectory):
1127         (API::WebsiteDataStore::defaultIndexedDBDatabaseDirectory):
1128         (API::WebsiteDataStore::defaultLocalStorageDirectory):
1129         (API::WebsiteDataStore::defaultMediaKeysStorageDirectory):
1130         (API::WebsiteDataStore::defaultWebSQLDatabaseDirectory):
1131         (API::WebsiteDataStore::defaultDataStoreConfiguration):
1132         (API::applicationCacheDirectory): Deleted.
1133
1134 2015-06-01  Jon Honeycutt  <jhoneycutt@apple.com>
1135
1136         [iOS] Uploading an animated GIF from the photo library uploads a JPEG
1137
1138         <https://bugs.webkit.org/show_bug.cgi?id=145539>
1139         <rdar://problem/19760877
1140
1141         Selecting a photo from the photo library using UIImagePickerController
1142         results in an NSDictionary with image info and a UIImage with the
1143         image. It's not possible to get the original image data from the
1144         UIImage, only a PNG or JPEG representation, so we were getting a JPEG
1145         representation and uploading that to the server. For animated GIFs,
1146         this meant a JPEG representation of the first frame.
1147
1148         To fix this, we'll get the asset URL, if available, and use the Photos
1149         API to query for the original image data.
1150
1151         Reviewed by Andy Estes and Joe Pecoraro.
1152
1153         * UIProcess/ios/forms/WKFileUploadPanel.mm:
1154         Soft link the Photos framework.
1155
1156         (-[WKFileUploadPanel _uploadItemForImageData:originalImage:imageName:successBlock:failureBlock:]):
1157         Save the image's data to a temporary location, and create a
1158         _WKImageFileUploadItem. Code moved from
1159         -_uploadItemFromMediaInfo:successBlock:failureBlock:.
1160
1161         (-[WKFileUploadPanel _uploadItemForJPEGRepresentationOfImage:successBlock:failureBlock:]):
1162         Get a JPEG representation of the UIImage, and create an upload item
1163         from that data.
1164
1165         (uploadImageNameFromUTI):
1166         Return a filename for the uploaded image based on the UTI.
1167
1168         (-[WKFileUploadPanel _uploadItemForImage:withAssetURL:successBlock:failureBlock:]):
1169         Fetch the photo asset with the given asset URL. Create an image manager
1170         object, and request the image data for the photo asset. Create an
1171         upload item from that data. If we fail, fall back to a JPEG
1172         representation.
1173
1174         (-[WKFileUploadPanel _uploadItemFromMediaInfo:successBlock:failureBlock:]):
1175         Return early if the media item is not an image type. If it is, and we
1176         have an asset URL, try to create an upload item for the native image.
1177         If we don't have an asset URL, use a JPEG representation of the image.
1178
1179 2015-06-04  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
1180
1181         REGRESSION(r185091): Crash happens on indexdb tests
1182         https://bugs.webkit.org/show_bug.cgi?id=145549
1183
1184         Reviewed by Darin Adler.
1185
1186         * WebProcess/Databases/IndexedDB/WebIDBServerConnection.cpp: Remove leakRef() use.
1187         (WebKit::WebIDBServerConnection::didCreateObjectStore):
1188         (WebKit::WebIDBServerConnection::didCreateIndex):
1189         (WebKit::WebIDBServerConnection::didDeleteIndex):
1190         (WebKit::WebIDBServerConnection::didPutRecord):
1191         (WebKit::WebIDBServerConnection::didGetRecord):
1192         (WebKit::WebIDBServerConnection::didOpenCursor):
1193         (WebKit::WebIDBServerConnection::didAdvanceCursor):
1194         (WebKit::WebIDBServerConnection::didIterateCursor):
1195         (WebKit::WebIDBServerConnection::didCount):
1196         (WebKit::WebIDBServerConnection::didDeleteRange):
1197         (WebKit::WebIDBServerConnection::didClearObjectStore):
1198         (WebKit::WebIDBServerConnection::didDeleteObjectStore):
1199         (WebKit::WebIDBServerConnection::didChangeDatabaseVersion):
1200
1201 2015-06-04  Joseph Pecoraro  <pecoraro@apple.com>
1202
1203         Web Inspector: REGRESSION: dragged node in the DOM Tree isn't positioned correctly
1204         https://bugs.webkit.org/show_bug.cgi?id=143912
1205
1206         Reviewed by Simon Fraser.
1207
1208         * UIProcess/mac/PageClientImpl.mm:
1209         (WebKit::PageClientImpl::setDragImage):
1210         When using the WKWebView, convert the position from the WKView's
1211         coordinate system to the WKWebView's.
1212
1213         * UIProcess/API/Cocoa/WKWebView.mm:
1214         (-[WKWebView draggingUpdated:]):
1215         * UIProcess/API/mac/WKView.mm:
1216         (-[WKView _dragImageForView:withImage:at:linkDrag:]):
1217         Whitespace cleanup in original drag code.
1218
1219 2015-06-04  Dan Bernstein  <mitz@apple.com>
1220
1221         Fixed the build.
1222
1223         * UIProcess/API/Cocoa/WKErrorPrivate.h:
1224
1225 2015-06-04  Dan Bernstein  <mitz@apple.com>
1226
1227         Renamed the WebKit2SandboxProfiles target to Sandbox Profiles.
1228
1229         Rubber-stamped by Anders Carlsson.
1230
1231         * WebKit2.xcodeproj/project.pbxproj: Renamed the target. For now, added an aggregate
1232         target with the old name that depends on the renamed target. We can remove it once the build
1233         system doesn’t reference to old name.
1234
1235 2015-06-03  Dan Bernstein  <mitz@apple.com>
1236
1237         [Cocoa] Expose interruptedForPolicyChangeError
1238         https://bugs.webkit.org/show_bug.cgi?id=145627
1239
1240         Reviewed by Anders Carlsson.
1241
1242         * UIProcess/API/Cocoa/WKErrorPrivate.h: Added WKErrorCodeFrameLoadInterruptedByPolicyChange with the same value as
1243         kWKErrorCodeFrameLoadInterruptedByPolicyChange.
1244
1245 2015-06-04  Chris Dumez  <cdumez@apple.com>
1246
1247         [WK2] Prune more resources from the MemoryCache before process suspension
1248         https://bugs.webkit.org/show_bug.cgi?id=145633
1249
1250         Reviewed by Andreas Kling.
1251
1252         * NetworkProcess/NetworkProcess.cpp:
1253         (WebKit::NetworkProcess::lowMemoryHandler):
1254         (WebKit::NetworkProcess::initializeNetworkProcess):
1255         (WebKit::NetworkProcess::processWillSuspendImminently):
1256         (WebKit::NetworkProcess::prepareToSuspend):
1257         * NetworkProcess/NetworkProcess.h:
1258         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
1259         (WebKit::NetworkProcess::platformLowMemoryHandler):
1260         * PluginProcess/PluginProcess.cpp:
1261         (WebKit::PluginProcess::initializeProcess):
1262
1263         Update low memory handler prototype to match WebCore changes.
1264
1265         * WebProcess/WebProcess.cpp:
1266         (WebKit::WebProcess::actualPrepareToSuspend):
1267
1268         Pass Synchronous::Yes argument to MemoryPressureHandler::releaseMemory()
1269         to request that the memory is free up synchronously (e.g. synchronous
1270         JS garbage collection) as the process is about to be suspended.
1271         Previously, the memory pressure handler was trying to detect this case
1272         by checking if the system was really under memory pressure but this was
1273         a bit hackish and it wouldn't work if the process happened to get
1274         suspended while the system was under memory pressure.
1275
1276 2015-06-03  Carlos Alberto Lopez Perez  <clopez@igalia.com>
1277
1278         [GTK] [Wayland] Build is broken on trunk
1279         https://bugs.webkit.org/show_bug.cgi?id=142879
1280
1281         Reviewed by Carlos Garcia Campos.
1282
1283         * WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp:
1284         (WebKit::LayerTreeHostGtk::makeContextCurrent): When Wayland target
1285         is enabled GLNativeWindowType is not an u_int64 type.
1286         Cast contextID to avoid a build failure.
1287
1288 2015-06-03  Dan Bernstein  <mitz@apple.com>
1289
1290         Made WKBackForwardListItemPrivate.h a private header after it was added as internal in r185183.
1291
1292         * WebKit2.xcodeproj/project.pbxproj:
1293
1294 2015-06-03  Hyungwook Lee  <hyungwook.lee@navercorp.com>
1295
1296         [EFL] Implement window_object_cleared callback in EwkPageClient.
1297         https://bugs.webkit.org/show_bug.cgi?id=145603
1298
1299         Reviewed by Gyuyoung Kim.
1300
1301         We need to provide right timing for custom JS API that may need to work at the beginning of the page.
1302
1303         * UIProcess/API/efl/tests/extensions/extension_sample.cpp:
1304         * WebProcess/InjectedBundle/API/efl/ewk_page.cpp:
1305         (EwkPage::EwkPage):
1306         (EwkPage::didStartProvisionalLoadForFrame):
1307         (EwkPage::didClearWindowObjectForFrame):
1308         (EwkPage::didFinishDocumentLoadForFrame):
1309         * WebProcess/InjectedBundle/API/efl/ewk_page.h:
1310         * WebProcess/InjectedBundle/API/efl/ewk_page_private.h:
1311
1312 2015-06-03  Anders Carlsson  <andersca@apple.com>
1313
1314         Add SPI that returns the snapshot layer contents for a given back/forward list item
1315         https://bugs.webkit.org/show_bug.cgi?id=145621
1316
1317         Reviewed by Dan Bernstein.
1318
1319         * UIProcess/API/Cocoa/WKBackForwardListItem.mm:
1320         (-[WKBackForwardListItem _snapshotLayerContents]):
1321         * UIProcess/API/Cocoa/WKBackForwardListItemInternal.h:
1322         * UIProcess/API/Cocoa/WKBackForwardListItemPrivate.h: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKBackForwardListItemInternal.h.
1323         * WebKit2.xcodeproj/project.pbxproj:
1324
1325 2015-06-02  Hyungwook Lee  <hyungwook.lee@navercorp.com>
1326
1327         [EFL] Implement load_started callback in EwkPageClient.
1328         https://bugs.webkit.org/show_bug.cgi?id=145545
1329
1330         Reviewed by Gyuyoung Kim.
1331
1332         We need to provide load_started callback to web extension module.
1333
1334         * UIProcess/API/efl/tests/extensions/extension_sample.cpp:
1335         * WebProcess/InjectedBundle/API/efl/ewk_page.cpp:
1336         (EwkPage::EwkPage):
1337         (EwkPage::remove):
1338         (EwkPage::didStartProvisionalLoadForFrame):
1339         (EwkPage::didFinishDocumentLoadForFrame):
1340         * WebProcess/InjectedBundle/API/efl/ewk_page.h:
1341         * WebProcess/InjectedBundle/API/efl/ewk_page_private.h:
1342
1343 2015-06-02  Gavin Barraclough  <barraclough@apple.com>
1344
1345         PDFs always think they're visible on iOS.
1346         https://bugs.webkit.org/show_bug.cgi?id=145493
1347         <rdar://problem/19668879>
1348
1349         Reviewed by Andreas Kling & Sam Weinig.
1350
1351         The problem here is that WKContentView is currently responsible for notifying the WebPageProxy
1352         that the visibility may have changed, but when a PDF isn't showing the WKContentView isn't in
1353         the view hierarchy and doesn't receive the didMoveToWindow notifications – and the WKPDFView
1354         (which is in the view hierarchy) does not listen for these events.
1355
1356         Visibility of the page should really just track the visibility of the WKWebView (and when
1357         actually assessing the visibility it largely does - the page client checks the web view's
1358         visibility, bar a FIXME, and the foreground/background check, which needs to change).
1359         So notifications should really just come from the WKWebView.
1360
1361         The WKWebView already listens for the didMoveToWindow notification, it just was only updating
1362         the IsInWindow flag. Instead just update all flags, and the call to viewStateDidChange from
1363         WKContentView can just be removed.
1364
1365         There is one problem with this in that it would reverse the order of the calls to
1366         viewStateDidChange & _updateForScreen:, which would mean the the view would become visible before
1367         updating the screen pixel density. To fix this, moving the call to _updateForScreen:
1368         to willMoveToWindow:, to ensure it occurs before the page becomes visible.
1369
1370         This will also change behavior on Mac for WKWebView clients, in coalescing all view state changes
1371         within the didMoveToWindow call. This is the direction we intended to go in anyway (the plan is
1372         to remove the mayHaveChanged argument from viewStateDidChange - we're currently adding unnecessary
1373         IPC traffic).
1374
1375         * UIProcess/API/Cocoa/WKWebView.mm:
1376         (-[WKWebView didMoveToWindow]):
1377             - should update all view state flags.
1378         * UIProcess/API/ios/WKViewIOS.mm:
1379         (-[WKView didMoveToWindow]):
1380             - added to match WKWebView.mm, for WebKitTestRunner.
1381         * UIProcess/ios/WKContentView.mm:
1382         (-[WKContentView willMoveToWindow:]):
1383             - should _updateForScreen:
1384         (-[WKContentView didMoveToWindow]): Deleted.
1385             - functionality moved to -[WKWebView didMoveToWindow], -[WKContentView didMoveToWindow].
1386
1387 2015-06-02  Chris Dumez  <cdumez@apple.com>
1388
1389         [iOS][WK2] Always mark layers as volatile for background pages
1390         https://bugs.webkit.org/show_bug.cgi?id=145547
1391         <rdar://problem/20663184>
1392
1393         Reviewed by Simon Fraser.
1394
1395         We previously marked layers as volatile when the WebProcess was about
1396         to be suspended. Most of the time the WebProcess gets suspended when a
1397         page goes into the background. However, it is not always true (see
1398         radar), in which case the layers won't be marked as volatile and use
1399         memory even though they are not visible.
1400
1401         We now mark layers as volatile as soon as the page goes into the
1402         background, instead of relying on the WebProcess suspension mechanism
1403         to do so.
1404
1405         A new ApplicationDidEnterBackground IPC message from the UIProcess to
1406         the WebProcess is added (in addition to the pre-existing
1407         ApplicationWillEnterForeground one). When the WebProcess receives this
1408         message, it will freeze the layer tree state and mark the layers as
1409         volatile (with a timer to keep retrying if needed), similarly to what
1410         is already done in WebProcess::actualPrepareToSuspend().
1411         When the ApplicationWillEnterForeground is received, we unfreeze the
1412         layer tree state. The layers' volatile state will be automatically
1413         updated when they are displayed (see setBufferVolatility() call in
1414         RemoteLayerBackingStore::display()).
1415
1416         * UIProcess/WebPageProxy.h:
1417         * UIProcess/ios/WKContentView.mm:
1418         (-[WKContentView _applicationDidEnterBackground:]):
1419         * UIProcess/ios/WebPageProxyIOS.mm:
1420         (WebKit::WebPageProxy::applicationDidEnterBackground):
1421         * WebProcess/WebPage/WebPage.cpp:
1422         (WebKit::WebPage::WebPage):
1423         (WebKit::WebPage::setLayerTreeStateIsFrozen):
1424         (WebKit::WebPage::markLayersVolatileImmediatelyIfPossible):
1425         * WebProcess/WebPage/WebPage.h:
1426         * WebProcess/WebPage/WebPage.messages.in:
1427         * WebProcess/WebPage/ios/WebPageIOS.mm:
1428         (WebKit::WebPage::volatilityTimerFired):
1429         (WebKit::WebPage::applicationDidEnterBackground):
1430         (WebKit::WebPage::applicationWillEnterForeground):
1431         * WebProcess/WebProcess.cpp:
1432         (WebKit::WebProcess::markAllLayersVolatileIfPossible):
1433         (WebKit::WebProcess::setAllLayerTreeStatesFrozen):
1434
1435 2015-06-02  Brady Eidson  <beidson@apple.com>
1436
1437         WebKit policy delegate should suggest if a navigation should be allowed to open URLs externally.
1438         rdar://problem/21025301 and https://bugs.webkit.org/show_bug.cgi?id=145280
1439         
1440         Reviewed by Alex Christensen.
1441
1442         * WebProcess/Plugins/PDF/PDFPlugin.mm:
1443         (WebKit::PDFPlugin::clickedLink):
1444         
1445         * WebProcess/Plugins/PluginView.cpp:
1446         (WebKit::PluginView::performFrameLoadURLRequest):
1447         (WebKit::PluginView::loadURL):
1448         
1449         * WebProcess/WebCoreSupport/WebContextMenuClient.cpp:
1450         (WebKit::WebContextMenuClient::searchWithGoogle):
1451         
1452         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1453         (WebKit::WebFrameLoaderClient::dispatchCreatePage):
1454         
1455         * WebProcess/WebPage/WebInspector.cpp:
1456         (WebKit::WebInspector::openInNewTab):
1457         
1458         * WebProcess/WebPage/WebPage.cpp:
1459         (WebKit::WebPage::loadURLInFrame):
1460         (WebKit::WebPage::loadRequest):
1461         (WebKit::WebPage::loadDataImpl):
1462         (WebKit::WebPage::navigateToPDFLinkWithSimulatedClick):
1463
1464 2015-06-02  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
1465
1466         REGRESSION(r185091): Crash happens on indexdb tests
1467         https://bugs.webkit.org/show_bug.cgi?id=145549
1468
1469         Reviewed by Csaba Osztrogonác.
1470
1471         r185091 caused crash on some indexeddb tests. The crash happens because IDBDatabaseError::create() doesn't
1472         dereference count by using ptr(). It makes a crash when dereferencing on ~Ref() destructor. To fix this issue,
1473         this patch uses leakRef() instead of ptr().
1474
1475         * WebProcess/Databases/IndexedDB/WebIDBServerConnection.cpp:
1476         (WebKit::WebIDBServerConnection::didCreateObjectStore):
1477         (WebKit::WebIDBServerConnection::didCreateIndex):
1478         (WebKit::WebIDBServerConnection::didDeleteIndex):
1479         (WebKit::WebIDBServerConnection::didPutRecord):
1480         (WebKit::WebIDBServerConnection::didGetRecord):
1481         (WebKit::WebIDBServerConnection::didOpenCursor):
1482         (WebKit::WebIDBServerConnection::didAdvanceCursor):
1483         (WebKit::WebIDBServerConnection::didIterateCursor):
1484         (WebKit::WebIDBServerConnection::didCount):
1485         (WebKit::WebIDBServerConnection::didDeleteRange):
1486         (WebKit::WebIDBServerConnection::didClearObjectStore):
1487         (WebKit::WebIDBServerConnection::didDeleteObjectStore):
1488         (WebKit::WebIDBServerConnection::didChangeDatabaseVersion):
1489
1490 2015-06-01  Enrica Casucci  <enrica@apple.com>
1491
1492         [iOS] Hardware Keyboard: All combinations for arrow keys with Shift do not extend the selection.
1493         https://bugs.webkit.org/show_bug.cgi?id=145538
1494         rdar://problem/18504199
1495
1496         Reviewed by Darin Adler.
1497
1498         The extend parameter was ignored in all the functions below.
1499
1500         * UIProcess/ios/WKContentViewInteraction.mm:
1501         (-[WKContentView _moveUp:withHistory:]):
1502         (-[WKContentView _moveDown:withHistory:]):
1503         (-[WKContentView _moveLeft:withHistory:]):
1504         (-[WKContentView _moveRight:withHistory:]):
1505         (-[WKContentView _moveToStartOfWord:withHistory:]):
1506         (-[WKContentView _moveToStartOfParagraph:withHistory:]):
1507         (-[WKContentView _moveToStartOfLine:withHistory:]):
1508         (-[WKContentView _moveToStartOfDocument:withHistory:]):
1509         (-[WKContentView _moveToEndOfWord:withHistory:]):
1510         (-[WKContentView _moveToEndOfParagraph:withHistory:]):
1511         (-[WKContentView _moveToEndOfLine:withHistory:]):
1512         (-[WKContentView _moveToEndOfDocument:withHistory:]):
1513
1514 2015-06-01  Anders Carlsson  <andersca@apple.com>
1515
1516         Use xpc_connection_set_oneshot_instance where possible
1517         https://bugs.webkit.org/show_bug.cgi?id=145535
1518         rdar://problem/21109994
1519
1520         Reviewed by Sam Weinig.
1521
1522         Use xpc_connection_set_oneshot_instance where possible; this will make sure that the 
1523         web process instances go away when the web process exits.
1524
1525         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
1526         (WebKit::connectToService):
1527         (WebKit::connectToReExecService):
1528
1529 2015-06-01  Enrica Casucci  <enrica@apple.com>
1530
1531         [iOS] Hardware Keyboard: Command + left arrow does not work.
1532         https://bugs.webkit.org/show_bug.cgi?id=145531
1533         rdar://problem/18576402
1534
1535         Reviewed by Anders Carlsson.
1536
1537         We were calling a non existent command (moveToStartOfLine) instead of
1538         moveToBeginningOfLine.
1539
1540         * UIProcess/ios/WKContentViewInteraction.mm:
1541         (-[WKContentView _moveToStartOfLine:withHistory:]):
1542
1543 2015-06-01  Brady Eidson  <beidson@apple.com>
1544
1545         Add WKTR support for "should open external URLs".
1546         https://bugs.webkit.org/show_bug.cgi?id=145505
1547
1548         Reviewed by Darin Adler.
1549
1550         Expose C-spi to allow WKTR to set this bit on new loads:
1551         * UIProcess/API/C/WKPage.cpp:
1552         (WKPageLoadURLWithShouldOpenExternalURLsPolicy):
1553         * UIProcess/API/C/WKPagePrivate.h:
1554         
1555         Expose the bit on NavigationAction for the policy delegate:        
1556         * WebProcess/InjectedBundle/API/c/WKBundleNavigationAction.cpp:
1557         (WKBundleNavigationActionGetShouldOpenExternalURLs):
1558         * WebProcess/InjectedBundle/API/c/WKBundleNavigationActionPrivate.h: Copied from Tools/WebKitTestRunner/WorkQueueManager.h.
1559
1560         * WebProcess/InjectedBundle/InjectedBundleNavigationAction.cpp:
1561         (WebKit::InjectedBundleNavigationAction::InjectedBundleNavigationAction):
1562         * WebProcess/InjectedBundle/InjectedBundleNavigationAction.h:
1563         (WebKit::InjectedBundleNavigationAction::shouldOpenExternalURLs):
1564     
1565         * WebKit2.xcodeproj/project.pbxproj:
1566
1567 2015-06-01  Gavin Barraclough  <barraclough@apple.com>
1568
1569         PDFs always think they're visible on iOS.
1570         https://bugs.webkit.org/show_bug.cgi?id=145493
1571         <rdar://problem/19668879>
1572
1573         Unreviewed roll-out.
1574
1575         Temporarily reverting this change – will need a workaround for test harness craziness.
1576
1577         * UIProcess/API/Cocoa/WKWebView.mm:
1578         (-[WKWebView didMoveToWindow]):
1579         (-[WKWebView setOpaque:]):
1580         * UIProcess/ios/WKContentView.mm:
1581         (-[WKContentView willMoveToWindow:]):
1582         (-[WKContentView didMoveToWindow]):
1583         (-[WKContentView browsingContextController]):
1584
1585 2015-06-01  Csaba Osztrogonác  <ossy@webkit.org>
1586
1587         [EFL] Remove unused const variable from EwkView.cpp
1588         https://bugs.webkit.org/show_bug.cgi?id=145512
1589
1590         Reviewed by Gyuyoung Kim.
1591
1592         * UIProcess/API/efl/EwkView.cpp:
1593
1594 2015-06-01  Csaba Osztrogonác  <ossy@webkit.org>
1595
1596         [cmake] Suppress unused parameter warnings in WebKit2 and TestNetscapePlugIn
1597         https://bugs.webkit.org/show_bug.cgi?id=145264
1598
1599         Reviewed by Carlos Garcia Campos.
1600
1601         * CMakeLists.txt: Use COMPILE_FLAGS instead of CMAKE_<C|CXX>_FLAGS to put -Wno-unused-parameter after -Wextra.
1602
1603 2015-05-31  Gavin Barraclough  <barraclough@apple.com>
1604
1605         PDFs always think they're visible on iOS.
1606         https://bugs.webkit.org/show_bug.cgi?id=145493
1607         <rdar://problem/19668879>
1608
1609         Reviewed by Andreas Kling.
1610
1611         The problem here is that WKContentView is currently responsible for notifying the WebPageProxy
1612         that the visibility may have changed, but when a PDF isn't showing the WKContentView isn't in
1613         the view hierarchy and doesn't receive the didMoveToWindow notifications – and the WKPDFView
1614         (which is in the view hierarchy) does not listen for these events.
1615
1616         Visibility of the page should really just track the visibility of the WKWebView (and when
1617         actually assessing the visibility it largely does - the page client checks the web view's
1618         visibility, bar a FIXME, and the foreground/background check, which needs to change).
1619         So notifications should really just come from the WKWebView.
1620
1621         The WKWebView already listens for the didMoveToWindow notification, it just was only updating
1622         the IsInWindow flag. Instead just update all flags, and the call to viewStateDidChange from
1623         WKContentView can just be removed.
1624
1625         There is one problem with this in that it would reverse the order of the calls to
1626         viewStateDidChange & _updateForScreen:, which would mean the the view would become visible before
1627         updating the screen pixel density. To fix this, move the call to _updateForScreen: to
1628         willMoveToWindow:, to ensure it occurs before the page becomes visible.
1629
1630         This will also change behavior on Mac for WKWebView clients, in coalescing all view state changes
1631         within the didMoveToWindow call. This is the direction we intended to go in anyway (the plan is
1632         to remove the mayHaveChanged argument from viewStateDidChange - we're currently adding unnecessary
1633         IPC traffic).
1634
1635         * UIProcess/API/Cocoa/WKWebView.mm:
1636         (-[WKWebView didMoveToWindow]):
1637             - should update all view state flags.
1638         * UIProcess/ios/WKContentView.mm:
1639         (-[WKContentView willMoveToWindow:]):
1640             - should _updateForScreen:
1641         (-[WKContentView didMoveToWindow]): Deleted.
1642             - functionality moved to -[WKWebView didMoveToWindow], -[WKContentView didMoveToWindow].
1643
1644 2015-05-30  Brady Eidson  <beidson@apple.com>
1645
1646         Make FrameLoader methods that take PassRefPtr<Event> take raw pointers instead.
1647         https://bugs.webkit.org/show_bug.cgi?id=145495
1648
1649         Reviewed by Alexey Proskuryakov.
1650
1651         * WebProcess/WebPage/WebPage.cpp:
1652         (WebKit::WebPage::navigateToPDFLinkWithSimulatedClick):
1653
1654 2015-05-29  Joseph Pecoraro  <pecoraro@apple.com>
1655
1656         Web Inspector: Crash closing a related tab with Web Inspector open while page is refreshing
1657         https://bugs.webkit.org/show_bug.cgi?id=145488
1658
1659         Reviewed by Alexey Proskuryakov.
1660
1661         * WebProcess/WebPage/WebInspector.h:
1662         * WebProcess/WebPage/WebInspector.cpp:
1663         (WebKit::WebInspector::~WebInspector):
1664         Ensure, no matter how we close, that we have invalidated the
1665         frontend connection of which we are the client.
1666
1667         (WebKit::WebInspector::createInspectorPage):
1668         This member variable will never be null.
1669
1670 2015-05-29  Andreas Kling  <akling@apple.com>
1671
1672         [iOS] When bouncing back from max pinch zoom scale, scaleChangeRate should be 0.
1673         <https://webkit.org/b/145487>
1674         <rdar://problem/20989389>
1675
1676         Reviewed by Benjamin Poulain.
1677
1678         Make sure we don't send WebCore some velocity data with non-zero scaleChangeRate
1679         when we bounce back from being pinch-zoomed past the maximum scale.
1680
1681         This fixes an issue where the bounce-back animation would cause a burst of
1682         unnecessary tile generation.
1683
1684         * WebProcess/WebPage/ios/WebPageIOS.mm:
1685         (WebKit::adjustVelocityDataForBoundedScale):
1686         (WebKit::WebPage::updateVisibleContentRects):
1687
1688 2015-05-29  Jon Lee  <jonlee@apple.com>
1689
1690         Fix preferences for wireless playback
1691         https://bugs.webkit.org/show_bug.cgi?id=145477
1692         rdar://problem/21166767
1693
1694         Reviewed by Anders Carlsson.
1695
1696         * UIProcess/API/C/WKPreferences.cpp: Add missing preference calls in C API.
1697         * UIProcess/API/C/WKPreferencesRef.h:
1698
1699 2015-05-29  Enrica Casucci  <enrica@apple.com>
1700
1701         [iOS] Cursor hidden in text area once it scrolls.
1702         https://bugs.webkit.org/show_bug.cgi?id=145451
1703         rdar://problem/20356413
1704
1705         Reviewed by Simon Fraser.
1706
1707         This patch fixes both the touch scrolling inside the
1708         overflow area as well as the programmatic scroll that
1709         occurs when inserting a new line. The first issue is fixed by
1710         implementing the chrome client methods didLayout,
1711         didStartOverflowScroll and didEndOverflowScroll. The second
1712         required changing the implementation of notifyRevealedSelectionByScrollingFrame.
1713         We not only need to notify the client to redraw the selection,
1714         but we also need to recompute the editorState, because scrolling
1715         might have occurred.
1716         I've removed the NotifyRevealedSelection message that was not needed
1717         any longer, since EditorStateChanged will do exactly what we want.
1718
1719         * UIProcess/WebPageProxy.h:
1720         * UIProcess/WebPageProxy.messages.in:
1721         * UIProcess/ios/WebPageProxyIOS.mm:
1722         (WebKit::WebPageProxy::editorStateChanged):
1723         (WebKit::WebPageProxy::notifyRevealedSelection): Deleted.
1724         * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
1725         (WebKit::WebChromeClient::notifyRevealedSelectionByScrollingFrame):
1726         (WebKit::WebChromeClient::didLayout):
1727         (WebKit::WebChromeClient::didStartOverflowScroll):
1728         (WebKit::WebChromeClient::didEndOverflowScroll):
1729
1730 2015-05-29  Chris Dumez  <cdumez@apple.com>
1731
1732         [iOS] Update WebContent process sandbox profile for AWD logging
1733         https://bugs.webkit.org/show_bug.cgi?id=145473
1734         <rdar://problem/20543269>
1735
1736         Reviewed by Darin Adler.
1737
1738         Update WebContent process sandbox profile for AWD logging.
1739
1740         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
1741
1742 2015-05-29  Anders Carlsson  <andersca@apple.com>
1743
1744         WebKit.framework installs or references Mac-only headers on iOS
1745         https://bugs.webkit.org/show_bug.cgi?id=145471
1746         rdar://problem/21161459
1747
1748         Reviewed by Dan Bernstein.
1749
1750         * UIProcess/API/C/mac/WKInspectorPrivateMac.h:
1751         Add an #if !TARGET_OS_IPHONE guard around the entire header.
1752
1753 2015-05-29  Anders Carlsson  <andersca@apple.com>
1754
1755         WKScriptMessageInternal.h should be a project header, not a private header
1756         https://bugs.webkit.org/show_bug.cgi?id=145464
1757         rdar://problem/21161639
1758
1759         Reviewed by Dan Bernstein.
1760
1761         * WebKit2.xcodeproj/project.pbxproj:
1762
1763 2015-05-28  Alexey Proskuryakov  <ap@apple.com>
1764
1765         Clean up VisitedLinkProvider teardown
1766         https://bugs.webkit.org/show_bug.cgi?id=145450
1767         rdar://problem/20244726
1768
1769         Reviewed by Brady Eidson.
1770
1771         * UIProcess/VisitedLinkProvider.cpp:
1772         (WebKit::VisitedLinkProvider::~VisitedLinkProvider):
1773
1774 2015-05-28  Brady Eidson  <beidson@apple.com>
1775
1776         Change method of signaling "should open external urls" to WebKit.
1777         https://bugs.webkit.org/show_bug.cgi?id=145454
1778
1779         Reviewed by Dan Bernstein.
1780
1781         Making this a property on the request was never a good idea.
1782
1783         Adding a new extensible load SPI seems much better.
1784
1785         * Shared/API/Cocoa/_WKNSURLRequestExtras.h: Removed.
1786         * Shared/API/Cocoa/_WKNSURLRequestExtras.mm: Removed.
1787
1788         * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
1789         (-[WKBrowsingContextController loadRequest:userData:]): Since this API is deprecated,
1790           it always gets the default restrictive behavior.
1791
1792         * UIProcess/API/Cocoa/WKWebView.mm:
1793         (-[WKWebView loadRequest:]):
1794         (-[WKWebView loadRequest:withOptions:]): Take an options dictionary that, for now, 
1795           only supports one option.
1796         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1797
1798         * WebKit2.xcodeproj/project.pbxproj:
1799
1800 2015-05-28  Anders Carlsson  <andersca@apple.com>
1801
1802         Make sure that we create the private WebKit.framework symlinks last
1803         https://bugs.webkit.org/show_bug.cgi?id=145442
1804         <rdar://problem/21142213>
1805
1806         Reviewed by Dan Bernstein.
1807
1808         Move the "Add Symlinks in /System/Library/PrivateFrameworks/WebKit.framework" build phase to
1809         the "All" aggregate target. Also update the script now that INSTALL_PATH is different.
1810
1811         * WebKit2.xcodeproj/project.pbxproj:
1812
1813 2015-05-28  Said Abou-Hallawa  <sabouhallawa@apple.com>
1814
1815         Code clean up for extracting information from the mix of WritingMode and TextDirection
1816         https://bugs.webkit.org/show_bug.cgi?id=143399
1817
1818         Reviewed by Darin Adler.
1819
1820         * Shared/WebPopupItem.h:
1821         * UIProcess/API/C/efl/WKAPICastEfl.h:
1822         * UIProcess/WebPopupMenuProxy.h:
1823         enum TextDirection is moved from TextFlags.h to WritingMode.h. So include
1824         WritingMode.h instead of including TextFlags.h.
1825
1826 2015-05-28  Antti Koivisto  <antti@apple.com>
1827
1828         Disable network cache for old clients
1829         https://bugs.webkit.org/show_bug.cgi?id=145418
1830
1831         Reviewed by Andreas Kling.
1832
1833         Follow-up: Don't do linked-on-or-after checks for iOS Safari.
1834
1835         * UIProcess/Cocoa/VersionChecks.mm:
1836         (WebKit::linkTimeVersion):
1837         (WebKit::linkedOnOrAfter):
1838
1839 2015-05-28  Matt Rajca  <mrajca@apple.com>
1840
1841         Add ENABLE_MEDIA_SESSION feature flag (which is off by default).
1842         https://bugs.webkit.org/show_bug.cgi?id=145415
1843
1844         Reviewed by Eric Carlson.
1845
1846         * Configurations/FeatureDefines.xcconfig:
1847
1848 2015-05-28  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
1849
1850         Unreviewed, Fix build break since r184930.
1851
1852         * UIProcess/Storage/StorageManager.cpp:
1853         (WebKit::StorageManager::createTransientLocalStorageMap): Pass a pointer of SecurityOrigin
1854         in isSameSchemeHostPort().
1855
1856 2015-05-28  Zan Dobersek  <zdobersek@igalia.com>
1857
1858         Unreviewed. Fixing the build after r184950.
1859
1860         * UIProcess/Storage/StorageManager.cpp:
1861         (WebKit::StorageManager::createSessionStorageMap): getOrCreateStorageArea()
1862         now expects a Ref<WebCore::SecurityOrigin> object.
1863
1864 2015-05-28  Zan Dobersek  <zdobersek@igalia.com>
1865
1866         [WK2] Handle WebCore::SecurityOrigin objects through Ref<> where possible
1867         https://bugs.webkit.org/show_bug.cgi?id=145373
1868
1869         Reviewed by Andreas Kling.
1870
1871         WebCore::SecurityOrigin creation functions in most cases return a
1872         Ref<WebCore::SecurityOrigin> object. In the WebKit2 layer, those objects
1873         were still largely converted to RefPtr<>s.
1874
1875         This patch switches to using Ref<> where possible. The remaining uses of
1876         RefPtr<WebCore::SecurityOrigin> are present due to HashTables, to-be-copied
1877         Vectors, WebCore::DatabaseManager::origins() API and code where non-null
1878         WebCore::SecurityOrigin can't be guaranteed.
1879
1880         * DatabaseProcess/DatabaseProcess.cpp:
1881         (WebKit::DatabaseProcess::deleteIndexedDatabaseEntriesForOrigin):
1882         * NetworkProcess/NetworkProcess.cpp:
1883         (WebKit::cfURLCacheOrigins):
1884         * UIProcess/Storage/LocalStorageDatabase.cpp:
1885         (WebKit::LocalStorageDatabase::create):
1886         (WebKit::LocalStorageDatabase::LocalStorageDatabase):
1887         (WebKit::LocalStorageDatabase::openDatabase):
1888         (WebKit::LocalStorageDatabase::close):
1889         * UIProcess/Storage/LocalStorageDatabase.h:
1890         * UIProcess/Storage/LocalStorageDatabaseTracker.cpp:
1891         (WebKit::LocalStorageDatabaseTracker::origins):
1892         * UIProcess/Storage/LocalStorageDatabaseTracker.h:
1893         * UIProcess/Storage/StorageManager.cpp:
1894         (WebKit::StorageManager::StorageArea::securityOrigin):
1895         (WebKit::StorageManager::TransientLocalStorageNamespace::getOrCreateStorageArea):
1896         (WebKit::StorageManager::TransientLocalStorageNamespace::origins):
1897         (WebKit::StorageManager::TransientLocalStorageNamespace::clearStorageAreasMatchingOrigin):
1898         (WebKit::StorageManager::StorageArea::create):
1899         (WebKit::StorageManager::StorageArea::StorageArea):
1900         (WebKit::StorageManager::StorageArea::openDatabaseAndImportItemsIfNeeded):
1901         (WebKit::StorageManager::LocalStorageNamespace::getOrCreateStorageArea):
1902         (WebKit::StorageManager::LocalStorageNamespace::didDestroyStorageArea):
1903         (WebKit::StorageManager::SessionStorageNamespace::origins):
1904         (WebKit::StorageManager::SessionStorageNamespace::clearStorageAreasMatchingOrigin):
1905         (WebKit::StorageManager::SessionStorageNamespace::getOrCreateStorageArea):
1906         * UIProcess/WebPageProxy.cpp:
1907         (WebKit::WebPageProxy::reachedApplicationCacheOriginQuota):
1908         * WebProcess/ApplicationCache/WebApplicationCacheManager.cpp:
1909         (WebKit::WebApplicationCacheManager::getApplicationCacheOrigins):
1910         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1911         (WebKit::InjectedBundle::setApplicationCacheOriginQuota):
1912         (WebKit::InjectedBundle::resetApplicationCacheOriginQuota):
1913         * WebProcess/ResourceCache/WebResourceCacheManager.cpp:
1914         (WebKit::WebResourceCacheManager::returnCacheOrigins):
1915         (WebKit::WebResourceCacheManager::clearCacheForOrigin):
1916         * WebProcess/WebCoreSupport/WebDatabaseManager.cpp:
1917         (WebKit::WebDatabaseManager::deleteDatabaseWithNameForOrigin):
1918         (WebKit::WebDatabaseManager::deleteDatabasesForOrigin):
1919         (WebKit::WebDatabaseManager::setQuotaForOrigin):
1920
1921 2015-05-19  Jon Honeycutt  <jhoneycutt@apple.com>
1922
1923         [iOS] When viewing an MJPEG stream as the main resource, only the first
1924         frame paints
1925
1926         <https://bugs.webkit.org/show_bug.cgi?id=145185>
1927         <rdar://problem/20124694>
1928
1929         Reviewed by Darin Adler.
1930
1931         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1932         (WebKit::WebFrameLoaderClient::willReplaceMultipartContent):
1933         Tell the WebPage that we will replace multipart content.
1934
1935         (WebKit::WebFrameLoaderClient::didReplaceMultipartContent):
1936         Tell the WebPage that we did replace multipart content.
1937
1938         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
1939         * WebProcess/WebPage/DrawingArea.h:
1940
1941         * WebProcess/WebPage/WebPage.cpp:
1942         (WebKit::WebPage::willReplaceMultipartContent):
1943         Save the exposed content rect.
1944         (WebKit::WebPage::didReplaceMultipartContent):
1945         Restore the exposed content rect that was saved before this load. This
1946         fixes the issue for WK2.
1947
1948         * WebProcess/WebPage/WebPage.h:
1949
1950         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
1951         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
1952         (WebKit::RemoteLayerTreeDrawingArea::exposedContentRect):
1953
1954 2015-05-22  Jon Lee  <jonlee@apple.com>
1955
1956         Fix macros for wireless playback
1957         https://bugs.webkit.org/show_bug.cgi?id=145239
1958         rdar://problem/21049541
1959
1960         Reviewed by Anders Carlsson.
1961
1962         Encompass the logic within ENABLE(WIRELESS_TARGET_PLAYBACK). Update property name.
1963
1964         * UIProcess/API/Cocoa/WKWebView.mm:
1965         (-[WKWebView initWithFrame:configuration:]):
1966         * UIProcess/API/Cocoa/WKWebViewConfiguration.h: Update names. Add a WKDeprecated
1967         category section.
1968         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
1969         (-[WKWebViewConfiguration init]): Update name of variables to reflect new property names.
1970         (-[WKWebViewConfiguration copyWithZone:]): Ditto.
1971         (-[WKWebViewConfiguration mediaPlaybackAllowsAirPlay]): Get and set off of the new
1972         variable.
1973         (-[WKWebViewConfiguration setMediaPlaybackAllowsAirPlay:]): Ditto.
1974         (-[WKWebViewConfiguration mediaPlaybackRequiresUserAction]): Ditto.
1975         (-[WKWebViewConfiguration setMediaPlaybackRequiresUserAction:]): Ditto.
1976
1977 2015-05-27  Brady Eidson  <beidson@apple.com>
1978
1979         Add a "should open urls externally" flag to DocumentLoader.
1980         rdar://problem/21025301 and https://bugs.webkit.org/show_bug.cgi?id=145417
1981
1982         Reviewed by Geoff Garen.
1983
1984         Rename "user initiated" to "should open external URLs":
1985         * Shared/API/Cocoa/_WKNSURLRequestExtras.h:
1986         * Shared/API/Cocoa/_WKNSURLRequestExtras.mm:
1987         (-[NSURLRequest _web_shouldOpenExternalURLs]):
1988         (-[NSMutableURLRequest _web_setShouldOpenExternalURLs:]):
1989         (-[NSURLRequest _web_isUserInitiated]): Deleted.
1990         (-[NSMutableURLRequest _web_setIsUserInitiated:]): Deleted.
1991         
1992         Hold the new flag as a bool, and encode/decode it across IPC:
1993         * Shared/NavigationActionData.cpp:
1994         (WebKit::NavigationActionData::encode):
1995         (WebKit::NavigationActionData::decode):
1996         (WebKit::NavigationActionData::NavigationActionData): Deleted.
1997         * Shared/NavigationActionData.h:
1998
1999         * UIProcess/API/APINavigationAction.h: Add accessor for the bool flag.
2000
2001         * UIProcess/API/C/WKPage.cpp:
2002         (WKPageLoadURLWithUserData): Use "ShouldNotAllow" in the legacy C API for now.
2003         (WKPageLoadURLRequestWithUserData): Ditto.
2004
2005         * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
2006         (-[WKBrowsingContextController loadRequest:userData:]): Set the value of the flag
2007           based on whether or not the initiating NSURLRequest was user initiated.
2008
2009         * UIProcess/API/Cocoa/WKNavigationAction.mm:
2010         (-[WKNavigationAction _shouldOpenExternalURLs]): Add accessor for the bool flag.
2011         * UIProcess/API/Cocoa/WKNavigationActionPrivate.h:
2012
2013         * UIProcess/API/Cocoa/WKWebView.mm:
2014         (-[WKWebView loadRequest:]): Set the value of the flag based on whether or not the
2015           initiating NSURLRequest was user initiated.
2016
2017         * UIProcess/WebPageProxy.cpp:
2018         (WebKit::WebPageProxy::loadRequest): Pass the value down to the WebProcess to load.
2019         (WebKit::WebPageProxy::loadFile): Ditto, but always with "ShouldNotAllow".
2020         * UIProcess/WebPageProxy.h:
2021
2022         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2023         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): Translate 
2024           the NavigationAction flag to a bool in the NavigationActionData object.
2025
2026         * WebProcess/WebPage/WebPage.cpp:
2027         (WebKit::WebPage::loadRequest): Set the value of the flag in the FrameLoadRequest that
2028           will be loaded.
2029         * WebProcess/WebPage/WebPage.h:
2030         * WebProcess/WebPage/WebPage.messages.in:
2031
2032 2015-05-27  Anders Carlsson  <andersca@apple.com>
2033
2034         Can't load local files in WKWebView from containerized app
2035         https://bugs.webkit.org/show_bug.cgi?id=145424
2036         rdar://problem/20831176
2037
2038         Reviewed by Dan Bernstein.
2039
2040         Allow the network process to load local files from its bundle as long as it has
2041         the sandbox extensions to do so.
2042
2043         This was originally added to only allow SSO to read the Info.plist inside its own application
2044         bundle, but being able to read the application bundle from within the network process should be OK.
2045
2046         * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
2047
2048 2015-05-27  Andreas Kling  <akling@apple.com>
2049
2050         [WK2] Local storage areas should get torn down when they have no remaining references.
2051         <https://webkit.org/b/143339>
2052         <rdar://problem/20156436>
2053
2054         Reviewed by Darin Adler.
2055
2056         Let StorageNamespaceImpl own its StorageAreaMaps weakly instead of through RefPtr.
2057         Ownership is flipped so that StorageAreaMap refs the StorageNamespaceImpl instead.
2058         This allows the StorageAreaMaps to get destroyed once all of its clients are gone.
2059
2060         Practically speaking, this means that the garbage collector now decides when local
2061         storage databases can be closed, instead of us keeping them open for the lifetime
2062         of the web process.
2063
2064         For session storage, it works a bit differently. In the web process, they get torn
2065         down when their last client disappears, but they stay alive in the UI process.
2066         If/when the web process asks the UI process to open session storage for an origin,
2067         the UI process checks if one already exists, and if so, just updates the ID of the
2068         old storage with the new one provided by the web process.
2069
2070         * UIProcess/Storage/StorageManager.cpp:
2071         (WebKit::StorageManager::StorageArea::isSessionStorage):
2072         (WebKit::StorageManager::createTransientLocalStorageMap):
2073         (WebKit::StorageManager::createSessionStorageMap):
2074         (WebKit::StorageManager::destroyStorageMap):
2075         * WebProcess/Storage/StorageAreaImpl.cpp:
2076         (WebKit::StorageAreaImpl::securityOrigin):
2077         * WebProcess/Storage/StorageAreaImpl.h:
2078         * WebProcess/Storage/StorageAreaMap.cpp:
2079         (WebKit::StorageAreaMap::StorageAreaMap):
2080         (WebKit::StorageAreaMap::~StorageAreaMap):
2081         * WebProcess/Storage/StorageAreaMap.h:
2082         (WebKit::StorageAreaMap::securityOrigin):
2083         * WebProcess/Storage/StorageNamespaceImpl.cpp:
2084         (WebKit::StorageNamespaceImpl::didDestroyStorageAreaMap):
2085         (WebKit::StorageNamespaceImpl::storageArea):
2086         * WebProcess/Storage/StorageNamespaceImpl.h:
2087
2088 2015-05-27  Antti Koivisto  <antti@apple.com>
2089
2090         Disable network cache for old clients
2091         https://bugs.webkit.org/show_bug.cgi?id=145418
2092         rdar://problem/21126587
2093
2094         Reviewed by Andy Estes.
2095
2096         Old clients might use NSURLCache API to clear the cache. New cache requires use of new APIs.
2097
2098         * UIProcess/Cocoa/VersionChecks.h: Added.
2099         * UIProcess/Cocoa/VersionChecks.mm: Added.
2100
2101             Add linked-on-or-after check mechanism similar to WebKit1.
2102
2103         (WebKit::linkTimeVersion):
2104         (WebKit::linkedOnOrAfter):
2105         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2106         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
2107
2108             Use it when deciding whether to enable the cache.
2109
2110         * WebKit2.xcodeproj/project.pbxproj:
2111
2112 2015-05-27  Dean Jackson  <dino@apple.com>
2113
2114         img.currentSrc problem in strict mode with old picturefill
2115         https://bugs.webkit.org/show_bug.cgi?id=144095
2116         <rdar://problem/21087013>
2117
2118         Reviewed by Simon Fraser.
2119
2120         Add a PICTURE_SIZES flag.
2121
2122         * Configurations/FeatureDefines.xcconfig:
2123
2124 2015-05-27  Chris Dumez  <cdumez@apple.com>
2125
2126         Assertion hit in WebPage::didChangeSelection()
2127         https://bugs.webkit.org/show_bug.cgi?id=145413
2128         <rdar://problem/21001129>
2129
2130         Reviewed by Ryosuke Niwa.
2131
2132         We sometimes hit the "ASSERT(layoutCount == view->layoutCount())"
2133         assertion in WebPage::didChangeSelection(). We manage to prevent
2134         synchronous layouts in most cases when calling editorState(). However,
2135         it seems it can still happen in some cases. Crashing in this case seems
2136         overkill and can be annoying to other developers, especially
2137         considering the implications are only on performance.
2138
2139         This patch drops the assertion.
2140
2141         * WebProcess/WebPage/WebPage.cpp:
2142         (WebKit::WebPage::didChangeSelection): Deleted.
2143
2144 2015-05-27  Anders Carlsson  <andersca@apple.com>
2145
2146         Address a follow-up review comment from Darin.
2147
2148         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2149         (WebKit::WebsiteDataStore::removeMediaKeys):
2150
2151 2015-05-26  Anders Carlsson  <andersca@apple.com>
2152
2153         WKWebsiteDataStore should handle media keys
2154         https://bugs.webkit.org/show_bug.cgi?id=145394
2155         rdar://problem/20617794.
2156
2157         Reviewed by Darin Adler.
2158
2159         * Shared/WebsiteData/WebsiteDataTypes.h:
2160         Add WebsiteDataTypeMediaKeys enum.
2161
2162         * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
2163         (API::WebsiteDataStore::defaultDataStoreConfiguration):
2164         Set up mediaKeysStorageDirectory.
2165
2166         * UIProcess/API/Cocoa/WKWebsiteDataRecord.mm:
2167         (dataTypesToString):
2168         * UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h:
2169         (WebKit::toWebsiteDataTypes):
2170         (WebKit::toWKWebsiteDataTypes):
2171         * UIProcess/API/Cocoa/WKWebsiteDataRecordPrivate.h: Added.
2172         Add _WKWebsiteDataTypeMediaKeys.
2173
2174         * UIProcess/WebProcessPool.cpp:
2175         (WebKit::legacyWebsiteDataStoreConfiguration):
2176         Set up mediaKeysStorageDirectory.
2177
2178         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2179         (WebKit::WebsiteDataStore::WebsiteDataStore):
2180         Set m_mediaKeysStorageDirectory.
2181
2182         (WebKit::WebsiteDataStore::fetchData):
2183         Make CallbackAggregator ThreadSafeRefCounted.
2184         Handle WebsiteDataTypeMediaKeys by calling mediaKeyOrigins on our background queue.
2185
2186         (WebKit::WebsiteDataStore::removeData):
2187         Make CallbackAggregator ThreadSafeRefCounted.
2188         Handle WebsiteDataTypeMediaKeys by calling removeMediaKeys on our background queue.
2189
2190         (WebKit::WebsiteDataStore::mediaKeyOrigins):
2191         Compute the origins.
2192
2193         (WebKit::computeMediaKeyFile):
2194         Add helper function that returns the media key given a containing directory.
2195
2196         (WebKit::WebsiteDataStore::removeMediaKeys):
2197         Remove media key files.
2198
2199         * UIProcess/WebsiteData/WebsiteDataStore.h:
2200         Add new members.
2201
2202         * WebKit2.xcodeproj/project.pbxproj:
2203         Add new files.
2204
2205 2015-05-27  Carlos Garcia Campos  <cgarcia@igalia.com>
2206
2207         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.9.2 release.
2208
2209         * gtk/NEWS: Add release notes for 2.9.2.
2210
2211 2015-05-27  Carlos Garcia Campos  <cgarcia@igalia.com>
2212
2213         [SOUP] Network Cache: Handle the case when we fail to create the IO stream
2214         https://bugs.webkit.org/show_bug.cgi?id=145406
2215
2216         Reviewed by Sergio Villar Senin.
2217
2218         We were asserting in that case, but it can happen that we
2219         fail to create the stream. It happened to me after r184690, that
2220         changed the NetworkCache::Key hash. Since this was not expected to
2221         happen, the async operation never finished and the completion
2222         handler never called, leaving resources loading forever. We
2223         should make sure we call the completion handler with an error
2224         code, so that the load finishes and the entry is silently removed
2225         from the cache.
2226
2227         * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:
2228         (WebKit::NetworkCache::IOChannel::read):
2229         (WebKit::NetworkCache::IOChannel::readSync):
2230         (WebKit::NetworkCache::IOChannel::write):
2231
2232 2015-05-26  Carlos Garcia Campos  <cgarcia@igalia.com>
2233
2234         Network Cache: Add cache capacity to the totals of JSON file
2235         https://bugs.webkit.org/show_bug.cgi?id=145246
2236
2237         Reviewed by Antti Koivisto.
2238
2239         * NetworkProcess/cache/NetworkCache.cpp:
2240         (WebKit::NetworkCache::Cache::dumpContentsToFile):
2241         * NetworkProcess/cache/NetworkCacheStorage.h:
2242         (WebKit::NetworkCache::Storage::capacity):
2243
2244 2015-05-26  Anders Carlsson  <andersca@apple.com>
2245
2246         Add a symlink for every file inside /S/L/F/WebKit.framework to the PrivateFrameworks mirror.
2247
2248         rdar://problem/21111232.
2249
2250         Reviewed by Dan Bernstein.
2251
2252         * WebKit2.xcodeproj/project.pbxproj:
2253
2254 2015-05-26  Hunseop Jeong  <hs85.jeong@samsung.com>
2255
2256         [EFL] webview should be updated from (0,0) when using the evasGL.
2257         https://bugs.webkit.org/show_bug.cgi?id=137948
2258
2259         Reviewed by Gyuyoung Kim.
2260
2261         Changed the point of the start position to update the evasObject
2262         correctly when using the evasGL for graphics backend.
2263
2264         * UIProcess/API/efl/EwkView.cpp:
2265         (EwkView::displayTimerFired):
2266
2267 2015-05-26  Dan Bernstein  <mitz@apple.com>
2268
2269         <rdar://problem/21104551> Update build settings
2270
2271         Reviewed by Anders Carlsson.
2272
2273         * Configurations/DebugRelease.xcconfig:
2274         * Configurations/FeatureDefines.xcconfig:
2275         * Configurations/Version.xcconfig:
2276         * Configurations/WebContentService.Development.xcconfig:
2277         * Configurations/WebContentService.xcconfig:
2278
2279 2015-05-26  Milan Crha  <mcrha@redhat.com>
2280
2281         [GTK] Expand wildcards inside generate-inspector-gresource-manifest.py
2282         https://bugs.webkit.org/show_bug.cgi?id=138134
2283
2284         Reviewed by Žan Doberšek.
2285
2286         * PlatformGTK.cmake: Command line with expanded resources exceeds 32KB, which
2287         is a limit on Windows. It's better to expand wildcards inside the python script.
2288
2289 2015-05-25  Dan Bernstein  <mitz@apple.com>
2290
2291         ASSERT_MAIN_THREAD and DOM_ASSERT_MAIN_THREAD are unnecessary no-ops
2292         https://bugs.webkit.org/show_bug.cgi?id=145372
2293
2294         Reviewed by Sam Weinig.
2295
2296         * Configurations/Base.xcconfig: Removed DISABLE_THREAD_CHECK from DEBUG_DEFINES.
2297
2298 2015-05-25  Carlos Garcia Campos  <cgarcia@igalia.com>
2299
2300         [GTK] Add construct property to WebKitWebContext to set the IndexedDB database directory
2301         https://bugs.webkit.org/show_bug.cgi?id=140882
2302
2303         Reviewed by Gustavo Noronha Silva.
2304
2305         Add WebKitWebContext:indexed-db-database-directory construct only property.
2306
2307         * UIProcess/API/gtk/WebKitWebContext.cpp:
2308         (webkitWebContextGetProperty):
2309         (webkitWebContextSetProperty):
2310         (webkitWebContextConstructed):
2311         (webkit_web_context_class_init):
2312
2313 2015-05-24  Sam Weinig  <sam@webkit.org>
2314
2315         Crash when using a removed ScriptMessageHandler
2316         <rdar://problem/20888499>
2317         https://bugs.webkit.org/show_bug.cgi?id=145359
2318
2319         Reviewed by Dan Bernstein.
2320
2321         * WebProcess/UserContent/WebUserContentController.cpp:
2322         (WebKit::WebUserMessageHandlerDescriptorProxy::~WebUserMessageHandlerDescriptorProxy):
2323         Invalidate the descriptor when the message handler client (as implemented by WebUserMessageHandlerDescriptorProxy)
2324         goes away. This will happen if a script message handler is removed at the API level or the WebUserContentController
2325         is destroyed (which will happen if all the pages get destroyed).
2326
2327 2015-05-23  Dan Bernstein  <mitz@apple.com>
2328
2329         <rdar://problem/21090327> /S/L/PrivateFrameworks/WebKit.framework is missing Headers and PrivateHeaders symlinks
2330         https://bugs.webkit.org/show_bug.cgi?id=145354
2331
2332         Reviewed by David Kilzer.
2333
2334         * WebKit2.xcodeproj/project.pbxproj: Create Headers and PrivateHeaders symlinks alongside
2335         the dylib symlink.
2336
2337 2015-05-23  Sungmann Cho  <sungmann.cho@navercorp.com>
2338
2339         Rename ShareableResource::create(Handle&) to map(Handle&) to match SharedMemory.
2340         https://bugs.webkit.org/show_bug.cgi?id=145288
2341
2342         Reviewed by Sam Weinig.
2343
2344         * Shared/ShareableResource.cpp:
2345         (WebKit::ShareableResource::Handle::tryWrapInSharedBuffer):
2346         (WebKit::ShareableResource::map):
2347         (WebKit::ShareableResource::create): Deleted.
2348         * Shared/ShareableResource.h:
2349
2350 2015-05-22  Jon Lee  <jonlee@apple.com>
2351
2352         Rename MediaPlaybackAllowsInline
2353         https://bugs.webkit.org/show_bug.cgi?id=145315
2354
2355         Reviewed by Eric Carlson.
2356
2357         Our API uses allowsInlineMediaPlayback. Our symbols should reflect the same.
2358
2359         * Shared/WebPreferencesDefinitions.h:
2360         * UIProcess/API/C/WKPreferences.cpp:
2361         (WKPreferencesSetMediaPlaybackAllowsInline): Update the call to preferences.
2362         The C API will not change in a future patch.
2363         (WKPreferencesGetMediaPlaybackAllowsInline): Ditto.
2364         * UIProcess/API/Cocoa/WKWebView.mm:
2365         (-[WKWebView initWithFrame:configuration:]): Update the name of the key.
2366         * WebProcess/WebPage/WebPage.cpp:
2367         (WebKit::WebPage::updatePreferences): Ditto.
2368
2369         * UIProcess/API/gtk/WebKitSettings.cpp: Update the call.
2370         (webkit_settings_get_media_playback_allows_inline):
2371         (webkit_settings_set_media_playback_allows_inline):
2372
2373 2015-05-22  Jon Lee  <jonlee@apple.com>
2374
2375         Rename MediaPlaybackAllowsAirPlay
2376         https://bugs.webkit.org/show_bug.cgi?id=145316
2377
2378         Reviewed by Eric Carlson.
2379
2380         In preparation for an API rename, update internal symbols from mediaPlaybackAllowsAirPlay
2381         to allowsAirPlayForMediaPlayback.
2382
2383         * Shared/WebPreferencesDefinitions.h: Update the name.
2384         * UIProcess/API/Cocoa/WKWebView.mm:
2385         (-[WKWebView initWithFrame:configuration:]): Ditto.
2386         * WebProcess/WebPage/WebPage.cpp:
2387         (WebKit::WebPage::updatePreferences): Update the call to settings.
2388
2389 2015-05-22  Jon Lee  <jonlee@apple.com>
2390
2391         Unreviewed GTK fix after r184802.
2392
2393         * UIProcess/API/gtk/WebKitSettings.cpp:
2394         (webkit_settings_get_media_playback_requires_user_gesture):
2395         (webkit_settings_set_media_playback_requires_user_gesture):
2396
2397 2015-05-22  Jon Lee  <jonlee@apple.com>
2398
2399         Rename MediaPlaybackRequiresUserGesture
2400         https://bugs.webkit.org/show_bug.cgi?id=145314
2401
2402         Reviewed by Anders Carlsson.
2403
2404         In preparation for an API rename, update internal symbols from mediaPlaybackRequiresUserGesture
2405         to requiresUserGestureForMediaPlayback.
2406
2407         No changes are being made to the API in this patch.
2408
2409         * Shared/WebPreferencesDefinitions.h: Update the name of the macro and the setting.
2410         * UIProcess/API/C/WKPreferences.cpp: The C API will not change in a future patch.
2411         (WKPreferencesSetMediaPlaybackRequiresUserGesture): Update the call to preferences.
2412         (WKPreferencesGetMediaPlaybackRequiresUserGesture): Ditto.
2413         * UIProcess/API/Cocoa/WKWebView.mm:
2414         (-[WKWebView initWithFrame:configuration:]): Update the name of the key.
2415         * WebProcess/WebPage/WebPage.cpp:
2416         (WebKit::WebPage::updatePreferences): Ditto.
2417
2418 2015-05-22  Commit Queue  <commit-queue@webkit.org>
2419
2420         Unreviewed, rolling out r183647.
2421         https://bugs.webkit.org/show_bug.cgi?id=145326
2422
2423         broke some toolbar blurring behavior (Requested by thorton on
2424         #webkit).
2425
2426         Reverted changeset:
2427
2428         "Asynchronous (or timed-out synchronous) resize flashes white
2429         instead of page background color"
2430         https://bugs.webkit.org/show_bug.cgi?id=144468
2431         http://trac.webkit.org/changeset/183647
2432
2433 2015-05-22  Yongjun Zhang  <yongjun_zhang@apple.com>
2434
2435         Image link doesn't create a preview view controller.
2436         https://bugs.webkit.org/show_bug.cgi?id=145320
2437
2438         Also try to create the preview view controller if the hit-tested node
2439         is a image link.
2440
2441         Reviewed by Beth Dakin.
2442
2443         * UIProcess/ios/WKContentViewInteraction.mm:
2444         (-[WKContentView gestureRecognizerShouldBegin:]):
2445         (-[WKContentView previewViewControllerForPosition:inSourceView:]):
2446
2447 2015-05-22  Tim Horton  <timothy_horton@apple.com>
2448
2449         Avoid doing an extra layout in some cases while doing scale-to-fit
2450         https://bugs.webkit.org/show_bug.cgi?id=145321
2451         <rdar://problem/21051165>
2452
2453         Reviewed by Beth Dakin.
2454
2455         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
2456         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
2457         (WebKit::TiledCoreAnimationDrawingArea::scaleViewToFitDocumentIfNeeded):
2458         If we make it to scaleViewToFitDocumentIfNeeded with valid layout,
2459         the view width is still less than the last-known minimum document size,
2460         and the document size hasn't changed, update the view scale without
2461         doing an extra layout, keeping the fixed layout size at the previously
2462         computed minimum document size.
2463
2464 2015-05-22  Beth Dakin  <bdakin@apple.com>
2465
2466         Yellow highlight and DD popover don't go away when scrolling an iframe
2467         https://bugs.webkit.org/show_bug.cgi?id=145312
2468         -and corresponding-
2469         rdar://problem/19692334
2470
2471         Reviewed by Tim Horton.
2472
2473         Match what Lookup already does for their popover and dismiss our popovers on 
2474         scroll.
2475         * UIProcess/API/mac/WKView.mm:
2476         (-[WKView scrollWheel:]):
2477
2478         This should not be needed anymore.
2479         * UIProcess/WebPageProxy.cpp:
2480         (WebKit::WebPageProxy::pageDidScroll):
2481
2482 2015-05-22  Tim Horton  <timothy_horton@apple.com>
2483
2484         Remove action menu support
2485         https://bugs.webkit.org/show_bug.cgi?id=145305
2486         <rdar://problem/21070771>
2487
2488         Reviewed by Anders Carlsson.
2489
2490         * Configurations/WebKit.xcconfig:
2491         * Shared/API/c/WKActionMenuItemTypes.h:
2492         * Shared/API/c/WKActionMenuTypes.h:
2493         * UIProcess/API/Cocoa/WKViewPrivate.h:
2494         * UIProcess/API/mac/WKView.mm:
2495         (-[WKView _didPerformImmediateActionHitTest:contentPreventsDefault:userData:]):
2496         (-[WKView dealloc]): Deleted.
2497         (-[WKView mouseDown:]): Deleted.
2498         (-[WKView initWithFrame:processPool:configuration:webView:]): Deleted.
2499         (-[WKView prepareForMenu:withEvent:]): Deleted.
2500         (-[WKView willOpenMenu:withEvent:]): Deleted.
2501         (-[WKView didCloseMenu:withEvent:]): Deleted.
2502         (-[WKView _didPerformActionMenuHitTest:forImmediateAction:contentPreventsDefault:userData:]): Deleted.
2503         (-[WKView _actionMenuItemsForHitTestResult:withType:defaultActionMenuItems:]): Deleted.
2504         (-[WKView _actionMenuItemsForHitTestResult:withType:defaultActionMenuItems:userData:]): Deleted.
2505         * UIProcess/API/mac/WKViewInternal.h:
2506         * UIProcess/PageClient.h:
2507         * UIProcess/WebPageProxy.cpp:
2508         (WebKit::WebPageProxy::performImmediateActionHitTestAtLocation):
2509         (WebKit::WebPageProxy::didPerformImmediateActionHitTest):
2510         (WebKit::WebPageProxy::performActionMenuHitTestAtLocation): Deleted.
2511         (WebKit::WebPageProxy::selectLastActionMenuRange): Deleted.
2512         (WebKit::WebPageProxy::focusAndSelectLastActionMenuHitTestResult): Deleted.
2513         (WebKit::WebPageProxy::didPerformActionMenuHitTest): Deleted.
2514         * UIProcess/WebPageProxy.h:
2515         * UIProcess/WebPageProxy.messages.in:
2516         * UIProcess/mac/PageClientImpl.h:
2517         * UIProcess/mac/PageClientImpl.mm:
2518         (WebKit::PageClientImpl::didPerformImmediateActionHitTest):
2519         (WebKit::PageClientImpl::didPerformActionMenuHitTest): Deleted.
2520         * UIProcess/mac/WKActionMenuController.h: Removed.
2521         * UIProcess/mac/WKActionMenuController.mm: Removed.
2522         * UIProcess/mac/WKImmediateActionController.h:
2523         * UIProcess/mac/WKImmediateActionController.mm:
2524         (-[WKImmediateActionController didPerformImmediateActionHitTest:contentPreventsDefault:userData:]):
2525         (-[WKImmediateActionController immediateActionRecognizerWillPrepare:]):
2526         (-[WKImmediateActionController immediateActionRecognizerWillBeginAnimation:]):
2527         (-[WKImmediateActionController didPerformActionMenuHitTest:contentPreventsDefault:userData:]): Deleted.
2528         * WebKit2.xcodeproj/project.pbxproj:
2529         * WebProcess/InjectedBundle/API/APIInjectedBundlePageContextMenuClient.h:
2530         (API::InjectedBundle::PageContextMenuClient::prepareForImmediateAction):
2531         (API::InjectedBundle::PageContextMenuClient::prepareForActionMenu): Deleted.
2532         * WebProcess/InjectedBundle/API/c/WKBundlePageContextMenuClient.h:
2533         * WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:
2534         * WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.h:
2535         * WebProcess/InjectedBundle/InjectedBundlePageContextMenuClient.cpp:
2536         (WebKit::InjectedBundlePageContextMenuClient::prepareForImmediateAction):
2537         (WebKit::InjectedBundlePageContextMenuClient::prepareForActionMenu): Deleted.
2538         * WebProcess/InjectedBundle/InjectedBundlePageContextMenuClient.h:
2539         * WebProcess/WebPage/WebPage.h:
2540         * WebProcess/WebPage/WebPage.messages.in:
2541         * WebProcess/WebPage/WebPageOverlay.cpp:
2542         (WebKit::WebPageOverlay::actionContextForResultAtPoint):
2543         * WebProcess/WebPage/WebPageOverlay.h:
2544         (WebKit::WebPageOverlay::Client::actionContextForResultAtPoint):
2545         * WebProcess/WebPage/mac/WebPageMac.mm:
2546         (WebKit::textIndicatorTransitionForImmediateAction):
2547         (WebKit::WebPage::performImmediateActionHitTestAtLocation):
2548         (WebKit::textIndicatorTransitionForActionMenu): Deleted.
2549         (WebKit::WebPage::performActionMenuHitTestAtLocation): Deleted.
2550         (WebKit::WebPage::selectLastActionMenuRange): Deleted.
2551         (WebKit::WebPage::focusAndSelectLastActionMenuHitTestResult): Deleted.
2552         Remove everything, except some enums that clients still refer to.
2553         Also, leave SPI that used to be shared between immediate actions and
2554         action menus intact, even if it had "action menu" in the name. We can
2555         deprecate and rename in another patch... except for the very recently-added
2556         support from r184106, which we'll revert entirely, removing WKBundlePageOverlayV2, 
2557         which was not adopted by any clients.
2558
2559 2015-05-22  Brady Eidson  <beidson@apple.com>
2560
2561         Rework how the ResourceRequest user initiated property key is used.
2562         Followup to https://bugs.webkit.org/show_bug.cgi?id=145281
2563
2564         Reviewed by Dan Bernstein.
2565
2566         * Shared/API/Cocoa/_WKNSURLRequestExtras.mm:
2567         (-[NSURLRequest _web_isUserInitiated]):
2568         (-[NSMutableURLRequest _web_setIsUserInitiated:]):
2569
2570         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
2571         (WKResourceRequestIsUserInitiatedKey): Deleted.
2572         (InitWebCoreSystemInterface): Deleted.
2573
2574 2015-05-21  Gavin Barraclough  <barraclough@apple.com>
2575
2576         Networking process sometimes suspended while WebContent runnable
2577         https://bugs.webkit.org/show_bug.cgi?id=145291
2578         <rdar://problem/21033029>
2579
2580         Reviewed by Andreas Kling.
2581
2582         There is an asymmetry in how the Networking process suspension is managed.
2583         We drop the assertion (& suspend the process) whenever the WebProcess says
2584         it is ready to suspend, but we only take the assertion (& resume execution)
2585         when the WebContent process is actually resumed. This leaves a race – where
2586         the WebContent process was willing to be suspended, but the UI app changed
2587         its mind suspending it. Since the WebContent process never actually suspended
2588         (we only prepared it to), we never send a resume, and since we never resume,
2589         we never wake the Networking process.
2590
2591         The fix is pretty clean. A web process should take a token on the networking
2592         process precisely whenever it holds an assertion on the web content process.
2593         This also enables a nice refinement, that when holding a BG assertion on the
2594         WebContent process we only need to hold a BG assertion on the networking
2595         process.
2596
2597         * UIProcess/Network/NetworkProcessProxy.cpp:
2598         (WebKit::NetworkProcessProxy::didSetAssertionState):
2599             - no-op
2600         * UIProcess/Network/NetworkProcessProxy.h:
2601             - added didSetAssertionState.
2602         * UIProcess/ProcessThrottler.cpp:
2603         (WebKit::ProcessThrottler::updateAssertionNow):
2604         (WebKit::ProcessThrottler::updateAssertion):
2605         (WebKit::ProcessThrottler::didConnectToProcess):
2606             - whenever taking/updating the assertion, inform the client via didSetAssertionState.
2607         * UIProcess/ProcessThrottlerClient.h:
2608             - added didSetAssertionState.
2609         * UIProcess/WebProcessProxy.cpp:
2610         (WebKit::WebProcessProxy::didFinishLaunching):
2611             removed initializeNetworkProcessActivityToken - this is taken via ProcessThrottler::didConnectToProcess.
2612         (WebKit::WebProcessProxy::sendProcessDidResume):
2613             - removed call to initializeNetworkProcessActivityToken - updated via didSetAssertionState.
2614         (WebKit::WebProcessProxy::processReadyToSuspend):
2615             - removed update of m_tokenForNetworkProcess - updated via didSetAssertionState.
2616         (WebKit::WebProcessProxy::didSetAssertionState):
2617             - update m_backgroundTokenForNetworkProcess/m_foregroundTokenForNetworkProcess.
2618         (WebKit::WebProcessProxy::initializeNetworkProcessActivityToken): Deleted.
2619             - updated via didSetAssertionState.
2620         * UIProcess/WebProcessProxy.h:
2621             - added didSetAssertionState, added separate FG/BG activity tokens for Networking process.
2622
2623 2015-05-22  Dan Bernstein  <mitz@apple.com>
2624
2625         Fixed the fix for <rdar://problem/20830673> Symlink the WebKit dylib instead of just the framework directory
2626         https://bugs.webkit.org/show_bug.cgi?id=145287
2627
2628         Reviewed by Anders Carlsson.
2629
2630         * WebKit2.xcodeproj/project.pbxproj: Give the symlink the correct destination.
2631
2632 2015-05-21  Brady Eidson  <beidson@apple.com>
2633
2634         Add an "initiated by user gesture" flag to ResourceRequest.
2635         https://bugs.webkit.org/show_bug.cgi?id=145281
2636
2637         Reviewed by Alex Christensen.
2638
2639         Expose a new category on NSURLRequest to allow SPI clients to easily set/get the flag:
2640         * Shared/API/Cocoa/_WKNSURLRequestExtras.h: Added.
2641         * Shared/API/Cocoa/_WKNSURLRequestExtras.mm: Added.
2642         (-[NSURLRequest _web_isUserInitiated]):
2643         (-[NSMutableURLRequest _web_setIsUserInitiated:]):
2644
2645         * WebKit2.xcodeproj/project.pbxproj:
2646
2647         Expose the new property key to WebCore:
2648         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
2649         (WKResourceRequestIsUserInitiatedKey):
2650         (InitWebCoreSystemInterface):
2651
2652 2015-05-21  Daniel Bates  <dabates@apple.com>
2653
2654         Rollout <http://trac.webkit.org/changeset/183909>
2655         (https://bugs.webkit.org/show_bug.cgi?id=144657)
2656
2657         Revert <http://trac.webkit.org/changeset/183909> since pausing the database
2658         thread prevents in-progress transactions from completing. We need to think
2659         about this change some more.
2660
2661         * UIProcess/WebPageProxy.h:
2662         * UIProcess/ios/WKContentView.mm:
2663         (-[WKContentView _applicationDidEnterBackground:]): Deleted.
2664         * UIProcess/ios/WebPageProxyIOS.mm:
2665         (WebKit::WebPageProxy::applicationDidEnterBackground): Deleted.
2666         * WebProcess/WebCoreSupport/WebDatabaseManager.cpp:
2667         (WebKit::WebDatabaseManager::setPauseAllDatabases): Deleted.
2668         * WebProcess/WebCoreSupport/WebDatabaseManager.h:
2669         * WebProcess/WebPage/WebPage.h:
2670         * WebProcess/WebPage/WebPage.messages.in:
2671         * WebProcess/WebPage/ios/WebPageIOS.mm:
2672         (WebKit::WebPage::applicationWillEnterForeground): Deleted.
2673         (WebKit::WebPage::applicationDidEnterBackground): Deleted.
2674
2675 2015-05-21  Enrica Casucci  <enrica@apple.com>
2676
2677         [iOS] Crash when taking a snapshot of a large PDF.
2678         https://bugs.webkit.org/show_bug.cgi?id=145286
2679         rdar://problem/20892362
2680
2681         Reviewed by Tim Horton.
2682
2683         The code for the PDF case was incorrectly computing the snapshot rect.
2684         On top of that drawViewHierarchyInRect was ignoring the rect and
2685         always creating an image using the view bounds causing the crash.
2686         We are now always using the IOSurface if we are parented or
2687         an image context when we are not.
2688
2689         * UIProcess/API/Cocoa/WKWebView.mm:
2690         (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]):
2691
2692 2015-05-21  Anders Carlsson  <andersca@apple.com>
2693
2694         Symlink the WebKit dylib instead of just the framework directory
2695         https://bugs.webkit.org/show_bug.cgi?id=145287
2696         rdar://problem/20830673
2697
2698         Reviewed by Dan Bernstein.
2699
2700         * WebKit2.xcodeproj/project.pbxproj:
2701
2702 2015-05-21  Anders Carlsson  <andersca@apple.com>
2703
2704         WKWebsiteDataStore doesn't track and remove iOS Safari's offline application cache entries
2705         https://bugs.webkit.org/show_bug.cgi?id=145279
2706         rdar://problem/20657912
2707
2708         Reviewed by Dan Bernstein.
2709
2710         Special-case iOS Safari and WebApp when computing the default application cache directory.
2711
2712         * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
2713         (API::applicationCacheDirectory):
2714         (API::WebsiteDataStore::defaultDataStoreConfiguration):
2715
2716 2015-05-21  Brian Weinstein  <bweinstein@apple.com>
2717
2718         Add a _WKWebKitContentExtensionStore initializer that takes a path.
2719         https://bugs.webkit.org/show_bug.cgi?id=145269 and work towards <rdar://problem/21031414>
2720
2721         Reviewed by Anders Carlsson.
2722
2723         * UIProcess/API/APIUserContentExtensionStore.cpp:
2724         (API::UserContentExtensionStore::storeWithPath):
2725         * UIProcess/API/APIUserContentExtensionStore.h:
2726         * UIProcess/API/Cocoa/_WKUserContentExtensionStore.h:
2727         * UIProcess/API/Cocoa/_WKUserContentExtensionStore.mm:
2728         (+[_WKUserContentExtensionStore storeWithURL:]):
2729
2730 2015-05-21  Alexey Proskuryakov  <ap@apple.com>
2731
2732         Build fix. Silence some deprecation warnings.
2733
2734         * UIProcess/ios/forms/WKFileUploadPanel.mm:
2735         (-[WKFileUploadPanel _presentPopoverWithContentViewController:animated:]):
2736         * UIProcess/ios/forms/WKFormInputControl.mm:
2737         (-[WKDateTimePopover initWithView:datePickerMode:]):
2738         * UIProcess/ios/forms/WKFormPopover.h:
2739         * UIProcess/ios/forms/WKFormPopover.mm:
2740         * UIProcess/ios/forms/WKFormSelectPopover.mm:
2741         (-[WKSelectPopover initWithView:hasGroups:]):
2742
2743 2015-05-21  Csaba Osztrogonác  <ossy@webkit.org>
2744
2745         [EFL] Remove an unused private field from EwkPopupMenuItem class
2746         https://bugs.webkit.org/show_bug.cgi?id=145249
2747
2748         Reviewed by Gyuyoung Kim.
2749
2750         * UIProcess/API/efl/ewk_popup_menu.cpp:
2751         (EwkPopupMenu::EwkPopupMenu):
2752         * UIProcess/API/efl/ewk_popup_menu_private.h:
2753
2754 2015-05-21  Csaba Osztrogonác  <ossy@webkit.org>
2755
2756         [EFL] Fix mismatched-tags warnings in UIProcess/API/efl
2757         https://bugs.webkit.org/show_bug.cgi?id=145129
2758
2759         Reviewed by Gyuyoung Kim.
2760
2761         * UIProcess/API/efl/EwkViewCallbacks.h:
2762         * UIProcess/API/efl/ewk_application_cache_manager.h:
2763         * UIProcess/API/efl/ewk_auth_request.h:
2764         * UIProcess/API/efl/ewk_back_forward_list.h:
2765         * UIProcess/API/efl/ewk_back_forward_list_item.h:
2766         * UIProcess/API/efl/ewk_color_picker.h:
2767         * UIProcess/API/efl/ewk_context.h:
2768         * UIProcess/API/efl/ewk_context_menu_item.h:
2769         * UIProcess/API/efl/ewk_cookie_manager.h:
2770         * UIProcess/API/efl/ewk_database_manager.h:
2771         * UIProcess/API/efl/ewk_download_job.h:
2772         * UIProcess/API/efl/ewk_error.h:
2773         * UIProcess/API/efl/ewk_favicon_database.h:
2774         * UIProcess/API/efl/ewk_file_chooser_request.h:
2775         * UIProcess/API/efl/ewk_form_submission_request.h:
2776         * UIProcess/API/efl/ewk_navigation_data.h:
2777         * UIProcess/API/efl/ewk_navigation_policy_decision.h:
2778         * UIProcess/API/efl/ewk_object.h:
2779         * UIProcess/API/efl/ewk_page_group.h:
2780         * UIProcess/API/efl/ewk_popup_menu.h:
2781         * UIProcess/API/efl/ewk_popup_menu_item.h:
2782         * UIProcess/API/efl/ewk_security_origin.h:
2783         * UIProcess/API/efl/ewk_settings.h:
2784         * UIProcess/API/efl/ewk_storage_manager.h:
2785         * UIProcess/API/efl/ewk_url_request.h:
2786         * UIProcess/API/efl/ewk_url_response.h:
2787         * UIProcess/API/efl/ewk_url_scheme_request.h:
2788         * UIProcess/API/efl/ewk_view.h:
2789         * UIProcess/API/efl/ewk_window_features.h:
2790         * WebProcess/InjectedBundle/API/efl/ewk_extension.h:
2791         * WebProcess/InjectedBundle/API/efl/ewk_page.h:
2792
2793 2015-05-21  Csaba Osztrogonác  <ossy@webkit.org>
2794
2795         Fix mismatched-tags warnings related to CoordinatedGraphics
2796         https://bugs.webkit.org/show_bug.cgi?id=145130
2797
2798         Reviewed by Darin Adler.
2799
2800         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
2801         * UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.messages.in:
2802         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h:
2803
2804 2015-05-20  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
2805
2806         Unreviewed GTK build fix since r184686.
2807
2808         * UIProcess/gtk/WebProcessPoolGtk.cpp:
2809         (WebKit::WebProcessPool::legacyPlatformDefaultApplicationCacheDirectory): Add *legacy* prefix.
2810         (WebKit::WebProcessPool::platformDefaultApplicationCacheDirectory): Deleted.
2811
2812 2015-05-20  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
2813
2814         Unreviewed EFL build fix since r184686.
2815
2816         * UIProcess/efl/WebProcessPoolEfl.cpp:
2817         (WebKit::WebProcessPool::legacyPlatformDefaultApplicationCacheDirectory): Add *legacy* prefix.
2818         (WebKit::WebProcessPool::platformDefaultApplicationCacheDirectory): Deleted.
2819
2820 2015-05-20  Chris Dumez  <cdumez@apple.com>
2821
2822         [WK2][iOS] Update WebContent process sandbox profile for AWD logging
2823         https://bugs.webkit.org/show_bug.cgi?id=145229
2824         <rdar://problem/20543269>
2825
2826         Reviewed by Alexey Proskuryakov.
2827
2828         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2829
2830 2015-05-20  Gavin Barraclough  <barraclough@apple.com>
2831
2832         dispatchViewStateChange should not wait for sync reply if the page isn't visible
2833         https://bugs.webkit.org/show_bug.cgi?id=145242
2834         <rdar://problem/20967937>
2835
2836         Reviewed by Ben Poulain.
2837
2838         This is particularly problematic on iOS, since if the page isn't visible the process is likely suspended.
2839
2840
2841         * UIProcess/WebPageProxy.cpp:
2842         (WebKit::WebPageProxy::dispatchViewStateChange):
2843         (WebKit::WebPageProxy::waitForDidUpdateViewState):
2844
2845 2015-05-20  Marcos Chavarría Teijeiro  <mchavarria@igalia.com>
2846
2847         Enable disk cache for range requests
2848         https://bugs.webkit.org/show_bug.cgi?id=144682
2849
2850         Reviewed by Antti Koivisto.
2851
2852         Add Range header value to the network cache key constructor so we take
2853         into account this value. The 206 response code is also marked to be cached.
2854
2855         * NetworkProcess/cache/NetworkCache.cpp:
2856         (WebKit::NetworkCache::makeCacheKey):
2857         (WebKit::NetworkCache::isStatusCodeCacheableByDefault):
2858         * NetworkProcess/cache/NetworkCacheKey.cpp:
2859         (WebKit::NetworkCache::Key::Key):
2860         (WebKit::NetworkCache::Key::operator=):
2861         (WebKit::NetworkCache::Key::computeHash):
2862         (WebKit::NetworkCache::Key::operator==):
2863         (WebKit::NetworkCache::Key::encode):
2864         (WebKit::NetworkCache::Key::decode):
2865         (WebKit::NetworkCache::Key::stringToHash): Deleted.
2866         * NetworkProcess/cache/NetworkCacheKey.h:
2867
2868 2015-05-20  Anders Carlsson  <andersca@apple.com>
2869
2870         WKWebsiteDataStore API doesn't report webkit.org as using Databases or App Cache after visiting http://www.webkit.org/demos/sticky-notes/
2871         https://bugs.webkit.org/show_bug.cgi?id=145238
2872         rdar://problem/20581175
2873
2874         Reviewed by Tim Horton.
2875
2876         Make sure to set the application cache and WebSQL directories when using the legacy data store.
2877
2878         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2879         (WebKit::WebProcessPool::legacyPlatformDefaultApplicationCacheDirectory):
2880         (WebKit::WebProcessPool::platformDefaultApplicationCacheDirectory):
2881         Rename this and move it to the right place.
2882
2883         * UIProcess/WebProcessPool.cpp:
2884         (WebKit::legacyWebsiteDataStoreConfiguration):
2885         Rename this and add the application cache and WebSQL directories.
2886
2887         (WebKit::WebProcessPool::WebProcessPool):
2888         Call legacyWebsiteDataStoreConfiguration.
2889
2890         (WebKit::WebProcessPool::applicationCacheDirectory):
2891         Call legacyPlatformDefaultApplicationCacheDirectory.
2892
2893         * UIProcess/WebProcessPool.h:
2894
2895 2015-05-20  Enrica Casucci  <enrica@apple.com>
2896
2897         [iOS] Using CSS viewport units causes incorrect layout.
2898         https://bugs.webkit.org/show_bug.cgi?id=145225
2899         rdar://problem/20924495
2900
2901         Reviewed by Benjamin Poulain.
2902
2903         * WebProcess/WebPage/ios/WebPageIOS.mm:
2904         (WebKit::WebPage::updateViewportSizeForCSSViewportUnits):
2905
2906 2015-05-20  Tim Horton  <timothy_horton@apple.com>
2907
2908         Allow overriding the waitForDidUpdateViewState timeout
2909         https://bugs.webkit.org/show_bug.cgi?id=145230
2910         <rdar://problem/20990162>
2911
2912         Reviewed by Darin Adler.
2913
2914         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
2915         (WebKit::RemoteLayerTreeDrawingAreaProxy::waitForDidUpdateViewState):
2916         Use the value from NSUserDefaults, if it exists.
2917         We'll only check once, so changing the default requires a restart of the UI process.
2918
2919 2015-05-20  Anders Carlsson  <andersca@apple.com>
2920
2921         Make sure we always have a process pool to perform data store operations with
2922         https://bugs.webkit.org/show_bug.cgi?id=145231
2923         rdar://problem/20618248
2924
2925         Reviewed by Tim Horton.
2926
2927         Make sure that we always return a process pool. If we're a legacy C SPI per-context data store,
2928         find the process pool we're a part of and use that. Otherwise, create a new one.
2929     
2930         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2931         (WebKit::WebsiteDataStore::processPools):
2932
2933 2015-05-19  Jer Noble  <jer.noble@apple.com>
2934
2935         Touching HTMLMediaElement.h or MediaPlayer.h causes a world rebuild.
2936         https://bugs.webkit.org/show_bug.cgi?id=145193
2937
2938         Reviewed by Eric Carlson.
2939
2940         Use HTMLMediaElementEnums instead of HTMLMediaElement.
2941
2942         * UIProcess/API/Cocoa/WKWebView.mm:
2943         (-[WKWebView _isShowingVideoOptimized]): HTMLMediaElement -> HTMLMediaElementEnums.
2944         * UIProcess/ios/WebVideoFullscreenManagerProxy.h:
2945         * UIProcess/ios/WebVideoFullscreenManagerProxy.messages.in:
2946         * UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
2947         (WebKit::WebVideoFullscreenManagerProxy::hasMode): Ditto.
2948         (WebKit::WebVideoFullscreenModelContext::fullscreenModeChanged): Ditto.
2949         (WebKit::WebVideoFullscreenManagerProxy::setupFullscreenWithID): Ditto.
2950         (WebKit::WebVideoFullscreenManagerProxy::fullscreenModeChanged): Ditto.
2951         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2952         (WebKit::WebChromeClient::enterVideoFullscreenForVideoElement): Ditto.
2953         * WebProcess/WebCoreSupport/WebChromeClient.h:
2954         * WebProcess/ios/WebVideoFullscreenManager.h:
2955         (WebKit::WebVideoFullscreenInterfaceContext::fullscreenMode): Ditto.
2956         (WebKit::WebVideoFullscreenInterfaceContext::setFullscreenMode): Ditto.
2957         * WebProcess/ios/WebVideoFullscreenManager.messages.in:
2958         * WebProcess/ios/WebVideoFullscreenManager.mm:
2959         (WebKit::WebVideoFullscreenManager::enterVideoFullscreenForVideoElement): Ditto.
2960         (WebKit::WebVideoFullscreenManager::fullscreenModeChanged): Ditto.
2961         (WebKit::WebVideoFullscreenManager::didCleanupFullscreen): Ditto.
2962
2963 2015-05-20  Anders Carlsson  <andersca@apple.com>
2964
2965         Refactor process pool enumeration code in WebsiteDataStore
2966         https://bugs.webkit.org/show_bug.cgi?id=145218
2967
2968         Reviewed by Tim Horton.
2969
2970         Also make sure to keep the WebProcessPool objects alive for the duration of the various data store
2971         operations. This is the first step towards having the data store create a single process pool lazily if
2972         there are no web views associated with the data store.
2973
2974         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2975         (WebKit::WebsiteDataStore::fetchData):
2976         (WebKit::WebsiteDataStore::removeData):
2977         (WebKit::WebsiteDataStore::processPools):
2978         * UIProcess/WebsiteData/WebsiteDataStore.h:
2979
2980 2015-05-20  Alex Christensen  <achristensen@webkit.org>
2981
2982         [Content Extensions] Relax restrictions on triggers that match everything.
2983         https://bugs.webkit.org/show_bug.cgi?id=145069
2984
2985         Reviewed by Benjamin Poulain.
2986
2987         * UIProcess/API/APIUserContentExtensionStore.h:
2988         Increment version number to reflect changes in DFABytecode.
2989
2990 2015-05-20  Sungmann Cho  <sungmann.cho@navercorp.com>
2991
2992         Minor cleanups to PluginProcessProxy.
2993         https://bugs.webkit.org/show_bug.cgi?id=145199
2994
2995         Reviewed by Anders Carlsson.
2996
2997         1. Remove unnecessary forward declaration.
2998         2. Remove unnecessary #include.
2999
3000         * UIProcess/Plugins/PluginProcessProxy.cpp:
3001         * UIProcess/Plugins/PluginProcessProxy.h:
3002
3003 2015-05-20  Marcos Chavarría Teijeiro  <mchavarria@igalia.com>
3004
3005         [GTK] Add some documentation to WebKitWebExtension
3006         https://bugs.webkit.org/show_bug.cgi?id=142786
3007
3008         Reviewed by Carlos Garcia Campos.
3009
3010         WebKitWebExtension API documentation lacks of some details and the information
3011         available is in some contributors blog posts. I add the section
3012         documentation with a small guide about how to use WebExtensions.
3013
3014         The code examples were taken from Carlos García and Adrián Pérez blog
3015         posts.
3016
3017         * WebProcess/InjectedBundle/API/gtk/WebKitWebExtension.cpp:
3018
3019 2015-05-20  Sungmann Cho  <sungmann.cho@navercorp.com>
3020
3021         Rename WebsiteDataStore::isNonPersistent() to WebsiteDataStore::isPersistent().
3022         https://bugs.webkit.org/show_bug.cgi?id=145111
3023
3024         Reviewed by Darin Adler.
3025
3026         This is a follow up to https://bugs.webkit.org/show_bug.cgi?id=144158.
3027
3028         * UIProcess/API/APIWebsiteDataStore.cpp:
3029         (API::WebsiteDataStore::isPersistent):
3030         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3031         (WebKit::WebsiteDataStore::fetchData):
3032         (WebKit::WebsiteDataStore::removeData):
3033         * UIProcess/WebsiteData/WebsiteDataStore.h:
3034         (WebKit::WebsiteDataStore::isPersistent):
3035         (WebKit::WebsiteDataStore::isNonPersistent): Deleted.
3036
3037 2015-05-20  Hyungwook Lee  <hyungwook.lee@navercorp.com>
3038
3039         [EFL] Fix build failure, linker does not find libXext.
3040         https://bugs.webkit.org/show_bug.cgi?id=144100
3041
3042         Reviewed by Gyuyoung Kim.
3043
3044         Move Xext library from WebProcess_LIBRARIES to WebKit2_LIBRARIES.
3045
3046         * PlatformEfl.cmake:
3047
3048 2015-05-19  Carlos Garcia Campos  <cgarcia@igalia.com>
3049
3050         [SOUP] Network Cache: Implement ShareableResource for Soup and enable it for GTK platform
3051         https://bugs.webkit.org/show_bug.cgi?id=144380
3052
3053         Reviewed by Antti Koivisto.
3054
3055         It improves the network cache performance, by mmaping big
3056         resources and sending only the file descriptor to the web process
3057         instead of the actual file data. It needs some changes in
3058         cross-platform code, because we can't use the same approach as
3059         mac (it uses a platform specific implementation not available in
3060         other platforms).
3061
3062         * NetworkProcess/cache/NetworkCache.cpp:
3063         (WebKit::NetworkCache::Cache::store): Use
3064         Data::tryCreateSharedMemory() to create the shared memory used by
3065         the ShareableResource. Also add an ASSERT instead of checking the
3066         shareable resource created is not nullptr, because the
3067         ShareableResource::create() that receives a shared memory should
3068         never return nullptr.
3069         * NetworkProcess/cache/NetworkCacheData.h:
3070         * NetworkProcess/cache/NetworkCacheDataCocoa.mm:
3071         (WebKit::NetworkCache::Data::tryCreateSharedMemory):
3072         * NetworkProcess/cache/NetworkCacheDataSoup.cpp:
3073         (WebKit::NetworkCache::Data::tryCreateSharedMemory): Create a
3074         SharedMemory object to wrap the mapped file, but keeping the ownership.
3075         * NetworkProcess/cache/NetworkCacheEntry.cpp:
3076         (WebKit::NetworkCache::Entry::initializeShareableResourceHandleFromStorageRecord):
3077         Use Data::tryCreateSharedMemory() to create the shared memory used
3078         bythe ShareableResource. Also add an ASSERT instead of checking
3079         the shareable resource created is not nullptr, because the
3080         ShareableResource::create() that receives a shared memory should
3081         never return nullptr.
3082         * Platform/SharedMemory.h:
3083         * Platform/unix/SharedMemoryUnix.cpp:
3084         (WebKit::SharedMemory::map): Use wrapMap() and initialize
3085         m_isWrappingMap to false.
3086         (WebKit::SharedMemory::wrapMap): Create a SharedMemory object for
3087         the given map, without taking its ownership.
3088         (WebKit::SharedMemory::~SharedMemory): Do not unmap and close the
3089         file descriptor if m_isWrappingMap is true.
3090         * Shared/ShareableResource.cpp:
3091         (WebKit::createShareableResourceDeallocator):
3092         (WebKit::ShareableResource::wrapInSharedBuffer): Create a SharedBuffer
3093         wrapping the ShareableResource data.
3094         (WebKit::ShareableResource::Handle::tryWrapInSharedBuffer): Create
3095         a ShareableResource for the handle and create a SharedBuffer
3096         wrapping it.
3097         * Shared/ShareableResource.h:
3098         * WebKit2Prefix.h: Enable ENABLE_SHAREABLE_RESOURCE for GTK.
3099         * WebProcess/Network/WebResourceLoader.cpp:
3100         (WebKit::WebResourceLoader::didReceiveResource): Get the CFData
3101         from the SharedBuffer for QuickLook instead of wrapping the handle again.
3102
3103 2015-05-19  Carlos Garcia Campos  <cgarcia@igalia.com>
3104
3105         [SOUP] Network Cache: Disable network cache efficacy logging
3106         https://bugs.webkit.org/show_bug.cgi?id=145172
3107
3108         Reviewed by Martin Robinson.
3109
3110         Disable network cache efficacy logging by default, since we are
3111         not currently using the collected data.
3112
3113         * UIProcess/soup/WebProcessPoolSoup.cpp:
3114         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
3115
3116 2015-05-19  Michael Saboff  <msaboff@apple.com>
3117
3118         REGRESSION(183787): JIT is enabled for all builds
3119         https://bugs.webkit.org/show_bug.cgi?id=145179
3120
3121         Reviewed by Geoffrey Garen.
3122
3123         Eliminated the setting of ENABLE_JIT, as wtf/Platform.h has appropriate logic to
3124         set it depending on OS and CPU type.
3125
3126         * Configurations/FeatureDefines.xcconfig:
3127
3128 2015-05-19  Brady Eidson  <beidson@apple.com>
3129
3130         X-Frame-Options headers not respected when loading from application cache.
3131         <rdar://problem/14877623> and https://bugs.webkit.org/show_bug.cgi?id=131800
3132
3133         Reviewed by Alexey Proskuryakov.
3134
3135         * WebProcess/WebPage/WebPage.cpp:
3136         (WebKit::WebPage::loadDataImpl):
3137
3138 2015-05-19  Sungmann Cho  <sungmann.cho@navercorp.com>
3139
3140         Add PLUGIN_ARCHITECTURE(MAC) around WKNVCALayerRenderServerPort in NetscapeBrowserFunc.h.
3141         https://bugs.webkit.org/show_bug.cgi?id=145173
3142
3143         Reviewed by Anders Carlsson.
3144
3145         WKNVCALayerRenderServerPort in NetscapeBrowserFunc.h is meaningful only for Mac.
3146         So we need to add PLUGIN_ARCHITECTURE(MAC) around it.
3147
3148         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.h:
3149
3150 2015-05-19  Brent Fulgham  <bfulgham@apple.com>
3151
3152         REGRESSION(142590): Part 2: Scroll-snap points are improperly snapping to earlier index values (Scrolling Thread) 
3153         https://bugs.webkit.org/show_bug.cgi?id=145175
3154         <rdar://problem/21023785>
3155
3156         Reviewed by Beth Dakin.
3157
3158         Add a stub implementation of isScrollSnapInProgress to match ScrollingCoordinator signature.
3159
3160         * WebProcess/Scrolling/RemoteScrollingCoordinator.h:
3161         * WebProcess/Scrolling/RemoteScrollingCoordinator.mm:
3162         (WebKit::RemoteScrollingCoordinator::isScrollSnapInProgress): Added stub.
3163
3164 2015-05-19  Jeremy Jones  <jeremyj@apple.com>
3165
3166         WebVideoFullscreenManagerProxy has incorrect OS_VERSION_MIN_REQUIRED conditionals.
3167         https://bugs.webkit.org/show_bug.cgi?id=145158
3168
3169         Reviewed by Eric Carlson.
3170
3171         * UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
3172         (WebKit::WebVideoFullscreenManagerProxy::setVideoLayerFrame):
3173
3174 2015-05-19  Ting-Wei Lan  <lantw44@gmail.com>
3175
3176         [SOUP] Use st_birthtime to get creation time of files on systems support it
3177         https://bugs.webkit.org/show_bug.cgi?id=144989
3178
3179         Reviewed by Carlos Garcia Campos.
3180
3181         FreeBSD and NetBSD have either st_birthtime field or compatiblity macro
3182         with the same name in stat. It is better to use it instead of manually
3183         setting xattr, which is unreliable because both operating systems and
3184         file systems support are required.
3185
3186         * NetworkProcess/cache/NetworkCacheFileSystemPosix.h:
3187         (WebKit::NetworkCache::fileTimes):
3188         * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:
3189         (WebKit::NetworkCache::IOChannel::IOChannel):
3190
3191 2015-05-19  Chris Dumez  <cdumez@apple.com>
3192
3193         Mark static variables as const when possible
3194         https://bugs.webkit.org/show_bug.cgi?id=145161
3195
3196         Reviewed by Andreas Kling.
3197
3198         * Platform/IPC/MessageEncoder.cpp:
3199         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
3200         (WebKit::networkProcessLatencyQOS):
3201         (WebKit::networkProcessThroughputQOS):
3202         (WebKit::webProcessLatencyQOS):
3203         (WebKit::webProcessThroughputQOS):
3204         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
3205         (WebKit::PluginProcessProxy::pluginNeedsExecutableHeap):
3206         (WebKit::pluginProcessLatencyQOS):
3207         (WebKit::pluginProcessThroughputQOS):
3208         * WebProcess/WebPage/WebPage.cpp:
3209
3210 2015-05-18  Michael Catanzaro  <mcatanzaro@igalia.com>
3211
3212         [CMake] Ignore warnings in system headers
3213         https://bugs.webkit.org/show_bug.cgi?id=144747
3214
3215         Reviewed by Darin Adler.
3216
3217         Separate include directories into WebKit project includes and system includes. Suppress all
3218         warnings from headers in system include directories using the SYSTEM argument to
3219         the include_directories command.
3220
3221         * CMakeLists.txt:
3222         * PlatformEfl.cmake:
3223         * PlatformGTK.cmake:
3224
3225 2015-05-18  Csaba Osztrogonác  <ossy@webkit.org>
3226
3227         Fix return-type warnings in test_ewk2_color_picker.cpp
3228         https://bugs.webkit.org/show_bug.cgi?id=145122
3229
3230         Reviewed by Gyuyoung Kim.
3231
3232         * UIProcess/API/efl/tests/test_ewk2_color_picker.cpp:
3233         (EWK2ColorPickerTest::hideColorPicker):
3234         (EWK2ColorPickerTest::hideColorPickerByRemovingElement):
3235
3236 2015-05-18  Skachkov Alexandr  <gskachkov@gmail.com>
3237
3238         [ES6] Arrow function syntax. Feature flag for arrow function
3239         https://bugs.webkit.org/show_bug.cgi?id=145108
3240
3241         Reviewed by Ryosuke Niwa.
3242
3243         Added feature flag ENABLE_ES6_ARROWFUNCTION_SYNTAX for arrow function
3244
3245         * Configurations/FeatureDefines.xcconfig:
3246
3247 2015-05-18  Anders Carlsson  <andersca@apple.com>
3248
3249         WKWebsiteDataStore should fully support session storage
3250         https://bugs.webkit.org/show_bug.cgi?id=145145
3251         rdar://problem/10690447
3252
3253         Reviewed by Sam Weinig.
3254
3255         Add a session store data type and handle it when clearing and fetching data.
3256
3257         * Shared/WebsiteData/WebsiteDataTypes.h:
3258         * UIProcess/API/Cocoa/WKWebsiteDataRecord.h:
3259         * UIProcess/API/Cocoa/WKWebsiteDataRecord.mm:
3260         (dataTypesToString):
3261         * UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h:
3262         (WebKit::toWebsiteDataTypes):
3263         (WebKit::toWKWebsiteDataTypes):
3264         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
3265         (+[WKWebsiteDataStore allWebsiteDataTypes]):
3266         * UIProcess/Storage/StorageManager.cpp:
3267         (WebKit::StorageManager::SessionStorageNamespace::origins):
3268         (WebKit::StorageManager::SessionStorageNamespace::clearStorageAreasMatchingOrigin):
3269         (WebKit::StorageManager::SessionStorageNamespace::clearAllStorageAreas):
3270         (WebKit::StorageManager::getSessionStorageOrigins):
3271         (WebKit::StorageManager::deleteSessionStorageOrigins):
3272         (WebKit::StorageManager::deleteSessionStorageEntriesForOrigins):
3273         * UIProcess/Storage/StorageManager.h:
3274         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3275         (WebKit::WebsiteDataStore::fetchData):
3276         (WebKit::WebsiteDataStore::removeData):
3277
3278 2015-05-18  Brady Eidson  <beidson@apple.com>
3279
3280         Followup to: Networking process on iOS can be suspended and never exit
3281         https://bugs.webkit.org/show_bug.cgi?id=144971.
3282
3283         Unreviewed. Fixing API tests that revealed the unintentional change in behavior.
3284
3285         * Shared/ChildProcessProxy.cpp:
3286         (WebKit::ChildProcessProxy::shutDownProcess): The on WebProcessProxy code path that this
3287           was adopted from had an m_connection null check, and that null check needs to remain.
3288
3289 2015-05-18  Csaba Osztrogonác  <ossy@webkit.org>
3290
3291         [GTK] URTBF after r184503.
3292
3293         * PlatformGTK.cmake:
3294
3295 2015-05-18  Brady Eidson  <beidson@apple.com>
3296
3297         Networking process on iOS can be suspended and never exit.
3298         <rdar://problem/20368630> and https://bugs.webkit.org/show_bug.cgi?id=144971
3299
3300         Reviewed by Darin Adler.
3301
3302         There's a few issues here.
3303         
3304         1 - When the NetworkProcessProxy goes away, it takes its process assertion with it. This causes
3305             the Network process to suspend indefinitely, unable to ever respond to IPC::Connection callbacks.
3306             We already solved this with WebProcess with a watchdog timer keeping both the process assertion
3307             and xpc_connection alive while the process shuts down. This patch expands that to the network
3308             process, and it will be easy to expand that to database and plugin processes doing forward.
3309         
3310         2 - All of our child processes either decide to self-terminate or listen for their connection to
3311             close at which point they terminate. This leads to various races. We should
3312             move to a model where the UI process explicitly tells them to shutdown, and this patch starts us 
3313             down that path.
3314         
3315         * CMakeLists.txt:
3316         * DerivedSources.make:
3317         * WebKit2.xcodeproj/project.pbxproj:
3318         
3319         * NetworkProcess/NetworkProcess.cpp:
3320         (WebKit::NetworkProcess::didReceiveMessage): Send ChildProcess messages to ChildProcess.
3321         
3322         * Shared/ChildProcess.cpp:
3323         (WebKit::ChildProcess::shutDown): For now, just terminate the process. In the future have the
3324           process do cleanup work before it is terminated.
3325         * Shared/ChildProcess.h:
3326         * Shared/ChildProcess.messages.in: Added.
3327         
3328         * Shared/ChildProcessProxy.cpp:
3329         (WebKit::ChildProcessProxy::shutDownProcess): Set a watchdog and - if possible - explicitly message 
3330           the process to ShutDown.
3331         (WebKit::ChildProcessProxy::abortProcessLaunchIfNeeded): Deleted.
3332         * Shared/ChildProcessProxy.h:
3333         
3334         * UIProcess/WebProcessPool.cpp:
3335         (WebKit::WebProcessPool::~WebProcessPool): Explicitly tell the network process to shut down.
3336         
3337         * UIProcess/WebProcessProxy.cpp:
3338         (WebKit::WebProcessProxy::removeWebPage): Move abortProcessLaunchIfNeeded() and the watchdog timer
3339           code to ChildProcessProxy::shutDownProcess.
3340         
3341         * WebProcess/WebProcess.cpp:
3342         (WebKit::WebProcess::didReceiveMessage): Send ChildProcess messages to ChildProcess::didReceiveMessage.
3343
3344 2015-05-17  Carlos Garcia Campos  <cgarcia@igalia.com>
3345
3346         Network Cache: Make Data::adoptMap take the ownership of the file descriptor
3347         https://bugs.webkit.org/show_bug.cgi?id=144950
3348
3349         Reviewed by Antti Koivisto.
3350
3351         It will be required to implement ShareableResource for soup
3352         network backend. Also move the common code of Data to a common
3353         file and add mapToFile(). The mapFile version that receives a file
3354         descriptor has been renamed to adoptAndMapFile().
3355
3356         * CMakeLists.txt: Add new file to compilation.
3357         * NetworkProcess/cache/NetworkCacheBlobStorage.cpp:
3358         (WebKit::NetworkCache::BlobStorage::add): Use mapToFile().
3359         * NetworkProcess/cache/NetworkCacheData.cpp: Added.
3360         (WebKit::NetworkCache::Data::mapToFile): Write the data to the
3361         given file and map it.
3362         (WebKit::NetworkCache::mapFile):
3363         (WebKit::NetworkCache::adoptAndMapFile):
3364         (WebKit::NetworkCache::computeSHA1):
3365         (WebKit::NetworkCache::bytesEqual):
3366         * NetworkProcess/cache/NetworkCacheData.h:
3367         * NetworkProcess/cache/NetworkCacheDataCocoa.mm:
3368         (WebKit::NetworkCache::Data::adoptMap): Close the file descriptor.
3369         * NetworkProcess/cache/NetworkCacheDataSoup.cpp:
3370         (WebKit::NetworkCache::Data::Data): Use a constructor that
3371         receives a file descriptor instead of the one receiving
3372         Backing. If the file descriptor is not -1 then the Data is a map.
3373         (WebKit::NetworkCache::MapWrapper::~MapWrapper): Also close the
3374         file descriptor.
3375         (WebKit::NetworkCache::Data::adoptMap): Pass the file descriptor
3376         to the MapWrapper and create the Data passing the file descriptor.
3377         * UIProcess/API/APIUserContentExtensionStore.cpp:
3378         (API::openAndMapContentExtension): Use mapFile that receives a
3379         file path.
3380         (API::compiledToFile): Use adoptAndMapFile() and don't close the
3381         descriptor.
3382
3383 2015-05-16  Andy Estes  <aestes@apple.com>
3384
3385         [iOS] WKPDFView should not follow javascript: links
3386         https://bugs.webkit.org/show_bug.cgi?id=145101
3387
3388         Reviewed by Dan Bernstein.
3389
3390         * UIProcess/WebPageProxy.cpp:
3391         (WebKit::WebPageProxy::navigateToPDFLinkWithSimulatedClick): Returned early if url's protocol is javascript:.
3392         (WebKit::WebPageProxy::navigateToURLWithSimulatedClick): Renamed to navigateToPDFLinkWithSimulatedClick to
3393         reflect that this function is exclusively for following PDF links.
3394         * UIProcess/WebPageProxy.h:
3395         * UIProcess/ios/WKPDFView.mm:
3396         (-[WKPDFView annotation:wasTouchedAtPoint:controller:]):
3397         (-[WKPDFView actionSheetAssistant:openElementAtLocation:]):
3398         * WebProcess/WebPage/WebPage.cpp:
3399         (WebKit::WebPage::navigateToPDFLinkWithSimulatedClick): Renamed from navigateToURLWithSimulatedClick.
3400         (WebKit::WebPage::navigateToURLWithSimulatedClick): Renamed to navigateToPDFLinkWithSimulatedClick.
3401         * WebProcess/WebPage/WebPage.h:
3402         * WebProcess/WebPage/WebPage.messages.in:
3403
3404 2015-05-16  Brent Fulgham  <bfulgham@apple.com>
3405
3406         [iOS] Remote scrolling tree needs to coordinate scroll snap state during resize/rotations
3407         https://bugs.webkit.org/show_bug.cgi?id=145059
3408         <rdar://problem/20975978>
3409
3410         Reviewed by Simon Fraser.
3411
3412         The web view needs to update its scroll snap point offsets to take into account any
3413         adjustments to the view size caused by content insets. We also need to update the
3414         offstes after device rotation.
3415
3416         * UIProcess/API/Cocoa/WKWebView.mm:
3417         (-[WKWebView scrollViewWillEndDragging:withVelocity:targetContentOffset:]): Retrieve the proper
3418         computed content inset for the view and incorporate into any scroll snap point adjustments.
3419         (-[WKWebView _updateVisibleContentRects]): If we have active scroll snap points, 
3420         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h:
3421         * UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm:
3422         (WebKit::RemoteScrollingCoordinatorProxy::adjustTargetContentOffsetForSnapping): Update to account
3423         for content inset.
3424         (WebKit::RemoteScrollingCoordinatorProxy::shouldSnapForMainFrameScrolling): Also validate that the
3425         active index is valid.
3426         (WebKit::RemoteScrollingCoordinatorProxy::closestSnapOffsetForMainFrameScrolling): Update to track
3427         current active snap offset index.
3428         (WebKit::RemoteScrollingCoordinatorProxy::hasActiveSnapPoint): Added.
3429         (WebKit::RemoteScrollingCoordinatorProxy::nearestActiveSnapPoint): Added. It calculates the proper
3430         scroll position incorporating any snap point and content insets.
3431
3432 2015-05-15  Yongjun Zhang  <yongjun_zhang@apple.com>
3433
3434         Don't reset the preview recognizer in [WKContentViewInteraction cleanupInteraction]
3435         https://bugs.webkit.org/show_bug.cgi?id=145081
3436
3437         We shouldn't reset the recognizer in [WKContentViewInteraction cleanupInteraction] since we don't re-add it
3438         back to WKContentView when the process relaunched. Since we already add/remove it when the view is move into/
3439         removed from the window, we don't need reset it in cleanupInteraction.
3440
3441         Reviewed by Dan Bernstein.
3442
3443         * UIProcess/ios/WKContentViewInteraction.mm:
3444         (-[WKContentView cleanupInteraction]):
3445
3446 2015-05-15  James Savage  <james.savage@apple.com>
3447
3448         REGRESSION (r181910): WKWebView incorrectly scales snapshot
3449         https://bugs.webkit.org/show_bug.cgi?id=145076
3450
3451         Reviewed by Tim Horton.
3452
3453         We added a fast path to snapshotting using IOSurfaces with
3454         http://trac.webkit.org/changeset/181910 which incorrectly determined
3455         scale and transform and resulted in bad snapshots in some situations.
3456
3457         * UIProcess/API/Cocoa/WKWebView.mm:
3458         (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]):
3459         When snapshotting an IOSurface we need to compute our scale based off of
3460         the rect in the WKWebView coordinates, we also failed to account for
3461         non-zero origins in the snapshot rect. Remove an unused varible while
3462         we're here.
3463
3464 2015-05-15  Alex Christensen  <achristensen@webkit.org>
3465
3466         [Content Extensions] Fail to load old content extension files
3467         https://bugs.webkit.org/show_bug.cgi?id=145027
3468
3469         Reviewed by Eric Carlson.
3470
3471         * UIProcess/API/APIUserContentExtensionStore.cpp:
3472         (API::openAndMapContentExtension):
3473         * UIProcess/API/APIUserContentExtensionStore.h:
3474
3475 2015-05-15  Jeremy Jones  <jeremyj@apple.com>
3476
3477         Limit alternate fullscreen with linked on or after.
3478         https://bugs.webkit.org/show_bug.cgi?id=144894
3479
3480         Reviewed by Dean Jackson.
3481
3482         * UIProcess/API/Cocoa/WKWebView.mm:
3483         (shouldAllowAlternateFullscreen): Added.
3484         (-[WKWebView initWithFrame:configuration:]):
3485
3486 2015-05-15  Chris Dumez  <cdumez@apple.com>
3487
3488         [WK2][Cocoa] Back swipe tab snapshot takes a long time to be removed on bing.com
3489         https://bugs.webkit.org/show_bug.cgi?id=145061
3490         <rdar://problem/20939743>
3491
3492         Reviewed by Tim Horton.
3493
3494         When swiping back from a video search result to the list of video
3495         search results on bing.com, the back swipe gesture tab snapshot takes
3496         ~3 seconds to be removed, even though the page gets loaded almost
3497         instantly from PageCache. The tab snapshot should be removed as soon as
3498         the load is done.
3499
3500         The issue is that we only cleared the back swipe gesture tab snapshot
3501         after PageClient::didFinishLoadForMainFrame() has been called. However,
3502         PageClient::didFinishLoadForMainFrame() was only being called by
3503         WebPageProxy if the main frame loaded *without* error. In case the main
3504         frame loaded with an error, only WebPageProxy::didFailLoadForFrame() is
3505         called, not WebPageProxy::didFinishLoadForFrame() and we would fail to
3506         remove the gesture snapshot until the 3 seconds timeout.
3507
3508         This patch calls PageClient::didFinishLoadForMainFrame() from
3509         WebPageProxy::didFailLoadForFrame() so we remove the snapshot in the
3510         error case as well.
3511
3512         The reason didFailLoadForFrame() is being called on bing.com video
3513         search results is because a "ping" load is aborted when the page is
3514         entering PageCache. Aborting any kind of resource load sets a
3515         "cancellation" error on the main document.
3516
3517         * UIProcess/WebPageProxy.cpp:
3518         (WebKit::WebPageProxy::didFailLoadForFrame):
3519
3520 2015-05-14  Carlos Garcia Campos  <cgarcia@igalia.com>
3521
3522         REGRESSION(r183861): [SOUP] Downloads are broken when using the Network Process
3523         https://bugs.webkit.org/show_bug.cgi?id=144738
3524
3525         Reviewed by Alexey Proskuryakov.
3526
3527         When converting the main resource handle to a download, the
3528         NetworkResourceLoader is aborted, and the ResourceHandle is
3529         cleaned up aborting the download operation. We need to use a
3530         different ResourceHandle for the download operation.
3531
3532         * Shared/Downloads/soup/DownloadSoup.cpp:
3533         (WebKit::Download::startWithHandle): Use ResourceHandle::releaseForDownload()
3534         instead of reusing the given handle.
3535
3536 2015-05-14  Brady Eidson  <beidson@apple.com>
3537
3538         Rename connectionDidClose and related methods to be more clear.
3539         https://bugs.webkit.org/show_bug.cgi?id=145030
3540
3541         Reviewed by Darin Adler.
3542
3543         These methods were easy to confuse with "Connection::Client::didClose()", yet they
3544         were about something much more explicit: A child process being shut down by the UI Process.
3545
3546         Let's call them as such.
3547
3548         * Shared/ChildProcessProxy.cpp:
3549         (WebKit::ChildProcessProxy::shutDownProcess):
3550         (WebKit::ChildProcessProxy::clearConnection): Deleted.
3551         (WebKit::ChildProcessProxy::connectionDidClose): Deleted.
3552         * Shared/ChildProcessProxy.h:
3553
3554         * UIProcess/Databases/DatabaseProcessProxy.cpp:
3555         (WebKit::DatabaseProcessProxy::processWillShutDown):
3556         * UIProcess/Databases/DatabaseProcessProxy.h:
3557
3558         * UIProcess/Network/NetworkProcessProxy.cpp:
3559         (WebKit::NetworkProcessProxy::processWillShutDown):
3560         * UIProcess/Network/NetworkProcessProxy.h:
3561
3562         * UIProcess/Plugins/PluginProcessProxy.cpp:
3563         (WebKit::PluginProcessProxy::processWillShutDown):
3564         * UIProcess/Plugins/PluginProcessProxy.h:
3565
3566         * UIProcess/WebFrameProxy.cpp:
3567         (WebKit::WebFrameProxy::webProcessWillShutDown):
3568         (WebKit::WebFrameProxy::disconnect): Deleted.
3569         * UIProcess/WebFrameProxy.h:
3570
3571         * UIProcess/WebPageProxy.cpp:
3572         (WebKit::WebPageProxy::webProcessWillShutDown):
3573         (WebKit::WebPageProxy::connectionDidClose): Deleted.
3574         * UIProcess/WebPageProxy.h:
3575
3576         * UIProcess/WebProcessLifetimeTracker.cpp:
3577         (WebKit::WebProcessLifetimeTracker::webProcessWillShutDown):
3578         (WebKit::WebProcessLifetimeTracker::connectionDidClose): Deleted.
3579         * UIProcess/WebProcessLifetimeTracker.h:
3580
3581         * UIProcess/WebProcessProxy.cpp:
3582         (WebKit::WebProcessProxy::processWillShutDown):
3583         (WebKit::WebProcessProxy::shutDown):
3584         (WebKit::WebProcessProxy::removeWebPage):
3585         (WebKit::WebProcessProxy::didClose):
3586         (WebKit::WebProcessProxy::disconnectFramesFromPage):
3587         (WebKit::WebProcessProxy::shouldTerminate):
3588         (WebKit::WebProcessProxy::requestTermination):
3589         (WebKit::WebProcessProxy::connectionDidClose): Deleted.
3590         (WebKit::WebProcessProxy::disconnect): Deleted.
3591         * UIProcess/WebProcessProxy.h:
3592
3593 2015-05-14  Zhuo Li  <zachli@apple.com>
3594
3595         Some CFNetwork SPI to reset HSTS hosts added since a date should not be used on Yosemite.
3596         https://bugs.webkit.org/show_bug.cgi?id=145025.
3597         and
3598         rdar://problem/20646308.
3599
3600         Reviewed by Alexey Proskuryakov.
3601
3602         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
3603         (WebKit::WebProcessPool::resetHSTSHostsAddedAfterDate):
3604
3605 2015-05-14  Timothy Horton  <timothy_horton@apple.com>
3606
3607         Add a layout mode that scales down the view to try to fit the document
3608         https://bugs.webkit.org/show_bug.cgi?id=145022
3609         <rdar://problem/19790341>
3610
3611         Reviewed by Dean Jackson.
3612
3613         * Shared/WebPageCreationParameters.cpp:
3614         (WebKit::WebPageCreationParameters::encode):
3615         (WebKit::WebPageCreationParameters::decode):
3616         * Shared/WebPageCreationParameters.h:
3617         * UIProcess/WebPageProxy.cpp:
3618         (WebKit::WebPageProxy::creationParameters):
3619         (WebKit::WebPageProxy::setShouldScaleViewToFitDocument):
3620         * UIProcess/WebPageProxy.h:
3621         * WebProcess/WebPage/DrawingArea.h:
3622         (WebKit::DrawingArea::setShouldScaleViewToFitDocument):
3623         * WebProcess/WebPage/WebPage.cpp:
3624         (WebKit::WebPage::WebPage):
3625         (WebKit::WebPage::setShouldScaleViewToFitDocument):
3626         * WebProcess/WebPage/WebPage.h:
3627         * WebProcess/WebPage/WebPage.messages.in:
3628         Plumb shouldScaleViewToFitDocument through to the DrawingArea.
3629
3630         * UIProcess/mac/WKViewLayoutStrategy.mm:
3631         (+[WKViewLayoutStrategy layoutStrategyWithPage:view:mode:]):
3632         (-[WKViewDynamicSizeComputedFromMinimumDocumentSizeLayoutStrategy initWithPage:view:mode:]):
3633         (-[WKViewDynamicSizeComputedFromMinimumDocumentSizeLayoutStrategy updateLayout]):
3634         (-[WKViewDynamicSizeComputedFromMinimumDocumentSizeLayoutStrategy willChangeLayoutStrategy]):
3635         * UIProcess/API/C/WKLayoutMode.h:
3636         * UIProcess/API/Cocoa/_WKLayoutMode.h:
3637         Add a new layout mode, which just turns on shouldScaleViewToFitDocument,
3638         and otherwise behaves as normal.
3639
3640         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
3641         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
3642         (WebKit::TiledCoreAnimationDrawingArea::setShouldScaleViewToFitDocument):
3643         (WebKit::TiledCoreAnimationDrawingArea::scaleViewToFitDocumentIfNeeded):
3644         (WebKit::TiledCoreAnimationDrawingArea::flushLayers):
3645         On every flush where either the document size or view size has changed,
3646         or layout is outstanding, do a layout with fixed layout off to determine
3647         whether the document fits inside the view. If it doesn't, scale it down
3648         to fit. This will require an extra layout for every resize while in the
3649         scaled-down state, but there is potential for future optimization.
3650
3651 2015-05-14  Anders Carlsson  <andersca@apple.com>
3652
3653         Local storage origins should include origins with transient local storage
3654         https://bugs.webkit.org/show_bug.cgi?id=145017
3655         rdar://problem/10690447
3656
3657         Reviewed by Sam Weinig.
3658
3659         The transient local storage namespaces are used for third party data blocking and will stay
3660         around until the UI process exits so we need to be able to include website data from transient storage
3661         in the website data store APIs.
3662
3663         * UIProcess/Storage/StorageManager.cpp:
3664         (WebKit::StorageManager::TransientLocalStorageNamespace::origins):
3665         (WebKit::StorageManager::getLocalStorageOrigins):
3666         * UIProcess/Storage/StorageManager.h:
3667         * UIProcess/WebKeyValueStorageManager.cpp:
3668         (WebKit::WebKeyValueStorageManager::getKeyValueStorageOrigins):
3669         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3670         (WebKit::WebsiteDataStore::fetchData):
3671
3672 2015-05-14  Beth Dakin  <bdakin@apple.com>
3673
3674         Change range of possible forces for mouseforcechanged DOM event
3675         https://bugs.webkit.org/show_bug.cgi?id=144987
3676         -and corresponding-
3677         rdar://problem/20472802
3678
3679         Reviewed by Tim Horton.
3680
3681         Change to a 0-3 range.
3682         * Shared/mac/WebEventFactory.mm:
3683         (WebKit::WebEventFactory::createWebMouseEvent):
3684
3685 2015-05-14  Zan Dobersek  <zdobersek@igalia.com>
3686
3687         [GTK] Add missing ENABLE(NETSCAPE_PLUGIN_API) build guards
3688         https://bugs.webkit.org/show_bug.cgi?id=144994
3689
3690         Reviewed by Carlos Garcia Campos.
3691
3692         This fixes the build when configured with Netscape plugin API
3693         support disabled.
3694
3695         * UIProcess/API/gtk/WebKitWebContext.cpp:
3696         (webkit_web_context_set_additional_plugins_directory):
3697         (webkitWebContextGetPluginThread):
3698         * UIProcess/Launcher/gtk/ProcessLauncherGtk.cpp:
3699         (WebKit::ProcessLauncher::launchProcess):
3700
3701 2015-05-13  Carlos Garcia Campos  <cgarcia@igalia.com>
3702
3703         [SOUP] Network Cache: NetworkProcess segfault when file system doesn't support xattrs
3704         https://bugs.webkit.org/show_bug.cgi?id=144953
3705
3706         Reviewed by Martin Robinson.
3707
3708         Return early if we fail to get the birthtime xattr.
3709
3710         * NetworkProcess/cache/NetworkCacheFileSystemPosix.h:
3711         (WebKit::NetworkCache::fileTimes):
3712
3713 2015-05-13  Daniel Bates  <dabates@apple.com>
3714
3715         Rename ProcessThrottlerClient::{send, cancel}ProcessWillSuspend() to {send, cancel}PrepareToSuspend()
3716         https://bugs.webkit.org/show_bug.cgi?id=144619
3717         <rdar://problem/20812779>
3718
3719         Reviewed by Andy Estes.
3720
3721         The names of the functions ProcessThrottlerClient::{send, cancel}ProcessWillSuspend() are misnomers. These
3722         functions are called when the ProcessThrottler wants to prepare the process that it manages for suspension
3723         and changes its mind, respectively. That is, these functions do not actually correspond to the OS decision
3724         to suspend a process or cancel the suspension of a process, respectively. So, rename these functions and
3725         associated {Network, Web}ProcessProxy message names to better describe their purpose.
3726
3727         * NetworkProcess/NetworkProcess.cpp:
3728         (WebKit::NetworkProcess::prepareToSuspend):
3729         (WebKit::NetworkProcess::cancelPrepareToSuspend):
3730         (WebKit::NetworkProcess::processWillSuspend): Deleted.
3731         (WebKit::NetworkProcess::cancelProcessWillSuspend): Deleted.
3732         * NetworkProcess/NetworkProcess.h:
3733         * NetworkProcess/NetworkProcess.messages.in:
3734         * UIProcess/Network/NetworkProcessProxy.cpp:
3735         (WebKit::NetworkProcessProxy::sendPrepareToSuspend):
3736         (WebKit::NetworkProcessProxy::sendCancelPrepareToSuspend):
3737         (WebKit::NetworkProcessProxy::sendProcessWillSuspend): Deleted.
3738         (WebKit::NetworkProcessProxy::sendCancelProcessWillSuspend): Deleted.
3739         * UIProcess/Network/NetworkProcessProxy.h:
3740         * UIProcess/ProcessThrottler.cpp:
3741         (WebKit::ProcessThrottler::updateAssertion):
3742         * UIProcess/ProcessThrottlerClient.h:
3743         * UIProcess/WebProcessProxy.cpp:
3744         (WebKit::WebProcess::actualPrepareToSuspend): Formerly named prepareToSuspend.
3745         (WebKit::WebProcessProxy::sendPrepareToSuspend):
3746         (WebKit::WebProcessProxy::sendCancelPrepareToSuspend):
3747         (WebKit::WebProcessProxy::sendProcessWillSuspend): Deleted.
3748         (WebKit::WebProcessProxy::sendCancelProcessWillSuspend): Deleted.
3749         * UIProcess/WebProcessProxy.h:
3750         * WebProcess/WebProcess.cpp:
3751         (WebKit::WebProcess::prepareToSuspend):
3752         (WebKit::WebProcess::cancelPrepareToSuspend):
3753         (WebKit::WebProcess::processWillSuspend): Deleted.
3754         (WebKit::WebProcess::cancelProcessWillSuspend): Deleted.
3755         * WebProcess/WebProcess.h:
3756         * WebProcess/WebProcess.messages.in:
3757
3758 2015-05-13  Anders Carlsson  <andersca@apple.com>
3759
3760         Don't create a per-pool data store when using the modern API
3761         https://bugs.webkit.org/show_bug.cgi?id=144963
3762         rdar://problem/20331756
3763
3764         Reviewed by Tim Horton.
3765
3766         * UIProcess/API/APIProcessPoolConfiguration.cpp:
3767         (API::ProcessPoolConfiguration::createWithLegacyOptions):
3768         (API::ProcessPoolConfiguration::copy):
3769         * UIProcess/API/APIProcessPoolConfiguration.h:
3770         Keep track of whether the process pool should have a data store.
3771
3772         * UIProcess/API/C/WKContext.cpp:
3773         (WKContextGetWebsiteDataStore):
3774         * UIProcess/WebKeyValueStorageManager.cpp:
3775         (WebKit::WebKeyValueStorageManager::getKeyValueStorageOrigins):
3776         (WebKit::WebKeyValueStorageManager::getStorageDetailsByOrigin):
3777         (WebKit::WebKeyValueStorageManager::deleteEntriesForOrigin):
3778         (WebKit::WebKeyValueStorageManager::deleteAllEntries):
3779         Update now that WebProcessPool::dataStore() no longer returns a reference.
3780
3781         * UIProcess/WebProcessPool.cpp:
3782         (WebKit::WebProcessPool::WebProcessPool):
3783         Only create a data store if the configuration states that we should.
3784
3785         * UIProcess/WebProcessPool.h:
3786         Change dataStore() to return a pointer instead of a reference.
3787
3788 2015-05-13  Alexey Proskuryakov  <ap@apple.com>
3789
3790         [Mac] Sandbox violation reading SubmitDiagInfo.domains
3791         https://bugs.webkit.org/show_bug.cgi?id=144962
3792         rdar://problem/20719330
3793
3794         Reviewed by Darin Adler.
3795
3796         * WebProcess/com.apple.WebProcess.sb.in:
3797
3798 2015-05-13  Beth Dakin  <bdakin@apple.com>
3799
3800         Speculative build fix.
3801
3802         * UIProcess/API/Cocoa/_WKOverlayScrollbarStyle.h:
3803
3804 2015-05-13  Michael Catanzaro  <mcatanzaro@igalia.com>
3805
3806         [GTK][CMake] Extra include directory when libnotify is present but disabled
3807         https://bugs.webkit.org/show_bug.cgi?id=144941
3808
3809         Reviewed by Martin Robinson.
3810
3811         Add LIBNOTIFY_INCLUDE_DIRS to WebKit2_INCLUDE_DIRECTORIES only if USE_LIBNOTIFY is true,
3812         rather than checking LIBNOTIFY_FOUND.
3813
3814         * PlatformGTK.cmake:
3815
3816 2015-05-13  Beth Dakin  <bdakin@apple.com>
3817
3818         Need SPI to set the overlay scroll bar style
3819         https://bugs.webkit.org/show_bug.cgi?id=144928
3820         -and corresponding-
3821         rdar://problem/20143614
3822
3823         Reviewed by Anders Carlsson.
3824
3825         Make scrollbarOverlayStyle a part of the creation parameters. 
3826         * Shared/WebPageCreationParameters.cpp:
3827         (WebKit::WebPageCreationParameters::encode):
3828         (WebKit::WebPageCreationParameters::decode):
3829         * Shared/WebPageCreationParameters.h:
3830
3831         New SPI.
3832         * UIProcess/API/Cocoa/WKViewPrivate.h:
3833         * UIProcess/API/Cocoa/_WKOverlayScrollbarStyle.h: Added.
3834         * UIProcess/API/mac/WKView.mm:
3835         (-[WKView _setOverlayScrollbarStyle:]):
3836         (-[WKView _overlayScrollbarStyle]):
3837
3838         Store m_scrollbarOverlayStyle on WebPageProxy, and set it to the WebProcess.
3839         * UIProcess/WebPageProxy.cpp:
3840         (WebKit::WebPageProxy::WebPageProxy):
3841         (WebKit::WebPageProxy::creationParameters):
3842         (WebKit::WebPageProxy::setOverlayScrollbarStyle):
3843         * UIProcess/WebPageProxy.h:
3844         (WebKit::WebPageProxy::overlayScrollbarStyle):
3845         * WebKit2.xcodeproj/project.pbxproj:
3846
3847         Return WebPage’s scrollbarOverlayStyle().
3848         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3849         (WebKit::WebChromeClient::preferredScrollbarOverlayStyle):
3850         * WebProcess/WebCoreSupport/WebChromeClient.h:
3851
3852         Cache the scrollbarOverlayStyle() here for the WebProcess. 
3853         * WebProcess/WebPage/WebPage.cpp:
3854         (WebKit::WebPage::WebPage):
3855         (WebKit::WebPage::setScrollbarOverlayStyle):
3856         * WebProcess/WebPage/WebPage.h:
3857         (WebKit::WebPage::scrollbarOverlayStyle):
3858         * WebProcess/WebPage/WebPage.messages.in:
3859
3860 2015-05-13  Anders Carlsson  <andersca@apple.com>
3861
3862         Rename some StorageManager functions to indicate that they work on local storage entries
3863         https://bugs.webkit.org/show_bug.cgi?id=144958
3864         First part of rdar://problem/10690447.
3865
3866         Reviewed by Beth Dakin.
3867
3868         * UIProcess/Storage/StorageManager.cpp:
3869         (WebKit::StorageManager::getLocalStorageOrigins):
3870         (WebKit::StorageManager::getLocalStorageDetailsByOrigin):
3871         (WebKit::StorageManager::deleteLocalStorageEntriesForOrigin):
3872         (WebKit::StorageManager::deleteAllLocalStorageEntries):
3873         (WebKit::StorageManager::deleteLocalStorageEntriesForOrigins):
3874         (WebKit::StorageManager::getOrigins): Deleted.
3875         (WebKit::StorageManager::getStorageDetailsByOrigin): Deleted.
3876         (WebKit::StorageManager::deleteEntriesForOrigin): Deleted.
3877         (WebKit::StorageManager::deleteAllEntries): Deleted.
3878         (WebKit::StorageManager::deleteEntriesForOrigins): Deleted.
3879         * UIProcess/Storage/StorageManager.h:
3880         * UIProcess/WebKeyValueStorageManager.cpp:
3881         (WebKit::WebKeyValueStorageManager::getKeyValueStorageOrigins):
3882         (WebKit::WebKeyValueStorageManager::getStorageDetailsByOrigin):
3883         (WebKit::WebKeyValueStorageManager::deleteEntriesForOrigin):
3884         (WebKit::WebKeyValueStorageManager::deleteAllEntries):
3885         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3886         (WebKit::WebsiteDataStore::fetchData):
3887         (WebKit::WebsiteDataStore::removeData):
3888
3889 2015-05-13  Joseph Pecoraro  <pecoraro@apple.com>
3890
3891         Crash under WebKit::WebInspectorProxy::attachAvailabilityChanged sometimes opening new page
3892         https://bugs.webkit.org/show_bug.cgi?id=144957
3893
3894         Reviewed by Simon Fraser.
3895
3896         * UIProcess/WebInspectorProxy.cpp:
3897         (WebKit::WebInspectorProxy::attachAvailabilityChanged):
3898
3899 2015-05-13  Joseph Pecoraro  <pecoraro@apple.com>
3900
3901         Pass String as reference in more places
3902         https://bugs.webkit.org/show_bug.cgi?id=144769
3903
3904         Reviewed by Daniel Bates.
3905
3906         * WebProcess/WebPage/WebInspectorUI.cpp:
3907         (WebKit::WebInspectorUI::showMainResourceForFrame):
3908         * WebProcess/WebPage/WebInspectorUI.h:
3909
3910 2015-05-13  Timothy Horton  <timothy_horton@apple.com>
3911
3912         View scale changes are temporarily lost after restoring a page from the page cache
3913         https://bugs.webkit.org/show_bug.cgi?id=144934
3914
3915         Reviewed by Brady Eidson.
3916
3917         * WebProcess/WebPage/WebPage.cpp:
3918         (WebKit::WebPage::WebPage):
3919         (WebKit::WebPage::scalePage):
3920         (WebKit::WebPage::scalePageInViewCoordinates):
3921         (WebKit::WebPage::pageScaleFactor):
3922         (WebKit::WebPage::viewScaleFactor):
3923         (WebKit::WebPage::scaleView):
3924         * WebProcess/WebPage/WebPage.h:
3925         (WebKit::WebPage::viewScaleFactor): Deleted.
3926         Get rid of m_viewScaleFactor, instead using Page::viewScaleFactor.
3927
3928 2015-05-13  Sungmann Cho  <sungmann.cho@navercorp.com>
3929
3930         Minor cleanups to PluginProxy.cpp.
3931         https://bugs.webkit.org/show_bug.cgi?id=144948
3932
3933         Reviewed by Gyuyoung Kim.
3934
3935         1. Remove unnecessary #include.
3936         2. Remove unnecessary return statement from PluginProxy::paint().
3937
3938         No new tests, no behavior change.
3939
3940         * WebProcess/Plugins/PluginProxy.cpp:
3941         (WebKit::PluginProxy::paint):
3942
3943 2015-05-13  Daegyu Lee  <daegyu.lee@navercorp.com>
3944
3945         REGRESSION(r176631): [EFL] Fullscreen feature doesn't work correctly on MiniBrowser
3946         https://bugs.webkit.org/show_bug.cgi?id=144906
3947
3948         Reviewed by Gyuyoung Kim.
3949
3950         * UIProcess/CoordinatedGraphics/PageViewportController.cpp:
3951         (WebKit::PageViewportController::updateMinimumScaleToFit): Recover the r176631 condition to
3952         call applyScaleAfterRenderingContents function to apply correct scale.
3953
3954 2015-05-12  Dan Bernstein  <mitz@apple.com>
3955
3956         In Safari, Debug > Get Bytecode Profile crashes the Web Content process
3957         https://bugs.webkit.org/show_bug.cgi?id=144944
3958
3959         Reviewed by Darin Adler.
3960
3961         * WebProcess/WebPage/WebPage.cpp:
3962         (WebKit::WebPage::getBytecodeProfile): Don’t assert that m_perBytecodeProfiler isn’t null,
3963         because it is when the profiler is disabled, which is the default. In that case, return
3964         after sending back the empty string, rather than continuing to dereference a null pointer.
3965
3966 2015-05-12  Jon Honeycutt  <jhoneycutt@apple.com>
3967
3968         Crash when using <input type=file>
3969
3970         <https://bugs.webkit.org/show_bug.cgi?id=144939>
3971         <rdar://problem/20172315>
3972
3973         Reviewed by Andy Estes.
3974
3975         * UIProcess/ios/forms/WKFileUploadPanel.mm:
3976         Use a RefPtr to hold the WebOpenPanelResultListenerProxy, because the
3977         WKFileUploadPanel can outlive it.
3978
3979 2015-05-12  Simon Fraser  <simon.fraser@apple.com>
3980
3981         Turn antialiased font dilation off by default
3982         https://bugs.webkit.org/show_bug.cgi?id=144940
3983         rdar://problem/20923031
3984
3985         Reviewed by Sam Weinig.
3986
3987         Turn antialised font dilation off by default.
3988
3989         * Shared/WebPreferencesDefinitions.h:
3990         * UIProcess/API/C/WKPreferencesRefPrivate.h:
3991
3992 2015-05-12  Daniel Bates  <dabates@apple.com>
3993
3994         Make {Network, Web}ProcessProxy inherit from ProcessThrottleClient privately
3995         https://bugs.webkit.org/show_bug.cgi?id=144886
3996
3997         Reviewed by Darin Adler.
3998
3999         {Network, Web}ProcessProxy are implemented in terms of ProcessThrottleClient, an
4000         interface that defines the callbacks that ProcessThrottler makes to a client. We
4001         do not want to allow arbitrary callers to make use of the interface ProcessThrottleClient.
4002         So, we should use private inheritance to represent the relationship between
4003         {Network, Web}ProcessProxy and ProcessThrottleClient instead of public inheritance.
4004
4005         Additionally make ProcessThrottler a instance variable of {Network, Web}ProcessProxy instead
4006         of holding a smart pointer to a ProcessThrottler instance because we always want to
4007         have a ProcessThrottler for each instance of {Network, Web}ProcessProxy.
4008
4009         * UIProcess/Network/NetworkProcessProxy.cpp:
4010         (WebKit::NetworkProcessProxy::NetworkProcessProxy): Update code to work now that m_throttler
4011         is an instance of ProcessThrottler instead of a smart pointer to a ProcessThrottler instance.
4012         (WebKit::NetworkProcessProxy::didFinishLaunching): Update code to access functions of
4013         m_throttler by reference instead of by pointer.
4014         (WebKit::NetworkProcessProxy::didCancelProcessSuspension): Ditto.
4015         (WebKit::NetworkProcessProxy::processReadyToSuspend): Ditto.
4016         (WebKit::NetworkProcessProxy::setIsHoldingLockedFiles): Ditto.
4017         * UIProcess/Network/NetworkProcessProxy.h: Inherit from ProcessThrottleClient privately.
4018         (WebKit::NetworkProcessProxy::throttler): Update code to work now that m_throttler is an
4019         instance of ProcessThrottler instead of a smart pointer to a ProcessThrottler instance.
4020         * UIProcess/ProcessThrottler.cpp:
4021         (WebKit::ProcessThrottler::ProcessThrottler): Update code to work now that m_process is
4022         a lvalue reference instead of a pointer.
4023         (WebKit::ProcessThrottler::updateAssertion): Ditto.
4024         (WebKit::ProcessThrottler::assertionWillExpireImminently): Ditto.
4025         * UIProcess/ProcessThrottler.h: Ditto.
4026         * UIProcess/WebProcessProxy.cpp:
4027         (WebKit::WebProcessProxy::WebProcessProxy): Update code to work now that m_throttler is an
4028         instance of ProcessThrottler instead of a smart pointer to a ProcessThrottler instance. 
4029         (WebKit::WebProcessProxy::didFinishLaunching): Update code to access functions of
4030         m_throttler by reference instead of by pointer.
4031         (WebKit::WebProcessProxy::processReadyToSuspend): Ditto.
4032         (WebKit::WebProcessProxy::didCancelProcessSuspension): Ditto.
4033         (WebKit::WebProcessProxy::setIsHoldingLockedFiles): Ditto.
4034         * UIProcess/WebProcessProxy.h: Inherit from ProcessThrottleClient privately.
4035         (WebKit::WebProcessProxy::throttler): Update code to work now that m_throttler is an
4036         instance of ProcessThrottler instead of a smart pointer to a ProcessThrottler instance.
4037
4038 2015-05-12  Anders Carlsson  <andersca@apple.com>
4039
4040         Production builds should link against the shims directly
4041         https://bugs.webkit.org/show_bug.cgi?id=144922
4042         rdar://problem/19708579
4043
4044         Reviewed by Dan Bernstein.
4045
4046         * Configurations/NetworkService.xcconfig:
4047         Point to an Info.plist that has DYLD_INSERT_LIBRARIES set on 10.10 and earlier.
4048         Link directly against SecItemShim.dylib where possible.
4049
4050         * Configurations/PluginProcessShim.xcconfig:
4051         Set the install name and install path.
4052
4053         * Configurations/PluginService.32.xcconfig:
4054         Point to an Info.plist that has DYLD_INSERT_LIBRARIES set on 10.10 and earlier.
4055         Link directly against PluginProcessShim.dylib where possible.
4056
4057         * Configurations/PluginService.64.xcconfig:
4058         Point to an Info.plist that has DYLD_INSERT_LIBRARIES set on 10.10 and earlier.
4059         Link directly against PluginProcessShim.dylib where possible.
4060
4061         * Configurations/SecItemShim.xcconfig:
4062         Set the install name and install path.
4063
4064         * Configurations/WebContentService.xcconfig:
4065         Point to an Info.plist that has DYLD_INSERT_LIBRARIES set on 10.10 and earlier.
4066         Link directly against WebProcessShim.dylib where possible.
4067
4068         * Configurations/WebProcessShim.xcconfig:
4069         Set the install name and install path.
4070
4071         * NetworkProcess/EntryPoint/mac/XPCService/NetworkService/Info-OSX-10.9-10.10.plist: Copied from Source/WebKit2/NetworkProcess/EntryPoint/mac/XPCService/NetworkService/Info-OSX.plist.