68a2f8a019793fe2a2651acb03bd79da9a6078a1
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2013-05-21  Jessie Berlin  <jberlin@apple.com>
2
3         Expose a way to know when forms are added to a page or when form controls are added to a form
4         in the injected bundle
5         https://bugs.webkit.org/show_bug.cgi?id=116334
6
7         Reviewed by Alexey Proskuryakov.
8
9         Add shouldNotifyOnFormChanges and didAssociateFormControls to the WKBundlePageFormClient.
10
11         * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
12         Add the new callbacks as part of version 2 of the WKBundlePageFormClient.
13
14         * WebProcess/InjectedBundle/InjectedBundlePageFormClient.cpp:
15         (WebKit::InjectedBundlePageFormClient::didAssociateFormControls):
16         Pass the message along to the client if the client has a handler.
17         (WebKit::InjectedBundlePageFormClient::shouldNotifyOnFormChanges):
18         Ditto.
19         * WebProcess/InjectedBundle/InjectedBundlePageFormClient.h:
20
21         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
22         (WebKit::WebChromeClient::didAssociateFormControls):
23         Tell the injected bundle form client for the page.
24         (WebKit::WebChromeClient::shouldNotifyOnFormChanges):
25         Ditto.
26         * WebProcess/WebCoreSupport/WebChromeClient.h:
27
28 2013-05-21  Michael Brüning  <michael.bruning@digia.com>
29
30         [Qt][WK2] Fix Mountain Lion builds after r150277.
31         https://bugs.webkit.org/show_bug.cgi?id=116467
32
33         Reviewed by Jocelyn Turcotte.
34
35         * Shared/API/c/WKBase.h:
36
37 2013-05-20  Lucas Forschler  <lforschler@apple.com>
38
39     Rollout r150398.
40
41 2013-05-20  Zan Dobersek  <zdobersek@igalia.com>
42
43         [GTK] Fix concatenations of string literals that are not C++11-compliant
44         https://bugs.webkit.org/show_bug.cgi?id=116449
45
46         Reviewed by Martin Robinson.
47
48         Fix the problematic concatenations of string literals so they are compilable under the C++11 standard. This
49         is simply a matter of separating the string and the string literal that are being concatenated with a space.
50
51         * UIProcess/API/gtk/tests/TestPrinting.cpp:
52         (testPrintOperationPrint):
53         * UIProcess/API/gtk/tests/WebExtensionTest.cpp:
54         (methodCallCallback):
55
56 2013-05-20  Commit Queue  <commit-queue@webkit.org>
57
58         Unreviewed, rolling out r150384.
59         http://trac.webkit.org/changeset/150384
60         https://bugs.webkit.org/show_bug.cgi?id=116513
61
62         Not ready for primetime. (Requested by kling on #webkit).
63
64         * UIProcess/WebProcessProxy.cpp:
65         (WebKit::WebProcessProxy::WebProcessProxy):
66         (WebKit::WebProcessProxy::removeWebPage):
67         * UIProcess/WebProcessProxy.h:
68         (WebProcessProxy):
69
70 2013-05-20  Martin Robinson  <mrobinson@igalia.com>
71
72         Remove SharedMemoryGtk.cpp
73         https://bugs.webkit.org/show_bug.cgi?id=116457
74
75         Reviewed by Andreas Kling.
76
77         * Platform/gtk/SharedMemoryGtk.cpp: Removed.
78
79 2013-05-20  Jessie Berlin  <jberlin@apple.com>
80
81         Expose a way to know when forms are added to a page or when form controls are added to a form
82         in the injected bundle
83         https://bugs.webkit.org/show_bug.cgi?id=116334
84
85         Reviewed by Alexey Proskuryakov.
86
87         Add shouldNotifyOnFormChanges and didAssociateFormControls to the WKBundlePageFormClient.
88
89         * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
90         Add the new callbacks as part of version 2 of the WKBundlePageFormClient.
91
92         * WebProcess/InjectedBundle/InjectedBundlePageFormClient.cpp:
93         (WebKit::InjectedBundlePageFormClient::didAssociateFormControls):
94         Pass the message along to the client if the client has a handler.
95         (WebKit::InjectedBundlePageFormClient::shouldNotifyOnFormChanges):
96         Ditto.
97         * WebProcess/InjectedBundle/InjectedBundlePageFormClient.h:
98
99         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
100         (WebKit::WebChromeClient::didAssociateFormControls):
101         Tell the injected bundle form client for the page.
102         (WebKit::WebChromeClient::shouldNotifyOnFormChanges):
103         Ditto.
104         * WebProcess/WebCoreSupport/WebChromeClient.h:
105
106 2013-05-20  Tim Horton  <timothy_horton@apple.com>
107
108         Clients should have a way to extend rendering suppression
109         https://bugs.webkit.org/show_bug.cgi?id=116463
110         <rdar://problem/13738496>
111
112         Reviewed by Andy Estes.
113
114         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
115         (WKBundlePageExtendIncrementalRenderingSuppression): Added.
116         (WKBundlePageStopExtendingIncrementalRenderingSuppression): Added.
117         * WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h:
118         These only have any effect if SuppressesIncrementalRendering is also enabled.
119
120         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
121         (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage):
122         Inform the FrameView if there are any outstanding rendering suppression tokens.
123
124         * WebProcess/WebPage/WebPage.cpp:
125         (WebKit::WebPage::WebPage):
126         (WebKit::WebPage::extendIncrementalRenderingSuppression):
127         Return the next available rendering suppression token.
128         Add it to the list of active tokens.
129         Inform the FrameView that we want to suppress rendering.
130
131         (WebKit::WebPage::stopExtendingIncrementalRenderingSuppression):
132         Remove the given token from the list of active tokens.
133         Un-suppress rendering if appropriate.
134
135         * WebProcess/WebPage/WebPage.h:
136         (WebKit::WebPage::shouldExtendIncrementalRenderingSuppression):
137         Return if there are any active rendering suppression tokens.
138
139 2013-05-20  Andreas Kling  <akling@apple.com>
140
141         PPT: Closing tab that is hung or chewing 100% CPU leaves abandoned WebProcess.
142         <http://webkit.org/b/116464>
143         <rdar://problem/10103795>
144
145         Reviewed by Anders Carlsson.
146
147         Give the web process a 10 second chance to exit nicely after closing the last tab belonging to it.
148         This code only runs if there was something on the page (e.g an unload/beforeunload event handler)
149         preventing the UI process from killing it right away.
150
151         * UIProcess/WebProcessProxy.cpp:
152         (WebKit::WebProcessProxy::WebProcessProxy):
153         (WebKit::WebProcessProxy::removeWebPage):
154         (WebKit::WebProcessProxy::forcefulTerminationTimerFired):
155         * UIProcess/WebProcessProxy.h:
156         (WebProcessProxy):
157
158 2013-05-20  Anders Carlsson  <andersca@apple.com>
159
160         Add helper function for converting a KeyedCodingValue to a CFTypeRef
161         https://bugs.webkit.org/show_bug.cgi?id=116461
162
163         Reviewed by Tim Horton.
164
165         * Shared/cf/KeyedCodingValueCF.cpp: Added.
166         * Shared/cf/KeyedCodingValueCF.h: Added.
167
168         * WebKit2.xcodeproj/project.pbxproj:
169
170 2013-05-20  Anders Carlsson  <andersca@apple.com>
171
172         Begin stubbing out a new KeyedEncoder class
173         https://bugs.webkit.org/show_bug.cgi?id=116456
174
175         Reviewed by Sam Weinig.
176
177         This class (and it's coming counterpart, KeyedDecoder) will be used for serializing
178         object graphs to a tree-like structure of dictionaries. It is up to individual ports to
179         serialize them further (for example, on Mac they could be serialized to CFPropertyList objects).
180         
181         This will be used for serializing session storage state but I hope that it can be used for serializing
182         back forward state in the future as our current implementation of back forward state serialization
183         is fragile and depends on our IPC layer's binary encoding(!).
184         
185         * Shared/KeyedCodingValue.h: Added.
186         * Shared/KeyedEncoder.cpp: Added.
187         * Shared/KeyedEncoder.h: Added.
188
189         * WebKit2.xcodeproj/project.pbxproj:
190
191 2013-05-19  Sam Weinig  <sam@webkit.org>
192
193         Bump WKBundlePageLoaderClient version number so as not to break some clients
194         https://bugs.webkit.org/show_bug.cgi?id=116426
195
196         Reviewed by Anders Carlsson.
197
198         * Shared/APIClientTraits.cpp:
199         (WebKit):
200         * Shared/APIClientTraits.h:
201         * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
202
203 2013-05-19  Anders Carlsson  <andersca@apple.com>
204
205         Remove link prerendering code
206         https://bugs.webkit.org/show_bug.cgi?id=116415
207
208         Reviewed by Darin Adler.
209
210         This code was only used by Chromium and is dead now.
211
212         * Configurations/FeatureDefines.xcconfig:
213
214 2013-05-18  Anders Carlsson  <andersca@apple.com>
215
216         Simplify the StorageArea setter functions
217         https://bugs.webkit.org/show_bug.cgi?id=116402
218
219         Reviewed by Sam Weinig.
220
221         Remove security checking code that lives in Storage now.
222
223         * WebProcess/Storage/StorageAreaImpl.cpp:
224         (WebKit::StorageAreaImpl::setItem):
225         (WebKit::StorageAreaImpl::removeItem):
226         (WebKit::StorageAreaImpl::clear):
227         * WebProcess/Storage/StorageAreaImpl.h:
228
229 2013-05-18  Sam Weinig  <sam@webkit.org>
230
231         Fix some builds.
232
233         * UIProcess/API/mac/WKTypeRefWrapper.mm:
234
235 2013-05-18  Carlos Garcia Campos  <cgarcia@igalia.com>
236
237         REGRESSION(r150305): WebKit2 build broken with INDEXED_DATABASE enabled
238         https://bugs.webkit.org/show_bug.cgi?id=116389
239
240         Reviewed by Martin Robinson.
241
242         There's no longer WebKeyValueStorageManager in the web process
243         after r150305.
244
245         * WebProcess/WebPage/WebPageGroupProxy.cpp:
246         (WebKit::WebPageGroupProxy::WebPageGroupProxy):
247
248 2013-05-17  Sam Weinig  <sam@webkit.org>
249
250         Add a way to pass WebKit2 WKTypeRefs in Objective-C style user data messages
251         https://bugs.webkit.org/show_bug.cgi?id=116345
252
253         Reviewed by Anders Carlsson.
254
255         In order to efficiently send a WKImageRef to another process when using the
256         Objective-C WKConnection (or other user data messages), we need a way to encode
257         WKTypeRefs in the objective-c object graph. Thus was born WKTypeRefWrapper.
258
259         * Shared/mac/ObjCObjectGraphCoders.mm:
260         (WebKit::typeFromObject):
261         (WebKit::WebContextObjCObjectGraphEncoderImpl::encode):
262         (WebKit::WebContextObjCObjectGraphDecoderImpl::decode):
263         (WebKit::InjectedBundleObjCObjectGraphEncoderImpl::encode):
264         (WebKit::InjectedBundleObjCObjectGraphDecoderImpl::decode):
265         * UIProcess/API/mac/WKTypeRefWrapper.h: Added.
266         * UIProcess/API/mac/WKTypeRefWrapper.mm: Added.
267         (-[WKTypeRefWrapper initWithObject:]):
268         (-[WKTypeRefWrapper object]):
269         * WebKit2.xcodeproj/project.pbxproj:
270
271 2013-05-18  Anders Carlsson  <andersca@apple.com>
272
273         Simplify StorageArea getter functions
274         https://bugs.webkit.org/show_bug.cgi?id=116399
275
276         Reviewed by Sam Weinig.
277
278         Remove security and private browsing checks.
279
280         * WebProcess/Storage/StorageAreaImpl.cpp:
281         (WebKit::StorageAreaImpl::key):
282         (WebKit::StorageAreaImpl::item):
283         (WebKit::StorageAreaImpl::contains):
284         * WebProcess/Storage/StorageAreaImpl.h:
285
286 2013-05-18  Patrick Gansterer  <paroga@webkit.org>
287
288         [CMake] Replace *_LIBRARY_NAME with *_OUTPUT_NAME
289         https://bugs.webkit.org/show_bug.cgi?id=114554
290
291         Reviewed by Gyuyoung Kim.
292
293         Using variables as target names is very uncommon in CMake.
294         The usual way to specify the name of the resulting binary
295         is to set the OUTPUT_NAME target property.
296
297         * CMakeLists.txt:
298         * PlatformEfl.cmake:
299         * efl/ewebkit2.pc.in:
300
301 2013-05-18  Carlos Garcia Campos  <cgarcia@igalia.com>
302
303         [GTK] Move GTK port off legacy clipboard
304         https://bugs.webkit.org/show_bug.cgi?id=116221
305
306         Reviewed by Martin Robinson.
307
308         * UIProcess/API/gtk/WebKitWebViewBase.cpp: Remove ClipboardGtk.h
309         include.
310         * WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp:
311         (WebKit::WebDragClient::startDrag): Get the DataObjectGtk from the
312         Pasteboard associated to the given Clipboard.
313
314 2013-05-18  Jinwoo Song  <jinwoo7.song@samsung.com>
315
316         [EFL][WK2] Refactor ewk_view_custom_encoding_set/get API
317         https://bugs.webkit.org/show_bug.cgi?id=116386
318
319         Reviewed by Christophe Dumez.
320
321         Refactor the API to handle 'const char*' parameter in right way and
322         enable the unit test which was disabled in r136230 as there is no assertion now.
323
324         * UIProcess/API/efl/EwkView.cpp:
325         (EwkView::setCustomTextEncodingName):
326         * UIProcess/API/efl/EwkView.h:
327         (EwkView::customTextEncodingName):
328         (EwkView):
329         * UIProcess/API/efl/ewk_view.cpp:
330         (ewk_view_custom_encoding_set):
331         * UIProcess/API/efl/tests/test_ewk2_view.cpp:
332         (TEST_F):
333
334 2013-05-18  Csaba Osztrogonác  <ossy@webkit.org>
335
336         [CMake] Unreviewed speculative build fix after r150305 and r150306.
337
338         * CMakeLists.txt:
339
340 2013-05-18  Csaba Osztrogonác  <ossy@webkit.org>
341
342         [Qt][WK2] Unreviewed build fix after r150305 and r150306.
343
344         * DerivedSources.pri:
345         * Target.pri:
346
347 2013-05-18  Zan Dobersek  <zdobersek@igalia.com>
348
349         Unreviewed build fix for the GTK port after r150305 and r150306.
350
351         * GNUmakefile.list.am:
352
353 2013-05-17  Alexey Proskuryakov  <ap@apple.com>
354
355         <rdar://problem/13819878> Disable SharedWorker when in multiple web process model
356         https://bugs.webkit.org/show_bug.cgi?id=116359
357
358         The condition was accidentally negated, fixing.
359
360         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
361         (WebKit::WebPlatformStrategies::isAvailable):
362
363 2013-05-17  Gavin Barraclough  <barraclough@apple.com>
364
365         Only allow 1 WebProcess to hold a PageCache
366         https://bugs.webkit.org/show_bug.cgi?id=116368
367         <rdar://problem/13392600>
368
369         Reviewed by Geoff Garen & Anders Carlson.
370
371         * UIProcess/WebContext.cpp:
372         (WebKit::WebContext::WebContext):
373         (WebKit::WebContext::processDidSaveToPageCache):
374         (WebKit):
375         (WebKit::WebContext::disconnectProcess):
376         * UIProcess/WebContext.h:
377             - Added m_processWithPageCache, only allow one process to keep a PageCache.
378         (WebContext):
379         * UIProcess/WebPageProxy.cpp:
380         (WebKit::WebPageProxy::didSaveToPageCache):
381         (WebKit):
382         * UIProcess/WebPageProxy.h:
383         (WebPageProxy):
384         * UIProcess/WebPageProxy.messages.in:
385             - Forward didSaveToPageCache to the WebProcessProxy.
386         * UIProcess/WebProcessProxy.cpp:
387         (WebKit::WebProcessProxy::addBackForwardItem):
388         (WebKit::WebProcessProxy::didSaveToPageCache):
389         (WebKit):
390         (WebKit::WebProcessProxy::releasePageCache):
391             - Forward releasePageCache to the WebProcess.
392             - Forward didSaveToPageCache to the WebContext.
393         * UIProcess/WebProcessProxy.h:
394         (WebProcessProxy):
395         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
396         (WebKit::WebFrameLoaderClient::didSaveToPageCache):
397             - Forward didSaveToPageCache to the WebPageProxy.
398         * WebProcess/WebProcess.cpp:
399         (WebKit::WebProcess::releasePageCache):
400         (WebKit):
401         * WebProcess/WebProcess.h:
402         (WebProcess):
403         * WebProcess/WebProcess.messages.in:
404             - Added 'ReleasePageCache' to instruct a web process to drop any cached pages.
405
406 2013-05-17  Anders Carlsson  <andersca@apple.com>
407
408         Share code between WebKit1 and WebKit2 StorageArea subclasses
409         https://bugs.webkit.org/show_bug.cgi?id=116367
410
411         Reviewed by Andreas Kling.
412
413         * WebProcess/Storage/StorageAreaImpl.cpp:
414         (WebKit::StorageAreaImpl::length):
415         Remove code that's now in Storage::length.
416
417         (WebKit::StorageAreaImpl::storageType):
418         Make this a virtual member function.
419
420         * WebProcess/Storage/StorageAreaImpl.h:
421
422 2013-05-17  Alexey Proskuryakov  <ap@apple.com>
423
424         <rdar://problem/13819878> Disable SharedWorker when in multiple web process model
425         https://bugs.webkit.org/show_bug.cgi?id=116359
426
427         Reviewed by Anders Carlsson.
428
429         Implement SharedWorkerStrategy::isAvailable.
430
431         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
432         (WebKit::WebPlatformStrategies::isAvailable):
433         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
434
435 2013-05-17  Beth Dakin  <bdakin@apple.com>
436
437         Headers and footers will sometimes disappear and re-appear during page loads
438         https://bugs.webkit.org/show_bug.cgi?id=116336
439         -and corresponding-
440         <rdar://problem/13886753>
441
442         Reviewed by Simon Fraser.
443
444         This patch changes the WebCore-level API that WebKit uses to create a banner. 
445         Specifically this patch removes FrameView::setWantsLayerForHeader(), which created 
446         and returned a layer. Instead, WK2 will call Page::addHeaderWithHeight(). When the 
447         layer has been created, it will call back into WK2 via ChromeClient. This will 
448         allow WebCore to re-create the header/footer layers as needed whenever the 
449         FrameView/RenderLayerCompositor have been destroyed and recreated.
450
451         Send the layers over to PageBanner.
452         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
453         (WebKit::WebChromeClient::didAddHeaderLayer):
454         (WebKit::WebChromeClient::didAddFooterLayer):
455         * WebProcess/WebCoreSupport/WebChromeClient.h:
456         (WebChromeClient):
457
458         PageBanner::addToPage() now does much less work since it can’t get the parent 
459         layer right away. The work that is used to do once it had the parent layer is now 
460         performed in didAddParentLayer()
461         * WebProcess/WebPage/PageBanner.cpp:
462         (WebKit::PageBanner::didAddParentLayer):
463         * WebProcess/WebPage/PageBanner.h:
464         * WebProcess/WebPage/mac/PageBannerMac.mm:
465         (WebKit::PageBanner::addToPage):
466         (WebKit::PageBanner::didAddParentLayer):
467
468 2013-05-17  Anders Carlsson  <andersca@apple.com>
469
470         Rename WebKeyValueStorageManagerProxy to WebKeyValueStorageManager
471         https://bugs.webkit.org/show_bug.cgi?id=116361
472
473         Reviewed by Andreas Kling.
474
475         There's nothing proxy about this class anymore!
476
477         * UIProcess/API/C/WKAPICast.h:
478         * UIProcess/API/C/WKContext.cpp:
479         * UIProcess/API/C/WKKeyValueStorageManager.cpp:
480         * UIProcess/WebKeyValueStorageManager.cpp: Renamed from Source/WebKit2/UIProcess/WebKeyValueStorageManagerProxy.cpp.
481         * UIProcess/WebKeyValueStorageManager.h: Renamed from Source/WebKit2/UIProcess/WebKeyValueStorageManagerProxy.h.
482         * WebKit2.xcodeproj/project.pbxproj:
483
484 2013-05-17  Anders Carlsson  <andersca@apple.com>
485
486         Remove dead local storage code
487         https://bugs.webkit.org/show_bug.cgi?id=116360
488
489         Reviewed by Beth Dakin.
490
491         Storage is all handled in the UI process now so we no longer need a WebKeyValueStorageManager in the web process.
492
493         * DerivedSources.make:
494         * UIProcess/WebKeyValueStorageManagerProxy.cpp:
495         (WebKit::WebKeyValueStorageManagerProxy::WebKeyValueStorageManagerProxy):
496         (WebKit):
497         (WebKit::didGetKeyValueStorageOrigins):
498         (WebKit::WebKeyValueStorageManagerProxy::getKeyValueStorageOrigins):
499         * UIProcess/WebKeyValueStorageManagerProxy.h:
500         (WebKeyValueStorageManagerProxy):
501         * UIProcess/WebKeyValueStorageManagerProxy.messages.in: Removed.
502         * WebKit2.xcodeproj/project.pbxproj:
503         * WebProcess/Storage/WebKeyValueStorageManager.cpp: Removed.
504         * WebProcess/Storage/WebKeyValueStorageManager.h: Removed.
505         * WebProcess/Storage/WebKeyValueStorageManager.messages.in: Removed.
506         * WebProcess/WebPage/WebPage.cpp:
507         (WebKit::WebPage::updatePreferences):
508         * WebProcess/WebProcess.cpp:
509         (WebKit::WebProcess::WebProcess):
510
511 2013-05-17  Anders Carlsson  <andersca@apple.com>
512
513         Use the UI process storage manager for deleting local storage data
514         https://bugs.webkit.org/show_bug.cgi?id=116358
515         <rdar://problem/13852829>
516
517         Reviewed by Andreas Kling.
518
519         * Shared/WebSecurityOrigin.h:
520         (WebKit::WebSecurityOrigin::protocol):
521         (WebKit::WebSecurityOrigin::host):
522         (WebKit::WebSecurityOrigin::databaseIdentifier):
523         (WebKit::WebSecurityOrigin::toString):
524         Remove unneeded consts.
525
526         (WebKit::WebSecurityOrigin::securityOrigin):
527         Add getter.
528
529         * UIProcess/Storage/LocalStorageDatabase.cpp:
530         (WebKit::LocalStorageDatabase::close):
531         deleteEmptyDatabaseWithOrigin has been renamed to deleteDatabaseWithOrigin.
532
533         * UIProcess/Storage/LocalStorageDatabaseTracker.cpp:
534         (WebKit::LocalStorageDatabaseTracker::deleteDatabaseWithOrigin):
535         Rename since this is no longer used only for empty databases.
536
537         (WebKit::LocalStorageDatabaseTracker::deleteAllDatabases):
538         Loop over the tracker database and delete all database files.
539
540         * UIProcess/Storage/StorageManager.cpp:
541         (WebKit::StorageManager::StorageArea::clear):
542         Clear the map, close the database and tell all event listeners to reset their caches.
543
544         (WebKit::StorageManager::LocalStorageNamespace::clearStorageAreasMatchingOrigin):
545         Loop over all storage areas and call clear on those matching the security origin.
546
547         (WebKit::StorageManager::LocalStorageNamespace::clearAllStorageAreas):
548         Loop over all storage areas and call clear on them.
549         
550         (WebKit::StorageManager::deleteEntriesForOrigin):
551         Dispatch deleteEntriesForOriginInternal on the work queue.
552
553         (WebKit::StorageManager::deleteAllEntries):
554         Dispatch deleteAllEntriesInternal on the work queue.
555
556         (WebKit::StorageManager::deleteEntriesForOriginInternal):
557         Call clearStorageAreasMatchingOrigin on all local storage namespaces and then delete the database.
558
559         (WebKit::StorageManager::deleteAllEntriesInternal):
560         Call clearAllStorageAreas on all local storage namespaces and then delete all databases.
561
562         * UIProcess/WebKeyValueStorageManagerProxy.cpp:
563         (WebKit::WebKeyValueStorageManagerProxy::deleteEntriesForOrigin):
564         Call out to the storage manager.
565
566         (WebKit::WebKeyValueStorageManagerProxy::deleteAllEntries):
567         Ditto.
568
569         * WebProcess/Storage/StorageAreaMap.cpp:
570         (WebKit::StorageAreaMap::clearCache):
571         Call resetValues which will null out the storage map.
572
573         * WebProcess/Storage/StorageAreaMap.messages.in:
574         Add ClearCache message.
575
576 2013-05-17  Anders Carlsson  <andersca@apple.com>
577
578         Only import local storage items from the database once
579         https://bugs.webkit.org/show_bug.cgi?id=116354
580
581         Reviewed by Andreas Kling.
582
583         We import items from the database over and over, when we only want to do it once. Use a 
584         boolean flag to guard against doing it more than once. 
585         
586         Also, rename importItemsFromDatabase to openDatabaseAndImportItemsIfNeeded since it now
587         also opens the database (even if it doesn't need to import anything). This is preparation for an
588         upcoming patch where the database will be closed when it's cleared.
589
590         * UIProcess/Storage/StorageManager.cpp:
591         (StorageManager::StorageArea):
592         (WebKit::StorageManager::StorageArea::StorageArea):
593         (WebKit::StorageManager::StorageArea::setItem):
594         (WebKit::StorageManager::StorageArea::removeItem):
595         (WebKit::StorageManager::StorageArea::clear):
596         (WebKit::StorageManager::StorageArea::items):
597         (WebKit::StorageManager::StorageArea::openDatabaseAndImportItemsIfNeeded):
598
599 2013-05-17  Alexey Proskuryakov  <ap@apple.com>
600
601         <rdar://problem/13869765> Lion: Crashes in islcCanLoadInputMethodFromBundleID.
602
603         Reviewed by Anders Carlsson.
604
605         * WebProcess/com.apple.WebProcess.sb.in: Allow text input directories.
606
607 2013-05-17  Anders Carlsson  <andersca@apple.com>
608
609         WKKeyValueStorageManagerGetKeyValueStorageOrigins should get origins from the UI process
610         https://bugs.webkit.org/show_bug.cgi?id=116346
611         <rdar://problem/13852829>
612
613         Reviewed by Andreas Kling.
614
615         * UIProcess/Storage/LocalStorageDatabaseTracker.cpp:
616         (WebKit::LocalStorageDatabaseTracker::origins):
617         New helper function to return all the tracked origins.
618
619         * UIProcess/Storage/StorageManager.cpp:
620         (WebKit::StorageManager::StorageManager):
621         Initialize the UTF-8 encoding.
622
623         (WebKit::StorageManager::getOrigins):
624         Call getOriginsInternal on our queue.
625
626         (WebKit::callCallbackFunction):
627         Helper function for calling the callback function.
628
629         (WebKit::StorageManager::getOriginsInternal):
630         Get the origins and make sure we call the callback with the given function dispatcher.
631
632         * UIProcess/WebKeyValueStorageManagerProxy.cpp:
633         (WebKit::didGetKeyValueStorageOriginsCallback):
634         Construct the array of WebSecurityOrigin objects and call the callback.
635
636         (WebKit::WebKeyValueStorageManagerProxy::getKeyValueStorageOrigins):
637         Call StorageManager::getOrigins.
638
639 2013-05-16  Alexey Proskuryakov  <ap@apple.com>
640
641         Text input is largely broken when there are subframes loading
642         http://bugs.webkit.org/show_bug.cgi?id=59121
643         <rdar://problem/9320468>
644
645         Reviewed by Darin Adler.
646
647         * UIProcess/PageClient.h:
648         * UIProcess/API/mac/PageClientImpl.h:
649         * UIProcess/API/mac/PageClientImpl.mm:
650         (WebKit::PageClientImpl::updateSecureInputState): Separated secure input state
651         updating into a separate function. Removed updateTextInputState, we don't need
652         to go through PageClient to implement its behavior at all.
653         (WebKit::PageClientImpl::dismissDictionaryLookupPanel): Added a FIXME.
654
655         * UIProcess/API/mac/WKView.mm:
656         * UIProcess/API/mac/WKViewInternal.h:
657         Removed _updateTextInputStateIncludingSecureInputState.
658
659         * UIProcess/WebPageProxy.h: Added m_temporarilyClosedComposition, which helps
660         to figure out that WebCore decided to close a composition. The issue is that WebCore
661         would first send an EditorState with hasComposition set to false, and with
662         shouldIgnoreCompositionSelectionChange set to true, at which time we forget the
663         previous m_editorState, but can't make any decisions based on this transient state.
664         We should find a way to simplify this (maybe not send these updates with
665         shouldIgnoreCompositionSelectionChange at all?)
666
667         * UIProcess/WebPageProxy.cpp:
668         (WebKit::WebPageProxy::WebPageProxy): Initialize m_temporarilyClosedComposition.
669         (WebKit::WebPageProxy::didCommitLoadForFrame): Removed the code to kill a composition
670         when any frame commits a load, which made no sense (along with surrounding code,
671         which will unfortunately survive longer).
672         (WebKit::WebPageProxy::editorStateChanged): Implemented state updating here,
673         we don't need to go to WKView.mm to implement this logic. Figure out when WebCore
674         discards a composition, and notify input methods about this.
675         (WebKit::WebPageProxy::resetStateAfterProcessExited): Reset m_temporarilyClosedComposition.
676         Added some FIXMEs.
677
678 2013-05-17  Manuel Rego Casasnovas  <rego@igalia.com>
679
680         [WK2] Add support for selectTrailingWhitespaceEnabled setting
681         https://bugs.webkit.org/show_bug.cgi?id=112426
682
683         Reviewed by Ryosuke Niwa.
684
685         * Shared/WebPreferencesStore.h:
686         (WebKit): Add macro for selectTrailingWhitespaceEnabled.
687         * UIProcess/API/C/WKPreferences.cpp:
688         (WKPreferencesSetSelectTrailingWhitespaceEnabled):
689         (WKPreferencesGetSelectTrailingWhitespaceEnabled): Implement methods
690         using the new setting.
691         * UIProcess/API/C/WKPreferencesPrivate.h: Add new methods headers.
692         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
693         (WebKit::WebEditorClient::isSelectTrailingWhitespaceEnabled): Implement
694         method delegating in WebPage.
695         * WebProcess/WebPage/WebPage.cpp:
696         (WebKit::WebPage::updatePreferences): Set
697         selectTrailingWhitespaceEnabled setting.
698         (WebKit::WebPage::setSmartInsertDeleteEnabled): Set
699         selectTrailingWhitespaceEnabled as they are mutually exclusive.
700         (WebKit):
701         (WebKit::WebPage::isSelectTrailingWhitespaceEnabled): Implement method
702         using settings.
703         (WebKit::WebPage::setSelectTrailingWhitespaceEnabled): Implement method
704         using settings and set smartInsertDeleteEnabled as they are mutually
705         exclusive.
706         * WebProcess/WebPage/WebPage.h:
707         (WebPage): Add new methods headers.
708
709 2013-05-17  Brady Eidson  <beidson@apple.com>
710
711         Fix crash introduced by http://trac.webkit.org/changeset/150282
712         Followup to https://bugs.webkit.org/show_bug.cgi?id=116253
713
714         Reviewed by Andreas Kling.
715
716         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
717         (WebKit::WebChromeClient::focusedFrameChanged): Frame might be null.
718
719 2013-05-17  Brady Eidson  <beidson@apple.com>
720
721         Replace WebFrameLoaderClient static_casts with a function that might return null.
722         https://bugs.webkit.org/show_bug.cgi?id=116253
723
724         The general approach here is:
725         1 - Introduce a toWebFrameLoaderClient() function to convert FrameLoaderClients, and that may return null.
726         2 - Adopt toWebFrameLoaderClient() everywhere we used to do a direct static_cast<WebFrameLoaderClient*>
727         3 - In functions that already support a "return 0" scenario, a failed cast results in a return 0.
728         4 - In other functions that assume no failure to get the WebFrameLoaderClient, add an ASSERT.
729
730         Reviewed by Alexey Proskuryakov.
731
732         Add the utility function to cast:
733         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
734         (WebKit::toWebFrameLoaderClient):
735
736         Adopt it everywhere:
737         * WebProcess/Geolocation/GeolocationPermissionRequestManager.cpp:
738         (WebKit::GeolocationPermissionRequestManager::startRequestForGeolocation):
739
740         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
741         (WebKit::InjectedBundleNodeHandle::documentFrame):
742         (WebKit::InjectedBundleNodeHandle::htmlFrameElementContentFrame):
743         (WebKit::InjectedBundleNodeHandle::htmlIFrameElementContentFrame):
744
745         * WebProcess/InjectedBundle/InjectedBundle.cpp:
746         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
747
748         * WebProcess/InjectedBundle/InjectedBundleDOMWindowExtension.cpp:
749         (WebKit::InjectedBundleDOMWindowExtension::frame):
750
751         * WebProcess/InjectedBundle/InjectedBundleHitTestResult.cpp:
752         (WebKit::InjectedBundleHitTestResult::frame):
753         (WebKit::InjectedBundleHitTestResult::targetFrame):
754
755         * WebProcess/Network/WebResourceLoadScheduler.cpp:
756         (WebKit::WebResourceLoadScheduler::scheduleLoad):
757
758         * WebProcess/Plugins/PluginView.cpp:
759         (WebKit::webPage):
760         (WebKit::PluginView::performFrameLoadURLRequest):
761
762         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
763         (WebKit::WebChromeClient::focusedNodeChanged):
764         (WebKit::WebChromeClient::focusedFrameChanged):
765         (WebKit::WebChromeClient::runBeforeUnloadConfirmPanel):
766         (WebKit::WebChromeClient::runJavaScriptAlert):
767         (WebKit::WebChromeClient::runJavaScriptConfirm):
768         (WebKit::WebChromeClient::runJavaScriptPrompt):
769         (WebKit::WebChromeClient::print):
770         (WebKit::WebChromeClient::exceededDatabaseQuota):
771         (WebKit::WebChromeClient::runOpenPanel):
772
773         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
774         (WebKit::WebEditorClient::textFieldDidBeginEditing):
775         (WebKit::WebEditorClient::textFieldDidEndEditing):
776         (WebKit::WebEditorClient::textDidChangeInTextField):
777         (WebKit::WebEditorClient::textDidChangeInTextArea):
778         (WebKit::WebEditorClient::doTextFieldCommandFromEvent):
779         (WebKit::WebEditorClient::textWillBeDeletedInTextField):
780
781         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
782         (WebKit::WebFrameLoaderClient::dispatchWillSendSubmitEvent):
783         (WebKit::WebFrameLoaderClient::dispatchWillSubmitForm):
784
785         * WebProcess/WebPage/WebFrame.cpp:
786         (WebKit::WebFrame::contentsAsString):
787         (WebKit::WebFrame::parentFrame):
788         (WebKit::WebFrame::childFrames):
789         (WebKit::WebFrame::frameForContext):
790         (WebKit::WebFrameFilter::shouldIncludeSubframe):
791
792         * WebProcess/WebPage/WebPage.cpp:
793         (WebKit::WebPage::mainFrameHasCustomRepresentation):
794
795 2013-05-17  Sam Weinig  <sam@webkit.org>
796
797         Expose new load-with-userData API to Objective-C
798         https://bugs.webkit.org/show_bug.cgi?id=116335
799
800         Reviewed by Anders Carlsson.
801
802         - Adds loadRequest:userData:, loadFileURL:restrictToFilesWithin:userData:, loadHTMLString:baseURL:userData:
803           loadData:MIMEType:textEncodingName:baseURL:, and loadData:MIMEType:textEncodingName:baseURL:userData.
804         - Adds a WKObjCTypeWrapperRef (which is a ObjCObjectGraph under the covers) to allow the userData to be unwrapped
805           in the injected bundles willLoadURLRequest and willLoadDataRequest C-SPI callbacks.
806
807         * Shared/API/c/WKBase.h:
808         * Shared/API/c/WKSharedAPICast.h:
809         * Shared/API/c/mac/WKBaseMac.h: Added.
810         * Shared/API/c/mac/WKObjCTypeWrapperRef.h: Added.
811         * Shared/API/c/mac/WKObjCTypeWrapperRef.mm: Added.
812         (WKObjCTypeWrapperGetTypeID):
813         (WKObjCTypeWrapperCreate):
814         (WKObjCTypeWrapperGetObject):
815         * UIProcess/API/mac/WKBrowsingContextController.h:
816         * UIProcess/API/mac/WKBrowsingContextController.mm:
817         (+[WKBrowsingContextController registerSchemeForCustomProtocol:]):
818         (+[WKBrowsingContextController unregisterSchemeForCustomProtocol:]):
819         (-[WKBrowsingContextController loadRequest:]):
820         (-[WKBrowsingContextController loadRequest:userData:]):
821         (-[WKBrowsingContextController loadFileURL:restrictToFilesWithin:]):
822         (-[WKBrowsingContextController loadFileURL:restrictToFilesWithin:userData:]):
823         (-[WKBrowsingContextController loadHTMLString:baseURL:]):
824         (-[WKBrowsingContextController loadHTMLString:baseURL:userData:]):
825         (-[WKBrowsingContextController loadData:MIMEType:textEncodingName:baseURL:]):
826         (-[WKBrowsingContextController loadData:MIMEType:textEncodingName:baseURL:userData:]):
827         * WebKit2.xcodeproj/project.pbxproj:
828
829 2013-05-17  Sam Weinig  <sam@webkit.org>
830
831         Add WKPageLoadData and WKPageLoadDataWithUserData SPI to support loading arbitrary data blobs
832         https://bugs.webkit.org/show_bug.cgi?id=116325
833
834         Reviewed by Simon Fraser.
835
836         * UIProcess/API/C/WKPage.cpp:
837         (WKPageLoadData):
838         (WKPageLoadDataWithUserData):
839         Add new SPI.
840
841         * UIProcess/API/C/WKPage.h:
842         * UIProcess/WebPageProxy.cpp:
843         (WebKit::WebPageProxy::loadData):
844         * UIProcess/WebPageProxy.h:
845         Pipe through to the WebProcess.
846
847         * WebProcess/WebPage/WebPage.h:
848         * WebProcess/WebPage/WebPage.messages.in:
849         * WebProcess/WebPage/WebPage.cpp:
850         (WebKit::WebPage::loadDataImpl):
851         (WebKit::WebPage::loadData):
852         (WebKit::WebPage::loadHTMLString):
853         (WebKit::WebPage::loadAlternateHTMLString):
854         (WebKit::WebPage::loadPlainTextString):
855         (WebKit::WebPage::loadWebArchiveData):
856         Rename existing loadData function to loadDataImpl (I hate it) to avoid overload conflict
857         from IPC magic.
858
859
860 2013-05-17  Michał Pakuła vel Rutka  <m.pakula@samsung.com>
861
862         [EFL][WK2] Fix sub menu initialization in ewk_context_menu_item
863         https://bugs.webkit.org/show_bug.cgi?id=116321
864
865         Reviewed by Christophe Dumez.
866
867         During sub menu creation, after initializing m_parentMenu, parentMenu
868         pointer became null which may cause segfaults. This patch fixes it by
869         using m_parentMenu.
870
871         * UIProcess/API/efl/ewk_context_menu_item.cpp:
872         (EwkContextMenuItem::EwkContextMenuItem):
873
874 2013-05-17  Michał Pakuła vel Rutka  <m.pakula@samsung.com>
875
876         [EFL][WK2] Support sub menu in ewk context menus
877         https://bugs.webkit.org/show_bug.cgi?id=114729
878
879         Reviewed by Christophe Dumez.
880
881         Added submenu support in EwkContextMenu and an API function to receive
882         Ewk_Context_Menu from submenu context menu item. A test case was added
883         for new API function.
884         EwkContextMenu is now an EwkObject allowing multiple instances of submenu
885         to be used in different submenu type context menu items.
886
887         * UIProcess/API/efl/ewk_context_menu_item.cpp:
888         (EwkContextMenuItem::EwkContextMenuItem):
889         (ewk_context_menu_item_new):
890         (ewk_context_menu_item_parent_menu_get):
891         (ewk_context_menu_item_submenu_get):
892         * UIProcess/API/efl/ewk_context_menu_item.h:
893         * UIProcess/API/efl/ewk_context_menu_item_private.h:
894         (EwkContextMenuItem::create):
895         (EwkContextMenuItem::parentMenu):
896         (EwkContextMenuItem::subMenu):
897         (EwkContextMenuItem):
898         * UIProcess/API/efl/ewk_context_menu_private.h:
899         (EwkContextMenu::ewkView):
900         (EwkContextMenu):
901         * UIProcess/API/efl/tests/test_ewk2_context_menu.cpp:
902         (showContextMenu):
903
904 2013-05-17  Zoltan Arvai  <zarvai@inf.u-szeged.hu>, Ádám Kallai  <kadam@inf.u-szeged.hu>
905
906         [Qt] Unreviewed build fix.
907
908         Add missing Qt specific initializer for willLoadURLRequest and willLoadDataRequest.
909
910         * WebProcess/qt/QtBuiltinBundlePage.cpp:
911         (WebKit::QtBuiltinBundlePage::QtBuiltinBundlePage):
912
913 2013-05-16  Beth Dakin  <bdakin@apple.com>
914
915         Remove WKBundlePageGetHeaderLayer/Footer SPI
916         https://bugs.webkit.org/show_bug.cgi?id=116254
917
918         Reviewed by Benjamin Poulain.
919
920         We should remove the Remove WKBundlePageGetHeaderLayer/Footer SPI. It was only 
921         recently added and have been replaced by WKBundlePageSetHeaderBanner/Footer.
922
923         * WebKit2.xcodeproj/project.pbxproj:
924         * WebProcess/InjectedBundle/API/c/mac/WKBundlePagePrivateMac.h: Removed.
925         * WebProcess/InjectedBundle/API/c/mac/WKBundlePagePrivateMac.mm: Removed.
926         * WebProcess/WebPage/WebPage.h:
927         (WebPage):
928         * WebProcess/WebPage/mac/WebPageMac.mm:
929         (WebKit):
930         (WebKit::WebPage::updateHeaderAndFooterLayersForDeviceScaleChange):
931
932 2013-05-14  Sam Weinig  <sam@webkit.org>
933
934         Add variants of the loading APIs that take user data and a way for the injected bundle to find out about them
935         https://bugs.webkit.org/show_bug.cgi?id=116132
936
937         Reviewed by Anders Carlsson.
938
939         Adds "WithUserData" versions of all the load APIs and two new WKBundlePageLoaderClient functions,
940         willLoadURLRequest and willLoadDataRequest to let the bundle access them.
941
942         Adds WebKit2WillLoadTest.* API tests.
943
944         * UIProcess/API/C/WKPage.cpp:
945         (WKPageLoadURLWithUserData):
946         (WKPageLoadURLRequestWithUserData):
947         (WKPageLoadFile):
948         (WKPageLoadFileWithUserData):
949         (WKPageLoadHTMLStringWithUserData):
950         (WKPageLoadAlternateHTMLStringWithUserData):
951         (WKPageLoadPlainTextStringWithUserData):
952         (WKPageLoadWebArchiveDataWithUserData):
953         * UIProcess/API/C/WKPage.h:
954         * UIProcess/WebPageProxy.cpp:
955         * UIProcess/WebPageProxy.h:
956         (WebPageProxy):
957         * WebKit2.xcodeproj/project.pbxproj:
958         * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
959         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp:
960         (WebKit::InjectedBundlePageLoaderClient::willLoadURLRequest):
961         (WebKit::InjectedBundlePageLoaderClient::willLoadDataRequest):
962         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h:
963         (WebCore):
964         (InjectedBundlePageLoaderClient):
965         * WebProcess/WebPage/WebPage.cpp:
966         * WebProcess/WebPage/WebPage.h:
967         * WebProcess/WebPage/WebPage.messages.in:
968
969 2013-05-16  Manuel Rego Casasnovas  <rego@igalia.com>
970
971         [GTK] Fix memory leak in WebKitBackForwardList
972         https://bugs.webkit.org/show_bug.cgi?id=116222
973
974         Reviewed by Carlos Garcia Campos.
975
976         Due to the use of leakRef() the ImmutableArray is not being released
977         automatically. Adding a local variable in the methods to make sure that
978         the ImmutableArray is freed.
979
980         * UIProcess/API/gtk/WebKitBackForwardList.cpp:
981         (webkit_back_forward_list_get_back_list_with_limit): Add local variable
982         RefPtr and pass the ImmutableArray to
983         WebKitBackForwardList::webkitBackForwardListCreateList() using
984         RefPtr::get().
985         (webkit_back_forward_list_get_forward_list_with_limit): Ditto.
986
987 2013-05-16  Commit Queue  <commit-queue@webkit.org>
988
989         Unreviewed, rolling out r150034.
990         http://trac.webkit.org/changeset/150034
991         https://bugs.webkit.org/show_bug.cgi?id=116257
992
993         This work around doesn't work due to another bug NSUndoManager
994         has (Requested by rniwa on #webkit).
995
996         * UIProcess/API/mac/PageClientImpl.mm:
997         (WebKit::PageClientImpl::registerEditCommand):
998
999 2013-05-16  Tim Horton  <timothy_horton@apple.com>
1000
1001         PDFPlugins don't load when plugins are disabled, but they should
1002         https://bugs.webkit.org/show_bug.cgi?id=75790
1003         <rdar://problem/11650197>
1004
1005         Reviewed by Anders Carlsson.
1006
1007         Support loading "application" plug-ins even if plug-ins are explicitly disabled.
1008
1009         Make PDFPlugin and SimplePDFPlugin "application" plug-ins, so they can
1010         be loaded even if plug-ins are disabled.
1011
1012         * Platform/CoreIPC/HandleMessage.h:
1013         (CoreIPC::callMemberFunction):
1014         Add a 5-argument, 3-reply version of callMemberFunction.
1015
1016         * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
1017         (WebKit::NetscapePluginModule::getPluginInfo):
1018         NPAPI plug-ins are not application plug-ins.
1019
1020         * Shared/WebCoreArgumentCoders.cpp:
1021         (CoreIPC::::encode):
1022         (CoreIPC::::decode):
1023         Encode/decode the new isApplicationPlugin field on PluginInfo.
1024
1025         * UIProcess/Plugins/PluginInfoStore.cpp:
1026         (WebKit::PluginInfoStore::findPluginForMIMEType):
1027         (WebKit::PluginInfoStore::findPluginForExtension):
1028         (WebKit::PluginInfoStore::findPlugin):
1029         * UIProcess/Plugins/PluginInfoStore.h:
1030         (PluginInfoStore):
1031         Give PluginInfoStore's findPlugin method and its private helper
1032         methods an argument allowing them to only match application plug-ins.
1033
1034         (WebKit::WebPageProxy::findPlugin):
1035         * UIProcess/WebPageProxy.h:
1036         (WebPageProxy):
1037         * UIProcess/WebPageProxy.messages.in:
1038         Add an argument allowing findPlugin to restrict its search to only application plug-ins.
1039
1040         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1041         (WebKit::WebFrameLoaderClient::objectContentType):
1042         Previously, this caller depended on pluginData() returning null if
1043         plug-ins were disabled. Since that is no longer the case, we have to
1044         check if we can use plug-ins, and otherwise ignore non-application-plug-ins.
1045
1046         * WebProcess/WebPage/WebPage.cpp:
1047         (WebKit::WebPage::createPlugin):
1048         When going to search for a plug-in, ask subframeLoader whether or not
1049         it's OK to use ordinary non-application plug-ins, and pass that information
1050         on to the UIProcess when performing the search.
1051
1052         (WebKit::WebPage::canPluginHandleResponse): Ditto.
1053         (WebKit::WebPage::canShowMIMEType):
1054         Ensure that canShowMIMEType returns true if we have an application plug-in
1055         that can display a particular MIME type, even if we're not allowed to load plug-ins.
1056
1057 2013-05-16  Michał Pakuła vel Rutka  <m.pakula@samsung.com>
1058
1059         [EFL][WK2] Make Ewk_Context_Menu Ewk_Object
1060         https://bugs.webkit.org/show_bug.cgi?id=116097
1061
1062         Reviewed by Gyuyoung Kim.
1063
1064         Changed Ewk_Context_Menu to be an Ewk_Object so pointer to menu
1065         object can be shared between different modules.
1066
1067         * UIProcess/API/efl/EwkView.cpp:
1068         (EwkView::showContextMenu):
1069         * UIProcess/API/efl/EwkView.h:
1070         (EwkView):
1071         * UIProcess/API/efl/ewk_context_menu.cpp:
1072         (EwkContextMenu::appendItem):
1073         (EwkContextMenu::removeItem):
1074         (ewk_context_menu_new):
1075         (ewk_context_menu_new_with_items):
1076         (ewk_context_menu_item_append):
1077         (ewk_context_menu_item_remove):
1078         (ewk_context_menu_hide):
1079         (ewk_context_menu_items_get):
1080         (ewk_context_menu_item_select):
1081         * UIProcess/API/efl/ewk_context_menu_item.cpp:
1082         (EwkContextMenuItem::EwkContextMenuItem):
1083         (ewk_context_menu_item_new_with_submenu):
1084         * UIProcess/API/efl/ewk_context_menu_item_private.h:
1085         (EwkContextMenuItem):
1086         * UIProcess/API/efl/ewk_context_menu_private.h:
1087         (EwkContextMenu):
1088         (EwkContextMenu::create):
1089         * UIProcess/API/efl/ewk_defines.h:
1090
1091 2013-05-16  Andreas Kling  <akling@apple.com>
1092
1093         Page::chrome() should return a reference.
1094         <http://webkit.org/b/116185>
1095
1096         Reviewed by Anders Carlsson.
1097
1098 2013-05-16  Brady Eidson  <beidson@apple.com>
1099
1100         svg/as-image/img-zoom-svg-stylesheet.html crashes with NetworkProcess enabled.
1101         <rdar://problem/13837408> and https://bugs.webkit.org/show_bug.cgi?id=115917
1102
1103         Reviewed by Sam Weinig.
1104
1105         * NetworkProcess/SchedulableLoader.cpp:
1106         (WebKit::SchedulableLoader::SchedulableLoader): ASSERT that either there’s a frame and page ID, or
1107           that the client cannot be asked for credentials.
1108
1109         * WebProcess/Network/WebResourceLoadScheduler.cpp:
1110         (WebKit::WebResourceLoadScheduler::scheduleLoad): Only cast the FrameLoaderClient and get WebFrame/WebPage
1111           if that is actually possible. Set the clientCredentialPolicy based on whether or not WebFrame/WebPage are
1112           available since they are needed to ask the UIProcess for credentials. ASSERT that either there’s both
1113           a frame and page ID or that the client won’t be asked for credentials.
1114
1115 2013-05-16  Timothy Hatcher  <timothy@apple.com>
1116
1117         Make the Find Banner in Safari work again with the docked Web Inspector.
1118
1119         https://webkit.org/b/116182
1120         rdar://problem/13857423
1121
1122         Reviewed by Benjamin Poulain.
1123
1124         * UIProcess/mac/WebInspectorProxyMac.mm:
1125         (WebKit::WebInspectorProxy::inspectedViewFrameDidChange):
1126         (WebKit::WebInspectorProxy::platformDetach):
1127         Preserve the top position of the inspected view so banners in Safari still work.
1128
1129 2013-05-16  Tim Horton  <timothy_horton@apple.com>
1130
1131         [wk2] didGetImageForFindMatch can return a null image
1132         https://bugs.webkit.org/show_bug.cgi?id=116251
1133         <rdar://problem/13277246>
1134
1135         Reviewed by Simon Fraser.
1136
1137         Don't send didGetImageForFindMatch if we didn't get an image for
1138         the find match, which can happen if the selection is not visible.
1139
1140         * WebProcess/WebPage/FindController.cpp:
1141         (WebKit::FindController::getImageForFindMatch):
1142
1143 2013-05-16  Tim Horton  <timothy_horton@apple.com>
1144
1145         [wk2] Minimum layout width is lost if the WebProcess crashes
1146         https://bugs.webkit.org/show_bug.cgi?id=116202
1147         <rdar://problem/13202320>
1148
1149         Reviewed by Darin Adler.
1150
1151         Send the minimum layout width to the WebProcess upon initialization,
1152         so that crashed-and-restarted WebProcesses have the correct width.
1153
1154         * Shared/WebPageCreationParameters.cpp:
1155         (WebKit::WebPageCreationParameters::encode):
1156         (WebKit::WebPageCreationParameters::decode):
1157         * Shared/WebPageCreationParameters.h:
1158         (WebPageCreationParameters):
1159         Add minimumLayoutWidth WebPage creation parameter.
1160
1161         * UIProcess/WebPageProxy.cpp:
1162         (WebKit::WebPageProxy::creationParameters):
1163         Send the current minimumLayoutWidth to the WebPage when it's created.
1164
1165         (WebKit::WebPageProxy::setMinimumLayoutWidth):
1166         Store minimumLayoutWidth changes that come in while the WebProcess is
1167         not valid, so that the correct width is sent once it is restarted.
1168
1169         * WebProcess/WebPage/WebPage.cpp:
1170         (WebKit::WebPage::WebPage):
1171         Set minimumLayoutWidth to the value provided by our creation parameters.
1172
1173 2013-05-16  Zoltan Arvai  <zarvai@inf.u-szeged.hu>
1174
1175         [Win] Unreviewed buildfix after r150161.
1176
1177         'Unknown' in HTTPRequest.cpp is ambiguous symbol with MSVC,
1178         because it is also defined in MS SDK 7.1 winioctl.h.
1179
1180         * UIProcess/InspectorServer/HTTPRequest.cpp:
1181         (WebKit::HTTPRequest::HTTPRequest):
1182
1183 2013-05-16  Andras Becsi  <andras.becsi@digia.com>
1184
1185         [WK2] PluginInformation.cpp fails to build because of missing ENABLE(NETSCAPE_PLUGIN_API) guard
1186         https://bugs.webkit.org/show_bug.cgi?id=116018
1187
1188         Rubber-stamped by Jocelyn Turcotte.
1189
1190         * Shared/Plugins/Netscape/PluginInformation.cpp:
1191         (WebKit::getPluginModuleInformation):
1192
1193 2013-05-15  Simon Cooper  <scooper@apple.com>
1194
1195         Enable printing in plugins
1196         https://bugs.webkit.org/show_bug.cgi?id=116201
1197         <rdar://problem/12347902>
1198
1199         Reviewed by Alexey Proskuryakov.
1200
1201         Add the printing entitlement so that legacy printing drivers can
1202         customize the print panel. Update the printing rules and enable them
1203         for the plugins.
1204
1205         * Configurations/PluginService.entitlements:
1206         * Resources/PlugInSandboxProfiles/com.apple.WebKit.plugin-common.sb:
1207         * Resources/PlugInSandboxProfiles/com.macromedia.Flash Player.plugin.sb:
1208         * Resources/PlugInSandboxProfiles/com.microsoft.SilverlightPlugin.sb:
1209         * Resources/PlugInSandboxProfiles/com.oracle.java.JavaAppletPlugin.sb:
1210
1211 2013-05-15  Anders Carlsson  <andersca@apple.com>
1212
1213         Move HTTPRequest class to WebKit2
1214         https://bugs.webkit.org/show_bug.cgi?id=116192
1215
1216         Reviewed by Darin Adler.
1217
1218         Move HTTPRequest to WebKit2 and put it in the WebKit namespace.
1219
1220         * CMakeLists.txt:
1221         * GNUmakefile.list.am:
1222         * Target.pri:
1223         * UIProcess/InspectorServer/HTTPRequest.cpp: Renamed from Source/WebCore/platform/network/HTTPRequest.cpp.
1224         * UIProcess/InspectorServer/HTTPRequest.h: Renamed from Source/WebCore/platform/network/HTTPRequest.h.
1225         * UIProcess/InspectorServer/WebInspectorServer.cpp:
1226         * UIProcess/InspectorServer/WebInspectorServer.h:
1227         (WebInspectorServer):
1228         * UIProcess/InspectorServer/WebSocketServerClient.h:
1229         (WebKit::WebSocketServerClient::didReceiveUnrecognizedHTTPRequest):
1230         (WebKit::WebSocketServerClient::didReceiveWebSocketUpgradeHTTPRequest):
1231         (WebKit::WebSocketServerClient::didEstablishWebSocketConnection):
1232         * UIProcess/InspectorServer/WebSocketServerConnection.cpp:
1233         * UIProcess/InspectorServer/WebSocketServerConnection.h:
1234         (WebKit):
1235         (WebSocketServerConnection):
1236
1237 2013-05-15  Arnaud Renevier  <a.renevier@sisa.samsung.com>
1238
1239         [GTK] [WebKit2] enable displaying console.log messages to system console
1240         https://bugs.webkit.org/show_bug.cgi?id=115578
1241
1242         Reviewed by Martin Robinson.
1243
1244         Add a setting to enable/disable displaying of page messages to system
1245         console. Property is called enable-write-console-messages-to-stdout.
1246         Getter API function is
1247         webkit_settings_get_enable_write_console_messages_to_stdout
1248         Setter API function is
1249         webkit_settings_set_enable_write_console_messages_to_stdout
1250
1251         * UIProcess/API/gtk/WebKitSettings.cpp:
1252         (webKitSettingsSetProperty):
1253         (webKitSettingsGetProperty):
1254         (webkit_settings_class_init):
1255         (webkit_settings_get_enable_write_console_messages_to_stdout):
1256         (webkit_settings_set_enable_write_console_messages_to_stdout):
1257         * UIProcess/API/gtk/WebKitSettings.h:
1258         * UIProcess/API/gtk/docs/webkit2gtk-sections.txt:
1259         * UIProcess/API/gtk/tests/TestWebKitSettings.cpp:
1260         (testWebKitSettings):
1261
1262 2013-05-08  Gavin Barraclough  <barraclough@apple.com>
1263
1264         Process suppression should throttle scripted animations
1265         https://bugs.webkit.org/show_bug.cgi?id=115812
1266
1267         Reviewed by Simon Fraser.
1268
1269         <rdar://problem/13799726>
1270
1271         * WebProcess/WebPage/WebPage.cpp:
1272         (WebKit::WebPage::setThrottled):
1273         (WebKit):
1274         * WebProcess/WebPage/WebPage.h:
1275         (WebPage):
1276             - Added setThrottled, forwards to WebCore::Page.
1277         * WebProcess/WebProcess.cpp:
1278         (WebKit):
1279         (WebKit::WebProcess::setProcessSuppressionEnabled):
1280         * WebProcess/WebProcess.h:
1281         (WebProcess):
1282             - Intercept calls to setProcessSuppressionEnabled, also mark all pages as being throttled.
1283
1284 2013-05-15  Anders Carlsson  <andersca@apple.com>
1285
1286         WKPageGetPluginInformationDisplayNameKey doesn't return the right key
1287         https://bugs.webkit.org/show_bug.cgi?id=116188
1288
1289         Reviewed by Andreas Kling.
1290
1291         * UIProcess/API/C/WKPage.cpp:
1292         (WKPageGetPluginInformationDisplayNameKey):
1293
1294 2013-05-15  Alexey Proskuryakov  <ap@apple.com>
1295
1296         More fixing after WebProcessShim renaming in r149074.
1297
1298         * WebProcess/EntryPoint/mac/XPCService/WebContentServiceEntryPoint.mm:
1299         (WebContentServiceInitializer): Updated a comment to mention the shim by its new name.
1300
1301 2013-05-15  Alexey Proskuryakov  <ap@apple.com>
1302
1303         <rdar://problem/13902706> Lion: com.apple.tsm.uiserver sandbox error in Console when
1304         launching Safari
1305
1306         Reviewed by Anders Carlsson.
1307
1308         * WebProcess/com.apple.WebProcess.sb.in: Silence the violation.
1309
1310 2013-05-13  Anders Carlsson  <andersca@apple.com>
1311
1312         Frame::editor() should return a reference
1313         https://bugs.webkit.org/show_bug.cgi?id=116037
1314
1315         Reviewed by Darin Adler.
1316
1317         * WebProcess/WebCoreSupport/WebContextMenuClient.cpp:
1318         (WebKit::WebContextMenuClient::searchWithGoogle):
1319         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
1320         (WebKit::WebEditorClient::updateGlobalSelection):
1321         * WebProcess/WebCoreSupport/efl/WebEditorClientEfl.cpp:
1322         (WebKit::WebEditorClient::handleInputMethodKeydown):
1323         * WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp:
1324         (WebKit::WebEditorClient::executePendingEditorCommands):
1325         (WebKit::WebEditorClient::handleKeyboardEvent):
1326         * WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm:
1327         (WebKit::WebContextMenuClient::searchWithGoogle):
1328         (WebKit::WebContextMenuClient::searchWithSpotlight):
1329         * WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
1330         (WebKit::changeWordCase):
1331         * WebProcess/WebPage/WebFrame.cpp:
1332         (WebKit::WebFrame::selectionAsString):
1333         (WebKit::WebFrame::setTextDirection):
1334         * WebProcess/WebPage/WebPage.cpp:
1335         (WebKit::WebPage::editorState):
1336         (WebKit::WebPage::executeEditingCommand):
1337         (WebKit::WebPage::isEditingCommandEnabled):
1338         (WebKit::WebPage::validateCommand):
1339         (WebKit::WebPage::handleEditingKeyboardEvent):
1340         (WebKit::WebPage::advanceToNextMisspelling):
1341         (WebKit::WebPage::uppercaseWord):
1342         (WebKit::WebPage::lowercaseWord):
1343         (WebKit::WebPage::capitalizeWord):
1344         (WebKit::WebPage::replaceSelectionWithText):
1345         (WebKit::WebPage::handleAlternativeTextUIResult):
1346         (WebKit::WebPage::setCompositionForTesting):
1347         (WebKit::WebPage::hasCompositionForTesting):
1348         (WebKit::WebPage::confirmCompositionForTesting):
1349         (WebKit::WebPage::setComposition):
1350         (WebKit::WebPage::cancelComposition):
1351         * WebProcess/WebPage/efl/WebPageEfl.cpp:
1352         (WebKit::WebPage::confirmComposition):
1353         (WebKit::WebPage::setComposition):
1354         (WebKit::WebPage::cancelComposition):
1355         * WebProcess/WebPage/mac/WebPageMac.mm:
1356         (WebKit::WebPage::executeKeypressCommandsInternal):
1357         (WebKit::WebPage::handleEditingKeyboardEvent):
1358         (WebKit::WebPage::setComposition):
1359         (WebKit::WebPage::confirmComposition):
1360         (WebKit::WebPage::cancelComposition):
1361         (WebKit::WebPage::insertText):
1362         (WebKit::WebPage::insertDictatedText):
1363         (WebKit::WebPage::getMarkedRange):
1364         (WebKit::WebPage::firstRectForCharacterRange):
1365         (WebKit::WebPage::readSelectionFromPasteboard):
1366         (WebKit::WebPage::getStringSelectionForPasteboard):
1367         (WebKit::WebPage::getDataSelectionForPasteboard):
1368
1369 2013-05-15  Anders Carlsson  <andersca@apple.com>
1370
1371         Need a way for NPAPI plug-ins to open preference panes
1372         https://bugs.webkit.org/show_bug.cgi?id=116173
1373         <rdar://problem/13503848>
1374
1375         Reviewed by Sam Weinig.
1376
1377         * PluginProcess/PluginControllerProxy.h:
1378         Add openPluginPreferencePane().
1379
1380         * PluginProcess/mac/PluginControllerProxyMac.mm:
1381         (WebKit::PluginControllerProxy::openPluginPreferencePane):
1382         Send OpenPluginPreferencePane to the UI process.
1383
1384         * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
1385         (WebKit::NetscapePluginModule::getPluginInfo):
1386         Get the preference pane path.
1387         
1388         * Shared/Plugins/PluginModuleInfo.h:
1389         Add preferencePanePath member variable.
1390
1391         * UIProcess/Plugins/PluginProcessProxy.h:
1392         Add openPluginPreferencePane message handler.
1393
1394         * UIProcess/Plugins/PluginProcessProxy.messages.in:
1395         ADd OpenPluginPreferencePane message.
1396
1397         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
1398         (WebKit::PluginProcessProxy::openPluginPreferencePane):
1399         Get the path to the preference pane and use LS to open it.
1400
1401         * WebKit2.xcodeproj/project.pbxproj:
1402         Add new files.
1403
1404         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
1405         (WebKit::NPN_GetValue):
1406         Handle WKNVPlugInContainer.
1407
1408         * WebProcess/Plugins/Netscape/NetscapePlugin.h:
1409         Add WKNVPlugInContainer member variable.
1410
1411         * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
1412         (WebKit::NetscapePlugin::openPluginPreferencePane):
1413         Call through to the plug-in controller.
1414
1415         (WebKit::NetscapePlugin::plugInContainer):
1416         Create a WKNPAPIPlugInContainer object if necessary.
1417
1418         (WebKit::NetscapePlugin::platformDestroy):
1419         Invalidate the WKNPAPIPlugInContainer object.
1420
1421         * WebProcess/Plugins/Netscape/mac/WKNPAPIPlugInContainer.h:
1422         New file with the protocol definition.
1423
1424         * WebProcess/Plugins/Netscape/mac/WKNPAPIPlugInContainer.mm:
1425         (-[WKNPAPIPlugInContainer dealloc]):
1426         Assert that the plug-in is null (that we've been invalidated).
1427
1428         (-[WKNPAPIPlugInContainer _invalidate]):
1429         Set the plug-in to null.
1430
1431         (-[WKNPAPIPlugInContainer openPlugInPreferencePane]):
1432         Call through to the plug-in.
1433
1434         * WebProcess/Plugins/Netscape/mac/WKNPAPIPlugInContainerInternal.h:
1435         New file with the interface declaration for the object that implements the protocol.
1436
1437         * WebProcess/Plugins/PluginController.h:
1438         Add openPluginPreferencePane member function.
1439
1440         * WebProcess/Plugins/PluginView.cpp:
1441         (WebKit::PluginView::openPluginPreferencePane):
1442         Add stub; this should never be called since we always go through the UI process.
1443
1444 2013-05-15  Alexey Proskuryakov  <ap@apple.com>
1445
1446         [WK2][Mac] Split resetTextInputState into two functions
1447         https://bugs.webkit.org/show_bug.cgi?id=116174
1448
1449         Reviewed by Anders Carlsson.
1450
1451         Splitting resetTextInputState into resetSecureInputState and
1452         notifyInputContextAboutDiscardedComposition, paving the way for a fix where these
1453         won't be happening simultaneously.
1454
1455         * UIProcess/API/mac/PageClientImpl.h:
1456         * UIProcess/API/mac/PageClientImpl.mm:
1457         (WebKit::PageClientImpl::resetSecureInputState):
1458         (WebKit::PageClientImpl::notifyInputContextAboutDiscardedComposition):
1459         * UIProcess/API/mac/WKView.mm:
1460         (-[WKView resignFirstResponder]):
1461         (-[WKView _resetSecureInputState]):
1462         (-[WKView _notifyInputContextAboutDiscardedComposition]):
1463         * UIProcess/API/mac/WKViewInternal.h:
1464         * UIProcess/PageClient.h:
1465         * UIProcess/WebPageProxy.cpp:
1466         (WebKit::WebPageProxy::didCommitLoadForFrame):
1467
1468 2013-05-15  Carlos Garcia Campos  <cgarcia@igalia.com>
1469
1470         [GTK] Add padding to all public class structs for future expansion without breaking ABI
1471         https://bugs.webkit.org/show_bug.cgi?id=112565
1472
1473         Reviewed by Anders Carlsson.
1474
1475         Use 4 pointers for most of the classes that are unlikely to grow
1476         and 8 for WebKitWebView and WebKitWebContext.
1477
1478         * UIProcess/API/gtk/WebKitBackForwardList.h:
1479         (_WebKitBackForwardListClass):
1480         * UIProcess/API/gtk/WebKitBackForwardListItem.h:
1481         (_WebKitBackForwardListItemClass):
1482         * UIProcess/API/gtk/WebKitContextMenu.h:
1483         (_WebKitContextMenuClass):
1484         * UIProcess/API/gtk/WebKitContextMenuItem.h:
1485         (_WebKitContextMenuItemClass):
1486         * UIProcess/API/gtk/WebKitCookieManager.h:
1487         (_WebKitCookieManagerClass):
1488         * UIProcess/API/gtk/WebKitDownload.h:
1489         (_WebKitDownloadClass):
1490         * UIProcess/API/gtk/WebKitFaviconDatabase.h:
1491         (_WebKitFaviconDatabaseClass):
1492         * UIProcess/API/gtk/WebKitFileChooserRequest.h:
1493         (_WebKitFileChooserRequestClass):
1494         * UIProcess/API/gtk/WebKitFindController.h:
1495         (_WebKitFindControllerClass):
1496         * UIProcess/API/gtk/WebKitFormSubmissionRequest.h:
1497         (_WebKitFormSubmissionRequestClass):
1498         * UIProcess/API/gtk/WebKitGeolocationPermissionRequest.h:
1499         (_WebKitGeolocationPermissionRequestClass):
1500         * UIProcess/API/gtk/WebKitHitTestResult.h:
1501         (_WebKitHitTestResultClass):
1502         * UIProcess/API/gtk/WebKitNavigationPolicyDecision.h:
1503         (_WebKitNavigationPolicyDecisionClass):
1504         * UIProcess/API/gtk/WebKitPlugin.h:
1505         (_WebKitPluginClass):
1506         * UIProcess/API/gtk/WebKitPolicyDecision.h:
1507         (_WebKitPolicyDecisionClass):
1508         * UIProcess/API/gtk/WebKitPrintOperation.h:
1509         (_WebKitPrintOperationClass):
1510         * UIProcess/API/gtk/WebKitResponsePolicyDecision.h:
1511         (_WebKitResponsePolicyDecisionClass):
1512         * UIProcess/API/gtk/WebKitSecurityManager.h:
1513         (_WebKitSecurityManagerClass):
1514         * UIProcess/API/gtk/WebKitSettings.h:
1515         (_WebKitSettingsClass):
1516         * UIProcess/API/gtk/WebKitURIRequest.h:
1517         (_WebKitURIRequestClass):
1518         * UIProcess/API/gtk/WebKitURIResponse.h:
1519         (_WebKitURIResponseClass):
1520         * UIProcess/API/gtk/WebKitURISchemeRequest.h:
1521         (_WebKitURISchemeRequestClass):
1522         * UIProcess/API/gtk/WebKitWebContext.h:
1523         (_WebKitWebContextClass):
1524         * UIProcess/API/gtk/WebKitWebInspector.h:
1525         (_WebKitWebInspectorClass):
1526         * UIProcess/API/gtk/WebKitWebResource.h:
1527         (_WebKitWebResourceClass):
1528         * UIProcess/API/gtk/WebKitWebView.h:
1529         (_WebKitWebViewClass):
1530         * UIProcess/API/gtk/WebKitWebViewBase.h:
1531         (_WebKitWebViewBaseClass):
1532         * UIProcess/API/gtk/WebKitWebViewGroup.h:
1533         (_WebKitWebViewGroupClass):
1534         * UIProcess/API/gtk/WebKitWindowProperties.h:
1535         (_WebKitWindowPropertiesClass):
1536
1537 2013-05-14  Carlos Garcia Campos  <cgarcia@igalia.com>
1538
1539         Remove WTF_USE_PLATFORM_STRATEGIES
1540         https://bugs.webkit.org/show_bug.cgi?id=114431
1541
1542         Reviewed by Darin Adler.
1543
1544         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
1545         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
1546         * WebProcess/WebProcess.cpp:
1547         (WebKit::WebProcess::WebProcess):
1548
1549 2013-05-14  Simon Cooper  <scooper@apple.com>
1550
1551         Add a preference that can disable the fake SYSV SHM shim
1552         https://bugs.webkit.org/show_bug.cgi?id=116127
1553         <rdar://problem/13810524>
1554
1555         Reviewed by Alexey Proskuryakov.
1556
1557         * PluginProcess/mac/PluginProcessShim.mm:
1558         (WebKit::shim_disabled):
1559         (WebKit::shim_shmdt):
1560         (WebKit::shim_shmat):
1561         (WebKit::shim_shmget):
1562         (WebKit::shim_shmctl):
1563
1564 2013-05-14  Tim Horton  <timothy_horton@apple.com>
1565
1566         [wk2] Not updating tiled backing coverage when main frame scrollability changes
1567         https://bugs.webkit.org/show_bug.cgi?id=116123
1568         <rdar://problem/13836559>
1569
1570         Reviewed by Simon Fraser.
1571
1572         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
1573         (TiledCoreAnimationDrawingArea):
1574         Add updateMainFrameClipsToExposedRect.
1575
1576         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
1577         (WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
1578         (WebKit::TiledCoreAnimationDrawingArea::flushLayers):
1579         Remove m_clipsToExposedRect. We don't actually need it.
1580
1581         (WebKit::TiledCoreAnimationDrawingArea::mainFrameScrollabilityChanged):
1582         Call updateMainFrameClipsToExposedRect so that we can always update
1583         tiled backing coverage and can factor out our calls to setClipsToExposedRect.
1584
1585         (WebKit::TiledCoreAnimationDrawingArea::updateMainFrameClipsToExposedRect):
1586         Factor out setClipsToExposedRect calls to here, and also call
1587         FrameView::adjustTiledBackingCoverage so that the FrameView's tiled
1588         backing is informed to allow overdraw in the UI-process-scrolling case.
1589
1590         (WebKit::TiledCoreAnimationDrawingArea::setRootCompositingLayer):
1591         Use updateMainFrameClipsToExposedRect.
1592
1593 2013-05-14  Alexey Proskuryakov  <ap@apple.com>
1594
1595         [Mac] Add a testing shim for secure event input functions
1596         https://bugs.webkit.org/show_bug.cgi?id=116122
1597
1598         Reviewed by Mark Rowe.
1599
1600         Moved DyldInterpose.h to WebCore, as we now use it there too.
1601
1602         * PluginProcess/mac/PluginProcessShim.mm:
1603         * Shared/mac/CookieStorageShimLibrary.cpp:
1604         * Shared/mac/DyldInterpose.h: Removed.
1605         * WebKit2.xcodeproj/project.pbxproj:
1606         * WebProcess/mac/SecItemShimLibrary.mm:
1607
1608 2013-05-14  Jocelyn Turcotte  <jocelyn.turcotte@digia.com>
1609
1610         [Win] REGRESSION(r149944): mmap is not available on Windows
1611         https://bugs.webkit.org/show_bug.cgi?id=116015
1612
1613         Reviewed by Anders Carlsson.
1614
1615         Use fastAlloc/fastFree for platforms other than OS(DARWIN) where
1616         using mmap is not necessary and maybe not available.
1617
1618         * Platform/CoreIPC/ArgumentEncoder.cpp:
1619         (CoreIPC::allocBuffer):
1620         (CoreIPC::freeBuffer):
1621         (CoreIPC::ArgumentEncoder::~ArgumentEncoder):
1622         (CoreIPC::ArgumentEncoder::grow):
1623
1624 2013-05-14  Zan Dobersek  <zdobersek@igalia.com>
1625
1626         [GTK] Move generated ColorData.cpp, WebKitFontFamilyNames.(cpp|h) build targets into libPlatform
1627         https://bugs.webkit.org/show_bug.cgi?id=115921
1628
1629         Reviewed by Gustavo Noronha Silva.
1630
1631         * GNUmakefile.am: Add platform_cppflags to the list of libwebkit2gtk CPPFLAGS.
1632
1633 2013-05-14  Jocelyn Turcotte  <jocelyn.turcotte@digia.com>
1634
1635         [WK2][Win] Fix ASSERT(DeleteTimerQueueTimer...)
1636         https://bugs.webkit.org/show_bug.cgi?id=116039
1637
1638         Reviewed by Benjamin Poulain.
1639
1640         According to the documentation, DeleteTimerQueueTimer can be expected to return
1641         false with an ERROR_IO_PENDING error when called from the timer's callback.
1642
1643         * Platform/win/WorkQueueWin.cpp:
1644         (WorkQueue::timerCallback):
1645
1646 2013-05-14  Alexey Proskuryakov  <ap@apple.com>
1647
1648         Remove unused "type" field from DictionaryPopupInfo
1649         https://bugs.webkit.org/show_bug.cgi?id=116011
1650
1651         Reviewed by Darin Adler.
1652
1653         It is unused, and furthermore, PDFPlugin sets it incorrectly anyway.
1654
1655         * Shared/DictionaryPopupInfo.cpp:
1656         (WebKit::DictionaryPopupInfo::encode):
1657         (WebKit::DictionaryPopupInfo::decode):
1658         * Shared/DictionaryPopupInfo.h:
1659         * WebProcess/Plugins/PDF/PDFPlugin.mm:
1660         (WebKit::PDFPlugin::showDefinitionForAttributedString):
1661         * WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm:
1662         (WebKit::WebContextMenuClient::lookUpInDictionary):
1663         * WebProcess/WebPage/WebPage.h:
1664         * WebProcess/WebPage/mac/WebPageMac.mm:
1665         (WebKit::WebPage::performDictionaryLookupAtLocation):
1666         (WebKit::WebPage::performDictionaryLookupForSelection):
1667         (WebKit::WebPage::performDictionaryLookupForRange):
1668
1669 2013-05-14  Michael Brüning  <michael.bruning@digia.com>
1670
1671         [WK2] Make WebPageProxy use deviceScaleFactor() in creationParameters().
1672         https://bugs.webkit.org/show_bug.cgi?id=110218
1673
1674         Reviewed by Darin Adler.
1675
1676         Make the WebPageProxy::creationParameters use the accessor
1677         deviceScaleFactor() instead of using m_intrinsicDeviceScaleFactor
1678         directly. This will restore the custom device scale factor when
1679         reattaching to the WebProcess after a crash.
1680
1681         Moreover, it will enable the Qt and ELF ports to use the
1682         existing C API for overriding the device scale factor instead
1683         of using the WebPageProxy directly or adding new C API to set
1684         the intrinsic device scale factor.
1685
1686         * UIProcess/API/efl/EwkView.cpp:
1687         (EwkView::setDeviceScaleFactor):
1688         * UIProcess/API/qt/qquickwebpage.cpp:
1689         (QQuickWebPage::updatePaintNode):
1690         * UIProcess/WebPageProxy.cpp:
1691         (WebKit::WebPageProxy::creationParameters):
1692
1693 2013-05-13  Alex Christensen  <achristensen@apple.com>
1694
1695         Added testRunner.setPrinting.
1696         https://bugs.webkit.org/show_bug.cgi?id=42693
1697         rdar://problem/8213845
1698
1699         Reviewed by Darin Adler.
1700
1701         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
1702         (WKBundlePageCopyRenderTreeExternalRepresentationForPrinting): Added.
1703         * WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h:
1704         Added WKBundlePageCopyRenderTreeExternalRepresentationForPrinting declaration.
1705         * WebProcess/WebPage/WebPage.cpp:
1706         (WebKit::WebPage::renderTreeExternalRepresentationForPrinting): Added.
1707         * WebProcess/WebPage/WebPage.h:
1708         Added renderTreeExternalRepresentationForPrinting declaration.
1709
1710 2013-05-13  Timothy Hatcher  <timothy@apple.com>
1711
1712         Add support for updating the Web Inspector toolbar height.
1713
1714         https://bugs.webkit.org/show_bug.cgi?id=115996
1715
1716         Reviewed by Joseph Pecoraro and Benjamin Poulain.
1717
1718         * UIProcess/WebInspectorProxy.h:
1719         (WebKit::WebInspectorProxy::setToolbarHeight):
1720         (WebInspectorProxy):
1721         * UIProcess/WebInspectorProxy.messages.in:
1722         * UIProcess/efl/WebInspectorProxyEfl.cpp:
1723         (WebKit::WebInspectorProxy::platformSetToolbarHeight):
1724         * UIProcess/gtk/WebInspectorProxyGtk.cpp:
1725         (WebKit::WebInspectorProxy::platformSetToolbarHeight):
1726         (WebKit):
1727         * UIProcess/mac/WebInspectorProxyMac.mm:
1728         (WebKit::WebInspectorProxy::platformSetToolbarHeight):
1729         * UIProcess/qt/WebInspectorProxyQt.cpp:
1730         (WebKit::WebInspectorProxy::platformSetToolbarHeight):
1731         * WebProcess/WebCoreSupport/WebInspectorFrontendClient.cpp:
1732         (WebKit::WebInspectorFrontendClient::setToolbarHeight):
1733         * WebProcess/WebCoreSupport/WebInspectorFrontendClient.h:
1734         (WebInspectorFrontendClient):
1735         * WebProcess/WebPage/WebInspector.cpp:
1736         (WebKit::WebInspector::setToolbarHeight):
1737         * WebProcess/WebPage/WebInspector.h:
1738
1739 2013-05-13  Ryosuke Niwa  <rniwa@webkit.org>
1740
1741         Sometimes NSUndoManager can get into an inconsistent state
1742         https://bugs.webkit.org/show_bug.cgi?id=116050
1743
1744         Reviewed by Enrica Casucci.
1745
1746         Always group undo items to work around a bug in NSUndoManager that manifests
1747         when we call removeAllActionsWithTarget.
1748
1749         * UIProcess/API/mac/PageClientImpl.mm:
1750         (WebKit::PageClientImpl::registerEditCommand):
1751
1752 2013-05-13  Anders Carlsson  <andersca@apple.com>
1753
1754         [WK2] Crash in WebKit::StorageAreaMap::didSetItem()
1755         https://bugs.webkit.org/show_bug.cgi?id=116026
1756
1757         Reviewed by Andreas Kling.
1758
1759         Make sure that we ignore any leftover messages from the UI process after we've reset
1760         the storage map. Achieve this by keeping a seed count in the StorageAreaMap object that's incremented
1761         everytime the map is reset. Associate every storage area change with the seed and ignore any incoming 
1762         notification messages from the UI process if the seeds are different.
1763
1764         * Platform/CoreIPC/HandleMessage.h:
1765         (CoreIPC):
1766         (CoreIPC::callMemberFunction):
1767         * UIProcess/Storage/StorageManager.cpp:
1768         (WebKit::StorageManager::getValues):
1769         (WebKit::StorageManager::setItem):
1770         (WebKit::StorageManager::removeItem):
1771         (WebKit::StorageManager::clear):
1772         * UIProcess/Storage/StorageManager.h:
1773         (StorageManager):
1774         * UIProcess/Storage/StorageManager.messages.in:
1775         * WebProcess/Storage/StorageAreaMap.cpp:
1776         (WebKit::StorageAreaMap::StorageAreaMap):
1777         (WebKit::StorageAreaMap::setItem):
1778         (WebKit::StorageAreaMap::removeItem):
1779         (WebKit::StorageAreaMap::clear):
1780         (WebKit::StorageAreaMap::resetValues):
1781         (WebKit::StorageAreaMap::loadValuesIfNeeded):
1782         (WebKit::StorageAreaMap::didGetValues):
1783         (WebKit::StorageAreaMap::didSetItem):
1784         (WebKit::StorageAreaMap::didRemoveItem):
1785         (WebKit::StorageAreaMap::didClear):
1786         (WebKit::StorageAreaMap::applyChange):
1787         * WebProcess/Storage/StorageAreaMap.h:
1788         (StorageAreaMap):
1789         * WebProcess/Storage/StorageAreaMap.messages.in:
1790
1791 2013-05-13  Jesus Sanchez-Palencia  <jesus.palencia@openbossa.org>
1792
1793         [WK2][CoordinatedGraphics] Avoid dispensable calls to WebView::updateViewportSize()
1794         https://bugs.webkit.org/show_bug.cgi?id=116045
1795
1796         Reviewed by Darin Adler.
1797
1798         * UIProcess/CoordinatedGraphics/WebView.cpp:
1799         (WebKit::WebView::setSize):
1800
1801 2013-05-13  Jon Lee  <jonlee@apple.com>
1802
1803         [WK2] Notification manager removal should not be tied to termination of web processes
1804         https://bugs.webkit.org/show_bug.cgi?id=116038
1805         <rdar://problem/10968680>
1806
1807         Reviewed by Ryosuke Niwa.
1808
1809         WebNotificationManagerProxy incorrectly removes the manager when web processes close.
1810         Since it is a supplemental on the web context, the manager should only be removed
1811         when the context is destroyed.
1812
1813         * UIProcess/Notifications/WebNotificationManagerProxy.cpp:
1814         * UIProcess/Notifications/WebNotificationManagerProxy.h: Remove implementation of
1815         processDidClose().
1816
1817 2013-05-13  Martin Robinson  <mrobinson@igalia.com>
1818
1819         [GTK] [WebKit2] Use a template file for generated GObject enum files
1820         https://bugs.webkit.org/show_bug.cgi?id=115867
1821
1822         Reviewed by Carlos Garcia Campos.
1823
1824         * GNUmakefile.am: Use a template file instead of specifying portions of the file on the command-line.
1825         * UIProcess/API/gtk/WebKitEnumTypes.cpp.template: Added.
1826         * UIProcess/API/gtk/WebKitEnumTypes.h.template: Added.
1827         * UIProcess/API/gtk/WebKitFindController.cpp: We can no longer rely on WebKitEnumTypes.h to pull in WebKitWebView.h.
1828
1829 2013-05-13  Noam Rosenthal  <noam@webkit.org>
1830
1831         [CoordGfx] requestAnimationFrame performance issues
1832         https://bugs.webkit.org/show_bug.cgi?id=112345
1833
1834         Reviewed by Jocelyn Turcotte.
1835
1836         Changed the logic of requestAnimationFrame in Coordinated Graphics.
1837         We don't send any IPC messages for requestAnimationFrame. Instead, we do one of two things:
1838         - If there is already a frame pending in the UI process, do nothing, as the animations would
1839           be serviced when the frame is returned to the web process.
1840         - If there is no frame pending, we schedule a flush, making sure that that flush occurs at 
1841           least 1/60 seconds after the last animation service, so that we don't get an infinite loop
1842           of flushes.
1843
1844         * UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.cpp:
1845         (WebKit::CoordinatedLayerTreeHostProxy::requestAnimationFrame):
1846         * UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.h:
1847         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
1848         (WebKit::CoordinatedLayerTreeHost::CoordinatedLayerTreeHost):
1849         (WebKit::CoordinatedLayerTreeHost::flushPendingLayerChanges):
1850         (WebKit::CoordinatedLayerTreeHost::scheduleAnimation):
1851         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
1852         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.messages.in:
1853
1854 2013-05-13  Jesus Sanchez-Palencia  <jesus.palencia@openbossa.org>
1855
1856         [WK2][CoordinatedGraphics] WKView needs API for handling opacity
1857         https://bugs.webkit.org/show_bug.cgi?id=116032
1858
1859         Reviewed by Kenneth Rohde Christiansen.
1860
1861         Add WKViewSetOpacity and WKViewOpacity APIs and use them in
1862         WebView.cpp.
1863
1864         * UIProcess/API/C/CoordinatedGraphics/WKView.cpp:
1865         (WKViewSetOpacity):
1866         (WKViewOpacity):
1867         * UIProcess/API/C/CoordinatedGraphics/WKView.h:
1868         * UIProcess/CoordinatedGraphics/WebView.cpp:
1869         (WebKit::WebView::WebView):
1870         (WebKit::WebView::paintToCurrentGLContext):
1871         * UIProcess/CoordinatedGraphics/WebView.h:
1872         (WebKit::WebView::setOpacity):
1873         (WebKit::WebView::opacity):
1874         (WebView):
1875
1876 2013-05-13  Zan Dobersek  <zdobersek@igalia.com>
1877
1878         [GTK] Use WebCore layer archives for TestWebCore, WebKitPluginProcess
1879         https://bugs.webkit.org/show_bug.cgi?id=115918
1880
1881         Reviewed by Gustavo Noronha Silva.
1882
1883         Due to layer violations and circular dependencies the WebKitPluginProcess requires for the
1884         libraries containing the built code of the intertwining Platform and WebCore layers to be
1885         specified multiple times when linking. This can be avoided by packing the two layers' archives
1886         into one big archive, named after the WebCore layer due to no clear boundary between it and the
1887         Platform layer. The big archive can then be specified only once when linking, simplifying the code
1888         and suppressing all the layering violations so they do not cause build problems.
1889
1890         First the libtool libraries that the WebCore layer (as required by the WebKitPluginProcess) depends on
1891         are specified. These are then used as dependencies for the archive creation rule as well as the list
1892         from which the archive file paths are constructed and then used to dump the member files from these archives.
1893         The member files are then added to the big archive. The latter is added to the list of libraries the
1894         WebKitPluginProcess requires to successfully link.
1895
1896         * GNUmakefile.am:
1897
1898 2013-05-13  Zalan Bujtas  <zalan@apple.com>
1899
1900         WebProcess consuming very high CPU on linkedin.com
1901         https://bugs.webkit.org/show_bug.cgi?id=115601
1902
1903         Reviewed by Andreas Kling.
1904
1905         Disable WEB_TIMING_MINIMAL.
1906         Turn off window.performance and performance.now(). Some JS frameworks expect
1907         additional Web Timing APIs, when performance.now() is available.
1908
1909         * Configurations/FeatureDefines.xcconfig:
1910
1911 2013-05-12  Anders Carlsson  <andersca@apple.com>
1912
1913         Stop including UnusedParam.h
1914         https://bugs.webkit.org/show_bug.cgi?id=116003
1915
1916         Reviewed by Sam Weinig.
1917
1918         UnusedParam.h is empty now so there's no need to include it anymore.
1919
1920         * UIProcess/API/C/WKContext.cpp:
1921         * UIProcess/API/C/WKInspector.cpp:
1922         * UIProcess/API/C/WKPage.cpp:
1923         * UIProcess/API/efl/ewk_text_checker.cpp:
1924         * UIProcess/API/efl/ewk_view.cpp:
1925         * UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestBase.cpp:
1926         * UIProcess/API/efl/tests/test_ewk2_view.cpp:
1927         * UIProcess/mac/WKFullScreenWindowController.mm:
1928         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
1929         * WebProcess/ResourceCache/WebResourceCacheManager.cpp:
1930
1931 2013-05-12  Andreas Kling  <akling@apple.com>
1932
1933         Unload event listeners should prevent Safari from insta-killing the web process on last tab close.
1934         <http://webkit.org/b/115988>
1935         <rdar://problem/13870943>
1936
1937         Reviewed by Anders Carlsson.
1938
1939         Let WebCore control the UI process's suppression of the sudden termination mechanism.
1940         This is implemented by having WebChromeClient push Enable/DisableSuddenTermination messages
1941         over to the UI process where the appropriate NSProcessInfo calls are made.
1942
1943         We also use this information when deciding whether to insta-kill a web process when its last
1944         page is closed. This mechanism is re-usable in WebCore to protect against sudden termination
1945         by the UI process.
1946
1947         * UIProcess/WebProcessProxy.cpp:
1948         (WebKit::WebProcessProxy::WebProcessProxy):
1949         (WebKit::WebProcessProxy::removeWebPage):
1950         (WebKit::WebProcessProxy::enableSuddenTermination):
1951         (WebKit::WebProcessProxy::disableSuddenTermination):
1952         * UIProcess/WebProcessProxy.h:
1953         (WebProcessProxy):
1954         * UIProcess/WebProcessProxy.messages.in:
1955         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1956         (WebKit::WebChromeClient::enableSuddenTermination):
1957         (WebKit::WebChromeClient::disableSuddenTermination):
1958         * WebProcess/WebCoreSupport/WebChromeClient.h:
1959         (WebChromeClient):
1960
1961 2013-05-12  Alexey Proskuryakov  <ap@apple.com>
1962
1963         <rdar://problem/13402976> Sandbox violations in com.nvidia.OpenGL on Lion.
1964
1965         Reviewed by Dan Bernstein.
1966
1967         * WebProcess/com.apple.WebProcess.sb.in: Silence the violations (on Lion only).
1968
1969 2013-05-12  Carlos Garcia Campos  <cgarcia@igalia.com>
1970
1971         [GTK] Remove unnecessary GTK_CHECK_VERSION #ifdefs
1972         https://bugs.webkit.org/show_bug.cgi?id=115914
1973
1974         Reviewed by Martin Robinson.
1975
1976         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
1977         (webkitWebViewBaseRealize):
1978
1979 2013-05-12  Raphael Kubo da Costa  <raphael.kubo.da.costa@intel.com>
1980
1981         Unreviewed build fix after r149944.
1982
1983         * Platform/CoreIPC/ArgumentEncoder.cpp: Include <sys/mman.h> for mmap(2).
1984
1985 2013-05-11  Anders Carlsson  <andersca@apple.com>
1986
1987         Don't pass malloced pointers as out-of-line data when sending Mach messages
1988         https://bugs.webkit.org/show_bug.cgi?id=115970
1989         <rdar://problem/13144680>
1990
1991         Reviewed by Sam Weinig.
1992
1993         Give ArgumentEncoder an inline buffer of 512 bytes. If we need more than that, use mmap to allocate data
1994         since that gives us fresh zero-filled memory that we can safely share.
1995
1996         * Platform/CoreIPC/ArgumentEncoder.cpp:
1997         (CoreIPC::ArgumentEncoder::ArgumentEncoder):
1998         Set up the buffer pointers to point to the inline buffer.
1999
2000         (CoreIPC::ArgumentEncoder::~ArgumentEncoder):
2001         Unmap the buffer if necessary.
2002
2003         (CoreIPC::ArgumentEncoder::grow):
2004         Grow the allocation exponentially, rounded up to the nearest page. This is a simplification from the
2005         current strategy, but most messages are either tiny in which case they will fit inside the inline buffer,
2006         or big in which case we'll end up doing less allocations + memory copying.
2007
2008         * Platform/CoreIPC/ArgumentEncoder.h:
2009         (ArgumentEncoder):
2010
2011 2013-05-11  Zan Dobersek  <zdobersek@igalia.com>
2012
2013         Unreviewed GTK build fix after r149904.
2014
2015         * GNUmakefile.list.am: Adding missing build targets.
2016
2017 2013-05-11  Christophe Dumez  <ch.dumez@sisa.samsung.com>
2018
2019         Unreviewed, Fix WK2 EFL build after r149904.
2020
2021         Add new PluginInformation.cpp file to CMake.
2022
2023         * CMakeLists.txt:
2024
2025 2013-05-11  Christophe Dumez  <ch.dumez@sisa.samsung.com>
2026
2027         Unreviewed, fix WK2 EFL build after r149904.
2028
2029         Add new WKPluginInformation.cpp file to CMake.
2030
2031         * CMakeLists.txt:
2032
2033 2013-05-11  Andreas Kling  <akling@apple.com>
2034
2035         When possible, terminate web processes immediately when closing their last page.
2036         <http://webkit.org/b/115964>
2037         <rdar://problem/13869266>
2038
2039         Reviewed by Geoffrey Garen.
2040
2041         When we're using a network process, there's no need for the UI process to wait for web processes
2042         to clear resource caches and terminate nicely.
2043
2044         We can just kill them off right away in WebProcessProxy::removeWebPage() when the last page is closed.
2045
2046         * UIProcess/WebProcessProxy.cpp:
2047         (WebKit::WebProcessProxy::removeWebPage):
2048
2049             Terminate the child process immediately if possible.
2050
2051         * UIProcess/WebProcessProxy.h:
2052         (WebKit::WebProcessProxy::canTerminateChildProcess):
2053         (WebKit::WebProcessProxy::shouldTerminate):
2054
2055             Broke out the logic from the shouldTerminate() IPC message handler into a separate function
2056             so we can call it from removeWebPage().
2057
2058 2013-05-11  Anders Carlsson  <andersca@apple.com>
2059
2060         Crash when terminating a process that has not been fully launched
2061         https://bugs.webkit.org/show_bug.cgi?id=115962
2062         <rdar://problem/13660916>
2063
2064         Reviewed by Andreas Kling.
2065
2066         Handle terminating a process that has not been fully launched.
2067
2068         * UIProcess/Launcher/ProcessLauncher.cpp:
2069         (WebKit::ProcessLauncher::didFinishLaunchingProcess):
2070         If we have been invalidated, dispose the connection identifier.
2071
2072         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
2073         (WebKit::ProcessLauncher::terminateProcess):
2074         If we're still launching the process, invalidate so the client won't get an unexpected
2075         didFinishLaunching callback.
2076
2077         * UIProcess/WebProcessProxy.cpp:
2078         (WebKit::WebProcessProxy::requestTermination):
2079         Check if webConnection() is null before calling it. (It will be null if the process isn't fully launched).
2080
2081 2013-05-10  Brian J. Burg  <burg@cs.washington.edu>
2082
2083         Web Inspector: Implement WK2 version of WebInspectorFrontendClient::save
2084         https://bugs.webkit.org/show_bug.cgi?id=115564
2085
2086         Reviewed by Benjamin Poulain.
2087
2088         Implement InspectorFrontendHost's save() and append() methods for
2089         Mac WebKit2. Add canSave() for all ports.
2090
2091         * UIProcess/WebInspectorProxy.cpp:
2092         (WebKit::WebInspectorProxy::save):
2093         (WebKit):
2094         (WebKit::WebInspectorProxy::append):
2095         * UIProcess/WebInspectorProxy.h:
2096         (WebInspectorProxy):
2097         * UIProcess/WebInspectorProxy.messages.in:
2098         * UIProcess/efl/WebInspectorProxyEfl.cpp:
2099         (WebKit::WebInspectorProxy::platformSave):
2100         (WebKit):
2101         (WebKit::WebInspectorProxy::platformAppend):
2102         * UIProcess/gtk/WebInspectorProxyGtk.cpp:
2103         (WebKit::WebInspectorProxy::platformSave):
2104         (WebKit):
2105         (WebKit::WebInspectorProxy::platformAppend):
2106         * UIProcess/mac/WebInspectorProxyMac.mm:
2107         (WebKit::WebInspectorProxy::platformSave):
2108         (WebKit):
2109         (WebKit::WebInspectorProxy::platformAppend):
2110         * UIProcess/qt/WebInspectorProxyQt.cpp:
2111         (WebKit::WebInspectorProxy::platformSave):
2112         (WebKit):
2113         (WebKit::WebInspectorProxy::platformAppend):
2114         * WebProcess/WebCoreSupport/WebInspectorFrontendClient.cpp:
2115         (WebKit::WebInspectorFrontendClient::canSave):
2116         (WebKit):
2117         (WebKit::WebInspectorFrontendClient::save):
2118         (WebKit::WebInspectorFrontendClient::append):
2119         * WebProcess/WebCoreSupport/WebInspectorFrontendClient.h:
2120         (WebInspectorFrontendClient):
2121         * WebProcess/WebPage/WebInspector.cpp:
2122         (WebKit::WebInspector::save):
2123         (WebKit):
2124         (WebKit::WebInspector::append):
2125         (WebKit::WebInspector::didSave):
2126         (WebKit::WebInspector::didAppend):
2127         * WebProcess/WebPage/WebInspector.h:
2128         (WebInspector):
2129         * WebProcess/WebPage/WebInspector.messages.in:
2130         * WebProcess/WebPage/efl/WebInspectorEfl.cpp:
2131         (WebKit::WebInspector::canSave):
2132         (WebKit):
2133         * WebProcess/WebPage/gtk/WebInspectorGtk.cpp:
2134         (WebKit::WebInspector::canSave):
2135         (WebKit):
2136         * WebProcess/WebPage/mac/WebInspectorMac.mm:
2137         (WebKit::WebInspector::canSave):
2138         (WebKit):
2139         * WebProcess/WebPage/qt/WebInspectorQt.cpp:
2140         (WebKit::WebInspector::canSave):
2141         (WebKit):
2142
2143 2013-05-10  Remy Demarest  <rdemarest@apple.com>
2144
2145         Copy WKPluginInformation.h header to the WebKit2 Framework private headers.
2146         https://bugs.webkit.org/show_bug.cgi?id=115940
2147
2148         Reviewed by Darin Adler.
2149
2150         * WebKit2.xcodeproj/project.pbxproj:
2151         Move WKPluginInformation.h file from the framework's Project Headers to
2152         Private Headers.
2153
2154 2013-05-10  Zoltan Arvai  <zarvai@inf.u-szeged.hu>
2155
2156         [Qt][Mac] Unreviewed. Roll out the fix attempt in r149912.
2157
2158         * Target.pri:
2159
2160 2013-05-10  Simon Cooper  <scooper@apple.com>
2161
2162         Fix AppleConnect issues for WiFi interfaces
2163         <rdar://problem/13776227&13776240&13776281>
2164         https://bugs.webkit.org/show_bug.cgi?id=115932
2165
2166         Reviewed by Alexey Proskuryakov.
2167
2168         Add support for WiFi interfaces for the AppleConnect plugin.
2169         Remove the FIXME.
2170
2171         * Resources/PlugInSandboxProfiles/com.apple.ist.ds.appleconnect.webplugin.sb:
2172
2173 2013-05-10  Zoltan Arvai  <zarvai@inf.u-szeged.hu>
2174
2175         [Qt][Mac] Unreviewed speculative build fix after r149904.
2176
2177         * Target.pri:
2178
2179 2013-05-10  Zoltan Arvai  <zarvai@inf.u-szeged.hu>
2180
2181         [Qt] Unreviewed buildfix after r149904.
2182
2183         * Target.pri:
2184
2185 2013-05-09  Sam Weinig  <sam@webkit.org>
2186
2187         Unify plug-in information dictionaries
2188         <rdar://problem/13852080>
2189         https://bugs.webkit.org/show_bug.cgi?id=115891
2190
2191         Reviewed by Anders Carlsson.
2192
2193         This unifies the plug-in information dictionaries vended by WKContextCopyPlugInInfoForBundleIdentifier
2194         and WKContextGetInfoForInstalledPlugIns with those from the WKPageLoaderClient and WKPageUIClient.
2195
2196         All the old keys will continue to work, but have been deprecated in favor of new keys defined in 
2197         WKPluginInformation.h
2198
2199         * Shared/API/c/WKPluginInformation.cpp: Added.
2200         * Shared/API/c/WKPluginInformation.h: Added.
2201         Export new keys as SPI.
2202
2203         * Shared/Plugins/Netscape/PluginInformation.h: Added.
2204         * Shared/Plugins/Netscape/PluginInformation.cpp: Added.
2205         (WebKit::pluginInformationBundleIdentifierKey):
2206         (WebKit::pluginInformationBundleVersionKey):
2207         (WebKit::pluginInformationPathKey):
2208         (WebKit::pluginInformationDisplayNameKey):
2209         (WebKit::pluginInformationDefaultLoadPolicyKey):
2210         (WebKit::pluginInformationUpdatePastLastBlockedVersionIsKnownAvailableKey):
2211         (WebKit::pluginInformationHasSandboxProfileKey):
2212         (WebKit::pluginInformationFrameURLKey):
2213         (WebKit::pluginInformationMIMETypeKey):
2214         (WebKit::pluginInformationPageURLKey):
2215         (WebKit::pluginInformationPluginspageAttributeURLKey):
2216         (WebKit::pluginInformationPluginURLKey):
2217         Add new keys.
2218
2219         (WebKit::pluginModuleInformation):
2220         (WebKit::createPluginInformationDictionary):
2221         Add creation functions to simplify multiple sites.
2222
2223         * Shared/Plugins/Netscape/mac/PluginInformationMac.mm: Added.
2224         (WebKit::platformPluginModuleInformation):
2225         Add platform specific data to the dictionary.
2226
2227         * UIProcess/API/C/WKPage.cpp:
2228         (WKPageGetPluginInformationBundleIdentifierKey):
2229         (WKPageGetPluginInformationBundleVersionKey):
2230         (WKPageGetPluginInformationDisplayNameKey):
2231         (WKPageGetPluginInformationFrameURLKey):
2232         (WKPageGetPluginInformationMIMETypeKey):
2233         (WKPageGetPluginInformationPageURLKey):
2234         (WKPageGetPluginInformationPluginspageAttributeURLKey):
2235         (WKPageGetPluginInformationPluginURLKey):
2236         * UIProcess/API/C/WKPage.h:
2237         Deprecate the old keys.
2238
2239         * UIProcess/API/C/mac/WKContextPrivateMac.h:
2240         * UIProcess/API/C/mac/WKContextPrivateMac.mm:
2241         (WKContextCopyPlugInInfoForBundleIdentifier):
2242         (WKContextGetInfoForInstalledPlugIns):
2243         Simplify by using the new createPluginInformationDictionary functions.
2244
2245         (WKPlugInInfoPathKey):
2246         (WKPlugInInfoBundleIdentifierKey):
2247         (WKPlugInInfoVersionKey):
2248         (WKPlugInInfoLoadPolicyKey):
2249         (WKPlugInInfoUpdatePastLastBlockedVersionIsKnownAvailableKey):
2250         (WKPlugInInfoIsSandboxedKey):
2251         Deprecate the old keys.
2252
2253         * UIProcess/WebLoaderClient.cpp:
2254         (WebKit::WebLoaderClient::didFailToInitializePlugin):
2255         (WebKit::WebLoaderClient::didBlockInsecurePluginVersion):
2256         (WebKit::WebLoaderClient::pluginLoadPolicy):
2257         * UIProcess/WebLoaderClient.h:
2258         * UIProcess/WebUIClient.cpp:
2259         (WebKit::WebUIClient::unavailablePluginButtonClicked):
2260         * UIProcess/WebUIClient.h:
2261         Optimize for the most recent callback type which takes a dictionary,
2262         and pull out the necessary bits from it for deprecated callbacks as necessary.
2263
2264         * UIProcess/WebPageProxy.h:
2265         * UIProcess/WebPageProxy.cpp:
2266         (WebKit::WebPageProxy::findPlugin):
2267         (WebKit::WebPageProxy::unavailablePluginButtonClicked):
2268         (WebKit::WebPageProxy::didFailToInitializePlugin):
2269         (WebKit::WebPageProxy::didBlockInsecurePluginVersion):
2270         Use createPluginInformationDictionary() consistently, to get consistent results for callbacks.
2271
2272         * WebKit2.xcodeproj/project.pbxproj:
2273         Add new files.
2274
2275 2013-05-10  Brian J. Burg  <burg@cs.washington.edu>
2276
2277         Web Inspector: implement runOpenPanel callback for WebKit2 inspector
2278         https://bugs.webkit.org/show_bug.cgi?id=115865
2279
2280         Reviewed by Sam Weinig.
2281
2282         * UIProcess/WebInspectorProxy.h:
2283         (WebKit::WebInspectorProxy::inspectorWindow):
2284         Add an accessor for m_inspectorWindow.
2285
2286         * UIProcess/mac/WebInspectorProxyMac.mm:
2287         (WebKit::runOpenPanel):
2288         Show the open panel dialog when requested.
2289
2290         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
2291         Register the callback when the inspector page is created.
2292
2293 2013-05-10  Jesus Sanchez-Palencia  <jesus.palencia@openbossa.org>
2294
2295         [WK2][CoordinatedGraphics] WKViewSetThemePath is EFL specific
2296         https://bugs.webkit.org/show_bug.cgi?id=115928
2297
2298         Reviewed by Kenneth Rohde Christiansen.
2299
2300         WKViewSetThemePath was moved to WKViewEfl.h since it is EFL specific.
2301
2302         * UIProcess/API/C/CoordinatedGraphics/WKView.cpp:
2303         * UIProcess/API/C/CoordinatedGraphics/WKView.h:
2304         * UIProcess/API/C/efl/WKViewEfl.cpp:
2305         (WKViewSetThemePath):
2306         * UIProcess/API/C/efl/WKViewEfl.h:
2307         * UIProcess/CoordinatedGraphics/WebView.cpp:
2308         * UIProcess/CoordinatedGraphics/WebView.h:
2309         (WebView):
2310         * UIProcess/efl/ViewClientEfl.cpp:
2311         * UIProcess/efl/WebInspectorProxyEfl.cpp:
2312         * UIProcess/efl/WebViewEfl.cpp:
2313         (WebKit::WebViewEfl::setThemePath):
2314         * UIProcess/efl/WebViewEfl.h:
2315         (WebViewEfl):
2316
2317 2013-05-10  Jer Noble  <jer.noble@apple.com>
2318
2319         REGRESSION (r149439): Video turns blank upon entering full screen for the first time
2320         https://bugs.webkit.org/show_bug.cgi?id=115617
2321
2322         Reviewed by Eric Carlson.
2323
2324         Partially revert the change introduced in r149439 for OS X 10.8 and previous. On these
2325         platforms, create a window with a NSZeroSize initial frame, which fixes the "blank"
2326         first-full screen behavior.
2327
2328         * UIProcess/API/mac/WKView.mm:
2329         (-[WKView createFullScreenWindow]):
2330
2331 2013-05-10  Zan Dobersek  <zdobersek@igalia.com>
2332
2333         [WK2] Make the WebSoupRequestManager a supplement to the WebProcess
2334         https://bugs.webkit.org/show_bug.cgi?id=115717
2335
2336         Reviewed by Andreas Kling.
2337
2338         WebSoupRequestManager should inherit from WebProcessSupplement and should be used as such
2339         by the WebProcess. This removes the need for the m_soupRequestManager member variable in
2340         the WebProcess class and brings the WebSoupRequestManager in line with other manager classes
2341         of which instances are controlled by the WebProcess class.
2342
2343         * WebProcess/WebProcess.cpp:
2344         (WebKit::WebProcess::WebProcess): Add  the WebSoupRequestManager as a supplement.
2345         * WebProcess/WebProcess.h:
2346         (WebProcess): Remove the m_soupRequestManager member variable and its getter method.
2347         * WebProcess/soup/WebKitSoupRequestGeneric.cpp:
2348         (webkitSoupRequestGenericSendAsync): Access the WebSoupRequestManager as a supplement.
2349         (webkitSoupRequestGenericSendFinish): Ditto.
2350         * WebProcess/soup/WebProcessSoup.cpp:
2351         (WebKit::WebProcess::platformInitializeWebProcess): Access the WebSoupRequestManager as a supplement.
2352         * WebProcess/soup/WebSoupRequestManager.cpp:
2353         (WebKit::WebSoupRequestManager::supplementName): Specify the supplement's name.
2354         * WebProcess/soup/WebSoupRequestManager.h:
2355         (WebSoupRequestManager): Inherit from the WebProcessSupplement interface.
2356
2357 2013-05-10  Carlos Garcia Campos  <cgarcia@igalia.com>
2358
2359         [GTK] Remove unnecessary GLIB_CHECK_VERSION #ifdefs
2360         https://bugs.webkit.org/show_bug.cgi?id=115904
2361
2362         Reviewed by Martin Robinson.
2363
2364         * UIProcess/API/gtk/tests/TestInspectorServer.cpp:
2365         (startTestServerMonitor):
2366         * UIProcess/API/gtk/tests/TestWebKitAccessibility.cpp:
2367         (startTestServerMonitor):
2368
2369 2013-05-09  Anders Carlsson  <andersca@apple.com>
2370
2371         Fix build.
2372
2373         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.mm:
2374
2375 2013-05-09  Anders Carlsson  <andersca@apple.com>
2376
2377         Enable UI process storage
2378         https://bugs.webkit.org/show_bug.cgi?id=115879
2379         <rdar://problem/12239765>
2380
2381         Reviewed by Beth Dakin.
2382
2383         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
2384         Flip the switch.
2385
2386 2013-05-09  Anders Carlsson  <andersca@apple.com>
2387
2388         Remove extra spaces between right angle brackets in template declarations
2389         https://bugs.webkit.org/show_bug.cgi?id=115877
2390
2391         Reviewed by Beth Dakin.
2392
2393         C++11 doesn't require spaces between right angle brackets so remove all of them.
2394
2395         * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
2396         (WebKit::NetworkBlobRegistry::registerBlobURL):
2397         (WebKit::NetworkBlobRegistry::sandboxExtensions):
2398         * NetworkProcess/FileAPI/NetworkBlobRegistry.h:
2399         (NetworkBlobRegistry):
2400         * NetworkProcess/HostRecord.h:
2401         (HostRecord):
2402         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2403         (WebKit::NetworkConnectionToWebProcess::didReceiveMessage):
2404         (WebKit::NetworkConnectionToWebProcess::didClose):
2405         (WebKit::NetworkConnectionToWebProcess::registerBlobURL):
2406         * NetworkProcess/NetworkConnectionToWebProcess.h:
2407         (NetworkConnectionToWebProcess):
2408         * NetworkProcess/NetworkProcess.h:
2409         (NetworkProcess):
2410         * NetworkProcess/NetworkResourceLoadScheduler.cpp:
2411         (WebKit::NetworkResourceLoadScheduler::servePendingRequests):
2412         (WebKit::NetworkResourceLoadScheduler::removeScheduledLoaders):
2413         * NetworkProcess/NetworkResourceLoadScheduler.h:
2414         * NetworkProcess/SchedulableLoader.cpp:
2415         (WebKit::SchedulableLoader::SchedulableLoader):
2416         * NetworkProcess/SchedulableLoader.h:
2417         (SchedulableLoader):
2418         * Platform/CoreIPC/ArgumentCoders.h:
2419         * Platform/CoreIPC/Connection.cpp:
2420         (Connection::SyncMessageState):
2421         (CoreIPC::Connection::waitForMessage):
2422         (CoreIPC::Connection::processIncomingMessage):
2423         * Platform/CoreIPC/Connection.h:
2424         (Connection):
2425         * Platform/WorkQueue.h:
2426         (WorkQueue):
2427         * PluginProcess/PluginProcess.h:
2428         (PluginProcess):
2429         * Scripts/webkit2/messages_unittest.py:
2430         (CoreIPC):
2431         * Shared/BlockingResponseMap.h:
2432         (BlockingResponseMap):
2433         * Shared/ChildProcessProxy.h:
2434         (ChildProcessProxy):
2435         * Shared/ImmutableArray.cpp:
2436         (WebKit::ImmutableArray::ImmutableArray):
2437         * Shared/ImmutableArray.h:
2438         (WebKit::ImmutableArray::adopt):
2439         (ImmutableArray):
2440         * Shared/ImmutableDictionary.cpp:
2441         (WebKit::ImmutableDictionary::keys):
2442         * Shared/ImmutableDictionary.h:
2443         (ImmutableDictionary):
2444         * Shared/Network/CustomProtocols/CustomProtocolManager.h:
2445         (CustomProtocolManager):
2446         * Shared/SecurityOriginData.cpp:
2447         (WebKit::performAPICallbackWithSecurityOriginDataVector):
2448         * Shared/SessionState.cpp:
2449         * Shared/StatisticsData.h:
2450         (StatisticsData):
2451         * Shared/UserMessageCoders.h:
2452         (WebKit::UserMessageDecoder::baseDecode):
2453         * Shared/WebArchive.cpp:
2454         (WebKit::WebArchive::WebArchive):
2455         (WebKit::WebArchive::subresources):
2456         (WebKit::WebArchive::subframeArchives):
2457         * Shared/WebContextMenuItem.cpp:
2458         (WebKit::WebContextMenuItem::submenuItemsAsImmutableArray):
2459         * Shared/WebOpenPanelParameters.cpp:
2460         (WebKit::WebOpenPanelParameters::acceptMIMETypes):
2461         (WebKit::WebOpenPanelParameters::selectedFileNames):
2462         * Shared/mac/ArgumentCodersMac.mm:
2463         (CoreIPC::encode):
2464         * SharedWorkerProcess/SharedWorkerProcess.h:
2465         (SharedWorkerProcess):
2466         * UIProcess/API/mac/WKPrintingView.h:
2467         (WebFrameProxy):
2468         * UIProcess/API/mac/WKPrintingView.mm:
2469         (-[WKPrintingView _drawPreview:]):
2470         * UIProcess/API/mac/WKView.mm:
2471         (WebKit):
2472         * UIProcess/Downloads/DownloadProxyMap.cpp:
2473         (WebKit::DownloadProxyMap::processDidClose):
2474         * UIProcess/Downloads/DownloadProxyMap.h:
2475         (DownloadProxyMap):
2476         * UIProcess/GeolocationPermissionRequestManagerProxy.h:
2477         (GeolocationPermissionRequestManagerProxy):
2478         * UIProcess/Launcher/mac/DynamicLinkerEnvironmentExtractor.h:
2479         (DynamicLinkerEnvironmentExtractor):
2480         * UIProcess/Network/CustomProtocols/CustomProtocolManagerProxy.h:
2481         (CustomProtocolManagerProxy):
2482         * UIProcess/Network/NetworkProcessProxy.h:
2483         (NetworkProcessProxy):
2484         * UIProcess/Notifications/NotificationPermissionRequestManagerProxy.h:
2485         (NotificationPermissionRequestManagerProxy):
2486         * UIProcess/Notifications/WebNotificationManagerProxy.h:
2487         (WebNotificationManagerProxy):
2488         * UIProcess/Plugins/PluginProcessManager.h:
2489         (PluginProcessManager):
2490         * UIProcess/Plugins/PluginProcessProxy.h:
2491         (PluginProcessProxy):
2492         * UIProcess/Plugins/WebPluginSiteDataManager.cpp:
2493         (WebKit::WebPluginSiteDataManager::didGetSitesWithData):
2494         * UIProcess/Plugins/WebPluginSiteDataManager.h:
2495         (WebPluginSiteDataManager):
2496         * UIProcess/SharedWorkers/SharedWorkerProcessManager.h:
2497         (SharedWorkerProcessManager):
2498         * UIProcess/SharedWorkers/SharedWorkerProcessProxy.h:
2499         (SharedWorkerProcessProxy):
2500         * UIProcess/StatisticsRequest.cpp:
2501         (WebKit::StatisticsRequest::completedRequest):
2502         * UIProcess/Storage/StorageManager.cpp:
2503         (StorageManager::StorageArea):
2504         (WebKit::StorageManager::StorageArea::dispatchEvents):
2505         (StorageManager::SessionStorageNamespace):
2506         (WebKit::StorageManager::SessionStorageNamespace::getOrCreateStorageArea):
2507         (WebKit::StorageManager::SessionStorageNamespace::cloneTo):
2508         (WebKit::StorageManager::createLocalStorageMap):
2509         (WebKit::StorageManager::createSessionStorageMap):
2510         (WebKit::StorageManager::destroyStorageMap):
2511         (WebKit::StorageManager::invalidateConnectionInternal):
2512         (WebKit::StorageManager::findStorageArea):
2513         (WebKit::StorageManager::getOrCreateLocalStorageNamespace):
2514         * UIProcess/Storage/StorageManager.h:
2515         (StorageManager):
2516         * UIProcess/WebApplicationCacheManagerProxy.h:
2517         (WebApplicationCacheManagerProxy):
2518         * UIProcess/WebBackForwardList.cpp:
2519         (WebKit::WebBackForwardList::addItem):
2520         (WebKit::WebBackForwardList::backListAsImmutableArrayWithLimit):
2521         (WebKit::WebBackForwardList::forwardListAsImmutableArrayWithLimit):
2522         (WebKit::WebBackForwardList::clear):
2523         * UIProcess/WebBackForwardList.h:
2524         (WebKit):
2525         * UIProcess/WebContext.cpp:
2526         (WebKit::WebContext::createNewWebProcess):
2527         (WebKit::WebContext::enableProcessTermination):
2528         (WebKit::WebContext::pluginInfoStoreDidLoadPlugins):
2529         * UIProcess/WebContext.h:
2530         (WebContext):
2531         * UIProcess/WebCookieManagerProxy.cpp:
2532         (WebKit::WebCookieManagerProxy::didGetHostnamesWithCookies):
2533         * UIProcess/WebCookieManagerProxy.h:
2534         (WebCookieManagerProxy):
2535         * UIProcess/WebDatabaseManagerProxy.cpp:
2536         (WebKit::WebDatabaseManagerProxy::didGetDatabasesByOrigin):
2537         (WebKit::WebDatabaseManagerProxy::didGetDatabaseOrigins):
2538         * UIProcess/WebDatabaseManagerProxy.h:
2539         (WebDatabaseManagerProxy):
2540         * UIProcess/WebFormClient.cpp:
2541         (WebKit::WebFormClient::willSubmitForm):
2542         * UIProcess/WebFormClient.h:
2543         (WebFormClient):
2544         * UIProcess/WebKeyValueStorageManagerProxy.h:
2545         (WebKeyValueStorageManagerProxy):
2546         * UIProcess/WebLoaderClient.cpp:
2547         (WebKit::WebLoaderClient::didChangeBackForwardList):
2548         * UIProcess/WebLoaderClient.h:
2549         (WebLoaderClient):
2550         * UIProcess/WebMediaCacheManagerProxy.cpp:
2551         (WebKit::WebMediaCacheManagerProxy::didGetHostnamesWithMediaCache):
2552         * UIProcess/WebMediaCacheManagerProxy.h:
2553         (WebMediaCacheManagerProxy):
2554         * UIProcess/WebPageContextMenuClient.cpp:
2555         (WebKit::WebPageContextMenuClient::showContextMenu):
2556         * UIProcess/WebPageProxy.cpp:
2557         (ExceededDatabaseQuotaRecords):
2558         (WebKit::WebPageProxy::relatedPages):
2559         (WebKit::WebPageProxy::didChangeBackForwardList):
2560         (WebKit::WebPageProxy::handleWheelEvent):
2561         (WebKit::WebPageProxy::processNextQueuedWheelEvent):
2562         (WebKit::WebPageProxy::findStringMatches):
2563         (WebKit::WebPageProxy::willSubmitForm):
2564         (WebKit::WebPageProxy::pluginInformationDictionary):
2565         (WebKit::WebPageProxy::didFindStringMatches):
2566         (WebKit::WebPageProxy::didReceiveEvent):
2567         * UIProcess/WebPageProxy.h:
2568         (WebPageProxy):
2569         * UIProcess/WebPageProxy.messages.in:
2570         * UIProcess/WebProcessProxy.cpp:
2571         (WebKit::WebProcessProxy::disconnect):
2572         (WebKit::WebProcessProxy::didClose):
2573         (WebKit::WebProcessProxy::didBecomeUnresponsive):
2574         (WebKit::WebProcessProxy::interactionOccurredWhileUnresponsive):
2575         (WebKit::WebProcessProxy::didBecomeResponsive):
2576         (WebKit::WebProcessProxy::disconnectFramesFromPage):
2577         (WebKit::WebProcessProxy::frameCountInPage):
2578         * UIProcess/WebProcessProxy.h:
2579         (WebProcessProxy):
2580         * UIProcess/WebResourceCacheManagerProxy.h:
2581         (WebResourceCacheManagerProxy):
2582         * UIProcess/mac/WebContextMenuProxyMac.mm:
2583         (WebKit::populateNSMenu):
2584         (WebKit::nsMenuItemVector):
2585         * WebProcess/ApplicationCache/WebApplicationCacheManager.cpp:
2586         (WebKit::WebApplicationCacheManager::getApplicationCacheOrigins):
2587         * WebProcess/Geolocation/WebGeolocationManager.cpp:
2588         (WebKit::WebGeolocationManager::didChangePosition):
2589         (WebKit::WebGeolocationManager::didFailToDeterminePosition):
2590         * WebProcess/IconDatabase/WebIconDatabaseProxy.h:
2591         (WebIconDatabaseProxy):
2592         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.mm:
2593         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2594         (WebKit::InjectedBundle::originsWithApplicationCache):
2595         * WebProcess/InjectedBundle/InjectedBundleBackForwardListItem.cpp:
2596         (WebKit::InjectedBundleBackForwardListItem::children):
2597         * WebProcess/InjectedBundle/InjectedBundlePageEditorClient.cpp:
2598         (WebKit::InjectedBundlePageEditorClient::getPasteboardDataForRange):
2599         * WebProcess/InjectedBundle/InjectedBundlePageEditorClient.h:
2600         (InjectedBundlePageEditorClient):
2601         * WebProcess/InjectedBundle/InjectedBundlePageFormClient.cpp:
2602         (WebKit::InjectedBundlePageFormClient::willSendSubmitEvent):
2603         (WebKit::InjectedBundlePageFormClient::willSubmitForm):
2604         * WebProcess/InjectedBundle/InjectedBundlePageFormClient.h:
2605         (InjectedBundlePageFormClient):
2606         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp:
2607         (WebKit::InjectedBundlePageLoaderClient::featuresUsedInPage):
2608         * WebProcess/Network/WebResourceLoadScheduler.cpp:
2609         (WebKit::WebResourceLoadScheduler::internallyFailedLoadTimerFired):
2610         (WebKit::WebResourceLoadScheduler::networkProcessCrashed):
2611         * WebProcess/Network/WebResourceLoadScheduler.h:
2612         (WebResourceLoadScheduler):
2613         * WebProcess/Notifications/NotificationPermissionRequestManager.h:
2614         (NotificationPermissionRequestManager):
2615         * WebProcess/Notifications/WebNotificationManager.h:
2616         (WebNotificationManager):
2617         * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp:
2618         (WebKit::NPRuntimeObjectMap::invalidate):
2619         * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.h:
2620         (NPRuntimeObjectMap):
2621         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
2622         (WebKit::NetscapePlugin::stopAllStreams):
2623         * WebProcess/Plugins/Netscape/NetscapePlugin.h:
2624         (NetscapePlugin):
2625         * WebProcess/Plugins/Netscape/NetscapePluginStream.h:
2626         (NetscapePluginStream):
2627         * WebProcess/Plugins/PDF/SimplePDFPlugin.mm:
2628         (getAllScriptsInPDFDocument):
2629         (WebKit::SimplePDFPlugin::runScriptsInPDFDocument):
2630         * WebProcess/Plugins/PluginProcessConnectionManager.h:
2631         (PluginProcessConnectionManager):
2632         * WebProcess/Plugins/PluginView.cpp:
2633         (WebKit::PluginView::cancelAllStreams):
2634         * WebProcess/Plugins/PluginView.h:
2635         (PluginView):
2636         * WebProcess/Storage/StorageAreaMap.cpp:
2637         (WebKit::StorageAreaMap::dispatchSessionStorageEvent):
2638         (WebKit::StorageAreaMap::dispatchLocalStorageEvent):
2639         * WebProcess/Storage/StorageNamespaceImpl.cpp:
2640         (WebKit::StorageNamespaceImpl::storageArea):
2641         * WebProcess/Storage/StorageNamespaceImpl.h:
2642         (StorageNamespaceImpl):
2643         * WebProcess/Storage/WebKeyValueStorageManager.cpp:
2644         (WebKit::keyValueStorageOriginIdentifiers):
2645         * WebProcess/WebCoreSupport/WebDatabaseManager.cpp:
2646         (WebKit::WebDatabaseManager::getDatabasesByOrigin):
2647         (WebKit::WebDatabaseManager::getDatabaseOrigins):
2648         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
2649         (WebKit::WebEditorClient::getClientPasteboardDataForRange):
2650         * WebProcess/WebCoreSupport/WebEditorClient.h:
2651         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2652         (WebKit::WebFrameLoaderClient::dispatchWillSubmitForm):
2653         * WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
2654         (WebKit::WebEditorClient::documentFragmentFromAttributedString):
2655         * WebProcess/WebPage/EventDispatcher.h:
2656         (EventDispatcher):
2657         * WebProcess/WebPage/FindController.cpp:
2658         (WebKit::FindController::findStringMatches):
2659         * WebProcess/WebPage/FindController.h:
2660         (FindController):
2661         * WebProcess/WebPage/WebBackForwardListProxy.cpp:
2662         (WebKit):
2663         * WebProcess/WebPage/WebFrame.cpp:
2664         (WebKit::WebFrame::childFrames):
2665         * WebProcess/WebPage/WebPage.cpp:
2666         (WebKit::WebPage::trackedRepaintRects):
2667         * WebProcess/WebPage/WebPage.h:
2668         (WebKit):
2669         (WebPage):
2670         * WebProcess/WebPage/mac/LayerTreeHostMac.h:
2671         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
2672         (TiledCoreAnimationDrawingArea):
2673         * WebProcess/WebProcess.cpp:
2674         (WebKit::WebProcess::visitedLinkStateChanged):
2675         (WebKit::WebProcess::allVisitedLinkStateChanged):
2676         (WebKit::WebProcess::focusedWebPage):
2677         (WebKit::WebProcess::createWebPage):
2678         (WebKit::WebProcess::didClose):
2679         (WebKit::WebProcess::webPageGroup):
2680         (WebKit::addCaseFoldedCharacters):
2681         (WebKit::getWebCoreMemoryCacheStatistics):
2682         (WebKit::WebProcess::setTextCheckerState):
2683         * WebProcess/WebProcess.h:
2684         (WebProcess):
2685
2686 2013-05-09  Anders Carlsson  <andersca@apple.com>
2687
2688         Implement WebPlatformStrategies::transientLocalStorageNamespace
2689         https://bugs.webkit.org/show_bug.cgi?id=115876
2690         <rdar://problem/13852871>
2691
2692         Reviewed by Beth Dakin.
2693
2694         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
2695         (WebKit::WebPlatformStrategies::transientLocalStorageNamespace):
2696         Return a session storage namespace for a random page when UI process storage is enabled,
2697         otherwise call the base class implementation.
2698
2699 2013-05-09  Anders Carlsson  <andersca@apple.com>
2700
2701         Use explicit qualifiers for names in the std:: namespace
2702         https://bugs.webkit.org/show_bug.cgi?id=115868
2703
2704         Reviewed by Andreas Kling.
2705
2706         * Shared/mac/ArgumentCodersMac.mm:
2707         (CoreIPC::encode):
2708         * UIProcess/API/C/WKPluginSiteDataManager.cpp:
2709         (WKPluginSiteDataManagerClearAllSiteData):
2710         * UIProcess/Plugins/PluginInfoStore.cpp:
2711         (WebKit::PluginInfoStore::findPluginForExtension):
2712         * UIProcess/WebFrameProxy.cpp:
2713         * UIProcess/WebProcessProxy.cpp:
2714         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
2715         (WebKit::parsePostBuffer):
2716         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
2717         (WebKit::NetscapePlugin::loadURL):
2718         * WebProcess/Plugins/Netscape/NetscapePluginStream.cpp:
2719         (WebKit::NetscapePluginStream::deliverDataToPlugin):
2720         * WebProcess/Plugins/PDF/SimplePDFPlugin.mm:
2721         * WebProcess/WebPage/DrawingAreaImpl.cpp:
2722         * WebProcess/WebPage/FindController.cpp:
2723         (WebKit::FindController::countStringMatches):
2724         (WebKit::FindController::updateFindUIAfterPageScroll):
2725         * WebProcess/WebPage/WebPage.cpp:
2726         * WebProcess/WebPage/mac/WebPageMac.mm:
2727         (WebKit::drawPDFPage):
2728         * WebProcess/mac/WebProcessMac.mm:
2729
2730 2013-05-09  Max Feil  <mfeil@rim.com>
2731
2732         shouldUsePluginDocument() needs to be respected when a document is created
2733         https://bugs.webkit.org/show_bug.cgi?id=110308
2734
2735         Reviewed by Rob Buis.
2736
2737         Renaming shouldUsePluginDocument() to shouldAlwaysUsePluginDocument()
2738         for clarity.
2739
2740         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2741         (WebKit::WebFrameLoaderClient::shouldAlwaysUsePluginDocument):
2742         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
2743         (WebFrameLoaderClient):
2744
2745 2013-05-09  Timothy Hatcher  <timothy@apple.com>
2746
2747         Make dragging off a tab in Safari with a docked Inspector reattach the Inspector.
2748
2749         https://webkit.org/b/115832
2750         rdar://problem/13605661
2751
2752         Reviewed by Benjamin Poulain.
2753
2754         * UIProcess/mac/WebInspectorProxyMac.mm:
2755         (WebKit::WebInspectorProxy::platformBringToFront):
2756         If the Web Inspector is no longer in the same window as the inspected view,
2757         then we need to reopen the Inspector to get it attached to the right window.
2758
2759 2013-05-08  Anders Carlsson  <andersca@apple.com>
2760
2761         Fix a typo in a comment.
2762
2763         Rubber-stamped by Darin Adler.
2764
2765         * WebProcess/WebProcess.cpp:
2766         (WebKit::WebProcess::initializeConnection):
2767
2768 2013-05-08  Anders Carlsson  <andersca@apple.com>
2769
2770         Remove bogus StorageAreaMap assertions
2771         https://bugs.webkit.org/show_bug.cgi?id=115838
2772
2773         Reviewed by Sam Weinig.
2774
2775         It is possible for didGetValues, and didClear to be called even if m_hasPendingClear is false so remove the assertions.
2776
2777         * WebProcess/Storage/StorageAreaMap.cpp:
2778         (WebKit::StorageAreaMap::didGetValues):
2779         (WebKit::StorageAreaMap::didClear):
2780
2781 2013-05-08  Anders Carlsson  <andersca@apple.com>
2782
2783         Handle incoming clear operations
2784         https://bugs.webkit.org/show_bug.cgi?id=115829
2785
2786         Reviewed by Sam Weinig.
2787
2788         Handle clear by building up a new storage map with our pending changes.
2789
2790         * WebProcess/Storage/StorageAreaMap.cpp:
2791         (WebKit::StorageAreaMap::applyChange):
2792
2793 2013-05-08  Anders Carlsson  <andersca@apple.com>
2794
2795         Don't apply changes while we're clearing the database
2796         https://bugs.webkit.org/show_bug.cgi?id=115826
2797
2798         Reviewed by Darin Adler.
2799
2800         * UIProcess/Storage/LocalStorageDatabase.cpp:
2801         (WebKit::LocalStorageDatabase::openDatabase):
2802         Only call didOpenDatabaseWithOrigin if we actually did open the database.
2803
2804         (WebKit::LocalStorageDatabase::updateDatabaseWithChangedItems):
2805         Create the database if needed.
2806
2807         * UIProcess/Storage/StorageManager.cpp:
2808         (WebKit::StorageManager::getValues):
2809         Send back a DidGetValues message.
2810
2811         * WebProcess/Storage/StorageAreaMap.cpp:
2812         (WebKit::StorageAreaMap::StorageAreaMap):
2813         Initialize m_hasPendingClear.
2814
2815         (WebKit::StorageAreaMap::clear):
2816         Set m_hasPendingClear to true.
2817
2818         (WebKit::StorageAreaMap::resetValues):
2819         Set m_hasPendingClear back to false.
2820
2821         (WebKit::StorageAreaMap::loadValuesIfNeeded):
2822         Set m_hasPendingClear to true so we'll ignore any changes that are already part of the returned items.
2823
2824         (WebKit::StorageAreaMap::didGetValues):
2825         Set m_hasPendingClear back to false.
2826
2827         (WebKit::StorageAreaMap::didClear):
2828         Set m_hasPendingClear back to false.
2829
2830         (WebKit::StorageAreaMap::applyChange):
2831         Don't apply the change if m_hasPendingClear is true.
2832
2833         * WebProcess/Storage/StorageAreaMap.messages.in:
2834         Add DidGetValues message.
2835
2836 2013-05-08  Andy Estes  <aestes@apple.com>
2837
2838         [WebKit2] REGRESSION (Custom Protocols): Reproducible crash when navigating to URL with an invalid scheme
2839         https://bugs.webkit.org/show_bug.cgi?id=115790
2840
2841         Reviewed by Alexey Proskuryakov.
2842
2843         NSMutableSet does not support adding or removing nil objects, and
2844         WTF::HashSet does not support adding, removing, or checking for null
2845         WTF::Strings.
2846
2847         For the NSMutableSet case, make sure that we don't try to add or remove
2848         nil NSStrings.
2849
2850         For the WTF::HashSet case, NSURL will return a nil NSString if we ask
2851         it for its scheme when it is invalid, which we will convert to a null
2852         WTF::String. Don't try to check if our HashSet of registered schemes
2853         contains a null String.
2854
2855         * Shared/Network/CustomProtocols/mac/CustomProtocolManagerMac.mm:
2856         (WebKit::CustomProtocolManager::registerScheme): Assert that the scheme
2857         isn't null. We reject null schemes at the WKBrowsingContextController level.
2858         (WebKit::CustomProtocolManager::unregisterScheme): Ditto.
2859         (WebKit::CustomProtocolManager::supportsScheme): If scheme is null, return false.
2860         * UIProcess/API/mac/WKBrowsingContextController.mm:
2861         (+[WKBrowsingContextController registerSchemeForCustomProtocol:]): Do not register a nil scheme.
2862         (+[WKBrowsingContextController unregisterSchemeForCustomProtocol:]): Ditto.
2863
2864 2013-05-08  Anders Carlsson  <andersca@apple.com>
2865
2866         Apply remote changes to storage maps locally
2867         https://bugs.webkit.org/show_bug.cgi?id=115825
2868
2869         Reviewed by Beth Dakin.
2870
2871         * WebProcess/Storage/StorageAreaMap.cpp:
2872         (WebKit::StorageAreaMap::resetValues):
2873         Clear the pending values map.
2874
2875         (WebKit::StorageAreaMap::didSetItem):
2876         If we failed to set the item, forget everything we know about this storage map.
2877         Otherwise, remove the pending item.
2878
2879         (WebKit::StorageAreaMap::didRemoveItem):
2880         Remove the pending item.
2881
2882         (WebKit::StorageAreaMap::shouldApplyChangeForKey):
2883         Helper function that returns whether a change for a given key should be applied.
2884
2885         (WebKit::StorageAreaMap::applyChange):
2886         Apply the change. Currently only adds and removes are handled.
2887
2888         (WebKit::StorageAreaMap::dispatchStorageEvent):
2889         Apply the change locally as well if needed.
2890
2891         * WebProcess/Storage/StorageAreaMap.h:
2892
2893 2013-05-08  Anders Carlsson  <andersca@apple.com>
2894
2895         Assert at compile time that we don't pass Objective-C object pointers to adoptCF
2896         https://bugs.webkit.org/show_bug.cgi?id=115823
2897
2898         Reviewed by Geoffrey Garen.
2899
2900         Fix adoptNS/adoptCF mismatches. For the adopt(leakRef()) case we'd ideally want a static_pointer_cast overload for RetainPtr,
2901         but this will do for now.
2902         
2903         * Shared/mac/ArgumentCodersMac.mm:
2904         (CoreIPC::decode):
2905
2906 2013-05-08  Sam Weinig  <sam@webkit.org>
2907
2908         Add SPI to determine if a plugin is sandboxed
2909         https://bugs.webkit.org/show_bug.cgi?id=115810
2910
2911         Reviewed by Anders Carlsson.
2912
2913         * PluginProcess/mac/PluginProcessMac.mm:
2914         (WebKit::PluginProcess::initializeSandbox):
2915         * Shared/Plugins/mac/PluginSandboxProfile.h: Added.
2916         * Shared/Plugins/mac/PluginSandboxProfile.mm: Added.
2917         (WebKit::pluginSandboxProfileDefaultDirectory):
2918         (WebKit::pluginSandboxProfileDirectories):
2919         (WebKit::pluginSandboxProfileName):
2920         (WebKit::pluginSandboxCommonProfile):
2921         (WebKit::pluginSandboxProfileForDirectory):
2922         (WebKit::pluginSandboxProfile):
2923         (WebKit::pluginHasSandboxProfileForDirectory):
2924         (WebKit::pluginHasSandboxProfile):
2925         Move sandbox code to its own file and refactor to use cocoa. Also adds pluginHasSandboxProfile function
2926         which uses the newly refactored code.
2927
2928         * UIProcess/API/C/mac/WKContextPrivateMac.h:
2929         * UIProcess/API/C/mac/WKContextPrivateMac.mm:
2930         (WKPlugInInfoIsSandboxedKey):
2931         (createInfoDictionary):
2932         Add WKPlugInInfoIsSandboxedKey.
2933
2934         * WebKit2.xcodeproj/project.pbxproj:
2935         Add new files.
2936
2937 2013-05-08  Anders Carlsson  <andersca@apple.com>
2938
2939         Safari unexpectedly quits with invalid message from the web process with message ID 0x323002f (WebPageProxy.DecidePolicyForNavigationAction)
2940         https://bugs.webkit.org/show_bug.cgi?id=115814
2941         <rdar://problem/12331258>
2942
2943         Reviewed by Andreas Kling.
2944
2945         To ensure that any asynchronous messages are delivered to the UI process before
2946         synchronous messages (except when doing so would lead to a deadlock), Call
2947         setOnlySendMessagesAsDispatchWhenWaitingForSyncReplyWhenProcessingSuchAMessage on the UI process connections.
2948
2949         * WebProcess/WebProcess.cpp:
2950         (WebKit::WebProcess::initializeConnection):
2951
2952 2013-05-08  Tim Horton  <timothy_horton@apple.com>
2953
2954         Coalesce WKView visibleRect changes
2955         https://bugs.webkit.org/show_bug.cgi?id=115792
2956         <rdar://problem/13776842>
2957
2958         Reviewed by Simon Fraser.
2959
2960         The system can call renewGState much more often than we actually want
2961         to update the WebProcess' notion of the exposed rect. Most importantly,
2962         within an autolayout pass it is called many times, and often sees
2963         [WKView visibleRect] be an intermediate value which will never be
2964         flushed to the screen. We only care about the final value, so we should
2965         wait until AppKit has finished - with a zero-delay timer - to inform the
2966         WebProcess of exposed rect changes.
2967
2968         * UIProcess/WebPageProxy.cpp:
2969         (WebKit::WebPageProxy::WebPageProxy):
2970         Add exposedRectChangedTimer.
2971         (WebKit::WebPageProxy::close):
2972         Cancel exposedRectChangedTimer when tearing down the WebPageProxy.
2973         * UIProcess/WebPageProxy.h:
2974         (WebPageProxy):
2975         Add exposedRectChangedTimerFired, the timer itself, and two rects:
2976         the most recent exposed rect from the WKView, and the last one we actually
2977         sent across to the WebProcess.
2978         * UIProcess/mac/WebPageProxyMac.mm:
2979         (WebKit::WebPageProxy::viewExposedRectChanged):
2980         Instead of immediately sending exposed rect changes to the WebProcess,
2981         start a zero-delay timer to do so.
2982         (WebKit::WebPageProxy::exposedRectChangedTimerFired):
2983         Once the zero-delay timer fires, send the new exposed rect to the WebProcess.
2984
2985 2013-05-08  Alexey Proskuryakov  <ap@apple.com>
2986
2987         <rdar://problem/13776220> 13A451: PluginProcess(2225) deny file-read-data ~/Library/InputManagers
2988         <rdar://problem/13642510> PluginProcess logs sandbox violations initializing TextServices
2989
2990         Reviewed by Anders Carlsson.
2991
2992         * Resources/PlugInSandboxProfiles/com.apple.WebKit.plugin-common.sb: Allow more
2993         TextServices and NSInputManager directories.
2994
2995 2013-05-08  Anders Carlsson  <andersca@apple.com>
2996
2997         Remove BinarySemaphoreWin.cpp.
2998
2999         Rubber-stamped by Beth Dakin.
3000
3001         BinarySemaphoreWin has been moved to WTF, but the original was never removed.
3002
3003         * Platform/CoreIPC/win/BinarySemaphoreWin.cpp: Removed.
3004
3005 2013-05-08  Zan Dobersek  <zdobersek@igalia.com>
3006
3007         [WK2] Make the WebNetworkInfoManager a supplement to the WebProcess
3008         https://bugs.webkit.org/show_bug.cgi?id=115716
3009
3010         Reviewed by Andreas Kling.
3011
3012         WebNetworkInfoManager should inherit from WebProcessSupplement and should be used
3013         as such by the WebProcess. This removes the need for the m_networkInfoManager member
3014         variable in the WebProcess class and brings the WebNetworkInfoManager in line with
3015         other manager classes of which instances are controlled by the WebProcess class.
3016
3017         * WebProcess/NetworkInfo/WebNetworkInfoManager.cpp:
3018         (WebKit::WebNetworkInfoManager::supplementName): Specify the supplement's name.
3019         (WebKit):
3020         * WebProcess/NetworkInfo/WebNetworkInfoManager.h:
3021         (WebKit): Alphabetically reorder the two forwarding declarations.
3022         (WebNetworkInfoManager): Inherit from the WebProcessSupplement interface.
3023         * WebProcess/WebCoreSupport/WebNetworkInfoClient.cpp:
3024         (WebKit::WebNetworkInfoClient::bandwidth): Access the WebNetworkInfoManager as a supplement.
3025         (WebKit::WebNetworkInfoClient::metered): Ditto.
3026         (WebKit::WebNetworkInfoClient::startUpdating): Ditto.
3027         (WebKit::WebNetworkInfoClient::stopUpdating): Ditto.
3028         (WebKit::WebNetworkInfoClient::networkInfoControllerDestroyed): Ditto.
3029         * WebProcess/WebProcess.cpp:
3030         (WebKit::WebProcess::WebProcess): Add the WebNetworkInfoManager instance as a supplement.
3031         * WebProcess/WebProcess.h:
3032         (WebProcess): Remove the m_networkInfoManager member variable and its getter method.
3033
3034 2013-05-08  Zan Dobersek  <zdobersek@igalia.com>
3035
3036         [WK2] Make the WebBatteryManager a supplement to the WebProcess
3037         https://bugs.webkit.org/show_bug.cgi?id=115715
3038
3039         Reviewed by Andreas Kling.
3040
3041         WebBatteryManager should inherit from WebProcessSupplement and should be used as such
3042         by the WebProcess. This removes the need for the m_batteryManager member variable in
3043         the WebProcess class and brings the WebBatteryManager in line with other manager classes
3044         of which instances are controlled by the WebProcess class.
3045
3046         * WebProcess/Battery/WebBatteryManager.cpp:
3047         (WebKit::WebBatteryManager::supplementName): Specify the supplement's name.
3048         (WebKit):
3049         * WebProcess/Battery/WebBatteryManager.h:
3050         (WebBatteryManager): Inherit from the WebProcessSupplement interface.
3051         * WebProcess/WebCoreSupport/WebBatteryClient.cpp:
3052         (WebKit::WebBatteryClient::startUpdating): Access the WebBatteryManager as a supplement.
3053         (WebKit::WebBatteryClient::stopUpdating): Ditto.
3054         (WebKit::WebBatteryClient::batteryControllerDestroyed): Ditto.
3055         * WebProcess/WebProcess.cpp:
3056         (WebKit::WebProcess::WebProcess): Add the WebBatteryManager instance as a supplement.
3057         * WebProcess/WebProcess.h:
3058         (WebProcess): Remove the m_batteryManager member variable and its getter method.
3059
3060 2013-05-06  Darin Adler  <darin@apple.com>
3061
3062         Use adoptCF and adoptNS in more places
3063         https://bugs.webkit.org/show_bug.cgi?id=115657
3064
3065         Reviewed by Sam Weinig.
3066
3067         * Shared/Downloads/cfnet/DownloadCFNet.cpp:
3068         (WebKit::Download::useCredential):
3069         (WebKit::Download::start):
3070         (WebKit::Download::startWithHandle):
3071         (WebKit::Download::cancel):
3072         (WebKit::Download::didDecideDestination):
3073         Use adoptCF and adoptNS.
3074
3075 2013-05-06  Sam Weinig  <sam@webkit.org>
3076
3077         Add SPI to get an array of all the installed plug-ins
3078         https://bugs.webkit.org/show_bug.cgi?id=115688
3079
3080         Reviewed by Anders Carlsson.
3081
3082         * UIProcess/API/C/mac/WKContextPrivateMac.h:
3083         * UIProcess/API/C/mac/WKContextPrivateMac.mm:
3084         (createInfoDictionary):
3085         Extract creation of info dictionary into helper.
3086         (WKContextCopyPlugInInfoForBundleIdentifier):
3087         Modified to use the new helper.
3088         (WKContextGetInfoForInstalledPlugIns):
3089         Added.
3090
3091 2013-05-07  Anders Carlsson  <andersca@apple.com>
3092
3093         Clean up KeyframeValueList and related classes
3094         https://bugs.webkit.org/show_bug.cgi?id=115738
3095
3096         Reviewed by Simon Fraser.
3097
3098         Update for WebCore changes.
3099
3100         * Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp:
3101         (CoreIPC::::decode):
3102
3103 2013-05-07  Anders Carlsson  <andersca@apple.com>
3104
3105         Add and remove databases and origins from the database tracker
3106         https://bugs.webkit.org/show_bug.cgi?id=115752
3107
3108         Reviewed by Andreas Kling.
3109
3110         * UIProcess/Storage/LocalStorageDatabase.cpp:
3111         (WebKit::LocalStorageDatabase::LocalStorageDatabase):
3112         Rename m_databaseFilename to m_databasePath.
3113
3114         (WebKit::LocalStorageDatabase::tryToOpenDatabase):
3115         Rename m_databaseFilename to m_databasePath.
3116
3117         * UIProcess/Storage/LocalStorageDatabase.h:
3118         Rename m_databaseFilename to m_databasePath.
3119
3120         * UIProcess/Storage/LocalStorageDatabaseTracker.cpp:
3121         (WebKit::LocalStorageDatabaseTracker::databasePath):
3122         Rename databaseFilename to databasePath.
3123
3124         (WebKit::LocalStorageDatabaseTracker::didOpenDatabaseWithOrigin):
3125         Call addDatabaseWithOriginIdentifier.
3126
3127         (WebKit::LocalStorageDatabaseTracker::deleteEmptyDatabaseWithOrigin):
3128         Call removeDatabaseWithOriginIdentifier.
3129
3130         (WebKit::LocalStorageDatabaseTracker::trackerDatabasePath):
3131         Call databasePath instead of databaseFile.
3132
3133         (WebKit::LocalStorageDatabaseTracker::openTrackerDatabase):
3134         Bail if the database is already open.
3135
3136         (WebKit::LocalStorageDatabaseTracker::updateTrackerDatabaseFromLocalStorageDatabaseFiles):
3137         Call addDatabaseWithOriginIdentifier if this is an origin we don't know about.
3138
3139         (WebKit::LocalStorageDatabaseTracker::addDatabaseWithOriginIdentifier):
3140         Add the database to the Origins table.
3141
3142         (WebKit::LocalStorageDatabaseTracker::removeDatabaseWithOriginIdentifier):
3143         remove the database from the Origins table and delete it.
3144
3145         (WebKit::LocalStorageDatabaseTracker::pathForDatabaseWithOriginIdentifier):
3146         Helper function that looks up a database path given its identifier.
3147         
3148         * UIProcess/Storage/LocalStorageDatabaseTracker.h:
3149         Rename databaseFile to databasePath.
3150
3151 2013-05-07  Anders Carlsson  <andersca@apple.com>
3152
3153         The storage database tracker should know when databases come and go
3154         https://bugs.webkit.org/show_bug.cgi?id=115748
3155
3156         Reviewed by Andreas Kling.
3157
3158         * UIProcess/Storage/LocalStorageDatabase.cpp:
3159         (WebKit::LocalStorageDatabase::openDatabase):
3160         If we've opened the database successfully, call LocalStorageDatabaseTracker::didOpenDatabaseWithOrigin.
3161
3162         (WebKit::LocalStorageDatabase::tryToOpenDatabase):
3163         Remove a FIXME; we run all storage related things on the same thread.
3164
3165         (WebKit::LocalStorageDatabase::close):
3166         Close the database. If it's empty, call LocalStorageDatabaseTracker::deleteEmptyDatabaseWithOrigin.
3167
3168         (WebKit::LocalStorageDatabase::databaseIsEmpty):
3169         Helper function for determining whether a database is empty.
3170         
3171         * UIProcess/Storage/LocalStorageDatabase.h:
3172         * UIProcess/Storage/LocalStorageDatabaseTracker.cpp:
3173         (WebKit::LocalStorageDatabaseTracker::databaseFilename):
3174         Add ".localstorage" to the filename.
3175
3176         (WebKit::LocalStorageDatabaseTracker::didOpenDatabaseWithOrigin):
3177         (WebKit::LocalStorageDatabaseTracker::deleteEmptyDatabaseWithOrigin):
3178         Add empty stubs.
3179
3180 2013-05-07  Brady Eidson  <beidson@apple.com>
3181
3182         Add JoinExistingSession to the Networking XPC.
3183         <rdar://problem/12902288> and https://bugs.webkit.org/show_bug.cgi?id=114991
3184
3185         Reviewed by Sam Weinig.
3186
3187         * NetworkProcess/EntryPoint/mac/XPCService/NetworkService.Development/Info.plist:
3188         * NetworkProcess/EntryPoint/mac/XPCService/NetworkService/Info.plist:
3189
3190 2013-05-07  Anders Carlsson  <andersca@apple.com>
3191
3192         REGRESSION(r149647): Assertion failure in LocalStorageDatabaseTracker::setLocalStorageDirectoryInternal
3193         https://bugs.webkit.org/show_bug.cgi?id=115711
3194
3195         Reviewed by Andreas Kling.
3196
3197         Handle setting the local storage directory more than once.
3198
3199         * UIProcess/Storage/LocalStorageDatabaseTracker.cpp:
3200         (WebKit::LocalStorageDatabaseTracker::setLocalStorageDirectoryInternal):
3201         Close the database (if necessary) and clear the origins map before importing the origin identifiers.
3202
3203 2013-05-07  Antoine Quint  <graouts@apple.com>
3204
3205         Re-establish autostart timeout extension on user interaction
3206         https://bugs.webkit.org/show_bug.cgi?id=113232
3207
3208         Change WebProcess::pluginDidReceiveUserInteraction to use a tuple of
3209         (pluginOrigin, pageOrigin, mimeType) arguments like the other similar
3210         WebProcess methods and gather these arguments from the PlugInView's
3211         plug-in element.
3212
3213         Reviewed by Dean Jackson.
3214
3215         * WebProcess/Plugins/PluginView.cpp:
3216         (WebKit::PluginView::pluginDidReceiveUserInteraction):
3217         Cast the m_pluginElement to a HTMLPlugInImageElement so we can obtain the
3218         tuple of (pluginOrigin, pageOrigin, mimeType) to pass to pluginDidReceiveUserInteraction().
3219
3220         * WebProcess/WebProcess.cpp:
3221         (WebKit::WebProcess::plugInDidReceiveUserInteraction):
3222         * WebProcess/WebProcess.h:
3223         (WebProcess):
3224         Update method signature to a tuple of (pluginOrigin, pageOrigin, mimeType)
3225         and obtain the plug-in origin hash from that.
3226
3227 2013-05-07  Anders Carlsson  <andersca@apple.com>
3228
3229         Each local storage database should know its origin
3230         https://bugs.webkit.org/show_bug.cgi?id=115737
3231
3232         Reviewed by Andreas Kling.
3233
3234         Store the security origin in a member variable. It'll be used to communicate database state changes to the tracker.
3235
3236         * UIProcess/Storage/LocalStorageDatabase.cpp:
3237         (WebKit::LocalStorageDatabase::create):
3238         (WebKit::LocalStorageDatabase::LocalStorageDatabase):
3239         * UIProcess/Storage/LocalStorageDatabase.h:
3240         (LocalStorageDatabase):
3241
3242 2013-05-07  Brady Eidson  <beidson@apple.com>
3243
3244         Remove some unnecessary soft linking in NetworkProcess. (Take 2)
3245         <rdar://problem/13821779> and https://bugs.webkit.org/show_bug.cgi?id=115683
3246
3247         Reviewed by Dean Jackson and owned by Andreas Kling.
3248
3249         As a followup to r149651, include the private headers conditionally.
3250         Also, fix a bug introduced with r149651 (bool vs CFBooleanRef).
3251
3252         * NetworkProcess/mac/DiskCacheMonitor.mm:
3253         * NetworkProcess/mac/NetworkResourceLoaderMac.mm:
3254         (WebKit::NetworkResourceLoader::tryGetShareableHandleFromSharedBuffer):
3255
3256 2013-05-07  Jinwoo Song  <jinwoo7.song@samsung.com>
3257
3258         [EFL][WK2] Add ewk APIs for setting and getting user agent
3259         https://bugs.webkit.org/show_bug.cgi?id=114429
3260
3261         Reviewed by Andreas Kling.
3262
3263         Provide ewk_view_user_agent_get/set APIs which wraps WK APIs.
3264
3265         * UIProcess/API/efl/EwkView.cpp:
3266         (EwkView::EwkView):
3267         (EwkView::setUserAgent):
3268         * UIProcess/API/efl/EwkView.h:
3269         (EwkView::userAgent):
3270         (EwkView):
3271         * UIProcess/API/efl/ewk_view.cpp:
3272         (ewk_view_user_agent_get):
3273         (ewk_view_user_agent_set):
3274         * UIProcess/API/efl/ewk_view.h:
3275         * UIProcess/API/efl/tests/test_ewk2_view.cpp:
3276         (TEST_F):
3277
3278 2013-05-07  Mikhail Pozdnyakov  <mikhail.pozdnyakov@intel.com>
3279
3280         HashTraits<RefPtr<P> >::PeekType should be raw pointer for better performance
3281         https://bugs.webkit.org/show_bug.cgi?id=115646
3282
3283         Reviewed by Darin Adler.
3284
3285         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
3286         (WebKit::NetworkConnectionToWebProcess::convertMainResourceLoadToDownload):
3287         * NetworkProcess/NetworkResourceLoadScheduler.cpp:
3288         (WebKit::NetworkResourceLoadScheduler::hostForURL):
3289         * Shared/ImmutableDictionary.h:
3290         (WebKit::ImmutableDictionary::get):
3291         * UIProcess/Storage/StorageManager.cpp:
3292         (WebKit::StorageManager::createSessionStorageMap):
3293         (WebKit::StorageManager::cloneSessionStorageNamespaceInternal):
3294         (WebKit::StorageManager::findStorageArea):
3295         * UIProcess/WebContext.h:
3296         (WebKit::WebContext::supplement):
3297         * UIProcess/WebProcessProxy.cpp:
3298         (WebKit::WebProcessProxy::webBackForwardItem):
3299         (WebKit::WebProcessProxy::webFrame):
3300         * UIProcess/efl/DownloadManagerEfl.cpp:
3301         (WebKit::DownloadManagerEfl::ewkDownloadJob):
3302         * WebProcess/Network/WebResourceLoadScheduler.h:
3303         (WebKit::WebResourceLoadScheduler::webResourceLoaderForIdentifier):
3304         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
3305         (WebKit::NetscapePlugin::streamFromID):
3306         * WebProcess/Plugins/PluginProcessConnectionManager.cpp:
3307         (WebKit::PluginProcessConnectionManager::pluginProcessCrashed):
3308         * WebProcess/Plugins/PluginView.cpp:
3309         (WebKit::PluginView::cancelStreamLoad):
3310         * WebProcess/WebPage/EventDispatcher.cpp:
3311         (WebKit::EventDispatcher::wheelEvent):
3312         * WebProcess/WebPage/WebBackForwardListProxy.cpp:
3313         (WebKit::WebBackForwardListProxy::itemForID):
3314         (WebKit::WebBackForwardListProxy::itemAtIndex):
3315         * WebProcess/WebPage/WebPage.cpp:
3316         (WebKit::WebPage::webUndoStep):
3317         (WebKit::WebPage::didFinishCheckingText):
3318         (WebKit::WebPage::didCancelCheckingText):
3319         * WebProcess/WebProcess.cpp:
3320         (WebKit::WebProcess::webPage):
3321         (WebKit::WebProcess::webPageGroup):
3322             Updated accordingly to new HashMap<.., RefPtr>::get() semantics.
3323
3324 2013-05-06  Zoltan Arvai  <zarvai@inf.u-szeged.hu>
3325
3326         [Qt] Unreviewed buildfix after r149637.
3327
3328         * Target.pri:
3329
3330 2013-05-06  Ryosuke Niwa  <rniwa@webkit.org>
3331
3332         REGRESSION(r149647): Assertion failure in LocalStorageDatabaseTracker::setLocalStorageDirectoryInternal
3333         https://bugs.webkit.org/show_bug.cgi?id=115711    
3334
3335         Rubber-stamped by Anders Carlsson.
3336
3337         Temporarily removed the assertion. Andres is going to investigate it tomorrow.
3338
3339         * UIProcess/Storage/LocalStorageDatabaseTracker.cpp:
3340         (WebKit::LocalStorageDatabaseTracker::setLocalStorageDirectoryInternal):
3341
3342 2013-05-06  Darin Adler  <darin@apple.com>
3343
3344         Use OwnPtr instead of deleteAllValues in KeyframeValueList
3345         https://bugs.webkit.org/show_bug.cgi?id=115652
3346
3347         Reviewed by Simon Fraser.
3348
3349         * Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp:
3350         (CoreIPC::ArgumentCoder<GraphicsLayerAnimation>::decode): Added adoptPtr
3351         next to new when calling KeyframeValueList::insert.
3352
3353 2013-05-06  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
3354
3355         Unreviewed, build fix on EFL port
3356
3357         * CMakeLists.txt: Add LocalStorageDatabaseTracker.cpp
3358
3359 2013-05-06  Philippe Normand  <pnormand@igalia.com>
3360
3361         Unreviewed, GTK build fix after r149637.
3362
3363         * GNUmakefile.list.am: Add LocalStorageDatabaseTracker sources to
3364         the build.
3365
3366 2013-05-06  Brady Eidson  <beidson@apple.com>
3367
3368         Remove some unnecessary soft linking in NetworkProcess.
3369         <rdar://problem/13821779> and https://bugs.webkit.org/show_bug.cgi?id=115683
3370
3371         Reviewed by Sam Weinig.
3372
3373         Replace some unneeded soft linking with forward declarations.
3374
3375         * NetworkProcess/mac/DiskCacheMonitor.mm:
3376         (WebKit::DiskCacheMonitor::DiskCacheMonitor):
3377         * NetworkProcess/mac/NetworkResourceLoaderMac.mm:
3378         (WebKit::NetworkResourceLoader::tryGetShareableHandleFromCFURLCachedResponse):
3379         (WebKit::NetworkResourceLoader::tryGetShareableHandleFromSharedBuffer):
3380
3381 2013-05-06  Anders Carlsson  <andersca@apple.com>
3382
3383         More work on LocalStorageDatabaseTracker
3384         https://bugs.webkit.org/show_bug.cgi?id=115680
3385
3386         Reviewed by Andreas Kling.
3387
3388         * UIProcess/Storage/LocalStorageDatabaseTracker.cpp:
3389         (WebKit::LocalStorageDatabaseTracker::databaseFilename):
3390         Call the new databaseFilename that takes a string.
3391
3392         (WebKit::LocalStorageDatabaseTracker::setLocalStorageDirectoryInternal):
3393         Assert that we don't call this more than once. Dispatch a call to import origin identifiers.
3394
3395         (WebKit::LocalStorageDatabaseTracker::trackerDatabasePath):
3396         New helper function that returns the tracker database path.
3397
3398         (WebKit::LocalStorageDatabaseTracker::openTrackerDatabase):
3399         Open the database and create the Origins table if needed.
3400
3401         (WebKit::LocalStorageDatabaseTracker::importOriginIdentifiers):
3402         Open the database and import the origin identifiers from it, then synchronize it with whatever files are on disk.
3403
3404         (WebKit::LocalStorageDatabaseTracker::updateTrackerDatabaseFromLocalStorageDatabaseFiles):
3405         Bring the tracker database up to date from the database files on disk.
3406
3407         * UIProcess/Storage/LocalStorageDatabaseTracker.h:
3408         (LocalStorageDatabaseTracker):
3409
3410 2013-05-06  Alexey Proskuryakov  <ap@apple.com>
3411
3412         <rdar://problem/13479806> [Mac] Pass information about open pages to LaunchServices
3413         https://bugs.webkit.org/show_bug.cgi?id=115665
3414
3415         Reviewed by Darin Adler.
3416
3417         * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::didCommitLoad): Moved repeated
3418         check for frame->isMainFrame() to the top, matching oter similar functions.
3419         Call updateActivePages().
3420
3421         * WebProcess/WebProcess.cpp:
3422         (WebKit::WebProcess::networkProcessConnectionClosed): Removed an obsolete FIXME.
3423         (WebKit::WebProcess::updateActivePages): Empty implementation for platforms
3424         that don't need to do anything here.
3425
3426         * WebProcess/WebProcess.h: Added updateActivePages().
3427
3428         * WebProcess/mac/WebProcessMac.mm: (WebKit::WebProcess::updateActivePages):
3429         Collect user visible origins of pages in the process and pass them to LS.
3430
3431 2013-05-06  Mark Rowe  <mrowe@apple.com>
3432
3433         <rdar://problem/13775921> Switch off a deprecated API.
3434
3435         Reviewed by Oliver Hunt.
3436
3437         * Shared/mac/ChildProcessMac.mm:
3438         (WebKit::ChildProcess::setProcessSuppressionEnabled): When disabling process suppression,
3439         begin an activity that doesn't disable idle sleep, sudden termination or automatic termination.
3440         When enabling process suppression, end the activity.
3441
3442 2013-05-06  Anders Carlsson  <andersca@apple.com>
3443
3444         Move local storage directory handling to LocalStorageDatabaseTracker
3445         https://bugs.webkit.org/show_bug.cgi?id=115676
3446
3447         Reviewed by Andreas Kling.
3448
3449         * UIProcess/Storage/LocalStorageDatabase.cpp:
3450         (WebKit::LocalStorageDatabase::create):
3451         (WebKit::LocalStorageDatabase::LocalStorageDatabase):
3452         * UIProcess/Storage/LocalStorageDatabase.h:
3453         (WebCore):
3454         (LocalStorageDatabase):
3455         * UIProcess/Storage/LocalStorageDatabaseTracker.cpp:
3456         (WebKit::LocalStorageDatabaseTracker::setLocalStorageDirectory):
3457         (WebKit):
3458         (WebKit::LocalStorageDatabaseTracker::databaseFilename):
3459         (WebKit::LocalStorageDatabaseTracker::setLocalStorageDirectoryInternal):
3460         * UIProcess/Storage/LocalStorageDatabaseTracker.h:
3461         (WebCore):
3462         (LocalStorageDatabaseTracker):
3463         * UIProcess/Storage/StorageManager.cpp:
3464         (WebKit::StorageManager::StorageArea::StorageArea):
3465         (WebKit::StorageManager::setLocalStorageDirectory):
3466         * UIProcess/Storage/StorageManager.h:
3467         (StorageManager):
3468
3469 2013-05-06  Manuel Rego Casasnovas  <rego@igalia.com>
3470
3471         [GTK] Add webkit_uri_scheme_request_finish_error
3472         https://bugs.webkit.org/show_bug.cgi?id=94316
3473
3474         Reviewed by Anders Carlsson.
3475
3476         This new method will allow to finish WebKitURISchemeRequest with a
3477         GError that will be passed to the WebKitWebView through the
3478         "load-failed" signal.
3479
3480         * UIProcess/API/gtk/WebKitURISchemeRequest.cpp:
3481         (webkit_uri_scheme_request_finish_error): Implement new method using
3482         WebSoupRequestManagerProxy::didFailURIRequest().
3483         * UIProcess/API/gtk/WebKitURISchemeRequest.h: Add new method header.
3484         * UIProcess/API/gtk/WebKitWebContext.cpp: Include the usage of the new
3485         method in the code example at webkit_web_context_register_uri_scheme()
3486         documentation.
3487         * UIProcess/API/gtk/docs/webkit2gtk-sections.txt: Include the new
3488         method.
3489         * UIProcess/API/gtk/tests/LoadTrackingTest.cpp:
3490         (loadFailedCallback): Set m_error to monitor it from the tests.
3491         (LoadTrackingTest::loadURI): Clear m_error before each load.
3492         (LoadTrackingTest::loadHtml): Ditto.
3493         (LoadTrackingTest::loadPlainText): Ditto.
3494         (LoadTrackingTest::loadRequest): Ditto.
3495         (LoadTrackingTest::reload): Ditto.
3496         (LoadTrackingTest::goBack): Ditto.
3497         (LoadTrackingTest::goForward): Ditto.
3498         * UIProcess/API/gtk/tests/LoadTrackingTest.h: Add new member m_error.
3499         * UIProcess/API/gtk/tests/TestWebKitWebContext.cpp:
3500         (testWebContextURIScheme): Modify test to check the behavior of the new
3501         method.
3502         * UIProcess/soup/WebSoupRequestManagerProxy.cpp:
3503         (WebKit::WebSoupRequestManagerProxy::didFailURIRequest):
3504         (WebKit): Implement new method using
3505         WebSoupRequestManager::DidFailURIRequest().
3506         * UIProcess/soup/WebSoupRequestManagerProxy.h:
3507         (WebSoupRequestManagerProxy): Add new method header.
3508         * WebProcess/soup/WebSoupRequestManager.cpp:
3509         (WebKit):
3510         (WebKit::WebSoupRequestManager::didFailURIRequest): Implement new method
3511         setting the error and completing the request.
3512         * WebProcess/soup/WebSoupRequestManager.h:
3513         (WebSoupRequestManager): Add new method header.
3514         * WebProcess/soup/WebSoupRequestManager.messages.in: Add new method
3515         signature.
3516
3517 2013-05-06  Anders Carlsson  <andersca@apple.com>
3518
3519         Every LocalStorageDatabase should know about its tracker
3520         https://bugs.webkit.org/show_bug.cgi?id=115673
3521
3522         Reviewed by Andreas Kling.
3523
3524         * UIProcess/Storage/LocalStorageDatabase.cpp:
3525         (WebKit::LocalStorageDatabase::create):
3526         (WebKit::LocalStorageDatabase::LocalStorageDatabase):
3527         * UIProcess/Storage/LocalStorageDatabase.h:
3528         * UIProcess/Storage/StorageManager.cpp:
3529         (WebKit::StorageManager::StorageArea::StorageArea):
3530
3531 2013-05-06  Anders Carlsson  <andersca@apple.com>
3532
3533         Add LocalStorageDatabaseTracker class
3534         https://bugs.webkit.org/show_bug.cgi?id=115671
3535
3536         Reviewed by Andreas Kling.
3537
3538         Somewhat unsurprisingly, this class will be used for tracking local storage databases.
3539
3540         * UIProcess/Storage/LocalStorageDatabaseTracker.cpp: Added.
3541         (WebKit::LocalStorageDatabaseTracker::create):
3542         (WebKit::LocalStorageDatabaseTracker::LocalStorageDatabaseTracker):
3543         (WebKit::LocalStorageDatabaseTracker::~LocalStorageDatabaseTracker):
3544         * UIProcess/Storage/LocalStorageDatabaseTracker.h: Added.
3545         (LocalStorageDatabaseTracker):
3546         
3547         * UIProcess/Storage/StorageManager.cpp:
3548         (WebKit::StorageManager::StorageManager):
3549         Create a local storage database tracker.
3550
3551         * WebKit2.xcodeproj/project.pbxproj:
3552         Add new files.
3553
3554 2013-05-06  Anders Carlsson  <andersca@apple.com>
3555
3556         Handle closing the local storage database
3557         https://bugs.webkit.org/show_bug.cgi?id=115669
3558
3559         Reviewed by Beth Dakin.
3560
3561         * UIProcess/Storage/LocalStorageDatabase.cpp:
3562         (WebKit::LocalStorageDatabase::LocalStorageDatabase):
3563         Initialize m_isClosed.
3564     
3565         (WebKit::LocalStorageDatabase::~LocalStorageDatabase):
3566         Assert that m_isClosed is false.
3567
3568         (WebKit::LocalStorageDatabase::close):
3569         Set m_isClosed to true and write any pending changes to disk.
3570
3571         (WebKit::LocalStorageDatabase::updateDatabase):
3572         Compute the changed items and pass them to updateDatabaseWithChangedItems.
3573
3574         (WebKit::LocalStorageDatabase::updateDatabaseWithChangedItems):
3575         Split out the code that actually writes to the database from updateDatabase and into this function.
3576
3577         * UIProcess/Storage/LocalStorageDatabase.h:
3578         * UIProcess/Storage/StorageManager.cpp:
3579         (WebKit::StorageManager::StorageArea::~StorageArea):
3580         Call close().
3581
3582 2013-05-06  Zan Dobersek  <zdobersek@igalia.com>
3583
3584         [WK2] Make the WebNetworkInfoManagerProxy a supplement to the WebContext
3585         https://bugs.webkit.org/show_bug.cgi?id=115654
3586
3587         Reviewed by Andreas Kling.
3588
3589         Rather than holding a RefPtr to the WebNetworkInfoManagerProxy object in WebContext, change the WebNetworkInfoManagerProxy
3590         to implement the WebContextSupplement interface and handle the object as such in WebContext, simplifying its
3591         construction and cleanup, removing the specific RefPtr member variable and its correlating getter method.
3592
3593         * UIProcess/API/C/WKContext.cpp:
3594         (WKContextGetNetworkInfoManager): Retrieve the WebNetworkInfoManagerProxy object from the suppplements of the WebContext.
3595         * UIProcess/WebContext.cpp:
3596         (WebKit::WebContext::WebContext): Add the WebNetworkInfoManagerProxy object as a supplement instead of assigning it to
3597         the now-removed member variable.
3598         (WebKit::WebContext::~WebContext): No need for the specific cleanup, the equivalent is achieved when iterating through the
3599         supplements vector.
3600         (WebKit::WebContext::disconnectProcess): Ditto.
3601         * UIProcess/WebContext.h:
3602         (WebContext): Remove the WebNetworkInfoManagerProxy RefPtr member variable and its getter method.
3603         * UIProcess/WebNetworkInfoManagerProxy.cpp:
3604         (WebKit::WebNetworkInfoManagerProxy::supplementName): Specift the supplement's name.
3605         (WebKit::WebNetworkInfoManagerProxy::WebNetworkInfoManagerProxy): Initialize as a WebContextSupplement.
3606         (WebKit::WebNetworkInfoManagerProxy::providerDidChangeNetworkInformation): Adjust to use the context() method instead of
3607         accessing the private m_context directly.
3608         (WebKit::WebNetworkInfoManagerProxy::contextDestroyed): Stop updating when invoked.
3609         (WebKit::WebNetworkInfoManagerProxy::processDidClose): Ditto.
3610         (WebKit::WebNetworkInfoManagerProxy::refWebContextSupplement): Call APIObject::ref.
3611         (WebKit::WebNetworkInfoManagerProxy::derefWebContextSupplement): Call APIObject::deref.
3612         * UIProcess/WebNetworkInfoManagerProxy.h:
3613         (WebNetworkInfoManagerProxy): Inherit from WebContextSupplement, declare the newly-inherited methods.
3614
3615 2013-05-06  Alexey Proskuryakov  <ap@apple.com>
3616
3617         <rdar://problem/13479806> [Mac] Pass plug-in bundle ID to LaunchServices
3618         https://bugs.webkit.org/show_bug.cgi?id=115483
3619
3620         Reviewed by Darin Adler.
3621
3622         * PluginProcess/PluginProcess.h: Added m_pluginBundleIdentifier. We now need it
3623         in multiple places, so it's easier to pre-compute it.
3624
3625         * PluginProcess/mac/PluginProcessMac.mm:
3626         (WebKit::loadSandboxProfileForDirectory): Changed to use precomputed bundle ID.
3627         (WebKit::loadSandboxProfile): Ditto.
3628         (WebKit::PluginProcess::platformInitializeProcess): Pre-compute bundle ID.
3629         (WebKit::PluginProcess::initializeProcessName): Pass it to LaunchServices.
3630         (WebKit::PluginProcess::initializeSandbox): Pass precomputed bundle ID instead of
3631         a path.
3632
3633 2013-05-06  Anders Carlsson  <andersca@apple.com>
3634
3635         Handle removeItem and clear in LocalStorageDatabase
3636         https://bugs.webkit.org/show_bug.cgi?id=115664
3637
3638         Reviewed by Darin Adler.
3639
3640         * UIProcess/Storage/LocalStorageDatabase.cpp:
3641         (WebKit::LocalStorageDatabase::removeItem):
3642         Call itemDidChange with a null value, indicating that we want to remove this item.
3643
3644         (WebKit::LocalStorageDatabase::clear):
3645         Clear items, set m_shouldClearItems and schedule a database update.
3646
3647         (WebKit::LocalStorageDatabase::updateDatabase):
3648         If m_shouldClearItems is true, clear all items.
3649
3650         * UIProcess/Storage/StorageManager.cpp:
3651         (WebKit::StorageManager::StorageArea::removeItem):
3652         Call through to the local storage database.
3653
3654         (WebKit::StorageManager::StorageArea::clear):
3655         Ditto.
3656
3657 2013-05-06  Anders Carlsson  <andersca@apple.com>
3658
3659         Write storage changes to disk
3660         https://bugs.webkit.org/show_bug.cgi?id=115660
3661
3662         Reviewed by Andreas Kling.
3663
3664         * UIProcess/Storage/LocalStorageDatabase.cpp:
3665         (WebKit::LocalStorageDatabase::LocalStorageDatabase):
3666         Initialize new member variables.
3667
3668         (WebKit::LocalStorageDatabase::tryToOpenDatabase):
3669         Disable database threading checks.
3670
3671         (WebKit::LocalStorageDatabase::importItems):
3672         Only import the items once.
3673
3674         (WebKit::LocalStorageDatabase::setItem):
3675         Call itemDidChange.
3676
3677         (WebKit::LocalStorageDatabase::itemDidChange):
3678         Record the change and schedule a database update.
3679
3680         (WebKit::LocalStorageDatabase::scheduleDatabaseUpdate):
3681         Use WorkQueue::dispatchAfterDelay to schedule a datbase update.
3682
3683         (WebKit::LocalStorageDatabase::updateDatabase):
3684         Write changes to disk. If there are more than 100 pending items, only write the first 100 and then schedule
3685         another database update for the remaining items.
3686
3687         * UIProcess/Storage/LocalStorageDatabase.h:
3688         Add new member variables.
3689
3690         * UIProcess/Storage/StorageManager.cpp:
3691         (WebKit::StorageManager::StorageArea::setItem):
3692         Call LocalStorageDatabase::setItem.
3693
3694 2013-05-06  Zan Dobersek  <zdobersek@igalia.com>
3695
3696         [WK2] Make the WebBatteryManagerProxy a supplement to the WebContext
3697         https://bugs.webkit.org/show_bug.cgi?id=115625
3698
3699         Reviewed by Andreas Kling.
3700
3701         Rather than holding a RefPtr to the WebBatteryManagerProxy object in WebContext, change the WebBatteryManagerProxy
3702         to implement the WebContextSupplement interface and handle the object as such in WebContext, simplifying its
3703         construction and cleanup, removing the specific RefPtr member variable and its correlating getter method.
3704
3705         * UIProcess/API/C/WKContext.cpp:
3706         (WKContextGetBatteryManager): Retrieve the WebBatteryManagerProxy object from the supplements of the WebContext.
3707         * UIProcess/WebBatteryManagerProxy.cpp:
3708         (WebKit::WebBatteryManagerProxy::supplementName): Specify the supplement's name.
3709         (WebKit::WebBatteryManagerProxy::WebBatteryManagerProxy): Initialize as a WebContextSupplementable.
3710         (WebKit::WebBatteryManagerProxy::providerDidChangeBatteryStatus): Adjust to use the context() method instead of accessing
3711         the private m_context directly.
3712         (WebKit::WebBatteryManagerProxy::providerUpdateBatteryStatus): Ditto.
3713         (WebKit::WebBatteryManagerProxy::contextDestroyed): Stop updating when invoked.
3714         (WebKit::WebBatteryManagerProxy::processDidClose): Ditto.
3715         (WebKit::WebBatteryManagerProxy::refWebContextSupplement): Call APIObject::ref.
3716         (WebKit::WebBatteryManagerProxy::derefWebContextSupplement): Call APIObject::deref.
3717         (WebKit::WebBatteryManagerProxy::startUpdating): Fire up the provider if not yet updating.
3718         (WebKit::WebBatteryManagerProxy::stopUpdating): Wind down the provider if updating.
3719         * UIProcess/WebBatteryManagerProxy.h:
3720         (WebBatteryManagerProxy): Inherit from WebContextSupplement, declare the newly-inherited methods.
3721         * UIProcess/WebContext.cpp:
3722         (WebKit::WebContext::WebContext): Add the WebBatteryManagerProxy object as a supplement instead of assigning it to
3723         the now-removed member variable.
3724         (WebKit::WebContext::~WebContext): No need for the specific cleanup, the equivalent is achieved when iterating through the
3725         supplements vector.
3726         (WebKit::WebContext::disconnectProcess): Ditto.
3727         * UIProcess/WebContext.h:
3728         (WebContext): Remove the WebBatteryManagerProxy RefPtr member variable and its getter method.
3729
3730 2013-05-06  Antoine Quint  <graouts@apple.com>
3731
3732         Manage the presentation of the snapshotted plug-in using JavaScript
3733         https://bugs.webkit.org/show_bug.cgi?id=115548
3734
3735         Reviewed by Dean Jackson.
3736
3737         Expose a new plugInExtraScript method to support the injection of
3738         a JS file from the chrome client to customize the rendering of a
3739         snapshotted plug-in's shadow tree. Additionally, it is expected
3740         the chrome client will want to provide localized strings taking
3741         into account the snapshotted plug-in's mime-type, so we're adding
3742         this as a parameter to both plugInStartLabelTitle and
3743         plugInStartLabelSubtitle methods.
3744
3745         * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
3746         * WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp:
3747         (WebKit::InjectedBundlePageUIClient::plugInStartLabelTitle):
3748         (WebKit::InjectedBundlePageUIClient::plugInStartLabelSubtitle):
3749         (WebKit::InjectedBundlePageUIClient::plugInExtraScript):
3750         * WebProcess/InjectedBundle/InjectedBundlePageUIClient.h:
3751         (InjectedBundlePageUIClient):
3752         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3753         (WebKit::WebChromeClient::plugInStartLabelTitle):
3754         (WebKit::WebChromeClient::plugInStartLabelSubtitle):
3755         (WebKit::WebChromeClient::plugInExtraScript):
3756         * WebProcess/WebCoreSupport/WebChromeClient.h:
3757         (WebChromeClient):
3758
3759 2013-05-05  Chris Fleizach  <cfleizach@apple.com>
3760
3761         WEB SPEECH: deny file-read-data /Library/Speech/Synthesizers
3762         https://bugs.webkit.org/show_bug.cgi?id=115621
3763
3764         Reviewed by Alexey Proskuryakov.
3765
3766         Allow access to the location where 3rd party speech synthesizers are stored.
3767
3768         * WebProcess/com.apple.WebProcess.sb.in:
3769
3770 2013-05-05  Tim Horton  <timothy_horton@apple.com>
3771
3772         [wk2] Page Overlays: deviceScaleFactor doesn't update when the display changes
3773         https://bugs.webkit.org/show_bug.cgi?id=115577
3774         <rdar://problem/13762583>
3775
3776         Reviewed by Darin Adler.
3777
3778         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
3779         (WebKit::TiledCoreAnimationDrawingArea::setDeviceScaleFactor):
3780         Invalidate the page overlay layers' device scale factor when
3781         TiledCoreAnimationDrawingArea is notified that it has changed.
3782
3783 2013-05-05  Anders Carlsson  <andersca@apple.com>
3784
3785         Remove the Vector::append overload that takes a Vector
3786         https://bugs.webkit.org/show_bug.cgi?id=115535
3787
3788         Reviewed by Andreas Kling.
3789
3790         Use Vector::appendVector instead.
3791
3792         * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
3793         (WebKit::NetworkBlobRegistry::registerBlobURL):
3794         * NetworkProcess/SchedulableLoader.cpp:
3795         (WebKit::SchedulableLoader::SchedulableLoader):
3796         * Platform/CoreIPC/Connection.cpp:
3797         (CoreIPC::Connection::SyncMessageState::dispatchMessages):
3798         * UIProcess/Plugins/unix/PluginInfoStoreUnix.cpp:
3799         (WebKit::PluginInfoStore::pluginsDirectories):
3800
3801 2013-05-04  Sam Weinig  <sam@webkit.org>
3802
3803         Fix * placement in a few functions as noticed by Mark Rowe.
3804
3805         Rubber-stamped by Dan Bernstein.
3806
3807         * WebProcess/WebPage/PageBanner.h:
3808         (PageBanner):
3809         * WebProcess/WebPage/mac/PageBannerMac.mm:
3810         (WebKit::PageBanner::create):
3811         (WebKit::PageBanner::PageBanner):
3812
3813 2013-05-04  Sam Weinig  <sam@webkit.org>
3814
3815         REGRESSION(r148312): Crash when calling WKPageClose(page) followed by WKPageTerminate(page)
3816         <rdar://problem/13702008>
3817         https://bugs.webkit.org/show_bug.cgi?id=115607
3818
3819         Reviewed by Benjamin Poulain.
3820
3821         API Test: WebKit2.CloseThenTerminate
3822
3823         * UIProcess/WebPageProxy.cpp:
3824         (WebKit::WebPageProxy::resetStateAfterProcessExited):
3825         Don't try to reset the state if the page is closed, it won't work and its not worth it.
3826
3827 2013-05-04  Beth Dakin  <bdakin@apple.com>
3828
3829         https://bugs.webkit.org/show_bug.cgi?id=115574
3830         Crash using new WKBundlePageSetHeaderBanner() API to set a banner to null
3831
3832         Reviewed by Darin Adler.
3833
3834         Don't call addToPage() on a null banner.
3835         * WebProcess/WebPage/WebPage.cpp:
3836         (WebKit::WebPage::setHeaderPageBanner):
3837         (WebKit::WebPage::setFooterPageBanner):
3838
3839 2013-05-03  Alexey Proskuryakov  <ap@apple.com>
3840
3841         <rdar://problem/13806836> Tweak sandbox profile.
3842
3843         Reviewed by Dan Bernstein.
3844
3845         * WebProcess/com.apple.WebProcess.sb.in:
3846
3847 2013-05-03  Tim Horton  <timothy_horton@apple.com>
3848
3849         PDFPlugin: Changes being made to active annotation aren't saved when the PDF is exported
3850         https://bugs.webkit.org/show_bug.cgi?id=115544
3851         <rdar://problem/13801789>
3852
3853         Reviewed by Alexey Proskuryakov.
3854
3855         Commit changes to the active annotation (if there is one) before
3856         returning the live PDF data, so that said changes are represented
3857         in the exported or printed output.
3858
3859         * WebProcess/Plugins/PDF/PDFPlugin.h: Override liveData.
3860         * WebProcess/Plugins/PDF/PDFPlugin.mm:
3861         (WebKit::PDFPlugin::liveData): Commit the active annotation if there is one.
3862         * WebProcess/Plugins/PDF/SimplePDFPlugin.h:
3863         (SimplePDFPlugin): Make liveData virtual.
3864
3865 2013-05-03  Tim Horton  <timothy_horton@apple.com>
3866
3867         Web process crashes at WebPage::determinePrimarySnapshottedPlugInTimerFired + 8
3868         https://bugs.webkit.org/show_bug.cgi?id=115056
3869         <rdar://problem/13719543>
3870
3871         Reviewed by Simon Fraser.
3872
3873         Null-check m_page. In theory, we shouldn't get here, because we stop
3874         the timer at the only point where m_page is cleared, but crash logs say
3875         we're still crashing here.
3876
3877         * WebProcess/WebPage/WebPage.cpp:
3878         (WebKit::WebPage::determinePrimarySnapshottedPlugInTimerFired):
3879
3880 2013-05-03  Tim Horton  <timothy_horton@apple.com>
3881
3882         Remove some "what" comments from FindController
3883         https://bugs.webkit.org/show_bug.cgi?id=115546
3884
3885         Reviewed by Andreas Kling.
3886
3887         * WebProcess/WebPage/FindController.cpp:
3888         (WebKit::FindController::countStringMatches):
3889         (WebKit::FindController::updateFindUIAfterPageScroll):
3890         (WebKit::FindController::willMoveToWebPage):
3891         (WebKit::FindController::mouseEvent):
3892         Remove or reword some comments.
3893
3894 2013-05-02  Andy Estes  <aestes@apple.com>
3895
3896         [WK2][CustomProtocols] NSURLProtocolClient methods should be dispatched on NSURLConnection's resource loader run loop
3897         https://bugs.webkit.org/show_bug.cgi?id=115539
3898
3899         Reviewed by Alexey Proskuryakov.
3900
3901         It turns out that calling NSURLProtocolClient methods from a different
3902         thread than the one running the NSURLConnection run loop is unsafe.
3903         Although I can't capture it reliably in a test case, doing so can
3904         sometimes result in a load timing out because the call to
3905         -[NSURLProtocolClient URLProtocolDidFinishLoading:] was ignored by
3906         NSURLConnection.
3907
3908         Fix this by dispatching these methods on the NSURLConnection resource
3909         load run loop. This matches where NSURLProtocolClient methods are
3910         dispatched by typical NSURLProtocol implementations, and in my testing
3911         this solves the timeout issue.
3912
3913         * Shared/Network/CustomProtocols/CustomProtocolManager.h: Declare
3914         dispatchOnResourceLoaderRunLoop().
3915         * Shared/Network/CustomProtocols/mac/CustomProtocolManagerMac.mm:
3916         Declare +[NSURLConnection resourceLoaderRunLoop] on a category of
3917         NSURLConnection. Also include the header that declares it if it's present.
3918         (WebKit::CustomProtocolManager::didFailWithError): Call the
3919         NSURLProtocolClient method via dispatchOnResourceLoaderRunLoop().
3920         (WebKit::CustomProtocolManager::didLoadData): Ditto.
3921         (WebKit::CustomProtocolManager::didReceiveResponse): Ditto.
3922         (WebKit::CustomProtocolManager::didFinishLoading): Ditto.
3923         (WebKit::CustomProtocolManager::dispatchOnResourceLoaderRunLoop):
3924         Dispatch a block on the NSURLConnection resource loader run loop and
3925         then wake up the run loop.
3926
3927 2013-05-02  Brady Eidson  <beidson@apple.com>
3928
3929         REGRESSION (149389) Main resources converted to downloads are immediately cancelled.
3930         <rdar://problem/13795795> and https://bugs.webkit.org/show_bug.cgi?id=115530
3931
3932         Reviewed by Alexey Proskuryakov.
3933
3934         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
3935         (WebKit::NetworkConnectionToWebProcess::convertMainResourceLoadToDownload): Call didConvertHandleToDownload
3936           on the NetworkResourceLoader.
3937
3938         * NetworkProcess/NetworkResourceLoader.cpp:
3939         (WebKit::NetworkResourceLoader::NetworkResourceLoader):
3940         (WebKit::NetworkResourceLoader::didConvertHandleToDownload): Set m_handleConvertedToDownload to true.
3941         (WebKit::NetworkResourceLoader::abort): Only cancel the handle if m_handleConvertedToDownload is false.
3942         * NetworkProcess/NetworkResourceLoader.h:
3943
3944 2013-05-02  Alexey Proskuryakov  <ap@apple.com>
3945
3946         <rdar://problem/13740375> Non-ASCII downloaded file names are garbled when using NetworkProcess
3947         https://bugs.webkit.org/show_bug.cgi?id=115520
3948
3949         Reviewed by Darin Adler.
3950
3951         * Shared/mac/WebCoreArgumentCodersMac.mm:
3952         (CoreIPC::::encodePlatformData):
3953         (CoreIPC::::decodePlatformData):
3954         Send the encoding fallback array over IPC, so that it's present when NetworkProcess does its loading.
3955
3956 2013-05-01  Alexey Proskuryakov  <ap@apple.com>
3957
3958         REGRESSION (r149422): -[WKBrowsingContextController loadFileURL:restrictToFilesWithin:]
3959         broken when second argument is nil
3960         https://bugs.webkit.org/show_bug.cgi?id=115505
3961         <rdar://problem/13787297>
3962
3963         Reviewed by Darin Adler.
3964
3965         * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::loadFile): Pass a URL string
3966         to assumeReadAccessToBaseURL, as this is what it takes.
3967
3968 2013-05-01  Ryosuke Niwa  <rniwa@webkit.org>
3969
3970         [Mac] WebKit doesn't enable or disable autocorrections when system preferences are changed
3971         https://bugs.webkit.org/show_bug.cgi?id=115463
3972
3973         Reviewed by Darin Adler.
3974
3975         Observe the default notification center and propagate the changes to TextCheckerState and
3976         to all WebProcesses when system preferences are updated.
3977
3978         * UIProcess/TextChecker.h:
3979         * UIProcess/WebContext.h:
3980         * UIProcess/mac/TextCheckerMac.mm:
3981         (WebKit::shouldAutomaticTextReplacementBeEnabled):
3982         (WebKit::shouldAutomaticSpellingCorrectionBeEnabled):
3983         (WebKit::shouldAutomaticQuoteSubstitutionBeEnabled):
3984         (WebKit::shouldAutomaticDashSubstitutionBeEnabled):
3985         (WebKit::initializeState):
3986         (WebKit::TextChecker::didChangeAutomaticTextReplacementEnabled):
3987         (WebKit::TextChecker::didChangeAutomaticSpellingCorrectionEnabled):
3988         (WebKit::TextChecker::didChangeAutomaticQuoteSubstitutionEnabled):
3989         (WebKit::TextChecker::didChangeAutomaticDashSubstitutionEnabled):
3990         * UIProcess/mac/WebContextMac.mm:
3991         (WebKit::WebContext::registerNotificationObservers):
3992         (WebKit::WebContext::unregisterNotificationObservers):
3993
3994 2013-05-01  Ryuan Choi  <ryuan.choi@samsung.com>
3995
3996         [GTK] Fix build break after r149449
3997         https://bugs.webkit.org/show_bug.cgi?id=115500
3998
3999         Reviewed by Gustavo Noronha Silva.
4000
4001         Unreviewed GTK build fix
4002
4003         * GNUmakefile.list.am: Added LocalStorageDatabase.[cpp|h] to the list of
4004         sources.
4005
4006 2013-05-01  Martin Robinson  <mrobinson@igalia.com>
4007
4008         [GTK] [WebKit2] Documentation for webkit_web_view_run_javascript should indicate what happens when JavaScript is disabled
4009         https://bugs.webkit.org/show_bug.cgi?id=115492
4010
4011         Reviewed by Xan Lopez.
4012
4013         * UIProcess/API/gtk/WebKitWebView.cpp: Clarify the documentation.
4014
4015 2013-05-01  Tim Horton  <timothy_horton@apple.com>
4016
4017         Move knowledge of PDF/PostScript MIME types into MIMETypeRegistry
4018         https://bugs.webkit.org/show_bug.cgi?id=115487
4019
4020         Reviewed by Darin Adler.
4021
4022         * UIProcess/WebContext.cpp:
4023         * UIProcess/WebContext.h:
4024         Remove pdfAndPostScriptMIMETypes.
4025
4026         * UIProcess/WebFrameProxy.cpp:
4027         (WebKit::WebFrameProxy::canShowMIMEType): Move PDF bits to WebPageProxy.
4028         (WebKit::WebFrameProxy::isDisplayingPDFDocument):
4029         Make use of WebCore's newfound knowledge of PDF and PostScript MIME types,
4030         so we don't have to duplicate it unnecessarily in WebKit2.
4031
4032         * UIProcess/WebPageProxy.cpp:
4033         (WebKit::WebPageProxy::canShowMIMEType):
4034         Add code which used to be in WebFrameProxy::canShowMIMEType, and adapt it
4035         to use WebCore's knowledge of PDF and PostScript MIME types.
4036
4037         * WebProcess/Plugins/PDF/SimplePDFPlugin.mm:
4038         (WebKit::SimplePDFPlugin::pluginInfo):
4039         We previously supported the "text/pdf" MIME type for PDFViewController,
4040         so SimplePDFPlugin and PDFPlugin should support it as well.
4041
4042         * WebProcess/WebPage/WebPage.cpp:
4043         (WebKit::WebPage::createPlugin):
4044         Adopt MIMETypeRegistry::isPDFOrPostScriptMIMEType.
4045
4046         * WebProcess/WebPage/WebPage.h:
4047         (WebPage):
4048         Remove pdfAndPostScriptMIMETypes.
4049
4050         * WebProcess/WebPage/mac/WebPageMac.mm:
4051         (WebKit::WebPage::platformPreferencesDidChange):
4052         Adopt getPDFAndPostScriptMIMETypes instead of duplicating the list in WebKit2.
4053
4054 2013-05-01  Anders Carlsson  <andersca@apple.com>
4055
4056         Implement LocalStorageDatabase::importItems
4057         https://bugs.webkit.org/show_bug.cgi?id=115493
4058
4059         Reviewed by Andreas Kling.
4060
4061         Fetch items and insert them in the storage map.
4062         * UIProcess/Storage/LocalStorageDatabase.cpp:
4063         (WebKit::LocalStorageDatabase::importItems):
4064
4065 2013-05-01  Anders Carlsson  <andersca@apple.com>
4066
4067         Begin work on loading items from the local storage database
4068         https://bugs.webkit.org/show_bug.cgi?id=115489
4069
4070         Reviewed by Andreas Kling.
4071
4072         Some of the LocalStorageDatabase code is originally from WebCore,
4073         but has been simplified due to the fact that we don't need to load
4074         database data asynchronously since we're already running on a non-main thread.
4075
4076         * UIProcess/Storage/LocalStorageDatabase.cpp:
4077         (WebKit::LocalStorageDatabase::LocalStorageDatabase):
4078         (WebKit::LocalStorageDatabase::openDatabase):
4079         (WebKit::LocalStorageDatabase::tryToOpenDatabase):
4080         (WebKit::LocalStorageDatabase::migrateItemTableIfNeeded):
4081         (WebKit::LocalStorageDatabase::importItems):
4082
4083         * UIProcess/Storage/LocalStorageDatabase.h:
4084         (WebKit::StorageManager::StorageArea::setItem):
4085         (WebKit::StorageManager::StorageArea::removeItem):
4086         (WebKit::StorageManager::StorageArea::clear):
4087         (WebKit::StorageManager::StorageArea::items):
4088         Call importItemsFromDatabase().
4089         
4090         (WebKit::StorageManager::StorageArea::importItemsFromDatabase):
4091         Ask the database to import the items.
4092
4093 2013-05-01  Ryuan Choi  <ryuan.choi@samsung.com>
4094
4095         [EFL] Unreviewed buildfix after r149449.
4096
4097         * CMakeLists.txt:
4098
4099 2013-05-01  Zoltan Arvai  <zarvai@inf.u-szeged.hu>
4100
4101         [Qt] Unreviewed buildfix after r149449.
4102
4103         * Target.pri:
4104
4105 2013-05-01  Anders Carlsson  <andersca@apple.com>
4106
4107         Add LocalStorageDatabase class
4108         https://bugs.webkit.org/show_bug.cgi?id=115486
4109
4110         Reviewed by Sam Weinig.
4111
4112         The LocalStorageDatabase class will persist local storage data to disk.
4113
4114         * UIProcess/Storage/LocalStorageDatabase.cpp:
4115         * UIProcess/Storage/LocalStorageDatabase.h: Added.
4116
4117         * UIProcess/Storage/StorageManager.cpp:
4118         (StorageManager::StorageArea):
4119         (WebKit::StorageManager::LocalStorageNamespace::storageManager):
4120         Add getter.
4121
4122         (StorageManager::LocalStorageNamespace):
4123         (WebKit::StorageManager::StorageArea::StorageArea):
4124         If this is a local storage area, create a LocalStorageDatabase.
4125
4126         (WebKit::StorageManager::LocalStorageNamespace::databaseFilename):
4127         Helper function for getting the name of the database for the given origin.
4128
4129         * WebKit2.xcodeproj/project.pbxproj:
4130         Add new files.
4131
4132 2013-05-01  Alexey Proskuryakov  <ap@apple.com>
4133
4134         <rdar://problem/13781156> Launching NetworkProcess broken on some OS vers