eeb6fd7b4ec4ddb08bdf1b085362e5f432b9affb
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2015-06-22  Carlos Garcia Campos  <cgarcia@igalia.com>
2
3         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.9.3 release.
4
5         * gtk/NEWS: Add release notes for 2.9.3.
6
7 2015-06-22  Dan Bernstein  <mitz@apple.com>
8
9         Part 2 of [Xcode] Fold the WebKit2SandboxProfiles-IOSOverride target into the Sandbox Profiles target
10         https://bugs.webkit.org/show_bug.cgi?id=146197
11
12         Rubber-stamped by Anders Carlsson.
13
14         * WebKit2.xcodeproj/project.pbxproj: Deleted the WebKit2SandboxProfiles-IOSOverride target.
15
16 2015-06-22  Dean Jackson  <dino@apple.com>
17
18         Rename PlatformCA*Mac to PlatformCA*Cocoa
19         https://bugs.webkit.org/show_bug.cgi?id=146224
20         <rdar://problem/21497182>
21
22         Reviewed by Simon Fraser.
23
24         Rename PlatformCALayerMac and related files in platform/graphics/ca/mac
25         to the more accurate Cocoa suffix.
26
27         * WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm:
28         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
29         (WebKit::PlatformCALayerRemote::filtersCanBeComposited):
30         * WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.mm:
31         (WebKit::PlatformCALayerRemoteCustom::create):
32         * WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.cpp:
33         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
34         (WebKit::TiledCoreAnimationDrawingArea::commitTransientZoom):
35
36 2015-06-22  Anders Carlsson  <andersca@apple.com>
37
38         Simplify Connection::SyncMessageState
39         https://bugs.webkit.org/show_bug.cgi?id=146213
40
41         Reviewed by Andreas Kling.
42
43         Since we no longer support Connections dispatching to multiple threads, we can make SyncMessageState
44         into a singleton and get rid of the RunLoop -> SyncMessageState hash map.
45
46         * Platform/IPC/Connection.cpp:
47         (IPC::Connection::SyncMessageState::singleton):
48         (IPC::Connection::SyncMessageState::SyncMessageState):
49         (IPC::Connection::SyncMessageState::processIncomingMessage):
50         (IPC::Connection::SyncMessageState::dispatchMessages):
51         (IPC::Connection::waitForSyncReply):
52         (IPC::Connection::processIncomingSyncReply):
53         (IPC::Connection::processIncomingMessage):
54         (IPC::Connection::connectionDidClose):
55         (IPC::Connection::SyncMessageState::syncMessageStateMap): Deleted.
56         (IPC::Connection::SyncMessageState::syncMessageStateMapMutex): Deleted.
57         (IPC::Connection::SyncMessageState::getOrCreate): Deleted.
58         (IPC::Connection::SyncMessageState::~SyncMessageState): Deleted.
59         (IPC::Connection::Connection): Deleted.
60         * Platform/IPC/Connection.h:
61
62 2015-06-20  Alex Christensen  <achristensen@webkit.org>
63
64         [Content Extensions] Add SPI to reload without content blocking.
65         https://bugs.webkit.org/show_bug.cgi?id=146128
66         rdar://problem/20351903
67
68         Reviewed by Sam Weinig.
69
70         * Shared/WebPageCreationParameters.cpp:
71         (WebKit::WebPageCreationParameters::encode):
72         (WebKit::WebPageCreationParameters::decode):
73         * Shared/WebPageCreationParameters.h:
74         * UIProcess/API/C/WKPage.cpp:
75         (WKPageSetCustomUserAgent):
76         (WKPageSetUserContentExtensionsEnabled):
77         (WKPageSupportsTextEncoding):
78         * UIProcess/API/C/WKPage.h:
79         * UIProcess/API/Cocoa/WKWebView.mm:
80         (-[WKWebView _customUserAgent]):
81         (-[WKWebView _setUserContentExtensionsEnabled:]):
82         (-[WKWebView _userContentExtensionsEnabled]):
83         (-[WKWebView _setCustomUserAgent:]):
84         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
85         * UIProcess/WebPageProxy.cpp:
86         (WebKit::WebPageProxy::creationParameters):
87         (WebKit::WebPageProxy::setShouldScaleViewToFitDocument):
88         (WebKit::WebPageProxy::setUserContentExtensionsEnabled):
89         * UIProcess/WebPageProxy.h:
90         (WebKit::WebPageProxy::userContentExtensionsEnabled):
91         * WebProcess/WebPage/WebPage.cpp:
92         (WebKit::WebPage::WebPage):
93         (WebKit::WebPage::reinitializeWebPage):
94         (WebKit::WebPage::setShouldScaleViewToFitDocument):
95         (WebKit::WebPage::setUserContentExtensionsEnabled):
96         * WebProcess/WebPage/WebPage.h:
97         * WebProcess/WebPage/WebPage.messages.in:
98         Pass a boolean from the API to WebCore.
99
100 2015-06-22  Anders Carlsson  <andersca@apple.com>
101
102         Remove m_clientRunLoop from IPC::Connection
103         https://bugs.webkit.org/show_bug.cgi?id=146212
104
105         Reviewed by Sam Weinig.
106
107         We only ever create connections whose messages are dispatched to the main run loop, so we can 
108         vastly simplify the code by only allowing messages to be dispatched there.
109
110         * DatabaseProcess/DatabaseToWebProcessConnection.cpp:
111         (WebKit::DatabaseToWebProcessConnection::DatabaseToWebProcessConnection):
112         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
113         (WebKit::NetworkConnectionToWebProcess::NetworkConnectionToWebProcess):
114         * Platform/IPC/Connection.cpp:
115         (IPC::Connection::createServerConnection):
116         (IPC::Connection::createClientConnection):
117         (IPC::Connection::Connection):
118         (IPC::Connection::addWorkQueueMessageReceiver):
119         (IPC::Connection::removeWorkQueueMessageReceiver):
120         (IPC::Connection::waitForMessage):
121         (IPC::Connection::sendSyncMessage):
122         (IPC::Connection::sendSyncMessageFromSecondaryThread):
123         (IPC::Connection::processIncomingMessage):
124         (IPC::Connection::connectionDidClose):
125         (IPC::Connection::dispatchDidReceiveInvalidMessage):
126         (IPC::Connection::enqueueIncomingMessage):
127         (IPC::Connection::wakeUpRunLoop):
128         * Platform/IPC/Connection.h:
129         * Platform/IPC/mac/ConnectionMac.mm:
130         (IPC::Connection::receiveSourceEventHandler):
131         * PluginProcess/WebProcessConnection.cpp:
132         (WebKit::WebProcessConnection::WebProcessConnection):
133         * Shared/ChildProcess.cpp:
134         (WebKit::ChildProcess::initialize):
135         * Shared/ChildProcessProxy.cpp:
136         (WebKit::ChildProcessProxy::didFinishLaunching):
137         * UIProcess/Plugins/PluginProcessProxy.cpp:
138         (WebKit::PluginProcessProxy::didFinishLaunching):
139         * WebProcess/Databases/WebToDatabaseProcessConnection.cpp:
140         (WebKit::WebToDatabaseProcessConnection::WebToDatabaseProcessConnection):
141         * WebProcess/Network/NetworkProcessConnection.cpp:
142         (WebKit::NetworkProcessConnection::NetworkProcessConnection):
143         * WebProcess/Plugins/PluginProcessConnection.cpp:
144         (WebKit::PluginProcessConnection::PluginProcessConnection):
145         * WebProcess/WebPage/WebInspector.cpp:
146         (WebKit::WebInspector::createInspectorPage):
147         * WebProcess/WebPage/WebInspectorUI.cpp:
148         (WebKit::WebInspectorUI::establishConnection):
149
150 2015-06-22  Anders Carlsson  <andersca@apple.com>
151
152         Crashes in hit testing under WebPage::acceptsFirstMouse() while handling sync message in plug-in teardown
153         https://bugs.webkit.org/show_bug.cgi?id=146211
154         rdar://problem/17180615
155
156         Reviewed by Sam Weinig.
157
158         If we're inside a sendSync message when we're being called, just bail.
159
160         * WebProcess/WebPage/mac/WebPageMac.mm:
161         (WebKit::WebPage::acceptsFirstMouse):
162
163 2015-06-22  Dan Bernstein  <mitz@apple.com>
164
165         Part 1 of [Xcode] Fold the WebKit2SandboxProfiles-IOSOverride target into the Sandbox Profiles target
166         https://bugs.webkit.org/show_bug.cgi?id=146197
167
168         Reviewed by Anders Carlsson.
169
170         * Configurations/SandboxProfiles.xcconfig: Added. Defines INSTALL_PATH based on the value
171         of WK_INSTALL_OVERRIDE_SANDBOX_PROFILES.
172         * WebKit2.xcodeproj/project.pbxproj: Use SandboxProfiles.xcconfig for the Sandbox Profiles
173         target, and change the destination path in its Copy Files build phase to INSTALL_PATH.
174
175 2015-06-22  Antti Koivisto  <antti@apple.com>
176
177         Crash replacing TabDocument in MobileSafari at WebKit: -[WKWebView(WKPrivate) _beginAnimatedResizeWithUpdates:]
178         https://bugs.webkit.org/show_bug.cgi?id=146201
179
180         Reviewed by Dan Bernstein.
181
182         * UIProcess/API/Cocoa/WKWebView.mm:
183         (-[WKWebView _beginAnimatedResizeWithUpdates:]):
184
185         No repro but if for some reason [_contentView bounds] width is zero we'll compute +Inf targetScale
186         and then NaN contentOffset.x. Verified in lldb that this gives the exact crash signature seen.
187
188         Fix by checking that [_contentView bounds] is not empty like is done with other inputs.
189
190 2015-06-22  Carlos Garcia Campos  <cgarcia@igalia.com>
191
192         REGRESSION(r182303): [GTK] Context menu API is broken since r182303
193         https://bugs.webkit.org/show_bug.cgi?id=146202
194
195         Reviewed by Žan Doberšek.
196
197         The problem is that ContextMenuclient API changed in r182303, but
198         we didn't notice it either, and the default handler for
199         getContextMenuFromProposedMenu was executed. An override keyword
200         would have caught this.
201
202         * UIProcess/API/gtk/WebKitContextMenuClient.cpp: Build a Vector of
203         WebContextMenuItemData as expected by our API, and add add
204         override keyword to ensure this doesn't happen again.
205
206 2015-06-22  Zan Dobersek  <zdobersek@igalia.com>
207
208         [WK2] ConnectionUnix should use FastMalloc to allocate on-heap resources
209         https://bugs.webkit.org/show_bug.cgi?id=146143
210
211         Reviewed by Carlos Garcia Campos.
212
213         IPC handling in Unix-specific IPC::Connection implementation should use
214         FastMalloc to allocate on-heap resources, instead of allocating via the
215         system allocator.
216
217         The AttachmentInfo class is marked as allocatable through FastMalloc.
218         That way it can be allocated through FastMalloc while still handled
219         through std::unique_ptr<>.
220
221         The char[] arrays in readBytesFromSocket() and Connection::sendOutgoingMessage()
222         are now handled through a MallocPtr<> object.
223
224         In Connection::sendOutgoingMessage(), both the AttachmentInfo[] and char[]
225         arrays are now only allocated if there are actual attachments contained
226         in the message. The code that's conditioned with a non-empty attachments
227         Vector is now also grouped together, in a single branch.
228
229         * Platform/IPC/unix/ConnectionUnix.cpp:
230         (IPC::readBytesFromSocket):
231         (IPC::Connection::sendOutgoingMessage):
232
233 2015-06-22  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
234
235         [EFL] test_ewk2_application_cache_manager has been failed since r185527
236         https://bugs.webkit.org/show_bug.cgi?id=146016
237
238         Reviewed by Csaba Osztrogonác.
239
240         * UIProcess/API/efl/tests/test_ewk2_application_cache_manager.cpp:
241         (TEST_F): Disable this test for now. This test will be enabled again.
242
243 2015-06-16  Gavin Barraclough  <barraclough@apple.com>
244
245         Page load performance regression due to bugs.webkit.org/show_bug.cgi?id=145542
246         https://bugs.webkit.org/show_bug.cgi?id=146198
247
248         Unreviewed rollout.
249
250         * UIProcess/API/gtk/WebKitWebContext.cpp:
251         (webkit_web_context_prefetch_dns):
252
253 2015-06-21  Hyungwook Lee  <hyungwook.lee@navercorp.com>
254
255         WKApplicationCacheManagerDeleteEntriesForOrigin() has wrong WebsiteDataTypes.
256         https://bugs.webkit.org/show_bug.cgi?id=146180
257
258         Reviewed by Sam Weinig.
259
260         Modify to use correct WebsiteDataTypes in WKApplicationCacheManagerDeleteEntriesForOrigin()
261
262         * UIProcess/API/C/WKApplicationCacheManager.cpp:
263         (WKApplicationCacheManagerDeleteEntriesForOrigin):
264
265 2015-06-21  Dan Bernstein  <mitz@apple.com>
266
267         <rdar://problem/21444762> REGRESSION (r184215): Plug-in services crash on launch on Yosemite
268         https://bugs.webkit.org/show_bug.cgi?id=146195
269
270         Reviewed by Sam Weinig.
271
272         * Configurations/PluginService.32.xcconfig: Changed the Yosemite definition of
273         INFOPLIST_FILE such that it would also apply to the macosx10.10.internal SDK.
274         * Configurations/PluginService.64.xcconfig: Ditto.
275
276 2015-06-21  Dan Bernstein  <mitz@apple.com>
277
278         Build fix.
279
280         * Shared/API/Cocoa/WKFoundation.h: Don’t use generics if the SDK doesn’t support them.
281
282 2015-06-21  Michael Catanzaro  <mcatanzaro@igalia.com>
283
284         [SOUP] Use GTask in WebKitSoupRequestInputStream
285         https://bugs.webkit.org/show_bug.cgi?id=146184
286
287         Reviewed by Carlos Garcia Campos.
288
289         Replace deprecated use of GSimpleAsyncResult with GTask.
290
291         * WebProcess/soup/WebKitSoupRequestInputStream.cpp:
292         (AsyncReadData::AsyncReadData):
293         (webkitSoupRequestInputStreamReadAsyncResultComplete):
294         (webkitSoupRequestInputStreamPendingReadAsyncComplete):
295         (webkitSoupRequestInputStreamReadAsync):
296         (webkitSoupRequestInputStreamReadFinish):
297
298 2015-06-21  Michael Catanzaro  <mcatanzaro@igalia.com>
299
300         Fix format strings in NetworkCache.cpp and NetworkCacheStatistics.cpp and WebIDBServerConnection.cpp
301         https://bugs.webkit.org/show_bug.cgi?id=146172
302
303         Reviewed by Darin Adler.
304
305         Use the correct %"PRIu64" and %"PRIi64" for uint64_t and int64_t, instead of %llu and %lli.
306
307         * NetworkProcess/cache/NetworkCache.cpp:
308         (WebKit::NetworkCache::Cache::retrieve):
309         * NetworkProcess/cache/NetworkCacheStatistics.cpp:
310         (WebKit::NetworkCache::Statistics::initialize):
311         (WebKit::NetworkCache::Statistics::recordNotUsingCacheForRequest):
312         (WebKit::NetworkCache::Statistics::recordRetrievalFailure):
313         (WebKit::NetworkCache::Statistics::recordRetrievedCachedEntry):
314         (WebKit::NetworkCache::Statistics::recordRevalidationSuccess):
315         * WebProcess/Databases/IndexedDB/WebIDBServerConnection.cpp:
316         (WebKit::WebIDBServerConnection::deleteDatabase):
317         (WebKit::WebIDBServerConnection::didDeleteDatabase):
318         (WebKit::WebIDBServerConnection::getOrEstablishIDBDatabaseMetadata):
319         (WebKit::WebIDBServerConnection::didGetOrEstablishIDBDatabaseMetadata):
320         (WebKit::WebIDBServerConnection::openTransaction):
321         (WebKit::WebIDBServerConnection::didOpenTransaction):
322         (WebKit::WebIDBServerConnection::beginTransaction):
323         (WebKit::WebIDBServerConnection::didBeginTransaction):
324         (WebKit::WebIDBServerConnection::commitTransaction):
325         (WebKit::WebIDBServerConnection::didCommitTransaction):
326         (WebKit::WebIDBServerConnection::resetTransaction):
327         (WebKit::WebIDBServerConnection::didResetTransaction):
328         (WebKit::WebIDBServerConnection::rollbackTransaction):
329         (WebKit::WebIDBServerConnection::didRollbackTransaction):
330         (WebKit::WebIDBServerConnection::createObjectStore):
331         (WebKit::WebIDBServerConnection::didCreateObjectStore):
332         (WebKit::WebIDBServerConnection::createIndex):
333         (WebKit::WebIDBServerConnection::didCreateIndex):
334         (WebKit::WebIDBServerConnection::deleteIndex):
335         (WebKit::WebIDBServerConnection::didDeleteIndex):
336         (WebKit::WebIDBServerConnection::get):
337         (WebKit::WebIDBServerConnection::put):
338         (WebKit::WebIDBServerConnection::didPutRecord):
339         (WebKit::WebIDBServerConnection::didGetRecord):
340         (WebKit::WebIDBServerConnection::didOpenCursor):
341         (WebKit::WebIDBServerConnection::didAdvanceCursor):
342         (WebKit::WebIDBServerConnection::didIterateCursor):
343         (WebKit::WebIDBServerConnection::count):
344         (WebKit::WebIDBServerConnection::didCount):
345         (WebKit::WebIDBServerConnection::deleteRange):
346         (WebKit::WebIDBServerConnection::didDeleteRange):
347         (WebKit::WebIDBServerConnection::clearObjectStore):
348         (WebKit::WebIDBServerConnection::didClearObjectStore):
349         (WebKit::WebIDBServerConnection::deleteObjectStore):
350         (WebKit::WebIDBServerConnection::didDeleteObjectStore):
351         (WebKit::WebIDBServerConnection::changeDatabaseVersion):
352         (WebKit::WebIDBServerConnection::didChangeDatabaseVersion):
353         (WebKit::WebIDBServerConnection::openCursor):
354         (WebKit::WebIDBServerConnection::cursorAdvance):
355         (WebKit::WebIDBServerConnection::cursorIterate):
356
357 2015-06-20  Tim Horton  <timothy_horton@apple.com>
358
359         Deselection of text causes a noticeable jump on force touch machines
360         https://bugs.webkit.org/show_bug.cgi?id=146173
361         <rdar://problem/20992842>
362
363         Reviewed by Sam Weinig.
364
365         * Shared/WebCoreArgumentCoders.cpp:
366         (IPC::ArgumentCoder<TextIndicatorData>::encode):
367         (IPC::ArgumentCoder<TextIndicatorData>::decode):
368         Encode/decode wantsMargin.
369
370         * WebProcess/WebPage/mac/WebPageMac.mm:
371         (WebKit::WebPage::performImmediateActionHitTestAtLocation):
372         (WebKit::textIndicatorTransitionForImmediateAction): Deleted.
373         Get rid of TextIndicatorPresentationTransition::Crossfade.
374
375 2015-06-20  Dan Bernstein  <mitz@apple.com>
376
377         [Cocoa] Actually use Objective-C lightweight generics when the compiler supports them
378         https://bugs.webkit.org/show_bug.cgi?id=146183
379
380         Reviewed by Sam Weinig.
381
382         * Shared/API/Cocoa/WKFoundation.h: When the compiler supports Objective-C generics, define
383         WK_ARRAY and WK_SET to use them. Also added a definition of WK_DICTIONARY.
384
385         * UIProcess/API/Cocoa/WKWebViewPrivate.h: Use WK_DICTIONARY for the options dictionary of
386         -_loadRequest:withOptions:.
387
388         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
389         (-[WKWebsiteDataStore fetchDataRecordsOfTypes:completionHandler:]): Made the completion
390         halder type match the declaration, now that NSArray and WK_ARRAY(WKWebsiteDataRecord *) are
391         not the same.
392
393         * mac/postprocess-framework-headers.sh: Also rewrite WK_DICTIONARY.
394
395 2015-06-20  Chris Dumez  <cdumez@apple.com>
396
397         [WK2][iOS] Avoid synchronous IPC on view state change when the content is not visible
398         https://bugs.webkit.org/show_bug.cgi?id=146179
399         <rdar://problem/20923432>
400
401         Reviewed by Tim Horton.
402
403         After r170787, viewStateChange() would cause a synchronous IPC between
404         the UIProcess and the WebProcess when the view becomes visible. This
405         was to avoid painting empty / black tiles when unsuspending the
406         WebProcess on tab switch, in the event volatile IOSurfaces were purged.
407
408         However, this sync IPC can have performance implications and is not
409         needed when the content is not actually visible yet (e.g.
410         hideContentUntilNextUpdate() was called, or the tab was killed).
411
412         This patch avoids the synchronous IPC when the content is hidden and
413         exposes a private API on WKWebView so that clients can ask for the
414         content to be hidden until the next update. This would allow for
415         clients to avoid the synchronous IPC if they don't need the content
416         to be displayed synchronously (e.g. the view is obscured).
417
418         * UIProcess/API/Cocoa/WKWebView.mm:
419         (-[WKWebView _hideContentUntilNextUpdate]):
420         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
421         * UIProcess/DrawingAreaProxy.h:
422         (WebKit::DrawingAreaProxy::hasVisibleContent):
423         * UIProcess/WebPageProxy.cpp:
424         (WebKit::WebPageProxy::dispatchViewStateChange):
425         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
426         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
427         (WebKit::RemoteLayerTreeDrawingAreaProxy::isContentHidden):
428
429 2015-06-20  Michael Catanzaro  <mcatanzaro@igalia.com>
430
431         Check for SHA1 certificates ignores subresources
432         https://bugs.webkit.org/show_bug.cgi?id=146159
433
434         Reviewed by Dan Bernstein.
435
436         * UIProcess/WebPageProxy.cpp:
437         (WebKit::WebPageProxy::didCommitLoadForFrame): Call
438         PageLoadState::didDisplayOrRunInsecureContent if a certificate chain contains a non-root
439         SHA1 certificate when the frame is not the main frame.
440
441 2015-06-20  Dan Bernstein  <mitz@apple.com>
442
443         Added availability information to a recently-added delegate method.
444
445         Suggested by Alexey Proskuryakov and Anders Carlsson.
446
447         * UIProcess/API/Cocoa/WKUIDelegate.h: Annotated -webViewDidClose:.
448
449 2015-06-20  Ryuan Choi  <ryuan.choi@navercorp.com>
450
451         [EFL] Do not consider test directories when DEVELOPER_MODE is OFF
452         https://bugs.webkit.org/show_bug.cgi?id=146171
453
454         Reviewed by Gyuyoung Kim.
455
456         * PlatformEfl.cmake:
457         Do not define SOURCE_DIR when DEVELOPER_MODE is OFF for seccomp filter
458         not to allow jhbuild directory.
459         * Shared/efl/ProcessExecutablePathEfl.cpp:
460         (WebKit::findProcessPath): Guard test code to ENABLE(DEVELOPER_MODE).
461
462 2015-06-18  Myles C. Maxfield  <mmaxfield@apple.com>
463
464         REGRESSION(r185475): [Mac] ASSERT() when clicking on text using web fonts with force touch trackpad
465         https://bugs.webkit.org/show_bug.cgi?id=145890
466         <rdar://problem/21390877>
467
468         Reviewed by Darin Adler and Tim Horton.
469
470         The best place to stop the serialization of unserializable fonts is inside WebKit2's IPC code. We want
471         this logic to occur when encoding an NSAttributedString, rather than when encoding an NSDictionary,
472         because changing the shape of an NSAttributedString is less likely to result in problems rather than
473         changing the shape of an NSDictionary.
474
475         * Shared/mac/ArgumentCodersMac.mm:
476         (IPC::fontIsSerializable):
477         (IPC::filterUnserializableValues):
478         (IPC::encode):
479
480 2015-06-19  Michael Catanzaro  <mcatanzaro@igalia.com>
481
482         [SOUP] Fix return-type-c-linkage warning after r185553
483         https://bugs.webkit.org/show_bug.cgi?id=146014
484
485         Reviewed by Martin Robinson.
486
487         * Shared/Network/CustomProtocols/soup/CustomProtocolManagerImpl.cpp:
488         (WebKit::CustomProtocolManagerImpl::start): webkitSoupRequestGenericGetRequest now returns
489         a pointer rather than a reference.
490
491 2015-06-19  Brady Eidson  <beidson@apple.com>
492
493         Rename WKSecurityOrigin.h/cpp to WKSecurityOriginRef.h/cpp.
494         https://bugs.webkit.org/show_bug.cgi?id=146152
495
496         Reviewed by Dan Bernstein.
497
498         * CMakeLists.txt:
499
500         * Shared/API/c/WKSecurityOriginRef.cpp: Renamed from Source/WebKit2/Shared/API/c/WKSecurityOrigin.cpp.
501         * Shared/API/c/WKSecurityOriginRef.h: Renamed from Source/WebKit2/Shared/API/c/WKSecurityOrigin.h.
502
503         * UIProcess/API/efl/ewk_security_origin.cpp:
504         * UIProcess/API/efl/ewk_storage_manager.cpp:
505
506         * WebKit2.xcodeproj/project.pbxproj:
507
508 2015-06-18  Brent Fulgham  <bfulgham@apple.com>
509
510         [iOS] scrollIntoViewIfNeeded is not working with scroll-snap points
511         https://bugs.webkit.org/show_bug.cgi?id=145318
512         <rdar://problem/21081501>
513
514         Reviewed by Simon Fraser.
515
516         * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp:
517         (ArgumentCoder<ScrollingStateScrollingNode>::encode): Handle scroll snap point offset indices.
518         (ArgumentCoder<ScrollingStateScrollingNode>::decode): Ditto.
519         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp:
520         (WebKit::RemoteScrollingCoordinatorProxy::currentSnapPointIndicesDidChange): Added. Send message
521         to WebProcess when scroll snap indices have changed.
522         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h:
523         * UIProcess/Scrolling/RemoteScrollingTree.cpp:
524         (WebKit::RemoteScrollingTree::currentSnapPointIndicesDidChange): Added. Notify the
525         RemoteScrollingCoordinatorProxy when scroll snap indices have changed.
526         * UIProcess/Scrolling/RemoteScrollingTree.h:
527         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
528         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
529         (-[WKOverflowScrollViewDelegate scrollViewWillEndDragging:withVelocity:targetContentOffset:]): Revised.
530         Identify changes in the current scroll snap point offset index (in either the horizontal or vertical
531         directions), and send a notification when this happens.
532         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::currentSnapPointIndicesDidChange): Added. Notify the
533         Scrolling Tree when indices changed.
534         * UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm:
535         (WebKit::RemoteScrollingCoordinatorProxy::adjustTargetContentOffsetForSnapping): Revised. Always compute
536         the new scroll snap offset index (even when we will rubber band).
537         * WebProcess/Scrolling/RemoteScrollingCoordinator.h:
538         * WebProcess/Scrolling/RemoteScrollingCoordinator.messages.in: Add a new message to relay changes in scroll
539         snap index.
540         * WebProcess/Scrolling/RemoteScrollingCoordinator.mm:
541         (WebKit::RemoteScrollingCoordinator::currentSnapPointIndicesChangedForNode): Added.
542
543 2015-06-19  Jeremy Jones  <jeremyj@apple.com>
544
545         Revert switch to _synchronizedDrawingFence.
546         https://bugs.webkit.org/show_bug.cgi?id=146136
547         <rdar://problem/21227992>
548
549         Reviewed by Simon Fraser.
550
551         Revert _synchronizedDrawingFence code path that leaks a port.
552
553         * UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
554         (WebKit::WebVideoFullscreenManagerProxy::setVideoLayerFrame):
555
556 2015-06-19  Anders Carlsson  <andersca@apple.com>
557
558         Address review feedback from Darin.
559
560         * Shared/mac/HangDetectionDisablerMac.mm:
561         (WebKit::clientsMayIgnoreEvents):
562
563 2015-06-19  Anders Carlsson  <andersca@apple.com>
564
565         Disable SpinTracer detection while loading sync XHR
566         https://bugs.webkit.org/show_bug.cgi?id=146150
567         rdar://problem/21462023
568
569         Reviewed by Dan Bernstein.
570
571         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
572         (WebKit::WebPlatformStrategies::loadResourceSynchronously):
573
574 2015-06-19  Anders Carlsson  <andersca@apple.com>
575
576         Spintracer treats the web process as hung when it's showing JavaScript dialogs in the UI process
577         https://bugs.webkit.org/show_bug.cgi?id=146124
578         rdar://problem/21449395
579
580         Reviewed by Geoffrey Garen.
581
582         Add a HangDetectionDisabler RAII object and use it for JavaScript panels.
583
584         * Shared/HangDetectionDisabler.h: Added.
585         (WebKit::HangDetectionDisabler::HangDetectionDisabler):
586         (WebKit::HangDetectionDisabler::~HangDetectionDisabler):
587         * Shared/mac/HangDetectionDisablerMac.mm: Added.
588         (WebKit::clientsMayIgnoreEvents):
589         (WebKit::setClientsMayIgnoreEvents):
590         (WebKit::HangDetectionDisabler::HangDetectionDisabler):
591         (WebKit::HangDetectionDisabler::~HangDetectionDisabler):
592         * WebKit2.xcodeproj/project.pbxproj:
593         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
594         (WebKit::WebChromeClient::runBeforeUnloadConfirmPanel):
595         (WebKit::WebChromeClient::runJavaScriptAlert):
596         (WebKit::WebChromeClient::runJavaScriptConfirm):
597         (WebKit::WebChromeClient::runJavaScriptPrompt):
598
599 2015-06-19  Dan Bernstein  <mitz@apple.com>
600
601         Fixed the build for platforms that don’t have SafariServices.
602
603         * UIProcess/ios/WKContentViewInteraction.mm:
604         (-[WKContentView previewViewControllerForPosition:inSourceView:]):
605         (-[WKContentView commitPreviewViewController:]):
606         (-[WKContentView willPresentPreviewViewController:forPosition:inSourceView:]):
607
608 2015-06-19  Csaba Osztrogonác  <ossy@webkit.org>
609
610         Remove unnecessary svn:executable flags
611         https://bugs.webkit.org/show_bug.cgi?id=146107
612
613         Reviewed by Alexey Proskuryakov.
614
615         * UIProcess/API/efl/EwkView.cpp: Removed property svn:executable.
616
617 2015-06-19  Csaba Osztrogonác  <ossy@webkit.org>
618
619         [WK2] Fix unused-private-field warning in WebProcess/Plugins/PluginView.<h|cpp>
620         https://bugs.webkit.org/show_bug.cgi?id=145252
621
622         Reviewed by Tim Horton.
623
624         * WebProcess/Plugins/PluginView.cpp:
625         (WebKit::PluginView::PluginView): Added the necessary ifdef guard.
626         * WebProcess/Plugins/PluginView.h: Added the necessary ifdef guard.
627         * WebProcess/WebPage/WebPage.h: Moved the definition of ENABLE_PRIMARY_SNAPSHOTTED_PLUGIN_HEURISTIC to WTF.
628
629 2015-06-18  Carlos Garcia Campos  <cgarcia@igalia.com>
630
631         Do not store configuration parameters twice in WebProcessPool
632         https://bugs.webkit.org/show_bug.cgi?id=146102
633
634         Reviewed by Sam Weinig.
635
636         Since we are copying the given WebProcessPoolConfiguration and
637         keeping it as a member, we don't need to keep an additional copy
638         of its contents as extra members. This also prevents
639         inconsistencies between the values in the configuration and the
640         members when any of them are modified by WebProcessPool API.
641
642         * UIProcess/API/APIProcessPoolConfiguration.h: Return a const
643         reference instead of a temporary in methods returning a String.
644         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
645         (WebKit::WebProcessPool::updateProcessSuppressionState):
646         (WebKit::WebProcessPool::platformInitializeWebProcess):
647         * UIProcess/WebProcessPool.cpp:
648         (WebKit::WebProcessPool::setProcessModel):
649         (WebKit::WebProcessPool::setMaximumNumberOfProcesses):
650         (WebKit::WebProcessPool::networkingProcessConnection):
651         (WebKit::WebProcessPool::languageChanged):
652         (WebKit::WebProcessPool::setUsesNetworkProcess):
653         (WebKit::WebProcessPool::usesNetworkProcess):
654         (WebKit::WebProcessPool::ensureNetworkProcess):
655         (WebKit::WebProcessPool::ensureDatabaseProcess):
656         (WebKit::WebProcessPool::ensureSharedWebProcess):
657         (WebKit::WebProcessPool::createNewWebProcess):
658         (WebKit::WebProcessPool::warmInitialProcess):
659         (WebKit::WebProcessPool::disconnectProcess):
660         (WebKit::WebProcessPool::createNewWebProcessRespectingProcessCountLimit):
661         (WebKit::WebProcessPool::createWebPage):
662         (WebKit::WebProcessPool::postMessageToInjectedBundle):
663         (WebKit::WebProcessPool::setCanHandleHTTPSServerTrustEvaluation):
664         (WebKit::WebProcessPool::setCacheModel):
665         (WebKit::WebProcessPool::allowSpecificHTTPSCertificateForHost):
666         (WebKit::WebProcessPool::requestWebContentStatistics):
667         (WebKit::WebProcessPool::requestNetworkingStatistics):
668         * UIProcess/WebProcessPool.h:
669         (WebKit::WebProcessPool::sendToNetworkingProcess):
670         (WebKit::WebProcessPool::sendToNetworkingProcessRelaunchingIfNecessary):
671         (WebKit::WebProcessPool::sendToAllProcessesRelaunchingThemIfNecessary):
672         (WebKit::WebProcessPool::sendToOneProcess):
673         * UIProcess/gtk/WebProcessPoolGtk.cpp:
674         (WebKit::WebProcessPool::platformInitializeWebProcess):
675
676 2015-06-18  Jon Lee  <jonlee@apple.com>
677
678         Update AVKit usage of pip
679         https://bugs.webkit.org/show_bug.cgi?id=146095
680         <rdar://problem/21386853>
681
682         Reviewed by Eric Carlson.
683
684         - Rename preference key
685         - Rename shouldAllowAlternateFullscreen to shouldAllowPictureInPictureMediaPlayback
686
687         * Shared/WebPreferencesDefinitions.h:
688         * UIProcess/API/C/WKPreferences.cpp: Remove unused preference calls.
689         (WKPreferencesSetAllowsAlternateFullscreen): Deleted.
690         (WKPreferencesGetAllowsAlternateFullscreen): Deleted.
691         * UIProcess/API/C/WKPreferencesRefPrivate.h:
692         * UIProcess/API/Cocoa/WKWebView.mm:
693         (-[WKWebView _isShowingVideoPictureInPicture]): Renamed.
694         (-[WKWebView _isShowingVideoOptimized]): Deleted.
695         (-[WKWebView _mayAutomaticallyShowVideoPictureInPicture]): Renamed.
696         (-[WKWebView _mayAutomaticallyShowVideoOptimized]): Deleted.
697         (shouldAllowPictureInPictureMediaPlayback): Renamed.
698         (shouldAllowAlternateFullscreen): Deleted.
699         * UIProcess/API/Cocoa/WKWebViewInternal.h:
700         * UIProcess/ios/PageClientImplIOS.mm:
701         * UIProcess/ios/WebVideoFullscreenManagerProxy.h: Rename local variables.
702         * UIProcess/ios/WebVideoFullscreenManagerProxy.messages.in:
703         * UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
704         (WebKit::WebVideoFullscreenManagerProxy::mayAutomaticallyShowVideoPictureInPicture): Renamed.
705         (WebKit::WebVideoFullscreenManagerProxy::mayAutomaticallyShowVideoOptimized): Deleted.
706         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
707         * WebProcess/WebPage/WebPage.cpp:
708         * WebProcess/ios/WebVideoFullscreenManager.mm:
709
710 2015-06-18  Jeremy Jones  <jeremyj@apple.com>
711
712         Fix crash when entering fullscreen during exit fullscreen animation.
713         https://bugs.webkit.org/show_bug.cgi?id=146117
714
715         Reviewed by Simon Fraser.
716
717         A partial teardown left the LayerHostingContext in a bad state when attempting to reuse the model and interface
718         objects. Instead, complete the teardown and don't reuse the objects.
719
720         * WebProcess/ios/WebVideoFullscreenManager.mm:
721         (WebKit::WebVideoFullscreenManager::didEnterFullscreen): WebThreadRun is a no-op in WK2. Use dispatch_async.
722         (WebKit::WebVideoFullscreenManager::didCleanupFullscreen): Do complete teardown before entering fullscreen again.
723
724 2015-06-18  Anders Carlsson  <andersca@apple.com>
725
726         Remove shouldInterruptJavaScript
727         https://bugs.webkit.org/show_bug.cgi?id=146118
728
729         Reviewed by Antti Koivisto.
730
731         * UIProcess/API/APIUIClient.h:
732         (API::UIClient::shouldInterruptJavaScript): Deleted.
733         * UIProcess/API/C/WKPage.cpp:
734         (WKPageSetPageUIClient): Deleted.
735         * UIProcess/API/C/WKPageUIClient.h:
736         * UIProcess/WebPageProxy.cpp:
737         (WebKit::WebPageProxy::shouldInterruptJavaScript): Deleted.
738         * UIProcess/WebPageProxy.h:
739         * UIProcess/WebPageProxy.messages.in:
740         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
741         (WebKit::WebChromeClient::shouldInterruptJavaScript): Deleted.
742         * WebProcess/WebCoreSupport/WebChromeClient.h:
743
744 2015-06-18  Tim Horton  <timothy_horton@apple.com>
745
746         Use SFSafariViewController for previews
747         https://bugs.webkit.org/show_bug.cgi?id=146092
748
749         Reviewed by Darin Adler.
750
751         * UIProcess/ios/WKContentViewInteraction.mm:
752         (-[WKContentView previewViewControllerForPosition:inSourceView:]):
753         (-[WKContentView commitPreviewViewController:]):
754         * WebKit2.xcodeproj/project.pbxproj:
755         * Source/WebKit2/Platform/spi/ios/SafariServicesSPI.h:
756
757 2015-06-18  Antti Koivisto  <antti@apple.com>
758
759         ~4% Membuster regression after WebKit r185452
760         https://bugs.webkit.org/show_bug.cgi?id=146112
761         rdar://problem/21406677
762
763         Reviewed by Chris Dumez.
764
765         Clear the cache write queue on critical memory pressure. There can be substantial amount of memory there and we
766         don't know how long writing it out will take. System is often under I/O pressure too in low memory situations.
767
768         This also makes sense for process suspension where we send simulated critical memory event.
769
770         * NetworkProcess/NetworkProcess.cpp:
771         (WebKit::NetworkProcess::lowMemoryHandler):
772         * NetworkProcess/cache/NetworkCache.cpp:
773         (WebKit::NetworkCache::Cache::handleMemoryPressureNotification):
774         * NetworkProcess/cache/NetworkCache.h:
775         * NetworkProcess/cache/NetworkCacheStorage.cpp:
776         (WebKit::NetworkCache::Storage::clearWriteQueue):
777         * NetworkProcess/cache/NetworkCacheStorage.h:
778
779 2015-06-18  Csaba Osztrogonác  <ossy@webkit.org>
780
781         Fix missing braces and deprecated declarations warnings in WebKitNotificationProvider.cpp
782         https://bugs.webkit.org/show_bug.cgi?id=145921
783
784         Reviewed by Carlos Garcia Campos.
785
786         * UIProcess/API/gtk/WebKitNotificationProvider.cpp:
787         (WebKitNotificationProvider::WebKitNotificationProvider):
788
789 2015-06-18  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
790
791         [EFL] test_ewk2_context has been failed since r185529
792         https://bugs.webkit.org/show_bug.cgi?id=146046
793
794         Reviewed by Csaba Osztrogonác.
795
796         ewk_context_network_process_model test has been failed since r185529.
797         This patch modifies the test which is similar to ewk_context_network_process_model
798         based on multiple process model to fix the failure. Besides ewk_context_network_process_model
799         seems to be fixed indirectly. So we enable it again.
800
801         * UIProcess/API/efl/tests/test_ewk2_context.cpp:
802         (TEST_F):
803
804 2015-06-17  Yongjun Zhang  <yongjun_zhang@apple.com>
805
806         Also turn off long press on link preview.
807         https://bugs.webkit.org/show_bug.cgi?id=146084
808
809         Also turn off long presss gesture when previewing. Turn that back on when preview is completed.
810
811         Reviewed by Tim Horton.
812
813         * UIProcess/ios/WKContentViewInteraction.mm:
814         (-[WKContentView willPresentPreviewViewController:forPosition:inSourceView:]):
815         (-[WKContentView didDismissPreviewViewController:committing:]):
816
817 2015-06-17  Brent Fulgham  <bfulgham@apple.com>
818
819         Overflow regions with scroll snap points are not reliably rubber banding
820         https://bugs.webkit.org/show_bug.cgi?id=142522
821         <rdar://problem/20100726>
822
823         Reviewed by Darin Adler.
824
825         Make sure we don't block rubberbanding behavior when a scroll gesture should take us past
826         the end of the scroll container.
827
828         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
829         (-[WKOverflowScrollViewDelegate scrollViewWillEndDragging:withVelocity:targetContentOffset:]): Don't adjust
830         target point if we were going to scroll past the edges of the scroll container.
831
832 2015-06-17  Anders Carlsson  <andersca@apple.com>
833
834         Would like a way, in the API, to get notified about a web process crash
835         https://bugs.webkit.org/show_bug.cgi?id=146085
836         rdar://problem/17358828
837
838         Reviewed by Darin Adler.
839
840         * UIProcess/API/Cocoa/WKNavigationDelegate.h:
841         * UIProcess/Cocoa/NavigationState.h:
842         * UIProcess/Cocoa/NavigationState.mm:
843         (WebKit::NavigationState::setNavigationDelegate):
844         (WebKit::NavigationState::NavigationClient::processDidCrash):
845
846 2015-06-17  Tim Horton  <timothy_horton@apple.com>
847
848         Swipe gesture can get stuck, preventing scrolling and other gestures
849         https://bugs.webkit.org/show_bug.cgi?id=146088
850         <rdar://problem/16056087>
851
852         Reviewed by Darin Adler.
853
854         * UIProcess/mac/ViewGestureControllerMac.mm:
855         (WebKit::ViewGestureController::trackSwipeGesture):
856         Ignore mouse events that come in while we're doing a swipe.
857         This prevents potentially problematic mouse events (especially context menus)
858         won't be processed during a swipe, avoiding situations that can cause
859         the swipe gesture to get stuck.
860
861 2015-06-17  Sungmann Cho  <sungmann.cho@navercorp.com>
862
863         Remove willSendEventToPlugin() from PluginController.h.
864         https://bugs.webkit.org/show_bug.cgi?id=146054
865
866         Reviewed by Darin Adler.
867
868         PluginController::willSendEventToPlugin() was introduced by http://webkit.org/b/59124.
869         This method had been used only for WebKit2 on Windows, and no one uses it now.
870         So we can remove it.
871
872         No new tests, no behavior change.
873
874         * PluginProcess/PluginControllerProxy.cpp:
875         (WebKit::PluginControllerProxy::willSendEventToPlugin): Deleted.
876         * PluginProcess/PluginControllerProxy.h:
877         * WebProcess/Plugins/PluginController.h:
878         * WebProcess/Plugins/PluginView.cpp:
879         (WebKit::PluginView::willSendEventToPlugin): Deleted.
880         * WebProcess/Plugins/PluginView.h:
881
882 2015-06-17  Tim Horton  <timothy_horton@apple.com>
883
884         Repro crash when swiping back from a NY Times article @ WebPageProxy::navigationGestureDidEnd
885         https://bugs.webkit.org/show_bug.cgi?id=146083
886         <rdar://problem/20974232>
887
888         Reviewed by Darin Adler.
889
890         * UIProcess/ios/ViewGestureControllerIOS.mm:
891         (WebKit::ViewGestureController::didSameDocumentNavigationForMainFrame):
892         (WebKit::ViewGestureController::activeLoadMonitoringTimerFired):
893         It is possible to get didSameDocumentNavigationForMainFrame *before*
894         endSwipeGesture, while the user is still interactively swiping. We
895         cannot remove the snapshot in this case, nor should we start the active
896         load monitoring timer; all of these things should happen only after the
897         swipe is completed and we've performed the navigation.
898
899         This was particularly bad (a crash instead of just a disappearing snapshot)
900         because removing the snapshot also causes m_webPageProxyForBackForwardListForCurrentSwipe
901         to be nulled out, but then it is dereferenced during endSwipeGesture.
902
903         Make sure that we never call removeSwipeSnapshotIfReady unless we were actually
904         waiting to remove the swipe snapshot (because the gesture had completed).
905         Most callers already did ensure this, but these two did not.
906
907 2015-06-17  Joseph Pecoraro  <pecoraro@apple.com>
908
909         Web Inspector: Improve Full Screen support for Web Inspector windows
910         https://bugs.webkit.org/show_bug.cgi?id=146036
911
912         Reviewed by Timothy Hatcher.
913
914         * UIProcess/WebInspectorProxy.h:
915         * UIProcess/mac/WebInspectorProxyMac.mm:
916         (-[WKWebInspectorProxyObjCAdapter windowDidEnterFullScreen:]):
917         (-[WKWebInspectorProxyObjCAdapter windowDidExitFullScreen:]):
918         (WebKit::WebInspectorProxy::platformCanAttach):
919         (WebKit::WebInspectorProxy::windowFullScreenDidChange):
920         When entering / leaving full screen update attach availability to
921         potentially show / hide the frontend's docking buttons.
922
923         (WebKit::WebInspectorProxy::createInspectorWindow):
924         Allow a Web Inspector window to be a full screen auxillary window,
925         so that if the application with a WebView opens a detached inspector
926         window it can be shown on the same desktop as the full screen app.
927         Also, reduce the minimum window size requirements for full screen tiling.
928
929 2015-06-17  Tim Horton  <timothy_horton@apple.com>
930
931         Safari tabs still have shrunken content after coming out of fullscreen
932         https://bugs.webkit.org/show_bug.cgi?id=146037
933         <rdar://problem/21105960>
934
935         Reviewed by Simon Fraser and Darin Adler.
936
937         * UIProcess/WebPageProxy.h:
938         (WebKit::WebPageProxy::useFixedLayoutDidChange):
939         (WebKit::WebPageProxy::fixedLayoutSizeDidChange):
940         * UIProcess/WebPageProxy.messages.in:
941         * WebProcess/WebPage/WebPage.cpp:
942         (WebKit::WebPage::setUseFixedLayout):
943         (WebKit::WebPage::setFixedLayoutSize):
944         Keep the UI process up-to-date when fixed layout is enabled or the size changes.
945         This is important because these things can change from the Web process side too,
946         and the UI process uses its (potentially stale) version to do some short-circuiting.
947         This was causing us to fail to turn off fixed layout when it was turned
948         on from the Web process side (by TiledCoreAnimationDrawingArea).
949
950         * UIProcess/mac/WKViewLayoutStrategy.mm:
951         (-[WKViewDynamicSizeComputedFromMinimumDocumentSizeLayoutStrategy willChangeLayoutStrategy]):
952         Reset the view scale, which WKViewDynamicSizeComputedFromMinimumDocumentSizeLayoutStrategy
953         makes heavy use of, just like the others.
954
955 2015-06-17  Dan Bernstein  <mitz@apple.com>
956
957         [Cocoa] Expose UIDelegate::UIClient::close via WKUIDelegate
958         https://bugs.webkit.org/show_bug.cgi?id=145957
959
960         Reviewed by Darin Adler.
961
962         * UIProcess/API/Cocoa/WKUIDelegate.h: Added -webViewDidClose: to the protocol.
963         * UIProcess/Cocoa/UIDelegate.h: Added a webViewDidClose boolean to the delegate methods struct.
964         * UIProcess/Cocoa/UIDelegate.mm:
965         (WebKit::UIDelegate::setDelegate): Initialize the webViewDidClose boolean.
966         (WebKit::UIDelegate::UIClient::close): Changed to call the new delegate method. Left behind
967         code that calls the old private method if it’s implemented.
968
969 2015-06-17  Carlos Garcia Campos  <cgarcia@igalia.com>
970
971         [GTK] WEBKIT_CACHE_MODEL_DOCUMENT_VIEWER doesn't disable memory cache when set before the web process is launched
972         https://bugs.webkit.org/show_bug.cgi?id=146053
973
974         Reviewed by Martin Robinson.
975
976         The cache is disabled in WebProcess::platformSetCacheModel() when
977         the cache model is CacheModelDocumentViewer, but it's enabled
978         again by WebProcess::setMemoryCacheDisabled() when
979         memoryCacheDisabled creation parameter is processed. We need to
980         make sure the cache model and memoryCacheDisabled parameters are consistent.
981
982         * UIProcess/gtk/WebProcessPoolGtk.cpp:
983         (WebKit::WebProcessPool::platformInitializeWebProcess): Initialize
984         memoryCacheDisabled parameter to true if memory cache was
985         explicitly disabled or cache model is CacheModelDocumentViewer.
986
987 2015-06-17  Zan Dobersek  <zdobersek@igalia.com>
988
989         [WK2] valueForKey() shouldn't copy the defaults map
990         https://bugs.webkit.org/show_bug.cgi?id=146050
991
992         Reviewed by Sam Weinig.
993
994         * Shared/WebPreferencesStore.cpp:
995         (WebKit::valueForKey): Avoid copying the defaults HashMap by binding the return value to a reference.
996
997 2015-06-16  Carlos Garcia Campos  <cgarcia@igalia.com>
998
999         [GTK] Inhibit screen saver when playing full screen video
1000         https://bugs.webkit.org/show_bug.cgi?id=145795
1001
1002         Reviewed by Gustavo Noronha Silva.
1003
1004         Use Freedesktop.org DBus API to inhibit/unhinibit the screen saver
1005         when entering/leaving fullscreen.
1006
1007         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
1008         (screenSaverInhibitedCallback):
1009         (webkitWebViewBaseSendInhibitMessageToScreenSaver):
1010         (screenSaverProxyCreatedCallback):
1011         (webkitWebViewBaseInhibitScreenSaver):
1012         (webkitWebViewBaseUninhibitScreenSaver):
1013         (webkitWebViewBaseEnterFullScreen):
1014         (webkitWebViewBaseExitFullScreen):
1015
1016 2015-06-16  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
1017
1018         Purge PassRefPtr with Ref or RefPtr
1019         https://bugs.webkit.org/show_bug.cgi?id=146001
1020
1021         Reviewed by Darin Adler.
1022
1023         As step to remove PassRefPtr, this patch reduces use of PassRefPtr in WebKit2.
1024         If function can't return nullptr, PassRefPtr is changed with Ref. If not, the function
1025         returns RefPtr.
1026
1027         * DatabaseProcess/DatabaseToWebProcessConnection.cpp:
1028         (WebKit::DatabaseToWebProcessConnection::create):
1029         * DatabaseProcess/DatabaseToWebProcessConnection.h:
1030         * DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.h:
1031         (WebKit::DatabaseProcessIDBConnection::create):
1032         * DatabaseProcess/IndexedDB/UniqueIDBDatabase.h:
1033         (WebKit::UniqueIDBDatabase::create):
1034         * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.h:
1035         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1036         (WebKit::NetworkConnectionToWebProcess::create):
1037         * NetworkProcess/NetworkConnectionToWebProcess.h:
1038         * NetworkProcess/RemoteNetworkingContext.h:
1039         * PluginProcess/WebProcessConnection.cpp:
1040         (WebKit::WebProcessConnection::create):
1041         * PluginProcess/WebProcessConnection.h:
1042         * Shared/API/APINumber.h:
1043         (API::Number::create):
1044         * Shared/API/APISecurityOrigin.h:
1045         (API::SecurityOrigin::createFromString):
1046         (API::SecurityOrigin::create):
1047         * Shared/API/APISerializedScriptValue.h:
1048         (API::SerializedScriptValue::create):
1049         (API::SerializedScriptValue::adopt):
1050         * Shared/APIWebArchive.h:
1051         * Shared/APIWebArchive.mm:
1052         (API::WebArchive::create):
1053         * Shared/APIWebArchiveResource.h:
1054         * Shared/APIWebArchiveResource.mm:
1055         (API::WebArchiveResource::create):
1056         * Shared/AsyncRequest.h:
1057         * UIProcess/API/efl/ewk_url_request_private.h:
1058         (EwkUrlRequest::create):
1059         * UIProcess/API/efl/ewk_url_response_private.h:
1060         (EwkUrlResponse::create):
1061         * UIProcess/API/efl/ewk_url_scheme_request_private.h:
1062         (EwkUrlSchemeRequest::create):
1063         * UIProcess/API/efl/ewk_window_features_private.h:
1064         (EwkWindowFeatures::create):
1065         * UIProcess/API/efl/tests/test_ewk2_object.cpp:
1066         (TestEwkObject1::create):
1067         (TestEwkObject2::create):
1068         * UIProcess/API/gtk/WebKitBatteryProvider.cpp:
1069         (WebKitBatteryProvider::create):
1070         * UIProcess/API/gtk/WebKitBatteryProvider.h:
1071         * UIProcess/API/gtk/WebKitColorChooser.cpp:
1072         (WebKit::WebKitColorChooser::create):
1073         * UIProcess/API/gtk/WebKitGeolocationProvider.cpp:
1074         (WebKitGeolocationProvider::create):
1075         * UIProcess/API/gtk/WebKitNotificationProvider.cpp:
1076         (WebKitNotificationProvider::create):
1077         * UIProcess/API/gtk/WebKitNotificationProvider.h:
1078         * UIProcess/GeolocationPermissionRequestProxy.h:
1079         (WebKit::GeolocationPermissionRequestProxy::create):
1080         * UIProcess/InspectorServer/HTTPRequest.h:
1081         (WebKit::HTTPRequest::create):
1082         * UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManager.cpp:
1083         (WebKit::WebSoupCustomProtocolRequestManager::create):
1084         * UIProcess/Network/NetworkProcessProxy.cpp:
1085         (WebKit::NetworkProcessProxy::create):
1086         * UIProcess/Network/NetworkProcessProxy.h:
1087         * UIProcess/Notifications/NotificationPermissionRequest.cpp:
1088         (WebKit::NotificationPermissionRequest::create):
1089         * UIProcess/Notifications/NotificationPermissionRequest.h:
1090         * UIProcess/Notifications/WebNotification.h:
1091         (WebKit::WebNotification::create):
1092         * UIProcess/WebPageProxy.cpp:
1093         (WebKit::WebPageProxy::scriptValueCallback):
1094         * UIProcess/WebVibrationProxy.cpp:
1095         (WebKit::WebVibrationProxy::create):
1096         * UIProcess/WebVibrationProxy.h:
1097         * UIProcess/WebViewportAttributes.h:
1098         (WebKit::WebViewportAttributes::create):
1099         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1100         (WebKit::WebsiteDataStore::createNonPersistent):
1101         (WebKit::WebsiteDataStore::create):
1102         * UIProcess/WebsiteData/WebsiteDataStore.h:
1103         * UIProcess/gtk/WebColorPickerGtk.cpp:
1104         (WebKit::WebColorPickerGtk::create):
1105         * UIProcess/gtk/WebColorPickerGtk.h:
1106         * UIProcess/gtk/WebContextMenuProxyGtk.h:
1107         (WebKit::WebContextMenuProxyGtk::create):
1108         * UIProcess/gtk/WebPopupMenuProxyGtk.h:
1109         (WebKit::WebPopupMenuProxyGtk::create):
1110         * UIProcess/mac/ViewSnapshotStore.h:
1111         * UIProcess/mac/ViewSnapshotStore.mm:
1112         (WebKit::ViewSnapshot::create):
1113         * UIProcess/mac/WebColorPickerMac.h:
1114         * UIProcess/mac/WebColorPickerMac.mm:
1115         (WebKit::WebColorPickerMac::create):
1116         * UIProcess/mac/WebContextMenuProxyMac.h:
1117         (WebKit::WebContextMenuProxyMac::create):
1118         * UIProcess/mac/WebPopupMenuProxyMac.h:
1119         (WebKit::WebPopupMenuProxyMac::create):
1120         * WebProcess/Databases/IndexedDB/WebIDBFactoryBackend.h:
1121         * WebProcess/Databases/WebToDatabaseProcessConnection.h:
1122         (WebKit::WebToDatabaseProcessConnection::create):
1123         * WebProcess/FullScreen/WebFullScreenManager.cpp:
1124         (WebKit::WebFullScreenManager::create):
1125         * WebProcess/FullScreen/WebFullScreenManager.h:
1126         * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
1127         (WebKit::InjectedBundleRangeHandle::create):
1128         * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.h:
1129         * WebProcess/InjectedBundle/InjectedBundleBackForwardList.h:
1130         (WebKit::InjectedBundleBackForwardList::create):
1131
1132 2015-06-16  Carlos Alberto Lopez Perez  <clopez@igalia.com>
1133
1134         Unreviewed build fix after r185615.
1135
1136         * UIProcess/API/gtk/WebKitWebContext.cpp:
1137         (webkit_web_context_clear_cache): Comment the call to the code
1138         removed and write down the bugzilla link for reimplementation.
1139
1140 2015-06-16  Anders Carlsson  <andersca@apple.com>
1141
1142         Get rid of performAPICallbackWithSecurityOriginDataVector
1143         https://bugs.webkit.org/show_bug.cgi?id=146039
1144
1145         Reviewed by Andreas Kling.
1146
1147         Get rid of performAPICallbackWithSecurityOriginDataVector since it's now no longer used
1148         and add a bunch of includes to make up for SecurityOriginData.h no longer including GenericCallback.h.
1149         * DatabaseProcess/DatabaseProcess.cpp:
1150         * DatabaseProcess/DatabaseProcess.h:
1151         * DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:
1152         * DatabaseProcess/IndexedDB/UniqueIDBDatabase.h:
1153         * Shared/SecurityOriginData.cpp:
1154         (WebKit::performAPICallbackWithSecurityOriginDataVector): Deleted.
1155         * Shared/SecurityOriginData.h:
1156         * Shared/WebsiteData/WebsiteData.cpp:
1157         * WebProcess/Databases/IndexedDB/WebIDBServerConnection.cpp:
1158         * WebProcess/MediaCache/WebMediaKeyStorageManager.cpp:
1159
1160 2015-06-16  Ryuan Choi  <ryuan.choi@navercorp.com>
1161
1162         Unreviewed build fix attempt on CMake based port after r185623.
1163
1164         * CMakeLists.txt:
1165
1166 2015-06-16  Anders Carlsson  <andersca@apple.com>
1167
1168         Move LocalStorageDetails into the local storage database tracker
1169         https://bugs.webkit.org/show_bug.cgi?id=146034
1170
1171         Reviewed by Andreas Kling.
1172
1173         * UIProcess/API/C/WKKeyValueStorageManager.cpp:
1174         (WKKeyValueStorageManagerGetStorageDetailsByOrigin):
1175         (WKKeyValueStorageManagerDeleteAllEntries):
1176         * UIProcess/LocalStorageDetails.h: Removed.
1177         * UIProcess/Storage/LocalStorageDatabaseTracker.cpp:
1178         (WebKit::LocalStorageDatabaseTracker::originDetails):
1179         (WebKit::LocalStorageDatabaseTracker::details): Deleted.
1180         * UIProcess/Storage/LocalStorageDatabaseTracker.h:
1181         * UIProcess/Storage/StorageManager.cpp:
1182         (WebKit::StorageManager::getLocalStorageOriginDetails):
1183         (WebKit::StorageManager::getLocalStorageDetailsByOrigin): Deleted.
1184         (WebKit::StorageManager::deleteAllLocalStorageEntries): Deleted.
1185         * UIProcess/Storage/StorageManager.h:
1186         * WebKit2.xcodeproj/project.pbxproj:
1187
1188 2015-06-16  Dan Bernstein  <mitz@apple.com>
1189
1190         Removed the WebKit2SandboxProfiles target.
1191
1192         Rubber-stamped by Anders Carlsson.
1193
1194         WebKit2SandboxProfiles was just an alias for the Sandbox Profiles target, and it’s not
1195         needed anymore.
1196
1197         * WebKit2.xcodeproj/project.pbxproj:
1198
1199 2015-06-16  Anders Carlsson  <andersca@apple.com>
1200
1201         Fold WebKeyValueStorageManager into WKKeyValueStorageManager
1202         https://bugs.webkit.org/show_bug.cgi?id=146030
1203
1204         Reviewed by Andreas Kling.
1205
1206         * UIProcess/API/C/WKAPICast.h:
1207         * UIProcess/API/C/WKContext.cpp:
1208         (WKContextGetKeyValueStorageManager):
1209         * UIProcess/API/C/WKKeyValueStorageManager.cpp:
1210         (WKKeyValueStorageManagerGetTypeID):
1211         (WKKeyValueStorageManagerGetOriginKey):
1212         (WKKeyValueStorageManagerGetCreationTimeKey):
1213         (WKKeyValueStorageManagerGetModificationTimeKey):
1214         (WKKeyValueStorageManagerGetKeyValueStorageOrigins):
1215         (WKKeyValueStorageManagerGetStorageDetailsByOrigin):
1216         (WKKeyValueStorageManagerDeleteEntriesForOrigin):
1217         (WKKeyValueStorageManagerDeleteAllEntries):
1218         * UIProcess/WebKeyValueStorageManager.cpp: Removed.
1219         (WebKit::WebKeyValueStorageManager::supplementName): Deleted.
1220         (WebKit::WebKeyValueStorageManager::originKey): Deleted.
1221         (WebKit::WebKeyValueStorageManager::creationTimeKey): Deleted.
1222         (WebKit::WebKeyValueStorageManager::modificationTimeKey): Deleted.
1223         (WebKit::WebKeyValueStorageManager::create): Deleted.
1224         (WebKit::WebKeyValueStorageManager::WebKeyValueStorageManager): Deleted.
1225         (WebKit::WebKeyValueStorageManager::~WebKeyValueStorageManager): Deleted.
1226         (WebKit::WebKeyValueStorageManager::refWebContextSupplement): Deleted.
1227         (WebKit::WebKeyValueStorageManager::derefWebContextSupplement): Deleted.
1228         (WebKit::WebKeyValueStorageManager::getKeyValueStorageOrigins): Deleted.
1229         (WebKit::WebKeyValueStorageManager::getStorageDetailsByOrigin): Deleted.
1230         (WebKit::WebKeyValueStorageManager::deleteEntriesForOrigin): Deleted.
1231         (WebKit::WebKeyValueStorageManager::deleteAllEntries): Deleted.
1232         * UIProcess/WebKeyValueStorageManager.h: Removed.
1233         * UIProcess/WebProcessPool.cpp:
1234         * WebKit2.xcodeproj/project.pbxproj:
1235
1236 2015-06-16  Alex Christensen  <achristensen@webkit.org>
1237
1238         CMake build fix after r185615.
1239
1240         * CMakeLists.txt:
1241         Remove WebResourceCacheManager from CMake build system.
1242
1243 2015-06-16  Alex Christensen  <achristensen@webkit.org>
1244
1245         [Content Extensions] Implement branch compaction for DFA bytecode.
1246         https://bugs.webkit.org/show_bug.cgi?id=145619
1247
1248         Reviewed by Benjamin Poulain.
1249
1250         * UIProcess/API/APIUserContentExtensionStore.h:
1251         Increment version number to reflect changes to bytecode.
1252
1253 2015-06-16  Anders Carlsson  <andersca@apple.com>
1254
1255         WebResourceCacheManager is unused, get rid of it
1256         https://bugs.webkit.org/show_bug.cgi?id=146027
1257
1258         Reviewed by Sam Weinig.
1259
1260         * DerivedSources.make:
1261         * UIProcess/API/C/WKAPICast.h:
1262         * UIProcess/API/C/WKContext.cpp:
1263         * UIProcess/WebProcessPool.cpp:
1264         * UIProcess/WebResourceCacheManagerProxy.cpp: Removed.
1265         (WebKit::WebResourceCacheManagerProxy::supplementName): Deleted.
1266         (WebKit::WebResourceCacheManagerProxy::create): Deleted.
1267         (WebKit::WebResourceCacheManagerProxy::WebResourceCacheManagerProxy): Deleted.
1268         (WebKit::WebResourceCacheManagerProxy::~WebResourceCacheManagerProxy): Deleted.
1269         (WebKit::WebResourceCacheManagerProxy::processPoolDestroyed): Deleted.
1270         (WebKit::WebResourceCacheManagerProxy::processDidClose): Deleted.
1271         (WebKit::WebResourceCacheManagerProxy::shouldTerminate): Deleted.
1272         (WebKit::WebResourceCacheManagerProxy::refWebContextSupplement): Deleted.
1273         (WebKit::WebResourceCacheManagerProxy::derefWebContextSupplement): Deleted.
1274         (WebKit::WebResourceCacheManagerProxy::getCacheOrigins): Deleted.
1275         (WebKit::WebResourceCacheManagerProxy::didGetCacheOrigins): Deleted.
1276         (WebKit::WebResourceCacheManagerProxy::clearCacheForOrigin): Deleted.
1277         (WebKit::WebResourceCacheManagerProxy::clearCacheForAllOrigins): Deleted.
1278         * UIProcess/WebResourceCacheManagerProxy.h: Removed.
1279         * UIProcess/WebResourceCacheManagerProxy.messages.in: Removed.
1280         * WebKit2.xcodeproj/project.pbxproj:
1281         * WebProcess/ResourceCache/WebResourceCacheManager.cpp: Removed.
1282         (WebKit::WebResourceCacheManager::supplementName): Deleted.
1283         (WebKit::WebResourceCacheManager::WebResourceCacheManager): Deleted.
1284         (WebKit::WebResourceCacheManager::getCacheOrigins): Deleted.
1285         (WebKit::WebResourceCacheManager::returnCacheOrigins): Deleted.
1286         (WebKit::WebResourceCacheManager::clearCacheForOrigin): Deleted.
1287         (WebKit::WebResourceCacheManager::clearCacheForAllOrigins): Deleted.
1288         * WebProcess/ResourceCache/WebResourceCacheManager.h: Removed.
1289         * WebProcess/ResourceCache/WebResourceCacheManager.messages.in: Removed.
1290         * WebProcess/ResourceCache/cf/WebResourceCacheManagerCFNet.mm: Removed.
1291         (WebKit::partitionName): Deleted.
1292         (WebKit::WebResourceCacheManager::cfURLCacheHostNamesWithCallback): Deleted.
1293         (WebKit::WebResourceCacheManager::clearCFURLCacheForHostNames): Deleted.
1294         * WebProcess/WebProcess.cpp:
1295         (WebKit::WebProcess::WebProcess): Deleted.
1296
1297 2015-06-16  Alex Christensen  <achristensen@webkit.org>
1298
1299         CMake build fix after r185601.
1300
1301         * CMakeLists.txt:
1302         Remove application cache manager classes.
1303
1304 2015-06-16  Anders Carlsson  <andersca@apple.com>
1305
1306         Stop calling into WebResourceCacheManager
1307         https://bugs.webkit.org/show_bug.cgi?id=146026
1308
1309         Reviewed by Andreas Kling.
1310
1311         Copy the cache clearing code into NetworkProcessCocoa in preparation of getting rid of
1312         the WebResourceCacheManager code.
1313
1314         * NetworkProcess/NetworkProcess.cpp:
1315         (WebKit::fetchDiskCacheEntries):
1316         (WebKit::clearDiskCacheEntries):
1317         (WebKit::cfURLCacheOrigins): Deleted.
1318         * NetworkProcess/NetworkProcess.h:
1319         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
1320         (WebKit::partitionName):
1321         (WebKit::NetworkProcess::cfURLCacheOrigins):
1322         (WebKit::NetworkProcess::clearCFURLCacheForOrigins):
1323
1324 2015-06-16  Anders Carlsson  <andersca@apple.com>
1325
1326         Get rid of the application cache manager classes, they are no longer used
1327         https://bugs.webkit.org/show_bug.cgi?id=146024
1328
1329         Reviewed by Sam Weinig.
1330
1331         * DerivedSources.make:
1332         * UIProcess/API/C/WKAPICast.h:
1333         * UIProcess/API/C/WKContext.cpp:
1334         * UIProcess/WebApplicationCacheManagerProxy.cpp: Removed.
1335         (WebKit::WebApplicationCacheManagerProxy::supplementName): Deleted.
1336         (WebKit::WebApplicationCacheManagerProxy::create): Deleted.
1337         (WebKit::WebApplicationCacheManagerProxy::WebApplicationCacheManagerProxy): Deleted.
1338         (WebKit::WebApplicationCacheManagerProxy::~WebApplicationCacheManagerProxy): Deleted.
1339         (WebKit::WebApplicationCacheManagerProxy::processPoolDestroyed): Deleted.
1340         (WebKit::WebApplicationCacheManagerProxy::processDidClose): Deleted.
1341         (WebKit::WebApplicationCacheManagerProxy::shouldTerminate): Deleted.
1342         (WebKit::WebApplicationCacheManagerProxy::refWebContextSupplement): Deleted.
1343         (WebKit::WebApplicationCacheManagerProxy::derefWebContextSupplement): Deleted.
1344         (WebKit::WebApplicationCacheManagerProxy::getApplicationCacheOrigins): Deleted.
1345         (WebKit::WebApplicationCacheManagerProxy::didGetApplicationCacheOrigins): Deleted.
1346         (WebKit::WebApplicationCacheManagerProxy::deleteEntriesForOrigin): Deleted.
1347         (WebKit::WebApplicationCacheManagerProxy::deleteAllEntries): Deleted.
1348         * UIProcess/WebApplicationCacheManagerProxy.h: Removed.
1349         * UIProcess/WebApplicationCacheManagerProxy.messages.in: Removed.
1350         * UIProcess/WebProcessPool.cpp:
1351         * WebKit2.xcodeproj/project.pbxproj:
1352         * WebProcess/ApplicationCache/WebApplicationCacheManager.cpp: Removed.
1353         (WebKit::WebApplicationCacheManager::supplementName): Deleted.
1354         (WebKit::WebApplicationCacheManager::WebApplicationCacheManager): Deleted.
1355         (WebKit::WebApplicationCacheManager::getApplicationCacheOrigins): Deleted.
1356         (WebKit::WebApplicationCacheManager::deleteEntriesForOrigin): Deleted.
1357         (WebKit::WebApplicationCacheManager::deleteAllEntries): Deleted.
1358         (WebKit::WebApplicationCacheManager::setAppCacheMaximumSize): Deleted.
1359         * WebProcess/ApplicationCache/WebApplicationCacheManager.h: Removed.
1360         * WebProcess/ApplicationCache/WebApplicationCacheManager.messages.in: Removed.
1361         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1362         (WebKit::InjectedBundle::clearApplicationCache):
1363         (WebKit::InjectedBundle::setAppCacheMaximumSize):
1364         * WebProcess/WebProcess.cpp:
1365         (WebKit::WebProcess::WebProcess): Deleted.
1366
1367 2015-06-16  Brady Eidson  <beidson@apple.com>
1368
1369         IDB: Records table migration doesn't work with all versions of SQLite.
1370         https://bugs.webkit.org/show_bug.cgi?id=145993
1371
1372         Reviewed by Darin Adler, provisionally reviewed by Jon Lee.
1373
1374         * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp:
1375         (WebKit::v1RecordsTableSchema):
1376         (WebKit::v1RecordsTableSchemaAlternate):
1377         (WebKit::v2RecordsTableSchema):
1378         (WebKit::v2RecordsTableSchemaAlternate):
1379         (WebKit::createOrMigrateRecordsTableIfNecessary): Check both v1 and v1 Alternate whenever we check for the v1 schema.
1380           Ditto for the v2 schema. Crash all builds if the current schema is none of these.
1381
1382 2015-06-16  Dan Bernstein  <mitz@apple.com>
1383
1384         Build fix.
1385
1386         * mac/postprocess-framework-headers.sh:
1387
1388 2015-06-16  Commit Queue  <commit-queue@webkit.org>
1389
1390         Unreviewed, rolling out r185552.
1391         https://bugs.webkit.org/show_bug.cgi?id=146015
1392
1393          It broke some WK2 API tests on EFL bots (Requested by
1394         gyuyoung on #webkit).
1395
1396         Reverted changeset:
1397
1398         "[EFL] Make send/receive messages to communicate the Web and
1399         UI Processes using Injected Bundle."
1400         https://bugs.webkit.org/show_bug.cgi?id=145685
1401         http://trac.webkit.org/changeset/185552
1402
1403 2015-06-16  Ryuan Choi  <ryuan.choi@navercorp.com>
1404
1405         [EFL] Add API tests for ewk_page
1406         https://bugs.webkit.org/show_bug.cgi?id=146004
1407
1408         Reviewed by Gyuyoung Kim.
1409
1410         Add unit test for load_started/load_finished callbacks of ewk_page.
1411
1412         * PlatformEfl.cmake:
1413         * UIProcess/API/efl/tests/extensions/extension_sample.cpp:
1414         * UIProcess/API/efl/tests/test_ewk2_page.cpp: Added.
1415         (EWK2PageTest::messageReceivedCallback):
1416         (EWK2PageTest::EWK2PageTest):
1417         (TEST_F):
1418
1419 2015-06-15  Simon Fraser  <simon.fraser@apple.com>
1420
1421         [iOS WK2] position:fixed elements sometimes truncated on scroll view bouncing
1422         https://bugs.webkit.org/show_bug.cgi?id=146000
1423         rdar://problem/19448439
1424
1425         Reviewed by Benjamin Poulain.
1426         
1427         When in the middle of a rubber-band (UIScrollView bounce), we could send a bad 
1428         fixed position rect down to WebCore, causing 100% height elements to get laid out
1429         at the wrong height, possible too short. This occurred when -_updateVisibleContentRects
1430         said we were in a stable state, but the rubber-band offset caused WebPageProxy::computeCustomFixedPositionRect()
1431         to compute a bad rect via constrainedUnobscuredRect.intersect(documentRect).
1432         
1433         Fix by not claiming to be in a stable state during rubber-banding. Added _scrollViewIsRubberBanding
1434         to compute that, taking care with floating point comparisons for 3x devices.
1435
1436         * UIProcess/API/Cocoa/WKWebView.mm:
1437         (isGreaterInDevicePixels):
1438         (-[WKWebView _scrollViewIsRubberBanding]):
1439         (-[WKWebView _updateVisibleContentRects]):
1440
1441 2015-06-15  Ryuan Choi  <ryuan.choi@navercorp.com>
1442
1443         Fix build break when ENABLE_SECCOMP_FILTERS is ON
1444         https://bugs.webkit.org/show_bug.cgi?id=145967
1445
1446         Reviewed by Carlos Garcia Campos.
1447
1448         Since r183189, ArgumentEncoder::addAttachment requires rvalue reference.
1449
1450         * Shared/linux/SeccompFilters/OpenSyscall.cpp:
1451         (WebKit::OpenSyscallResult::encode): Use WTF::move().
1452
1453 2015-06-15  Chris Dumez  <cdumez@apple.com>
1454
1455         [WK2] BrowsingContextController.loadData API is leaking Navigation objects
1456         https://bugs.webkit.org/show_bug.cgi?id=145977
1457         <rdar://problem/21305706>
1458
1459         Reviewed by Darin Adler.
1460
1461         BrowsingContextController.loadData API was leaking Navigation objects.
1462         The issue was due to WebPageProxy::loadData() creating a Navigation
1463         object but not passing along the navigationID to the WebProcess when
1464         sending the Messages::WebPage::LoadData IPC. As a result, the
1465         WebProcess would use 0 as navigationID and we would end up creating a
1466         new Navigation object later on for the same navigation.
1467
1468         * UIProcess/WebPageProxy.cpp:
1469         (WebKit::WebPageProxy::loadData):
1470         * WebProcess/WebPage/WebPage.cpp:
1471         (WebKit::WebPage::loadData):
1472         * WebProcess/WebPage/WebPage.h:
1473         * WebProcess/WebPage/WebPage.messages.in:
1474
1475 2015-06-15  Dan Bernstein  <mitz@apple.com>
1476
1477         REGRESSION (r185298): Databases service has Web Content service’s entitlements
1478         https://bugs.webkit.org/show_bug.cgi?id=145980
1479
1480         Reviewed by Darin Adler.
1481
1482         * Configurations/DatabaseService.xcconfig: Set WK_XPC_SERVICE_IOS_ENTITLEMENTS_BASE to
1483         Databases-iOS.
1484
1485 2015-06-11  Jon Lee  <jonlee@apple.com>
1486
1487         [WK2] Add allowsPictureInPictureMediaPlayback
1488         https://bugs.webkit.org/show_bug.cgi?id=145901
1489         rdar://problem/21349851
1490
1491         Reviewed by Anders Carlsson.
1492
1493         Replace _allowsAlternateFullscreen with allowsPictureInPictureMediaPlayback.
1494
1495         * UIProcess/API/Cocoa/WKWebViewConfiguration.h: Add allowsPictureInPictureMediaPlayback.
1496         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
1497         (-[WKWebViewConfiguration init]): Remove _allowsAlternateFullscreen.
1498         (-[WKWebViewConfiguration copyWithZone:]): Replace the variable.
1499         (-[WKWebViewConfiguration _allowsAlternateFullscreen]): Deleted.
1500         (-[WKWebViewConfiguration _setAllowsAlternateFullscreen:]): Deleted.
1501         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h: Remove the SPI.
1502
1503         * UIProcess/API/Cocoa/WKWebView.mm:
1504         (-[WKWebView initWithFrame:configuration:]): Update to use the new API.
1505
1506 2015-06-12  Alexey Proskuryakov  <ap@apple.com>
1507
1508         -[WKWebView evaluateJavaScript] provides a misleading error when the return cannot be serialized
1509         https://bugs.webkit.org/show_bug.cgi?id=145900
1510
1511         Reviewed by Sam Weinig.
1512
1513         We used to conflate to cases: (1) when there was a JavaScript exception, and
1514         (2) when the result could not be serialized for IPC. Turns out that it was quite
1515         misleading!
1516
1517         * UIProcess/API/C/WKPage.cpp:
1518         (WKPageRunJavaScriptInMainFrame):
1519         * UIProcess/API/Cocoa/WKError.h:
1520         * UIProcess/API/Cocoa/WKError.mm:
1521         (localizedDescriptionForErrorCode):
1522         * UIProcess/API/Cocoa/WKWebView.mm:
1523         (-[WKWebView evaluateJavaScript:completionHandler:]):
1524         * UIProcess/WebPageProxy.cpp:
1525         (WebKit::WebPageProxy::runJavaScriptInMainFrame):
1526         (WebKit::WebPageProxy::scriptValueCallback):
1527         * UIProcess/WebPageProxy.h:
1528         * UIProcess/WebPageProxy.messages.in:
1529         * WebProcess/WebPage/WebPage.cpp:
1530         (WebKit::WebPage::runJavaScriptInMainFrame):
1531         * UIProcess/API/gtk/WebKitWebView.cpp:
1532         (webkit_web_view_run_javascript):
1533         (resourcesStreamReadCallback):
1534
1535 2015-06-15  Carlos Garcia Campos  <cgarcia@igalia.com>
1536
1537         [SOUP] Custom URI schemes don't work for requests containing a fragment identifier
1538         https://bugs.webkit.org/show_bug.cgi?id=145969
1539
1540         Reviewed by Sergio Villar Senin.
1541
1542         Use the WebKitSoupRequestGeneric request instead of creating a new one
1543         from the SoupRequest URI, since that is the network one and doesn't
1544         contain the fragment identifier part.
1545
1546         * Shared/Network/CustomProtocols/soup/CustomProtocolManagerImpl.cpp:
1547         (WebKit::CustomProtocolManagerImpl::start):
1548
1549 2015-06-15  Hyungwook Lee  <hyungwook.lee@navercorp.com>
1550
1551         [EFL] Make send/receive messages to communicate the Web and UI Processes using Injected Bundle.
1552         https://bugs.webkit.org/show_bug.cgi?id=145685
1553
1554         Reviewed by Gyuyoung Kim.
1555
1556         To have extensible port specific API facility using Injected Bundle,
1557         we need to load libewebkit_extension_manager.so in default that is same as what gtk port does.
1558
1559         * UIProcess/API/efl/ewk_context.cpp:
1560         (EwkContext::EwkContext):
1561         (EwkContext::~EwkContext):
1562         (EwkContext::findOrCreateWrapper):
1563         (bundlePathForExtension):
1564         (EwkContext::create): Deleted.
1565         * UIProcess/API/efl/ewk_context_private.h:
1566         * WebProcess/efl/ExtensionManagerEfl.cpp:
1567         (WebKit::ExtensionManagerEfl::initialize):
1568
1569 2015-06-15  Carlos Garcia Campos  <cgarcia@igalia.com>
1570
1571         [SOUP] Move WebKitSoupRequestGeneric to platform layer
1572         https://bugs.webkit.org/show_bug.cgi?id=145968
1573
1574         Reviewed by Sergio Villar Senin.
1575
1576         * PlatformEfl.cmake: Remove WebKitSoupRequestGeneric.
1577         * PlatformGTK.cmake: Ditto.
1578         * Shared/Network/CustomProtocols/soup/CustomProtocolManagerImpl.cpp:
1579         * Shared/Network/CustomProtocols/soup/CustomProtocolManagerImpl.h:
1580
1581 2015-06-15  Csaba Osztrogonác  <ossy@webkit.org>
1582
1583         Fix unused private field warning in PageBanner.h
1584         https://bugs.webkit.org/show_bug.cgi?id=145925
1585
1586         Reviewed by Darin Adler.
1587
1588         * WebProcess/WebPage/PageBanner.cpp:
1589         (WebKit::PageBanner::~PageBanner):
1590         * WebProcess/WebPage/PageBanner.h: Initialize m_type, m_webPage, m_mouseDownInBanner, and m_isHidden here instead of in the constructor.
1591         * WebProcess/WebPage/mac/PageBannerMac.mm: Use PLATFORM(MAC) instead of !PLATFORM(IOS), they are same in objc files.
1592
1593 2015-06-15  Carlos Garcia Campos  <cgarcia@igalia.com>
1594
1595         [SOUP] Make WebKitSoupRequestGeneric independent from CustomProtocolManagerImpl
1596         https://bugs.webkit.org/show_bug.cgi?id=145966
1597
1598         Reviewed by Sergio Villar Senin.
1599
1600         Add WebKitSoupRequestGenericClient with start and finish methods,
1601         that are implemented by WebKitSoupRequestGeneric.
1602         This allows us to move WebKitSoupRequestGeneric to platform layer.
1603
1604         * Shared/Network/CustomProtocols/soup/CustomProtocolManagerImpl.cpp:
1605         (WebKit::CustomProtocolManagerImpl::registerScheme):
1606         (WebKit::CustomProtocolManagerImpl::start):
1607         * Shared/Network/CustomProtocols/soup/CustomProtocolManagerImpl.h:
1608         * WebProcess/soup/WebKitSoupRequestGeneric.cpp:
1609         (webkitSoupRequestGenericSendAsync):
1610         (webkitSoupRequestGenericSendFinish):
1611         * WebProcess/soup/WebKitSoupRequestGeneric.h:
1612         * WebProcess/soup/WebKitSoupRequestGenericClient.h: Added.
1613
1614 2015-06-14  Dan Bernstein  <mitz@apple.com>
1615
1616         Fixed the build.
1617
1618         * mac/postprocess-framework-headers.sh:
1619
1620 2015-06-14  Michael Catanzaro  <mcatanzaro@igalia.com>
1621
1622         Format string misuse in DatabaseProcessIDBConnection.cpp and UniqueIDBDatabaseBackingStoreSQLite.cpp
1623         https://bugs.webkit.org/show_bug.cgi?id=145960
1624
1625         Reviewed by Darin Adler.
1626
1627         Use PRIu64 and PRIi64 to print uint64_t and int64_t, respectively. These things are
1628         different types on x86_64 Linux (unsigned long) and on Mac (unsigned long long).
1629
1630         * DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.cpp:
1631         (WebKit::DatabaseProcessIDBConnection::getOrEstablishIDBDatabaseMetadata):
1632         (WebKit::DatabaseProcessIDBConnection::deleteDatabase):
1633         (WebKit::DatabaseProcessIDBConnection::openTransaction):
1634         (WebKit::DatabaseProcessIDBConnection::beginTransaction):
1635         (WebKit::DatabaseProcessIDBConnection::commitTransaction):
1636         (WebKit::DatabaseProcessIDBConnection::resetTransaction):
1637         (WebKit::DatabaseProcessIDBConnection::rollbackTransaction):
1638         (WebKit::DatabaseProcessIDBConnection::changeDatabaseVersion):
1639         (WebKit::DatabaseProcessIDBConnection::createObjectStore):
1640         (WebKit::DatabaseProcessIDBConnection::deleteObjectStore):
1641         (WebKit::DatabaseProcessIDBConnection::clearObjectStore):
1642         (WebKit::DatabaseProcessIDBConnection::createIndex):
1643         (WebKit::DatabaseProcessIDBConnection::deleteIndex):
1644         (WebKit::DatabaseProcessIDBConnection::putRecord):
1645         (WebKit::DatabaseProcessIDBConnection::getRecord):
1646         (WebKit::DatabaseProcessIDBConnection::count):
1647         (WebKit::DatabaseProcessIDBConnection::deleteRange):
1648         (WebKit::DatabaseProcessIDBConnection::openCursor):
1649         (WebKit::DatabaseProcessIDBConnection::cursorAdvance):
1650         (WebKit::DatabaseProcessIDBConnection::cursorIterate):
1651         * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp:
1652         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::deleteObjectStore):
1653         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::clearObjectStore):
1654         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::deleteIndex):
1655         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::generateKeyNumber):
1656         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::keyExistsInObjectStore):
1657         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::putRecord):
1658         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::uncheckedPutIndexRecord):
1659         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::deleteRecord):
1660         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::getKeyRecordFromObjectStore):
1661         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::getKeyRangeRecordFromObjectStore):
1662         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::advanceCursor):
1663
1664 2015-06-14  Dan Bernstein  <mitz@apple.com>
1665
1666         [Cocoa] Clean up postprocess-framework-headers.sh
1667         https://bugs.webkit.org/show_bug.cgi?id=145962
1668
1669         Reviewed by Darin Adler.
1670
1671         * mac/postprocess-framework-headers.sh: Gather all the sed options in a variable, and then
1672         run sed only once on each header. Also, correctly exit with the sed return value if it
1673         fails.
1674
1675 2015-06-13  Chris Dumez  <cdumez@apple.com>
1676
1677         [WK2] API::Navigation objects are leaked on history navigation to HistoryItems in PageCache
1678         https://bugs.webkit.org/show_bug.cgi?id=145948
1679
1680         Reviewed by Darin Adler.
1681
1682         API::Navigation objects were leaked on history navigation to
1683         HistoryItems in PageCache. In such case, we would create 2 Navigation
1684         objects instead of 1 and the first one would be leaked. The reason
1685         we create the second one is because we fail to pass along the
1686         navigationID from the UIProcess to the WebProcess and then back to the
1687         UIProcess. On the IPC back to the UIProcess, the navigationID ends up
1688         being 0 so the UIProcess creates a new Navigation object, thinking that
1689         the load was triggered by the WebContent process.
1690
1691         We now pass along the navigationID, even if the HistoryItem is in the
1692         PageCache and we end up reusing the cached DocumentLoader, instead of
1693         creating a new one. A new updateCachedDocumentLoader() delegate is
1694         added to the FrameLoaderClient, similarly to the pre-existing
1695         createDocumentLoader() but for the case where the DocumentLoader gets
1696         reused.
1697
1698         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1699         (WebKit::WebFrameLoaderClient::updateCachedDocumentLoader):
1700         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
1701         * WebProcess/WebPage/WebPage.cpp:
1702         (WebKit::WebPage::goForward):
1703         (WebKit::WebPage::goBack):
1704         (WebKit::WebPage::goToBackForwardItem):
1705         (WebKit::WebPage::updateCachedDocumentLoader):
1706         * WebProcess/WebPage/WebPage.h:
1707
1708 2015-06-12  Gavin Barraclough  <barraclough@apple.com>
1709
1710         Add private API to force page to always run at foreground priority
1711         https://bugs.webkit.org/show_bug.cgi?id=145946
1712         <rdar://problem/21267221>
1713
1714         Reviewed by Anders Carlsson.
1715
1716         * UIProcess/API/Cocoa/WKWebView.mm:
1717         (-[WKWebView initWithFrame:configuration:]):
1718             - copy _alwaysRunsAtForegroundPriority to WebPageConfiguration.
1719         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
1720         (-[WKWebViewConfiguration copyWithZone:]):
1721         (-[WKWebViewConfiguration _alwaysRunsAtForegroundPriority]):
1722         (-[WKWebViewConfiguration _setAlwaysRunsAtForegroundPriority:]):
1723             - added _alwaysRunsAtForegroundPriority.
1724         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
1725             - added _alwaysRunsAtForegroundPriority.
1726         * UIProcess/WebPageProxy.cpp:
1727         (WebKit::WebPageProxy::WebPageProxy):
1728             - initialize m_alwaysRunsAtForegroundPriority.
1729         (WebKit::WebPageProxy::updateActivityToken):
1730             - if m_alwaysRunsAtForegroundPriority is set always take the foreground activity token.
1731         * UIProcess/WebPageProxy.h:
1732             - added m_alwaysRunsAtForegroundPriority, alwaysRunsAtForegroundPriority.
1733
1734 2015-06-12  Anders Carlsson  <andersca@apple.com>
1735
1736         Reimplement WKResourceCacheManagerRef on top of WKWebsiteDataStoreRef
1737         https://bugs.webkit.org/show_bug.cgi?id=145951
1738
1739         Reviewed by Darin Adler.
1740
1741         * UIProcess/API/C/WKContext.cpp:
1742         (WKContextGetResourceCacheManager):
1743         * UIProcess/API/C/WKResourceCacheManager.cpp:
1744         (WKResourceCacheManagerGetTypeID):
1745         (toWebsiteDataTypes):
1746         (WKResourceCacheManagerGetCacheOrigins):
1747         (WKResourceCacheManagerClearCacheForOrigin):
1748         (WKResourceCacheManagerClearCacheForAllOrigins):
1749
1750 2015-06-12  Anders Carlsson  <andersca@apple.com>
1751
1752         Reimplement WKApplicationCacheManagerRef as WKWebsiteDataStoreRef
1753         https://bugs.webkit.org/show_bug.cgi?id=145950
1754
1755         Reviewed by Dan Bernstein.
1756
1757         * UIProcess/API/C/WKAPICast.h:
1758         * UIProcess/API/C/WKApplicationCacheManager.cpp:
1759         (WKApplicationCacheManagerGetTypeID):
1760         (WKApplicationCacheManagerGetApplicationCacheOrigins):
1761         (WKApplicationCacheManagerDeleteEntriesForOrigin):
1762         (WKApplicationCacheManagerDeleteAllEntries):
1763         * UIProcess/API/C/WKContext.cpp:
1764         (WKContextGetApplicationCacheManager):
1765         (WKContextGetPluginSiteDataManager):
1766
1767 2015-06-12  Anders Carlsson  <andersca@apple.com>
1768
1769         Clean up IndexedDB website data retrieval and removal
1770         https://bugs.webkit.org/show_bug.cgi?id=145941
1771
1772         Reviewed by Andreas Kling.
1773
1774         - Use SecurityOrigin instead of SecurityOriginData; It's not possible to pass SecurityOriginData
1775         safely between threads.
1776         
1777         - Use std::chrono instead of double for modification times.
1778         
1779         - Get rid of endTime since it's not used.
1780         
1781         - Change deleteIndexedDatabaseEntriesForOrigin to deleteIndexedDatabaseEntriesForOrigins and make it take
1782         a vector of origins instead of a single one.
1783
1784         - Get rid of deleteAllIndexedDatabaseEntries.
1785
1786         - Change SecurityOriginData::securityOrigin to call isolatedCopy on the origin components, since it's common
1787         to pass origins to other threads and we want that to be safe.
1788
1789         * DatabaseProcess/DatabaseProcess.cpp:
1790         (WebKit::DatabaseProcess::fetchWebsiteData):
1791         (WebKit::DatabaseProcess::deleteWebsiteData):
1792         (WebKit::DatabaseProcess::deleteWebsiteDataForOrigins):
1793         (WebKit::DatabaseProcess::indexedDatabaseOrigins):
1794         (WebKit::removeAllDatabasesForOriginPath):
1795         (WebKit::DatabaseProcess::deleteIndexedDatabaseEntriesForOrigins):
1796         (WebKit::DatabaseProcess::deleteIndexedDatabaseEntriesModifiedSince):
1797         (WebKit::DatabaseProcess::getIndexedDatabaseOrigins): Deleted.
1798         (WebKit::DatabaseProcess::deleteIndexedDatabaseEntriesForOrigin): Deleted.
1799         (WebKit::DatabaseProcess::deleteIndexedDatabaseEntriesModifiedBetweenDates): Deleted.
1800         (WebKit::DatabaseProcess::deleteAllIndexedDatabaseEntries): Deleted.
1801         * DatabaseProcess/DatabaseProcess.h:
1802         * Shared/SecurityOriginData.cpp:
1803         (WebKit::SecurityOriginData::securityOrigin):
1804
1805 2015-06-12  Antti Koivisto  <antti@apple.com>
1806
1807         Network Cache: Use SHA1 for header checksum
1808         https://bugs.webkit.org/show_bug.cgi?id=145928
1809
1810         Reviewed by Chris Dumez.
1811
1812         Use SHA1 everywhere for consistency and robustness.
1813
1814         * NetworkProcess/cache/NetworkCacheStorage.cpp:
1815         (WebKit::NetworkCache::Storage::bodyPathForKey):
1816         (WebKit::NetworkCache::RecordMetaData::RecordMetaData):
1817         (WebKit::NetworkCache::decodeRecordMetaData):
1818         (WebKit::NetworkCache::decodeRecordHeader):
1819         (WebKit::NetworkCache::encodeRecordMetaData):
1820         (WebKit::NetworkCache::Storage::encodeRecord):
1821         (WebKit::NetworkCache::hashData): Deleted.
1822
1823             This was the last user of 32 bit hashes in cache code.
1824
1825         * NetworkProcess/cache/NetworkCacheStorage.h:
1826
1827             Also bump the cache version number as recent changes have changed the format.
1828             Old caches would transition fine but this makes it easier to identify which version user has.
1829
1830 2015-06-12  Simon Fraser  <simon.fraser@apple.com>
1831
1832         [iOS WK2] Video with reflection crashes WebKit and Safari
1833         https://bugs.webkit.org/show_bug.cgi?id=145905
1834         rdar://problem/18364939
1835
1836         Reviewed by Anders Carlsson.
1837         
1838         On iOS, AVPlayerLayers are contained inside a WebVideoContainerLayer, but
1839         the layer type is still LayerTypeAVPlayerLayer.
1840         
1841         Avoid throwing exceptions when cloning such layers by checking the layer class.
1842
1843         * WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.mm:
1844         (WebKit::PlatformCALayerRemoteCustom::clone):
1845
1846 2015-06-12  Csaba Osztrogonác  <ossy@webkit.org>
1847
1848         [EFL] Fix unused private field warning in WebContextMenuProxyEfl.cpp
1849         https://bugs.webkit.org/show_bug.cgi?id=145911
1850
1851         Reviewed by Darin Adler.
1852
1853         * UIProcess/efl/WebContextMenuProxyEfl.cpp:
1854         (WebKit::WebContextMenuProxyEfl::WebContextMenuProxyEfl): Deleted.
1855         * UIProcess/efl/WebContextMenuProxyEfl.h:
1856
1857 2015-06-12  Zan Dobersek  <zdobersek@igalia.com>
1858
1859         Unreviewed build fix after r185502.
1860
1861         * NetworkProcess/cache/NetworkCacheFileSystem.cpp:
1862         GRefPtr.h header has been moved to a different place.
1863
1864 2015-06-12  Zan Dobersek  <zdobersek@igalia.com>
1865
1866         [GLib] Move files under Source/WTF/wtf/gobject to Source/WTF/wtf/glib
1867         https://bugs.webkit.org/show_bug.cgi?id=145799
1868
1869         Reviewed by Carlos Garcia Campos.
1870
1871         Update header inclusions for headers that have been moved
1872         to Source/WTF/wtf/glib/.
1873
1874         * NetworkProcess/cache/NetworkCacheFileSystemPosix.h:
1875         * NetworkProcess/cache/NetworkCacheIOChannel.h:
1876         * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:
1877         * NetworkProcess/soup/NetworkProcessSoup.cpp:
1878         * PlatformEfl.cmake:
1879         * PlatformGTK.cmake:
1880         * Shared/Downloads/soup/DownloadSoup.cpp:
1881         * Shared/Network/CustomProtocols/soup/CustomProtocolManagerImpl.h:
1882         * Shared/PrintInfo.h:
1883         * Shared/gtk/ArgumentCodersGtk.cpp:
1884         * Shared/gtk/ArgumentCodersGtk.h:
1885         * Shared/gtk/KeyedDecoder.h:
1886         * Shared/gtk/KeyedEncoder.h:
1887         * Shared/gtk/ProcessExecutablePathGtk.cpp:
1888         * UIProcess/API/gtk/WebKitBackForwardList.cpp:
1889         * UIProcess/API/gtk/WebKitBackForwardListItem.cpp:
1890         * UIProcess/API/gtk/WebKitColorChooser.h:
1891         * UIProcess/API/gtk/WebKitContextMenu.cpp:
1892         * UIProcess/API/gtk/WebKitContextMenuItem.cpp:
1893         * UIProcess/API/gtk/WebKitCookieManager.cpp:
1894         * UIProcess/API/gtk/WebKitDownload.cpp:
1895         * UIProcess/API/gtk/WebKitDownloadClient.cpp:
1896         * UIProcess/API/gtk/WebKitFaviconDatabase.cpp:
1897         * UIProcess/API/gtk/WebKitFileChooserRequest.cpp:
1898         * UIProcess/API/gtk/WebKitFindController.cpp:
1899         * UIProcess/API/gtk/WebKitFormClient.cpp:
1900         * UIProcess/API/gtk/WebKitFormSubmissionRequest.cpp:
1901         * UIProcess/API/gtk/WebKitInjectedBundleClient.cpp:
1902         * UIProcess/API/gtk/WebKitJavascriptResult.cpp:
1903         * UIProcess/API/gtk/WebKitLoaderClient.cpp:
1904         * UIProcess/API/gtk/WebKitMimeInfo.cpp:
1905         * UIProcess/API/gtk/WebKitNavigationAction.cpp:
1906         * UIProcess/API/gtk/WebKitNavigationPolicyDecision.cpp:
1907         * UIProcess/API/gtk/WebKitPolicyClient.cpp:
1908         * UIProcess/API/gtk/WebKitPrintOperation.cpp:
1909         * UIProcess/API/gtk/WebKitResponsePolicyDecision.cpp:
1910         * UIProcess/API/gtk/WebKitUIClient.cpp:
1911         * UIProcess/API/gtk/WebKitURISchemeRequest.cpp:
1912         * UIProcess/API/gtk/WebKitUserContentManager.cpp:
1913         * UIProcess/API/gtk/WebKitWebContext.cpp:
1914         * UIProcess/API/gtk/WebKitWebInspector.cpp:
1915         * UIProcess/API/gtk/WebKitWebResource.cpp:
1916         * UIProcess/API/gtk/WebKitWebView.cpp:
1917         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
1918         * UIProcess/InspectorServer/WebSocketServer.h:
1919         * UIProcess/InspectorServer/gtk/WebInspectorServerGtk.cpp:
1920         * UIProcess/InspectorServer/soup/WebSocketServerSoup.cpp:
1921         * UIProcess/Launcher/gtk/ProcessLauncherGtk.cpp:
1922         * UIProcess/Plugins/gtk/PluginInfoCache.h:
1923         * UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp:
1924         * UIProcess/gtk/DragAndDropHandler.cpp:
1925         * UIProcess/gtk/GestureController.h:
1926         * UIProcess/gtk/InputMethodFilter.cpp:
1927         * UIProcess/gtk/InputMethodFilter.h:
1928         * UIProcess/gtk/WebInspectorProxyGtk.cpp:
1929         * UIProcess/gtk/WebPopupMenuProxyGtk.cpp:
1930         * UIProcess/gtk/WebPopupMenuProxyGtk.h:
1931         * UIProcess/gtk/WebProcessPoolGtk.cpp:
1932         * WebProcess/Cookies/soup/WebCookieManagerSoup.cpp:
1933         * WebProcess/InjectedBundle/API/gtk/WebKitWebExtension.cpp:
1934         * WebProcess/InjectedBundle/API/gtk/WebKitWebHitTestResult.cpp:
1935         * WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp:
1936         * WebProcess/WebPage/WebPage.h:
1937         * WebProcess/WebPage/gtk/LayerTreeHostGtk.h:
1938         * WebProcess/WebPage/gtk/PrinterListGtk.h:
1939         * WebProcess/WebPage/gtk/WebPageGtk.cpp:
1940         * WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp:
1941         * WebProcess/WebPage/gtk/WebPrintOperationGtk.h:
1942         * WebProcess/gtk/WebGtkExtensionManager.h:
1943         * WebProcess/soup/WebKitSoupRequestInputStream.cpp:
1944         * WebProcess/soup/WebProcessSoup.cpp:
1945         * WebProcess/soup/WebSoupRequestManager.h:
1946
1947 2015-06-12  Antti Koivisto  <antti@apple.com>
1948
1949         Network Cache: Use SHA1 for key hash
1950         https://bugs.webkit.org/show_bug.cgi?id=143829
1951
1952         Reviewed by Anders Carlsson.
1953
1954         For consistency with blobs, use SHA1 instead of MD5.
1955
1956         * NetworkProcess/cache/NetworkCacheCoders.cpp:
1957         (WebKit::NetworkCache::Coder<MD5::Digest>::encode): Deleted.
1958         (WebKit::NetworkCache::Coder<MD5::Digest>::decode): Deleted.
1959
1960             No longer needed.
1961
1962         * NetworkProcess/cache/NetworkCacheCoders.h:
1963         * NetworkProcess/cache/NetworkCacheKey.cpp:
1964         (WebKit::NetworkCache::hashString):
1965         (WebKit::NetworkCache::Key::computeHash):
1966         * NetworkProcess/cache/NetworkCacheKey.h:
1967
1968 2015-06-12  Csaba Osztrogonác  <ossy@webkit.org>
1969
1970         Fix mismatched-tags warning in Source/WebKit2/UIProcess/gtk/InputMethodFilter.h
1971         https://bugs.webkit.org/show_bug.cgi?id=145923
1972
1973         Reviewed by Carlos Garcia Campos.
1974
1975         * UIProcess/gtk/InputMethodFilter.h:
1976
1977 2015-06-12  Antti Koivisto  <antti@apple.com>
1978
1979         Use SHA1 for cache coder checksums
1980         https://bugs.webkit.org/show_bug.cgi?id=145880
1981
1982         Reviewed by Anders Carlsson.
1983
1984         Make cache data error detection more robust by using SHA1 for checksums.
1985
1986         * NetworkProcess/cache/NetworkCacheDecoder.cpp:
1987         (WebKit::NetworkCache::Decoder::Decoder):
1988         (WebKit::NetworkCache::Decoder::decodeFixedLengthData):
1989         (WebKit::NetworkCache::Decoder::decodeNumber):
1990         (WebKit::NetworkCache::Decoder::verifyChecksum):
1991         * NetworkProcess/cache/NetworkCacheDecoder.h:
1992         * NetworkProcess/cache/NetworkCacheEncoder.cpp:
1993         (WebKit::NetworkCache::Encoder::Encoder):
1994         (WebKit::NetworkCache::Encoder::grow):
1995         (WebKit::NetworkCache::Encoder::updateChecksumForData):
1996         (WebKit::NetworkCache::Encoder::encodeFixedLengthData):
1997         (WebKit::NetworkCache::Encoder::encodeNumber):
1998         (WebKit::NetworkCache::Encoder::encodeChecksum):
1999         * NetworkProcess/cache/NetworkCacheEncoder.h:
2000         (WebKit::NetworkCache::Encoder::buffer):
2001         (WebKit::NetworkCache::Encoder::bufferSize):
2002         (WebKit::NetworkCache::Encoder::updateChecksumForNumber):
2003
2004 2015-06-12  Csaba Osztrogonác  <ossy@webkit.org>
2005
2006         [EFL] Fix deprecated declarations warnings related to WK2 versioned structs
2007         https://bugs.webkit.org/show_bug.cgi?id=145913
2008
2009         Reviewed by Gyuyoung Kim.
2010
2011         * UIProcess/API/efl/ewk_favicon_database.cpp:
2012         (EwkFaviconDatabase::EwkFaviconDatabase):
2013         * UIProcess/efl/ContextHistoryClientEfl.cpp:
2014         (WebKit::ContextHistoryClientEfl::ContextHistoryClientEfl):
2015         * UIProcess/efl/ContextMenuClientEfl.cpp:
2016         (ContextMenuClientEfl::ContextMenuClientEfl):
2017         * UIProcess/efl/DownloadManagerEfl.cpp:
2018         (WebKit::DownloadManagerEfl::DownloadManagerEfl):
2019         * UIProcess/efl/FindClientEfl.cpp:
2020         (WebKit::FindClientEfl::FindClientEfl):
2021         * UIProcess/efl/FormClientEfl.cpp:
2022         (WebKit::FormClientEfl::FormClientEfl):
2023         * UIProcess/efl/PageUIClientEfl.cpp:
2024         (WebKit::PageUIClientEfl::PageUIClientEfl):
2025
2026 2015-06-11  Mark Lam  <mark.lam@apple.com>
2027
2028         WebCore::reportException() needs to be able to accept a raw thrown value in addition to Exception objects.
2029         https://bugs.webkit.org/show_bug.cgi?id=145872
2030
2031         Reviewed by Michael Saboff.
2032
2033         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2034         (WebKit::InjectedBundle::reportException):
2035         - Don't assume we have an Exception object.  Let WebCore::reportException() take
2036           care of it.
2037
2038 2015-06-11  Carlos Alberto Lopez Perez  <clopez@igalia.com>
2039
2040         [CMake] Unreviewed build fix after r185479.
2041
2042         * CMakeLists.txt: Unlist the files that r185479 deleted.
2043
2044 2015-06-11  Anders Carlsson  <andersca@apple.com>
2045
2046         Get rid of WebOriginDataManager
2047         https://bugs.webkit.org/show_bug.cgi?id=145896
2048
2049         Reviewed by Andreas Kling.
2050
2051         * DatabaseProcess/DatabaseProcess.cpp:
2052         (WebKit::DatabaseProcess::DatabaseProcess): Deleted.
2053         (WebKit::DatabaseProcess::getOrigins): Deleted.
2054         (WebKit::DatabaseProcess::deleteEntriesForOrigin): Deleted.
2055         (WebKit::DatabaseProcess::deleteEntriesModifiedBetweenDates): Deleted.
2056         (WebKit::DatabaseProcess::deleteAllEntries): Deleted.
2057         * DatabaseProcess/DatabaseProcess.h:
2058         * DerivedSources.make:
2059         * UIProcess/API/C/WKAPICast.h:
2060         * UIProcess/API/C/WKContext.cpp:
2061         * UIProcess/Databases/DatabaseProcessProxy.cpp:
2062         (WebKit::DatabaseProcessProxy::didReceiveMessage): Deleted.
2063         * UIProcess/WebOriginDataManagerProxy.cpp: Removed.
2064         (WebKit::WebOriginDataManagerProxy::supplementName): Deleted.
2065         (WebKit::WebOriginDataManagerProxy::create): Deleted.
2066         (WebKit::WebOriginDataManagerProxy::WebOriginDataManagerProxy): Deleted.
2067         (WebKit::WebOriginDataManagerProxy::~WebOriginDataManagerProxy): Deleted.
2068         (WebKit::WebOriginDataManagerProxy::processPoolDestroyed): Deleted.
2069         (WebKit::WebOriginDataManagerProxy::processDidClose): Deleted.
2070         (WebKit::WebOriginDataManagerProxy::shouldTerminate): Deleted.
2071         (WebKit::WebOriginDataManagerProxy::refWebContextSupplement): Deleted.
2072         (WebKit::WebOriginDataManagerProxy::derefWebContextSupplement): Deleted.
2073         (WebKit::CallbackSynchronizer::create): Deleted.
2074         (WebKit::CallbackSynchronizer::~CallbackSynchronizer): Deleted.
2075         (WebKit::CallbackSynchronizer::taskStarted): Deleted.
2076         (WebKit::CallbackSynchronizer::taskCompleted): Deleted.
2077         (WebKit::CallbackSynchronizer::CallbackSynchronizer): Deleted.
2078         (WebKit::createSynchronizedCallback): Deleted.
2079         (WebKit::sendMessageToAllProcessesInProcessPool): Deleted.
2080         (WebKit::WebOriginDataManagerProxy::getOrigins): Deleted.
2081         (WebKit::WebOriginDataManagerProxy::didGetOrigins): Deleted.
2082         (WebKit::WebOriginDataManagerProxy::deleteEntriesForOrigin): Deleted.
2083         (WebKit::WebOriginDataManagerProxy::deleteEntriesModifiedBetweenDates): Deleted.
2084         (WebKit::WebOriginDataManagerProxy::didDeleteEntries): Deleted.
2085         (WebKit::WebOriginDataManagerProxy::deleteAllEntries): Deleted.
2086         (WebKit::WebOriginDataManagerProxy::didDeleteAllEntries): Deleted.
2087         * UIProcess/WebOriginDataManagerProxy.h: Removed.
2088         * UIProcess/WebOriginDataManagerProxy.messages.in: Removed.
2089         * UIProcess/WebProcessPool.cpp:
2090         * WebKit2.xcodeproj/project.pbxproj:
2091         * WebProcess/OriginData/WebOriginDataManager.cpp: Removed.
2092         (WebKit::WebOriginDataManager::WebOriginDataManager): Deleted.
2093         (WebKit::WebOriginDataManager::getOrigins): Deleted.
2094         (WebKit::WebOriginDataManager::deleteEntriesForOrigin): Deleted.
2095         (WebKit::WebOriginDataManager::deleteEntriesModifiedBetweenDates): Deleted.
2096         (WebKit::WebOriginDataManager::deleteAllEntries): Deleted.
2097         * WebProcess/OriginData/WebOriginDataManager.h: Removed.
2098         * WebProcess/OriginData/WebOriginDataManager.messages.in: Removed.
2099         * WebProcess/OriginData/WebOriginDataManagerSupplement.h: Removed.
2100         (WebKit::WebOriginDataManagerSupplement::WebOriginDataManagerSupplement): Deleted.
2101         (WebKit::WebOriginDataManagerSupplement::~WebOriginDataManagerSupplement): Deleted.
2102         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2103         * WebProcess/WebPage/WebPage.cpp:
2104         * WebProcess/WebProcess.cpp:
2105         (WebKit::WebProcess::~WebProcess):
2106         (WebKit::WebProcess::WebProcess): Deleted.
2107         (WebKit::WebProcess::getOrigins): Deleted.
2108         (WebKit::WebProcess::deleteEntriesForOrigin): Deleted.
2109         (WebKit::WebProcess::deleteEntriesModifiedBetweenDates): Deleted.
2110         (WebKit::WebProcess::deleteAllEntries): Deleted.
2111         * WebProcess/WebProcess.h:
2112         * WebProcess/cocoa/WebProcessCocoa.mm:
2113
2114 2015-06-11  Matt Rajca  <mrajca@apple.com>
2115
2116         Media Session: Add plumbing for media control event delivery.
2117         https://bugs.webkit.org/show_bug.cgi?id=145859
2118
2119         Reviewed by Anders Carlsson.
2120
2121         * UIProcess/API/C/WKPage.cpp:
2122         (WKPageHandleMediaEvent):
2123         * UIProcess/API/C/WKPagePrivate.h:
2124         * UIProcess/WebPageProxy.cpp:
2125         (WebKit::WebPageProxy::handleMediaEvent):
2126         * UIProcess/WebPageProxy.h:
2127         * WebProcess/WebPage/WebPage.cpp:
2128         (WebKit::WebPage::handleMediaEvent):
2129         * WebProcess/WebPage/WebPage.h:
2130         * WebProcess/WebPage/WebPage.messages.in:
2131
2132 2015-06-11  Myles C. Maxfield  <mmaxfield@apple.com>
2133
2134         [OS X] Decoding fonts may return nil when using force click
2135         https://bugs.webkit.org/show_bug.cgi?id=145890
2136
2137         Reviewed by Beth Dakin.
2138
2139         [NSFontDescriptor fontDescriptorWithFontAttributes] might return nil, which
2140         causes the encoding of an NSFont to erroneously return true.
2141
2142         * Shared/mac/ArgumentCodersMac.mm:
2143         (IPC::decode):
2144
2145 2015-06-11  Anders Carlsson  <andersca@apple.com>
2146
2147         Reimplement WKOriginDataManager in terms of API::WebsiteDataStore
2148         https://bugs.webkit.org/show_bug.cgi?id=145889
2149
2150         Reviewed by Dan Bernstein.
2151
2152         * UIProcess/API/C/WKAPICast.h:
2153         * UIProcess/API/C/WKContext.cpp:
2154         (WKContextGetOriginDataManager):
2155         * UIProcess/API/C/WKOriginDataManager.cpp:
2156         (WKOriginDataManagerGetTypeID):
2157         (WKOriginDataManagerGetOrigins):
2158         (WKOriginDataManagerDeleteEntriesForOrigin):
2159         (WKOriginDataManagerDeleteEntriesModifiedBetweenDates):
2160         (WKOriginDataManagerDeleteAllEntries):
2161
2162 2015-06-11  Brent Fulgham  <bfulgham@apple.com>
2163
2164         Full screen video space can be resized to 1pt wide
2165         https://bugs.webkit.org/show_bug.cgi?id=145895
2166         <rdar://problem/20907914>
2167
2168         Reviewed by Simon Fraser.
2169
2170         Prior to the upcoming OS X, full screen mode was not resizable. Now that it is,
2171         we need to set a minimum window width that is large enough to hold the media
2172         controls. This makes our full-screen video behave the same as the QuickTimeX player.
2173
2174         * UIProcess/mac/WKFullScreenWindowController.mm:
2175         (-[WKFullScreenWindowController finishedEnterFullScreenAnimation:]): Active that new
2176         kWKLayoutModeDynamicSizeWithMinimumViewSize style, and set the minimum view size to
2177         be the width of our media controls, with 20 pixels of padding on either side.
2178         (-[WKFullScreenWindowController finishedExitFullScreenAnimation:]): Set the layout
2179         mode back to the default style.
2180
2181 2015-06-11  Jon Lee  <jonlee@apple.com>
2182
2183         Update media controls JS and CSS to use picture-in-picture
2184         https://bugs.webkit.org/show_bug.cgi?id=145827
2185         <rdar://problem/21311576>
2186
2187         Reviewed by Dean Jackson.
2188
2189         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
2190         (InitWebCoreSystemInterface): Deleted GetMediaUIImageData.
2191
2192 2015-06-11  Alex Christensen  <achristensen@webkit.org>
2193
2194         Speculative build fix for GTK after r185463.
2195
2196         * CMakeLists.txt:
2197         Remove WebPluginSiteDataManager.cpp from CMake build.
2198
2199 2015-06-11  Anders Carlsson  <andersca@apple.com>
2200
2201         Remove WebPluginSiteDataManager
2202         https://bugs.webkit.org/show_bug.cgi?id=145884
2203
2204         Reviewed by Andreas Kling.
2205
2206         * PluginProcess/PluginProcess.cpp:
2207         (WebKit::PluginProcess::clearSiteData): Deleted.
2208         * PluginProcess/PluginProcess.h:
2209         * PluginProcess/PluginProcess.messages.in:
2210         * UIProcess/API/C/WKAPICast.h:
2211         * UIProcess/API/C/WKContext.cpp:
2212         * UIProcess/API/C/WKPluginSiteDataManager.cpp:
2213         * UIProcess/Plugins/PluginProcessManager.cpp:
2214         (WebKit::PluginProcessManager::clearSiteData): Deleted.
2215         * UIProcess/Plugins/PluginProcessManager.h:
2216         * UIProcess/Plugins/PluginProcessProxy.cpp:
2217         (WebKit::PluginProcessProxy::clearSiteData): Deleted.
2218         (WebKit::PluginProcessProxy::pluginProcessCrashedOrFailedToLaunch): Deleted.
2219         (WebKit::PluginProcessProxy::didFinishLaunching): Deleted.
2220         (WebKit::PluginProcessProxy::didClearSiteData): Deleted.
2221         * UIProcess/Plugins/PluginProcessProxy.h:
2222         * UIProcess/Plugins/PluginProcessProxy.messages.in:
2223         * UIProcess/Plugins/WebPluginSiteDataManager.cpp: Removed.
2224         (WebKit::WebPluginSiteDataManager::GetSitesWithDataState::GetSitesWithDataState): Deleted.
2225         (WebKit::WebPluginSiteDataManager::GetSitesWithDataState::getSitesWithDataForNextPlugin): Deleted.
2226         (WebKit::WebPluginSiteDataManager::GetSitesWithDataState::didGetSitesWithDataForSinglePlugin): Deleted.
2227         (WebKit::WebPluginSiteDataManager::ClearSiteDataState::ClearSiteDataState): Deleted.
2228         (WebKit::WebPluginSiteDataManager::ClearSiteDataState::clearSiteDataForNextPlugin): Deleted.
2229         (WebKit::WebPluginSiteDataManager::ClearSiteDataState::didClearSiteDataForSinglePlugin): Deleted.
2230         (WebKit::WebPluginSiteDataManager::create): Deleted.
2231         (WebKit::WebPluginSiteDataManager::WebPluginSiteDataManager): Deleted.
2232         (WebKit::WebPluginSiteDataManager::~WebPluginSiteDataManager): Deleted.
2233         (WebKit::WebPluginSiteDataManager::invalidate): Deleted.
2234         (WebKit::WebPluginSiteDataManager::getSitesWithData): Deleted.
2235         (WebKit::WebPluginSiteDataManager::didGetSitesWithData): Deleted.
2236         (WebKit::WebPluginSiteDataManager::clearSiteData): Deleted.
2237         (WebKit::WebPluginSiteDataManager::didClearSiteData): Deleted.
2238         (WebKit::WebPluginSiteDataManager::didGetSitesWithDataForSinglePlugin): Deleted.
2239         (WebKit::WebPluginSiteDataManager::didGetSitesWithDataForAllPlugins): Deleted.
2240         (WebKit::WebPluginSiteDataManager::didClearSiteDataForSinglePlugin): Deleted.
2241         (WebKit::WebPluginSiteDataManager::didClearSiteDataForAllPlugins): Deleted.
2242         * UIProcess/Plugins/WebPluginSiteDataManager.h: Removed.
2243         (WebKit::WebPluginSiteDataManager::processPool): Deleted.
2244         (WebKit::WebPluginSiteDataManager::clearProcessPool): Deleted.
2245         * UIProcess/WebProcessPool.cpp:
2246         (WebKit::WebProcessPool::~WebProcessPool): Deleted.
2247         * UIProcess/WebProcessPool.h:
2248         * UIProcess/WebProcessProxy.cpp:
2249         * WebKit2.xcodeproj/project.pbxproj:
2250
2251 2015-06-11  Anders Carlsson  <andersca@apple.com>
2252
2253         Make WKWebsiteDataStoreRef backed by an API::WebsiteDataStore
2254         https://bugs.webkit.org/show_bug.cgi?id=145882
2255
2256         Reviewed by Dan Bernstein.
2257
2258         * UIProcess/API/C/WKAPICast.h:
2259         * UIProcess/API/C/WKContext.cpp:
2260         (WKContextGetPluginSiteDataManager):
2261         * UIProcess/API/C/WKPluginSiteDataManager.cpp:
2262         (WKPluginSiteDataManagerGetTypeID):
2263         (WKPluginSiteDataManagerGetSitesWithData):
2264         (WKPluginSiteDataManagerClearSiteData):
2265         (WKPluginSiteDataManagerClearAllSiteData):
2266
2267 2015-06-11  Antti Koivisto  <antti@apple.com>
2268
2269         Network process crashes decoding invalid cache entry on 32bit system
2270         https://bugs.webkit.org/show_bug.cgi?id=145842
2271         rdar://problem/21228334
2272
2273         Reviewed by Anders Carlsson.
2274
2275         After cache scheme changes we may end up decoding invalid cache entries. This is by design,
2276         we should just fail decoding and delete these entries.
2277
2278         However Decoder::bufferIsLargeEnoughToContain test in some cases would allow corrupted large
2279         sizes due to overflow in 32bit pointer math and we would crash when allocating a string.
2280
2281         * NetworkProcess/cache/NetworkCacheCoders.cpp:
2282         (WebKit::NetworkCache::Coder<CString>::decode):
2283         (WebKit::NetworkCache::decodeStringText):
2284         (WebKit::NetworkCache::Coder<WebCore::CertificateInfo>::decode):
2285         (WebKit::NetworkCache::Coder<MD5::Digest>::encode):
2286         * NetworkProcess/cache/NetworkCacheCoders.h:
2287         * NetworkProcess/cache/NetworkCacheDecoder.cpp:
2288         (WebKit::NetworkCache::Decoder::Decoder):
2289         (WebKit::NetworkCache::Decoder::bufferIsLargeEnoughToContain):
2290
2291             Reshuffle to avoid sum.
2292
2293         (WebKit::NetworkCache::Decoder::decodeFixedLengthData):
2294         * NetworkProcess/cache/NetworkCacheDecoder.h:
2295         (WebKit::NetworkCache::Decoder::bufferSize):
2296         (WebKit::NetworkCache::Decoder::currentOffset):
2297         (WebKit::NetworkCache::Decoder::length): Deleted.
2298         (WebKit::NetworkCache::Decoder::isInvalid): Deleted.
2299         (WebKit::NetworkCache::Decoder::markInvalid): Deleted.
2300
2301             Remove these, they are not really used or needed.
2302
2303 2015-06-10  Anders Carlsson  <andersca@apple.com>
2304
2305         Rewrite WKPluginSiteDataManager using WebsiteDataStore functions
2306         https://bugs.webkit.org/show_bug.cgi?id=145868
2307
2308         Reviewed by Antti Koivisto.
2309
2310         * UIProcess/API/C/WKPluginSiteDataManager.cpp:
2311         (WKPluginSiteDataManagerGetSitesWithData):
2312         (WKPluginSiteDataManagerClearSiteData):
2313         (WKPluginSiteDataManagerClearAllSiteData):
2314         (toNPClearSiteDataFlags): Deleted.
2315         * UIProcess/Plugins/WebPluginSiteDataManager.h:
2316         (WebKit::WebPluginSiteDataManager::processPool):
2317
2318 2015-06-11  Antti Koivisto  <antti@apple.com>
2319
2320         3% cold PLT regression from network cache on iOS
2321         https://bugs.webkit.org/show_bug.cgi?id=145694
2322         rdar://problem/21158245
2323
2324         Reviewed by Chris Dumez.
2325
2326         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.
2327
2328         * NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:
2329         (WebKit::NetworkCache::IOChannel::IOChannel):
2330         (WebKit::NetworkCache::IOChannel::open):
2331
2332             Dispatch channels inherit their I/O priority from the target queue. Use background queue for write I/O.
2333
2334         * NetworkProcess/cache/NetworkCacheStorage.cpp:
2335         (WebKit::NetworkCache::Storage::Storage):
2336         (WebKit::NetworkCache::Storage::dispatchPendingReadOperations):
2337         (WebKit::NetworkCache::Storage::dispatchPendingWriteOperations):
2338
2339             Only write one file at a time instead of maximum of three.
2340
2341         (WebKit::NetworkCache::Storage::retrieve):
2342
2343             For consistency with store prepend new entries here too.
2344
2345         (WebKit::NetworkCache::Storage::store):
2346
2347             Delay start of the first write operation by 1s.
2348             Prepend instead of append to the pending write deque so retrieveFromMemory lookup finds newest entries first in case of duplicates
2349
2350         (WebKit::NetworkCache::Storage::traverse):
2351         * NetworkProcess/cache/NetworkCacheStorage.h:
2352
2353 2015-06-10  Yongjun Zhang  <yongjun_zhang@apple.com>
2354
2355         Don't send touch events on link preview.
2356         https://bugs.webkit.org/show_bug.cgi?id=145863
2357
2358         Disable web touch event recognizer on link preview. We do the same when finding nodes in inspector or when long press gesture
2359         is recognized (by _cancelAllTouches). 
2360
2361         Reviewed by Beth Dakin.
2362
2363         * UIProcess/ios/WKContentViewInteraction.mm:
2364         (-[WKContentView willPresentPreviewViewController:forPosition:inSourceView:]): Remove touch event gesture recognizer on preview start.
2365         (-[WKContentView didDismissPreviewViewController:committing:]): Add the gesture recognizer back on dismiss.
2366
2367 2015-06-10  Anders Carlsson  <andersca@apple.com>
2368
2369         WKWebsiteDataStore should handle removing plug-in data for individual records
2370         https://bugs.webkit.org/show_bug.cgi?id=145864
2371
2372         Reviewed by Beth Dakin.
2373
2374         * PluginProcess/PluginProcess.cpp:
2375         (WebKit::PluginProcess::deleteWebsiteDataForHostNames):
2376         * PluginProcess/PluginProcess.h:
2377         * PluginProcess/PluginProcess.messages.in:
2378         * UIProcess/Plugins/PluginProcessManager.cpp:
2379         (WebKit::PluginProcessManager::deleteWebsiteDataForHostNames):
2380         * UIProcess/Plugins/PluginProcessManager.h:
2381         * UIProcess/Plugins/PluginProcessProxy.cpp:
2382         (WebKit::PluginProcessProxy::deleteWebsiteDataForHostNames):
2383         (WebKit::PluginProcessProxy::pluginProcessCrashedOrFailedToLaunch):
2384         (WebKit::PluginProcessProxy::didFinishLaunching):
2385         (WebKit::PluginProcessProxy::didDeleteWebsiteDataForHostNames):
2386         * UIProcess/Plugins/PluginProcessProxy.h:
2387         * UIProcess/Plugins/PluginProcessProxy.messages.in:
2388         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2389         (WebKit::WebsiteDataStore::removeData):
2390
2391 2015-06-10  Anders Carlsson  <andersca@apple.com>
2392
2393         WKWebsiteDataStore should handle removing plug-in data
2394         https://bugs.webkit.org/show_bug.cgi?id=145862
2395
2396         Reviewed by Sam Weinig.
2397
2398         * PluginProcess/PluginProcess.cpp:
2399         (WebKit::PluginProcess::deleteWebsiteData):
2400         * PluginProcess/PluginProcess.h:
2401         * PluginProcess/PluginProcess.messages.in:
2402         * UIProcess/Plugins/PluginProcessManager.cpp:
2403         (WebKit::PluginProcessManager::deleteWebsiteData):
2404         * UIProcess/Plugins/PluginProcessManager.h:
2405         * UIProcess/Plugins/PluginProcessProxy.cpp:
2406         (WebKit::PluginProcessProxy::~PluginProcessProxy):
2407         (WebKit::PluginProcessProxy::deleteWebsiteData):
2408         (WebKit::PluginProcessProxy::pluginProcessCrashedOrFailedToLaunch):
2409         (WebKit::PluginProcessProxy::didFinishLaunching):
2410         (WebKit::PluginProcessProxy::didDeleteWebsiteData):
2411         * UIProcess/Plugins/PluginProcessProxy.h:
2412         * UIProcess/Plugins/PluginProcessProxy.messages.in:
2413         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2414         (WebKit::WebsiteDataStore::removeData):
2415
2416 2015-06-10  Brent Fulgham  <bfulgham@apple.com>
2417
2418         [WK2] Do not indicate Media Keys are present when they are not
2419         https://bugs.webkit.org/show_bug.cgi?id=145713
2420         <rdar://problem/19752566>
2421
2422         Reviewed by Dean Jackson.
2423
2424         Correct the reporting of Media Key presence by checking for the actual
2425         media key file, not just the directory. Sometimes the directory will exist
2426         with no media key files (e.g., if a user navigates to the directory using
2427         the Finder).
2428
2429         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2430         (WebKit::computeMediaKeyFile): Moved earlier in file so it could be used by
2431         the 'mediaKeyOrigins' method.
2432         (WebKit::WebsiteDataStore::mediaKeyOrigins): Only indicate we have a media key
2433         origin if the folder actually contains the media key file.
2434         (WebKit::WebsiteDataStore::removeMediaKeys): Use the existing 'computeMediaKeyFile',
2435         rather than manually building the file from strings.
2436
2437 2015-06-09  Anders Carlsson  <andersca@apple.com>
2438
2439         Support fetching website data
2440         https://bugs.webkit.org/show_bug.cgi?id=145828
2441
2442         Reviewed by Darin Adler.
2443
2444         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2445         (WebKit::WebsiteDataStore::fetchData):
2446         (WebKit::WebsiteDataStore::plugins):
2447         * UIProcess/WebsiteData/WebsiteDataStore.h:
2448
2449 2015-06-10  Zan Dobersek  <zdobersek@igalia.com>
2450
2451         Unreviewed. Fixing the build for the GTK port with Clang.
2452
2453         * UIProcess/gtk/InputMethodFilter.h: Add the <functional> header inclusion
2454         to avoid compilation errors due to missing std::function<>.
2455
2456 2015-06-10  Carlos Garcia Campos  <cgarcia@igalia.com>
2457
2458         [GTK] Move KeyBindingTranslator from platform to WebKit2 layer
2459         https://bugs.webkit.org/show_bug.cgi?id=145840
2460
2461         Reviewed by Martin Robinson.
2462
2463         It's currently used only by WebKit2 in the UI process and it's
2464         another file built twice because of the GTK2 plugin process.
2465
2466         * PlatformGTK.cmake:
2467         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
2468         * UIProcess/gtk/KeyBindingTranslator.cpp: Renamed from Source/WebCore/platform/gtk/KeyBindingTranslator.cpp.
2469         (WebKit::backspaceCallback):
2470         (WebKit::selectAllCallback):
2471         (WebKit::cutClipboardCallback):
2472         (WebKit::copyClipboardCallback):
2473         (WebKit::pasteClipboardCallback):
2474         (WebKit::toggleOverwriteCallback):
2475         (WebKit::popupMenuCallback):
2476         (WebKit::showHelpCallback):
2477         (WebKit::deleteFromCursorCallback):
2478         (WebKit::moveCursorCallback):
2479         (WebKit::KeyBindingTranslator::KeyBindingTranslator):
2480         (WebKit::KeyBindingTranslator::commandsForKeyEvent):
2481         * UIProcess/gtk/KeyBindingTranslator.h: Renamed from Source/WebCore/platform/gtk/KeyBindingTranslator.h.
2482         (WebKit::KeyBindingTranslator::addPendingEditorCommand):
2483
2484 2015-06-10  Carlos Garcia Campos  <cgarcia@igalia.com>
2485
2486         [GTK] Get rid of GetEditorCommandsForKeyEvent sync message
2487         https://bugs.webkit.org/show_bug.cgi?id=145598
2488
2489         Reviewed by Žan Doberšek.
2490
2491         We are sending GetEditorCommandsForKeyEvent sync message from web
2492         process to the UI process for every key pressed. And if the
2493         keydown event doesn't handle the key, the message is sent again
2494         for the keypress event, so in many cases it happens twice per
2495         keypress. We can get the list of commands when the key press event
2496         happens in the web view, and send it to the web process as part of
2497         the keyboard event like mac port does. In the web process,
2498         commands not inserting text will be handled by keydown and the
2499         rest in keypress without having to use any other IPC message for that.
2500
2501         * Shared/NativeWebKeyboardEvent.h: Add command list parameter to
2502         the constructor.
2503         * Shared/WebEvent.h: Add GTK specific constructor that receives a
2504         list of commands and whether the event was handled by input methods.
2505         (WebKit::WebKeyboardEvent::commands): Returns the list of commands.
2506         * Shared/WebEventConversion.cpp:
2507         (WebKit::WebKit2PlatformKeyboardEvent::WebKit2PlatformKeyboardEvent):
2508         Also copy the commands and handledByInputMethod member.
2509         * Shared/WebKeyboardEvent.cpp:
2510         (WebKit::WebKeyboardEvent::WebKeyboardEvent): Implement GTK
2511         specific constructor that receives a list of commands and whether
2512         the event was handled by input methods.
2513         (WebKit::WebKeyboardEvent::encode): Encode commands and handledByInputMethod.
2514         (WebKit::WebKeyboardEvent::decode): Decode commands and handledByInputMethod.
2515         * Shared/gtk/NativeWebKeyboardEventGtk.cpp:
2516         (WebKit::NativeWebKeyboardEvent::NativeWebKeyboardEvent): Add
2517         command list parameter to the constructor.
2518         * Shared/gtk/WebEventFactory.cpp:
2519         (WebKit::WebEventFactory::createWebKeyboardEvent): Use the new
2520         WebKeyboardEvent constructor and simplify the code. We don't need
2521         to explicitly set VK_PROCESSKEY as windows virtual key code when
2522         the event was handled by input methods. The WebCore event handler
2523         already does that.
2524         * Shared/gtk/WebEventFactory.h:
2525         * UIProcess/API/gtk/PageClientImpl.cpp:
2526         (WebKit::PageClientImpl::getEditorCommandsForKeyEvent): Deleted.
2527         * UIProcess/API/gtk/PageClientImpl.h:
2528         * UIProcess/API/gtk/WebKitWebViewBase.cpp: Add a
2529         KeyBindingTranslator member.
2530         (webkitWebViewBaseKeyPressEvent): Use the new
2531         InputMethodFilter::filterKeyEvent() API and get the list of
2532         commands for the key when events was not handled by input methods.
2533         (webkitWebViewBaseKeyReleaseEvent): Use the new
2534         InputMethodFilter::filterKeyEvent() API.
2535         * UIProcess/PageClient.h:
2536         * UIProcess/WebPageProxy.messages.in: Remove GetEditorCommandsForKeyEvent message.
2537         * UIProcess/gtk/InputMethodFilter.cpp:
2538         (WebKit::InputMethodFilter::handleKeyboardEvent): Call the
2539         completation handler.
2540         (WebKit::InputMethodFilter::handleKeyboardEventWithCompositionResults): Ditto.
2541         (WebKit::InputMethodFilter::filterKeyEvent): Use a completion
2542         handler for the task, so that the caller (the web view) can handle
2543         the keyboard event.
2544         * UIProcess/gtk/InputMethodFilter.h:
2545         * UIProcess/gtk/WebPageProxyGtk.cpp:
2546         (WebKit::WebPageProxy::getEditorCommandsForKeyEvent): Deleted.
2547         * WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp:
2548         (WebKit::WebEditorClient::handleKeyboardEvent): Return earlier if
2549         the event was handled by input methods. And get the list of
2550         commands from the PlatformKeyboardEvent instead of sending a sync
2551         message to the UI process.
2552         (WebKit::WebEditorClient::handleInputMethodKeydown): If the event
2553         was handled by inpout methods, set the event as default handled so
2554         that the WebCore event handler sets VK_PROCESSKEY as windows
2555         virtual key code.
2556         (WebKit::WebEditorClient::getEditorCommandsForKeyEvent): Deleted.
2557
2558 2015-06-10  Carlos Garcia Campos  <cgarcia@igalia.com>
2559
2560         Unreviewed. Fix GTK build after r185412.
2561
2562         Add missing include.
2563
2564         * NetworkProcess/cache/NetworkCacheFileSystem.cpp:
2565
2566 2015-06-10  Antti Koivisto  <antti@apple.com>
2567
2568         NetworkCache: Delete old cache versions
2569         https://bugs.webkit.org/show_bug.cgi?id=145800
2570
2571         Reviewed by Darin Adler.
2572
2573         * CMakeLists.txt:
2574         * NetworkProcess/cache/NetworkCacheBlobStorage.cpp:
2575         (WebKit::NetworkCache::BlobStorage::synchronize):
2576         * NetworkProcess/cache/NetworkCacheFileSystem.cpp: Added.
2577         (WebKit::NetworkCache::directoryEntryType):
2578         (WebKit::NetworkCache::traverseDirectory):
2579
2580             Pass entry type as callback argument.
2581
2582         (WebKit::NetworkCache::deleteDirectoryRecursively):
2583
2584             Add helper.
2585
2586         (WebKit::NetworkCache::fileTimes):
2587         (WebKit::NetworkCache::updateFileModificationTimeIfNeeded):
2588         * NetworkProcess/cache/NetworkCacheFileSystem.h: Copied from Source/WebKit2/NetworkProcess/cache/NetworkCacheFileSystemPosix.h.
2589
2590             Move code to cpp.
2591
2592         (WebKit::NetworkCache::traverseDirectory): Deleted.
2593         (WebKit::NetworkCache::traverseCacheFiles): Deleted.
2594         (WebKit::NetworkCache::fileTimes): Deleted.
2595         (WebKit::NetworkCache::updateFileModificationTimeIfNeeded): Deleted.
2596         * NetworkProcess/cache/NetworkCacheFileSystemPosix.h: Removed.
2597         * NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:
2598         * NetworkProcess/cache/NetworkCacheStatistics.cpp:
2599         (WebKit::NetworkCache::Statistics::bootstrapFromNetworkCache):
2600         * NetworkProcess/cache/NetworkCacheStorage.cpp:
2601         (WebKit::NetworkCache::makeBlobDirectoryPath):
2602         (WebKit::NetworkCache::traverseRecordsFiles):
2603
2604             Move cache hierarchy aware traversal code here from NetworkCacheFileSystem (for better layering).
2605             Rename for clarity.
2606
2607         (WebKit::NetworkCache::deleteEmptyRecordsDirectories):
2608
2609             Factor to a function.
2610
2611         (WebKit::NetworkCache::Storage::Storage):
2612         (WebKit::NetworkCache::Storage::synchronize):
2613         (WebKit::NetworkCache::Storage::traverse):
2614         (WebKit::NetworkCache::Storage::clear):
2615
2616             Use traverseRecordsFiles for traversal.
2617
2618         (WebKit::NetworkCache::Storage::shrink):
2619         (WebKit::NetworkCache::Storage::deleteOldVersions):
2620
2621             Delete version subdirectories with version number less than the current version.
2622             Remove code for clearing unversioned V1 caches. No one should have them.
2623
2624         * NetworkProcess/cache/NetworkCacheStorage.h:
2625         * UIProcess/API/APIUserContentExtensionStore.cpp:
2626         * WebKit2.xcodeproj/project.pbxproj:
2627
2628 2015-06-10  Zan Dobersek  <zdobersek@igalia.com>
2629
2630         [GTK] Web Inspector is broken
2631         https://bugs.webkit.org/show_bug.cgi?id=145836
2632
2633         Reviewed by Carlos Garcia Campos.
2634
2635         * PlatformGTK.cmake: Thread the InspectorBackendCommands.js file as a separate
2636         dependency of InspectorGResourceBundle.xml. It can't be listed under the InspectorFiles
2637         variable and then searched via the CMake glob command because it probably won't exist
2638         at the time the command is run (since it's copied into the specified path), so it won't
2639         be listed among the dependencies at all.
2640
2641 2015-06-09  Anders Carlsson  <andersca@apple.com>
2642
2643         Fix build.
2644
2645         * UIProcess/Plugins/WebPluginSiteDataManager.cpp:
2646         (WebKit::WebPluginSiteDataManager::GetSitesWithDataState::getSitesWithDataForNextPlugin):
2647
2648 2015-06-09  Anders Carlsson  <andersca@apple.com>
2649
2650         Change the PluginProcessManager data fetching function to take a completion handler
2651         https://bugs.webkit.org/show_bug.cgi?id=145821
2652
2653         Reviewed by Sam Weinig.
2654
2655         * UIProcess/Plugins/PluginProcessManager.cpp:
2656         (WebKit::PluginProcessManager::fetchWebsiteData):
2657         (WebKit::PluginProcessManager::getSitesWithData): Deleted.
2658         * UIProcess/Plugins/PluginProcessManager.h:
2659         * UIProcess/Plugins/PluginProcessProxy.cpp:
2660         (WebKit::generateCallbackID):
2661         (WebKit::PluginProcessProxy::~PluginProcessProxy):
2662         (WebKit::PluginProcessProxy::fetchWebsiteData):
2663         (WebKit::PluginProcessProxy::pluginProcessCrashedOrFailedToLaunch):
2664         (WebKit::PluginProcessProxy::didFinishLaunching):
2665         (WebKit::PluginProcessProxy::didGetSitesWithData):
2666         (WebKit::PluginProcessProxy::getSitesWithData): Deleted.
2667         * UIProcess/Plugins/PluginProcessProxy.h:
2668         * UIProcess/Plugins/WebPluginSiteDataManager.cpp:
2669         (WebKit::WebPluginSiteDataManager::GetSitesWithDataState::getSitesWithDataForNextPlugin):
2670
2671 2015-06-09  Anders Carlsson  <andersca@apple.com>
2672
2673         Add code to keep track of plug-in data host names in website data records
2674         https://bugs.webkit.org/show_bug.cgi?id=145818
2675
2676         Reviewed by Andreas Kling.
2677
2678         * Shared/WebsiteData/WebsiteData.cpp:
2679         (WebKit::WebsiteData::encode):
2680         (WebKit::WebsiteData::decode):
2681         * Shared/WebsiteData/WebsiteData.h:
2682         * UIProcess/WebsiteData/WebsiteDataRecord.cpp:
2683         (WebKit::WebsiteDataRecord::displayNameForPluginDataHostName):
2684         (WebKit::WebsiteDataRecord::addPluginDataHostName):
2685         (WebKit::WebsiteDataRecord::displayNameForCookieHostName): Deleted.
2686         * UIProcess/WebsiteData/WebsiteDataRecord.h:
2687         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2688         (WebKit::WebsiteDataStore::fetchData):
2689
2690 2015-06-09  Anders Carlsson  <andersca@apple.com>
2691
2692         Add Plug-in type declarations to WKWebsiteDataRecord and friends
2693         https://bugs.webkit.org/show_bug.cgi?id=145816
2694
2695         Reviewed by Andreas Kling.
2696
2697         * Shared/WebsiteData/WebsiteDataTypes.h:
2698         * UIProcess/API/Cocoa/WKWebsiteDataRecord.mm:
2699         (dataTypesToString):
2700         * UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h:
2701         (WebKit::toWebsiteDataTypes):
2702         (WebKit::toWKWebsiteDataTypes):
2703         * UIProcess/API/Cocoa/WKWebsiteDataRecordPrivate.h:
2704
2705 2015-06-09  Antti Koivisto  <antti@apple.com>
2706
2707         REGRESSION(r185262): NetworkCache is in wrong location on OS X
2708         https://bugs.webkit.org/show_bug.cgi?id=145812
2709
2710         Reviewed by Anders Carlsson.
2711
2712         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2713         (WebKit::WebProcessPool::legacyPlatformDefaultWebSQLDatabaseDirectory):
2714         (WebKit::WebProcessPool::legacyPlatformDefaultLocalStorageDirectory):
2715         (WebKit::WebProcessPool::legacyPlatformDefaultMediaKeysStorageDirectory):
2716         (WebKit::WebProcessPool::isNetworkCacheEnabled):
2717
2718             Make sure static functions that use NSUserDefaults call registerUserDefaultsIfNeeded() first.
2719
2720 2015-06-09  Yusuke Suzuki  <utatane.tea@gmail.com>
2721
2722         Crash when passing Symbol to NPAPI plugin objects
2723         https://bugs.webkit.org/show_bug.cgi?id=145798
2724
2725         Reviewed by Darin Adler.
2726
2727         When the symbol is passed, `propertyName.publicName()` becomes nullptr.
2728         So dereferencing it causes null dereference errors.
2729         At first, this bug appears in the https://bugs.webkit.org/show_bug.cgi?id=145556,
2730         plugin[@@toStringTag] ("string" + plugin) causes SEGV in plugins/embed-inside-object.html test.
2731
2732         This patch avoids it by early returning when the symbols are passed.
2733         Methods for symbols are not implemented in the NPObject side, so it works correctly.
2734
2735         * WebProcess/Plugins/Netscape/JSNPObject.cpp:
2736         (WebKit::npIdentifierFromIdentifier):
2737         (WebKit::JSNPObject::callMethod):
2738         (WebKit::JSNPObject::getOwnPropertySlot):
2739         (WebKit::JSNPObject::put):
2740         (WebKit::JSNPObject::deleteProperty):
2741         (WebKit::JSNPObject::propertyGetter):
2742         (WebKit::JSNPObject::methodGetter):
2743
2744 2015-06-09  Carlos Garcia Campos  <cgarcia@igalia.com>
2745
2746         [SOUP] Network Cache: Give more priority to reads over writes in IO WorkQueue
2747         https://bugs.webkit.org/show_bug.cgi?id=145791
2748
2749         Reviewed by Sergio Villar Senin.
2750
2751         Keep using G_PRIORITY_DEFAULT for reads, but use
2752         G_PRIORITY_DEFAULT_IDLE for writes now.
2753
2754         * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:
2755         (WebKit::NetworkCache::outputStreamWriteReadyCallback): Use
2756         G_PRIORITY_DEFAULT_IDLE for write async operations.
2757         (WebKit::NetworkCache::IOChannel::write): Pass
2758         G_PRIORITY_DEFAULT_IDLE to runTaskInQueue().
2759
2760 2015-06-09  Carlos Garcia Campos  <cgarcia@igalia.com>
2761
2762         [SOUP] Network Cache: run the IO completion handler in the given queue instead of the whole operation
2763         https://bugs.webkit.org/show_bug.cgi?id=145797
2764
2765         Reviewed by Žan Doberšek.
2766
2767         I misunderstood what the WorkQueue parameter meant in the IO
2768         channel operations. It's the queue where the completion handler
2769         should be run, not the whole operation. Since our operations are
2770         already non-blocking, we can just run the read/writes in the main
2771         thread, and schedule the completion handler in the given work
2772         queue when the operation finishes.
2773
2774         * NetworkProcess/cache/NetworkCacheIOChannel.h:
2775         * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:
2776         (WebKit::NetworkCache::inputStreamReadReadyCallback):
2777         (WebKit::NetworkCache::IOChannel::read):
2778         (WebKit::NetworkCache::IOChannel::readSync):
2779         (WebKit::NetworkCache::outputStreamWriteReadyCallback):
2780         (WebKit::NetworkCache::IOChannel::write):
2781
2782 2015-06-09  David Kilzer  <ddkilzer@apple.com>
2783
2784         REGRESSION (r185357): Fix build for iOS 8.x
2785
2786         * UIProcess/ios/forms/WKFileUploadPanel.mm:
2787         (fallbackIconForFile): Add cast prior to iOS 9.
2788
2789 2015-06-09  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
2790
2791         [EFL] Fix a crash on MiniBrowser when running on debug mode
2792         https://bugs.webkit.org/show_bug.cgi?id=145793
2793
2794         Reviewed by Carlos Garcia Campos.
2795
2796         r185314 missed to initialize parameters.diskCacheDirectory with configuration's one.
2797
2798         * UIProcess/efl/WebProcessPoolEfl.cpp:
2799         (WebKit::WebProcessPool::platformInitializeWebProcess):
2800
2801 2015-06-09  Csaba Osztrogonác  <ossy@webkit.org>
2802
2803         [cmake] Fix the style issues in cmake project files
2804         https://bugs.webkit.org/show_bug.cgi?id=145755
2805
2806         Reviewed by Darin Adler.
2807
2808         * CMakeLists.txt:
2809         * PlatformGTK.cmake:
2810         * PlatformMac.cmake:
2811
2812 2015-06-02  Jon Honeycutt  <jhoneycutt@apple.com>
2813
2814         [iOS] UI process memory spike, hang when uploading a very large JPEG
2815
2816         <https://bugs.webkit.org/show_bug.cgi?id=145567>
2817         <rdar://problem/21206699>
2818
2819         When uploading an image, we generate a thumbnail to use for an icon
2820         that sits next to the control. To do this, we load the image and draw
2821         it into a thumbnail-sized canvas. This can be very expensive for large
2822         images.
2823
2824         To fix this, we'll use CGImageSource API, which will allow us to get
2825         any existing thumbnail that exists in the source file.
2826
2827         Reviewed by Darin Adler.
2828
2829         * UIProcess/ios/forms/WKFileUploadPanel.mm:
2830         (squareCropRectForSize):
2831         Use std::round, based on Darin's review feedback that a) rintf is
2832         incorrect in 64-bit systems where CGFloat is a double, b) rintf uses a
2833         variable rounding mode, which is undesirable.
2834         (squareImage):
2835         Changed to take a CGImageRef.
2836         Use RetainPtr and +[UIImage imageWithCGImage:] to match other code in
2837         this file.
2838         (thumbnailSizedImageForImage):
2839         Changed to take a CGImageRef and to use iconSideLength.
2840         (iconForImageFile):
2841         Create an image source for the file, then use CGImageSource API to
2842         generate a thumbnail.
2843         (-[_WKImageFileUploadItem initWithFileURL:originalImage:]): Deleted.
2844         (-[_WKImageFileUploadItem displayImage]):
2845         Use iconForImageFile() rather than trying to generate an icon from the
2846         UIImage.
2847         (-[WKFileUploadPanel _uploadItemForImageData:imageName:successBlock:failureBlock:]):
2848         Removed originalImage parameter; _WKImageFileUploadItem no longer uses
2849         it.
2850         (-[WKFileUploadPanel _uploadItemForJPEGRepresentationOfImage:successBlock:failureBlock:]):
2851         (-[WKFileUploadPanel _uploadItemForImage:withAssetURL:successBlock:failureBlock:]):
2852
2853 2015-06-08  Dan Bernstein  <mitz@apple.com>
2854
2855         [Cocoa] Use generics in framework headers
2856         https://bugs.webkit.org/show_bug.cgi?id=145781
2857
2858         Reviewed by Sam Weinig.
2859
2860         * mac/postprocess-framework-headers.sh: Use the parameter to WK_ARRAY and WK_SET.
2861
2862 2015-06-08  Chris Dumez  <cdumez@apple.com>
2863
2864         Access GCController instance via GCController::singleton() instead of a free function
2865         https://bugs.webkit.org/show_bug.cgi?id=145776
2866
2867         Reviewed by Darin Adler.
2868
2869         Access GCController instance via GCController::singleton() instead of a
2870         free function as per coding style and for consistency with other
2871         singleton classes in the codebase.
2872
2873         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2874         (WebKit::InjectedBundle::garbageCollectJavaScriptObjects):
2875         (WebKit::InjectedBundle::garbageCollectJavaScriptObjectsOnAlternateThreadForDebugging):
2876         * WebProcess/WebProcess.cpp:
2877         (WebKit::WebProcess::terminate):
2878         (WebKit::WebProcess::didClose):
2879         (WebKit::WebProcess::garbageCollectJavaScriptObjects):
2880         (WebKit::WebProcess::setJavaScriptGarbageCollectorTimerEnabled):
2881
2882 2015-06-08  Anders Carlsson  <andersca@apple.com>
2883
2884         Include IndexedDB databases in -[WKWebsiteDataStore allWebsiteDataTypes]
2885         https://bugs.webkit.org/show_bug.cgi?id=145775
2886
2887         Reviewed by Simon Fraser.
2888
2889         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
2890         (+[WKWebsiteDataStore allWebsiteDataTypes]):
2891
2892 2015-06-08  Anders Carlsson  <andersca@apple.com>
2893
2894         Move the snapshot layer contents SPI to the web view
2895         https://bugs.webkit.org/show_bug.cgi?id=145771
2896
2897         Reviewed by Geoffrey Garen.
2898
2899         We need to potentially ask the web page to take a snapshot of the current item,
2900         so move the SPI to WKWebView and name it appropriately.
2901
2902         * UIProcess/API/Cocoa/WKBackForwardListItem.mm:
2903         (-[WKBackForwardListItem _snapshotLayerContents]): Deleted.
2904         * UIProcess/API/Cocoa/WKBackForwardListItemPrivate.h: Removed.
2905         * UIProcess/API/Cocoa/WKWebView.mm:
2906         (-[WKWebView _snapshotLayerContentsForBackForwardListItem:]):
2907         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2908         * WebKit2.xcodeproj/project.pbxproj:
2909
2910 2015-06-08  Brady Eidson  <beidson@apple.com>
2911
2912         Completely remove all IDB properties/constructors when it is disabled at runtime.
2913         rdar://problem/18429374 and https://bugs.webkit.org/show_bug.cgi?id=137034
2914
2915         Reviewed by Geoffrey Garen.
2916
2917         * WebProcess/WebProcess.cpp:
2918         (WebKit::WebProcess::WebProcess): Enable IDB at runtime if it's enabled at compile time.
2919
2920 2015-06-08  Michael Catanzaro  <mcatanzaro@igalia.com>
2921
2922         [SOUP] Performs DNS prefetch when a proxy is configured (information leak)
2923         https://bugs.webkit.org/show_bug.cgi?id=145542
2924
2925         Reviewed by Alexey Proskuryakov.
2926
2927         Add documentation to webkit_web_context_prefetch_dns to indicate that the function does
2928         nothing if the system configuration indicates we should use a proxy to resolve the host.
2929
2930         * UIProcess/API/gtk/WebKitWebContext.cpp:
2931
2932 2015-06-08  Carlos Garcia Campos  <cgarcia@igalia.com>
2933
2934         REGRESSION(r185251): [GTK] webkit_web_context_set_disk_cache_directory() doesn't work when using shared secondary process model after r185251
2935         https://bugs.webkit.org/show_bug.cgi?id=145751
2936
2937         Reviewed by Darin Adler.
2938
2939         In r185251 the CFNetwork cache was disabled in the web process,
2940         but it also removed the disk cache directory web process
2941         initialization parameter. While we support networking in the web
2942         process when shared secondary process model is used, the network
2943         cache should still work. We can remove this if we eventually
2944         switch to use the network process unconditionally.
2945
2946         * Shared/WebProcessCreationParameters.cpp:
2947         (WebKit::WebProcessCreationParameters::encode): Encode disk cache directory.
2948         (WebKit::WebProcessCreationParameters::decode): Decode disk cache directory.
2949         * Shared/WebProcessCreationParameters.h: Bring back disk cache directory only for soup.
2950         * UIProcess/gtk/WebProcessPoolGtk.cpp:
2951         (WebKit::WebProcessPool::platformInitializeWebProcess): Initialize disk cache directory parameter.
2952         * WebProcess/soup/WebProcessSoup.cpp:
2953         (WebKit::WebProcess::platformInitializeWebProcess): Use the disck cache directory parameter again.
2954
2955 2015-06-08  Csaba Osztrogonác  <ossy@webkit.org>
2956
2957         [GTK] Remove the unused scroll function from WebPageGtk.cpp
2958         https://bugs.webkit.org/show_bug.cgi?id=145756
2959
2960         Reviewed by Carlos Garcia Campos.
2961
2962         * WebProcess/WebPage/gtk/WebPageGtk.cpp:
2963         (WebKit::scroll): Deleted.
2964
2965 2015-06-08  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
2966
2967         REGRESSION(r185262): [EFL] Modify legacyPlatformDefaultNetworkCacheDirectory() according to network cache
2968         https://bugs.webkit.org/show_bug.cgi?id=145752
2969
2970         Reviewed by Carlos Garcia Campos.
2971
2972         EFL port needs to add different prefix for network cache directory since r185262.
2973         Modify it basedon GTK port fix.
2974
2975         * UIProcess/efl/WebProcessPoolEfl.cpp:
2976         (WebKit::WebProcessPool::legacyPlatformDefaultNetworkCacheDirectory):
2977
2978 2015-06-07  Carlos Garcia Campos  <cgarcia@igalia.com>
2979
2980         REGRESSION(r185262): [GTK] webkit_web_context_set_disk_cache_directory() doesn't work after r185262
2981         https://bugs.webkit.org/show_bug.cgi?id=145735
2982
2983         Reviewed by Darin Adler.
2984
2985         * NetworkProcess/soup/NetworkProcessSoup.cpp:
2986         (WebKit::NetworkProcess::platformInitializeNetworkProcess): Use
2987         the directory name to clear the old cache, since the disk cache
2988         subdirectory is now added in the UI process.
2989         * UIProcess/API/gtk/WebKitWebContext.cpp:
2990         (webkit_web_context_set_disk_cache_directory): Update the
2991         WebProcessPool configuration to override the disk cache directory.
2992         * UIProcess/WebProcessPool.cpp:
2993         (WebKit::WebProcessPool::ensureNetworkProcess): Use the
2994         configuration to get the disk cache directory.
2995         (WebKit::WebProcessPool::WebProcessPool): Remove
2996         m_diskCacheDirectory member initialization.
2997         * UIProcess/WebProcessPool.h: Remove m_diskCacheDirectory member.
2998         * UIProcess/gtk/WebProcessPoolGtk.cpp:
2999         (WebKit::WebProcessPool::legacyPlatformDefaultNetworkCacheDirectory):
3000         Append the disk cache subdirectory.
3001
3002 2015-06-07  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
3003
3004         [EFL][GTK] Fix build  break since r185262
3005         https://bugs.webkit.org/show_bug.cgi?id=145724
3006
3007         Unreviewed, fix build break for EFL and GTK ports.
3008
3009         * UIProcess/API/APIWebsiteDataStore.cpp:
3010         (API::WebsiteDataStore::defaultLocalStorageDirectory):
3011         (API::WebsiteDataStore::defaultWebSQLDatabaseDirectory):
3012         (API::WebsiteDataStore::defaultNetworkCacheDirectory):
3013         (API::WebsiteDataStore::defaultApplicationCacheDirectory):
3014         (API::WebsiteDataStore::defaultMediaKeysStorageDirectory):
3015         (API::WebsiteDataStore::defaultIndexedDBDatabaseDirectory):
3016         * UIProcess/efl/WebProcessPoolEfl.cpp:
3017         (WebKit::WebProcessPool::legacyPlatformDefaultNetworkCacheDirectory):
3018         (WebKit::WebProcessPool::platformDefaultDiskCacheDirectory): Deleted.
3019         * WebProcess/soup/WebProcessSoup.cpp:
3020         (WebKit::WebProcess::platformInitializeWebProcess):
3021
3022 2015-06-06  Dan Bernstein  <mitz@apple.com>
3023
3024         Don’t enable manual sandboxing in the iOS Simulator. This should fix all the tests timing out.
3025
3026         * Configurations/DebugRelease.xcconfig:
3027
3028 2015-06-06  Dan Bernstein  <mitz@apple.com>
3029
3030         [iOS] Can’t debug with Development XPC services due to automatic sandboxing
3031         https://bugs.webkit.org/show_bug.cgi?id=145731
3032
3033         Rubber-stamped by Darin Adler.
3034
3035         In iOS, the XPC services are automatically sandboxed based on their entitlements. The
3036         sandbox doesn’t allow them to re-exec, which is necessary for linking against engineering
3037         builds of the WebKit frameworks placed in a non-system location.
3038
3039         The solution is to opt Engineering builds into manual sandboxing.
3040
3041         * Configurations/BaseTarget.xcconfig:
3042         - Add ENABLE_MANUAL_SANDBOXING to
3043           GCC_PREPROCESSOR_DEFINITIONS when WK_MANUAL_SANDBOXING_ENABLED is YES.
3044         - Set WK_MANUAL_SANDBOXING_ENABLED to YES for OS X, because we always use manual
3045           sandboxing on that platform.
3046
3047         * Configurations/DebugRelease.xcconfig: Removed unused definition of DEBUG_OR_RELEASE. Set
3048           WK_MANUAL_SANDBOXING_ENABLED to YES for all engineering builds.
3049
3050         * Configurations/BaseXPCService.xcconfig: Define CODE_SIGN_ENTITLEMENTS for iOS to be empty
3051           if the service is not installed; to use the base entitlements file from Configurations if
3052           manual sandboxing is not enabled; and to use a derived entitlements file, which doesn’t
3053           specify a sandbox profile, if manual sandboxing is enabled.
3054
3055         * Configurations/DatabaseService.Development.xcconfig: Define
3056           WK_XPC_SERVICE_IOS_ENTITLEMENTS_BASE and let BaseXPCService.xcconfig define
3057           CODE_SIGN_ENTITLEMENTS for iOS.
3058
3059         * Configurations/DatabaseService.xcconfig: Ditto.
3060         * Configurations/NetworkService.Development.xcconfig: Ditto.
3061         * Configurations/NetworkService.xcconfig: Ditto.
3062         * Configurations/WebContentService.Development.xcconfig: Ditto.
3063         * Configurations/WebContentService.xcconfig: Ditto.
3064
3065         * WebKit2.xcodeproj/project.pbxproj:
3066         - In the Derived Sources target, added a Derive Entitlements for Manual Sandboxing script
3067           build phase. When building for iOS with manual sandboxing enabled, it creates copies of
3068           the iOS entitlements files with a -no-sandbox suffix and the seatbelt-profiles key
3069           removed.
3070         - In the WebKit target, added a Copy iOS Sandbox Profiles for Manual Sandboxing script build
3071           phase. When building for iOS with manual sandboxing enabled, it copies the iOS sandbox
3072           profiles into the framework, so that the services can apply them to themselves at runtime.
3073
3074         * Shared/ios/ChildProcessIOS.mm:
3075         (WebKit::ChildProcess::initializeSandbox): Use ENABLE(MANUAL_SANDBOXING) and don’t define it
3076         here.
3077
3078         * WebProcess/cocoa/WebProcessCocoa.mm:
3079         (WebKit::WebProcess::initializeSandbox): Use ENABLE(MANUAL_SANDBOXING) instead of defining
3080         and using ENABLE_MANUAL_WEBPROCESS_SANDBOXING here.
3081
3082 2015-06-06  Anders Carlsson  <andersca@apple.com>
3083
3084         Remove support from getting plug-in information from Carbon resources
3085         https://bugs.webkit.org/show_bug.cgi?id=145730
3086
3087         Reviewed by Dan Bernstein.
3088
3089         No current plug-in versions use this feature, and both Chrome and Mozilla for
3090         Mac stopped looking at Carbon resources years ago.
3091
3092         * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
3093         (WebKit::NetscapePluginModule::getPluginInfo):
3094         (WebKit::ResourceMap::ResourceMap): Deleted.
3095         (WebKit::ResourceMap::~ResourceMap): Deleted.
3096         (WebKit::ResourceMap::isValid): Deleted.
3097         (WebKit::getStringListResource): Deleted.
3098         (WebKit::getPluginInfoFromCarbonResources): Deleted.
3099
3100 2015-06-05  Anders Carlsson  <andersca@apple.com>
3101
3102         Only allow plug-ins to create custom MIME property lists on older versions of OS X
3103         https://bugs.webkit.org/show_bug.cgi?id=145716
3104
3105         Reviewed by Dan Bernstein.
3106
3107         * PluginProcess/EntryPoint/mac/LegacyProcess/PluginProcessMain.mm:
3108         * Shared/Plugins/Netscape/NetscapePluginModule.h:
3109         * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
3110         (WebKit::getMIMETypesFromPluginBundle):
3111         * UIProcess/Plugins/PluginProcessProxy.h:
3112         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
3113
3114 2015-06-05  Chris Dumez  <cdumez@apple.com>
3115
3116         [WK2][iOS] Limit the number of vnodes used by the WebContent processes
3117         https://bugs.webkit.org/show_bug.cgi?id=145672
3118         <rdar://problem/21126637>
3119
3120         Reviewed by Antti Koivisto.
3121
3122         Have the WebContent process register a vnode pressure handler on iOS,
3123         which calls the memory pressure handler.
3124
3125         On non-critical pressure, it will prune dead resources from the memory
3126         cache, which should free up some vnodes. On critical pressure, the
3127         handler will clear the PageCache and do a JS GC, which should free even
3128         more vnodes.
3129
3130         * WebProcess/cocoa/WebProcessCocoa.mm:
3131         (WebKit::WebProcess::platformInitializeWebProcess):
3132
3133 2015-06-05  Anders Carlsson  <andersca@apple.com>
3134
3135         Fix refacto, don't put IndexedDB databases in the cache directory
3136         https://bugs.webkit.org/show_bug.cgi?id=145714
3137
3138         Reviewed by Antti Koivisto.
3139
3140         * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
3141         (API::WebsiteDataStore::defaultIndexedDBDatabaseDirectory):
3142
3143 2015-06-05  Anders Carlsson  <andersca@apple.com>
3144
3145         Make the network cache directory part of WKContextConfigurationRef
3146         https://bugs.webkit.org/show_bug.cgi?id=145711
3147
3148         Reviewed by Antti Koivisto.
3149
3150         Also, make the UI process be in control of where we place the new network cache.
3151         When using the Modern WebKit API, put the cache in ~/Library/Caches/<Bundle ID>/WebKit/NetworkCache,
3152         and put the cache in ~/Library/Caches/<Bundle ID>/WebKitCache otherwise (this is just for Safari).
3153
3154         * NetworkProcess/cache/NetworkCacheStorage.cpp:
3155         (WebKit::NetworkCache::Storage::open):
3156         * UIProcess/API/APIProcessPoolConfiguration.cpp:
3157         (API::ProcessPoolConfiguration::createWithLegacyOptions):
3158         (API::ProcessPoolConfiguration::ProcessPoolConfiguration):
3159         (API::ProcessPoolConfiguration::copy):
3160         * UIProcess/API/APIProcessPoolConfiguration.h:
3161         * UIProcess/API/C/WKContext.cpp:
3162         (WKContextSetDiskCacheDirectory): Deleted.
3163         * UIProcess/API/C/WKContextConfigurationRef.cpp:
3164         (WKContextConfigurationCopyDiskCacheDirectory):
3165         (WKContextConfigurationSetDiskCacheDirectory):
3166         * UIProcess/API/C/WKContextConfigurationRef.h:
3167         * UIProcess/API/C/WKContextPrivate.h:
3168         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
3169         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
3170         (WebKit::WebProcessPool::legacyPlatformDefaultNetworkCacheDirectory):
3171         (WebKit::WebProcessPool::isNetworkCacheEnabled):
3172         (WebKit::WebProcessPool::platformDefaultDiskCacheDirectory): Deleted.
3173         * UIProcess/WebProcessPool.cpp:
3174         (WebKit::legacyWebsiteDataStoreConfiguration):
3175         (WebKit::WebProcessPool::WebProcessPool):
3176         (WebKit::WebProcessPool::ensureNetworkProcess):
3177         (WebKit::WebProcessPool::diskCacheDirectory): Deleted.
3178         * UIProcess/WebProcessPool.h:
3179
3180 2015-06-05  Anders Carlsson  <andersca@apple.com>
3181
3182         Make the application cache directory part of WKContextConfigurationRef
3183         https://bugs.webkit.org/show_bug.cgi?id=145704
3184
3185         Reviewed by Geoffrey Garen.
3186
3187         * UIProcess/API/APIProcessPoolConfiguration.cpp:
3188         (API::ProcessPoolConfiguration::createWithLegacyOptions):
3189         (API::ProcessPoolConfiguration::ProcessPoolConfiguration):
3190         (API::ProcessPoolConfiguration::copy):
3191         * UIProcess/API/APIProcessPoolConfiguration.h:
3192         * UIProcess/API/C/WKContext.cpp:
3193         (WKContextSetApplicationCacheDirectory): Deleted.
3194         * UIProcess/API/C/WKContextConfigurationRef.cpp:
3195         (WKContextConfigurationCopyApplicationCacheDirectory):
3196         (WKContextConfigurationSetApplicationCacheDirectory):
3197         * UIProcess/API/C/WKContextConfigurationRef.h:
3198         * UIProcess/API/C/WKContextPrivate.h:
3199         * UIProcess/WebProcessPool.cpp:
3200         (WebKit::WebProcessPool::WebProcessPool):
3201         (WebKit::WebProcessPool::createNewWebProcess):
3202         (WebKit::WebProcessPool::applicationCacheDirectory): Deleted.
3203         * UIProcess/WebProcessPool.h:
3204
3205 2015-06-05  Mark Lam  <mark.lam@apple.com>
3206
3207         finally blocks should not set the exception stack trace when re-throwing the exception.
3208         https://bugs.webkit.org/show_bug.cgi?id=145525
3209
3210         Reviewed by Geoffrey Garen.
3211
3212         * WebProcess/InjectedBundle/InjectedBundle.cpp:
3213         (WebKit::InjectedBundle::reportException):
3214         - Changed to use the new Exception object.
3215
3216 2015-06-05  Anders Carlsson  <andersca@apple.com>
3217
3218         Disable the CFNetwork cache in the web process
3219         https://bugs.webkit.org/show_bug.cgi?id=145700
3220         rdar://problem/20243343
3221
3222         Reviewed by Geoffrey Garen.
3223
3224         * NetworkProcess/cache/NetworkCacheStorage.cpp:
3225         (WebKit::NetworkCache::Storage::open):
3226         * Shared/WebProcessCreationParameters.cpp:
3227         (WebKit::WebProcessCreationParameters::WebProcessCreationParameters): Deleted.
3228         (WebKit::WebProcessCreationParameters::encode): Deleted.
3229         (WebKit::WebProcessCreationParameters::decode): Deleted.
3230         * Shared/WebProcessCreationParameters.h:
3231         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
3232         (WebKit::WebProcessPool::platformInitializeWebProcess): Deleted.
3233         * UIProcess/WebProcessPool.cpp:
3234         (WebKit::WebProcessPool::createNewWebProcess): Deleted.
3235         * WebProcess/WebProcess.cpp:
3236         (WebKit::WebProcess::WebProcess): Deleted.
3237         (WebKit::WebProcess::initializeWebProcess): Deleted.
3238         * WebProcess/WebProcess.h:
3239         * WebProcess/cocoa/WebProcessCocoa.mm:
3240         (WebKit::WebProcess::platformClearResourceCaches):
3241         (WebKit::WebProcess::platformInitializeWebProcess):
3242         (WebKit::WebProcess::platformSetCacheModel): Deleted.
3243         (WebKit::WebProcess::platformTerminate): Deleted.
3244
3245 2015-06-05  Anders Carlsson  <andersca@apple.com>
3246
3247         Consolidate default website data directory computations
3248         https://bugs.webkit.org/show_bug.cgi?id=145698
3249
3250         Reviewed by Andreas Kling.
3251
3252         * UIProcess/API/APIProcessPoolConfiguration.cpp:
3253         (API::ProcessPoolConfiguration::ProcessPoolConfiguration):
3254         * UIProcess/API/APIWebsiteDataStore.h:
3255         * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
3256         (API::WebsiteDataStore::defaultApplicationCacheDirectory):
3257         (API::WebsiteDataStore::defaultNetworkCacheDirectory):
3258         (API::WebsiteDataStore::defaultIndexedDBDatabaseDirectory):
3259         (API::WebsiteDataStore::defaultLocalStorageDirectory):
3260         (API::WebsiteDataStore::defaultMediaKeysStorageDirectory):
3261         (API::WebsiteDataStore::defaultWebSQLDatabaseDirectory):
3262         (API::WebsiteDataStore::defaultDataStoreConfiguration):
3263         (API::applicationCacheDirectory): Deleted.
3264
3265 2015-06-01  Jon Honeycutt  <jhoneycutt@apple.com>
3266
3267         [iOS] Uploading an animated GIF from the photo library uploads a JPEG
3268
3269         <https://bugs.webkit.org/show_bug.cgi?id=145539>
3270         <rdar://problem/19760877
3271
3272         Selecting a photo from the photo library using UIImagePickerController
3273         results in an NSDictionary with image info and a UIImage with the
3274         image. It's not possible to get the original image data from the
3275         UIImage, only a PNG or JPEG representation, so we were getting a JPEG
3276         representation and uploading that to the server. For animated GIFs,
3277         this meant a JPEG representation of the first frame.
3278
3279         To fix this, we'll get the asset URL, if available, and use the Photos
3280         API to query for the original image data.
3281
3282         Reviewed by Andy Estes and Joe Pecoraro.
3283
3284         * UIProcess/ios/forms/WKFileUploadPanel.mm:
3285         Soft link the Photos framework.
3286
3287         (-[WKFileUploadPanel _uploadItemForImageData:originalImage:imageName:successBlock:failureBlock:]):
3288         Save the image's data to a temporary location, and create a
3289         _WKImageFileUploadItem. Code moved from
3290         -_uploadItemFromMediaInfo:successBlock:failureBlock:.
3291
3292         (-[WKFileUploadPanel _uploadItemForJPEGRepresentationOfImage:successBlock:failureBlock:]):
3293         Get a JPEG representation of the UIImage, and create an upload item
3294         from that data.
3295
3296         (uploadImageNameFromUTI):
3297         Return a filename for the uploaded image based on the UTI.
3298
3299         (-[WKFileUploadPanel _uploadItemForImage:withAssetURL:successBlock:failureBlock:]):
3300         Fetch the photo asset with the given asset URL. Create an image manager
3301         object, and request the image data for the photo asset. Create an
3302         upload item from that data. If we fail, fall back to a JPEG
3303         representation.
3304
3305         (-[WKFileUploadPanel _uploadItemFromMediaInfo:successBlock:failureBlock:]):
3306         Return early if the media item is not an image type. If it is, and we
3307         have an asset URL, try to create an upload item for the native image.
3308         If we don't have an asset URL, use a JPEG representation of the image.
3309
3310 2015-06-04  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
3311
3312         REGRESSION(r185091): Crash happens on indexdb tests
3313         https://bugs.webkit.org/show_bug.cgi?id=145549
3314
3315         Reviewed by Darin Adler.
3316
3317         * WebProcess/Databases/IndexedDB/WebIDBServerConnection.cpp: Remove leakRef() use.
3318         (WebKit::WebIDBServerConnection::didCreateObjectStore):
3319         (WebKit::WebIDBServerConnection::didCreateIndex):
3320         (WebKit::WebIDBServerConnection::didDeleteIndex):
3321         (WebKit::WebIDBServerConnection::didPutRecord):
3322         (WebKit::WebIDBServerConnection::didGetRecord):
3323         (WebKit::WebIDBServerConnection::didOpenCursor):
3324         (WebKit::WebIDBServerConnection::didAdvanceCursor):
3325         (WebKit::WebIDBServerConnection::didIterateCursor):
3326         (WebKit::WebIDBServerConnection::didCount):
3327         (WebKit::WebIDBServerConnection::didDeleteRange):
3328         (WebKit::WebIDBServerConnection::didClearObjectStore):
3329         (WebKit::WebIDBServerConnection::didDeleteObjectStore):
3330         (WebKit::WebIDBServerConnection::didChangeDatabaseVersion):
3331
3332 2015-06-04  Joseph Pecoraro  <pecoraro@apple.com>
3333
3334         Web Inspector: REGRESSION: dragged node in the DOM Tree isn't positioned correctly
3335         https://bugs.webkit.org/show_bug.cgi?id=143912
3336
3337         Reviewed by Simon Fraser.
3338
3339         * UIProcess/mac/PageClientImpl.mm:
3340         (WebKit::PageClientImpl::setDragImage):
3341         When using the WKWebView, convert the position from the WKView's
3342         coordinate system to the WKWebView's.
3343
3344         * UIProcess/API/Cocoa/WKWebView.mm:
3345         (-[WKWebView draggingUpdated:]):
3346         * UIProcess/API/mac/WKView.mm:
3347         (-[WKView _dragImageForView:withImage:at:linkDrag:]):
3348         Whitespace cleanup in original drag code.
3349
3350 2015-06-04  Dan Bernstein  <mitz@apple.com>
3351
3352         Fixed the build.
3353
3354         * UIProcess/API/Cocoa/WKErrorPrivate.h:
3355
3356 2015-06-04  Dan Bernstein  <mitz@apple.com>
3357
3358         Renamed the WebKit2SandboxProfiles target to Sandbox Profiles.
3359
3360         Rubber-stamped by Anders Carlsson.
3361
3362         * WebKit2.xcodeproj/project.pbxproj: Renamed the target. For now, added an aggregate
3363         target with the old name that depends on the renamed target. We can remove it once the build
3364         system doesn’t reference to old name.
3365
3366 2015-06-03  Dan Bernstein  <mitz@apple.com>
3367
3368         [Cocoa] Expose interruptedForPolicyChangeError
3369         https://bugs.webkit.org/show_bug.cgi?id=145627
3370
3371         Reviewed by Anders Carlsson.
3372
3373         * UIProcess/API/Cocoa/WKErrorPrivate.h: Added WKErrorCodeFrameLoadInterruptedByPolicyChange with the same value as
3374         kWKErrorCodeFrameLoadInterruptedByPolicyChange.
3375
3376 2015-06-04  Chris Dumez  <cdumez@apple.com>
3377
3378         [WK2] Prune more resources from the MemoryCache before process suspension
3379         https://bugs.webkit.org/show_bug.cgi?id=145633
3380
3381         Reviewed by Andreas Kling.
3382
3383         * NetworkProcess/NetworkProcess.cpp:
3384         (WebKit::NetworkProcess::lowMemoryHandler):
3385         (WebKit::NetworkProcess::initializeNetworkProcess):
3386         (WebKit::NetworkProcess::processWillSuspendImminently):
3387         (WebKit::NetworkProcess::prepareToSuspend):
3388         * NetworkProcess/NetworkProcess.h:
3389         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
3390         (WebKit::NetworkProcess::platformLowMemoryHandler):
3391         * PluginProcess/PluginProcess.cpp:
3392         (WebKit::PluginProcess::initializeProcess):
3393
3394         Update low memory handler prototype to match WebCore changes.
3395
3396         * WebProcess/WebProcess.cpp:
3397         (WebKit::WebProcess::actualPrepareToSuspend):
3398
3399         Pass Synchronous::Yes argument to MemoryPressureHandler::releaseMemory()
3400         to request that the memory is free up synchronously (e.g. synchronous
3401         JS garbage collection) as the process is about to be suspended.
3402         Previously, the memory pressure handler was trying to detect this case
3403         by checking if the system was really under memory pressure but this was
3404         a bit hackish and it wouldn't work if the process happened to get
3405         suspended while the system was under memory pressure.
3406
3407 2015-06-03  Carlos Alberto Lopez Perez  <clopez@igalia.com>
3408
3409         [GTK] [Wayland] Build is broken on trunk
3410         https://bugs.webkit.org/show_bug.cgi?id=142879
3411
3412         Reviewed by Carlos Garcia Campos.
3413
3414         * WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp:
3415         (WebKit::LayerTreeHostGtk::makeContextCurrent): When Wayland target
3416         is enabled GLNativeWindowType is not an u_int64 type.
3417         Cast contextID to avoid a build failure.
3418
3419 2015-06-03  Dan Bernstein  <mitz@apple.com>
3420
3421         Made WKBackForwardListItemPrivate.h a private header after it was added as internal in r185183.
3422
3423         * WebKit2.xcodeproj/project.pbxproj:
3424
3425 2015-06-03  Hyungwook Lee  <hyungwook.lee@navercorp.com>
3426
3427         [EFL] Implement window_object_cleared callback in EwkPageClient.
3428         https://bugs.webkit.org/show_bug.cgi?id=145603
3429
3430         Reviewed by Gyuyoung Kim.
3431
3432         We need to provide right timing for custom JS API that may need to work at the beginning of the page.
3433
3434         * UIProcess/API/efl/tests/extensions/extension_sample.cpp:
3435         * WebProcess/InjectedBundle/API/efl/ewk_page.cpp:
3436         (EwkPage::EwkPage):
3437         (EwkPage::didStartProvisionalLoadForFrame):
3438         (EwkPage::didClearWindowObjectForFrame):
3439         (EwkPage::didFinishDocumentLoadForFrame):
3440         * WebProcess/InjectedBundle/API/efl/ewk_page.h:
3441         * WebProcess/InjectedBundle/API/efl/ewk_page_private.h:
3442
3443 2015-06-03  Anders Carlsson  <andersca@apple.com>
3444
3445         Add SPI that returns the snapshot layer contents for a given back/forward list item
3446         https://bugs.webkit.org/show_bug.cgi?id=145621
3447
3448         Reviewed by Dan Bernstein.
3449
3450         * UIProcess/API/Cocoa/WKBackForwardListItem.mm:
3451         (-[WKBackForwardListItem _snapshotLayerContents]):
3452         * UIProcess/API/Cocoa/WKBackForwardListItemInternal.h:
3453         * UIProcess/API/Cocoa/WKBackForwardListItemPrivate.h: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKBackForwardListItemInternal.h.
3454         * WebKit2.xcodeproj/project.pbxproj:
3455
3456 2015-06-02  Hyungwook Lee  <hyungwook.lee@navercorp.com>
3457
3458         [EFL] Implement load_started callback in EwkPageClient.
3459         https://bugs.webkit.org/show_bug.cgi?id=145545
3460
3461         Reviewed by Gyuyoung Kim.
3462
3463         We need to provide load_started callback to web extension module.
3464
3465         * UIProcess/API/efl/tests/extensions/extension_sample.cpp:
3466         * WebProcess/InjectedBundle/API/efl/ewk_page.cpp:
3467         (EwkPage::EwkPage):
3468         (EwkPage::remove):
3469         (EwkPage::didStartProvisionalLoadForFrame):
3470         (EwkPage::didFinishDocumentLoadForFrame):
3471         * WebProcess/InjectedBundle/API/efl/ewk_page.h:
3472         * WebProcess/InjectedBundle/API/efl/ewk_page_private.h:
3473
3474 2015-06-02  Gavin Barraclough  <barraclough@apple.com>
3475
3476         PDFs always think they're visible on iOS.
3477         https://bugs.webkit.org/show_bug.cgi?id=145493
3478         <rdar://problem/19668879>
3479
3480         Reviewed by Andreas Kling & Sam Weinig.
3481
3482         The problem here is that WKContentView is currently responsible for notifying the WebPageProxy
3483         that the visibility may have changed, but when a PDF isn't showing the WKContentView isn't in
3484         the view hierarchy and doesn't receive the didMoveToWindow notifications – and the WKPDFView
3485         (which is in the view hierarchy) does not listen for these events.
3486
3487         Visibility of the page should really just track the visibility of the WKWebView (and when
3488         actually assessing the visibility it largely does - the page client checks the web view's
3489         visibility, bar a FIXME, and the foreground/background check, which needs to change).
3490         So notifications should really just come from the WKWebView.
3491
3492         The WKWebView already listens for the didMoveToWindow notification, it just was only updating
3493         the IsInWindow flag. Instead just update all flags, and the call to viewStateDidChange from
3494         WKContentView can just be removed.
3495
3496         There is one problem with this in that it would reverse the order of the calls to
3497         viewStateDidChange & _updateForScreen:, which would mean the the view would become visible before
3498         updating the screen pixel density. To fix this, moving the call to _updateForScreen:
3499         to willMoveToWindow:, to ensure it occurs before the page becomes visible.
3500
3501         This will also change behavior on Mac for WKWebView clients, in coalescing all view state changes
3502         within the didMoveToWindow call. This is the direction we intended to go in anyway (the plan is
3503         to remove the mayHaveChanged argument from viewStateDidChange - we're currently adding unnecessary
3504         IPC traffic).
3505
3506         * UIProcess/API/Cocoa/WKWebView.mm:
3507         (-[WKWebView didMoveToWindow]):
3508             - should update all view state flags.
3509         * UIProcess/API/ios/WKViewIOS.mm:
3510         (-[WKView didMoveToWindow]):
3511             - added to match WKWebView.mm, for WebKitTestRunner.
3512         * UIProcess/ios/WKContentView.mm:
3513         (-[WKContentView willMoveToWindow:]):
3514             - should _updateForScreen:
3515         (-[WKContentView didMoveToWindow]): Deleted.
3516             - functionality moved to -[WKWebView didMoveToWindow], -[WKContentView didMoveToWindow].
3517
3518 2015-06-02  Chris Dumez  <cdumez@apple.com>
3519
3520         [iOS][WK2] Always mark layers as volatile for background pages
3521         https://bugs.webkit.org/show_bug.cgi?id=145547
3522         <rdar://problem/20663184>
3523
3524         Reviewed by Simon Fraser.
3525
3526         We previously marked layers as volatile when the WebProcess was about
3527         to be suspended. Most of the time the WebProcess gets suspended when a
3528         page goes into the background. However, it is not always true (see
3529         radar), in which case the layers won't be marked as volatile and use
3530         memory even though they are not visible.
3531
3532         We now mark layers as volatile as soon as the page goes into the
3533         background, instead of relying on the WebProcess suspension mechanism
3534         to do so.
3535
3536         A new ApplicationDidEnterBackground IPC message from the UIProcess to
3537         the WebProcess is added (in addition to the pre-existing
3538         ApplicationWillEnterForeground one). When the WebProcess receives this
3539         message, it will freeze the layer tree state and mark the layers as
3540         volatile (with a timer to keep retrying if needed), similarly to what
3541         is already done in WebProcess::actualPrepareToSuspend().
3542         When the ApplicationWillEnterForeground is received, we unfreeze the
3543         layer tree state. The layers' volatile state will be automatically
3544         updated when they are displayed (see setBufferVolatility() call in
3545         RemoteLayerBackingStore::display()).
3546
3547         * UIProcess/WebPageProxy.h:
3548         * UIProcess/ios/WKContentView.mm:
3549         (-[WKContentView _applicationDidEnterBackground:]):
3550         * UIProcess/ios/WebPageProxyIOS.mm:
3551         (WebKit::WebPageProxy::applicationDidEnterBackground):
3552         * WebProcess/WebPage/WebPage.cpp:
3553         (WebKit::WebPage::WebPage):
3554         (WebKit::WebPage::setLayerTreeStateIsFrozen):
3555         (WebKit::WebPage::markLayersVolatileImmediatelyIfPossible):
3556         * WebProcess/WebPage/WebPage.h:
3557         * WebProcess/WebPage/WebPage.messages.in:
3558         * WebProcess/WebPage/ios/WebPageIOS.mm:
3559         (WebKit::WebPage::volatilityTimerFired):
3560         (WebKit::WebPage::applicationDidEnterBackground):
3561         (WebKit::WebPage::applicationWillEnterForeground):
3562         * WebProcess/WebProcess.cpp:
3563         (WebKit::WebProcess::markAllLayersVolatileIfPossible):
3564         (WebKit::WebProcess::setAllLayerTreeStatesFrozen):
3565
3566 2015-06-02  Brady Eidson  <beidson@apple.com>
3567
3568         WebKit policy delegate should suggest if a navigation should be allowed to open URLs externally.
3569         rdar://problem/21025301 and https://bugs.webkit.org/show_bug.cgi?id=145280
3570         
3571         Reviewed by Alex Christensen.
3572
3573         * WebProcess/Plugins/PDF/PDFPlugin.mm:
3574         (WebKit::PDFPlugin::clickedLink):
3575         
3576         * WebProcess/Plugins/PluginView.cpp:
3577         (WebKit::PluginView::performFrameLoadURLRequest):
3578         (WebKit::PluginView::loadURL):
3579         
3580         * WebProcess/WebCoreSupport/WebContextMenuClient.cpp:
3581         (WebKit::WebContextMenuClient::searchWithGoogle):
3582         
3583         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3584         (WebKit::WebFrameLoaderClient::dispatchCreatePage):
3585         
3586         * WebProcess/WebPage/WebInspector.cpp:
3587         (WebKit::WebInspector::openInNewTab):
3588         
3589         * WebProcess/WebPage/WebPage.cpp:
3590         (WebKit::WebPage::loadURLInFrame):
3591         (WebKit::WebPage::loadRequest):
3592         (WebKit::WebPage::loadDataImpl):
3593         (WebKit::WebPage::navigateToPDFLinkWithSimulatedClick):
3594
3595 2015-06-02  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
3596
3597         REGRESSION(r185091): Crash happens on indexdb tests
3598         https://bugs.webkit.org/show_bug.cgi?id=145549
3599
3600         Reviewed by Csaba Osztrogonác.
3601
3602         r185091 caused crash on some indexeddb tests. The crash happens because IDBDatabaseError::create() doesn't
3603         dereference count by using ptr(). It makes a crash when dereferencing on ~Ref() destructor. To fix this issue,
3604         this patch uses leakRef() instead of ptr().
3605
3606         * WebProcess/Databases/IndexedDB/WebIDBServerConnection.cpp:
3607         (WebKit::WebIDBServerConnection::didCreateObjectStore):
3608         (WebKit::WebIDBServerConnection::didCreateIndex):
3609         (WebKit::WebIDBServerConnection::didDeleteIndex):
3610         (WebKit::WebIDBServerConnection::didPutRecord):
3611         (WebKit::WebIDBServerConnection::didGetRecord):
3612         (WebKit::WebIDBServerConnection::didOpenCursor):
3613         (WebKit::WebIDBServerConnection::didAdvanceCursor):
3614         (WebKit::WebIDBServerConnection::didIterateCursor):
3615         (WebKit::WebIDBServerConnection::didCount):
3616         (WebKit::WebIDBServerConnection::didDeleteRange):
3617         (WebKit::WebIDBServerConnection::didClearObjectStore):
3618         (WebKit::WebIDBServerConnection::didDeleteObjectStore):
3619         (WebKit::WebIDBServerConnection::didChangeDatabaseVersion):
3620
3621 2015-06-01  Enrica Casucci  <enrica@apple.com>
3622
3623         [iOS] Hardware Keyboard: All combinations for arrow keys with Shift do not extend the selection.
3624         https://bugs.webkit.org/show_bug.cgi?id=145538
3625         rdar://problem/18504199
3626
3627         Reviewed by Darin Adler.
3628
3629         The extend parameter was ignored in all the functions below.
3630
3631         * UIProcess/ios/WKContentViewInteraction.mm:
3632         (-[WKContentView _moveUp:withHistory:]):
3633         (-[WKContentView _moveDown:withHistory:]):
3634         (-[WKContentView _moveLeft:withHistory:]):
3635         (-[WKContentView _moveRight:withHistory:]):
3636         (-[WKContentView _moveToStartOfWord:withHistory:]):
3637         (-[WKContentView _moveToStartOfParagraph:withHistory:]):
3638         (-[WKContentView _moveToStartOfLine:withHistory:]):
3639         (-[WKContentView _moveToStartOfDocument:withHistory:]):
3640         (-[WKContentView _moveToEndOfWord:withHistory:]):
3641         (-[WKContentView _moveToEndOfParagraph:withHistory:]):
3642         (-[WKContentView _moveToEndOfLine:withHistory:]):
3643         (-[WKContentView _moveToEndOfDocument:withHistory:]):
3644
3645 2015-06-01  Anders Carlsson  <andersca@apple.com>
3646
3647         Use xpc_connection_set_oneshot_instance where possible
3648         https://bugs.webkit.org/show_bug.cgi?id=145535
3649         rdar://problem/21109994
3650
3651         Reviewed by Sam Weinig.
3652
3653         Use xpc_connection_set_oneshot_instance where possible; this will make sure that the 
3654         web process instances go away when the web process exits.
3655
3656         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
3657         (WebKit::connectToService):
3658         (WebKit::connectToReExecService):
3659
3660 2015-06-01  Enrica Casucci  <enrica@apple.com>
3661
3662         [iOS] Hardware Keyboard: Command + left arrow does not work.
3663         https://bugs.webkit.org/show_bug.cgi?id=145531
3664         rdar://problem/18576402
3665
3666         Reviewed by Anders Carlsson.
3667
3668         We were calling a non existent command (moveToStartOfLine) instead of
3669         moveToBeginningOfLine.
3670
3671         * UIProcess/ios/WKContentViewInteraction.mm:
3672         (-[WKContentView _moveToStartOfLine:withHistory:]):
3673
3674 2015-06-01  Brady Eidson  <beidson@apple.com>
3675
3676         Add WKTR support for "should open external URLs".
3677         https://bugs.webkit.org/show_bug.cgi?id=145505
3678
3679         Reviewed by Darin Adler.
3680
3681         Expose C-spi to allow WKTR to set this bit on new loads:
3682         * UIProcess/API/C/WKPage.cpp:
3683         (WKPageLoadURLWithShouldOpenExternalURLsPolicy):
3684         * UIProcess/API/C/WKPagePrivate.h:
3685         
3686         Expose the bit on NavigationAction for the policy delegate:        
3687         * WebProcess/InjectedBundle/API/c/WKBundleNavigationAction.cpp:
3688         (WKBundleNavigationActionGetShouldOpenExternalURLs):
3689         * WebProcess/InjectedBundle/API/c/WKBundleNavigationActionPrivate.h: Copied from Tools/WebKitTestRunner/WorkQueueManager.h.
3690
3691         * WebProcess/InjectedBundle/InjectedBundleNavigationAction.cpp:
3692         (WebKit::InjectedBundleNavigationAction::InjectedBundleNavigationAction):
3693         * WebProcess/InjectedBundle/InjectedBundleNavigationAction.h:
3694         (WebKit::InjectedBundleNavigationAction::shouldOpenExternalURLs):
3695     
3696         * WebKit2.xcodeproj/project.pbxproj:
3697
3698 2015-06-01  Gavin Barraclough  <barraclough@apple.com>
3699
3700         PDFs always think they're visible on iOS.
3701         https://bugs.webkit.org/show_bug.cgi?id=145493
3702         <rdar://problem/19668879>
3703
3704         Unreviewed roll-out.
3705
3706         Temporarily reverting this change – will need a workaround for test harness craziness.
3707
3708         * UIProcess/API/Cocoa/WKWebView.mm:
3709         (-[WKWebView didMoveToWindow]):
3710         (-[WKWebView setOpaque:]):
3711         * UIProcess/ios/WKContentView.mm:
3712         (-[WKContentView willMoveToWindow:]):
3713         (-[WKContentView didMoveToWindow]):
3714         (-[WKContentView browsingContextController]):
3715
3716 2015-06-01  Csaba Osztrogonác  <ossy@webkit.org>
3717
3718         [EFL] Remove unused const variable from EwkView.cpp
3719         https://bugs.webkit.org/show_bug.cgi?id=145512
3720
3721         Reviewed by Gyuyoung Kim.
3722
3723         * UIProcess/API/efl/EwkView.cpp:
3724
3725 2015-06-01  Csaba Osztrogonác  <ossy@webkit.org>
3726
3727         [cmake] Suppress unused parameter warnings in WebKit2 and TestNetscapePlugIn
3728         https://bugs.webkit.org/show_bug.cgi?id=145264
3729
3730         Reviewed by Carlos Garcia Campos.
3731
3732         * CMakeLists.txt: Use COMPILE_FLAGS instead of CMAKE_<C|CXX>_FLAGS to put -Wno-unused-parameter after -Wextra.
3733
3734 2015-05-31  Gavin Barraclough  <barraclough@apple.com>
3735
3736         PDFs always think they're visible on iOS.
3737         https://bugs.webkit.org/show_bug.cgi?id=145493
3738         <rdar://problem/19668879>
3739
3740         Reviewed by Andreas Kling.
3741
3742         The problem here is that WKContentView is currently responsible for notifying the WebPageProxy
3743         that the visibility may have changed, but when a PDF isn't showing the WKContentView isn't in
3744         the view hierarchy and doesn't receive the didMoveToWindow notifications – and the WKPDFView
3745         (which is in the view hierarchy) does not listen for these events.
3746
3747         Visibility of the page should really just track the visibility of the WKWebView (and when
3748         actually assessing the visibility it largely does - the page client checks the web view's
3749         visibility, bar a FIXME, and the foreground/background check, which needs to change).
3750         So notifications should really just come from the WKWebView.
3751
3752         The WKWebView already listens for the didMoveToWindow notification, it just was only updating
3753         the IsInWindow flag. Instead just update all flags, and the call to viewStateDidChange from
3754         WKContentView can just be removed.
3755
3756         There is one problem with this in that it would reverse the order of the calls to
3757         viewStateDidChange & _updateForScreen:, which would mean the the view would become visible before
3758         updating the screen pixel density. To fix this, move the call to _updateForScreen: to
3759         willMoveToWindow:, to ensure it occurs before the page becomes visible.
3760
3761         This will also change behavior on Mac for WKWebView clients, in coalescing all view state changes
3762         within the didMoveToWindow call. This is the direction we intended to go in anyway (the plan is
3763         to remove the mayHaveChanged argument from viewStateDidChange - we're currently adding unnecessary
3764         IPC traffic).
3765
3766         * UIProcess/API/Cocoa/WKWebView.mm:
3767         (-[WKWebView didMoveToWindow]):
3768             - should update all view state flags.
3769         * UIProcess/ios/WKContentView.mm:
3770         (-[WKContentView willMoveToWindow:]):
3771             - should _updateForScreen:
3772         (-[WKContentView didMoveToWindow]): Deleted.
3773             - functionality moved to -[WKWebView didMoveToWindow], -[WKContentView didMoveToWindow].
3774
3775 2015-05-30  Brady Eidson  <beidson@apple.com>
3776
3777         Make FrameLoader methods that take PassRefPtr<Event> take raw pointers instead.
3778         https://bugs.webkit.org/show_bug.cgi?id=145495
3779
3780         Reviewed by Alexey Proskuryakov.
3781
3782         * WebProcess/WebPage/WebPage.cpp:
3783         (WebKit::WebPage::navigateToPDFLinkWithSimulatedClick):
3784
3785 2015-05-29  Joseph Pecoraro  <pecoraro@apple.com>
3786
3787         Web Inspector: Crash closing a related tab with Web Inspector open while page is refreshing
3788         https://bugs.webkit.org/show_bug.cgi?id=145488
3789
3790         Reviewed by Alexey Proskuryakov.
3791
3792         * WebProcess/WebPage/WebInspector.h:
3793         * WebProcess/WebPage/WebInspector.cpp:
3794         (WebKit::WebInspector::~WebInspector):
3795         Ensure, no matter how we close, that we have invalidated the
3796         frontend connection of which we are the client.
3797
3798         (WebKit::WebInspector::createInspectorPage):
3799         This member variable will never be null.
3800
3801 2015-05-29  Andreas Kling  <akling@apple.com>
3802
3803         [iOS] When bouncing back from max pinch zoom scale, scaleChangeRate should be 0.
3804         <https://webkit.org/b/145487>
3805         <rdar://problem/20989389>
3806
3807         Reviewed by Benjamin Poulain.
3808
3809         Make sure we don't send WebCore some velocity data with non-zero scaleChangeRate
3810         when we bounce back from being pinch-zoomed past the maximum scale.
3811
3812         This fixes an issue where the bounce-back animation would cause a burst of
3813         unnecessary tile generation.
3814
3815         * WebProcess/WebPage/ios/WebPageIOS.mm:
3816         (WebKit::adjustVelocityDataForBoundedScale):
3817         (WebKit::WebPage::updateVisibleContentRects):
3818
3819 2015-05-29  Jon Lee  <jonlee@apple.com>
3820
3821         Fix preferences for wireless playback
3822         https://bugs.webkit.org/show_bug.cgi?id=145477
3823         rdar://problem/21166767
3824
3825         Reviewed by Anders Carlsson.
3826
3827         * UIProcess/API/C/WKPreferences.cpp: Add missing preference calls in C API.
3828         * UIProcess/API/C/WKPreferencesRef.h:
3829
3830 2015-05-29  Enrica Casucci  <enrica@apple.com>
3831
3832         [iOS] Cursor hidden in text area once it scrolls.
3833         https://bugs.webkit.org/show_bug.cgi?id=145451
3834         rdar://problem/20356413
3835
3836         Reviewed by Simon Fraser.
3837
3838         This patch fixes both the touch scrolling inside the
3839         overflow area as well as the programmatic scroll that
3840         occurs when inserting a new line. The first issue is fixed by
3841         implementing the chrome client methods didLayout,
3842         didStartOverflowScroll and didEndOverflowScroll. The second
3843         required changing the implementation of notifyRevealedSelectionByScrollingFrame.
3844         We not only need to notify the client to redraw the selection,
3845         but we also need to recompute the editorState, because scrolling
3846         might have occurred.
3847         I've removed the NotifyRevealedSelection message that was not needed
3848         any longer, since EditorStateChanged will do exactly what we want.
3849
3850         * UIProcess/WebPageProxy.h:
3851         * UIProcess/WebPageProxy.messages.in:
3852         * UIProcess/ios/WebPageProxyIOS.mm:
3853         (WebKit::WebPageProxy::editorStateChanged):
3854         (WebKit::WebPageProxy::notifyRevealedSelection): Deleted.
3855         * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
3856         (WebKit::WebChromeClient::notifyRevealedSelectionByScrollingFrame):
3857         (WebKit::WebChromeClient::didLayout):
3858         (WebKit::WebChromeClient::didStartOverflowScroll):
3859         (WebKit::WebChromeClient::didEndOverflowScroll):
3860
3861 2015-05-29  Chris Dumez  <cdumez@apple.com>
3862
3863         [iOS] Update WebContent process sandbox profile for AWD logging
3864         https://bugs.webkit.org/show_bug.cgi?id=145473
3865         <rdar://problem/20543269>
3866
3867         Reviewed by Darin Adler.
3868
3869         Update WebContent process sandbox profile for AWD logging.
3870
3871         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
3872
3873 2015-05-29  Anders Carlsson  <andersca@apple.com>
3874
3875         WebKit.framework installs or references Mac-only headers on iOS
3876         https://bugs.webkit.org/show_bug.cgi?id=145471
3877         rdar://problem/21161459
3878
3879         Reviewed by Dan Bernstein.
3880
3881         * UIProcess/API/C/mac/WKInspectorPrivateMac.h:
3882         Add an #if !TARGET_OS_IPHONE guard around the entire header.
3883
3884 2015-05-29  Anders Carlsson  <andersca@apple.com>
3885
3886         WKScriptMessageInternal.h should be a project header, not a private header
3887         https://bugs.webkit.org/show_bug.cgi?id=145464
3888         rdar://problem/21161639
3889
3890         Reviewed by Dan Bernstein.
3891
3892         * WebKit2.xcodeproj/project.pbxproj:
3893
3894 2015-05-28  Alexey Proskuryakov  <ap@apple.com>
3895
3896         Clean up VisitedLinkProvider teardown
3897         https://bugs.webkit.org/show_bug.cgi?id=145450
3898         rdar://problem/20244726
3899
3900         Reviewed by Brady Eidson.
3901
3902         * UIProcess/VisitedLinkProvider.cpp:
3903         (WebKit::VisitedLinkProvider::~VisitedLinkProvider):
3904
3905 2015-05-28  Brady Eidson  <beidson@apple.com>
3906
3907         Change method of signaling "should open external urls" to WebKit.
3908         https://bugs.webkit.org/show_bug.cgi?id=145454
3909
3910         Reviewed by Dan Bernstein.
3911
3912         Making this a property on the request was never a good idea.
3913
3914         Adding a new extensible load SPI seems much better.
3915
3916         * Shared/API/Cocoa/_WKNSURLRequestExtras.h: Removed.
3917         * Shared/API/Cocoa/_WKNSURLRequestExtras.mm: Removed.
3918
3919         * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
3920         (-[WKBrowsingContextController loadRequest:userData:]): Since this API is deprecated,
3921           it always gets the default restrictive behavior.
3922
3923         * UIProcess/API/Cocoa/WKWebView.mm:
3924         (-[WKWebView loadRequest:]):
3925         (-[WKWebView loadRequest:withOptions:]): Take an options dictionary that, for now, 
3926           only supports one option.
3927         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3928
3929         * WebKit2.xcodeproj/project.pbxproj:
3930
3931 2015-05-28  Anders Carlsson  <andersca@apple.com>
3932
3933         Make sure that we create the private WebKit.framework symlinks last
3934         https://bugs.webkit.org/show_bug.cgi?id=145442
3935         <rdar://problem/21142213>
3936
3937         Reviewed by Dan Bernstein.
3938
3939         Move the "Add Symlinks in /System/Library/PrivateFrameworks/WebKit.framework" build phase to
3940         the "All" aggregate target. Also update the script now that INSTALL_PATH is different.
3941
3942         * WebKit2.xcodeproj/project.pbxproj:
3943
3944 2015-05-28  Said Abou-Hallawa  <sabouhallawa@apple.com>
3945
3946         Code clean up for extracting information from the mix of WritingMode and TextDirection
3947         https://bugs.webkit.org/show_bug.cgi?id=143399
3948
3949         Reviewed by Darin Adler.
3950
3951         * Shared/WebPopupItem.h:
3952         * UIProcess/API/C/efl/WKAPICastEfl.h:
3953         * UIProcess/WebPopupMenuProxy.h:
3954         enum TextDirection is moved from TextFlags.h to WritingMode.h. So include
3955         WritingMode.h instead of including TextFlags.h.
3956
3957 2015-05-28  Antti Koivisto  <antti@apple.com>
3958
3959         Disable network cache for old clients
3960         https://bugs.webkit.org/show_bug.cgi?id=145418
3961
3962         Reviewed by Andreas Kling.
3963
3964         Follow-up: Don't do linked-on-or-after checks for iOS Safari.
3965
3966         * UIProcess/Cocoa/VersionChecks.mm:
3967         (WebKit::linkTimeVersion):
3968         (WebKit::linkedOnOrAfter):
3969
3970 2015-05-28  Matt Rajca  <mrajca@apple.com>
3971
3972         Add ENABLE_MEDIA_SESSION feature flag (which is off by default).
3973         https://bugs.webkit.org/show_bug.cgi?id=145415
3974
3975         Reviewed by Eric Carlson.
3976
3977         * Configurations/FeatureDefines.xcconfig:
3978
3979 2015-05-28  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
3980
3981         Unreviewed, Fix build break since r184930.
3982
3983         * UIProcess/Storage/StorageManager.cpp:
3984         (WebKit::StorageManager::createTransientLocalStorageMap): Pass a pointer of SecurityOrigin
3985         in isSameSchemeHostPort().
3986
3987 2015-05-28  Zan Dobersek  <zdobersek@igalia.com>
3988
3989         Unreviewed. Fixing the build after r184950.
3990
3991         * UIProcess/Storage/StorageManager.cpp:
3992         (WebKit::StorageManager::createSessionStorageMap): getOrCreateStorageArea()
3993         now expects a Ref<WebCore::SecurityOrigin> object.
3994
3995 2015-05-28  Zan Dobersek  <zdobersek@igalia.com>
3996
3997         [WK2] Handle WebCore::SecurityOrigin objects through Ref<> where possible
3998         https://bugs.webkit.org/show_bug.cgi?id=145373
3999
4000         Reviewed by Andreas Kling.
4001
4002         WebCore::SecurityOrigin creation functions in most cases return a
4003         Ref<WebCore::SecurityOrigin> object. In the WebKit2 layer, those objects
4004         were still largely converted to RefPtr<>s.
4005
4006         This patch switches to using Ref<> where possible. The remaining uses of
4007         RefPtr<WebCore::SecurityOrigin> are present due to HashTables, to-be-copied
4008         Vectors, WebCore::DatabaseManager::origins() API and code where non-null
4009         WebCore::SecurityOrigin can't be guaranteed.
4010
4011         * DatabaseProcess/DatabaseProcess.cpp:
4012         (WebKit::DatabaseProcess::deleteIndexedDatabaseEntriesForOrigin):
4013         * NetworkProcess/NetworkProcess.cpp:
4014         (WebKit::cfURLCacheOrigins):
4015         * UIProcess/Storage/LocalStorageDatabase.cpp:
4016         (WebKit::LocalStorageDatabase::create):
4017         (WebKit::LocalStorageDatabase::LocalStorageDatabase):
4018         (WebKit::LocalStorageDatabase::openDatabase):
4019         (WebKit::LocalStorageDatabase::close):
4020         * UIProcess/Storage/LocalStorageDatabase.h:
4021         * UIProcess/Storage/LocalStorageDatabaseTracker.cpp:
4022         (WebKit::LocalStorageDatabaseTracker::origins):
4023         * UIProcess/Storage/LocalStorageDatabaseTracker.h:
4024         * UIProcess/Storage/StorageManager.cpp:
4025         (WebKit::StorageManager::StorageArea::securityOrigin):
4026         (WebKit::StorageManager::TransientLocalStorageNamespace::getOrCreateStorageArea):
4027         (WebKit::StorageManager::TransientLocalStorageNamespace::origins):
4028         (WebKit::StorageManager::TransientLocalStorageNamespace::clearStorageAreasMatchingOrigin):
4029         (WebKit::StorageManager::StorageArea::create):
4030         (WebKit::StorageManager::StorageArea::StorageArea):
4031         (WebKit::StorageManager::StorageArea::openDatabaseAndImportItemsIfNeeded):
4032         (WebKit::StorageManager::LocalStorageNamespace::getOrCreateStorageArea):
4033         (WebKit::StorageManager::LocalStorageNamespace::didDestroyStorageArea):
4034         (WebKit::StorageManager::SessionStorageNamespace::origins):
4035         (WebKit::StorageManager::SessionStorageNamespace::clearStorageAreasMatchingOrigin):
4036         (WebKit::StorageManager::SessionStorageNamespace::getOrCreateStorageArea):
4037         * UIProcess/WebPageProxy.cpp:
4038         (WebKit::WebPageProxy::reachedApplicationCacheOriginQuota):
4039         * WebProcess/ApplicationCache/WebApplicationCacheManager.cpp:
4040         (WebKit::WebApplicationCacheManager::getApplicationCacheOrigins):
4041         * WebProcess/InjectedBundle/InjectedBundle.cpp:
4042         (WebKit::InjectedBundle::setApplicationCacheOriginQuota):
4043         (WebKit::InjectedBundle::resetApplicationCacheOriginQuota):
4044         * WebProcess/ResourceCache/WebResourceCacheManager.cpp:
4045         (WebKit::WebResourceCacheManager::returnCacheOrigins):
4046         (WebKit::WebResourceCacheManager::clearCacheForOrigin):
4047         * WebProcess/WebCoreSupport/WebDatabaseManager.cpp:
4048         (WebKit::WebDatabaseManager::deleteDatabaseWithNameForOrigin):
4049         (WebKit::WebDatabaseManager::deleteDatabasesForOrigin):
4050         (WebKit::WebDatabaseManager::setQuotaForOrigin):
4051
4052 2015-05-19  Jon Honeycutt  <jhoneycutt@apple.com>
4053
4054         [iOS] When viewing an MJPEG stream as the main resource, only the first
4055         frame paints
4056
4057         <https://bugs.webkit.org/show_bug.cgi?id=145185>
4058         <rdar://problem/20124694>
4059
4060         Reviewed by Darin Adler.
4061