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