3357cc1ff7b55ecf71b2363f5919386e1752370d
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2013-05-09  Anders Carlsson  <andersca@apple.com>
2
3         Fix build.
4
5         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.mm:
6
7 2013-05-09  Anders Carlsson  <andersca@apple.com>
8
9         Enable UI process storage
10         https://bugs.webkit.org/show_bug.cgi?id=115879
11         <rdar://problem/12239765>
12
13         Reviewed by Beth Dakin.
14
15         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
16         Flip the switch.
17
18 2013-05-09  Anders Carlsson  <andersca@apple.com>
19
20         Remove extra spaces between right angle brackets in template declarations
21         https://bugs.webkit.org/show_bug.cgi?id=115877
22
23         Reviewed by Beth Dakin.
24
25         C++11 doesn't require spaces between right angle brackets so remove all of them.
26
27         * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
28         (WebKit::NetworkBlobRegistry::registerBlobURL):
29         (WebKit::NetworkBlobRegistry::sandboxExtensions):
30         * NetworkProcess/FileAPI/NetworkBlobRegistry.h:
31         (NetworkBlobRegistry):
32         * NetworkProcess/HostRecord.h:
33         (HostRecord):
34         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
35         (WebKit::NetworkConnectionToWebProcess::didReceiveMessage):
36         (WebKit::NetworkConnectionToWebProcess::didClose):
37         (WebKit::NetworkConnectionToWebProcess::registerBlobURL):
38         * NetworkProcess/NetworkConnectionToWebProcess.h:
39         (NetworkConnectionToWebProcess):
40         * NetworkProcess/NetworkProcess.h:
41         (NetworkProcess):
42         * NetworkProcess/NetworkResourceLoadScheduler.cpp:
43         (WebKit::NetworkResourceLoadScheduler::servePendingRequests):
44         (WebKit::NetworkResourceLoadScheduler::removeScheduledLoaders):
45         * NetworkProcess/NetworkResourceLoadScheduler.h:
46         * NetworkProcess/SchedulableLoader.cpp:
47         (WebKit::SchedulableLoader::SchedulableLoader):
48         * NetworkProcess/SchedulableLoader.h:
49         (SchedulableLoader):
50         * Platform/CoreIPC/ArgumentCoders.h:
51         * Platform/CoreIPC/Connection.cpp:
52         (Connection::SyncMessageState):
53         (CoreIPC::Connection::waitForMessage):
54         (CoreIPC::Connection::processIncomingMessage):
55         * Platform/CoreIPC/Connection.h:
56         (Connection):
57         * Platform/WorkQueue.h:
58         (WorkQueue):
59         * PluginProcess/PluginProcess.h:
60         (PluginProcess):
61         * Scripts/webkit2/messages_unittest.py:
62         (CoreIPC):
63         * Shared/BlockingResponseMap.h:
64         (BlockingResponseMap):
65         * Shared/ChildProcessProxy.h:
66         (ChildProcessProxy):
67         * Shared/ImmutableArray.cpp:
68         (WebKit::ImmutableArray::ImmutableArray):
69         * Shared/ImmutableArray.h:
70         (WebKit::ImmutableArray::adopt):
71         (ImmutableArray):
72         * Shared/ImmutableDictionary.cpp:
73         (WebKit::ImmutableDictionary::keys):
74         * Shared/ImmutableDictionary.h:
75         (ImmutableDictionary):
76         * Shared/Network/CustomProtocols/CustomProtocolManager.h:
77         (CustomProtocolManager):
78         * Shared/SecurityOriginData.cpp:
79         (WebKit::performAPICallbackWithSecurityOriginDataVector):
80         * Shared/SessionState.cpp:
81         * Shared/StatisticsData.h:
82         (StatisticsData):
83         * Shared/UserMessageCoders.h:
84         (WebKit::UserMessageDecoder::baseDecode):
85         * Shared/WebArchive.cpp:
86         (WebKit::WebArchive::WebArchive):
87         (WebKit::WebArchive::subresources):
88         (WebKit::WebArchive::subframeArchives):
89         * Shared/WebContextMenuItem.cpp:
90         (WebKit::WebContextMenuItem::submenuItemsAsImmutableArray):
91         * Shared/WebOpenPanelParameters.cpp:
92         (WebKit::WebOpenPanelParameters::acceptMIMETypes):
93         (WebKit::WebOpenPanelParameters::selectedFileNames):
94         * Shared/mac/ArgumentCodersMac.mm:
95         (CoreIPC::encode):
96         * SharedWorkerProcess/SharedWorkerProcess.h:
97         (SharedWorkerProcess):
98         * UIProcess/API/mac/WKPrintingView.h:
99         (WebFrameProxy):
100         * UIProcess/API/mac/WKPrintingView.mm:
101         (-[WKPrintingView _drawPreview:]):
102         * UIProcess/API/mac/WKView.mm:
103         (WebKit):
104         * UIProcess/Downloads/DownloadProxyMap.cpp:
105         (WebKit::DownloadProxyMap::processDidClose):
106         * UIProcess/Downloads/DownloadProxyMap.h:
107         (DownloadProxyMap):
108         * UIProcess/GeolocationPermissionRequestManagerProxy.h:
109         (GeolocationPermissionRequestManagerProxy):
110         * UIProcess/Launcher/mac/DynamicLinkerEnvironmentExtractor.h:
111         (DynamicLinkerEnvironmentExtractor):
112         * UIProcess/Network/CustomProtocols/CustomProtocolManagerProxy.h:
113         (CustomProtocolManagerProxy):
114         * UIProcess/Network/NetworkProcessProxy.h:
115         (NetworkProcessProxy):
116         * UIProcess/Notifications/NotificationPermissionRequestManagerProxy.h:
117         (NotificationPermissionRequestManagerProxy):
118         * UIProcess/Notifications/WebNotificationManagerProxy.h:
119         (WebNotificationManagerProxy):
120         * UIProcess/Plugins/PluginProcessManager.h:
121         (PluginProcessManager):
122         * UIProcess/Plugins/PluginProcessProxy.h:
123         (PluginProcessProxy):
124         * UIProcess/Plugins/WebPluginSiteDataManager.cpp:
125         (WebKit::WebPluginSiteDataManager::didGetSitesWithData):
126         * UIProcess/Plugins/WebPluginSiteDataManager.h:
127         (WebPluginSiteDataManager):
128         * UIProcess/SharedWorkers/SharedWorkerProcessManager.h:
129         (SharedWorkerProcessManager):
130         * UIProcess/SharedWorkers/SharedWorkerProcessProxy.h:
131         (SharedWorkerProcessProxy):
132         * UIProcess/StatisticsRequest.cpp:
133         (WebKit::StatisticsRequest::completedRequest):
134         * UIProcess/Storage/StorageManager.cpp:
135         (StorageManager::StorageArea):
136         (WebKit::StorageManager::StorageArea::dispatchEvents):
137         (StorageManager::SessionStorageNamespace):
138         (WebKit::StorageManager::SessionStorageNamespace::getOrCreateStorageArea):
139         (WebKit::StorageManager::SessionStorageNamespace::cloneTo):
140         (WebKit::StorageManager::createLocalStorageMap):
141         (WebKit::StorageManager::createSessionStorageMap):
142         (WebKit::StorageManager::destroyStorageMap):
143         (WebKit::StorageManager::invalidateConnectionInternal):
144         (WebKit::StorageManager::findStorageArea):
145         (WebKit::StorageManager::getOrCreateLocalStorageNamespace):
146         * UIProcess/Storage/StorageManager.h:
147         (StorageManager):
148         * UIProcess/WebApplicationCacheManagerProxy.h:
149         (WebApplicationCacheManagerProxy):
150         * UIProcess/WebBackForwardList.cpp:
151         (WebKit::WebBackForwardList::addItem):
152         (WebKit::WebBackForwardList::backListAsImmutableArrayWithLimit):
153         (WebKit::WebBackForwardList::forwardListAsImmutableArrayWithLimit):
154         (WebKit::WebBackForwardList::clear):
155         * UIProcess/WebBackForwardList.h:
156         (WebKit):
157         * UIProcess/WebContext.cpp:
158         (WebKit::WebContext::createNewWebProcess):
159         (WebKit::WebContext::enableProcessTermination):
160         (WebKit::WebContext::pluginInfoStoreDidLoadPlugins):
161         * UIProcess/WebContext.h:
162         (WebContext):
163         * UIProcess/WebCookieManagerProxy.cpp:
164         (WebKit::WebCookieManagerProxy::didGetHostnamesWithCookies):
165         * UIProcess/WebCookieManagerProxy.h:
166         (WebCookieManagerProxy):
167         * UIProcess/WebDatabaseManagerProxy.cpp:
168         (WebKit::WebDatabaseManagerProxy::didGetDatabasesByOrigin):
169         (WebKit::WebDatabaseManagerProxy::didGetDatabaseOrigins):
170         * UIProcess/WebDatabaseManagerProxy.h:
171         (WebDatabaseManagerProxy):
172         * UIProcess/WebFormClient.cpp:
173         (WebKit::WebFormClient::willSubmitForm):
174         * UIProcess/WebFormClient.h:
175         (WebFormClient):
176         * UIProcess/WebKeyValueStorageManagerProxy.h:
177         (WebKeyValueStorageManagerProxy):
178         * UIProcess/WebLoaderClient.cpp:
179         (WebKit::WebLoaderClient::didChangeBackForwardList):
180         * UIProcess/WebLoaderClient.h:
181         (WebLoaderClient):
182         * UIProcess/WebMediaCacheManagerProxy.cpp:
183         (WebKit::WebMediaCacheManagerProxy::didGetHostnamesWithMediaCache):
184         * UIProcess/WebMediaCacheManagerProxy.h:
185         (WebMediaCacheManagerProxy):
186         * UIProcess/WebPageContextMenuClient.cpp:
187         (WebKit::WebPageContextMenuClient::showContextMenu):
188         * UIProcess/WebPageProxy.cpp:
189         (ExceededDatabaseQuotaRecords):
190         (WebKit::WebPageProxy::relatedPages):
191         (WebKit::WebPageProxy::didChangeBackForwardList):
192         (WebKit::WebPageProxy::handleWheelEvent):
193         (WebKit::WebPageProxy::processNextQueuedWheelEvent):
194         (WebKit::WebPageProxy::findStringMatches):
195         (WebKit::WebPageProxy::willSubmitForm):
196         (WebKit::WebPageProxy::pluginInformationDictionary):
197         (WebKit::WebPageProxy::didFindStringMatches):
198         (WebKit::WebPageProxy::didReceiveEvent):
199         * UIProcess/WebPageProxy.h:
200         (WebPageProxy):
201         * UIProcess/WebPageProxy.messages.in:
202         * UIProcess/WebProcessProxy.cpp:
203         (WebKit::WebProcessProxy::disconnect):
204         (WebKit::WebProcessProxy::didClose):
205         (WebKit::WebProcessProxy::didBecomeUnresponsive):
206         (WebKit::WebProcessProxy::interactionOccurredWhileUnresponsive):
207         (WebKit::WebProcessProxy::didBecomeResponsive):
208         (WebKit::WebProcessProxy::disconnectFramesFromPage):
209         (WebKit::WebProcessProxy::frameCountInPage):
210         * UIProcess/WebProcessProxy.h:
211         (WebProcessProxy):
212         * UIProcess/WebResourceCacheManagerProxy.h:
213         (WebResourceCacheManagerProxy):
214         * UIProcess/mac/WebContextMenuProxyMac.mm:
215         (WebKit::populateNSMenu):
216         (WebKit::nsMenuItemVector):
217         * WebProcess/ApplicationCache/WebApplicationCacheManager.cpp:
218         (WebKit::WebApplicationCacheManager::getApplicationCacheOrigins):
219         * WebProcess/Geolocation/WebGeolocationManager.cpp:
220         (WebKit::WebGeolocationManager::didChangePosition):
221         (WebKit::WebGeolocationManager::didFailToDeterminePosition):
222         * WebProcess/IconDatabase/WebIconDatabaseProxy.h:
223         (WebIconDatabaseProxy):
224         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.mm:
225         * WebProcess/InjectedBundle/InjectedBundle.cpp:
226         (WebKit::InjectedBundle::originsWithApplicationCache):
227         * WebProcess/InjectedBundle/InjectedBundleBackForwardListItem.cpp:
228         (WebKit::InjectedBundleBackForwardListItem::children):
229         * WebProcess/InjectedBundle/InjectedBundlePageEditorClient.cpp:
230         (WebKit::InjectedBundlePageEditorClient::getPasteboardDataForRange):
231         * WebProcess/InjectedBundle/InjectedBundlePageEditorClient.h:
232         (InjectedBundlePageEditorClient):
233         * WebProcess/InjectedBundle/InjectedBundlePageFormClient.cpp:
234         (WebKit::InjectedBundlePageFormClient::willSendSubmitEvent):
235         (WebKit::InjectedBundlePageFormClient::willSubmitForm):
236         * WebProcess/InjectedBundle/InjectedBundlePageFormClient.h:
237         (InjectedBundlePageFormClient):
238         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp:
239         (WebKit::InjectedBundlePageLoaderClient::featuresUsedInPage):
240         * WebProcess/Network/WebResourceLoadScheduler.cpp:
241         (WebKit::WebResourceLoadScheduler::internallyFailedLoadTimerFired):
242         (WebKit::WebResourceLoadScheduler::networkProcessCrashed):
243         * WebProcess/Network/WebResourceLoadScheduler.h:
244         (WebResourceLoadScheduler):
245         * WebProcess/Notifications/NotificationPermissionRequestManager.h:
246         (NotificationPermissionRequestManager):
247         * WebProcess/Notifications/WebNotificationManager.h:
248         (WebNotificationManager):
249         * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp:
250         (WebKit::NPRuntimeObjectMap::invalidate):
251         * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.h:
252         (NPRuntimeObjectMap):
253         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
254         (WebKit::NetscapePlugin::stopAllStreams):
255         * WebProcess/Plugins/Netscape/NetscapePlugin.h:
256         (NetscapePlugin):
257         * WebProcess/Plugins/Netscape/NetscapePluginStream.h:
258         (NetscapePluginStream):
259         * WebProcess/Plugins/PDF/SimplePDFPlugin.mm:
260         (getAllScriptsInPDFDocument):
261         (WebKit::SimplePDFPlugin::runScriptsInPDFDocument):
262         * WebProcess/Plugins/PluginProcessConnectionManager.h:
263         (PluginProcessConnectionManager):
264         * WebProcess/Plugins/PluginView.cpp:
265         (WebKit::PluginView::cancelAllStreams):
266         * WebProcess/Plugins/PluginView.h:
267         (PluginView):
268         * WebProcess/Storage/StorageAreaMap.cpp:
269         (WebKit::StorageAreaMap::dispatchSessionStorageEvent):
270         (WebKit::StorageAreaMap::dispatchLocalStorageEvent):
271         * WebProcess/Storage/StorageNamespaceImpl.cpp:
272         (WebKit::StorageNamespaceImpl::storageArea):
273         * WebProcess/Storage/StorageNamespaceImpl.h:
274         (StorageNamespaceImpl):
275         * WebProcess/Storage/WebKeyValueStorageManager.cpp:
276         (WebKit::keyValueStorageOriginIdentifiers):
277         * WebProcess/WebCoreSupport/WebDatabaseManager.cpp:
278         (WebKit::WebDatabaseManager::getDatabasesByOrigin):
279         (WebKit::WebDatabaseManager::getDatabaseOrigins):
280         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
281         (WebKit::WebEditorClient::getClientPasteboardDataForRange):
282         * WebProcess/WebCoreSupport/WebEditorClient.h:
283         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
284         (WebKit::WebFrameLoaderClient::dispatchWillSubmitForm):
285         * WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
286         (WebKit::WebEditorClient::documentFragmentFromAttributedString):
287         * WebProcess/WebPage/EventDispatcher.h:
288         (EventDispatcher):
289         * WebProcess/WebPage/FindController.cpp:
290         (WebKit::FindController::findStringMatches):
291         * WebProcess/WebPage/FindController.h:
292         (FindController):
293         * WebProcess/WebPage/WebBackForwardListProxy.cpp:
294         (WebKit):
295         * WebProcess/WebPage/WebFrame.cpp:
296         (WebKit::WebFrame::childFrames):
297         * WebProcess/WebPage/WebPage.cpp:
298         (WebKit::WebPage::trackedRepaintRects):
299         * WebProcess/WebPage/WebPage.h:
300         (WebKit):
301         (WebPage):
302         * WebProcess/WebPage/mac/LayerTreeHostMac.h:
303         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
304         (TiledCoreAnimationDrawingArea):
305         * WebProcess/WebProcess.cpp:
306         (WebKit::WebProcess::visitedLinkStateChanged):
307         (WebKit::WebProcess::allVisitedLinkStateChanged):
308         (WebKit::WebProcess::focusedWebPage):
309         (WebKit::WebProcess::createWebPage):
310         (WebKit::WebProcess::didClose):
311         (WebKit::WebProcess::webPageGroup):
312         (WebKit::addCaseFoldedCharacters):
313         (WebKit::getWebCoreMemoryCacheStatistics):
314         (WebKit::WebProcess::setTextCheckerState):
315         * WebProcess/WebProcess.h:
316         (WebProcess):
317
318 2013-05-09  Anders Carlsson  <andersca@apple.com>
319
320         Implement WebPlatformStrategies::transientLocalStorageNamespace
321         https://bugs.webkit.org/show_bug.cgi?id=115876
322         <rdar://problem/13852871>
323
324         Reviewed by Beth Dakin.
325
326         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
327         (WebKit::WebPlatformStrategies::transientLocalStorageNamespace):
328         Return a session storage namespace for a random page when UI process storage is enabled,
329         otherwise call the base class implementation.
330
331 2013-05-09  Anders Carlsson  <andersca@apple.com>
332
333         Use explicit qualifiers for names in the std:: namespace
334         https://bugs.webkit.org/show_bug.cgi?id=115868
335
336         Reviewed by Andreas Kling.
337
338         * Shared/mac/ArgumentCodersMac.mm:
339         (CoreIPC::encode):
340         * UIProcess/API/C/WKPluginSiteDataManager.cpp:
341         (WKPluginSiteDataManagerClearAllSiteData):
342         * UIProcess/Plugins/PluginInfoStore.cpp:
343         (WebKit::PluginInfoStore::findPluginForExtension):
344         * UIProcess/WebFrameProxy.cpp:
345         * UIProcess/WebProcessProxy.cpp:
346         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
347         (WebKit::parsePostBuffer):
348         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
349         (WebKit::NetscapePlugin::loadURL):
350         * WebProcess/Plugins/Netscape/NetscapePluginStream.cpp:
351         (WebKit::NetscapePluginStream::deliverDataToPlugin):
352         * WebProcess/Plugins/PDF/SimplePDFPlugin.mm:
353         * WebProcess/WebPage/DrawingAreaImpl.cpp:
354         * WebProcess/WebPage/FindController.cpp:
355         (WebKit::FindController::countStringMatches):
356         (WebKit::FindController::updateFindUIAfterPageScroll):
357         * WebProcess/WebPage/WebPage.cpp:
358         * WebProcess/WebPage/mac/WebPageMac.mm:
359         (WebKit::drawPDFPage):
360         * WebProcess/mac/WebProcessMac.mm:
361
362 2013-05-09  Max Feil  <mfeil@rim.com>
363
364         shouldUsePluginDocument() needs to be respected when a document is created
365         https://bugs.webkit.org/show_bug.cgi?id=110308
366
367         Reviewed by Rob Buis.
368
369         Renaming shouldUsePluginDocument() to shouldAlwaysUsePluginDocument()
370         for clarity.
371
372         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
373         (WebKit::WebFrameLoaderClient::shouldAlwaysUsePluginDocument):
374         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
375         (WebFrameLoaderClient):
376
377 2013-05-09  Timothy Hatcher  <timothy@apple.com>
378
379         Make dragging off a tab in Safari with a docked Inspector reattach the Inspector.
380
381         https://webkit.org/b/115832
382         rdar://problem/13605661
383
384         Reviewed by Benjamin Poulain.
385
386         * UIProcess/mac/WebInspectorProxyMac.mm:
387         (WebKit::WebInspectorProxy::platformBringToFront):
388         If the Web Inspector is no longer in the same window as the inspected view,
389         then we need to reopen the Inspector to get it attached to the right window.
390
391 2013-05-08  Anders Carlsson  <andersca@apple.com>
392
393         Fix a typo in a comment.
394
395         Rubber-stamped by Darin Adler.
396
397         * WebProcess/WebProcess.cpp:
398         (WebKit::WebProcess::initializeConnection):
399
400 2013-05-08  Anders Carlsson  <andersca@apple.com>
401
402         Remove bogus StorageAreaMap assertions
403         https://bugs.webkit.org/show_bug.cgi?id=115838
404
405         Reviewed by Sam Weinig.
406
407         It is possible for didGetValues, and didClear to be called even if m_hasPendingClear is false so remove the assertions.
408
409         * WebProcess/Storage/StorageAreaMap.cpp:
410         (WebKit::StorageAreaMap::didGetValues):
411         (WebKit::StorageAreaMap::didClear):
412
413 2013-05-08  Anders Carlsson  <andersca@apple.com>
414
415         Handle incoming clear operations
416         https://bugs.webkit.org/show_bug.cgi?id=115829
417
418         Reviewed by Sam Weinig.
419
420         Handle clear by building up a new storage map with our pending changes.
421
422         * WebProcess/Storage/StorageAreaMap.cpp:
423         (WebKit::StorageAreaMap::applyChange):
424
425 2013-05-08  Anders Carlsson  <andersca@apple.com>
426
427         Don't apply changes while we're clearing the database
428         https://bugs.webkit.org/show_bug.cgi?id=115826
429
430         Reviewed by Darin Adler.
431
432         * UIProcess/Storage/LocalStorageDatabase.cpp:
433         (WebKit::LocalStorageDatabase::openDatabase):
434         Only call didOpenDatabaseWithOrigin if we actually did open the database.
435
436         (WebKit::LocalStorageDatabase::updateDatabaseWithChangedItems):
437         Create the database if needed.
438
439         * UIProcess/Storage/StorageManager.cpp:
440         (WebKit::StorageManager::getValues):
441         Send back a DidGetValues message.
442
443         * WebProcess/Storage/StorageAreaMap.cpp:
444         (WebKit::StorageAreaMap::StorageAreaMap):
445         Initialize m_hasPendingClear.
446
447         (WebKit::StorageAreaMap::clear):
448         Set m_hasPendingClear to true.
449
450         (WebKit::StorageAreaMap::resetValues):
451         Set m_hasPendingClear back to false.
452
453         (WebKit::StorageAreaMap::loadValuesIfNeeded):
454         Set m_hasPendingClear to true so we'll ignore any changes that are already part of the returned items.
455
456         (WebKit::StorageAreaMap::didGetValues):
457         Set m_hasPendingClear back to false.
458
459         (WebKit::StorageAreaMap::didClear):
460         Set m_hasPendingClear back to false.
461
462         (WebKit::StorageAreaMap::applyChange):
463         Don't apply the change if m_hasPendingClear is true.
464
465         * WebProcess/Storage/StorageAreaMap.messages.in:
466         Add DidGetValues message.
467
468 2013-05-08  Andy Estes  <aestes@apple.com>
469
470         [WebKit2] REGRESSION (Custom Protocols): Reproducible crash when navigating to URL with an invalid scheme
471         https://bugs.webkit.org/show_bug.cgi?id=115790
472
473         Reviewed by Alexey Proskuryakov.
474
475         NSMutableSet does not support adding or removing nil objects, and
476         WTF::HashSet does not support adding, removing, or checking for null
477         WTF::Strings.
478
479         For the NSMutableSet case, make sure that we don't try to add or remove
480         nil NSStrings.
481
482         For the WTF::HashSet case, NSURL will return a nil NSString if we ask
483         it for its scheme when it is invalid, which we will convert to a null
484         WTF::String. Don't try to check if our HashSet of registered schemes
485         contains a null String.
486
487         * Shared/Network/CustomProtocols/mac/CustomProtocolManagerMac.mm:
488         (WebKit::CustomProtocolManager::registerScheme): Assert that the scheme
489         isn't null. We reject null schemes at the WKBrowsingContextController level.
490         (WebKit::CustomProtocolManager::unregisterScheme): Ditto.
491         (WebKit::CustomProtocolManager::supportsScheme): If scheme is null, return false.
492         * UIProcess/API/mac/WKBrowsingContextController.mm:
493         (+[WKBrowsingContextController registerSchemeForCustomProtocol:]): Do not register a nil scheme.
494         (+[WKBrowsingContextController unregisterSchemeForCustomProtocol:]): Ditto.
495
496 2013-05-08  Anders Carlsson  <andersca@apple.com>
497
498         Apply remote changes to storage maps locally
499         https://bugs.webkit.org/show_bug.cgi?id=115825
500
501         Reviewed by Beth Dakin.
502
503         * WebProcess/Storage/StorageAreaMap.cpp:
504         (WebKit::StorageAreaMap::resetValues):
505         Clear the pending values map.
506
507         (WebKit::StorageAreaMap::didSetItem):
508         If we failed to set the item, forget everything we know about this storage map.
509         Otherwise, remove the pending item.
510
511         (WebKit::StorageAreaMap::didRemoveItem):
512         Remove the pending item.
513
514         (WebKit::StorageAreaMap::shouldApplyChangeForKey):
515         Helper function that returns whether a change for a given key should be applied.
516
517         (WebKit::StorageAreaMap::applyChange):
518         Apply the change. Currently only adds and removes are handled.
519
520         (WebKit::StorageAreaMap::dispatchStorageEvent):
521         Apply the change locally as well if needed.
522
523         * WebProcess/Storage/StorageAreaMap.h:
524
525 2013-05-08  Anders Carlsson  <andersca@apple.com>
526
527         Assert at compile time that we don't pass Objective-C object pointers to adoptCF
528         https://bugs.webkit.org/show_bug.cgi?id=115823
529
530         Reviewed by Geoffrey Garen.
531
532         Fix adoptNS/adoptCF mismatches. For the adopt(leakRef()) case we'd ideally want a static_pointer_cast overload for RetainPtr,
533         but this will do for now.
534         
535         * Shared/mac/ArgumentCodersMac.mm:
536         (CoreIPC::decode):
537
538 2013-05-08  Sam Weinig  <sam@webkit.org>
539
540         Add SPI to determine if a plugin is sandboxed
541         https://bugs.webkit.org/show_bug.cgi?id=115810
542
543         Reviewed by Anders Carlsson.
544
545         * PluginProcess/mac/PluginProcessMac.mm:
546         (WebKit::PluginProcess::initializeSandbox):
547         * Shared/Plugins/mac/PluginSandboxProfile.h: Added.
548         * Shared/Plugins/mac/PluginSandboxProfile.mm: Added.
549         (WebKit::pluginSandboxProfileDefaultDirectory):
550         (WebKit::pluginSandboxProfileDirectories):
551         (WebKit::pluginSandboxProfileName):
552         (WebKit::pluginSandboxCommonProfile):
553         (WebKit::pluginSandboxProfileForDirectory):
554         (WebKit::pluginSandboxProfile):
555         (WebKit::pluginHasSandboxProfileForDirectory):
556         (WebKit::pluginHasSandboxProfile):
557         Move sandbox code to its own file and refactor to use cocoa. Also adds pluginHasSandboxProfile function
558         which uses the newly refactored code.
559
560         * UIProcess/API/C/mac/WKContextPrivateMac.h:
561         * UIProcess/API/C/mac/WKContextPrivateMac.mm:
562         (WKPlugInInfoIsSandboxedKey):
563         (createInfoDictionary):
564         Add WKPlugInInfoIsSandboxedKey.
565
566         * WebKit2.xcodeproj/project.pbxproj:
567         Add new files.
568
569 2013-05-08  Anders Carlsson  <andersca@apple.com>
570
571         Safari unexpectedly quits with invalid message from the web process with message ID 0x323002f (WebPageProxy.DecidePolicyForNavigationAction)
572         https://bugs.webkit.org/show_bug.cgi?id=115814
573         <rdar://problem/12331258>
574
575         Reviewed by Andreas Kling.
576
577         To ensure that any asynchronous messages are delivered to the UI process before
578         synchronous messages (except when doing so would lead to a deadlock), Call
579         setOnlySendMessagesAsDispatchWhenWaitingForSyncReplyWhenProcessingSuchAMessage on the UI process connections.
580
581         * WebProcess/WebProcess.cpp:
582         (WebKit::WebProcess::initializeConnection):
583
584 2013-05-08  Tim Horton  <timothy_horton@apple.com>
585
586         Coalesce WKView visibleRect changes
587         https://bugs.webkit.org/show_bug.cgi?id=115792
588         <rdar://problem/13776842>
589
590         Reviewed by Simon Fraser.
591
592         The system can call renewGState much more often than we actually want
593         to update the WebProcess' notion of the exposed rect. Most importantly,
594         within an autolayout pass it is called many times, and often sees
595         [WKView visibleRect] be an intermediate value which will never be
596         flushed to the screen. We only care about the final value, so we should
597         wait until AppKit has finished - with a zero-delay timer - to inform the
598         WebProcess of exposed rect changes.
599
600         * UIProcess/WebPageProxy.cpp:
601         (WebKit::WebPageProxy::WebPageProxy):
602         Add exposedRectChangedTimer.
603         (WebKit::WebPageProxy::close):
604         Cancel exposedRectChangedTimer when tearing down the WebPageProxy.
605         * UIProcess/WebPageProxy.h:
606         (WebPageProxy):
607         Add exposedRectChangedTimerFired, the timer itself, and two rects:
608         the most recent exposed rect from the WKView, and the last one we actually
609         sent across to the WebProcess.
610         * UIProcess/mac/WebPageProxyMac.mm:
611         (WebKit::WebPageProxy::viewExposedRectChanged):
612         Instead of immediately sending exposed rect changes to the WebProcess,
613         start a zero-delay timer to do so.
614         (WebKit::WebPageProxy::exposedRectChangedTimerFired):
615         Once the zero-delay timer fires, send the new exposed rect to the WebProcess.
616
617 2013-05-08  Alexey Proskuryakov  <ap@apple.com>
618
619         <rdar://problem/13776220> 13A451: PluginProcess(2225) deny file-read-data ~/Library/InputManagers
620         <rdar://problem/13642510> PluginProcess logs sandbox violations initializing TextServices
621
622         Reviewed by Anders Carlsson.
623
624         * Resources/PlugInSandboxProfiles/com.apple.WebKit.plugin-common.sb: Allow more
625         TextServices and NSInputManager directories.
626
627 2013-05-08  Anders Carlsson  <andersca@apple.com>
628
629         Remove BinarySemaphoreWin.cpp.
630
631         Rubber-stamped by Beth Dakin.
632
633         BinarySemaphoreWin has been moved to WTF, but the original was never removed.
634
635         * Platform/CoreIPC/win/BinarySemaphoreWin.cpp: Removed.
636
637 2013-05-08  Zan Dobersek  <zdobersek@igalia.com>
638
639         [WK2] Make the WebNetworkInfoManager a supplement to the WebProcess
640         https://bugs.webkit.org/show_bug.cgi?id=115716
641
642         Reviewed by Andreas Kling.
643
644         WebNetworkInfoManager should inherit from WebProcessSupplement and should be used
645         as such by the WebProcess. This removes the need for the m_networkInfoManager member
646         variable in the WebProcess class and brings the WebNetworkInfoManager in line with
647         other manager classes of which instances are controlled by the WebProcess class.
648
649         * WebProcess/NetworkInfo/WebNetworkInfoManager.cpp:
650         (WebKit::WebNetworkInfoManager::supplementName): Specify the supplement's name.
651         (WebKit):
652         * WebProcess/NetworkInfo/WebNetworkInfoManager.h:
653         (WebKit): Alphabetically reorder the two forwarding declarations.
654         (WebNetworkInfoManager): Inherit from the WebProcessSupplement interface.
655         * WebProcess/WebCoreSupport/WebNetworkInfoClient.cpp:
656         (WebKit::WebNetworkInfoClient::bandwidth): Access the WebNetworkInfoManager as a supplement.
657         (WebKit::WebNetworkInfoClient::metered): Ditto.
658         (WebKit::WebNetworkInfoClient::startUpdating): Ditto.
659         (WebKit::WebNetworkInfoClient::stopUpdating): Ditto.
660         (WebKit::WebNetworkInfoClient::networkInfoControllerDestroyed): Ditto.
661         * WebProcess/WebProcess.cpp:
662         (WebKit::WebProcess::WebProcess): Add the WebNetworkInfoManager instance as a supplement.
663         * WebProcess/WebProcess.h:
664         (WebProcess): Remove the m_networkInfoManager member variable and its getter method.
665
666 2013-05-08  Zan Dobersek  <zdobersek@igalia.com>
667
668         [WK2] Make the WebBatteryManager a supplement to the WebProcess
669         https://bugs.webkit.org/show_bug.cgi?id=115715
670
671         Reviewed by Andreas Kling.
672
673         WebBatteryManager should inherit from WebProcessSupplement and should be used as such
674         by the WebProcess. This removes the need for the m_batteryManager member variable in
675         the WebProcess class and brings the WebBatteryManager in line with other manager classes
676         of which instances are controlled by the WebProcess class.
677
678         * WebProcess/Battery/WebBatteryManager.cpp:
679         (WebKit::WebBatteryManager::supplementName): Specify the supplement's name.
680         (WebKit):
681         * WebProcess/Battery/WebBatteryManager.h:
682         (WebBatteryManager): Inherit from the WebProcessSupplement interface.
683         * WebProcess/WebCoreSupport/WebBatteryClient.cpp:
684         (WebKit::WebBatteryClient::startUpdating): Access the WebBatteryManager as a supplement.
685         (WebKit::WebBatteryClient::stopUpdating): Ditto.
686         (WebKit::WebBatteryClient::batteryControllerDestroyed): Ditto.
687         * WebProcess/WebProcess.cpp:
688         (WebKit::WebProcess::WebProcess): Add the WebBatteryManager instance as a supplement.
689         * WebProcess/WebProcess.h:
690         (WebProcess): Remove the m_batteryManager member variable and its getter method.
691
692 2013-05-06  Darin Adler  <darin@apple.com>
693
694         Use adoptCF and adoptNS in more places
695         https://bugs.webkit.org/show_bug.cgi?id=115657
696
697         Reviewed by Sam Weinig.
698
699         * Shared/Downloads/cfnet/DownloadCFNet.cpp:
700         (WebKit::Download::useCredential):
701         (WebKit::Download::start):
702         (WebKit::Download::startWithHandle):
703         (WebKit::Download::cancel):
704         (WebKit::Download::didDecideDestination):
705         Use adoptCF and adoptNS.
706
707 2013-05-06  Sam Weinig  <sam@webkit.org>
708
709         Add SPI to get an array of all the installed plug-ins
710         https://bugs.webkit.org/show_bug.cgi?id=115688
711
712         Reviewed by Anders Carlsson.
713
714         * UIProcess/API/C/mac/WKContextPrivateMac.h:
715         * UIProcess/API/C/mac/WKContextPrivateMac.mm:
716         (createInfoDictionary):
717         Extract creation of info dictionary into helper.
718         (WKContextCopyPlugInInfoForBundleIdentifier):
719         Modified to use the new helper.
720         (WKContextGetInfoForInstalledPlugIns):
721         Added.
722
723 2013-05-07  Anders Carlsson  <andersca@apple.com>
724
725         Clean up KeyframeValueList and related classes
726         https://bugs.webkit.org/show_bug.cgi?id=115738
727
728         Reviewed by Simon Fraser.
729
730         Update for WebCore changes.
731
732         * Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp:
733         (CoreIPC::::decode):
734
735 2013-05-07  Anders Carlsson  <andersca@apple.com>
736
737         Add and remove databases and origins from the database tracker
738         https://bugs.webkit.org/show_bug.cgi?id=115752
739
740         Reviewed by Andreas Kling.
741
742         * UIProcess/Storage/LocalStorageDatabase.cpp:
743         (WebKit::LocalStorageDatabase::LocalStorageDatabase):
744         Rename m_databaseFilename to m_databasePath.
745
746         (WebKit::LocalStorageDatabase::tryToOpenDatabase):
747         Rename m_databaseFilename to m_databasePath.
748
749         * UIProcess/Storage/LocalStorageDatabase.h:
750         Rename m_databaseFilename to m_databasePath.
751
752         * UIProcess/Storage/LocalStorageDatabaseTracker.cpp:
753         (WebKit::LocalStorageDatabaseTracker::databasePath):
754         Rename databaseFilename to databasePath.
755
756         (WebKit::LocalStorageDatabaseTracker::didOpenDatabaseWithOrigin):
757         Call addDatabaseWithOriginIdentifier.
758
759         (WebKit::LocalStorageDatabaseTracker::deleteEmptyDatabaseWithOrigin):
760         Call removeDatabaseWithOriginIdentifier.
761
762         (WebKit::LocalStorageDatabaseTracker::trackerDatabasePath):
763         Call databasePath instead of databaseFile.
764
765         (WebKit::LocalStorageDatabaseTracker::openTrackerDatabase):
766         Bail if the database is already open.
767
768         (WebKit::LocalStorageDatabaseTracker::updateTrackerDatabaseFromLocalStorageDatabaseFiles):
769         Call addDatabaseWithOriginIdentifier if this is an origin we don't know about.
770
771         (WebKit::LocalStorageDatabaseTracker::addDatabaseWithOriginIdentifier):
772         Add the database to the Origins table.
773
774         (WebKit::LocalStorageDatabaseTracker::removeDatabaseWithOriginIdentifier):
775         remove the database from the Origins table and delete it.
776
777         (WebKit::LocalStorageDatabaseTracker::pathForDatabaseWithOriginIdentifier):
778         Helper function that looks up a database path given its identifier.
779         
780         * UIProcess/Storage/LocalStorageDatabaseTracker.h:
781         Rename databaseFile to databasePath.
782
783 2013-05-07  Anders Carlsson  <andersca@apple.com>
784
785         The storage database tracker should know when databases come and go
786         https://bugs.webkit.org/show_bug.cgi?id=115748
787
788         Reviewed by Andreas Kling.
789
790         * UIProcess/Storage/LocalStorageDatabase.cpp:
791         (WebKit::LocalStorageDatabase::openDatabase):
792         If we've opened the database successfully, call LocalStorageDatabaseTracker::didOpenDatabaseWithOrigin.
793
794         (WebKit::LocalStorageDatabase::tryToOpenDatabase):
795         Remove a FIXME; we run all storage related things on the same thread.
796
797         (WebKit::LocalStorageDatabase::close):
798         Close the database. If it's empty, call LocalStorageDatabaseTracker::deleteEmptyDatabaseWithOrigin.
799
800         (WebKit::LocalStorageDatabase::databaseIsEmpty):
801         Helper function for determining whether a database is empty.
802         
803         * UIProcess/Storage/LocalStorageDatabase.h:
804         * UIProcess/Storage/LocalStorageDatabaseTracker.cpp:
805         (WebKit::LocalStorageDatabaseTracker::databaseFilename):
806         Add ".localstorage" to the filename.
807
808         (WebKit::LocalStorageDatabaseTracker::didOpenDatabaseWithOrigin):
809         (WebKit::LocalStorageDatabaseTracker::deleteEmptyDatabaseWithOrigin):
810         Add empty stubs.
811
812 2013-05-07  Brady Eidson  <beidson@apple.com>
813
814         Add JoinExistingSession to the Networking XPC.
815         <rdar://problem/12902288> and https://bugs.webkit.org/show_bug.cgi?id=114991
816
817         Reviewed by Sam Weinig.
818
819         * NetworkProcess/EntryPoint/mac/XPCService/NetworkService.Development/Info.plist:
820         * NetworkProcess/EntryPoint/mac/XPCService/NetworkService/Info.plist:
821
822 2013-05-07  Anders Carlsson  <andersca@apple.com>
823
824         REGRESSION(r149647): Assertion failure in LocalStorageDatabaseTracker::setLocalStorageDirectoryInternal
825         https://bugs.webkit.org/show_bug.cgi?id=115711
826
827         Reviewed by Andreas Kling.
828
829         Handle setting the local storage directory more than once.
830
831         * UIProcess/Storage/LocalStorageDatabaseTracker.cpp:
832         (WebKit::LocalStorageDatabaseTracker::setLocalStorageDirectoryInternal):
833         Close the database (if necessary) and clear the origins map before importing the origin identifiers.
834
835 2013-05-07  Antoine Quint  <graouts@apple.com>
836
837         Re-establish autostart timeout extension on user interaction
838         https://bugs.webkit.org/show_bug.cgi?id=113232
839
840         Change WebProcess::pluginDidReceiveUserInteraction to use a tuple of
841         (pluginOrigin, pageOrigin, mimeType) arguments like the other similar
842         WebProcess methods and gather these arguments from the PlugInView's
843         plug-in element.
844
845         Reviewed by Dean Jackson.
846
847         * WebProcess/Plugins/PluginView.cpp:
848         (WebKit::PluginView::pluginDidReceiveUserInteraction):
849         Cast the m_pluginElement to a HTMLPlugInImageElement so we can obtain the
850         tuple of (pluginOrigin, pageOrigin, mimeType) to pass to pluginDidReceiveUserInteraction().
851
852         * WebProcess/WebProcess.cpp:
853         (WebKit::WebProcess::plugInDidReceiveUserInteraction):
854         * WebProcess/WebProcess.h:
855         (WebProcess):
856         Update method signature to a tuple of (pluginOrigin, pageOrigin, mimeType)
857         and obtain the plug-in origin hash from that.
858
859 2013-05-07  Anders Carlsson  <andersca@apple.com>
860
861         Each local storage database should know its origin
862         https://bugs.webkit.org/show_bug.cgi?id=115737
863
864         Reviewed by Andreas Kling.
865
866         Store the security origin in a member variable. It'll be used to communicate database state changes to the tracker.
867
868         * UIProcess/Storage/LocalStorageDatabase.cpp:
869         (WebKit::LocalStorageDatabase::create):
870         (WebKit::LocalStorageDatabase::LocalStorageDatabase):
871         * UIProcess/Storage/LocalStorageDatabase.h:
872         (LocalStorageDatabase):
873
874 2013-05-07  Brady Eidson  <beidson@apple.com>
875
876         Remove some unnecessary soft linking in NetworkProcess. (Take 2)
877         <rdar://problem/13821779> and https://bugs.webkit.org/show_bug.cgi?id=115683
878
879         Reviewed by Dean Jackson and owned by Andreas Kling.
880
881         As a followup to r149651, include the private headers conditionally.
882         Also, fix a bug introduced with r149651 (bool vs CFBooleanRef).
883
884         * NetworkProcess/mac/DiskCacheMonitor.mm:
885         * NetworkProcess/mac/NetworkResourceLoaderMac.mm:
886         (WebKit::NetworkResourceLoader::tryGetShareableHandleFromSharedBuffer):
887
888 2013-05-07  Jinwoo Song  <jinwoo7.song@samsung.com>
889
890         [EFL][WK2] Add ewk APIs for setting and getting user agent
891         https://bugs.webkit.org/show_bug.cgi?id=114429
892
893         Reviewed by Andreas Kling.
894
895         Provide ewk_view_user_agent_get/set APIs which wraps WK APIs.
896
897         * UIProcess/API/efl/EwkView.cpp:
898         (EwkView::EwkView):
899         (EwkView::setUserAgent):
900         * UIProcess/API/efl/EwkView.h:
901         (EwkView::userAgent):
902         (EwkView):
903         * UIProcess/API/efl/ewk_view.cpp:
904         (ewk_view_user_agent_get):
905         (ewk_view_user_agent_set):
906         * UIProcess/API/efl/ewk_view.h:
907         * UIProcess/API/efl/tests/test_ewk2_view.cpp:
908         (TEST_F):
909
910 2013-05-07  Mikhail Pozdnyakov  <mikhail.pozdnyakov@intel.com>
911
912         HashTraits<RefPtr<P> >::PeekType should be raw pointer for better performance
913         https://bugs.webkit.org/show_bug.cgi?id=115646
914
915         Reviewed by Darin Adler.
916
917         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
918         (WebKit::NetworkConnectionToWebProcess::convertMainResourceLoadToDownload):
919         * NetworkProcess/NetworkResourceLoadScheduler.cpp:
920         (WebKit::NetworkResourceLoadScheduler::hostForURL):
921         * Shared/ImmutableDictionary.h:
922         (WebKit::ImmutableDictionary::get):
923         * UIProcess/Storage/StorageManager.cpp:
924         (WebKit::StorageManager::createSessionStorageMap):
925         (WebKit::StorageManager::cloneSessionStorageNamespaceInternal):
926         (WebKit::StorageManager::findStorageArea):
927         * UIProcess/WebContext.h:
928         (WebKit::WebContext::supplement):
929         * UIProcess/WebProcessProxy.cpp:
930         (WebKit::WebProcessProxy::webBackForwardItem):
931         (WebKit::WebProcessProxy::webFrame):
932         * UIProcess/efl/DownloadManagerEfl.cpp:
933         (WebKit::DownloadManagerEfl::ewkDownloadJob):
934         * WebProcess/Network/WebResourceLoadScheduler.h:
935         (WebKit::WebResourceLoadScheduler::webResourceLoaderForIdentifier):
936         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
937         (WebKit::NetscapePlugin::streamFromID):
938         * WebProcess/Plugins/PluginProcessConnectionManager.cpp:
939         (WebKit::PluginProcessConnectionManager::pluginProcessCrashed):
940         * WebProcess/Plugins/PluginView.cpp:
941         (WebKit::PluginView::cancelStreamLoad):
942         * WebProcess/WebPage/EventDispatcher.cpp:
943         (WebKit::EventDispatcher::wheelEvent):
944         * WebProcess/WebPage/WebBackForwardListProxy.cpp:
945         (WebKit::WebBackForwardListProxy::itemForID):
946         (WebKit::WebBackForwardListProxy::itemAtIndex):
947         * WebProcess/WebPage/WebPage.cpp:
948         (WebKit::WebPage::webUndoStep):
949         (WebKit::WebPage::didFinishCheckingText):
950         (WebKit::WebPage::didCancelCheckingText):
951         * WebProcess/WebProcess.cpp:
952         (WebKit::WebProcess::webPage):
953         (WebKit::WebProcess::webPageGroup):
954             Updated accordingly to new HashMap<.., RefPtr>::get() semantics.
955
956 2013-05-06  Zoltan Arvai  <zarvai@inf.u-szeged.hu>
957
958         [Qt] Unreviewed buildfix after r149637.
959
960         * Target.pri:
961
962 2013-05-06  Ryosuke Niwa  <rniwa@webkit.org>
963
964         REGRESSION(r149647): Assertion failure in LocalStorageDatabaseTracker::setLocalStorageDirectoryInternal
965         https://bugs.webkit.org/show_bug.cgi?id=115711    
966
967         Rubber-stamped by Anders Carlsson.
968
969         Temporarily removed the assertion. Andres is going to investigate it tomorrow.
970
971         * UIProcess/Storage/LocalStorageDatabaseTracker.cpp:
972         (WebKit::LocalStorageDatabaseTracker::setLocalStorageDirectoryInternal):
973
974 2013-05-06  Darin Adler  <darin@apple.com>
975
976         Use OwnPtr instead of deleteAllValues in KeyframeValueList
977         https://bugs.webkit.org/show_bug.cgi?id=115652
978
979         Reviewed by Simon Fraser.
980
981         * Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp:
982         (CoreIPC::ArgumentCoder<GraphicsLayerAnimation>::decode): Added adoptPtr
983         next to new when calling KeyframeValueList::insert.
984
985 2013-05-06  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
986
987         Unreviewed, build fix on EFL port
988
989         * CMakeLists.txt: Add LocalStorageDatabaseTracker.cpp
990
991 2013-05-06  Philippe Normand  <pnormand@igalia.com>
992
993         Unreviewed, GTK build fix after r149637.
994
995         * GNUmakefile.list.am: Add LocalStorageDatabaseTracker sources to
996         the build.
997
998 2013-05-06  Brady Eidson  <beidson@apple.com>
999
1000         Remove some unnecessary soft linking in NetworkProcess.
1001         <rdar://problem/13821779> and https://bugs.webkit.org/show_bug.cgi?id=115683
1002
1003         Reviewed by Sam Weinig.
1004
1005         Replace some unneeded soft linking with forward declarations.
1006
1007         * NetworkProcess/mac/DiskCacheMonitor.mm:
1008         (WebKit::DiskCacheMonitor::DiskCacheMonitor):
1009         * NetworkProcess/mac/NetworkResourceLoaderMac.mm:
1010         (WebKit::NetworkResourceLoader::tryGetShareableHandleFromCFURLCachedResponse):
1011         (WebKit::NetworkResourceLoader::tryGetShareableHandleFromSharedBuffer):
1012
1013 2013-05-06  Anders Carlsson  <andersca@apple.com>
1014
1015         More work on LocalStorageDatabaseTracker
1016         https://bugs.webkit.org/show_bug.cgi?id=115680
1017
1018         Reviewed by Andreas Kling.
1019
1020         * UIProcess/Storage/LocalStorageDatabaseTracker.cpp:
1021         (WebKit::LocalStorageDatabaseTracker::databaseFilename):
1022         Call the new databaseFilename that takes a string.
1023
1024         (WebKit::LocalStorageDatabaseTracker::setLocalStorageDirectoryInternal):
1025         Assert that we don't call this more than once. Dispatch a call to import origin identifiers.
1026
1027         (WebKit::LocalStorageDatabaseTracker::trackerDatabasePath):
1028         New helper function that returns the tracker database path.
1029
1030         (WebKit::LocalStorageDatabaseTracker::openTrackerDatabase):
1031         Open the database and create the Origins table if needed.
1032
1033         (WebKit::LocalStorageDatabaseTracker::importOriginIdentifiers):
1034         Open the database and import the origin identifiers from it, then synchronize it with whatever files are on disk.
1035
1036         (WebKit::LocalStorageDatabaseTracker::updateTrackerDatabaseFromLocalStorageDatabaseFiles):
1037         Bring the tracker database up to date from the database files on disk.
1038
1039         * UIProcess/Storage/LocalStorageDatabaseTracker.h:
1040         (LocalStorageDatabaseTracker):
1041
1042 2013-05-06  Alexey Proskuryakov  <ap@apple.com>
1043
1044         <rdar://problem/13479806> [Mac] Pass information about open pages to LaunchServices
1045         https://bugs.webkit.org/show_bug.cgi?id=115665
1046
1047         Reviewed by Darin Adler.
1048
1049         * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::didCommitLoad): Moved repeated
1050         check for frame->isMainFrame() to the top, matching oter similar functions.
1051         Call updateActivePages().
1052
1053         * WebProcess/WebProcess.cpp:
1054         (WebKit::WebProcess::networkProcessConnectionClosed): Removed an obsolete FIXME.
1055         (WebKit::WebProcess::updateActivePages): Empty implementation for platforms
1056         that don't need to do anything here.
1057
1058         * WebProcess/WebProcess.h: Added updateActivePages().
1059
1060         * WebProcess/mac/WebProcessMac.mm: (WebKit::WebProcess::updateActivePages):
1061         Collect user visible origins of pages in the process and pass them to LS.
1062
1063 2013-05-06  Mark Rowe  <mrowe@apple.com>
1064
1065         <rdar://problem/13775921> Switch off a deprecated API.
1066
1067         Reviewed by Oliver Hunt.
1068
1069         * Shared/mac/ChildProcessMac.mm:
1070         (WebKit::ChildProcess::setProcessSuppressionEnabled): When disabling process suppression,
1071         begin an activity that doesn't disable idle sleep, sudden termination or automatic termination.
1072         When enabling process suppression, end the activity.
1073
1074 2013-05-06  Anders Carlsson  <andersca@apple.com>
1075
1076         Move local storage directory handling to LocalStorageDatabaseTracker
1077         https://bugs.webkit.org/show_bug.cgi?id=115676
1078
1079         Reviewed by Andreas Kling.
1080
1081         * UIProcess/Storage/LocalStorageDatabase.cpp:
1082         (WebKit::LocalStorageDatabase::create):
1083         (WebKit::LocalStorageDatabase::LocalStorageDatabase):
1084         * UIProcess/Storage/LocalStorageDatabase.h:
1085         (WebCore):
1086         (LocalStorageDatabase):
1087         * UIProcess/Storage/LocalStorageDatabaseTracker.cpp:
1088         (WebKit::LocalStorageDatabaseTracker::setLocalStorageDirectory):
1089         (WebKit):
1090         (WebKit::LocalStorageDatabaseTracker::databaseFilename):
1091         (WebKit::LocalStorageDatabaseTracker::setLocalStorageDirectoryInternal):
1092         * UIProcess/Storage/LocalStorageDatabaseTracker.h:
1093         (WebCore):
1094         (LocalStorageDatabaseTracker):
1095         * UIProcess/Storage/StorageManager.cpp:
1096         (WebKit::StorageManager::StorageArea::StorageArea):
1097         (WebKit::StorageManager::setLocalStorageDirectory):
1098         * UIProcess/Storage/StorageManager.h:
1099         (StorageManager):
1100
1101 2013-05-06  Manuel Rego Casasnovas  <rego@igalia.com>
1102
1103         [GTK] Add webkit_uri_scheme_request_finish_error
1104         https://bugs.webkit.org/show_bug.cgi?id=94316
1105
1106         Reviewed by Anders Carlsson.
1107
1108         This new method will allow to finish WebKitURISchemeRequest with a
1109         GError that will be passed to the WebKitWebView through the
1110         "load-failed" signal.
1111
1112         * UIProcess/API/gtk/WebKitURISchemeRequest.cpp:
1113         (webkit_uri_scheme_request_finish_error): Implement new method using
1114         WebSoupRequestManagerProxy::didFailURIRequest().
1115         * UIProcess/API/gtk/WebKitURISchemeRequest.h: Add new method header.
1116         * UIProcess/API/gtk/WebKitWebContext.cpp: Include the usage of the new
1117         method in the code example at webkit_web_context_register_uri_scheme()
1118         documentation.
1119         * UIProcess/API/gtk/docs/webkit2gtk-sections.txt: Include the new
1120         method.
1121         * UIProcess/API/gtk/tests/LoadTrackingTest.cpp:
1122         (loadFailedCallback): Set m_error to monitor it from the tests.
1123         (LoadTrackingTest::loadURI): Clear m_error before each load.
1124         (LoadTrackingTest::loadHtml): Ditto.
1125         (LoadTrackingTest::loadPlainText): Ditto.
1126         (LoadTrackingTest::loadRequest): Ditto.
1127         (LoadTrackingTest::reload): Ditto.
1128         (LoadTrackingTest::goBack): Ditto.
1129         (LoadTrackingTest::goForward): Ditto.
1130         * UIProcess/API/gtk/tests/LoadTrackingTest.h: Add new member m_error.
1131         * UIProcess/API/gtk/tests/TestWebKitWebContext.cpp:
1132         (testWebContextURIScheme): Modify test to check the behavior of the new
1133         method.
1134         * UIProcess/soup/WebSoupRequestManagerProxy.cpp:
1135         (WebKit::WebSoupRequestManagerProxy::didFailURIRequest):
1136         (WebKit): Implement new method using
1137         WebSoupRequestManager::DidFailURIRequest().
1138         * UIProcess/soup/WebSoupRequestManagerProxy.h:
1139         (WebSoupRequestManagerProxy): Add new method header.
1140         * WebProcess/soup/WebSoupRequestManager.cpp:
1141         (WebKit):
1142         (WebKit::WebSoupRequestManager::didFailURIRequest): Implement new method
1143         setting the error and completing the request.
1144         * WebProcess/soup/WebSoupRequestManager.h:
1145         (WebSoupRequestManager): Add new method header.
1146         * WebProcess/soup/WebSoupRequestManager.messages.in: Add new method
1147         signature.
1148
1149 2013-05-06  Anders Carlsson  <andersca@apple.com>
1150
1151         Every LocalStorageDatabase should know about its tracker
1152         https://bugs.webkit.org/show_bug.cgi?id=115673
1153
1154         Reviewed by Andreas Kling.
1155
1156         * UIProcess/Storage/LocalStorageDatabase.cpp:
1157         (WebKit::LocalStorageDatabase::create):
1158         (WebKit::LocalStorageDatabase::LocalStorageDatabase):
1159         * UIProcess/Storage/LocalStorageDatabase.h:
1160         * UIProcess/Storage/StorageManager.cpp:
1161         (WebKit::StorageManager::StorageArea::StorageArea):
1162
1163 2013-05-06  Anders Carlsson  <andersca@apple.com>
1164
1165         Add LocalStorageDatabaseTracker class
1166         https://bugs.webkit.org/show_bug.cgi?id=115671
1167
1168         Reviewed by Andreas Kling.
1169
1170         Somewhat unsurprisingly, this class will be used for tracking local storage databases.
1171
1172         * UIProcess/Storage/LocalStorageDatabaseTracker.cpp: Added.
1173         (WebKit::LocalStorageDatabaseTracker::create):
1174         (WebKit::LocalStorageDatabaseTracker::LocalStorageDatabaseTracker):
1175         (WebKit::LocalStorageDatabaseTracker::~LocalStorageDatabaseTracker):
1176         * UIProcess/Storage/LocalStorageDatabaseTracker.h: Added.
1177         (LocalStorageDatabaseTracker):
1178         
1179         * UIProcess/Storage/StorageManager.cpp:
1180         (WebKit::StorageManager::StorageManager):
1181         Create a local storage database tracker.
1182
1183         * WebKit2.xcodeproj/project.pbxproj:
1184         Add new files.
1185
1186 2013-05-06  Anders Carlsson  <andersca@apple.com>
1187
1188         Handle closing the local storage database
1189         https://bugs.webkit.org/show_bug.cgi?id=115669
1190
1191         Reviewed by Beth Dakin.
1192
1193         * UIProcess/Storage/LocalStorageDatabase.cpp:
1194         (WebKit::LocalStorageDatabase::LocalStorageDatabase):
1195         Initialize m_isClosed.
1196     
1197         (WebKit::LocalStorageDatabase::~LocalStorageDatabase):
1198         Assert that m_isClosed is false.
1199
1200         (WebKit::LocalStorageDatabase::close):
1201         Set m_isClosed to true and write any pending changes to disk.
1202
1203         (WebKit::LocalStorageDatabase::updateDatabase):
1204         Compute the changed items and pass them to updateDatabaseWithChangedItems.
1205
1206         (WebKit::LocalStorageDatabase::updateDatabaseWithChangedItems):
1207         Split out the code that actually writes to the database from updateDatabase and into this function.
1208
1209         * UIProcess/Storage/LocalStorageDatabase.h:
1210         * UIProcess/Storage/StorageManager.cpp:
1211         (WebKit::StorageManager::StorageArea::~StorageArea):
1212         Call close().
1213
1214 2013-05-06  Zan Dobersek  <zdobersek@igalia.com>
1215
1216         [WK2] Make the WebNetworkInfoManagerProxy a supplement to the WebContext
1217         https://bugs.webkit.org/show_bug.cgi?id=115654
1218
1219         Reviewed by Andreas Kling.
1220
1221         Rather than holding a RefPtr to the WebNetworkInfoManagerProxy object in WebContext, change the WebNetworkInfoManagerProxy
1222         to implement the WebContextSupplement interface and handle the object as such in WebContext, simplifying its
1223         construction and cleanup, removing the specific RefPtr member variable and its correlating getter method.
1224
1225         * UIProcess/API/C/WKContext.cpp:
1226         (WKContextGetNetworkInfoManager): Retrieve the WebNetworkInfoManagerProxy object from the suppplements of the WebContext.
1227         * UIProcess/WebContext.cpp:
1228         (WebKit::WebContext::WebContext): Add the WebNetworkInfoManagerProxy object as a supplement instead of assigning it to
1229         the now-removed member variable.
1230         (WebKit::WebContext::~WebContext): No need for the specific cleanup, the equivalent is achieved when iterating through the
1231         supplements vector.
1232         (WebKit::WebContext::disconnectProcess): Ditto.
1233         * UIProcess/WebContext.h:
1234         (WebContext): Remove the WebNetworkInfoManagerProxy RefPtr member variable and its getter method.
1235         * UIProcess/WebNetworkInfoManagerProxy.cpp:
1236         (WebKit::WebNetworkInfoManagerProxy::supplementName): Specift the supplement's name.
1237         (WebKit::WebNetworkInfoManagerProxy::WebNetworkInfoManagerProxy): Initialize as a WebContextSupplement.
1238         (WebKit::WebNetworkInfoManagerProxy::providerDidChangeNetworkInformation): Adjust to use the context() method instead of
1239         accessing the private m_context directly.
1240         (WebKit::WebNetworkInfoManagerProxy::contextDestroyed): Stop updating when invoked.
1241         (WebKit::WebNetworkInfoManagerProxy::processDidClose): Ditto.
1242         (WebKit::WebNetworkInfoManagerProxy::refWebContextSupplement): Call APIObject::ref.
1243         (WebKit::WebNetworkInfoManagerProxy::derefWebContextSupplement): Call APIObject::deref.
1244         * UIProcess/WebNetworkInfoManagerProxy.h:
1245         (WebNetworkInfoManagerProxy): Inherit from WebContextSupplement, declare the newly-inherited methods.
1246
1247 2013-05-06  Alexey Proskuryakov  <ap@apple.com>
1248
1249         <rdar://problem/13479806> [Mac] Pass plug-in bundle ID to LaunchServices
1250         https://bugs.webkit.org/show_bug.cgi?id=115483
1251
1252         Reviewed by Darin Adler.
1253
1254         * PluginProcess/PluginProcess.h: Added m_pluginBundleIdentifier. We now need it
1255         in multiple places, so it's easier to pre-compute it.
1256
1257         * PluginProcess/mac/PluginProcessMac.mm:
1258         (WebKit::loadSandboxProfileForDirectory): Changed to use precomputed bundle ID.
1259         (WebKit::loadSandboxProfile): Ditto.
1260         (WebKit::PluginProcess::platformInitializeProcess): Pre-compute bundle ID.
1261         (WebKit::PluginProcess::initializeProcessName): Pass it to LaunchServices.
1262         (WebKit::PluginProcess::initializeSandbox): Pass precomputed bundle ID instead of
1263         a path.
1264
1265 2013-05-06  Anders Carlsson  <andersca@apple.com>
1266
1267         Handle removeItem and clear in LocalStorageDatabase
1268         https://bugs.webkit.org/show_bug.cgi?id=115664
1269
1270         Reviewed by Darin Adler.
1271
1272         * UIProcess/Storage/LocalStorageDatabase.cpp:
1273         (WebKit::LocalStorageDatabase::removeItem):
1274         Call itemDidChange with a null value, indicating that we want to remove this item.
1275
1276         (WebKit::LocalStorageDatabase::clear):
1277         Clear items, set m_shouldClearItems and schedule a database update.
1278
1279         (WebKit::LocalStorageDatabase::updateDatabase):
1280         If m_shouldClearItems is true, clear all items.
1281
1282         * UIProcess/Storage/StorageManager.cpp:
1283         (WebKit::StorageManager::StorageArea::removeItem):
1284         Call through to the local storage database.
1285
1286         (WebKit::StorageManager::StorageArea::clear):
1287         Ditto.
1288
1289 2013-05-06  Anders Carlsson  <andersca@apple.com>
1290
1291         Write storage changes to disk
1292         https://bugs.webkit.org/show_bug.cgi?id=115660
1293
1294         Reviewed by Andreas Kling.
1295
1296         * UIProcess/Storage/LocalStorageDatabase.cpp:
1297         (WebKit::LocalStorageDatabase::LocalStorageDatabase):
1298         Initialize new member variables.
1299
1300         (WebKit::LocalStorageDatabase::tryToOpenDatabase):
1301         Disable database threading checks.
1302
1303         (WebKit::LocalStorageDatabase::importItems):
1304         Only import the items once.
1305
1306         (WebKit::LocalStorageDatabase::setItem):
1307         Call itemDidChange.
1308
1309         (WebKit::LocalStorageDatabase::itemDidChange):
1310         Record the change and schedule a database update.
1311
1312         (WebKit::LocalStorageDatabase::scheduleDatabaseUpdate):
1313         Use WorkQueue::dispatchAfterDelay to schedule a datbase update.
1314
1315         (WebKit::LocalStorageDatabase::updateDatabase):
1316         Write changes to disk. If there are more than 100 pending items, only write the first 100 and then schedule
1317         another database update for the remaining items.
1318
1319         * UIProcess/Storage/LocalStorageDatabase.h:
1320         Add new member variables.
1321
1322         * UIProcess/Storage/StorageManager.cpp:
1323         (WebKit::StorageManager::StorageArea::setItem):
1324         Call LocalStorageDatabase::setItem.
1325
1326 2013-05-06  Zan Dobersek  <zdobersek@igalia.com>
1327
1328         [WK2] Make the WebBatteryManagerProxy a supplement to the WebContext
1329         https://bugs.webkit.org/show_bug.cgi?id=115625
1330
1331         Reviewed by Andreas Kling.
1332
1333         Rather than holding a RefPtr to the WebBatteryManagerProxy object in WebContext, change the WebBatteryManagerProxy
1334         to implement the WebContextSupplement interface and handle the object as such in WebContext, simplifying its
1335         construction and cleanup, removing the specific RefPtr member variable and its correlating getter method.
1336
1337         * UIProcess/API/C/WKContext.cpp:
1338         (WKContextGetBatteryManager): Retrieve the WebBatteryManagerProxy object from the supplements of the WebContext.
1339         * UIProcess/WebBatteryManagerProxy.cpp:
1340         (WebKit::WebBatteryManagerProxy::supplementName): Specify the supplement's name.
1341         (WebKit::WebBatteryManagerProxy::WebBatteryManagerProxy): Initialize as a WebContextSupplementable.
1342         (WebKit::WebBatteryManagerProxy::providerDidChangeBatteryStatus): Adjust to use the context() method instead of accessing
1343         the private m_context directly.
1344         (WebKit::WebBatteryManagerProxy::providerUpdateBatteryStatus): Ditto.
1345         (WebKit::WebBatteryManagerProxy::contextDestroyed): Stop updating when invoked.
1346         (WebKit::WebBatteryManagerProxy::processDidClose): Ditto.
1347         (WebKit::WebBatteryManagerProxy::refWebContextSupplement): Call APIObject::ref.
1348         (WebKit::WebBatteryManagerProxy::derefWebContextSupplement): Call APIObject::deref.
1349         (WebKit::WebBatteryManagerProxy::startUpdating): Fire up the provider if not yet updating.
1350         (WebKit::WebBatteryManagerProxy::stopUpdating): Wind down the provider if updating.
1351         * UIProcess/WebBatteryManagerProxy.h:
1352         (WebBatteryManagerProxy): Inherit from WebContextSupplement, declare the newly-inherited methods.
1353         * UIProcess/WebContext.cpp:
1354         (WebKit::WebContext::WebContext): Add the WebBatteryManagerProxy object as a supplement instead of assigning it to
1355         the now-removed member variable.
1356         (WebKit::WebContext::~WebContext): No need for the specific cleanup, the equivalent is achieved when iterating through the
1357         supplements vector.
1358         (WebKit::WebContext::disconnectProcess): Ditto.
1359         * UIProcess/WebContext.h:
1360         (WebContext): Remove the WebBatteryManagerProxy RefPtr member variable and its getter method.
1361
1362 2013-05-06  Antoine Quint  <graouts@apple.com>
1363
1364         Manage the presentation of the snapshotted plug-in using JavaScript
1365         https://bugs.webkit.org/show_bug.cgi?id=115548
1366
1367         Reviewed by Dean Jackson.
1368
1369         Expose a new plugInExtraScript method to support the injection of
1370         a JS file from the chrome client to customize the rendering of a
1371         snapshotted plug-in's shadow tree. Additionally, it is expected
1372         the chrome client will want to provide localized strings taking
1373         into account the snapshotted plug-in's mime-type, so we're adding
1374         this as a parameter to both plugInStartLabelTitle and
1375         plugInStartLabelSubtitle methods.
1376
1377         * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
1378         * WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp:
1379         (WebKit::InjectedBundlePageUIClient::plugInStartLabelTitle):
1380         (WebKit::InjectedBundlePageUIClient::plugInStartLabelSubtitle):
1381         (WebKit::InjectedBundlePageUIClient::plugInExtraScript):
1382         * WebProcess/InjectedBundle/InjectedBundlePageUIClient.h:
1383         (InjectedBundlePageUIClient):
1384         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1385         (WebKit::WebChromeClient::plugInStartLabelTitle):
1386         (WebKit::WebChromeClient::plugInStartLabelSubtitle):
1387         (WebKit::WebChromeClient::plugInExtraScript):
1388         * WebProcess/WebCoreSupport/WebChromeClient.h:
1389         (WebChromeClient):
1390
1391 2013-05-05  Chris Fleizach  <cfleizach@apple.com>
1392
1393         WEB SPEECH: deny file-read-data /Library/Speech/Synthesizers
1394         https://bugs.webkit.org/show_bug.cgi?id=115621
1395
1396         Reviewed by Alexey Proskuryakov.
1397
1398         Allow access to the location where 3rd party speech synthesizers are stored.
1399
1400         * WebProcess/com.apple.WebProcess.sb.in:
1401
1402 2013-05-05  Tim Horton  <timothy_horton@apple.com>
1403
1404         [wk2] Page Overlays: deviceScaleFactor doesn't update when the display changes
1405         https://bugs.webkit.org/show_bug.cgi?id=115577
1406         <rdar://problem/13762583>
1407
1408         Reviewed by Darin Adler.
1409
1410         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
1411         (WebKit::TiledCoreAnimationDrawingArea::setDeviceScaleFactor):
1412         Invalidate the page overlay layers' device scale factor when
1413         TiledCoreAnimationDrawingArea is notified that it has changed.
1414
1415 2013-05-05  Anders Carlsson  <andersca@apple.com>
1416
1417         Remove the Vector::append overload that takes a Vector
1418         https://bugs.webkit.org/show_bug.cgi?id=115535
1419
1420         Reviewed by Andreas Kling.
1421
1422         Use Vector::appendVector instead.
1423
1424         * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
1425         (WebKit::NetworkBlobRegistry::registerBlobURL):
1426         * NetworkProcess/SchedulableLoader.cpp:
1427         (WebKit::SchedulableLoader::SchedulableLoader):
1428         * Platform/CoreIPC/Connection.cpp:
1429         (CoreIPC::Connection::SyncMessageState::dispatchMessages):
1430         * UIProcess/Plugins/unix/PluginInfoStoreUnix.cpp:
1431         (WebKit::PluginInfoStore::pluginsDirectories):
1432
1433 2013-05-04  Sam Weinig  <sam@webkit.org>
1434
1435         Fix * placement in a few functions as noticed by Mark Rowe.
1436
1437         Rubber-stamped by Dan Bernstein.
1438
1439         * WebProcess/WebPage/PageBanner.h:
1440         (PageBanner):
1441         * WebProcess/WebPage/mac/PageBannerMac.mm:
1442         (WebKit::PageBanner::create):
1443         (WebKit::PageBanner::PageBanner):
1444
1445 2013-05-04  Sam Weinig  <sam@webkit.org>
1446
1447         REGRESSION(r148312): Crash when calling WKPageClose(page) followed by WKPageTerminate(page)
1448         <rdar://problem/13702008>
1449         https://bugs.webkit.org/show_bug.cgi?id=115607
1450
1451         Reviewed by Benjamin Poulain.
1452
1453         API Test: WebKit2.CloseThenTerminate
1454
1455         * UIProcess/WebPageProxy.cpp:
1456         (WebKit::WebPageProxy::resetStateAfterProcessExited):
1457         Don't try to reset the state if the page is closed, it won't work and its not worth it.
1458
1459 2013-05-04  Beth Dakin  <bdakin@apple.com>
1460
1461         https://bugs.webkit.org/show_bug.cgi?id=115574
1462         Crash using new WKBundlePageSetHeaderBanner() API to set a banner to null
1463
1464         Reviewed by Darin Adler.
1465
1466         Don't call addToPage() on a null banner.
1467         * WebProcess/WebPage/WebPage.cpp:
1468         (WebKit::WebPage::setHeaderPageBanner):
1469         (WebKit::WebPage::setFooterPageBanner):
1470
1471 2013-05-03  Alexey Proskuryakov  <ap@apple.com>
1472
1473         <rdar://problem/13806836> Tweak sandbox profile.
1474
1475         Reviewed by Dan Bernstein.
1476
1477         * WebProcess/com.apple.WebProcess.sb.in:
1478
1479 2013-05-03  Tim Horton  <timothy_horton@apple.com>
1480
1481         PDFPlugin: Changes being made to active annotation aren't saved when the PDF is exported
1482         https://bugs.webkit.org/show_bug.cgi?id=115544
1483         <rdar://problem/13801789>
1484
1485         Reviewed by Alexey Proskuryakov.
1486
1487         Commit changes to the active annotation (if there is one) before
1488         returning the live PDF data, so that said changes are represented
1489         in the exported or printed output.
1490
1491         * WebProcess/Plugins/PDF/PDFPlugin.h: Override liveData.
1492         * WebProcess/Plugins/PDF/PDFPlugin.mm:
1493         (WebKit::PDFPlugin::liveData): Commit the active annotation if there is one.
1494         * WebProcess/Plugins/PDF/SimplePDFPlugin.h:
1495         (SimplePDFPlugin): Make liveData virtual.
1496
1497 2013-05-03  Tim Horton  <timothy_horton@apple.com>
1498
1499         Web process crashes at WebPage::determinePrimarySnapshottedPlugInTimerFired + 8
1500         https://bugs.webkit.org/show_bug.cgi?id=115056
1501         <rdar://problem/13719543>
1502
1503         Reviewed by Simon Fraser.
1504
1505         Null-check m_page. In theory, we shouldn't get here, because we stop
1506         the timer at the only point where m_page is cleared, but crash logs say
1507         we're still crashing here.
1508
1509         * WebProcess/WebPage/WebPage.cpp:
1510         (WebKit::WebPage::determinePrimarySnapshottedPlugInTimerFired):
1511
1512 2013-05-03  Tim Horton  <timothy_horton@apple.com>
1513
1514         Remove some "what" comments from FindController
1515         https://bugs.webkit.org/show_bug.cgi?id=115546
1516
1517         Reviewed by Andreas Kling.
1518
1519         * WebProcess/WebPage/FindController.cpp:
1520         (WebKit::FindController::countStringMatches):
1521         (WebKit::FindController::updateFindUIAfterPageScroll):
1522         (WebKit::FindController::willMoveToWebPage):
1523         (WebKit::FindController::mouseEvent):
1524         Remove or reword some comments.
1525
1526 2013-05-02  Andy Estes  <aestes@apple.com>
1527
1528         [WK2][CustomProtocols] NSURLProtocolClient methods should be dispatched on NSURLConnection's resource loader run loop
1529         https://bugs.webkit.org/show_bug.cgi?id=115539
1530
1531         Reviewed by Alexey Proskuryakov.
1532
1533         It turns out that calling NSURLProtocolClient methods from a different
1534         thread than the one running the NSURLConnection run loop is unsafe.
1535         Although I can't capture it reliably in a test case, doing so can
1536         sometimes result in a load timing out because the call to
1537         -[NSURLProtocolClient URLProtocolDidFinishLoading:] was ignored by
1538         NSURLConnection.
1539
1540         Fix this by dispatching these methods on the NSURLConnection resource
1541         load run loop. This matches where NSURLProtocolClient methods are
1542         dispatched by typical NSURLProtocol implementations, and in my testing
1543         this solves the timeout issue.
1544
1545         * Shared/Network/CustomProtocols/CustomProtocolManager.h: Declare
1546         dispatchOnResourceLoaderRunLoop().
1547         * Shared/Network/CustomProtocols/mac/CustomProtocolManagerMac.mm:
1548         Declare +[NSURLConnection resourceLoaderRunLoop] on a category of
1549         NSURLConnection. Also include the header that declares it if it's present.
1550         (WebKit::CustomProtocolManager::didFailWithError): Call the
1551         NSURLProtocolClient method via dispatchOnResourceLoaderRunLoop().
1552         (WebKit::CustomProtocolManager::didLoadData): Ditto.
1553         (WebKit::CustomProtocolManager::didReceiveResponse): Ditto.
1554         (WebKit::CustomProtocolManager::didFinishLoading): Ditto.
1555         (WebKit::CustomProtocolManager::dispatchOnResourceLoaderRunLoop):
1556         Dispatch a block on the NSURLConnection resource loader run loop and
1557         then wake up the run loop.
1558
1559 2013-05-02  Brady Eidson  <beidson@apple.com>
1560
1561         REGRESSION (149389) Main resources converted to downloads are immediately cancelled.
1562         <rdar://problem/13795795> and https://bugs.webkit.org/show_bug.cgi?id=115530
1563
1564         Reviewed by Alexey Proskuryakov.
1565
1566         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1567         (WebKit::NetworkConnectionToWebProcess::convertMainResourceLoadToDownload): Call didConvertHandleToDownload
1568           on the NetworkResourceLoader.
1569
1570         * NetworkProcess/NetworkResourceLoader.cpp:
1571         (WebKit::NetworkResourceLoader::NetworkResourceLoader):
1572         (WebKit::NetworkResourceLoader::didConvertHandleToDownload): Set m_handleConvertedToDownload to true.
1573         (WebKit::NetworkResourceLoader::abort): Only cancel the handle if m_handleConvertedToDownload is false.
1574         * NetworkProcess/NetworkResourceLoader.h:
1575
1576 2013-05-02  Alexey Proskuryakov  <ap@apple.com>
1577
1578         <rdar://problem/13740375> Non-ASCII downloaded file names are garbled when using NetworkProcess
1579         https://bugs.webkit.org/show_bug.cgi?id=115520
1580
1581         Reviewed by Darin Adler.
1582
1583         * Shared/mac/WebCoreArgumentCodersMac.mm:
1584         (CoreIPC::::encodePlatformData):
1585         (CoreIPC::::decodePlatformData):
1586         Send the encoding fallback array over IPC, so that it's present when NetworkProcess does its loading.
1587
1588 2013-05-01  Alexey Proskuryakov  <ap@apple.com>
1589
1590         REGRESSION (r149422): -[WKBrowsingContextController loadFileURL:restrictToFilesWithin:]
1591         broken when second argument is nil
1592         https://bugs.webkit.org/show_bug.cgi?id=115505
1593         <rdar://problem/13787297>
1594
1595         Reviewed by Darin Adler.
1596
1597         * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::loadFile): Pass a URL string
1598         to assumeReadAccessToBaseURL, as this is what it takes.
1599
1600 2013-05-01  Ryosuke Niwa  <rniwa@webkit.org>
1601
1602         [Mac] WebKit doesn't enable or disable autocorrections when system preferences are changed
1603         https://bugs.webkit.org/show_bug.cgi?id=115463
1604
1605         Reviewed by Darin Adler.
1606
1607         Observe the default notification center and propagate the changes to TextCheckerState and
1608         to all WebProcesses when system preferences are updated.
1609
1610         * UIProcess/TextChecker.h:
1611         * UIProcess/WebContext.h:
1612         * UIProcess/mac/TextCheckerMac.mm:
1613         (WebKit::shouldAutomaticTextReplacementBeEnabled):
1614         (WebKit::shouldAutomaticSpellingCorrectionBeEnabled):
1615         (WebKit::shouldAutomaticQuoteSubstitutionBeEnabled):
1616         (WebKit::shouldAutomaticDashSubstitutionBeEnabled):
1617         (WebKit::initializeState):
1618         (WebKit::TextChecker::didChangeAutomaticTextReplacementEnabled):
1619         (WebKit::TextChecker::didChangeAutomaticSpellingCorrectionEnabled):
1620         (WebKit::TextChecker::didChangeAutomaticQuoteSubstitutionEnabled):
1621         (WebKit::TextChecker::didChangeAutomaticDashSubstitutionEnabled):
1622         * UIProcess/mac/WebContextMac.mm:
1623         (WebKit::WebContext::registerNotificationObservers):
1624         (WebKit::WebContext::unregisterNotificationObservers):
1625
1626 2013-05-01  Ryuan Choi  <ryuan.choi@samsung.com>
1627
1628         [GTK] Fix build break after r149449
1629         https://bugs.webkit.org/show_bug.cgi?id=115500
1630
1631         Reviewed by Gustavo Noronha Silva.
1632
1633         Unreviewed GTK build fix
1634
1635         * GNUmakefile.list.am: Added LocalStorageDatabase.[cpp|h] to the list of
1636         sources.
1637
1638 2013-05-01  Martin Robinson  <mrobinson@igalia.com>
1639
1640         [GTK] [WebKit2] Documentation for webkit_web_view_run_javascript should indicate what happens when JavaScript is disabled
1641         https://bugs.webkit.org/show_bug.cgi?id=115492
1642
1643         Reviewed by Xan Lopez.
1644
1645         * UIProcess/API/gtk/WebKitWebView.cpp: Clarify the documentation.
1646
1647 2013-05-01  Tim Horton  <timothy_horton@apple.com>
1648
1649         Move knowledge of PDF/PostScript MIME types into MIMETypeRegistry
1650         https://bugs.webkit.org/show_bug.cgi?id=115487
1651
1652         Reviewed by Darin Adler.
1653
1654         * UIProcess/WebContext.cpp:
1655         * UIProcess/WebContext.h:
1656         Remove pdfAndPostScriptMIMETypes.
1657
1658         * UIProcess/WebFrameProxy.cpp:
1659         (WebKit::WebFrameProxy::canShowMIMEType): Move PDF bits to WebPageProxy.
1660         (WebKit::WebFrameProxy::isDisplayingPDFDocument):
1661         Make use of WebCore's newfound knowledge of PDF and PostScript MIME types,
1662         so we don't have to duplicate it unnecessarily in WebKit2.
1663
1664         * UIProcess/WebPageProxy.cpp:
1665         (WebKit::WebPageProxy::canShowMIMEType):
1666         Add code which used to be in WebFrameProxy::canShowMIMEType, and adapt it
1667         to use WebCore's knowledge of PDF and PostScript MIME types.
1668
1669         * WebProcess/Plugins/PDF/SimplePDFPlugin.mm:
1670         (WebKit::SimplePDFPlugin::pluginInfo):
1671         We previously supported the "text/pdf" MIME type for PDFViewController,
1672         so SimplePDFPlugin and PDFPlugin should support it as well.
1673
1674         * WebProcess/WebPage/WebPage.cpp:
1675         (WebKit::WebPage::createPlugin):
1676         Adopt MIMETypeRegistry::isPDFOrPostScriptMIMEType.
1677
1678         * WebProcess/WebPage/WebPage.h:
1679         (WebPage):
1680         Remove pdfAndPostScriptMIMETypes.
1681
1682         * WebProcess/WebPage/mac/WebPageMac.mm:
1683         (WebKit::WebPage::platformPreferencesDidChange):
1684         Adopt getPDFAndPostScriptMIMETypes instead of duplicating the list in WebKit2.
1685
1686 2013-05-01  Anders Carlsson  <andersca@apple.com>
1687
1688         Implement LocalStorageDatabase::importItems
1689         https://bugs.webkit.org/show_bug.cgi?id=115493
1690
1691         Reviewed by Andreas Kling.
1692
1693         Fetch items and insert them in the storage map.
1694         * UIProcess/Storage/LocalStorageDatabase.cpp:
1695         (WebKit::LocalStorageDatabase::importItems):
1696
1697 2013-05-01  Anders Carlsson  <andersca@apple.com>
1698
1699         Begin work on loading items from the local storage database
1700         https://bugs.webkit.org/show_bug.cgi?id=115489
1701
1702         Reviewed by Andreas Kling.
1703
1704         Some of the LocalStorageDatabase code is originally from WebCore,
1705         but has been simplified due to the fact that we don't need to load
1706         database data asynchronously since we're already running on a non-main thread.
1707
1708         * UIProcess/Storage/LocalStorageDatabase.cpp:
1709         (WebKit::LocalStorageDatabase::LocalStorageDatabase):
1710         (WebKit::LocalStorageDatabase::openDatabase):
1711         (WebKit::LocalStorageDatabase::tryToOpenDatabase):
1712         (WebKit::LocalStorageDatabase::migrateItemTableIfNeeded):
1713         (WebKit::LocalStorageDatabase::importItems):
1714
1715         * UIProcess/Storage/LocalStorageDatabase.h:
1716         (WebKit::StorageManager::StorageArea::setItem):
1717         (WebKit::StorageManager::StorageArea::removeItem):
1718         (WebKit::StorageManager::StorageArea::clear):
1719         (WebKit::StorageManager::StorageArea::items):
1720         Call importItemsFromDatabase().
1721         
1722         (WebKit::StorageManager::StorageArea::importItemsFromDatabase):
1723         Ask the database to import the items.
1724
1725 2013-05-01  Ryuan Choi  <ryuan.choi@samsung.com>
1726
1727         [EFL] Unreviewed buildfix after r149449.
1728
1729         * CMakeLists.txt:
1730
1731 2013-05-01  Zoltan Arvai  <zarvai@inf.u-szeged.hu>
1732
1733         [Qt] Unreviewed buildfix after r149449.
1734
1735         * Target.pri:
1736
1737 2013-05-01  Anders Carlsson  <andersca@apple.com>
1738
1739         Add LocalStorageDatabase class
1740         https://bugs.webkit.org/show_bug.cgi?id=115486
1741
1742         Reviewed by Sam Weinig.
1743
1744         The LocalStorageDatabase class will persist local storage data to disk.
1745
1746         * UIProcess/Storage/LocalStorageDatabase.cpp:
1747         * UIProcess/Storage/LocalStorageDatabase.h: Added.
1748
1749         * UIProcess/Storage/StorageManager.cpp:
1750         (StorageManager::StorageArea):
1751         (WebKit::StorageManager::LocalStorageNamespace::storageManager):
1752         Add getter.
1753
1754         (StorageManager::LocalStorageNamespace):
1755         (WebKit::StorageManager::StorageArea::StorageArea):
1756         If this is a local storage area, create a LocalStorageDatabase.
1757
1758         (WebKit::StorageManager::LocalStorageNamespace::databaseFilename):
1759         Helper function for getting the name of the database for the given origin.
1760
1761         * WebKit2.xcodeproj/project.pbxproj:
1762         Add new files.
1763
1764 2013-05-01  Alexey Proskuryakov  <ap@apple.com>
1765
1766         <rdar://problem/13781156> Launching NetworkProcess broken on some OS versions.
1767
1768         Reviewed by Anders Carlsson.
1769
1770         Adapt to LaunchServices changes.
1771
1772         * Shared/mac/ChildProcessMac.mm:
1773         (WebKit::ChildProcess::setApplicationIsDaemon):
1774
1775 2013-05-01  Martin Robinson  <mrobinson@igalia.com>
1776
1777         [GTK] [WebKit2] Add a setting to control whether or not accelerated 2D canvas is enabled
1778         https://bugs.webkit.org/show_bug.cgi?id=114394
1779
1780         Reviewed by Anders Carlsson.
1781
1782         Add a setting to control accelerated 2D canvas, which determines whether
1783         or not to consider rendering HTML canvas with hardware acceleration.
1784
1785         * UIProcess/API/gtk/WebKitSettings.cpp:
1786         (webKitSettingsSetProperty): Added support for enable-accelerated-2d-canvas property.
1787         (webKitSettingsGetProperty): Added support for enable-accelerated-2d-canvas property.
1788         (webkit_settings_class_init): Added support for enable-accelerated-2d-canvas property.
1789         (webkit_settings_get_enable_accelerated_2d_canvas): Added.
1790         (webkit_settings_set_enable_accelerated_2d_canvas): Added.
1791         * UIProcess/API/gtk/WebKitSettings.h: New methods.
1792         * UIProcess/API/gtk/docs/webkit2gtk-sections.txt: Added new methods to the documentation.
1793         * UIProcess/API/gtk/tests/TestWebKitSettings.cpp:
1794         (testWebKitSettings): Added a simple test for the setting.
1795
1796 2013-04-30  Jer Noble  <jer.noble@apple.com>
1797
1798         Entering full screen mode shows desktop linen instead of WKView the first time.
1799         https://bugs.webkit.org/show_bug.cgi?id=115433
1800         <rdar://problem/13774540>
1801
1802         Reviewed by Eric Carlson.
1803
1804         For certain types of windows created by subclasses of WKView, the window in question fails to paint
1805         when created with a zero-size rect. Create the window with an initial size of the active screen frame
1806         as that is the likely destination size.
1807
1808         * UIProcess/API/mac/WKView.mm:
1809         (-[WKView createFullScreenWindow]):
1810
1811 2013-05-01  Zoltan Arvai  <zarvai@inf.u-szeged.hu>
1812
1813         [Qt][Win] Fix build after r149416.
1814         https://bugs.webkit.org/show_bug.cgi?id=115474
1815
1816         Reviewed by Anders Carlsson.
1817
1818         * Platform/CoreIPC/Connection.h:
1819         (Connection):
1820         * Platform/CoreIPC/win/ConnectionWin.cpp:
1821         (CoreIPC::Connection::dispatchSentMessagesUntil):
1822
1823 2013-05-01  Sergio Villar Senin  <svillar@igalia.com>
1824
1825         Unreviewed GTK build fix after r149417.
1826
1827         * GNUmakefile.list.am: Added PageBanner.[cpp|h] to the list of
1828         sources.
1829
1830 2013-05-01  Ryuan Choi  <ryuan.choi@samsung.com>
1831
1832         [EFL] Unreviewed buildfix after r149416 and r149417.
1833
1834         Unreviewed build fix.
1835
1836         * CMakeLists.txt:
1837
1838 2013-05-01  Zoltan Arvai  <zarvai@inf.u-szeged.hu>
1839
1840         [Qt] Unreviewed buildfix after r149416 and r149417.
1841
1842         * Target.pri:
1843
1844 2013-04-30  Dongwoo Joshua Im  <dw.im@samsung.com>
1845
1846         [EFL] Unreviewed, EFL build fix after r149416
1847         https://bugs.webkit.org/show_bug.cgi?id=115467
1848
1849         Unreviewed build fix.
1850
1851         * CMakeLists.txt: Remove non-existing file, BinarySemaphore.cpp, from the list.
1852
1853 2013-04-30  Simon Cooper  <scooper@apple.com>
1854
1855         ipc-posix-shm backwards compatibility 
1856         https://bugs.webkit.org/show_bug.cgi?id=115448
1857         <rdar://problem/13743037>
1858
1859         Reviewed by Alexey Proskuryakov.
1860
1861         Add compatibility for older ipc-posix-shm operations, but prefer the
1862         newer names when writing profiles.
1863
1864         * Resources/PlugInSandboxProfiles/com.apple.WebKit.plugin-common.sb:
1865
1866 2013-04-30  Philippe Normand  <pnormand@igalia.com>
1867
1868         Unreviewed, GTK build fix after r149416.
1869
1870         * GNUmakefile.list.am: Remove references to non-existant
1871         BinarySemaphore module.
1872
1873 2013-04-28  Alexey Proskuryakov  <ap@apple.com>
1874
1875         <rdar://problem/13574729> Implement file path restrictions in WebKit Objective C API
1876         https://bugs.webkit.org/show_bug.cgi?id=115321
1877
1878         Reviewed by Darin Adler.
1879
1880         * UIProcess/API/C/WKPage.cpp:
1881         * UIProcess/API/C/WKPage.h: 
1882         * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::loadFile):
1883         * UIProcess/WebPageProxy.h:
1884         Added and implemented a C API to load a file while only opening sandbox for
1885         a specific directory.
1886
1887         * UIProcess/API/mac/WKBrowsingContextController.h: Fixed a typo in a comment.
1888
1889         * UIProcess/API/mac/WKBrowsingContextController.mm:
1890         (-[WKBrowsingContextController loadFileURL:restrictToFilesWithin:]):
1891         Respect allowedDirectory argument. Updated the function to raise an exception for
1892         incorrect input, as decribed in header file.
1893
1894 2013-04-29  Sam Weinig  <sam@webkit.org>
1895
1896         Add API to allow WebKit2 banners to get mouse events
1897         https://bugs.webkit.org/show_bug.cgi?id=115395
1898
1899         Reviewed by Beth Dakin.
1900
1901         * Shared/API/c/WKBase.h:
1902         * Shared/APIObject.h:
1903         Add banner type.
1904
1905         * WebKit2.xcodeproj/project.pbxproj:
1906         Add files.
1907
1908         * WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
1909         Add conversion.
1910
1911         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
1912         (WKBundlePageSetTopOverhangImage):
1913         (WKBundlePageSetBottomOverhangImage):
1914         Fix parameter names to be consistent.
1915
1916         (WKBundlePageSetHeaderBanner):
1917         (WKBundlePageSetFooterBanner):
1918         * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
1919         * WebProcess/InjectedBundle/API/c/WKBundlePageBanner.cpp: Added.
1920         (WKBundlePageBannerGetTypeID):
1921         * WebProcess/InjectedBundle/API/c/WKBundlePageBanner.h: Added.
1922         * WebProcess/InjectedBundle/API/c/mac/WKBundlePageBannerMac.h: Added.
1923         * WebProcess/InjectedBundle/API/c/mac/WKBundlePageBannerMac.mm: Added.
1924         (PageBannerClientImpl):
1925         (PageBannerClientImpl::create):
1926         (PageBannerClientImpl::PageBannerClientImpl):
1927         (PageBannerClientImpl::pageBannerDestroyed):
1928         (PageBannerClientImpl::mouseEvent):
1929         (WKBundlePageBannerCreateBannerWithCALayer):
1930         (WKBundlePageBannerGetLayer):
1931         Add banner API.
1932
1933         * WebProcess/WebPage/PageBanner.h: Added.
1934         * WebProcess/WebPage/PageBanner.cpp: Added.
1935         (WebKit::PageBanner::~PageBanner):
1936         (WebKit::PageBanner::addToPage):
1937         (WebKit::PageBanner::detachFromPage):
1938         (WebKit::PageBanner::didChangeDeviceScaleFactor):
1939         (WebKit::PageBanner::mouseEvent):
1940         Add non-mac implementations.
1941
1942         * WebProcess/WebPage/WebPage.cpp:
1943         (WebKit::WebPage::~WebPage):
1944         (WebKit::WebPage::setHeaderPageBanner):
1945         (WebKit::WebPage::headerPageBanner):
1946         (WebKit::WebPage::setFooterPageBanner):
1947         (WebKit::WebPage::footerPageBanner):
1948         (WebKit::WebPage::mouseEvent):
1949         (WebKit::WebPage::mouseEventSyncForTesting):
1950         * WebProcess/WebPage/WebPage.h:
1951         Add banner setter/getters and give the banners a chance to handle mouse events.
1952
1953         * WebProcess/WebPage/mac/PageBannerMac.mm: Added.
1954         (WebKit::PageBanner::create):
1955         (WebKit::PageBanner::PageBanner):
1956         (WebKit::PageBanner::addToPage):
1957         (WebKit::PageBanner::detachFromPage):
1958         (WebKit::PageBanner::didChangeDeviceScaleFactor):
1959         (WebKit::PageBanner::mouseEvent):
1960         (WebKit::PageBanner::layer):
1961         Add Mac implementation.
1962
1963         * WebProcess/WebPage/mac/WebPageMac.mm:
1964         (WebKit::WebPage::updateHeaderAndFooterLayersForDeviceScaleChange):
1965         Notify banners when the device scale changes.
1966
1967 2013-04-30  Anders Carlsson  <andersca@apple.com>
1968
1969         Remove the WebKit2 BinarySemaphore class
1970         https://bugs.webkit.org/show_bug.cgi?id=115458
1971
1972         Reviewed by Benjamin Poulain.
1973
1974         Remove the WK2 specific BinarySemaphore class and use the one from WTF.
1975
1976         * Platform/CoreIPC/BinarySemaphore.cpp: Removed.
1977         * Platform/CoreIPC/BinarySemaphore.h: Removed.
1978         * Platform/CoreIPC/Connection.cpp:
1979         * Platform/CoreIPC/Connection.h:
1980         * WebKit2.xcodeproj/project.pbxproj:
1981
1982 2013-04-30  Alexey Proskuryakov  <ap@apple.com>
1983
1984         <rdar://problem/13757475> WebProcess deny ipc-posix-shm-read-data CFPBS:A2:
1985
1986         Reviewed by Anders Carlsson.
1987
1988         * WebProcess/com.apple.WebProcess.sb.in: Allow pbs shared memory.
1989
1990 2013-04-30  Alexey Proskuryakov  <ap@apple.com>
1991
1992         [Mac] Don't open window server connection in network process
1993         https://bugs.webkit.org/show_bug.cgi?id=115446
1994
1995         Reviewed by Anders Carlsson.
1996
1997         * NetworkProcess/NetworkProcess.cpp:
1998         (WebKit::NetworkProcess::initializeProcess):
1999         * NetworkProcess/NetworkProcess.h:
2000         * NetworkProcess/mac/NetworkProcessMac.mm:
2001         (WebKit::NetworkProcess::initializeProcess):
2002         (WebKit::NetworkProcess::initializeProcessName):
2003         Instead of shutting down a connection after setting process name, just prevent
2004         it from being created.
2005
2006         * Shared/ChildProcess.h:
2007         * Shared/mac/ChildProcessMac.mm: (WebKit::ChildProcess::setApplicationIsDaemon):
2008         Expose a function for client processes to call if they don't run an NSApplication
2009         run loop.
2010
2011         * OfflineStorageProcess/OfflineStorageProcess.cpp:
2012         (WebKit::OfflineStorageProcess::initializeProcess):
2013         * OfflineStorageProcess/OfflineStorageProcess.h:
2014         * OfflineStorageProcess/mac/OfflineStorageProcessMac.mm:
2015         (WebKit::OfflineStorageProcess::initializeProcess):
2016         (WebKit::OfflineStorageProcess::initializeProcessName):
2017         * SharedWorkerProcess/SharedWorkerProcess.cpp:
2018         (WebKit::SharedWorkerProcess::initializeProcess):
2019         (WebKit::SharedWorkerProcess::initializeProcessName):
2020         * SharedWorkerProcess/SharedWorkerProcess.h:
2021         * SharedWorkerProcess/mac/SharedWorkerProcessMac.mm:
2022         (WebKit::SharedWorkerProcess::initializeProcess):
2023         (WebKit::SharedWorkerProcess::initializeProcessName):
2024         Match NetworkProcess for consistency.
2025
2026         * WebProcess/mac/WebProcessMac.mm: (WebKit::WebProcess::initializeProcessName):
2027         Don't null check UI process name. First, it can't be null, and second, some other
2028         processes already don't have this check.
2029
2030 2013-04-30  Tim Horton  <timothy_horton@apple.com>
2031
2032         Disable deprecation warnings around some NSProcessInfo API.
2033
2034         Rubber-stamped by Brady Eidson.
2035
2036         * Shared/mac/ChildProcessMac.mm:
2037         (WebKit::ChildProcess::setProcessSuppressionEnabled):
2038
2039 2013-04-30  Brady Eidson  <beidson@apple.com>
2040
2041         [WK2] Threads get stuck in NetworkProcess when canceling loads in WebProcess.
2042         <rdar://problem/13757687> and https://bugs.webkit.org/show_bug.cgi?id=115319
2043
2044         Written and reviewed by both Alexey Proskuryakov and Brady Eidson.
2045
2046         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2047         (WebKit::NetworkConnectionToWebProcess::didClose): Call abort() on all loaders
2048           instead of connectionToWebProcessDidClose()
2049         (WebKit::NetworkConnectionToWebProcess::removeLoadIdentifier): Instead of removing
2050           the loader from the scheduler, call abort() which will also end up removing it.
2051
2052         * NetworkProcess/SchedulableLoader.h: Add a virtual abort() call.
2053
2054         * NetworkProcess/NetworkResourceLoader.cpp:
2055         (WebKit::NetworkResourceLoader::sendAbortingOnFailure): Added a messageFlags argument so 
2056           callers can pass DispatchMessageEvenWhenWaitingForSyncReply.
2057         (WebKit::NetworkResourceLoader::abort): Combined "abortInProgressLoad" and "cleanup" to
2058           be a general purpose "cancel"
2059         (WebKit::NetworkResourceLoader::didReceiveBuffer):
2060         (WebKit::NetworkResourceLoader::willSendRequestAsync):
2061         (WebKit::NetworkResourceLoader::canAuthenticateAgainstProtectionSpaceAsync):
2062         * NetworkProcess/NetworkResourceLoader.h:
2063
2064         * NetworkProcess/SyncNetworkResourceLoader.cpp:
2065         (WebKit::SyncNetworkResourceLoader::abort):
2066         * NetworkProcess/SyncNetworkResourceLoader.h:
2067
2068         * WebProcess/Network/WebResourceLoadScheduler.cpp:
2069         (WebKit::WebResourceLoadScheduler::remove): Remove an obsolete/incorrect comment.
2070
2071         * WebProcess/Network/WebResourceLoader.cpp:
2072         (WebKit::WebResourceLoader::didReceiveResponseWithCertificateInfo): Add comment stressing
2073           the importance of this null check so it's not removed again.
2074
2075 2013-04-30  Carlos Garcia Campos  <cgarcia@igalia.com>
2076
2077         [WK2][GTK] MiniBrowser won't play video in <embed> tag
2078         https://bugs.webkit.org/show_bug.cgi?id=113107
2079
2080         Reviewed by Anders Carlsson.
2081
2082         The wrong clip region is used for windowed plugins, because it's
2083         translated to window frame coords again.
2084
2085         * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:
2086         (WebKit::NetscapePlugin::platformGeometryDidChange): Do not move
2087         the current clip region.
2088
2089 2013-04-30  Timothy Hatcher  <timothy@apple.com>
2090
2091         Make the Inspector dock to right button work in the WebKit nightlies on Safari 6.0.4.
2092
2093         https://webkit.org/b/115428
2094
2095         Reviewed by Joseph Pecoraro.
2096
2097         * UIProcess/mac/WebInspectorProxyMac.mm:
2098         (WebKit::WebInspectorProxy::createInspectorWindow): Reduce the required Safari version.
2099         (WebKit::WebInspectorProxy::platformDetach): Simplify the frame restoring code so it
2100         works on Safari 6.0.4.
2101
2102 2013-04-30  Artur Moryc  <a.moryc@samsung.com>
2103
2104         [WK2][EFL] Spelling marker disappears while selection is being changed
2105         https://bugs.webkit.org/show_bug.cgi?id=115165
2106
2107         Reviewed by Anders Carlsson.
2108
2109         The marker for a misspelled word disappears while the cursor is being navigated along the word.
2110
2111         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
2112         (WebKit::WebEditorClient::shouldEraseMarkersAfterChangeSelection):
2113
2114 2013-04-30  Zalan Bujtas  <zalan@apple.com>
2115
2116         Animations fail to start on http://www.google.com/insidesearch/howsearchworks/thestory/
2117         https://bugs.webkit.org/show_bug.cgi?id=111244
2118
2119         Reviewed by David Kilzer.
2120         
2121         Enable performance.now() as a minimal subset of Web Timing API. 
2122         It returns DOMHighResTimeStamp, a monotonically increasing value representing the 
2123         number of milliseconds from the start of the navigation of the current document.
2124         JS libraries use this API to check against the requestAnimationFrame() timestamp.
2125
2126         * Configurations/FeatureDefines.xcconfig:
2127
2128 2013-04-29  Chris Fleizach  <cfleizach@apple.com>
2129
2130         WEB SPEECH: need to identify the default voice per language
2131         https://bugs.webkit.org/show_bug.cgi?id=115366
2132
2133         Reviewed by Tim Horton.
2134
2135         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
2136         (InitWebCoreSystemInterface):
2137
2138 2013-04-29  Benjamin Poulain  <benjamin@webkit.org>
2139
2140         [WK2] Streamline the use of strings in WebProcess::getWebCoreStatistics
2141         https://bugs.webkit.org/show_bug.cgi?id=115315
2142
2143         Reviewed by Geoffrey Garen.
2144
2145         Remove a couple of unjustified DEFINE_STATIC_LOCAL.
2146         Use ASCIILiteral when allocating new String.
2147
2148         * WebProcess/WebProcess.cpp:
2149         (WebKit::getWebCoreMemoryCacheStatistics):
2150         (WebKit::WebProcess::getWebCoreStatistics):
2151
2152 2013-04-29  Anders Carlsson  <andersca@apple.com>
2153
2154         Remove StorageTracker::originsLoaded
2155         https://bugs.webkit.org/show_bug.cgi?id=115382
2156
2157         Reviewed by Sam Weinig.
2158
2159         Add m_didFinishLoadingOrigins.
2160
2161         * WebProcess/Storage/WebKeyValueStorageManager.cpp:
2162         (WebKit::WebKeyValueStorageManager::WebKeyValueStorageManager):
2163         (WebKit::WebKeyValueStorageManager::getKeyValueStorageOrigins):
2164         (WebKit::WebKeyValueStorageManager::didFinishLoadingOrigins):
2165         * WebProcess/Storage/WebKeyValueStorageManager.h:
2166         (WebKeyValueStorageManager):
2167
2168 2013-04-29  Chris Fleizach  <cfleizach@apple.com>
2169
2170         WEB SPEECH Update seatbelt profile to work with speech synthesis
2171         https://bugs.webkit.org/show_bug.cgi?id=115368
2172
2173         Reviewed by Alexey Proskuryakov.
2174
2175         * WebProcess/com.apple.WebProcess.sb.in:
2176
2177 2013-04-28  Beth Dakin  <bdakin@apple.com>
2178
2179         Need a LayoutMilestone to fire when we have done our first paint after suppressing 
2180         incremental layout
2181         https://bugs.webkit.org/show_bug.cgi?id=115330
2182         -and corresponding-
2183         <rdar://problem/12722365>
2184
2185         Reviewed by Simon Fraser.
2186
2187         Two new millstones.
2188         * Shared/API/c/WKPageLoadTypes.h:
2189         * Shared/API/c/WKSharedAPICast.h:
2190         (WebKit::toWKLayoutMilestones):
2191         (WebKit::toLayoutMilestones):
2192
2193         This null-check is necessary now since this code ends up running at 
2194         WebFrame::init() time while we're setting up the Document. 
2195         setVisualUpdatesAllowed(true) has always been called as a part of that process, 
2196         and now the updateLayout(), ends up calling this code too, but we don't actually 
2197         have a mainFrame yet since it's still being created.
2198         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2199         (WebKit::findLargestFrameInFrameSet):
2200
2201 2013-04-29  Brady Eidson  <beidson@apple.com>
2202
2203         REGRESSION: We see authentication challenge sheets for favicon requests.
2204         <rdar://problem/13753470> and https://bugs.webkit.org/show_bug.cgi?id=115288
2205
2206         Reviewed by Alexey Proskuryakov.
2207
2208         Have NetworkResourceLoadParameters remember the ClientCredentialPolicy:
2209         * Shared/Network/NetworkResourceLoadParameters.cpp:
2210         (WebKit::NetworkResourceLoadParameters::NetworkResourceLoadParameters):
2211         (WebKit::NetworkResourceLoadParameters::encode):
2212         (WebKit::NetworkResourceLoadParameters::decode):
2213         * Shared/Network/NetworkResourceLoadParameters.h:
2214
2215         Pass along the ClientCredentialPolicy to the NetworkProcess:
2216         * WebProcess/Network/WebResourceLoadScheduler.cpp:
2217         (WebKit::WebResourceLoadScheduler::scheduleLoad):
2218         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
2219         (WebKit::WebPlatformStrategies::loadResourceSynchronously):
2220         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
2221
2222         Have the SchedulableLoader remember the ClientCredentialPolicy:
2223         * NetworkProcess/SchedulableLoader.cpp:
2224         (WebKit::SchedulableLoader::SchedulableLoader):
2225         * NetworkProcess/SchedulableLoader.h:
2226         (WebKit::SchedulableLoader::clientCredentialPolicy):
2227
2228         Don’t message for credentials if the ClientCredentialPolicy forbids it:
2229         * NetworkProcess/NetworkResourceLoader.cpp:
2230         (WebKit::NetworkResourceLoader::didReceiveAuthenticationChallenge):
2231         * NetworkProcess/NetworkResourceLoader.h:
2232
2233         Update for the new loadResourceSynchronously signature (which is still a no-op on the NetworkProcess side):
2234         * NetworkProcess/NetworkProcessPlatformStrategies.cpp:
2235         (WebKit::NetworkProcessPlatformStrategies::loadResourceSynchronously):
2236         * NetworkProcess/NetworkProcessPlatformStrategies.h:
2237
2238 2013-04-29  Jer Noble  <jer.noble@apple.com>
2239
2240         Unreviewed build fix. Point the Network process towards its own version of SecItemShim.dyld.
2241
2242         * NetworkProcess/EntryPoint/mac/XPCService/NetworkService/Info.plist:
2243
2244 2013-04-29  Alexey Proskuryakov  <ap@apple.com>
2245
2246         Threads get stuck in NetworkProcess when canceling loads
2247         https://bugs.webkit.org/show_bug.cgi?id=115319
2248
2249         Backing out part of the fix, as it's causing crashes.
2250
2251         * WebProcess/Network/WebResourceLoader.cpp:
2252         (WebKit::WebResourceLoader::didReceiveResponseWithCertificateInfo):
2253
2254 2013-04-29  Noam Rosenthal  <noam@webkit.org>
2255
2256         Get rid of "non-composited contents" in CoordinatedLayerTreeHost
2257         https://bugs.webkit.org/show_bug.cgi?id=110355
2258
2259         Reviewed by Jocelyn Turcotte.
2260
2261         Instead of using a special non-composited contents layer, we let RenderLayerCompositor create
2262         a proper GraphicsLayer for that content.
2263         CoordinatedLayerTreeHost now needs to find the main contents layer for the purpose of setting
2264         the trajectory vector and applying the cover rect.
2265
2266         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
2267         (WebKit::CoordinatedLayerTreeHost::CoordinatedLayerTreeHost):
2268         (WebKit::CoordinatedLayerTreeHost::setRootCompositingLayer):
2269             Don't create the non-composited layer, instead keep a raw pointer to the root
2270             compositing layer created by the WebCore compositor.
2271
2272         (WebKit::CoordinatedLayerTreeHost::setNonCompositedContentsNeedDisplay):
2273         (WebKit::CoordinatedLayerTreeHost::setNonCompositedContentsNeedDisplayInRect):
2274         (WebKit::CoordinatedLayerTreeHost::scrollNonCompositedContents):
2275         (WebKit::CoordinatedLayerTreeHost::sizeDidChange):
2276         (WebKit::CoordinatedLayerTreeHost::paintContents):
2277         (WebKit::CoordinatedLayerTreeHost::deviceOrPageScaleFactorChanged):
2278         (WebKit::CoordinatedLayerTreeHost::setVisibleContentsRect):
2279             Remove non-composited layer specialization.
2280
2281 2013-04-29  Zoltan Arvai  <zarvai@inf.u-szeged.hu>
2282
2283         [Qt] Build fix. Enabling c++11 for Qt WK2 after r149259.
2284         https://bugs.webkit.org/show_bug.cgi?id=115345
2285
2286         Reviewed by Anders Carlsson.
2287
2288         * WebKit2.pri:
2289
2290 2013-04-29  Bruno de Oliveira Abinader  <bruno.abinader@basyskom.com>
2291
2292         [WK2][EFL] Skip cancel fullscreen request if not made from FullScreen API
2293         https://bugs.webkit.org/show_bug.cgi?id=108201
2294
2295         Reviewed by Andreas Kling.
2296
2297         Adds a check on WebFullScreenManagerProxyEfl whether fullscreen mode was
2298         set from FullScreen API or not, so it can skip cancelling fullscreen
2299         request if fullscreen mode was set by application, preventing
2300         WebProcess' FullScreenManager from crashing.
2301
2302         EFL unit test available: ewk_view_cancel_full_screen_request.
2303
2304         * UIProcess/API/C/CoordinatedGraphics/WKView.cpp:
2305         (WKViewExitFullScreen):
2306         * UIProcess/API/C/CoordinatedGraphics/WKView.h:
2307         WKViewExitFullScreen now returns a bool, indicating whether the
2308         operation has succeeded or not.
2309
2310         * UIProcess/API/efl/ewk_view.cpp:
2311         (ewk_view_fullscreen_exit):
2312         Skip request if not in fullscreen mode.
2313
2314         * UIProcess/API/efl/tests/test_ewk2_view.cpp:
2315         (TEST_F):
2316         Added ewk_view_cancel_full_screen_request unit test.
2317
2318         * UIProcess/CoordinatedGraphics/WebView.cpp:
2319         (WebKit::WebView::exitFullScreen):
2320         * UIProcess/CoordinatedGraphics/WebView.h:
2321         (WebView):
2322         exitFullScreen now returns a bool, indicating whether the operation has
2323         succeeded or not.
2324
2325         * UIProcess/WebFullScreenManagerProxy.cpp:
2326         (WebKit::WebFullScreenManagerProxy::WebFullScreenManagerProxy):
2327         * UIProcess/WebFullScreenManagerProxy.h:
2328         (WebFullScreenManagerProxy):
2329         * UIProcess/efl/WebFullScreenManagerProxyEfl.cpp:
2330         (WebKit::WebFullScreenManagerProxy::isFullScreen):
2331         (WebKit::WebFullScreenManagerProxy::enterFullScreen):
2332         (WebKit::WebFullScreenManagerProxy::exitFullScreen):
2333         Added m_hasRequestedFullScreen boolean flag to EFL port. Used to
2334         indicate if fullscreen mode is enabled, as well as sanity checks on both
2335         {enter,exit}FullScreen functions.
2336
2337 2013-04-29  Anders Carlsson  <andersca@apple.com>
2338
2339         Stop using range-based for syntax
2340         https://bugs.webkit.org/show_bug.cgi?id=115356
2341
2342         Reviewed by Andreas Kling.
2343
2344         * PluginProcess/WebProcessConnection.cpp:
2345         (WebKit::WebProcessConnection::didClose):
2346
2347 2013-04-29  Sergio Correia  <sergio.correia@openbossa.org>
2348
2349         [EFL][WK2]: WebProcessMain: hide call to ecore_x_shutdown() under guard
2350         https://bugs.webkit.org/show_bug.cgi?id=115295
2351
2352         Reviewed by Andreas Kling.
2353
2354         Since the mentioned function is declared in a header that is included
2355         conditionally depending on HAVE_ECORE_X being defined.
2356
2357         * WebProcess/efl/WebProcessMainEfl.cpp:
2358         (WebKit::WebProcessMainEfl):
2359
2360 2013-04-29  Jinwoo Song  <jinwoo7.song@samsung.com>
2361
2362         [WK2] Remove build warnings by -Wunused-parameter
2363         https://bugs.webkit.org/show_bug.cgi?id=115344
2364
2365         Reviewed by Noam Rosenthal.
2366
2367         Fix build warnigs -Wunused-parameter.
2368
2369         * UIProcess/CoordinatedGraphics/WebView.cpp:
2370         (WebKit::WebView::createContextMenuProxy):
2371         * UIProcess/DrawingAreaProxy.h:
2372         (WebKit::DrawingAreaProxy::waitForPossibleGeometryUpdate):
2373         * UIProcess/WebPageProxy.cpp:
2374         (WebKit::WebPageProxy::connectionWillClose):
2375
2376 2013-04-29  Carlos Garcia Campos  <cgarcia@igalia.com>
2377
2378         Unreviewed. Fix make distcheck.
2379
2380         * GNUmakefile.list.am: Add missing header files to compilation.
2381
2382 2013-04-28  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
2383
2384         Unreviewed fix build break on EFL port since r149259.
2385
2386         In EFL port, there is a non-compatible code when compiling based on C++11. This is a trivial build fix.
2387
2388         I got a confirm from Sam about landing a trivial build fix patch without sign-off from
2389         WK2 owner.
2390
2391         * UIProcess/API/efl/EwkViewCallbacks.h:
2392
2393 2013-04-28  Dean Jackson  <dino@apple.com>
2394
2395         [Mac] Disable canvas backing store scaling (HIGH_DPI_CANVAS)
2396         https://bugs.webkit.org/show_bug.cgi?id=115310
2397
2398         Reviewed by Simon Fraser.
2399
2400         Remove ENABLE_HIGH_DPI_CANVAS_macosx.
2401
2402         * Configurations/FeatureDefines.xcconfig:
2403
2404 2013-04-28  Sam Weinig  <sam@webkit.org>
2405
2406         [WebKit2] Adopt new API for detecting window occlusion
2407         https://bugs.webkit.org/show_bug.cgi?id=115334
2408
2409         Reviewed by Simon Fraser.
2410
2411         Switch off of WKSI for window occlusion and use the new NSWindowDidChangeOcclusionState notification
2412         instead.
2413
2414         * UIProcess/API/mac/WKView.mm:
2415         (-[WKView dealloc]):
2416         (-[WKView addWindowObserversForWindow:]):
2417         (-[WKView removeWindowObservers]):
2418         (-[WKView viewWillMoveToWindow:]):
2419         (-[WKView viewDidMoveToWindow]):
2420         (-[WKView _windowDidOrderOnScreen:]):
2421         (-[WKView _windowDidChangeOcclusionState:]):
2422         (-[WKView _setIsWindowOccluded:]):
2423         (-[WKView initWithFrame:contextRef:pageGroupRef:relatedToPage:]):
2424         (-[WKView windowOcclusionDetectionEnabled]):
2425         (-[WKView setWindowOcclusionDetectionEnabled:]):
2426         Only compile occlusion detection code where supported and remove calls to register/deregister
2427         for detection callbacks, now that NSWindow will handle that for us. We also no longer need to
2428         track all the WKViews, as that was only required to lookup the view that matched the window number
2429         returned from the occlusion callback.
2430
2431 2013-04-26  Anders Carlsson  <andersca@apple.com>
2432
2433         Use OwnPtr<PluginControllerProxy> for storing plug-in controllers in WebProcessConnection
2434         https://bugs.webkit.org/show_bug.cgi?id=115259
2435
2436         Reviewed by Andreas Kling.
2437
2438         * PluginProcess/WebProcessConnection.cpp:
2439         (WebKit::WebProcessConnection::addPluginControllerProxy):
2440         (WebKit::WebProcessConnection::removePluginControllerProxy):
2441         (WebKit::WebProcessConnection::didClose):
2442         * PluginProcess/WebProcessConnection.h:
2443         (WebProcessConnection):
2444
2445 2013-04-27  Jessie Berlin  <jberlin@apple.com>
2446
2447         Build fix.
2448
2449         * NetworkProcess/NetworkResourceLoader.cpp:
2450         (WebKit::NetworkResourceLoader::didReceiveBuffer):
2451         Do not declare another variable with the same name.
2452
2453 2013-04-27  Darin Adler  <darin@apple.com>
2454
2455         Move from constructor and member function adoptCF/NS to free function adoptCF/NS.
2456         https://bugs.webkit.org/show_bug.cgi?id=115307
2457
2458         Reviewed by Geoffrey Garen.
2459
2460         This change was done by a global replace followed by compiling and inspecting for
2461         cases that needed to be tweaked by hand.
2462
2463         * Platform/cg/CGUtilities.cpp:
2464         (WebKit::paintBitmapContext):
2465         * Platform/mac/ModuleMac.mm:
2466         (WebKit::Module::load):
2467         (WebKit::Module::platformFunctionPointer):
2468         * PluginProcess/mac/PluginProcessMac.mm:
2469         (WebKit::PluginProcess::initializeSandbox):
2470         * Shared/API/c/mac/WKURLRequestNS.mm:
2471         (WKURLRequestCreateWithNSURLRequest):
2472         * Shared/API/c/mac/WKURLResponseNS.mm:
2473         (WKURLResponseCreateWithNSURLResponse):
2474         * Shared/Downloads/mac/DownloadMac.mm:
2475         (WebKit::Download::start):
2476         (WebKit::Download::startWithHandle):
2477         * Shared/EntryPointUtilities/mac/LegacyProcess/ChildProcessEntryPoint.h:
2478         (WebKit::ChildProcessMain):
2479         * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
2480         (WebKit::getPluginArchitecture):
2481         (WebKit::contentsOfPropertyListAtURL):
2482         (WebKit::getMIMETypesFromPluginBundle):
2483         (WebKit::getStringListResource):
2484         (WebKit::NetscapePluginModule::getPluginInfo):
2485         * Shared/ShareableResource.cpp:
2486         (WebKit::ShareableResource::Handle::tryWrapInSharedBuffer):
2487         * Shared/cf/ArgumentCodersCF.cpp:
2488         (CoreIPC::decode):
2489         (CoreIPC::encode):
2490         * Shared/cg/ShareableBitmapCG.cpp:
2491         (WebKit::ShareableBitmap::createGraphicsContext):
2492         (WebKit::ShareableBitmap::makeCGImageCopy):
2493         (WebKit::ShareableBitmap::makeCGImage):
2494         (WebKit::ShareableBitmap::createCGImage):
2495         * Shared/mac/ArgumentCodersMac.mm:
2496         (CoreIPC::decode):
2497         * Shared/mac/PlatformCertificateInfo.mm:
2498         (WebKit::PlatformCertificateInfo::dump):
2499         * Shared/mac/WebCoreArgumentCodersMac.mm:
2500         (CoreIPC::::encodePlatformData):
2501         (CoreIPC::::decodePlatformData):
2502         * UIProcess/API/mac/FindIndicatorWindow.mm:
2503         (WebKit::FindIndicatorWindow::setFindIndicator):
2504         (WebKit::FindIndicatorWindow::startFadeOutTimerFired):
2505         * UIProcess/API/mac/PDFViewController.mm:
2506         (-[WKPDFView initWithFrame:PDFViewController:]):
2507         (WebKit::PDFViewController::PDFViewController):
2508         (WebKit::convertPostScriptDataSourceToPDF):
2509         (WebKit::PDFViewController::setPDFDocumentData):
2510         * UIProcess/API/mac/PageClientImpl.mm:
2511         (WebKit::PageClientImpl::PageClientImpl):
2512         (WebKit::PageClientImpl::registerEditCommand):
2513         (WebKit::PageClientImpl::setDragImage):
2514         * UIProcess/API/mac/WKBrowsingContextController.mm:
2515         (didFailProvisionalLoadWithErrorForFrame):
2516         (didFailLoadWithErrorForFrame):
2517         * UIProcess/API/mac/WKConnection.mm:
2518         (didReceiveMessage):
2519         * UIProcess/API/mac/WKPrintingView.mm:
2520         (-[WKPrintingView drawRect:]):
2521         * UIProcess/API/mac/WKView.mm:
2522         (-[WKView browsingContextController]):
2523         (-[WKView _setAcceleratedCompositingModeRootLayer:]):
2524         (-[WKView _setPromisedData:WebCore::withFileName:withExtension:withTitle:withURL:withVisibleURL:withArchive:WebCore::forPasteboard:]):
2525         (-[WKView namesOfPromisedFilesDroppedAtDestination:]):
2526         (-[WKView fullScreenWindowController]):
2527         (-[WKView _executeSavedCommandBySelector:]):
2528         (-[WKView printOperationWithPrintInfo:forFrame:]):
2529         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
2530         (WebKit::createProcess):
2531         * UIProcess/Plugins/mac/PluginInfoStoreMac.mm:
2532         (WebKit::PluginInfoStore::pluginPathsInDirectory):
2533         (WebKit::PluginInfoStore::getMIMETypeForExtension):
2534         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
2535         (WebKit::PluginProcessProxy::beginModal):
2536         * UIProcess/cf/WebBackForwardListCF.cpp:
2537         (WebKit::WebBackForwardList::createCFDictionaryRepresentation):
2538         * UIProcess/cf/WebPageProxyCF.cpp:
2539         (WebKit::WebPageProxy::sessionStateData):
2540         (WebKit::WebPageProxy::restoreFromSessionStateData):
2541         (WebKit::WebPageProxy::saveRecentSearches):
2542         (WebKit::WebPageProxy::loadRecentSearches):
2543         * UIProcess/cf/WebPreferencesCF.cpp:
2544         (WebKit::cfStringFromWebCoreString):
2545         (WebKit::setStringValueIfInUserDefaults):
2546         (WebKit::setBoolValueIfInUserDefaults):
2547         (WebKit::setUInt32ValueIfInUserDefaults):
2548         (WebKit::setDoubleValueIfInUserDefaults):
2549         (WebKit::WebPreferences::platformUpdateUInt32ValueForKey):
2550         (WebKit::WebPreferences::platformUpdateDoubleValueForKey):
2551         (WebKit::WebPreferences::platformUpdateFloatValueForKey):
2552         * UIProcess/mac/BackingStoreMac.mm:
2553         (WebKit::BackingStore::resetScrolledRect):
2554         (WebKit::BackingStore::backingStoreContext):
2555         * UIProcess/mac/CorrectionPanel.mm:
2556         (WebKit::CorrectionPanel::handleAcceptedReplacement):
2557         * UIProcess/mac/TextCheckerMac.mm:
2558         (WebKit::TextChecker::checkTextOfParagraph):
2559         (WebKit::TextChecker::updateSpellingUIWithGrammarString):
2560         * UIProcess/mac/WKFullScreenWindowController.mm:
2561         (-[WKFullScreenWindowController enterFullScreen:]):
2562         (-[WKFullScreenWindowController _startEnterFullScreenAnimationWithDuration:]):
2563         (-[WKFullScreenWindowController _startExitFullScreenAnimationWithDuration:]):
2564         * UIProcess/mac/WebContextMac.mm:
2565         (WebKit::WebContext::platformDefaultDiskCacheDirectory):
2566         * UIProcess/mac/WebContextMenuProxyMac.mm:
2567         (WebKit::nsMenuItemVector):
2568         (WebKit::WebContextMenuProxyMac::populate):
2569         * UIProcess/mac/WebInspectorProxyMac.mm:
2570         (WebKit::WebInspectorProxy::createInspectorWindow):
2571         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
2572         * UIProcess/mac/WebPopupMenuProxyMac.mm:
2573         (WebKit::WebPopupMenuProxyMac::populate):
2574         (WebKit::WebPopupMenuProxyMac::showPopupMenu):
2575         * WebProcess/InjectedBundle/mac/InjectedBundleMac.mm:
2576         (WebKit::InjectedBundle::load):
2577         * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
2578         (WebKit::NetscapePlugin::updatePluginLayer):
2579         * WebProcess/Plugins/Netscape/mac/PluginProxyMac.mm:
2580         (WebKit::PluginProxy::pluginLayer):
2581         * WebProcess/Plugins/PDF/PDFPlugin.mm:
2582         (WebKit::PDFPlugin::PDFPlugin):
2583         (WebKit::PDFPlugin::createScrollbar):
2584         (WebKit::PDFPlugin::pdfDocumentDidLoad):
2585         (WebKit::PDFPlugin::writeItemsToPasteboard):
2586         * WebProcess/Plugins/PDF/SimplePDFPlugin.mm:
2587         (getAllScriptsInPDFDocument):
2588         (WebKit::SimplePDFPlugin::pdfDocumentDidLoad):
2589         (WebKit::SimplePDFPlugin::streamDidReceiveData):
2590         (WebKit::SimplePDFPlugin::manualStreamDidReceiveData):
2591         * WebProcess/ResourceCache/WebResourceCacheManager.cpp:
2592         (WebKit::WebResourceCacheManager::clearCacheForOrigin):
2593         * WebProcess/ResourceCache/cf/WebResourceCacheManagerCFNet.cpp:
2594         (WebKit::WebResourceCacheManager::cfURLCacheHostNames):
2595         (WebKit::WebResourceCacheManager::clearCFURLCacheForHostNames):
2596         * WebProcess/WebCoreSupport/mac/WebErrorsMac.mm:
2597         (WebKit::createNSError):
2598         * WebProcess/WebPage/WebPage.cpp:
2599         (WebKit::WebPage::drawPagesToPDF):
2600         * WebProcess/WebPage/mac/WebPageMac.mm:
2601         (WebKit::WebPage::performDictionaryLookupForRange):
2602         (WebKit::cachedResponseForURL):
2603         (WebKit::WebPage::drawPagesToPDFFromPDFDocument):
2604         * WebProcess/mac/WebProcessMac.mm:
2605         (WebKit::WebProcess::platformSetCacheModel):
2606         Use adoptCF and adoptNS free functions.
2607
2608 2013-04-27  Alexey Proskuryakov  <ap@apple.com>
2609
2610         <rdar://problem/13757007> Crashes in NetworkResourceLoader::didReceiveResponseAsync
2611         https://bugs.webkit.org/show_bug.cgi?id=115318
2612
2613         Reviewed by Darin Adler.
2614
2615         sendAbortingOnFailure may actually fail, and abort the request, making m_handle null.
2616
2617         * NetworkProcess/NetworkResourceLoader.cpp:
2618         (WebKit::NetworkResourceLoader::didReceiveResponseAsync): Null check m_handle after
2619         sending a message, because the request will cancelled when connection is invalid.
2620         (WebKit::NetworkResourceLoader::didReceiveBuffer): Assert that m_handle matches
2621         the handle that we are called with.
2622         (WebKit::NetworkResourceLoader::didFinishLoading): Ditto.
2623         (WebKit::NetworkResourceLoader::didFail): Ditto.
2624         (WebKit::NetworkResourceLoader::willSendRequestAsync): Ditto.
2625         (WebKit::NetworkResourceLoader::didSendData): Ditto.
2626         (WebKit::NetworkResourceLoader::shouldUseCredentialStorage): Ditto.
2627         (WebKit::NetworkResourceLoader::shouldUseCredentialStorageAsync): Ditto.
2628         (WebKit::NetworkResourceLoader::didReceiveAuthenticationChallenge): Ditto.
2629         (WebKit::NetworkResourceLoader::didCancelAuthenticationChallenge): Ditto.
2630         (WebKit::NetworkResourceLoader::canAuthenticateAgainstProtectionSpaceAsync): Ditto.
2631
2632 2013-04-27  Alexey Proskuryakov  <ap@apple.com>
2633
2634         <rdar://problem/13757687> Threads get stuck in NetworkProcess when canceling loads
2635         https://bugs.webkit.org/show_bug.cgi?id=115319
2636
2637         Reviewed by Darin Adler.
2638
2639         WebResourceLoader was second-guessing NetworkProcess as to whether it needs a response
2640         to DidReceiveResponseWithCertificateInfo, and it was guessing wrong if the load was
2641         alrady canceled on WebProcess side.
2642
2643         * NetworkProcess/NetworkResourceLoader.cpp:
2644         (WebKit::NetworkResourceLoader::didReceiveResponseAsync):
2645         * WebProcess/Network/WebResourceLoader.cpp:
2646         (WebKit::WebResourceLoader::didReceiveResponseWithCertificateInfo):
2647         * WebProcess/Network/WebResourceLoader.h:
2648         * WebProcess/Network/WebResourceLoader.messages.in:
2649
2650 2013-04-27  Alexey Proskuryakov  <ap@apple.com>
2651
2652         Regression tests that reference a non-local resource crash with NetworkProcess enabled
2653         https://bugs.webkit.org/show_bug.cgi?id=115290
2654
2655         Reviewed by Sam Weinig.
2656
2657         Covered by fast/dom/icon-url-change.html and many other existing tests.
2658
2659         * WebProcess/Network/WebResourceLoadScheduler.cpp:
2660         (WebKit::WebResourceLoadScheduler::remove): Handle this case. Architecturally, it
2661         would be better if SubresourceLoad::create just created an object an didn't do
2662         further checks before returning a pointer, but changing that is beyond the scope
2663         of the fix.
2664
2665 2013-04-26  Yael Aharon  <yael.aharon@intel.com>
2666
2667         [WK2][EFL] Build break after r149212
2668         https://bugs.webkit.org/show_bug.cgi?id=115294
2669
2670         Reviewed by Simon Fraser.
2671         r144672 bumped up the revision of WKContextClient API, and introduced a version array
2672         APIClientTraits<WKContextClient>::interfaceSizesByVersion .
2673         In r149212, the version was bumped back down and the version array was emptied but not removed.
2674         This causes a warning "array subscript is below array bounds", and in EFL the warning is
2675         treated as error.
2676
2677         * Shared/APIClientTraits.cpp:
2678         (WebKit):
2679         * Shared/APIClientTraits.h:
2680
2681 2013-04-26  Martin Robinson  <mrobinson@igalia.com>
2682
2683         [GTK] Add methods to add a user style sheet to the WebKit2 GTK+ API
2684         https://bugs.webkit.org/show_bug.cgi?id=99081
2685
2686         Reviewed by Carlos Garcia Campos, Gustavo Noronha Silva, and Benjamin Poulain.
2687
2688         Add methods to WebKitWebViewGroup to add and remove user style sheets.
2689         This allows clients to inject style sheets into pages with a set of
2690         rules for when those style sheets apply.
2691
2692         * UIProcess/API/gtk/WebKitWebViewGroup.cpp:
2693         (toImmutableArray): Added this helper which converts the GList* parameters into
2694         ImmutableArrays for use with the WebKit2 internal API.
2695         (webkit_web_view_group_add_user_style_sheet): Added new API for adding a style sheet.
2696         (webkit_web_view_group_remove_all_user_style_sheets): Add new API for clearing out all style sheets.
2697         * UIProcess/API/gtk/WebKitWebViewGroup.h: Added new method declarations.
2698         * UIProcess/API/gtk/docs/webkit2gtk-sections.txt: Added new API to the documentation.
2699         * UIProcess/API/gtk/tests/TestWebKitWebViewGroup.cpp: Added a test for the new API.
2700         (isStyleSheetInjectedForURLAtPath): Function to check whether the style sheet has been injected for a given URL.
2701         (fillURLListFromPaths): Helper which converts paths passed via varargs into a whitelist or blacklist.
2702         (removeOldInjectedStyleSheetsAndResetLists): Function to start afresh.
2703         (testWebViewGroupInjectedStyleSheet): The actual test.
2704         (serverCallback): Server callback for use with the test. We cannot use loadHTML or
2705         loadAlternateHTML, because that checks the whitelist and blacklist against about:blank.
2706         (beforeAll): Initialize the server and new test.
2707         (afterAll): Clean up the server.
2708
2709 2013-04-26  Simon Cooper  <scooper@apple.com>
2710
2711         Permit ~/Library or ~/Library/Preferences to be symlinks
2712         https://bugs.webkit.org/show_bug.cgi?id=115142
2713         <rdar://problem/12953603>
2714
2715         Reviewed by Alexey Proskuryakov.
2716
2717         Pass in two new parameters which are the resolved paths to ~/Library
2718         and ~/Library/Preferences. Added new expansion functions and
2719         substituted the new functions for home-regex, home-subpath and
2720         home-literal for places referencing resources in "~/Library" or
2721         "~/Library/Preferences".
2722
2723         * Resources/PlugInSandboxProfiles/com.apple.QuickTime Plugin.plugin.sb:
2724         * Resources/PlugInSandboxProfiles/com.apple.WebKit.plugin-common.sb:
2725         * Resources/PlugInSandboxProfiles/com.apple.ist.ds.appleconnect.webplugin.sb:
2726         * Resources/PlugInSandboxProfiles/com.macromedia.Flash Player.plugin.sb:
2727         * Resources/PlugInSandboxProfiles/com.microsoft.SilverlightPlugin.sb:
2728         * Resources/PlugInSandboxProfiles/com.oracle.java.JavaAppletPlugin.sb:
2729         * Shared/mac/ChildProcessMac.mm:
2730         (WebKit::ChildProcess::initializeSandbox):
2731
2732 2013-04-26  Alexey Proskuryakov  <ap@apple.com>
2733
2734         [WK2] WKContextClient doesn't need to be versioned yet
2735         https://bugs.webkit.org/show_bug.cgi?id=115279
2736
2737         Reviewed by Anders Carlsson.
2738
2739         * Shared/APIClientTraits.cpp:
2740         * Shared/APIClientTraits.h:
2741         * UIProcess/API/C/WKContext.h:
2742
2743 2013-04-26  Anders Carlsson  <andersca@apple.com>
2744
2745         Downloads need to be converted from the NSURLConnection, not canceled and restarted, when using the NetworkProcess
2746         https://bugs.webkit.org/show_bug.cgi?id=115277
2747         <rdar://problem/12890184>
2748
2749         Reviewed by Sam Weinig.
2750
2751         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2752         (WebKit::NetworkConnectionToWebProcess::convertMainResourceLoadToDownload):
2753         Ask the download manager to convert the main resource load to a download.
2754
2755         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
2756         Add new message.
2757
2758         * NetworkProcess/NetworkResourceLoader.h:
2759         (WebKit::NetworkResourceLoader::handle):
2760         Add getter.
2761
2762         * Shared/Downloads/mac/DownloadMac.mm:
2763         (dispatchOnMainThread):
2764         Helper function that ensures that a given block is called on the main thread.
2765
2766         (-[WKDownloadAsDelegate downloadDidBegin:]):
2767         (-[WKDownloadAsDelegate download:didReceiveAuthenticationChallenge:]):
2768         (-[WKDownloadAsDelegate download:didReceiveResponse:]):
2769         (-[WKDownloadAsDelegate download:didReceiveDataOfLength:]):
2770         (-[WKDownloadAsDelegate download:shouldDecodeSourceDataOfMIMEType:]):
2771         (-[WKDownloadAsDelegate download:decideDestinationWithSuggestedFilename:]):
2772         (-[WKDownloadAsDelegate download:didCreateDestination:]):
2773         (-[WKDownloadAsDelegate downloadDidFinish:]):
2774         (-[WKDownloadAsDelegate download:didFailWithError:]):
2775         Use dispatchOnMainThread.
2776
2777         * UIProcess/WebPageProxy.cpp:
2778         (WebKit::WebPageProxy::receivedPolicyDecision):
2779         Remove code that cancels the current load and starts a new download.
2780
2781         * WebProcess/WebPage/WebFrame.cpp:
2782         (WebKit::WebFrame::convertMainResourceLoadToDownload):
2783         Send the ConvertMainResourceLoadToDownload message to the network process.
2784
2785 2013-04-25  Roger Fong  <roger_fong@apple.com>
2786
2787         Disable sub-pixel layout on mac.
2788         https://bugs.webkit.org/show_bug.cgi?id=114999.
2789
2790         Reviewed by Simon Fraser.
2791
2792         * Configurations/FeatureDefines.xcconfig:
2793
2794 2013-04-26  Simon Fraser  <simon.fraser@apple.com>
2795
2796         Inspector window is often blank when opened
2797         https://bugs.webkit.org/show_bug.cgi?id=115220
2798
2799         Reviewed by Tim Horton.
2800         
2801         After disabling tiled scrolling and accelerated drawing in r149006, the
2802         Inspector window was often missing its content after opening. This only
2803         happened when the user has a preference on disk to use accelerated drawing
2804         in the Inspector.
2805         
2806         The missing content was caused by a failure to connect the correct contextID
2807         for remote layer hosting. On window creation, we hook up a context using
2808         WindowServer layer hosting (the default), but then switch back to app-hosted
2809         layers for the Inspector window. This switching happens in didUpdateBackingStoreState(),
2810         but that can be re-entered via its call to sendUpdateBackingStoreState(). In
2811         that cause, on unwinding the stack it would call enterAcceleratedCompositingMode()
2812         with a stale layerTreeContext.
2813         
2814         Fix by moving the code that exits/enters accelerated compositing mode to before
2815         the call to sendUpdateBackingStoreState() that can cause re-entrancy. That avoids
2816         use of a possibly stale layerTreeContext.
2817
2818         * UIProcess/DrawingAreaProxyImpl.cpp:
2819         (WebKit::DrawingAreaProxyImpl::didUpdateBackingStoreState):
2820
2821 2013-04-26  Alexey Proskuryakov  <ap@apple.com>
2822
2823         Crashes under ResourceHandle::continueDidReceiveResponse when loading blobs
2824         https://bugs.webkit.org/show_bug.cgi?id=115273
2825
2826         Reviewed by Anders Carlsson.
2827
2828         Covered by multiple existing tests (when using NetworkProcess), including:
2829         - http/tests/fileapi/blob-url-in-subframe.html
2830         - http/tests/fileapi/create-blob-url-from-data-url.html
2831
2832         * NetworkProcess/NetworkResourceLoader.cpp:
2833         (WebKit::NetworkResourceLoader::continueDidReceiveResponse):
2834         Work around BlobResourceHandle badness.
2835
2836 2013-04-26  Alexey Proskuryakov  <ap@apple.com>
2837
2838         [WK2] Remove NetworkResourceLoader::cleanupOnMainThread
2839         https://bugs.webkit.org/show_bug.cgi?id=115268
2840
2841         Reviewed by Brady Eidson.
2842
2843         All cleanup() callers are now on main thread, and this indirection only complicates debugging.
2844
2845         * NetworkProcess/NetworkResourceLoader.cpp:
2846         (WebKit::NetworkResourceLoader::connectionToWebProcessDidClose):
2847         (WebKit::NetworkResourceLoader::abortInProgressLoad):
2848         (WebKit::NetworkResourceLoader::didFinishLoading):
2849         (WebKit::NetworkResourceLoader::didFail):
2850         * NetworkProcess/NetworkResourceLoader.h:
2851
2852 2013-04-26  Andy Estes  <aestes@apple.com>
2853
2854         [WebKit2] CustomProtocolManager's m_registeredSchemes HashSet can be accessed by multiple threads
2855         https://bugs.webkit.org/show_bug.cgi?id=115267
2856
2857         Reviewed by Alexey Proskuryakov.
2858
2859         * Shared/Network/CustomProtocols/CustomProtocolManager.h: Added a Mutex to protect m_registeredSchemes.
2860         * Shared/Network/CustomProtocols/mac/CustomProtocolManagerMac.mm:
2861         (WebKit::CustomProtocolManager::registerScheme): Acquired the mutex before accessing m_registeredSchemes.
2862         (WebKit::CustomProtocolManager::unregisterScheme): Ditto.
2863         (WebKit::CustomProtocolManager::supportsScheme): Ditto.
2864
2865 2013-04-26  Alexey Proskuryakov  <ap@apple.com>
2866
2867         Blobs are not associated with connection when there are no sandbox extensions
2868         https://bugs.webkit.org/show_bug.cgi?id=115264
2869
2870         Reviewed by Brady Eidson.
2871
2872         Covered by multiple fast/files tests when using NetworkProcess.
2873
2874         * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
2875         (WebKit::NetworkBlobRegistry::registerBlobURL): Fixed a logic error.
2876
2877 2013-04-25  Andy Estes  <aestes@apple.com>
2878
2879         [WebKit2] Loading a resource from a custom protocol in a synchronous XHR times out
2880         https://bugs.webkit.org/show_bug.cgi?id=115223
2881
2882         Reviewed by Darin Adler.
2883
2884         When WebKit performs a synchronous load on the Mac, it spins a nested
2885         run loop in a mode that only accepts input from the NSURLConnection
2886         performing the load. When the load is for a custom protocol in WebKit2,
2887         we proxy it to the UI process via CoreIPC messages, but the response
2888         messages from the UI process are never processed as long as the run
2889         loop is in a non-common mode (and we wouldn't want to process messages
2890         that could re-enter WebCore in the middle of loading, anyway). Since
2891         these messages never make it back to the NSURLConnection handling the
2892         request, the connection eventually times out.
2893
2894         Fix this by using a work queue to handle custom protocol messages in
2895         the networking process. The work queue can process incoming custom
2896         protocol messages while the main thread is blocked.
2897
2898         * NetworkProcess/NetworkProcess.cpp:
2899         (WebKit::NetworkProcess::initializeConnection): Called
2900         initializeConnection() on all the NetworkProcess's supplements.
2901         * Shared/ChildProcessSupplement.h: Added a base class for
2902         NetworkProcessSupplement and WebProcessSupplement which defines
2903         initializeConnection and provides an empty default implementation.
2904         (WebKit::ChildProcessSupplement::~ChildProcessSupplement):
2905         (WebKit::ChildProcessSupplement::initializeConnection):
2906         * Shared/Network/CustomProtocols/CustomProtocolManager.h:
2907         * Shared/Network/CustomProtocols/mac/CustomProtocolManagerMac.mm:
2908         (WebKit::CustomProtocolManager::CustomProtocolManager): Instantiated a
2909         work queue for message processing.
2910         (WebKit::CustomProtocolManager::initializeConnection): Added the work
2911         queue as a message receiver on the CoreIPC connection.
2912         (WebKit::CustomProtocolManager::initialize): If we're in the web
2913         process and the network process is being used, unregister and destroy
2914         the work queue we previously created. It'd be better to not create it
2915         in the first place, but we have to register our work queue with the
2916         CoreIPC connection before it is established, which is before the UI
2917         process has told us whether the network process is in use.
2918         * Shared/Network/NetworkProcessSupplement.h: Inherited from
2919         ChildProcessSupplement.
2920         * WebKit2.xcodeproj/project.pbxproj: Added ChildProcessSupplement.h.
2921         * WebProcess/WebProcess.cpp:
2922         (WebKit::WebProcess::initializeConnection): Called
2923         initializeConnection() on all the WebProcess's supplements.
2924         * WebProcess/WebProcessSupplement.h: Inherited from
2925         ChildProcessSupplement.
2926
2927 2013-04-26  Eduardo Lima Mitev  <elima@igalia.com>
2928
2929         [GTK] Compilation of ProcessLauncherGtk.cpp fails due to unresolved symbols
2930         https://bugs.webkit.org/show_bug.cgi?id=115240
2931
2932         Reviewed by Martin Robinson.
2933
2934         * UIProcess/Launcher/gtk/ProcessLauncherGtk.cpp: Includes sys/socket.h if OS is Linux
2935
2936 2013-04-25  Zan Dobersek  <zdobersek@igalia.com>
2937
2938         [GTK] Plugin process broken due to a missing symbol
2939         https://bugs.webkit.org/show_bug.cgi?id=114901
2940
2941         Reviewed by Gustavo Noronha Silva.
2942
2943         Work around the missing symbols in the WebKitPluginProcess by specifying the required libraries
2944         multiple times in the program's LDADD list. Libtool fights fiercely to avoid duplicate static library
2945         references among the linker arguments (even if using the --preserve-dup-deps flag) so the required libraries
2946         are specified in various ways.
2947
2948         The unresolved symbols in object files are no longer ignored as this can lead to further trouble (for instance
2949         this patch also adds a few missing source files to the list of WebKitPluginProcess sources). The Freetype and
2950         gamepad dependencies' libraries are also added to the binary's LDADD list.
2951
2952         * GNUmakefile.am:
2953         * GNUmakefile.list.am: Add a few missing files to the build.
2954
2955 2013-04-24  Chris Fleizach  <cfleizach@apple.com>
2956
2957         WEB SPEECH: language support does not work as expected
2958         https://bugs.webkit.org/show_bug.cgi?id=115119
2959
2960         Reviewed by Alexey Proskuryakov.
2961
2962         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
2963         (InitWebCoreSystemInterface):
2964
2965 2013-04-25  Anders Carlsson  <andersca@apple.com>
2966
2967         Rename DecidePolicyForResponse message to DecidePolicyForResponseSync
2968         https://bugs.webkit.org/show_bug.cgi?id=115207
2969
2970         Reviewed by Beth Dakin.
2971
2972         In preparation for adding a new async DecidePolicyForResponse message,
2973         rename the current one to DecidePolicyForResponseSync. Also split out the async part
2974         into a separate WebPageProxy::decidePolicyForResponse member function.
2975
2976         * UIProcess/WebPageProxy.cpp:
2977         (WebKit::WebPageProxy::WebPageProxy):
2978         (WebKit::WebPageProxy::receivedPolicyDecision):
2979         (WebKit::WebPageProxy::decidePolicyForResponse):
2980         (WebKit::WebPageProxy::decidePolicyForResponseSync):
2981         * UIProcess/WebPageProxy.h:
2982         (WebPageProxy):
2983         * UIProcess/WebPageProxy.messages.in:
2984         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2985         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
2986
2987 2013-04-25  Joseph Pecoraro  <pecoraro@apple.com>
2988
2989         Web Inspector: ConsoleMessage should include line and column number where possible
2990         https://bugs.webkit.org/show_bug.cgi?id=114929
2991
2992         Reviewed by Timothy Hatcher.
2993
2994         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2995         (WebKit::WebChromeClient::addMessageToConsole):
2996         * WebProcess/WebCoreSupport/WebChromeClient.h:
2997
2998 2013-04-25  Brady Eidson  <beidson@apple.com>
2999
3000         Thread safety issues in WKCustomProtocol.
3001         <rdar://problem/13247304> and https://bugs.webkit.org/show_bug.cgi?id=115185
3002
3003         Reviewed by Alexey Proskuryakov.
3004
3005         * Shared/Network/CustomProtocols/CustomProtocolManager.h:
3006
3007         * Shared/Network/CustomProtocols/mac/CustomProtocolManagerMac.mm:
3008         (WebKit::CustomProtocolManager::addCustomProtocol): Protect m_customProtocolMap with its mutex.
3009         (WebKit::CustomProtocolManager::removeCustomProtocol): Ditto.
3010         (WebKit::CustomProtocolManager::didFailWithError):
3011         (WebKit::CustomProtocolManager::didLoadData):
3012         (WebKit::CustomProtocolManager::didReceiveResponse):
3013         (WebKit::CustomProtocolManager::didFinishLoading):
3014         (WebKit::CustomProtocolManager::protocolForID): Protect m_customProtocolMap with its mutex, and return
3015           a RetainPtr instead of a raw pointer.
3016
3017 2013-04-25  Jer Noble  <jer.noble@apple.com>
3018
3019         Further build fixes: correct two more misnames of WebProcessShim.dyld.
3020
3021         * WebProcess/EntryPoint/mac/LegacyProcess/WebContentProcessMain.mm:
3022         (WebKit::WebContentProcessMainDelegate::doPreInitializationWork):
3023         * WebProcess/EntryPoint/mac/XPCService/WebContentService/Info.plist:
3024
3025 2013-04-25  Martin Robinson  <mrobinson@igalia.com>
3026
3027         Make gobject-introspection warnings non-fatal
3028         https://bugs.webkit.org/show_bug.cgi?id=115184
3029
3030         Reviewed by Carlos Garcia Campos.
3031
3032         * GNUmakefile.am: Make it so that gobject-introspection errors do not fail the buld
3033         until we get to a point where gobject-introspection gives consistent warnings.
3034
3035 2013-04-25  Carlos Garcia Campos  <cgarcia@igalia.com>
3036
3037         [GTK] Add WebKitWebViewGroup to WebKit2 GTK+ API
3038         https://bugs.webkit.org/show_bug.cgi?id=111265
3039
3040         Reviewed by Anders Carlsson.
3041
3042         In the current API the settings are always shared by all web
3043         views, because they are always created on the default page
3044         group. This makes impossible to have different settings on
3045         different web views. Expose the page group in the API,
3046         so that users can create web views on a group different than the
3047         default one to have their own settings.
3048
3049         * GNUmakefile.list.am: Add new files to compilation.
3050         * UIProcess/API/gtk/WebKitSettings.cpp:
3051         (webkitSettingsGetPreferences): Helper private method to get the
3052         WebPreferences wrapped by a WebKitSettings object.
3053         * UIProcess/API/gtk/WebKitSettingsPrivate.h:
3054         * UIProcess/API/gtk/WebKitWebContext.cpp:
3055         (_WebKitWebContextPrivate): Add a default WebKitWebViewGroup.
3056         (webkitWebContextCreatePageForWebView): Create the WebPageProxy
3057         with the WebPageGroup of the given WebKitWebViewGroup.
3058         (webkitWebContextGetDefaultWebViewGroup): Helper private method to
3059         get the default WebKitWebViewGroup.
3060         * UIProcess/API/gtk/WebKitWebContextPrivate.h:
3061         * UIProcess/API/gtk/WebKitWebView.cpp:
3062         (_WebKitWebViewPrivate): Add a WebKitWebViewGroup in case the view
3063         is created with a group.
3064         (webkitWebViewUpdateSettings): Keep a reference of the group
3065         settings to be able to disconnect the signals when the settings
3066         object is replaced in the view group and connect to the signals
3067         for the custom settings.
3068         (webkitWebViewSettingsChanged): Disconnect the signals for the
3069         previous settings and set the new settings.
3070         (webkitWebViewDisconnectSettingsChangedSignalHandler): Disconnect
3071         notify::settings signal of WebKitWebViewGroup.
3072         (webkitWebViewConstructed): Pass the current WebKitWebViewGroup to
3073         webkitWebContextCreatePageForWebView().
3074         (webkitWebViewSetProperty): Add setter for group property.
3075         (webkitWebViewGetProperty): Add getter for group property.
3076         (webkitWebViewDispose): Call
3077         webkitWebViewDisconnectSettingsChangedSignalHandler().
3078         (webkit_web_view_class_init): Add WebKitWebView:group property.
3079         (webkitWebViewHandleAuthenticationChallenge): Use
3080         webkit_web_view_get_settings().
3081         (webkit_web_view_new_with_group): Create a new web view with the
3082         given WebKitWebViewGroup.
3083         (webkit_web_view_get_group): Return the current WebKitWebViewGroup
3084         or the default one if the view was not created with
3085         webkit_web_view_new_with_group().
3086         (webkit_web_view_set_settings): Set the settings of the current
3087         WebKitWebViewGroup.
3088         (webkit_web_view_get_settings): Get the settings of the current
3089         WebKitWebViewGroup.
3090         (webkit_web_view_set_zoom_level): Use
3091         webkit_web_view_get_settings().
3092         (webkit_web_view_get_zoom_level): Ditto.
3093         * UIProcess/API/gtk/WebKitWebView.h:
3094         * UIProcess/API/gtk/WebKitWebViewGroup.cpp: Added.
3095         (_WebKitWebViewGroupPrivate):
3096         (webkitWebViewGroupSetProperty):
3097         (webkitWebViewGroupGetProperty):
3098         (webkitWebViewGroupConstructed):
3099         (webkit_web_view_group_class_init):
3100         (webkitWebViewGroupAttachSettingsToPageGroup): Set the
3101         WebPreferences of the current WebKitSettings to the WebPageGroup.
3102         (webkitWebViewGroupCreate): Create a new WebKitWebViewGroup for
3103         the given WebPageGroup.
3104         (webkitWebViewGroupGetPageGroup): Helper private method to get the
3105         WebPageGroup wrapped by the WebKitWebViewGroup.
3106         (webkit_web_view_group_new): Create a new WebKitWebViewGroup.
3107         (webkit_web_view_group_get_name): Return the name of a
3108         WebKitWebViewGroup.
3109         (webkit_web_view_group_get_settings): Get the settings of a
3110         WebKitWebViewGroup.
3111         (webkit_web_view_group_set_settings): Set new settings of a
3112         WebKitWebViewGroup.
3113         * UIProcess/API/gtk/WebKitWebViewGroup.h: Added.
3114         (_WebKitWebViewGroup):
3115         (_WebKitWebViewGroupClass):
3116         * UIProcess/API/gtk/WebKitWebViewGroupPrivate.h: Added.
3117         * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml: Add
3118         WebKitWebViewGroup section.
3119         * UIProcess/API/gtk/docs/webkit2gtk-sections.txt: Add new symbols.
3120         * UIProcess/API/gtk/docs/webkit2gtk.types: Add
3121         webkit_web_view_group_get_type.
3122         * UIProcess/API/gtk/tests/GNUmakefile.am: Add new files to
3123         compilation.
3124         * UIProcess/API/gtk/tests/TestWebKitWebView.cpp:
3125         (testWebViewSettings): We can't watch settings in the default view
3126         group anymore, because they are not released with the web view but
3127         with the web context that is freed after the Test destructor.
3128         * UIProcess/API/gtk/tests/TestWebKitWebViewGroup.cpp: Added.
3129         (testWebViewGroupDefault):
3130         (testWebViewGroupNewGroup):
3131         (testWebViewNewWithGroup):
3132         (testWebViewGroupSettings):
3133         (beforeAll):
3134         (afterAll):
3135         * UIProcess/API/gtk/webkit2.h: Include WebKitWebViewGroup.h.
3136
3137 2013-04-25  Jer Noble  <jer.noble@apple.com>
3138
3139         Unreviewed build fix: Fix the name of DyldInterpose.h in
3140         SecItemShimLibrary.mm, fix the name of WebProcessShim.dyld in
3141         WebContentServiceEntryPoint.mm, and stop linking against libWTF.a
3142         directly (which means removing ASSERTs from
3143         CookieStorageShimLibrary.cpp).
3144
3145         * Shared/mac/CookieStorageShimLibrary.cpp:
3146         (WebKit::shimCFHTTPCookieStorageCopyRequestHeaderFieldsForURL):
3147         (WebKit::WebKitCookieStorageShimInitialize):
3148         * WebKit2.xcodeproj/project.pbxproj:
3149         * WebProcess/EntryPoint/mac/XPCService/WebContentServiceEntryPoint.mm:
3150         (WebContentServiceInitializer):
3151         * WebProcess/mac/SecItemShimLibrary.mm:
3152
3153 2013-04-24  Tim Horton  <timothy_horton@apple.com>
3154
3155         PDFPlugin: Cursor should become an i-beam when over selectable text
3156         https://bugs.webkit.org/show_bug.cgi?id=115018
3157         <rdar://problem/12645012>
3158
3159         Reviewed by Alexey Proskuryakov.
3160
3161         * WebProcess/Plugins/PDF/PDFPlugin.h:
3162         Add updateCursor(), the UpdateCursorMode and HitTestResult enums, and
3163         storage for the last PDF hit test result.
3164         * WebProcess/Plugins/PDF/PDFPlugin.mm:
3165         (WebKit::PDFPlugin::updateCursor):
3166         Hit test the PDF. If there is a word under the cursor, use the I-beam cursor,
3167         otherwise, use the default pointer cursor. This approximates PDFKit's behavior,
3168         though does not match it precisely in the case of annotations.
3169         Only send the cursor update to the UIProcess if it is a change, or if
3170         we're explicitly asked to update.
3171         (WebKit::PDFPlugin::handleMouseEvent):
3172         If we're processing a mouse moved event, update the cursor if needed.
3173         (WebKit::PDFPlugin::handleMouseEnterEvent):
3174         If the cursor just moved over the PDFPlugin, force-update the cursor,
3175         even if it matches the previously-set cursor (because something else
3176         likely updated the cursor while it was not over the PDFPlugin).
3177
3178 2013-04-24  Tim Horton  <timothy_horton@apple.com>
3179
3180         Page Overlays shouldn't waste time flushing layers if we're not going to use it
3181         https://bugs.webkit.org/show_bug.cgi?id=115145
3182
3183         Reviewed by Simon Fraser.
3184
3185         Don't flush the page overlay layer when it's installed - it starts out
3186         with paintContents=false, so we don't really need a CALayer yet. We'll
3187         flush later if need be.
3188
3189         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
3190         (WebKit::TiledCoreAnimationDrawingArea::didInstallPageOverlay):
3191
3192 2013-04-24  Jer Noble  <jer.noble@apple.com>
3193
3194         Further unreviewed build fix; CFNetwork.framework is the one which Lion
3195         refuses to link against.
3196
3197         * WebKit2.xcodeproj/project.pbxproj:
3198
3199 2013-04-24  Jer Noble  <jer.noble@apple.com>
3200
3201         Unreviewed build fix; link against CoreServices.framework instead of against
3202         CoreFoundation.framework directly, to make the linker happy on Lion.
3203
3204         * WebKit2.xcodeproj/project.pbxproj:
3205
3206 2013-04-22  Jer Noble  <jer.noble@apple.com>
3207
3208         WWDC session videos don’t play at developer.apple.com
3209         https://bugs.webkit.org/show_bug.cgi?id=114858
3210
3211         Reviewed by Eric Carlson. Rubber stamped by Brady Eidson.
3212
3213         AVFoundation uses CFNetwork to store and retrieve cookies from the global store.
3214         However, in the case where network access happens in the NetworkProcess, session
3215         cookies are stored in-memory, and are not accessable in the WebProcess. Until such
3216         a time as AVFoundation can provide an API which would allow us to provide cookies
3217         for a specific request, we will interpose the CFNetwork method which they use to
3218         retrieve the cookie string from the cookie store for their pending request.
3219
3220         Duplicate the previous SecItemShim target to a new, WebProcessShim target. This
3221         target includes the SecItemShim functionality, but will add a new shim for cookie
3222         retrieval:
3223         * Shared/mac/CookieStorageShimLibrary.h: Added
3224         (CookieStorageShimCallbacks):
3225         * Shared/mac/CookieStorageShimLibrary.cpp: Added.
3226         (WebKit::ShimProtector::ShimProtector): A simple stack-based counter class.
3227         (WebKit::ShimProtector::~ShimProtector):
3228         (WebKit::ShimProtector::count):
3229         (WebKit::shimCFHTTPCookieStorageCopyRequestHeaderFieldsForURL): Interpose
3230             the CFNetwork call, and pass to the registered callback.
3231         (WebKit::WebKitCookieStorageShimInitialize): Register the callbacks.
3232
3233         Add a helper singleton class which will talk to the shim through the 
3234         registered callbacks:
3235         * Shared/mac/CookieStorageShim.h: Added
3236         (WebKit::CookieStorageShim::CookieStorageShim):
3237         * Shared/mac/CookieStorageShim.cpp: Added.
3238         (WebKit::webKitCookieStorageCopyRequestHeaderFieldsForURL): Pass the request
3239             over to the NetworkProcess.
3240         (WebKit::CookieStorageShim::shared): Simple singleton.
3241         (WebKit::CookieStorageShim::initialize): Call the library initializer.
3242
3243         Initialize the shim only when the WebProcess is delegating network loading
3244         to the NetworkProcess:
3245         * WebProcess/WebProcess.cpp:
3246         (WebKit::WebProcess::initializeWebProcess):
3247
3248         Rename the WebProcess's shim from SecItemShim -> WebProcessShim:
3249         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
3250         (WebKit::addDYLDEnvironmentAdditions):
3251         * WebProcess/EntryPoint/mac/LegacyProcess/WebContentProcessMain.mm:
3252         (WebKit::WebContentProcessMainDelegate::doPreInitializationWork):
3253         * WebProcess/EntryPoint/mac/XPCService/WebContentService/Info.plist:
3254         * WebProcess/EntryPoint/mac/XPCService/WebContentServiceEntryPoint.mm:
3255         (WebContentServiceInitializer):
3256
3257         As the DYLD_INTERPOSE macro is used in multiple files now, put it in its
3258         own header:
3259         * Shared/mac/DyldInterpose.h: Added.
3260         * PluginProcess/mac/PluginProcessShim.mm:
3261         * WebProcess/mac/SecItemShimLibrary.mm:
3262
3263         Add new files to the project:
3264         * WebKit2.xcodeproj/project.pbxproj:
3265
3266 2013-04-24  Byungwoo Lee  <bw80.lee@samsung.com>
3267
3268         [EFL] Fix build error after r148963.
3269         https://bugs.webkit.org/show_bug.cgi?id=115126
3270
3271         Reviewed by Laszlo Gombos.
3272
3273         Generate forwarding headers for 'CoordinatedGraphics' to generate WKView.h
3274
3275         * PlatformEfl.cmake:
3276
3277 2013-04-24  Anders Carlsson  <andersca@apple.com>
3278
3279         Crash when trying to determine the length of an invalid message
3280         https://bugs.webkit.org/show_bug.cgi?id=115127
3281         <rdar://problem/13700736>
3282
3283         Reviewed by Beth Dakin.
3284
3285         Use message instead of incomingMessage since incomingMessage will always be null.
3286
3287         * Platform/CoreIPC/Connection.cpp:
3288         (CoreIPC::Connection::processIncomingMessage):
3289
3290 2013-04-24  Carlos Garcia Campos  <cgarcia@igalia.com>
3291
3292         [GTK] Use stamp files for generate-forwarding-headers makefile rules
3293         https://bugs.webkit.org/show_bug.cgi?id=115118
3294
3295         Reviewed by Martin Robinson.
3296
3297         Use a stamp file for the WebKit2 forwarding generator rule. Also
3298         fix the rule dependencies that pointed to a non existent variable.
3299
3300         * GNUmakefile.am:
3301
3302 2013-04-24  Zan Dobersek  <zdobersek@igalia.com>
3303
3304         [GTK][WK2] Implement LayerTreeHostGtk::pageBackgroundTransparencyChanged
3305         https://bugs.webkit.org/show_bug.cgi?id=115094
3306
3307         Reviewed by Tim Horton.
3308
3309         The method was introduced in r149004 (and a stub implementation for the GTK port added in r149017).
3310         Implement the method for the GTK port in the same manner it is implemented under the Mac port,
3311         calling setContentsOpaque on the non-composited content layer.
3312
3313         * WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp:
3314         (WebKit::LayerTreeHostGtk::pageBackgroundTransparencyChanged):
3315
3316 2013-04-24  Simon Cooper  <scooper@apple.com>
3317
3318         <rdar://problem/13614117> Refine the Flash Player profile
3319         https://bugs.webkit.org/show_bug.cgi?id=115016
3320
3321         Reviewed by Alexey Proskuryakov.
3322
3323         Add some refinements to the Flash Player profile. Make a non-/ home
3324         directory work. Fixes that allow file uploading via user selected files.
3325
3326         * Resources/PlugInSandboxProfiles/com.macromedia.Flash Player.plugin.sb:
3327
3328 2013-04-24  Carlos Garcia Campos  <cgarcia@igalia.com>
3329
3330         [WebKit2] Add CoordinatedGraphics to the list of platforms in generate-forwarding-headers.pl
3331         https://bugs.webkit.org/show_bug.cgi?id=115098
3332
3333         Reviewed by Martin Robinson.
3334
3335         r148963 introduced a new WKView.h header in a directory not listed
3336         as a platform prefix in generate-forwarding-headers.pl.
3337
3338         * Scripts/generate-forwarding-headers.pl: Replace unused chromium
3339         plaform prefix with CoordinatedGraphics that is used now.
3340
3341 2013-04-24  Seokju Kwon  <seokju.kwon@gmail.com>
3342
3343         Web Inspector: Add number to list from remote web inspector.
3344         https://bugs.webkit.org/show_bug.cgi?id=115014
3345
3346         Reviewed by Benjamin Poulain.
3347
3348         * UIProcess/InspectorServer/front-end/inspectorPageIndex.html:
3349
3350 2013-04-24  Vlad Vasilyeu  <vasvlad@gmail.com>
3351
3352         --minimal build fails with error: Source/WebKit2/Platform/CoreIPC/ArgumentCoder.h:44:36: error: decode is not a member of WebCore::TextCheckingResult
3353         https://bugs.webkit.org/show_bug.cgi?id=114367
3354
3355         Reviewed by Benjamin Poulain.
3356
3357         Include WebCoreArgumentCoders.h to WebEditorClientEfl.cpp from
3358         WebKit2/Shared/ for successfully building with option --minimal
3359
3360         * WebProcess/WebCoreSupport/efl/WebEditorClientEfl.cpp:
3361
3362 == Rolled over to ChangeLog-2013-04-24 ==