[iOS] cleanup AirPlay code
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2015-02-20  Eric Carlson  <eric.carlson@apple.com>
2
3         [iOS] cleanup AirPlay code
4         https://bugs.webkit.org/show_bug.cgi?id=141811
5
6         Reviewed by Jer Noble.
7
8         * Configurations/FeatureDefines.xcconfig: IOS_AIRPLAY -> WIRELESS_PLAYBACK_TARGET.
9         * WebProcess/WebPage/WebPage.cpp:
10         (WebKit::WebPage::updatePreferences): Ditto.
11
12 2015-02-20  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
13
14         [WK2][EFL] Fix the build after r180362
15         https://bugs.webkit.org/show_bug.cgi?id=141836
16
17         Reviewed by Carlos Garcia Campos.
18
19         As r180409, EFL port needs to add missing includes for several features,
20         and needs to have a specific implementation of toAPI/toImple for EFL port.
21
22         * UIProcess/API/C/WKBatteryManager.cpp:
23         * UIProcess/API/C/WKPage.cpp:
24         * UIProcess/API/C/efl/WKAPICastEfl.h:
25         (WebKit::toAPI):
26         (WebKit::toImpl):
27         * UIProcess/API/efl/ewk_url_scheme_request.cpp:
28         * UIProcess/CoordinatedGraphics/WebViewClient.cpp:
29         * UIProcess/efl/WebUIPopupMenuClient.cpp:
30         * UIProcess/efl/WebViewEfl.cpp:
31         * WebProcess/efl/ExtensionManagerEfl.cpp:
32
33 2015-02-20  Antti Koivisto  <antti@apple.com>
34
35         Move WorkQueue from WK2 to WTF
36         https://bugs.webkit.org/show_bug.cgi?id=141797
37
38         Reviewed by Anders Carlsson.
39
40         * CMakeLists.txt:
41         * DatabaseProcess/DatabaseProcess.h:
42         * Platform/IPC/Connection.h:
43         * Platform/WorkQueue.cpp: Removed.
44         * Platform/WorkQueue.h: Removed.
45         * Platform/efl/WorkQueueEfl.cpp: Removed.
46         * Platform/gtk/WorkQueueGtk.cpp: Removed.
47         * Platform/mac/WorkQueueMac.cpp: Removed.
48         * PlatformEfl.cmake:
49         * PlatformGTK.cmake:
50         * Shared/Network/CustomProtocols/CustomProtocolManager.h:
51         * UIProcess/Launcher/ProcessLauncher.cpp:
52         * UIProcess/Storage/LocalStorageDatabase.cpp:
53         * UIProcess/Storage/LocalStorageDatabase.h:
54         * UIProcess/Storage/LocalStorageDatabaseTracker.cpp:
55         * UIProcess/Storage/LocalStorageDatabaseTracker.h:
56         * UIProcess/Storage/StorageManager.cpp:
57         * UIProcess/Storage/StorageManager.h:
58         * WebKit2.xcodeproj/project.pbxproj:
59
60 2015-02-20  Carlos Garcia Campos  <cgarcia@igalia.com>
61
62         [WK2][GTK] Fix the build after r180362
63         https://bugs.webkit.org/show_bug.cgi?id=141813
64
65         Reviewed by Žan Doberšek.
66
67         Add several missing includes and a specific implementation of
68         toAPI/toImpl for GTK+ WebView.
69
70         * UIProcess/API/C/gtk/WKAPICastGtk.h:
71         (WebKit::toAPI):
72         (WebKit::toImpl):
73         * UIProcess/API/C/gtk/WKView.cpp:
74         * UIProcess/API/gtk/WebKitFormClient.cpp:
75         * UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManagerClient.cpp:
76         * UIProcess/gtk/WebInspectorClientGtk.cpp:
77
78 2015-02-19  Shivakumar JM  <shiva.jm@samsung.com>
79
80         Fix build warning in WebKit2/WebProcess and UIProcess module.
81         https://bugs.webkit.org/show_bug.cgi?id=141794.
82
83         Reviewed by Anders Carlsson.
84
85         Fix build warning by using UNUSED_PARAM macro.
86
87         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
88         (WebKit::computeWebProcessAccessType):
89         * WebProcess/WebProcess.cpp:
90         (WebKit::WebProcess::deleteWebsiteData):
91
92 2015-02-19  Remy Demarest  <rdemarest@apple.com>
93
94         Make EnvironmentVariables::appendValue() handle the case where the existing value is an empty string.
95         https://bugs.webkit.org/show_bug.cgi?id=141818.
96
97         Reviewed by Dan Bernstein.
98
99         * UIProcess/Launcher/mac/EnvironmentVariables.cpp:
100         (WebKit::EnvironmentVariables::appendValue): If the existing value is an empty string, replace it rather than
101         append to it.
102
103 2015-02-19  Anders Carlsson  <andersca@apple.com>
104
105         Make C SPI objects and modern API objects toll-free bridged
106         https://bugs.webkit.org/show_bug.cgi?id=141808
107
108         Reviewed by Tim Horton.
109
110         * Shared/API/APIObject.h:
111         (API::Object::wrap):
112         (API::Object::unwrap):
113         Add default implementations of wrap and unwrap. These just cast.
114
115         * Shared/API/c/WKArray.cpp:
116         (WKArrayCreate):
117         (WKArrayCreateAdoptingValues):
118         (WKArrayGetItemAtIndex):
119         * Shared/API/c/WKDictionary.cpp:
120         (WKDictionaryGetItemForKey):
121         Add toImpl and toAPI where necessary.
122
123         * Shared/API/c/WKSharedAPICast.h:
124         Add API::Object::wrap in toAPI and unwrap in toImpl.
125
126         * Shared/API/c/WKType.cpp:
127         (WKGetTypeID):
128         (WKRetain):
129         (WKRelease):
130         Add missing toImpl calls.
131
132         * Shared/Cocoa/APIObject.mm:
133         (API::Object::wrap):
134         Return the APIObject Objective-C wrapper.
135
136         (API::Object::unwrap):
137         Return the API::Object from the Objective-C object.
138
139         * Shared/Cocoa/WKObject.h:
140         Add wrap and unwrap declarations.
141
142         * UIProcess/API/C/WKPage.cpp:
143         * UIProcess/API/C/WKPageConfigurationRef.cpp:
144         * UIProcess/API/C/WKPageGroup.cpp:
145         * UIProcess/API/C/WKUserContentControllerRef.cpp:
146         Add missing includes; toImpl now requires a complete type.
147
148 2015-02-19  Timothy Horton  <timothy_horton@apple.com>
149
150         Remove unused forward declaration from WKWebViewInternal.h
151         https://bugs.webkit.org/show_bug.cgi?id=141806
152
153         Reviewed by Anders Carlsson.
154
155         * UIProcess/API/Cocoa/WKWebViewInternal.h:
156         The use of WebCore::Highlight moved to WKContentView.
157
158 2015-02-19  Anders Carlsson  <andersca@apple.com>
159
160         Use the real implementation type in our API cast traits
161         https://bugs.webkit.org/show_bug.cgi?id=141805
162
163         Reviewed by Sam Weinig.
164
165         * Shared/API/c/WKSharedAPICast.h:
166         (WebKit::toURLRef):
167         (WebKit::toAPI): Deleted.
168         (WebKit::toImpl): Deleted.
169         * UIProcess/GenericCallback.h:
170
171 2015-02-19  Anders Carlsson  <andersca@apple.com>
172
173         Remove the stray storage manager from WebProcessPool
174         https://bugs.webkit.org/show_bug.cgi?id=141800
175
176         Reviewed by Sam Weinig.
177
178         * UIProcess/API/mac/WKView.mm:
179         (-[WKView dealloc]):
180         (-[WKView initWithFrame:processPool:configuration:webView:]):
181         (-[WKView _applicationWillTerminate:]): Deleted.
182         Remove code that calls applicationWillTerminate on the WebPageProxy.
183
184         * UIProcess/WebKeyValueStorageManager.cpp:
185         (WebKit::WebKeyValueStorageManager::getKeyValueStorageOrigins):
186         (WebKit::WebKeyValueStorageManager::getStorageDetailsByOrigin):
187         (WebKit::WebKeyValueStorageManager::deleteEntriesForOrigin):
188         (WebKit::WebKeyValueStorageManager::deleteAllEntries):
189         Get the storage manager from the website data store.
190
191         * UIProcess/WebPageProxy.cpp:
192         (WebKit::WebPageProxy::WebPageProxy):
193         (WebKit::WebPageProxy::close):
194         Remove storage manager calls.
195
196         * UIProcess/WebProcessPool.cpp:
197         (WebKit::WebProcessPool::WebProcessPool):
198         (WebKit::WebProcessPool::applicationWillTerminate): Deleted.
199         * UIProcess/WebProcessPool.h:
200         Remove storage manager code.
201
202         * UIProcess/WebsiteData/WebsiteDataStore.h:
203         (WebKit::WebsiteDataStore::storageManager):
204         Add getter.
205
206 2015-02-19  Csaba Osztrogonác  <ossy@webkit.org>
207
208         [WK2] Unreviewed buildfix for non-Cocoa platforms.
209
210         * CMakeLists.txt:
211         * UIProcess/WebsiteData/unix/WebsiteDataStoreUnix.cpp: Added.
212         (WebKit::WebsiteDataStore::platformInitialize): Added.
213         (WebKit::WebsiteDataStore::platformDestroy): Added.
214
215 2015-02-19  Anders Carlsson  <andersca@apple.com>
216
217         WebsiteDataStore should ensure that local storage is written before exiting
218         https://bugs.webkit.org/show_bug.cgi?id=141798
219
220         Reviewed by Sam Weinig.
221
222         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm: Added.
223         (WebKit::dataStoresWithStorageManagers):
224         (WebKit::WebsiteDataStore::platformInitialize):
225         (WebKit::WebsiteDataStore::platformDestroy):
226         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
227         (WebKit::WebsiteDataStore::WebsiteDataStore):
228         (WebKit::WebsiteDataStore::~WebsiteDataStore):
229         * UIProcess/WebsiteData/WebsiteDataStore.h:
230         * WebKit2.xcodeproj/project.pbxproj:
231
232 2015-02-18  Chris Dumez  <cdumez@apple.com>
233
234         [WK2][iOS] Fix NetworkCache build
235         https://bugs.webkit.org/show_bug.cgi?id=141778
236
237         Reviewed by Antti Koivisto.
238
239         Add missing header include to use round_page() on iOS.
240
241         * NetworkProcess/cache/NetworkCacheStorageCocoa.mm:
242
243 2015-02-18  Alexey Proskuryakov  <ap@apple.com>
244
245         Remove input and output files from "Make Frameworks Symbolic Link" step
246         https://bugs.webkit.org/show_bug.cgi?id=141769
247
248         Reviewed by Dan Bernstein.
249
250         * WebKit2.xcodeproj/project.pbxproj:
251
252 2015-02-18  Timothy Horton  <timothy_horton@apple.com>
253
254         Adopt WebCore::IOSurface in ImageBuffer
255         https://bugs.webkit.org/show_bug.cgi?id=141751
256
257         Reviewed by Simon Fraser.
258
259         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
260         (InitWebCoreSystemInterface):
261         Remove old WKSI IOSurface-related functions.
262
263 2015-02-18  Beth Dakin  <bdakin@apple.com>
264
265         iBooks immediate action blacklist should not even create the gesture recognizer
266         https://bugs.webkit.org/show_bug.cgi?id=141768
267         -and corresponding-
268         rdar://problem/19806770
269
270         Reviewed by Tim Horton.
271
272         Move the runtime-application check to the point where the gesture recognizer is 
273         created so that we can avoid doing so.
274         * UIProcess/API/mac/WKView.mm:
275         (-[WKView initWithFrame:processPool:configuration:webView:]):
276         * UIProcess/mac/WKImmediateActionController.mm:
277         (-[WKImmediateActionController _updateImmediateActionItem]):
278
279 2015-02-18  Chris Dumez  <cdumez@apple.com>
280
281         Access FontCache global instance via singleton() static member function
282         https://bugs.webkit.org/show_bug.cgi?id=141726
283
284         Reviewed by Daniel Bates.
285
286         Access FontCache global instance via singleton() static member function,
287         as per coding style.
288
289 2015-02-18  Timothy Horton  <timothy_horton@apple.com>
290
291         Add WKContext SPI to clear all visited links
292         https://bugs.webkit.org/show_bug.cgi?id=141752
293         <rdar://problem/9997966>
294
295         Reviewed by Dan Bernstein.
296
297         * UIProcess/API/C/WKContext.cpp:
298         (WKContextClearVisitedLinks):
299         * UIProcess/API/C/WKContext.h:
300
301 2015-02-17  Anders Carlsson  <andersca@apple.com>
302
303         Add API for clearing in-memory caches to WKWebsiteDataStore
304         https://bugs.webkit.org/show_bug.cgi?id=141724
305
306         Reviewed by Tim Horton.
307
308         * Shared/WebsiteData/WebsiteDataTypes.h:
309         Add WebsiteDataTypeMemoryCache.
310
311         * UIProcess/API/Cocoa/_WKWebsiteDataStore.h:
312         Add WKWebsiteDataTypeMemoryCache.
313
314         * UIProcess/API/Cocoa/_WKWebsiteDataStore.mm:
315         (toWebsiteDataTypes):
316         Handle WKWebsiteDataTypeMemoryCache and convert it to WebsiteDataTypeMemoryCache.
317
318         * UIProcess/WebProcessProxy.cpp:
319         (WebKit::generateCallbackID):
320         Generate a new callback.
321
322         (WebKit::WebProcessProxy::~WebProcessProxy):
323         Assert that we don't have any pending callbacks.
324
325         (WebKit::WebProcessProxy::connectionDidClose):
326         Invoke pending callbacks.
327
328         (WebKit::WebProcessProxy::canTerminateChildProcess):
329         Don't try to terminate if we have pending callbacks.
330
331         (WebKit::WebProcessProxy::didDeleteWebsiteData):
332         Take the callback and invoke it.
333
334         (WebKit::WebProcessProxy::deleteWebsiteData):
335         Send a delete message.
336
337         * UIProcess/WebProcessProxy.h:
338         Add new members.
339
340         * UIProcess/WebProcessProxy.messages.in:
341         Add DidDeleteWebsiteData message.
342
343         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
344         (WebKit::computeNetworkProcessAccessType):
345         Spell persistent correctly.
346
347         (WebKit::computeWebProcessAccessType):
348         Return a web process access type given the a data type mask.
349
350         (WebKit::WebsiteDataStore::removeData):
351         Ask any associated web processes to remove website data.
352
353         * WebProcess/WebProcess.cpp:
354         (WebKit::WebProcess::deleteWebsiteData):
355         Delete the memory cache if requested.
356
357         * WebProcess/WebProcess.h:
358         Add new member.
359
360         * WebProcess/WebProcess.messages.in:
361         Add DeleteWebsiteData message.
362
363 2015-02-17  Timothy Horton  <timothy_horton@apple.com>
364
365         REGRESSION (r178595): Clicking on DD highlights sometimes do not work
366         https://bugs.webkit.org/show_bug.cgi?id=141728
367         <rdar://problem/19825372>
368
369         Reviewed by Beth Dakin.
370
371         * UIProcess/mac/WKImmediateActionController.mm:
372         (-[WKImmediateActionController _cancelImmediateActionIfNeeded]):
373         (-[WKImmediateActionController immediateActionRecognizerWillBeginAnimation:]):
374         The change that r178595 intended to make was purely that things that we
375         have no immediate actions for should cancel the immediate action gesture recognizer.
376         Moving the DataDetectors activation code as well breaks strict ordering
377         of immediate action callbacks vs. shouldUseActionsWithContext: that they depend on.
378
379 2015-02-17  Anders Carlsson  <andersca@apple.com>
380
381         Only create the WebKit.framework symlink in PrivateFrameworks when the platform is iphoneos
382         https://bugs.webkit.org/show_bug.cgi?id=141710
383         <rdar://problem/19719748>
384
385         Reviewed by Andreas Kling.
386
387         Don't create the symlink when building for the simulator.
388
389         * WebKit2.xcodeproj/project.pbxproj:
390
391 2015-02-17  Chris Dumez  <cdumez@apple.com>
392
393         Access MemoryPressureHandler global instance via a singleton() static member function
394         https://bugs.webkit.org/show_bug.cgi?id=141691
395
396         Reviewed by Andreas Kling.
397
398         Access MemoryPressureHandler global instance via a singleton() static
399         member function.
400
401         * NetworkProcess/NetworkProcess.cpp:
402         (WebKit::NetworkProcess::initializeNetworkProcess):
403         (WebKit::NetworkProcess::lowMemoryHandler): Deleted.
404         * NetworkProcess/NetworkProcess.h:
405         * PluginProcess/PluginProcess.cpp:
406         (WebKit::PluginProcess::initializeProcess):
407         (WebKit::PluginProcess::lowMemoryHandler): Deleted.
408         * PluginProcess/PluginProcess.h:
409         * WebProcess/WebPage/ios/WebPageIOS.mm:
410         (WebKit::WebPage::updateVisibleContentRects):
411         * WebProcess/WebProcess.cpp:
412         (WebKit::WebProcess::initializeWebProcess):
413         (WebKit::WebProcess::processWillSuspend):
414
415 2015-02-16  Carlos Garcia Campos  <cgarcia@igalia.com>
416
417         [GTK] WebKitFrame objects are never released
418         https://bugs.webkit.org/show_bug.cgi?id=141641
419
420         Reviewed by Martin Robinson.
421
422         Use a FrameDestructionObserver derived class to wrap our
423         WebKitFrame objects and delete them when the frame is destroyed,
424         instead of using willDestroyFrame callback of WKBundlePageLoaderClient
425         that has never worked.
426
427         * WebProcess/InjectedBundle/API/gtk/WebKitFrame.cpp:
428         (webkitFrameGetWebFrame):
429         * WebProcess/InjectedBundle/API/gtk/WebKitFramePrivate.h:
430         * WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp:
431         (webkitFrameGetOrCreate):
432         (webkitFrameDestroy):
433         (webkitWebPageCreate):
434         (willDestroyFrame): Deleted.
435
436 2015-02-16  Tim Horton  <timothy_horton@apple.com>
437
438         Fix the !USE(IOSURFACE) build
439
440         * Shared/mac/RemoteLayerBackingStore.mm:
441         SOFT_LINK_MAY_FAIL makes a function that will be unused if !USE(IOSURFACE).
442
443 2015-02-16  Tim Horton  <timothy_horton@apple.com>
444
445         Sometimes RemoteLayerBackingStore ends up non-volatile while the process is suspended
446         <rdar://problem/19842957>
447         https://bugs.webkit.org/show_bug.cgi?id=141675
448
449         Reviewed by Simon Fraser.
450
451         Previously, it was possible to get a layer tree flush in between the
452         process suspension cleanup code making surfaces volatile and the process
453         actually being suspended (it was racy because the suspension requires
454         a few IPC round trips). Depending on how far through the flush we got,
455         we could sometimes end up either making new non-volatile backing store,
456         or switching some recently-made-volatile backing store back to non-volatile.
457         We don't want to have any non-volatile backing store while suspended.
458
459         * UIProcess/ProcessThrottler.cpp:
460         (WebKit::ProcessThrottler::updateAssertion):
461         Inform the WebProcess when it's going from suspended to runnable state.
462
463         * UIProcess/WebProcessProxy.cpp:
464         (WebKit::WebProcessProxy::sendProcessDidResume):
465         * UIProcess/WebProcessProxy.h:
466         Forward the message along.
467
468         * WebProcess/WebProcess.cpp:
469         (WebKit::WebProcess::processWillSuspend):
470         (WebKit::WebProcess::cancelProcessWillSuspend):
471         (WebKit::WebProcess::setAllLayerTreeStatesFrozen):
472         (WebKit::WebProcess::processDidResume):
473         Freeze all of this process' pages' layer trees when we start trying to suspend,
474         and un-freeze them when either suspension is cancelled or we resume.
475
476         * WebProcess/WebProcess.h:
477         * WebProcess/WebProcess.messages.in:
478
479 2015-02-16  Tim Horton  <timothy_horton@apple.com>
480
481         Adopt CAMachPort-as-layer-contents
482         https://bugs.webkit.org/show_bug.cgi?id=141687
483         <rdar://problem/19393233>
484
485         Reviewed by Simon Fraser.
486
487         * Shared/mac/RemoteLayerBackingStore.h:
488         * Shared/mac/RemoteLayerBackingStore.mm:
489         (WebKit::RemoteLayerBackingStore::decode):
490         If we have CAMachPort, just keep the MachSendRight around.
491
492         (WebKit::RemoteLayerBackingStore::applyBackingStoreToLayer):
493         If we have CAMachPort, make one and leak our send right into it. CAMachPort
494         will adopt the port and destroy it when needed.
495
496         (WebKit::RemoteLayerBackingStore::setBufferVolatility):
497         Tiny style fix.
498
499 2015-02-15  Sam Weinig  <sam@webkit.org>
500
501         Add experimental <attachment> element support
502         https://bugs.webkit.org/show_bug.cgi?id=141626
503
504         Reviewed by Tim Horton.
505
506         * Configurations/FeatureDefines.xcconfig:
507
508 2015-02-16  Tim Horton  <timothy_horton@apple.com>
509
510         REGRESSION (r176459): Process suspension cleanup timer sometimes never stops
511         https://bugs.webkit.org/show_bug.cgi?id=141669
512
513         Reviewed by Simon Fraser.
514
515         * WebProcess/WebProcess.cpp:
516         (WebKit::WebProcess::markAllLayersVolatileIfPossible):
517         r176459 accidentally removed the code to stop the cleanup timer
518         in the case where we successfully finish marking layers volatile,
519         causing the timer to continue running once the process comes back
520         from a suspended state.
521
522 2015-02-16  Anders Carlsson  <andersca@apple.com>
523
524         Check for the assume_nonnull feature instead of noescape
525         https://bugs.webkit.org/show_bug.cgi?id=141666
526
527         Reviewed by Dan Bernstein.
528
529         * Shared/API/Cocoa/WKFoundation.h:
530
531 2015-02-16  Anders Carlsson  <andersca@apple.com>
532
533         Add nullability qualifiers to all API headers
534         https://bugs.webkit.org/show_bug.cgi?id=141652
535         rdar://problem/19793630
536
537         Reviewed by Dan Bernstein.
538
539         * Shared/API/Cocoa/WKFoundation.h:
540         Add a WK_NULLABLE_SPECIFIER macro.
541
542         * UIProcess/API/Cocoa/WKBackForwardListItem.h:
543         * UIProcess/API/Cocoa/WKFrameInfo.h:
544         * UIProcess/API/Cocoa/WKNavigationAction.h:
545         * UIProcess/API/Cocoa/WKNavigationDelegate.h:
546         * UIProcess/API/Cocoa/WKNavigationResponse.h:
547         * UIProcess/API/Cocoa/WKScriptMessage.h:
548         * UIProcess/API/Cocoa/WKScriptMessageHandler.h:
549         * UIProcess/API/Cocoa/WKUIDelegate.h:
550         * UIProcess/API/Cocoa/WKUserContentController.h:
551         * UIProcess/API/Cocoa/WKUserScript.h:
552         * UIProcess/API/Cocoa/WKWebView.h:
553         * UIProcess/API/Cocoa/WKWebViewConfiguration.h:
554         * UIProcess/API/Cocoa/WKWindowFeatures.h:
555
556         * mac/postprocess-framework-headers.sh:
557         Handle the WK_NULLABLE_SPECIFIER macro. Change the WK_NULLABLE sed command to replace
558         all occurrences of WK_NULLABLE instead of just the first one.
559
560 2015-02-16  Dan Bernstein  <mitz@apple.com>
561
562         Update SPI availability annotations 
563         https://bugs.webkit.org/show_bug.cgi?id=141588
564
565         Reviewed by Anders Carlsson.
566
567         * Shared/API/Cocoa/WKFoundation.h: Added a definition of __NSi_8_3 for when building with
568         an older SDK.
569         * UIProcess/API/Cocoa/WKErrorPrivate.h:
570         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
571
572 2015-02-16  Antti Koivisto  <antti@apple.com>
573
574         Remove unused InjectedBundle::setCacheModel.
575
576         Rubber-stamped by Anders Carlsson.
577
578         * WebProcess/InjectedBundle/InjectedBundle.cpp:
579         (WebKit::InjectedBundle::setCacheModel): Deleted.
580         * WebProcess/InjectedBundle/InjectedBundle.h:
581
582 2015-02-16  Anders Carlsson  <andersca@apple.com>
583
584         Build fix for versions of Xcode that support nullability but don't have the Foundation #defines.
585
586         * Shared/API/Cocoa/WKFoundation.h:
587
588 2015-02-16  Antti Koivisto  <antti@apple.com>
589
590         Develop/Disable Caches does not properly disable disk cache
591         https://bugs.webkit.org/show_bug.cgi?id=141636
592
593         Reviewed by Anders Carlsson.
594
595         The menu item sets the cache model to "document viewer" to disable the caches (cache size 0).
596         However the cache model was never passed to the network process after the initialization.
597
598         * NetworkProcess/NetworkProcess.messages.in:
599         * NetworkProcess/cache/NetworkCacheStorageCocoa.mm:
600         (WebKit::NetworkCacheStorage::retrieve):
601         (WebKit::NetworkCacheStorage::store):
602         (WebKit::NetworkCacheStorage::update):
603
604             Don't try to store or retrieve when the maximum cache size is set to zero.
605
606         * UIProcess/WebProcessPool.cpp:
607         (WebKit::WebProcessPool::setCacheModel):
608
609            Message the network process too.
610
611         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
612         (WKBundleSetCacheModel): Deleted.
613
614             Remove the now unused SPI.
615
616         * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
617
618 2015-02-16  Antti Koivisto  <antti@apple.com>
619
620         Assertion in disk cache code with redirect to a non-http resource
621         https://bugs.webkit.org/show_bug.cgi?id=141644
622
623         Reviewed by Anders Carlsson.
624
625         * NetworkProcess/NetworkResourceLoader.cpp:
626         (WebKit::NetworkResourceLoader::didFinishLoading):
627
628             Check that response is HTTP before calling computeFreshnessLifetimeForHTTPFamily.
629
630         * NetworkProcess/cache/NetworkCache.cpp:
631         (WebKit::canStore):
632
633             Deny storing non-HTTP responses to cache (though the above already covers this).
634
635 2015-02-13  Anders Carlsson  <andersca@apple.com>
636
637         Add support for nullability to the header postprocessing
638         https://bugs.webkit.org/show_bug.cgi?id=141573
639
640         Reviewed by Darin Adler.
641
642         * Shared/API/Cocoa/WKFoundation.h:
643         * UIProcess/API/Cocoa/WKBackForwardList.h:
644         * mac/postprocess-framework-headers.sh:
645
646 2015-02-16  Grzegorz Czajkowski  <g.czajkowski@samsung.com>
647
648         [EFL] Rename WebContextEfl to WebProcessPoolEfl
649         https://bugs.webkit.org/show_bug.cgi?id=141642
650
651         Reviewed by Csaba Osztrogonác.
652
653         Although we've renamed almost everything in r177716, this is still
654         required after r177692.
655
656         * UIProcess/efl/WebProcessPoolEfl.cpp: Renamed from Source/WebKit2/UIProcess/efl/WebContextEfl.cpp.
657
658 2015-02-14  Alexey Proskuryakov  <ap@apple.com>
659
660         Build fix after <http://trac.webkit.org/changeset/180122>
661
662         * Platform/mac/StringUtilities.mm:
663
664 2015-02-14  Joseph Pecoraro  <pecoraro@apple.com>
665
666         [Mac] Possible DDActionContext leaks, RetainPtr cleanup
667         https://bugs.webkit.org/show_bug.cgi?id=141613
668
669         Reviewed by Tim Horton.
670
671         * UIProcess/mac/WKActionMenuController.mm:
672         (-[WKActionMenuController _defaultMenuItemsForDataDetectableLink]):
673         Adopt the allocated object.
674
675 2015-02-09  Brian J. Burg  <burg@cs.washington.edu>
676
677         Web Inspector: remove some unnecessary Inspector prefixes from class names in Inspector namespace
678         https://bugs.webkit.org/show_bug.cgi?id=141372
679
680         Reviewed by Joseph Pecoraro.
681
682         * WebProcess/WebPage/WebInspector.cpp:
683         (WebKit::WebInspector::remoteFrontendDisconnected):
684
685 2015-02-14  Beth Dakin  <bdakin@apple.com>
686
687         REGRESSION: Page opens with enlarged font after visiting PDF, navigating back, 
688         then doing a process swap
689         https://bugs.webkit.org/show_bug.cgi?id=141584
690         -and corresponding-
691         rdar://problem/18167729
692
693         Reviewed by Tim Horton.
694
695         This patch keeps the plugin zoom/scale factors separate from page zoom/scale 
696         factors in the UI process since they are used for slightly different purposes for 
697         plugins (i.e., PDFs) than they are for normal pages. Keeping track of the right 
698         factor for the right type of document will ensure that we don’t use the wrong one.
699
700         * UIProcess/WebPageProxy.cpp:
701         (WebKit::WebPageProxy::WebPageProxy):
702         (WebKit::WebPageProxy::pageZoomFactor):
703         (WebKit::WebPageProxy::pageScaleFactor):
704         (WebKit::WebPageProxy::pluginScaleFactorDidChange):
705         (WebKit::WebPageProxy::pluginZoomFactorDidChange):
706         (WebKit::WebPageProxy::didCommitLoadForFrame):
707         (WebKit::WebPageProxy::pageZoomFactorDidChange): Deleted.
708         * UIProcess/WebPageProxy.h:
709         (WebKit::WebPageProxy::pageZoomFactor): Deleted.
710         (WebKit::WebPageProxy::pageScaleFactor): Deleted.
711         * UIProcess/WebPageProxy.messages.in:
712         * WebProcess/Plugins/PluginView.cpp:
713         (WebKit::PluginView::setPageScaleFactor):
714
715 2015-02-14  Brian J. Burg  <burg@cs.washington.edu>
716
717         REGRESSION(r179573): Web Inspector toolbar is completely messed up on Mavericks
718         https://bugs.webkit.org/show_bug.cgi?id=141555
719
720         Reviewed by Joseph Pecoraro.
721
722         The old WKView-based code called _setDrawsBackground:NO on the WKView for Mavericks.
723         Simulate this old behavior by calling WebPageProxy::setDrawsBackground(false).
724
725         WKWebView's setOpaque:BOOL gives a flat background color instead of the intended
726         gradient, so we can't use that method.
727
728         * UIProcess/mac/WebInspectorProxyMac.mm:
729         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
730
731 2015-02-13  Simon Fraser  <simon.fraser@apple.com>
732
733         Crash closing a tab when a context or popup menu is open
734         https://bugs.webkit.org/show_bug.cgi?id=141582
735         rdar://problem/17700475
736
737         Reviewed by Anders Carlsson.
738
739         If a context menu or a popup menu is open when a tab is programmatically closed,
740         then we'd crash because both the WebContextMenuProxyMac/WebPopupMenuProxyMac
741         and the WebPageProxy would be deleted while still in use, via messages
742         handled via the nested event tracking runloop.
743
744         Fix by protecting those things while showing the popup. Also programmatically
745         dismiss the popup when closing the WebPageProxy.
746
747         * UIProcess/WebContextMenuProxy.h:
748         (WebKit::WebContextMenuProxy::cancelTracking):
749         * UIProcess/WebPageProxy.cpp:
750         (WebKit::WebPageProxy::close):
751         (WebKit::WebPageProxy::showPopupMenu): Clean up some EFL-related confusion that we don't need.
752         Retaining |this| will also retain m_activePopupMenu.
753         (WebKit::WebPageProxy::hidePopupMenu):
754         (WebKit::WebPageProxy::showContextMenu):
755         (WebKit::WebPageProxy::resetState):
756         * UIProcess/WebPopupMenuProxy.h:
757         (WebKit::WebPopupMenuProxy::cancelTracking):
758         * UIProcess/mac/WebContextMenuProxyMac.h:
759         * UIProcess/mac/WebContextMenuProxyMac.mm:
760         (WebKit::WebContextMenuProxyMac::showContextMenu):
761         (WebKit::WebContextMenuProxyMac::cancelTracking):
762         * UIProcess/mac/WebPopupMenuProxyMac.h: For popups, we need to remember if we were
763         canceled to avoid trying to send events after closing.
764         * UIProcess/mac/WebPopupMenuProxyMac.mm:
765         (WebKit::WebPopupMenuProxyMac::WebPopupMenuProxyMac):
766         (WebKit::WebPopupMenuProxyMac::showPopupMenu):
767         (WebKit::WebPopupMenuProxyMac::cancelTracking):
768
769 2015-02-13  Timothy Horton  <timothy_horton@apple.com>
770
771         Fix the iOS build.
772
773         * UIProcess/ios/ViewGestureControllerIOS.mm:
774         (WebKit::ViewGestureController::removeSwipeSnapshot):
775         * UIProcess/mac/ViewGestureController.h:
776         This code is never used on iOS.
777
778 2015-02-13  Timothy Horton  <timothy_horton@apple.com>
779
780         Make WebCore::IOSurface have single ownership instead of refcounting
781         https://bugs.webkit.org/show_bug.cgi?id=141578
782
783         Reviewed by Anders Carlsson.
784
785         * Shared/mac/RemoteLayerBackingStore.h:
786         * Shared/mac/RemoteLayerBackingStore.mm:
787         (WebKit::RemoteLayerBackingStore::Buffer::discard):
788         * UIProcess/API/mac/WKView.mm:
789         (-[WKView _takeViewSnapshot]):
790         * UIProcess/mac/ViewGestureController.h:
791         * UIProcess/mac/ViewGestureControllerMac.mm:
792         (WebKit::ViewGestureController::beginSwipeGesture):
793         (WebKit::ViewGestureController::removeSwipeSnapshot):
794         * UIProcess/mac/ViewSnapshotStore.h:
795         * UIProcess/mac/ViewSnapshotStore.mm:
796         (WebKit::ViewSnapshot::create):
797         (WebKit::ViewSnapshot::ViewSnapshot):
798         (WebKit::ViewSnapshot::hasImage):
799         Adjust to the single-ownership model.
800
801 2015-02-13  Brent Fulgham  <bfulgham@apple.com>
802
803         [iOS] Unreviewed build fix after r180076.
804
805         * UIProcess/WebPageProxy.cpp:
806         (WebKit::WebPageProxy::creationParameters): We do not
807         want to do this on iOS. 
808         * UIProcess/WebPageProxy.h: No need to expose function
809         on iOS (only Mac).
810
811 2015-02-13  Brent Fulgham  <bfulgham@apple.com>
812
813         [Mac, iOS] Adjust pagination behavior for Mail.app printing use
814         https://bugs.webkit.org/show_bug.cgi?id=141569
815         <rdar://problem/14912763>
816
817         Reviewed by Anders Carlsson.
818
819         * Shared/WebPageCreationParameters.cpp:
820         (WebKit::WebPageCreationParameters::encode): Add new flag.
821         (WebKit::WebPageCreationParameters::decode): Ditto.
822         * Shared/WebPageCreationParameters.h: Ditto.
823         * UIProcess/WebPageProxy.cpp:
824         (WebKit::WebPageProxy::creationParameters): Set new page construction flag.
825         * UIProcess/WebPageProxy.h:
826         * UIProcess/mac/WebPageProxyMac.mm:
827         (WebKit::WebPageProxy::paginationQuirkEnabled): Ask for new pagination flag
828         when running as a Mail client.
829         * WebProcess/WebPage/WebPage.cpp:
830         (WebKit::WebPage::WebPage): Set up pagination based on desired settings.
831
832 2015-02-12  Simon Fraser  <simon.fraser@apple.com>
833
834         determinePrimarySnapshottedPlugIn() should only traverse visible Frames
835         https://bugs.webkit.org/show_bug.cgi?id=141547
836         Part of rdar://problem/18445733.
837
838         Reviewed by Anders Carlsson.
839         
840         Use FrameTree::traverseNextRendered() to avoid doing things in unrendered frames
841         which are not guaranteed to have been laid out.
842
843         * WebProcess/WebPage/WebPage.cpp:
844         (WebKit::WebPage::determinePrimarySnapshottedPlugIn):
845
846 2015-02-13  Antti Koivisto  <antti@apple.com>
847
848         WorkQueue should support concurrent queues
849         https://bugs.webkit.org/show_bug.cgi?id=141559
850
851         Reviewed by Anders Carlsson.
852
853         * DatabaseProcess/DatabaseProcess.cpp:
854         (WebKit::DatabaseProcess::DatabaseProcess):
855         * Platform/IPC/Connection.h:
856         * Platform/IPC/mac/ConnectionMac.mm:
857         (IPC::Connection::open):
858         * Platform/WorkQueue.cpp:
859         (WorkQueue::create):
860
861             Also make create return a Ref.
862
863         (WorkQueue::WorkQueue):
864         * Platform/WorkQueue.h:
865
866             Add queue type enum.
867
868         * Platform/efl/WorkQueueEfl.cpp:
869         (WorkQueue::platformInitialize):
870         * Platform/gtk/WorkQueueGtk.cpp:
871         (WorkQueue::platformInitialize):
872         * Platform/mac/WorkQueueMac.cpp:
873         (WorkQueue::platformInitialize):
874         * Shared/mac/SecItemShim.cpp:
875         (WebKit::SecItemShim::initializeConnection):
876         * Shared/mac/SecItemShim.h:
877         * UIProcess/Launcher/ProcessLauncher.cpp:
878         (WebKit::processLauncherWorkQueue):
879         * UIProcess/mac/SecItemShimProxy.cpp:
880         (WebKit::SecItemShimProxy::initializeConnection):
881         * UIProcess/mac/SecItemShimProxy.h:
882         * WebProcess/Plugins/PluginProcessConnectionManager.cpp:
883         (WebKit::PluginProcessConnectionManager::initializeConnection):
884         * WebProcess/Plugins/PluginProcessConnectionManager.h:
885         * WebProcess/WebPage/EventDispatcher.cpp:
886         (WebKit::EventDispatcher::EventDispatcher):
887         (WebKit::EventDispatcher::initializeConnection):
888         * WebProcess/WebPage/EventDispatcher.h:
889         * WebProcess/WebPage/ViewUpdateDispatcher.h:
890
891 2015-02-12  Anders Carlsson  <andersca@apple.com>
892
893         Clean up the framework postprocessing phase
894         https://bugs.webkit.org/show_bug.cgi?id=141544
895
896         Reviewed by Dan Bernstein.
897
898         Rename WK_API_AVAILABILITY_ENABLED to WK_FRAMEWORK_HEADER_POSTPROCESSING_ENABLED to better match what
899         it is we're doing. Also, rename the associated script. Remove a couple of now unnecessary #defines, and
900         change everything we can to be feature-based instead of OS based.
901
902         * Configurations/WebKit.xcconfig:
903         * Shared/API/Cocoa/WKFoundation.h:
904         * WebKit2.xcodeproj/project.pbxproj:
905         * mac/postprocess-framework-headers.sh: Renamed from Source/WebKit2/mac/rewrite-availability-macros.sh.
906
907 2015-02-12  Tim Horton  <timothy_horton@apple.com>
908
909         Crash removing RemoteLayerTreeDisplayRefreshMonitor from the drawing area's map
910         https://bugs.webkit.org/show_bug.cgi?id=141545
911         <rdar://problem/17712200>
912
913         Reviewed by Simon Fraser.
914
915         * WebProcess/WebPage/WebPage.cpp:
916         (WebKit::WebPage::windowScreenDidChange):
917         * WebProcess/WebPage/WebPage.h:
918         * WebProcess/WebPage/WebPage.messages.in:
919         windowScreenDidChange should take uint32_t, since that's what PlatformDisplayID is.
920
921         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
922         (WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
923         RemoteLayerTreeDisplayRefreshMonitor is driven by the page's
924         RemoteLayerTreeDrawingArea. Because of this, we cannot have the same
925         sharing of DisplayRefreshMonitors that other platforms use.
926         In order to ensure that we get a unique DisplayRefreshMonitor
927         per-DrawingArea, give each page a unique DisplayID derived
928         from WebPage's unique ID.
929
930 2015-02-12  Tim Horton  <timothy_horton@apple.com>
931
932         Crash under RemoteLayerTreeDrawingArea::flushLayers() when closing a tab
933         https://bugs.webkit.org/show_bug.cgi?id=141541
934
935         Reviewed by Benjamin Poulain.
936
937         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
938         (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
939         The WebPage pointer can become stale between when it is retrieved
940         and dereferenced. Retrieve it by ID inside the dispatch_async block
941         instead of outside of it.
942
943 2015-02-12  Antti Koivisto  <antti@apple.com>
944
945         WebKit persistent cache uses a lot of threads
946         https://bugs.webkit.org/show_bug.cgi?id=141520
947
948         Reviewed by Andreas Kling.
949
950         Parallel retrieves are limited but stores are not. We may end up with lots of backround io
951         dispatch queue threads if they don't complete fast enough.
952
953         This patch adds pending state for write operations similar to what retrieves already have
954         and limits to number of active operations.
955
956         * NetworkProcess/cache/NetworkCacheStorage.h:
957
958             Combine StoreOperation and UpdateOperation and rename to WriteOperation.
959             Rename RetrieveOperation to ReadOperation.
960             The idea is to emphasize that these are disk operations.
961
962         * NetworkProcess/cache/NetworkCacheStorageCocoa.mm:
963         (WebKit::NetworkCacheStorage::dispatchReadOperation):
964         (WebKit::NetworkCacheStorage::dispatchPendingReadOperations):
965         (WebKit::retrieveFromMemory):
966         (WebKit::NetworkCacheStorage::retrieve):
967         (WebKit::NetworkCacheStorage::store):
968         (WebKit::NetworkCacheStorage::update):
969         (WebKit::NetworkCacheStorage::dispatchPendingWriteOperations):
970
971             Only allow 3 parallel writes.
972
973         (WebKit::NetworkCacheStorage::dispatchFullWriteOperation):
974         (WebKit::NetworkCacheStorage::dispatchHeaderWriteOperation):
975
976             More informative names.
977
978         (WebKit::NetworkCacheStorage::dispatchRetrieveOperation): Deleted.
979         (WebKit::NetworkCacheStorage::dispatchPendingRetrieveOperations): Deleted.
980         (WebKit::retrieveActive): Deleted.
981
982 2015-02-12  Carlos Garcia Campos  <cgarcia@igalia.com>
983
984         [GTK] Add API to allow overriding the default color chooser implementation
985         https://bugs.webkit.org/show_bug.cgi?id=98935
986
987         Reviewed by Gustavo Noronha Silva.
988
989         Add API to allow the user to override the default UI of color
990         chooser. Similar to the file chooser API, a new run-color-chooser
991         signal is added to WebKitWebView that passes a WebKitColorChooserRequest
992         parameter to the signal.
993
994         Initial patch by Arnaud Renevier <a.renevier@sisa.samsung.com>.
995
996         * PlatformGTK.cmake: Add new files to compilation.
997         * UIProcess/API/gtk/PageClientImpl.cpp:
998         (WebKit::PageClientImpl::createColorPicker): Create a
999         WebKitColorChooser is the view widget is a WebKitWebView or a
1000         WebColorPicker otherwise,
1001         * UIProcess/API/gtk/WebKitColorChooser.cpp: Added.
1002         (WebKit::WebKitColorChooser::create):
1003         (WebKit::WebKitColorChooser::WebKitColorChooser):
1004         (WebKit::WebKitColorChooser::~WebKitColorChooser):
1005         (WebKit::WebKitColorChooser::endPicker): Chain up to parent class
1006         when not having a request, or finish the request if we have one.
1007         (WebKit::WebKitColorChooser::colorChooserRequestFinished):
1008         (WebKit::WebKitColorChooser::colorChooserRequestRGBAChanged):
1009         (WebKit::WebKitColorChooser::showColorPicker): Create a new
1010         WebKitColorChooserRequest and emit WebKitWebView::run-color-chooser.
1011         If the signal is not handled, fallback to the default color
1012         chooser dialog implemented by the parent class.
1013         * UIProcess/API/gtk/WebKitColorChooser.h: Added.
1014         * UIProcess/API/gtk/WebKitColorChooserRequest.cpp: Added.
1015         (webkitColorChooserRequestGetProperty):
1016         (webkitColorChooserRequestSetProperty):
1017         (webkit_color_chooser_request_class_init):
1018         (webkit_color_chooser_request_set_rgba):
1019         (webkit_color_chooser_request_get_rgba):
1020         (webkit_color_chooser_request_get_element_rectangle):
1021         (webkit_color_chooser_request_finish):
1022         (webkit_color_chooser_request_cancel):
1023         (webkitColorChooserRequestCreate):
1024         * UIProcess/API/gtk/WebKitColorChooserRequest.h: Added.
1025         * UIProcess/API/gtk/WebKitColorChooserRequestPrivate.h: Added.
1026         * UIProcess/API/gtk/WebKitWebView.cpp:
1027         (webkit_web_view_class_init): Add run-color-chooser signal.
1028         (webkitWebViewEmitRunColorChooser): Emit run-color-chooser signal.
1029         * UIProcess/API/gtk/WebKitWebView.h:
1030         * UIProcess/API/gtk/WebKitWebViewPrivate.h:
1031         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: Add new symbols.
1032         * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml: Add new section for WebKitColorChooserRequest.
1033         * UIProcess/API/gtk/webkit2.h: Include WebKitColorChooserRequest.h
1034
1035 2015-02-11  Enrica Casucci  <enrica@apple.com>
1036
1037         iOS build fix.
1038
1039         Unreviewed.
1040
1041         * UIProcess/ios/WKContentViewInteraction.mm:
1042         (-[WKContentView inputAssistantItem]):
1043         (-[WKContentView _inputAssistantItem]):
1044
1045 2015-02-11  Chris Dumez  <cdumez@apple.com>
1046
1047         [WK2] Add logging to validate the network cache efficacy (Part 2)
1048         https://bugs.webkit.org/show_bug.cgi?id=141345
1049         <rdar://problem/19632080>
1050
1051         Reviewed by Sam Weinig.
1052
1053         Add diagnostic logging messages to validate the network cache efficacy.
1054         The following 4 messages are added:
1055         - networkCache / retrieval / success
1056         - networkCache / retrieval / unhandledRequestFailure
1057         - networkCache / retrieval / noLongerInCacheFailure
1058         - networkCache / retrieval / unusableCachedEntryFailure
1059
1060         The messages are sent via IPC from the NetworkProcess to the UIProcess,
1061         where the WebPageProxy code already handles diagnostic messages sent by
1062         the WebProcess.
1063
1064 2015-02-11  Tim Horton  <timothy_horton@apple.com>
1065
1066         REGRESSION (iOS 8): PDFs embedded in <object>/<embed> tag don't load at all
1067         https://bugs.webkit.org/show_bug.cgi?id=141457
1068         <rdar://problem/18221851>
1069
1070         Reviewed by Alexey Proskuryakov.
1071
1072         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1073         (WebKit::WebFrameLoaderClient::objectContentType):
1074         On iOS, if we don't know what to do with a PDF-in-object, treat it as an image.
1075
1076 2015-02-11  ChangSeok Oh  <changseok.oh@collabora.com>
1077
1078         Activate ReliefLogger of a memory pressure handler for linux system.
1079         https://bugs.webkit.org/show_bug.cgi?id=123611
1080
1081         Reviewed by Anders Carlsson.
1082
1083         * Shared/WebProcessCreationParameters.cpp:
1084         (WebKit::WebProcessCreationParameters::WebProcessCreationParameters):
1085         Make the parameter, shouldEnableMemoryPressureReliefLogging shareable with COCOA else systems.
1086         (WebKit::WebProcessCreationParameters::encode): ditto.
1087         (WebKit::WebProcessCreationParameters::decode): ditto.
1088         * Shared/WebProcessCreationParameters.h:
1089         * UIProcess/WebProcessPool.cpp:
1090         (WebKit::WebProcessPool::createNewWebProcess): Set shouldEnableMemoryPressureReliefLogging
1091         to true for linux system.
1092         * WebProcess/WebProcess.cpp:
1093         (WebKit::WebProcess::initializeWebProcess): Pass the shouldEnableMemoryPressureReliefLogging value
1094         to MemoryPressureHandler::ReliefLogger::setLoggingEnabled().
1095
1096 2015-02-11  Yusuke Suzuki  <utatane.tea@gmail.com>
1097
1098         [GTK][EFL] Suppress a warning of unused params
1099         https://bugs.webkit.org/show_bug.cgi?id=141474
1100
1101         Reviewed by Darin Adler.
1102
1103         Drop unused argument name, `directoryName`.
1104
1105         * UIProcess/API/APIWebsiteDataStore.cpp:
1106         (API::WebsiteDataStore::websiteDataDirectoryFileSystemRepresentation):
1107
1108 2015-02-11  Carlos Garcia Campos  <cgarcia@igalia.com>
1109
1110         [GTK] Add default color chooser implementation using GtkColorChooserDialog
1111         https://bugs.webkit.org/show_bug.cgi?id=141392
1112
1113         Reviewed by Gustavo Noronha Silva.
1114
1115         * PlatformGTK.cmake: Add new files to compilation.
1116         * UIProcess/API/gtk/PageClientImpl.cpp:
1117         (WebKit::PageClientImpl::createColorPicker): Call WebColorPickerGtk::create().
1118         * UIProcess/gtk/WebColorPickerGtk.cpp: Added.
1119         (WebKit::WebColorPickerGtk::create):
1120         (WebKit::WebColorPickerGtk::WebColorPickerGtk):
1121         (WebKit::WebColorPickerGtk::~WebColorPickerGtk):
1122         (WebKit::WebColorPickerGtk::cancel): Set initial color.
1123         (WebKit::WebColorPickerGtk::endPicker): Destroy the color chooser dialog.
1124         (WebKit::WebColorPickerGtk::didChooseColor): Notify the client.
1125         (WebKit::WebColorPickerGtk::colorChooserDialogRGBAChangedCallback):
1126         Update the selected color.
1127         (WebKit::WebColorPickerGtk::colorChooserDialogResponseCallback):
1128         Cancel or finish the operation depending on the dialog response.
1129         (WebKit::WebColorPickerGtk::showColorPicker): Create a
1130         GtkColorChooserDialog to handle the color picker operation.
1131         * UIProcess/gtk/WebColorPickerGtk.h: Added.
1132         (WebKit::WebColorPickerGtk::initialColor):
1133
1134 2015-02-11  Commit Queue  <commit-queue@webkit.org>
1135
1136         Unreviewed, rolling out r179910.
1137         https://bugs.webkit.org/show_bug.cgi?id=141464
1138
1139         Caused assertions on debug bots (Requested by ap on #webkit).
1140
1141         Reverted changeset:
1142
1143         "[WK2] Add logging to validate the network cache efficacy
1144         (Part 2)"
1145         https://bugs.webkit.org/show_bug.cgi?id=141345
1146         http://trac.webkit.org/changeset/179910
1147
1148 2015-02-10  Chris Dumez  <cdumez@apple.com>
1149
1150         [WK2] Add logging to validate the network cache efficacy (Part 2)
1151         https://bugs.webkit.org/show_bug.cgi?id=141345
1152         <rdar://problem/19632080>
1153
1154         Reviewed by Antti Koivisto.
1155
1156         Add diagnostic logging messages to validate the network cache efficacy.
1157         The following 4 messages are added:
1158         - networkCache / retrieval / success
1159         - networkCache / retrieval / unhandledRequestFailure
1160         - networkCache / retrieval / noLongerInCacheFailure
1161         - networkCache / retrieval / unusableCachedEntryFailure
1162
1163         The messages are sent via IPC from the NetworkProcess to the UIProcess,
1164         where the WebPageProxy code already handles diagnostic messages sent by
1165         the WebProcess.
1166
1167 2015-02-10  Conrad Shultz  <conrad_shultz@apple.com>
1168
1169         Clients need the ability to hook into immediate action lifecycle
1170         https://bugs.webkit.org/show_bug.cgi?id=141449
1171
1172         Reviewed by Tim Horton.
1173
1174         * UIProcess/API/Cocoa/WKViewPrivate.h:
1175         Expose new methods.
1176
1177         * UIProcess/API/mac/WKView.mm:
1178         (-[WKView _prepareForImmediateActionAnimation]):
1179         (-[WKView _cancelImmediateActionAnimation]):
1180         (-[WKView _completeImmediateActionAnimation]):
1181         Stub implementations.
1182
1183         * UIProcess/mac/WKImmediateActionController.mm:
1184         (-[WKImmediateActionController immediateActionRecognizerWillPrepare:]):
1185         Send -_prepareForImmediateActionAnimation.
1186         (-[WKImmediateActionController immediateActionRecognizerDidCancelAnimation:]):
1187         Send -_cancelImmediateActionAnimation.
1188         (-[WKImmediateActionController immediateActionRecognizerDidCompleteAnimation:]):
1189         Send -_completeImmediateActionAnimation.
1190
1191 2015-02-10  Dan Bernstein  <mitz@apple.com>
1192
1193         <rdar://problem/19770264> Starting a navigation gesture dismisses the keyboard
1194
1195         Reviewed by Tim Horton.
1196
1197         * UIProcess/ios/ViewGestureControllerIOS.mm:
1198         (WebKit::ViewGestureController::beginSwipeGesture): Reordered the view hierarchy changes,
1199         such that m_liveSwipeView will not momentarily move out of the window, because that causes
1200         the window’s first responder to be set to nil (if it was a descendant of m_liveSwipView).
1201
1202 2015-02-10  Enrica Casucci  <enrica@apple.com>
1203
1204         Hit testing is misplaced when selecting on wikipedia page.
1205         https://bugs.webkit.org/show_bug.cgi?id=141410
1206         rdar://problem/19768211
1207
1208         Reviewed by Simon Fraser.
1209
1210         When loading a new document into the same WebPage object, we need
1211         to clear the assisted node, since there is no guarantee that the
1212         node will be blurred. The bug was caused by the use of a stale
1213         assisted node to constrain the point where the gesture occurs.
1214         The node was still valid, since the previous page was in the cache.
1215         I've added a ASSERT to check that, when constraining the point to
1216         node rectangle, the node is in the same document as the one we
1217         are performing hit test on. When the frame is detached, we clear
1218         the assisted node if the node is part of the document is the frame
1219         being detached.
1220
1221         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1222         (WebKit::WebFrameLoaderClient::detachedFromParent2):
1223         * WebProcess/WebPage/WebPage.h:
1224         * WebProcess/WebPage/ios/WebPageIOS.mm:
1225         (WebKit::constrainPoint):
1226         (WebKit::WebPage::resetAssistedNodeForFrame):
1227
1228 2015-02-10  Joseph Pecoraro  <pecoraro@apple.com>
1229
1230         [Cocoa] NSData over retain in WKBrowsingContextController loadData
1231         https://bugs.webkit.org/show_bug.cgi?id=141437
1232
1233         Reviewed by Anders Carlsson.
1234
1235         * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
1236         (-[WKBrowsingContextController loadData:MIMEType:textEncodingName:baseURL:userData:]):
1237         API::Data::createWithoutCopying will automatically do the retaining / releasing for us.
1238
1239 2015-02-10  Zhuo Li  <zachli@apple.com>
1240
1241         [WK2] Add support for registering url schemes to bypass Content Security Policy.
1242         https://bugs.webkit.org/show_bug.cgi?id=140736
1243
1244         Reviewed by Anders Carlsson.
1245
1246         * Shared/WebProcessCreationParameters.cpp:
1247         (WebKit::WebProcessCreationParameters::encode):
1248         (WebKit::WebProcessCreationParameters::decode):
1249         * Shared/WebProcessCreationParameters.h:
1250         * UIProcess/API/C/WKContext.cpp:
1251         (WKContextRegisterURLSchemeAsBypassingContentSecurityPolicy):
1252         * UIProcess/API/C/WKContextPrivate.h:
1253         * UIProcess/WebProcessPool.cpp:
1254         (WebKit::WebProcessPool::createNewWebProcess):
1255         (WebKit::WebProcessPool::registerURLSchemeAsBypassingContentSecurityPolicy):
1256         * UIProcess/WebProcessPool.h:
1257         * WebProcess/WebProcess.cpp:
1258         (WebKit::WebProcess::initializeWebProcess):
1259         (WebKit::WebProcess::registerURLSchemeAsBypassingContentSecurityPolicy):
1260         * WebProcess/WebProcess.h:
1261         * WebProcess/WebProcess.messages.in:
1262
1263 2015-02-10  Sanghyup Lee  <sh53.lee@samsung.com>
1264
1265         [EFL] Use a variable to set flicking time instead of hardcoding
1266         https://bugs.webkit.org/show_bug.cgi?id=138950
1267
1268         Reviewed by Gyuyoung Kim.
1269
1270         Currently time of flick gesture animation is hardcoded as one second.
1271         This patch added a static variable to increase readability.
1272
1273         * UIProcess/API/efl/GestureRecognizer.cpp:
1274         (WebKit::GestureHandler::GestureHandler):
1275         (WebKit::GestureHandler::flickAnimatorCallback):
1276         (WebKit::GestureHandler::handleFlick):
1277
1278 2015-02-09  Enrica Casucci  <enrica@apple.com>
1279
1280         Selection flickers when trying to change size of selection.
1281         https://bugs.webkit.org/show_bug.cgi?id=141404
1282         rdar://problem/18824863
1283
1284         Reviewed by Benjamin Poulain.
1285
1286         When looking for the contracted range from the current range,
1287         we were incorrectly choosing a selection whose rectangle is empty
1288         as a best match candidate. This was throwing off all the logic
1289         and producing a contracted range whose rectangle was bigger than the
1290         expanded range, therefore producing a shrink threshold larger than the
1291         growth one.
1292
1293         * WebProcess/WebPage/ios/WebPageIOS.mm:
1294         (WebKit::WebPage::contractedRangeFromHandle):
1295
1296 2015-02-09  Brian J. Burg  <burg@cs.washington.edu>
1297
1298         REGRESSION(r179705): 2nd-level inspector availability no longer controlled by DeveloperExtrasEnabled user default
1299         https://bugs.webkit.org/show_bug.cgi?id=141343
1300
1301         Reviewed by Timothy Hatcher.
1302
1303         The regression was caused by the switch to using WKWebViewConfiguration and
1304         its default WebPreferences object, which is used to populate the inspector page's
1305         Settings object. This WebPreferences is initialized with no identifier, so
1306         only preferences in the FOR_EACH_WEBKIT_DEBUG_*_PREFERENCE macros are populated
1307         from NSUserDefaults.
1308
1309         The simplest fix is to move DeveloperExtrasEnabled into the DEBUG group.
1310
1311         Previously, each inspector level had a unique identifier such as
1312         __WebInspectorPageGroupLevelN__, and the n+1 level inspector was enabled
1313         by toggling __WebInspectorPageGroupLevelN__.WebKit2DeveloperExrasEnabled.
1314         With the move to the DEBUG group, the preference becomes simply
1315         WebKitDeveloperExtrasEnabled, which enables any level of inspector.
1316         (This does not clash with Safari's "Show Develop Menu" preference, which uses
1317         the key "WebKitDeveloperExtrasEnabledPreferenceKey")
1318
1319         * Shared/WebPreferencesDefinitions.h:
1320
1321 2015-02-08  Antti Koivisto  <antti@apple.com>
1322
1323         Measure cache size more accurately
1324         https://bugs.webkit.org/show_bug.cgi?id=141378
1325         <rdar://problem/19760224>
1326
1327         Reviewed by Chris Dumez.
1328
1329         Estimate the cache disk space usage from the actual entry sizes instead of the item count.
1330         This prevents large cache items from making the cache grow beyond its bounds.
1331
1332         * NetworkProcess/cache/NetworkCacheStorage.h:
1333         * NetworkProcess/cache/NetworkCacheStorageCocoa.mm:
1334         (WebKit::NetworkCacheStorage::initialize):
1335         (WebKit::NetworkCacheStorage::removeEntry):
1336         (WebKit::NetworkCacheStorage::store):
1337         (WebKit::NetworkCacheStorage::clear):
1338         (WebKit::NetworkCacheStorage::shrinkIfNeeded):
1339
1340 2015-02-09  Carlos Garcia Campos  <cgarcia@igalia.com>
1341
1342         REGRESSION(r179705): [GTK] The Web Inspector doesn't work after r179705
1343         https://bugs.webkit.org/show_bug.cgi?id=141333
1344
1345         Reviewed by Žan Doberšek.
1346
1347         Create an initialize WebPreferences for the inspector page. This
1348         was moved from cross-platform code to platform specific code.
1349
1350         * UIProcess/gtk/WebInspectorProxyGtk.cpp:
1351         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
1352
1353 2015-02-08  Timothy Horton  <timothy_horton@apple.com>
1354
1355         Null deref in _clearImmediateActionState when closing a view with a DataDetectors popover open
1356         https://bugs.webkit.org/show_bug.cgi?id=141377
1357         <rdar://problem/19711203>
1358
1359         Reviewed by Darin Adler.
1360
1361         * UIProcess/mac/WKImmediateActionController.mm:
1362         (-[WKImmediateActionController _clearImmediateActionState]):
1363         We can have already detached the page when DataDetectors calls us back
1364         in interactionStoppedHandler. While we have kept a strong reference to the
1365         page in the interactionStoppedHandler block, _page is nulled out.
1366         It's OK to avoid doing this work, in any case, because closing a page
1367         tears down the TextIndicator anyway.
1368
1369 2015-02-08  Chris Dumez  <cdumez@apple.com>
1370
1371         [WK2] Add logging to validate the network cache efficacy (Part 1)
1372         https://bugs.webkit.org/show_bug.cgi?id=141269
1373         <rdar://problem/19632080>
1374
1375         Reviewed by Antti Koivisto.
1376
1377         Add console logging to validate the network cache efficacy. This will
1378         tell us if how the network cache satisties requests, in particular:
1379         - Request cannot be handled by the cache
1380         - Entry was not in the cache but is no longer there (pruned)
1381         - Entry is in the cache but is not usable
1382         - Entry is in the cache and is used.
1383
1384         This patch introduces a SQLite-based network cache statistics storage
1385         that is used to store requests we have seen before, and query if we
1386         have seen a request before. The storage is lightweight as it only
1387         stores hashes in the database, in a background thread.
1388
1389         The statistics cache is initially bootstapped from the network disk
1390         cache so that we have data initially and get as accurate statistics
1391         as possible from the start.
1392
1393         To maintain an acceptable level of performance, we have a hard limit
1394         on the number of unique requests that are retained set to 100000.
1395
1396         Diagnostic logging for this will be added in a follow-up patch.
1397
1398 2015-02-07  Chris Dumez  <cdumez@apple.com>
1399
1400         Add Vector::removeFirstMatching() / removeAllMatching() methods taking lambda functions
1401         https://bugs.webkit.org/show_bug.cgi?id=141321
1402
1403         Reviewed by Darin Adler.
1404
1405         Use new Vector::removeFirstMatching() / removeAllMatching() methods.
1406
1407 2015-02-07  Tim Horton  <timothy_horton@apple.com>
1408
1409         Add API::HistoryClient and split some things out of API::NavigationClient
1410         https://bugs.webkit.org/show_bug.cgi?id=141264
1411
1412         Reviewed by Darin Adler.
1413
1414         * UIProcess/API/APIHistoryClient.h: Added.
1415         (API::HistoryClient::~HistoryClient):
1416         (API::HistoryClient::didNavigateWithNavigationData):
1417         (API::HistoryClient::didPerformClientRedirect):
1418         (API::HistoryClient::didPerformServerRedirect):
1419         (API::HistoryClient::didUpdateHistoryTitle):
1420         * UIProcess/API/APINavigationClient.h:
1421         (API::NavigationClient::didNavigateWithNavigationData): Deleted.
1422         (API::NavigationClient::didPerformClientRedirect): Deleted.
1423         (API::NavigationClient::didPerformServerRedirect): Deleted.
1424         (API::NavigationClient::didUpdateHistoryTitle): Deleted.
1425         * UIProcess/Cocoa/NavigationState.h:
1426         * UIProcess/Cocoa/NavigationState.mm:
1427         (WebKit::NavigationState::createHistoryClient):
1428         (WebKit::NavigationState::HistoryClient::HistoryClient):
1429         (WebKit::NavigationState::HistoryClient::~HistoryClient):
1430         (WebKit::NavigationState::HistoryClient::didNavigateWithNavigationData):
1431         (WebKit::NavigationState::HistoryClient::didPerformClientRedirect):
1432         (WebKit::NavigationState::HistoryClient::didPerformServerRedirect):
1433         (WebKit::NavigationState::HistoryClient::didUpdateHistoryTitle):
1434         (WebKit::NavigationState::NavigationClient::didNavigateWithNavigationData): Deleted.
1435         (WebKit::NavigationState::NavigationClient::didPerformClientRedirect): Deleted.
1436         (WebKit::NavigationState::NavigationClient::didPerformServerRedirect): Deleted.
1437         (WebKit::NavigationState::NavigationClient::didUpdateHistoryTitle): Deleted.
1438         * UIProcess/WebPageProxy.cpp:
1439         (WebKit::WebPageProxy::setHistoryClient):
1440         (WebKit::WebPageProxy::didNavigateWithNavigationData):
1441         (WebKit::WebPageProxy::didPerformClientRedirect):
1442         (WebKit::WebPageProxy::didPerformServerRedirect):
1443         (WebKit::WebPageProxy::didUpdateHistoryTitle):
1444         * UIProcess/WebPageProxy.h:
1445         Add a API::HistoryClient and move the few things that belong on it out of API::NavigationClient.
1446         Adjust accordingly in WebPageProxy and NavigationState.
1447
1448         * UIProcess/API/Cocoa/WKWebView.mm:
1449         (-[WKWebView initWithFrame:configuration:]):
1450         (-[WKWebView setNavigationDelegate:]):
1451         (-[WKWebView setUIDelegate:]):
1452         (-[WKWebView _setHistoryDelegate:]):
1453         Lazily push the NavigationState/UIDelegate clients down to WebPageProxy upon
1454         installation of a delegate, so that alternative (C SPI) delegate setters can
1455         be separately created.
1456
1457         * WebKit2.xcodeproj/project.pbxproj:
1458
1459 2015-02-07  Antti Koivisto  <antti@apple.com>
1460
1461         And as a further followup restore the 8bit test too.
1462
1463         * NetworkProcess/cache/NetworkCacheKey.cpp:
1464         (WebKit::hashString):
1465
1466 2015-02-07  Antti Koivisto  <antti@apple.com>
1467
1468         Use longer hashes for cache keys
1469         https://bugs.webkit.org/show_bug.cgi?id=141356
1470
1471         Rubber-stamped by Darin Adler.
1472
1473         Folloup and build fix.
1474
1475         * NetworkProcess/cache/NetworkCacheCoders.h:
1476         * NetworkProcess/cache/NetworkCacheKey.cpp:
1477         (WebKit::hashString):
1478
1479             Use containsOnlyASCII instead of is8Bit so both paths always compute the same hash.
1480
1481         * NetworkProcess/cache/NetworkCacheKey.h:
1482
1483 2015-02-07  Antti Koivisto  <antti@apple.com>
1484
1485         Remove a printf.
1486
1487         * NetworkProcess/cache/NetworkCache.cpp:
1488         (WebKit::NetworkCache::retrieve):
1489
1490 2015-02-07  Antti Koivisto  <antti@apple.com>
1491
1492         Use longer hashes for cache keys
1493         https://bugs.webkit.org/show_bug.cgi?id=141356
1494
1495         Reviewed by Darin Adler.
1496
1497         The current key hashes are 32bit. We should use longer hashes to eliminate collisions.
1498
1499         This patch switches us to using MD5 digests for the cache key hashes. As a result the file names for the cache
1500         entries grow from 8 to 32 character.
1501
1502         Note that we don't need a cryptographic hash (full cache keys are verified against the entries).
1503         MD5 just happens to be fast, convenient and available.
1504
1505         The patch also moves the whole cache hierarchy down to a versioned subdirectory ("WebKitCache/Version 2")
1506         and deletes any old style cache files if they exist.
1507
1508         * NetworkProcess/cache/NetworkCacheCoders.cpp:
1509         (WebKit::NetworkCacheCoder<MD5::Digest>::encode):
1510         (WebKit::NetworkCacheCoder<MD5::Digest>::decode):
1511         * NetworkProcess/cache/NetworkCacheCoders.h:
1512         * NetworkProcess/cache/NetworkCacheKey.cpp:
1513         (WebKit::NetworkCacheKey::NetworkCacheKey):
1514         (WebKit::hashString):
1515         (WebKit::NetworkCacheKey::computeHash):
1516         (WebKit::NetworkCacheKey::hashAsString):
1517         (WebKit::NetworkCacheKey::stringToHash):
1518         * NetworkProcess/cache/NetworkCacheKey.h:
1519         (WebKit::NetworkCacheKey::shortHash):
1520         (WebKit::NetworkCacheKey::toShortHash):
1521
1522             32bit hash to use in the bloom filter.
1523
1524         (WebKit::NetworkCacheKey::hashStringLength):
1525         * NetworkProcess/cache/NetworkCacheStorage.h:
1526
1527             Bump the version.
1528
1529         * NetworkProcess/cache/NetworkCacheStorageCocoa.mm:
1530         (WebKit::traverseCacheFiles):
1531         (WebKit::makeVersionedDirectoryPath):
1532         (WebKit::NetworkCacheStorage::NetworkCacheStorage):
1533         (WebKit::NetworkCacheStorage::initialize):
1534         (WebKit::NetworkCacheStorage::removeEntry):
1535         (WebKit::NetworkCacheStorage::retrieve):
1536         (WebKit::NetworkCacheStorage::store):
1537         (WebKit::NetworkCacheStorage::update):
1538         (WebKit::NetworkCacheStorage::shrinkIfNeeded):
1539         (WebKit::NetworkCacheStorage::deleteOldVersions):
1540
1541             Wipe out the version 1 cache.
1542
1543 2015-02-06  Chris Dumez  <cdumez@apple.com>
1544
1545         Have SQLiteStatement::database() return a reference
1546         https://bugs.webkit.org/show_bug.cgi?id=141348
1547
1548         Reviewed by Andreas Kling.
1549
1550         Have SQLiteStatement::database() return a reference as it can never
1551         return null.
1552
1553         * DatabaseProcess/IndexedDB/sqlite/SQLiteIDBCursor.cpp:
1554         (WebKit::SQLiteIDBCursor::internalAdvanceOnce):
1555
1556 2015-02-06  Alexey Proskuryakov  <ap@apple.com>
1557
1558         Report network process crashes during layout tests
1559         https://bugs.webkit.org/show_bug.cgi?id=139646
1560
1561         Reviewed by Anders Carlsson.
1562
1563         Added a way to get network process pid, modeled after how we do this for web process.
1564
1565         * UIProcess/API/C/mac/WKContextPrivateMac.h:
1566         * UIProcess/API/C/mac/WKContextPrivateMac.mm:
1567         (WKContextGetNetworkProcessIdentifier):
1568         * UIProcess/WebProcessPool.cpp:
1569         (WebKit::WebProcessPool::networkProcessCrashed): Don't reset m_networkProcess until
1570         after calling the client, so that the client could retrieve its pid.
1571         (WebKit::WebProcessPool::networkProcessIdentifier):
1572         * UIProcess/WebProcessPool.h:
1573
1574 2015-02-05  Timothy Hatcher  <timothy@apple.com>
1575
1576         Support overriding the deviceScaleFactor per WKWebView/WKView
1577         https://bugs.webkit.org/show_bug.cgi?id=141311
1578
1579         Reviewed by Tim Horton.
1580
1581         * UIProcess/API/Cocoa/WKViewPrivate.h:
1582         * UIProcess/API/Cocoa/WKWebView.mm:
1583         (-[WKWebView _setOverrideDeviceScaleFactor:]):
1584         (-[WKWebView _overrideDeviceScaleFactor]):
1585         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1586         * UIProcess/API/mac/WKView.mm:
1587         (-[WKView _intrinsicDeviceScaleFactor]):
1588         (-[WKView _setOverrideDeviceScaleFactor:]):
1589         (-[WKView _overrideDeviceScaleFactor]):
1590
1591 2015-02-06  Carlos Garcia Campos  <cgarcia@igalia.com>
1592
1593         [GTK] Remove WebKitWebView::close-notification signal
1594         https://bugs.webkit.org/show_bug.cgi?id=141330
1595
1596         Reviewed by Gustavo Noronha Silva.
1597
1598         In favor of a WebKitNotification::closed signal and
1599         webkit_notification_close() method that both applications and
1600         WebKit can use to close a notification. This also fixes the
1601         onclose event that was not fired when the notification was
1602         closed. It also brings back padding space in WebKitWebViewClass.
1603
1604         * UIProcess/API/gtk/WebKitNotification.cpp:
1605         (webkit_notification_class_init): Add WebKitNotification::closed signal.
1606         (webkit_notification_close): Emit WebKitNotification::closed.
1607         * UIProcess/API/gtk/WebKitNotification.h:
1608         * UIProcess/API/gtk/WebKitNotificationProvider.cpp:
1609         (WebKitNotificationProvider::notificationCloseCallback): Callback
1610         for WebKitNotification::closed signal that notifies the WebProcess
1611         and removes the notification from the map.
1612         (WebKitNotificationProvider::show): Connect to WebKitNotification::closed.
1613         (WebKitNotificationProvider::cancelNotificationByID): Call webkit_notification_close().
1614         * UIProcess/API/gtk/WebKitNotificationProvider.h:
1615         * UIProcess/API/gtk/WebKitWebView.cpp:
1616         (notifyNotificationClosed): The user closed the annotation, call
1617         webkit_notification_close().
1618         (webNotificationClosed): The WebKitNotification has been closed,
1619         close the libnotify notification if it hasn't been closed yet.
1620         (webkitWebViewShowNotification): Create the libnotifiy
1621         notification if needed and associate it to the WebKitNotification
1622         as user data. Connect to the closed signal of both, the libnotifiy
1623         notification and the WebKit notification.
1624         (webkitWebViewCloseNotification): Deleted.
1625         (webkit_web_view_class_init): Remove close-notification signal and
1626         the default hanlder.
1627         (webkitWebViewEmitCloseNotification): Deleted.
1628         * UIProcess/API/gtk/WebKitWebView.h:
1629         * UIProcess/API/gtk/WebKitWebViewPrivate.h:
1630         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: Add webkit_notification_close.
1631
1632 2015-02-06  Carlos Garcia Campos  <cgarcia@igalia.com>
1633
1634         ASSERTION FAILED: !m_adoptionIsRequired in WTF::RefCountedBase::ref
1635         https://bugs.webkit.org/show_bug.cgi?id=141035
1636
1637         Reviewed by Sergio Villar Senin.
1638
1639         Rename PrinterListGtk::singleton() as PrinterListGtk::getOrCreate(), and
1640         make it return nullptr when the shared PrinterListGtk object is
1641         still being created. This can happen if the nested loop used by
1642         gtk_enumerate_printers dispatches a GSource that starts a new
1643         synchronous print operation. In that case we just ignore the
1644         second print operation, since there's already one ongoing.
1645
1646         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1647         (WebKit::WebChromeClient::print): Return early if
1648         PrinterListGtk::getOrCreate() return nullptr.
1649         * WebProcess/WebPage/gtk/PrinterListGtk.cpp:
1650         (WebKit::PrinterListGtk::getOrCreate): Return nullptr if the
1651         PrinterListGtk is still enumerating the printers.
1652         (WebKit::PrinterListGtk::PrinterListGtk): Initialize
1653         m_enumeratingPrinters to true before calling
1654         gtk_enumerate_printers, and to false once it finishes.
1655         (WebKit::PrinterListGtk::singleton): Deleted.
1656         (WebKit::PrinterListGtk::enumeratePrintersFunction): Deleted.
1657         * WebProcess/WebPage/gtk/PrinterListGtk.h:
1658         * WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp: Add an
1659         assertion here since PrinterListGtk::getOrCreate() should never
1660         return nullptr at this point.
1661
1662 2015-02-05  Tim Horton  <timothy_horton@apple.com>
1663
1664         Null deref in ViewGestureController::beginSwipeGesture when swiping while script is navigating
1665         https://bugs.webkit.org/show_bug.cgi?id=141308
1666         <rdar://problem/18460046>
1667
1668         Reviewed by Simon Fraser.
1669
1670         * UIProcess/mac/ViewGestureControllerMac.mm:
1671         (WebKit::ViewGestureController::trackSwipeGesture):
1672         If script navigates (history.back, probably other cases too) while in the middle of
1673         building up enough scroll events to start a swipe, it can destroy the history item
1674         that we were planning to swipe to. If this happens, bail from the swipe.
1675
1676 2015-02-05  Alexey Proskuryakov  <ap@apple.com>
1677
1678         Don't pass architecture to development plug-in XPC services
1679         https://bugs.webkit.org/show_bug.cgi?id=141309
1680
1681         Reviewed by Anders Carlsson.
1682
1683         We now have separate services for 32-bit and 64-bit.
1684
1685         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.Development.mm:
1686         (WebKit::reexec):
1687         (WebKit::XPCServiceEventHandler):
1688         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
1689         (WebKit::connectToReExecService):
1690
1691 2015-02-05  Chris Dumez  <cdumez@apple.com>
1692
1693         Use deleteEmptyDirectory() in NetworkCacheStorage::clear()
1694         https://bugs.webkit.org/show_bug.cgi?id=141314
1695
1696         Reviewed by Antti Koivisto.
1697
1698         Use deleteEmptyDirectory() in NetworkCacheStorage::clear() to simplify
1699         the code a little bit.
1700
1701         * NetworkProcess/cache/NetworkCacheStorageCocoa.mm:
1702         (WebKit::NetworkCacheStorage::clear):
1703
1704 2015-02-05  Joseph Pecoraro  <pecoraro@apple.com>
1705
1706         [iOS] Remove False Positive dispatch_source Leak in WebMemoryPressureHandler singleton
1707         https://bugs.webkit.org/show_bug.cgi?id=141307
1708
1709         Reviewed by Anders Carlsson.
1710
1711         * UIProcess/ios/WebMemoryPressureHandlerIOS.h:
1712         * UIProcess/ios/WebMemoryPressureHandlerIOS.mm:
1713         (WebKit::WebMemoryPressureHandler::WebMemoryPressureHandler):
1714         We want to keep the dispatch_source around, so just tie it to the
1715         singleton so that it is not reported as a leak.
1716
1717 2015-02-05  Antti Koivisto  <antti@apple.com>
1718
1719         Switch to file backed buffer when resource is cached to disk
1720         https://bugs.webkit.org/show_bug.cgi?id=141295
1721
1722         Reviewed by Chris Dumez.
1723
1724         Wire the DidCacheResource mechanism to the new disk cache.
1725
1726         * NetworkProcess/NetworkResourceLoader.cpp:
1727         (WebKit::NetworkResourceLoader::didFinishLoading):
1728
1729             Send DidCacheResource message to the web process so it can switch the resource to file backing.
1730
1731         * NetworkProcess/cache/NetworkCache.cpp:
1732         (WebKit::NetworkCache::store):
1733         (WebKit::NetworkCache::update):
1734         * NetworkProcess/cache/NetworkCache.h:
1735         * NetworkProcess/cache/NetworkCacheStorage.h:
1736         (WebKit::DispatchPtr::DispatchPtr):
1737         * NetworkProcess/cache/NetworkCacheStorageCocoa.mm:
1738         (WebKit::NetworkCacheStorage::Data::Data):
1739         (WebKit::mapFile):
1740         (WebKit::decodeEntry):
1741         (WebKit::retrieveActive):
1742         (WebKit::NetworkCacheStorage::retrieve):
1743         (WebKit::NetworkCacheStorage::store):
1744
1745             Map files larger than a memory page after a successful store.
1746
1747         (WebKit::NetworkCacheStorage::update):
1748         (WebKit::encodeEntry): Deleted.
1749
1750 2015-02-05  Chris Dumez  <cdumez@apple.com>
1751
1752         [WK2] Properly check for mmap() error case
1753         https://bugs.webkit.org/show_bug.cgi?id=141304
1754
1755         Reviewed by Anders Carlsson.
1756
1757         mmap() returns MAP_FAILED, which is (void*)-1, not a null pointer in
1758         case of failure. This patch updates several wrong error checks in
1759         WebKit2.
1760
1761         * Platform/IPC/ArgumentEncoder.cpp:
1762         (IPC::allocBuffer):
1763         (IPC::ArgumentEncoder::reserve):
1764         * Platform/IPC/mac/ConnectionMac.mm:
1765         (IPC::Connection::sendOutgoingMessage):
1766
1767 2015-02-05  Brian J. Burg  <burg@cs.washington.edu>
1768
1769         Clean up WebInspectorProxy and use simpler inspector levels design
1770         https://bugs.webkit.org/show_bug.cgi?id=141135
1771
1772         Reviewed by Timothy Hatcher.
1773
1774         Inspector levels used to be managed by keeping a set of WebPageGroup
1775         instances and doing pointer comparisons to check whether the inspected
1776         view is itself a web inspector instance. This is unnecessary, as we
1777         can maintain a mapping from WebPageProxy* to its corresponding level.
1778
1779         When an inspector instance is created, it is inserted into the mapping
1780         along with its level. An inspector's level is 1 unless its inspected page
1781         is in the mapping, then it is one greater that the inspected page's level.
1782
1783         The level is provided by inspectorLevel(), rather than a member variable.
1784         WebInspectorProxy is created in the constructor of WebPageProxy. Thus, there
1785         would be no chance to add the inspector page's level to the mapping before the
1786         next level inspector tries to look it up when initializing its members.
1787
1788         This patch introduces other miscellaneous cleanups, such as naming m_page
1789         to m_inspectedPage, using Ref and using an enum class for the attachment side.
1790
1791         * UIProcess/API/C/WKInspector.cpp:
1792         (WKInspectorGetPage):
1793         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
1794         (resizeWebKitWebViewBaseFromAllocation):
1795         * UIProcess/InspectorServer/efl/WebInspectorServerEfl.cpp:
1796         * UIProcess/InspectorServer/gtk/WebInspectorServerGtk.cpp:
1797         * UIProcess/WebInspectorProxy.cpp:
1798         (WebKit::pageLevelMap):
1799         (WebKit::WebInspectorProxy::WebInspectorProxy):
1800         (WebKit::WebInspectorProxy::inspectorLevel):
1801         (WebKit::WebInspectorProxy::inspectorPageGroupIdentifier):
1802         (WebKit::WebInspectorProxy::inspectorPagePreferences):
1803         (WebKit::WebInspectorProxy::invalidate):
1804         (WebKit::WebInspectorProxy::isFront):
1805         (WebKit::WebInspectorProxy::connect):
1806         (WebKit::WebInspectorProxy::show):
1807         (WebKit::WebInspectorProxy::hide):
1808         (WebKit::WebInspectorProxy::close):
1809         (WebKit::WebInspectorProxy::didRelaunchInspectorPageProcess):
1810         (WebKit::WebInspectorProxy::showConsole):
1811         (WebKit::WebInspectorProxy::showResources):
1812         (WebKit::WebInspectorProxy::showMainResourceForFrame):
1813         (WebKit::WebInspectorProxy::attachBottom):
1814         (WebKit::WebInspectorProxy::attachRight):
1815         (WebKit::WebInspectorProxy::attach):
1816         (WebKit::WebInspectorProxy::detach):
1817         (WebKit::WebInspectorProxy::togglePageProfiling):
1818         (WebKit::WebInspectorProxy::isInspectorPage):
1819         (WebKit::decidePolicyForNavigationAction):
1820         (WebKit::WebInspectorProxy::remoteFrontendConnected):
1821         (WebKit::WebInspectorProxy::remoteFrontendDisconnected):
1822         (WebKit::WebInspectorProxy::dispatchMessageFromRemoteFrontend):
1823         (WebKit::WebInspectorProxy::eagerlyCreateInspectorPage):
1824         (WebKit::WebInspectorProxy::createInspectorPage):
1825         (WebKit::WebInspectorProxy::didClose):
1826         (WebKit::WebInspectorPageGroups::singleton): Deleted.
1827         (WebKit::WebInspectorPageGroups::inspectorLevel): Deleted.
1828         (WebKit::WebInspectorPageGroups::isInspectorPageGroup): Deleted.
1829         (WebKit::WebInspectorPageGroups::inspectorPageGroupLevel): Deleted.
1830         (WebKit::WebInspectorPageGroups::inspectorPageGroupForLevel): Deleted.
1831         (WebKit::WebInspectorPageGroups::createInspectorPageGroup): Deleted.
1832         (WebKit::WebInspectorProxy::~WebInspectorProxy): Deleted.
1833         (WebKit::WebInspectorProxy::inspectorPageGroup): Deleted.
1834         (WebKit::WebInspectorProxy::setAttachedWindowHeight): Deleted.
1835         (WebKit::WebInspectorProxy::enableRemoteInspection): Deleted.
1836         (WebKit::WebInspectorProxy::open): Deleted.
1837         * UIProcess/WebInspectorProxy.h:
1838         (WebKit::WebInspectorProxy::create):
1839         (WebKit::WebInspectorProxy::inspectedPage):
1840         (WebKit::WebInspectorProxy::page): Deleted.
1841         * UIProcess/efl/WebInspectorProxyEfl.cpp:
1842         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
1843         * UIProcess/gtk/WebInspectorProxyGtk.cpp:
1844         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
1845         (WebKit::WebInspectorProxy::dockButtonClicked):
1846         (WebKit::WebInspectorProxy::createInspectorWindow):
1847         (WebKit::WebInspectorProxy::platformInspectedWindowHeight):
1848         (WebKit::WebInspectorProxy::platformInspectedWindowWidth):
1849         (WebKit::WebInspectorProxy::platformAttach):
1850         (WebKit::WebInspectorProxy::platformDetach):
1851         (WebKit::WebInspectorProxy::platformSetAttachedWindowHeight):
1852         (WebKit::WebInspectorProxy::platformSetAttachedWindowWidth):
1853         * UIProcess/mac/WebInspectorProxyMac.mm:
1854         (-[WKWebInspectorProxyObjCAdapter attachRight:]):
1855         (-[WKWebInspectorProxyObjCAdapter attachBottom:]):
1856         (WebKit::WebInspectorProxy::createInspectorWindow):
1857         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
1858         (WebKit::WebInspectorProxy::platformBringToFront):
1859         (WebKit::WebInspectorProxy::windowFrameDidChange):
1860         (WebKit::WebInspectorProxy::inspectedViewFrameDidChange):
1861         (WebKit::WebInspectorProxy::platformInspectedWindowHeight):
1862         (WebKit::WebInspectorProxy::platformInspectedWindowWidth):
1863         (WebKit::WebInspectorProxy::platformAttach):
1864         (WebKit::WebInspectorProxy::platformDetach):
1865         (-[WKWebInspectorProxyObjCAdapter close]): Deleted.
1866
1867 2015-02-05  Chris Dumez  <cdumez@apple.com>
1868
1869         [WK2][Cocoa] Populate m_contentsFilter bloom filter from the main dispatch queue NetworkCacheStorage::initialize()
1870         https://bugs.webkit.org/show_bug.cgi?id=141297
1871
1872         Reviewed by Antti Koivisto.
1873
1874         Populate m_contentsFilter bloom filter from the main dispatch queue
1875         NetworkCacheStorage::initialize() to avoid thread-safety issues.
1876
1877         * NetworkProcess/cache/NetworkCacheStorageCocoa.mm:
1878         (WebKit::NetworkCacheStorage::initialize):
1879
1880 2015-02-05  Chris Dumez  <cdumez@apple.com>
1881
1882         Use deleteFile() in NetworkCacheStorageCocoa.mm
1883         https://bugs.webkit.org/show_bug.cgi?id=141299
1884
1885         Reviewed by Antti Koivisto.
1886
1887         Use deleteFile() in NetworkCacheStorageCocoa.mm to simplify the code
1888         a bit.
1889
1890         * NetworkProcess/cache/NetworkCacheStorageCocoa.mm:
1891         (WebKit::NetworkCacheStorage::removeEntry):
1892         (WebKit::NetworkCacheStorage::clear):
1893         (WebKit::NetworkCacheStorage::shrinkIfNeeded):
1894
1895 2015-02-04  Antti Koivisto  <antti@apple.com>
1896
1897         Avoid copying std::functions across threads in NetworkCacheStorage
1898         https://bugs.webkit.org/show_bug.cgi?id=141273
1899
1900         Reviewed by Andreas Kling.
1901
1902         The current approach is risky. There is possiblity that captured variables are
1903         deleted in an unexpected thread.
1904
1905         * NetworkProcess/cache/NetworkCache.cpp:
1906         (WebKit::NetworkCache::retrieve):
1907
1908             The capture trick here is no longer needed.
1909
1910         * NetworkProcess/cache/NetworkCacheStorage.h:
1911
1912             For each cache operation we create Retrive/Store/UpdateOperation object kept alive by the active operation map.
1913             This object captures all parameters of the operation including the lambda. When the operation completes
1914             the object is removed from the map in the main thread, ensuring safe destruction.
1915
1916         * NetworkProcess/cache/NetworkCacheStorageCocoa.mm:
1917         (WebKit::NetworkCacheStorage::dispatchRetrieveOperation):
1918         (WebKit::NetworkCacheStorage::dispatchPendingRetrieveOperations):
1919         (WebKit::retrieveActive):
1920
1921             Instead of maintaining a separate write cache we just look through the active write and update maps.
1922
1923         (WebKit::NetworkCacheStorage::retrieve):
1924
1925             Use fixed sized priority array rather than a dynamic one. Vector<Deque<std::unique_ptr>> doesn't quite work.
1926
1927         (WebKit::NetworkCacheStorage::store):
1928         (WebKit::NetworkCacheStorage::update):
1929         (WebKit::NetworkCacheStorage::clear):
1930
1931 2015-02-05  Youenn Fablet  <youenn.fablet@crf.canon.fr> and Xabier Rodriguez Calvar <calvaris@igalia.com>
1932
1933         [Streams API] Implement a barebone ReadableStream interface
1934         https://bugs.webkit.org/show_bug.cgi?id=141045
1935
1936         Reviewed by Benjamin Poulain.
1937
1938         * CMakeLists.txt:
1939         * Configurations/FeatureDefines.xcconfig:
1940
1941 2015-02-04  Joseph Pecoraro  <pecoraro@apple.com>
1942
1943         [iOS] Selection callout does not follow selection when double-tap scrolling
1944         https://bugs.webkit.org/show_bug.cgi?id=141214
1945
1946         Reviewed by Benjamin Poulain.
1947
1948         Implement the delegate that gets called after UIScrollView
1949         setContentOffset animations. When scrolling to a rect, do the normal
1950         willScroll, didScroll actions to update the selection assistant.
1951
1952         * UIProcess/API/Cocoa/WKWebView.mm:
1953         (-[WKWebView _scrollToRect:origin:minimumScrollDistance:]):
1954         (-[WKWebView scrollViewDidEndScrollingAnimation:]):
1955
1956 2015-02-04  Simon Fraser  <simon.fraser@apple.com>
1957
1958         [iOS WK2] Layers that are created and destroyed in the same transaction shouldn't be encoded
1959         https://bugs.webkit.org/show_bug.cgi?id=141228
1960
1961         Reviewed by Tim Horton.
1962         
1963         With UI-side compositing, it was possible for layers to get created and
1964         destroyed in the same transaction (e.g. two layouts before a single layer
1965         tree commit). When that happened we would encode layer creation properties
1966         but not encode layer properties, since the layer would be unreachable.
1967         
1968         Fix by removing deleted layers from the created layers list, which is
1969         converted into a map for easy searching.
1970
1971         * WebProcess/WebPage/mac/RemoteLayerTreeContext.h:
1972         * WebProcess/WebPage/mac/RemoteLayerTreeContext.mm:
1973         (WebKit::RemoteLayerTreeContext::layerWasCreated):
1974         (WebKit::RemoteLayerTreeContext::layerWillBeDestroyed):
1975         (WebKit::RemoteLayerTreeContext::buildTransaction):
1976
1977 2015-02-04  Michael Catanzaro  <mcatanzaro@igalia.com>
1978
1979         Build with seccomp filters broken since r179409
1980         https://bugs.webkit.org/show_bug.cgi?id=141206
1981
1982         Reviewed by Darin Adler.
1983
1984         Fix build by renaming SeccompBrokerClient::shared to SeccompBrokerClient::singleton.
1985
1986         * Shared/linux/SeccompFilters/SeccompBroker.cpp:
1987         (WebKit::SeccompBrokerClient::singleton):
1988         (WebKit::SeccompBroker::initialize):
1989         (WebKit::SeccompBrokerClient::shared):
1990         (WebKit::SeccompBroker::runLoop):
1991
1992 2015-02-04  Simon Fraser  <simon.fraser@apple.com>
1993
1994         [iOS WK2] Assert in ScrollingTreeOverflowScrollingNodeIOS::updateAfterChildren() on tab switching
1995         https://bugs.webkit.org/show_bug.cgi?id=141223
1996         rdar://problem/18458993
1997
1998         Reviewed by Tim Horton.
1999
2000         It's possible to submit a RemoteLayerTree transaction that contains data
2001         about a created layer, but doesn't have any properties for that layer. This
2002         happens when the newly created layer isn't reached during the traversal that
2003         gathers layer properties (i.e. it's not rooted). However, whether we create
2004         a scrolling layer or not requires having properties; they are missing, so we
2005         create a normal layer, but then the scrolling tree commit asserts that we
2006         should have a scrolling layer.
2007         
2008         Fix by making scrolling layers have a corresponding layer type, which is
2009         stored in layer creation properties. This required exposing layer types
2010         up through GraphicsLayer, but that allows for some nice cleanup:
2011         
2012         1. No need to have the hokey shouldUseTiledBacking() GraphicsLayerClient hack
2013            for creating the page tiled layer.
2014         2. The notion of "custom behaviors" can be removed from GraphicsLayer entirely.
2015
2016         * Shared/mac/RemoteLayerBackingStore.mm:
2017         (WebKit::RemoteLayerBackingStore::drawInContext):
2018         * Shared/mac/RemoteLayerTreeTransaction.h:
2019         * Shared/mac/RemoteLayerTreeTransaction.mm:
2020         (WebKit::RemoteLayerTreeTransaction::LayerProperties::LayerProperties):
2021         (WebKit::RemoteLayerTreeTransaction::LayerProperties::encode):
2022         (WebKit::RemoteLayerTreeTransaction::LayerProperties::decode):
2023         (WebKit::dumpChangedLayers):
2024         (WebKit::RemoteLayerTreeTransaction::description):
2025         * UIProcess/ios/RemoteLayerTreeHostIOS.mm:
2026         (WebKit::RemoteLayerTreeHost::createLayer):
2027         * UIProcess/mac/RemoteLayerTreeHost.mm:
2028         (WebKit::RemoteLayerTreeHost::createLayer):
2029         * WebProcess/WebPage/mac/GraphicsLayerCARemote.h:
2030         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
2031         (WebKit::PlatformCALayerRemote::customBehavior): Deleted.
2032         (WebKit::PlatformCALayerRemote::updateCustomBehavior): Deleted.
2033         * WebProcess/WebPage/mac/PlatformCALayerRemote.h:
2034         * WebProcess/WebPage/mac/RemoteLayerTreeContext.h:
2035         * WebProcess/WebPage/mac/RemoteLayerTreeContext.mm:
2036         (WebKit::RemoteLayerTreeContext::createGraphicsLayer):
2037
2038 2015-02-04  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
2039
2040         [EFL][WK2] Manage failing API tests
2041         https://bugs.webkit.org/show_bug.cgi?id=141250
2042
2043         Reviewed by Csaba Osztrogonác.
2044
2045         * PlatformEfl.cmake: Skip to test test_ewk2_storage_manager.
2046         * UIProcess/API/efl/tests/test_ewk2_view.cpp: Disable 2 unit test functions.
2047         (TEST_F):
2048
2049 2015-02-04  Chris Dumez  <cdumez@apple.com>
2050
2051         Add removeFirst(value) / removeAll(value) methods to WTF::Vector
2052         https://bugs.webkit.org/show_bug.cgi?id=141192
2053
2054         Reviewed by Benjamin Poulain.
2055
2056         Use new Vector::removeFirst(value) / removeAll(value) API to simplify the
2057         code a bit.
2058
2059         * UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManager.cpp:
2060         (WebKit::WebSoupCustomProtocolRequestManager::unregisterSchemeForCustomProtocol):
2061         * UIProcess/PageLoadState.cpp:
2062         (WebKit::PageLoadState::removeObserver):
2063         * UIProcess/WebProcessPool.cpp:
2064         (WebKit::WebProcessPool::~WebProcessPool):
2065         (WebKit::WebProcessPool::disconnectProcess):
2066         * WebProcess/InjectedBundle/API/efl/ewk_extension.cpp:
2067         (EwkExtension::remove):
2068
2069 2015-02-03  Chris Dumez  <cdumez@apple.com>
2070
2071         Unreviewed attempt to fix GTK/EFL build after r179588.
2072
2073         Add new files to CMakeLists.txt.
2074
2075         * CMakeLists.txt:
2076
2077 2015-02-03  Shivakumar JM  <shiva.jm@samsung.com>
2078
2079         Fix build warning in WebKit2/Platform/IPC module.
2080         https://bugs.webkit.org/show_bug.cgi?id=141229
2081
2082         Reviewed by Chris Dumez.
2083
2084         Fix build warning by using UNUSED_PARAM macro.
2085
2086         * Platform/IPC/Connection.cpp:
2087         (IPC::Connection::sendMessage):
2088
2089 2015-02-03  Tim Horton  <timothy_horton@apple.com>
2090
2091         Add WKPageNavigationClient as C SPI around API::NavigationClient, and adopt in WKTR
2092         https://bugs.webkit.org/show_bug.cgi?id=141217
2093
2094         * UIProcess/API/C/WKPageRenderingProgressEventsInternal.h:
2095         Include, not import.
2096
2097 2015-02-03  Tim Horton  <timothy_horton@apple.com>
2098
2099         Add WKPageNavigationClient as C SPI around API::NavigationClient, and adopt in WKTR
2100         https://bugs.webkit.org/show_bug.cgi?id=141217
2101
2102         Reviewed by Sam Weinig.
2103
2104         * Shared/API/c/WKBase.h:
2105         * UIProcess/API/C/WKAPICast.h:
2106         * UIProcess/API/C/WKFrameInfoRef.cpp: Added.
2107         (WKFrameInfoGetTypeID):
2108         * UIProcess/API/C/WKFrameInfoRef.h: Added.
2109         * UIProcess/API/C/WKNavigationActionRef.cpp: Added.
2110         (WKNavigationActionGetTypeID):
2111         * UIProcess/API/C/WKNavigationActionRef.h: Added.
2112         * UIProcess/API/C/WKNavigationRef.cpp: Added.
2113         (WKNavigationGetTypeID):
2114         * UIProcess/API/C/WKNavigationRef.h: Added.
2115         * UIProcess/API/C/WKNavigationResponseRef.cpp: Added.
2116         (WKNavigationResponseGetTypeID):
2117         (WKNavigationResponseCanShowMIMEType):
2118         * UIProcess/API/C/WKNavigationResponseRef.h: Added.
2119         Add tiny C wrappers around API::{FrameInfo, NavigationAction, Navigation, NavigationResponse}.
2120
2121         * UIProcess/API/APINavigationClient.h:
2122         (API::NavigationClient::decidePolicyForPluginLoad):
2123         Add a default implementation of decidePolicyForPluginLoad.
2124
2125         * UIProcess/API/C/WKPage.cpp:
2126         (WKPageSetPageNavigationClient):
2127         * UIProcess/API/C/WKPage.h:
2128         Add WKPageSetPageNavigationClient, which connects API::NavigationClient to
2129         the new WKPageNavigationClient C SPI.
2130         
2131         * UIProcess/API/C/WKPageNavigationClient.h: Added.
2132         Add WKPageNavigationClient, which one can use in place of WKPageLoaderClient
2133         and WKPagePolicyClient and which has the same semantics as the Modern ObjC API
2134         (including things like API::Navigation as WKNavigationRef, etc.)
2135
2136         * UIProcess/API/C/WKPageLoaderClient.h:
2137         * UIProcess/API/C/WKPageRenderingProgressEvents.h: Added.
2138         * UIProcess/API/C/WKPageRenderingProgressEventsInternal.h: Added.
2139         (pageRenderingProgressEvents):
2140         * UIProcess/API/C/WKPluginLoadPolicy.h: Added.
2141         Pull some enums out into their own files (WKPageRenderingProgressEvents is
2142         duplicated from the Modern ObjC API's _WKRenderingProgressEvents, WKPluginLoadPolicy
2143         is pulled out of WKPageLoaderClient).
2144
2145         * UIProcess/WebPageProxy.cpp:
2146         (WebKit::WebPageProxy::findPlugin):
2147         Add an equivalent of pluginLoadPolicy to the NavigationClient.
2148
2149         * WebKit2.xcodeproj/project.pbxproj:
2150
2151 2015-02-03  Timothy Horton  <timothy_horton@apple.com>
2152
2153         Every PageOverlayClientImpl leaks
2154         https://bugs.webkit.org/show_bug.cgi?id=141224
2155         <rdar://problem/19652939>
2156
2157         Reviewed by Simon Fraser.
2158
2159         * WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:
2160         (WKBundlePageOverlayCreate):
2161         * WebProcess/WebPage/WebPageOverlay.cpp:
2162         (WebKit::WebPageOverlay::create):
2163         (WebKit::WebPageOverlay::WebPageOverlay):
2164         (WebKit::WebPageOverlay::pageOverlayDestroyed):
2165         (WebKit::WebPageOverlay::willMoveToPage):
2166         (WebKit::WebPageOverlay::didMoveToPage):
2167         (WebKit::WebPageOverlay::drawRect):
2168         (WebKit::WebPageOverlay::mouseEvent):
2169         (WebKit::WebPageOverlay::didScrollFrame):
2170         (WebKit::WebPageOverlay::actionContextForResultAtPoint):
2171         (WebKit::WebPageOverlay::dataDetectorsDidPresentUI):
2172         (WebKit::WebPageOverlay::dataDetectorsDidChangeUI):
2173         (WebKit::WebPageOverlay::dataDetectorsDidHideUI):
2174         (WebKit::WebPageOverlay::copyAccessibilityAttributeStringValueForPoint):
2175         (WebKit::WebPageOverlay::copyAccessibilityAttributeBoolValueForPoint):
2176         (WebKit::WebPageOverlay::copyAccessibilityAttributeNames):
2177         * WebProcess/WebPage/WebPageOverlay.h:
2178         (WebKit::WebPageOverlay::client):
2179         Keep the PageOverlayClientImpl as a unique_ptr instead of a leaked reference,
2180         ensuring that it's cleaned up when the WebPageOverlay is torn down.
2181
2182 2015-02-03  Chris Dumez  <cdumez@apple.com>
2183
2184         Drop ResourceLoadPriorityUnresolved resource load priority and use Optional<> instead
2185         https://bugs.webkit.org/show_bug.cgi?id=141186
2186
2187         Reviewed by Antti Koivisto.
2188
2189         Update code now that ResourceLoadPriorityUnresolved is not longer a
2190         ResourceLoadPriority enum value.
2191
2192         * NetworkProcess/cache/NetworkCache.cpp:
2193         (WebKit::NetworkCache::retrieve):
2194         * WebProcess/Network/WebResourceLoadScheduler.cpp:
2195         (WebKit::WebResourceLoadScheduler::scheduleLoad):
2196
2197 2015-02-03  Enrica Casucci  <enrica@apple.com>
2198
2199         [iOS] Add support for deleteFromInputWithFlags.
2200         https://bugs.webkit.org/show_bug.cgi?id=141216
2201         rdar://problem/19130081
2202
2203         Reviewed by Benjamin Poulain.
2204
2205         Adopts the new method as soon as it is available.
2206         The patch also removes some obsolete code used for staging.
2207
2208         * Platform/spi/ios/UIKitSPI.h:
2209         * UIProcess/ios/WKContentViewInteraction.mm:
2210         (-[WKContentView _interpretKeyEvent:isCharEvent:]):
2211
2212 2015-02-03  Joseph Pecoraro  <pecoraro@apple.com>
2213
2214         [iOS] Selection Callout should not immediately disappear on pages with frequent layouts
2215         https://bugs.webkit.org/show_bug.cgi?id=141210
2216
2217         Reviewed by Enrica Casucci.
2218
2219         In iOS WebKit2 in order to keep caret refreshes in sync with WebCore layouts
2220         the selection assistant is told to update whenever WebKit's layer tree
2221         commits. Unfortunately, for pages with JavaScript animation that are
2222         frequently doing a layout / layer tree update, this would trigger very
2223         frequent selection updates that would keep the caret from blinking and
2224         dismiss any selection callouts.
2225
2226         This change tracks the last selection drawing information so that we can
2227         avoid informing the assistant of a selection updates unless it has changed
2228         visually or needs to redraw (zoom).
2229
2230         * Shared/EditorState.cpp:
2231         Remove include already in header.
2232
2233         * UIProcess/ios/WKContentViewInteraction.h:
2234         * UIProcess/ios/WKContentViewInteraction.mm:
2235         (WebKit::WKSelectionDrawingInfo::WKSelectionDrawingInfo):
2236         (WebKit::operator==):
2237         (WebKit::operator!=):
2238         (-[WKContentView observeValueForKeyPath:ofObject:change:context:]):
2239         When zooming, force the selection update, even though the drawing
2240         information hasn't changed, the views will need to be updated.
2241
2242         (-[WKContentView _updateChangedSelection]):
2243         (-[WKContentView _updateChangedSelection:]):
2244         Monitor EditorState for changes in selection drawing and avoid
2245         informing the selection assistant unless necessary.
2246
2247 2015-02-03  Jeremy Jones  <jeremyj@apple.com>
2248
2249         Prevent flicker when exiting fullscreen by synchronizing transactions.
2250         https://bugs.webkit.org/show_bug.cgi?id=140897
2251
2252         Reviewed by Tim Horton.
2253
2254         Flush transactions before removing layerHost. This allows existing transactions to be completed before the hosting layer disappears.
2255
2256         * UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
2257         (WebKit::WebVideoFullscreenManagerProxy::didCleanupFullscreen):
2258
2259 2015-02-03  Brian J. Burg  <burg@cs.washington.edu>
2260
2261         Convert WebInspectorProxy to use WKWebView API for the inspector view
2262         https://bugs.webkit.org/show_bug.cgi?id=141037
2263
2264         Reviewed by Timothy Hatcher.
2265
2266         Use the newer API for PLATFORM(MAC). The main difference is that the
2267         WKWebView's page group cannot be set directly; instead, the group identifier
2268         is passed. Also add some preference setters needed for the inspector.
2269
2270         Refactor some code to not use page groups directly. In a future patch,
2271         the PageGroup-based inspector level system will be simplified. It is
2272         it is no longer necessary to keep a static map of PageGroup instances,
2273         since they are only used to save inspector window preferences. (These used
2274         to prevent all levels of inspector from pausing together when a second-level
2275         inspector hit a breakpoint. This is not necessary with multi-process
2276         web inspectors.)
2277
2278         Also, adjust window resizing behavior when the inspector is docked to
2279         the right. Window width resizes should not affect the width of the inspector
2280         frame. This matches the behavior of height changes when docked to the bottom.
2281
2282         To support 32-bit Mac builds where WKWebView is not defined, share the stub
2283         platformFoo() implementations with PLATFORM(IOS). The stubs are now located
2284         in the platform-independent WebInspectorProxy.cpp.
2285
2286         * UIProcess/API/Cocoa/WKPreferences.mm:
2287         (-[WKPreferences _logsPageMessagesToSystemConsoleEnabled]): Added.
2288         (-[WKPreferences _setLogsPageMessagesToSystemConsoleEnabled:]): Added.
2289         (-[WKPreferences _allowFileAccessFromFileURLs]): Added.
2290         (-[WKPreferences _setAllowFileAccessFromFileURLs:]): Added.
2291         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
2292         * UIProcess/WebInspectorProxy.cpp:
2293         (WebKit::WebInspectorProxy::WebInspectorProxy):
2294         (WebKit::WebInspectorProxy::inspectorPagePreferences):
2295         (WebKit::WebInspectorProxy::attach):
2296         (WebKit::WebInspectorProxy::detach):
2297         (WebKit::WebInspectorProxy::setAttachedWindowHeight):
2298         (WebKit::WebInspectorProxy::setAttachedWindowWidth):
2299         (WebKit::WebInspectorProxy::createInspectorPage):
2300         (WebKit::WebInspectorProxy::shouldOpenAttached):
2301         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
2302         (WebKit::WebInspectorProxy::platformOpen):
2303         (WebKit::WebInspectorProxy::platformDidClose):
2304         (WebKit::WebInspectorProxy::platformInvalidate):
2305         (WebKit::WebInspectorProxy::platformBringToFront):
2306         (WebKit::WebInspectorProxy::platformHide):
2307         (WebKit::WebInspectorProxy::platformIsFront):
2308         (WebKit::WebInspectorProxy::platformInspectedURLChanged):
2309         (WebKit::WebInspectorProxy::platformSave):
2310         (WebKit::WebInspectorProxy::platformAppend):
2311         (WebKit::WebInspectorProxy::platformInspectedWindowHeight):
2312         (WebKit::WebInspectorProxy::platformInspectedWindowWidth):
2313         (WebKit::WebInspectorProxy::platformAttach):
2314         (WebKit::WebInspectorProxy::platformDetach):
2315         (WebKit::WebInspectorProxy::platformSetAttachedWindowHeight):
2316         (WebKit::WebInspectorProxy::platformSetToolbarHeight):
2317         (WebKit::WebInspectorProxy::inspectorPageURL):
2318         (WebKit::WebInspectorProxy::inspectorTestPageURL):
2319         (WebKit::WebInspectorProxy::inspectorBaseURL):
2320         (WebKit::WebInspectorProxy::platformSetAttachedWindowWidth):
2321         (WebKit::WebInspectorProxy::platformAttachAvailabilityChanged):
2322         * UIProcess/WebInspectorProxy.h:
2323         * UIProcess/ios/WebInspectorProxyIOS.mm: Removed.
2324         * UIProcess/mac/WebInspectorProxyMac.mm:
2325         (-[WKWebInspectorWKWebView _didRelaunchProcess]):
2326         WKWebView doesn't implement this, so remove the super call.
2327         (WebKit::WebInspectorProxy::closeTimerFired):
2328         (WebKit::createDockButton):
2329         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
2330         (WebKit::WebInspectorProxy::platformAttach):
2331         (-[WKWebInspectorWKView _didRelaunchProcess]): Deleted.
2332         * WebKit2.xcodeproj/project.pbxproj:
2333
2334 2015-02-03  Antti Koivisto  <antti@apple.com>
2335
2336         Memory cache for resources pending disk write
2337         https://bugs.webkit.org/show_bug.cgi?id=141159
2338
2339         Reviewed by Andreas Kling.
2340
2341         If a resource was requested from the disk cache before it has been written we ended up
2342         loading it again. Add a short lived memory cache to avoid this.
2343
2344         * NetworkProcess/cache/NetworkCache.cpp:
2345         (WebKit::decodeStorageEntry):
2346         * NetworkProcess/cache/NetworkCacheStorage.h:
2347         (WebKit::NetworkCacheStorage::Data::isMap):
2348
2349             Add a way to know whether a Data is backed by map or not. SharedMemory does not work correctly
2350             if it is not a map.
2351
2352         * NetworkProcess/cache/NetworkCacheStorageCocoa.mm:
2353         (WebKit::NetworkCacheStorage::Data::Data):
2354         (WebKit::NetworkCacheStorage::initialize):
2355
2356             Also do some renaming.
2357
2358         (WebKit::decodeEntry):
2359         (WebKit::NetworkCacheStorage::removeEntry):
2360         (WebKit::NetworkCacheStorage::retrieve):
2361         (WebKit::NetworkCacheStorage::store):
2362         (WebKit::NetworkCacheStorage::clear):
2363         (WebKit::NetworkCacheStorage::shrinkIfNeeded):
2364
2365 2015-02-02  Antti Koivisto  <antti@apple.com>
2366
2367         Update cache header after revalidation without rewriting the body data
2368         https://bugs.webkit.org/show_bug.cgi?id=141182
2369
2370         Reviewed by Andreas Kling.
2371
2372         Currently we just rewrite the entire entry after revalidation.
2373
2374         * NetworkProcess/cache/NetworkCache.cpp:
2375         (WebKit::decodeStorageEntry):
2376
2377             Include the strorage entry to the cache response so we can more easily update it.
2378
2379         (WebKit::NetworkCache::update):
2380
2381             Call the storage update function with the new and the exisiting storage entry.
2382
2383         * NetworkProcess/cache/NetworkCache.h:
2384         * NetworkProcess/cache/NetworkCacheStorage.h:
2385         * NetworkProcess/cache/NetworkCacheStorageCocoa.mm:
2386         (WebKit::openFileForKey):
2387
2388             Added an option for opening a file for writing without creating a new one.
2389             Renamed for clarity.
2390
2391         (WebKit::encodeEntryHeader):
2392
2393             Separate header encoding to a function.
2394
2395         (WebKit::encodeEntry):
2396         (WebKit::NetworkCacheStorage::dispatchRetrieveOperation):
2397         (WebKit::NetworkCacheStorage::store):
2398         (WebKit::NetworkCacheStorage::update):
2399
2400             New update function.
2401             If the page-rounded header size would stay unchanged we can just write the new header over the old one.
2402             In the unlikely event it doesn't we rewrite the whole thing.
2403
2404         (WebKit::createIOChannelForKey): Deleted.
2405
2406 2015-02-02  Commit Queue  <commit-queue@webkit.org>
2407
2408         Unreviewed, rolling out r179540.
2409         https://bugs.webkit.org/show_bug.cgi?id=141190
2410
2411         need further investigation to fix !WK_API_ENABLED (32bit)
2412         build. (Requested by brrian_ on #webkit).
2413
2414         Reverted changeset:
2415
2416         "Convert WebInspectorProxy to use WKWebView API for the
2417         inspector view"
2418         https://bugs.webkit.org/show_bug.cgi?id=141037
2419         http://trac.webkit.org/changeset/179540
2420
2421 2015-02-02  Brian J. Burg  <burg@cs.washington.edu>
2422
2423         Convert WebInspectorProxy to use WKWebView API for the inspector view
2424         https://bugs.webkit.org/show_bug.cgi?id=141037
2425
2426         Reviewed by Timothy Hatcher.
2427
2428         Use the newer API for PLATFORM(MAC). The main difference is that the
2429         WKWebView's page group cannot be set directly; instead, the group identifier
2430         is passed. Also add some preference setters needed for the inspector.
2431
2432         Refactor some code to not use page groups directly. In a future patch,
2433         the PageGroup-based inspector level system will be simplified. It is
2434         it is no longer necessary to keep a static map of PageGroup instances,
2435         since they are only used to save inspector window preferences. (These used
2436         to prevent all levels of inspector from pausing together when a second-level
2437         inspector hit a breakpoint. This is not necessary with multi-process
2438         web inspectors.)
2439
2440         Also, adjust window resizing behavior when the inspector is docked to
2441         the right. Window width resizes should not affect the width of the inspector
2442         frame. This matches the behavior of height changes when docked to the bottom.
2443
2444         * UIProcess/API/Cocoa/WKPreferences.mm:
2445         (-[WKPreferences _logsPageMessagesToSystemConsoleEnabled]): Added.
2446         (-[WKPreferences _setLogsPageMessagesToSystemConsoleEnabled:]): Added.
2447         (-[WKPreferences _allowFileAccessFromFileURLs]): Added.
2448         (-[WKPreferences _setAllowFileAccessFromFileURLs:]): Added.
2449         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
2450         * UIProcess/WebInspectorProxy.cpp:
2451         (WebKit::WebInspectorProxy::WebInspectorProxy):
2452         (WebKit::WebInspectorProxy::inspectorPagePreferences): Added.
2453         (WebKit::WebInspectorProxy::attach):
2454         (WebKit::WebInspectorProxy::detach):
2455         (WebKit::WebInspectorProxy::setAttachedWindowHeight):
2456         (WebKit::WebInspectorProxy::setAttachedWindowWidth):
2457         (WebKit::WebInspectorProxy::createInspectorPage):
2458         (WebKit::WebInspectorProxy::shouldOpenAttached):
2459         * UIProcess/WebInspectorProxy.h: Use default member initializers.
2460         * UIProcess/mac/WebInspectorProxyMac.mm:
2461         (-[WKWebInspectorWKWebView _didRelaunchProcess]):
2462         WKWebView doesn't implement this, so remove the super call.
2463         (WebKit::WebInspectorProxy::closeTimerFired):
2464         (WebKit::createDockButton):
2465         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
2466         (WebKit::WebInspectorProxy::platformAttach):
2467         (-[WKWebInspectorWKView _didRelaunchProcess]): Deleted.
2468
2469 2015-02-02  Chris Dumez  <cdumez@apple.com>
2470
2471         Make NetworkCache's constructor private
2472         https://bugs.webkit.org/show_bug.cgi?id=141181
2473
2474         Reviewed by Antti Koivisto.
2475
2476         Make NetworkCache's constructor private and mark its destructor as
2477         deleted as it is a singleton class.
2478
2479         * NetworkProcess/cache/NetworkCache.cpp:
2480         (WebKit::NetworkCache::NetworkCache): Deleted.
2481         * NetworkProcess/cache/NetworkCache.h:
2482
2483 2015-02-02  Filip Pizlo  <fpizlo@apple.com>
2484
2485         Revert accidental (and super bad) change in r179490.
2486
2487         * WebProcess/com.apple.WebProcess.sb.in:
2488
2489 2015-02-02  Chris Dumez  <cdumez@apple.com>
2490
2491         Access MemoryCache singleton using MemoryCache::singleton()
2492         https://bugs.webkit.org/show_bug.cgi?id=141104
2493
2494         Reviewed by Andreas Kling.
2495
2496         Access MemoryCache singleton using MemoryCache::singleton() static
2497         member function, instead of a free function, as per the recent
2498         coding style discussion on WebKit-dev.
2499
2500 2015-02-02  Jeremy Jones  <jeremyj@apple.com>
2501
2502         Prevent crash when accessing WebAVPlayerController.delegate.
2503         https://bugs.webkit.org/show_bug.cgi?id=140893
2504
2505         Reviewed by Darin Adler.
2506
2507         Plumb new resetMediaState() through IPC interface WebVideoFullscreenManagerProxy.
2508
2509         * UIProcess/ios/WebVideoFullscreenManagerProxy.messages.in:
2510         * UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
2511         (WebKit::WebVideoFullscreenManagerProxy::invalidate): remove redundant set to nullptr.
2512         * WebProcess/ios/WebVideoFullscreenManager.h:
2513         * WebProcess/ios/WebVideoFullscreenManager.mm:
2514         (WebKit::WebVideoFullscreenManager::resetMediaState):
2515
2516 2015-02-01  Chris Dumez  <cdumez@apple.com>
2517
2518         Use more references in HistoryItem
2519         https://bugs.webkit.org/show_bug.cgi?id=141133
2520
2521         Reviewed by Andreas Kling.
2522
2523         Use more references in HistoryItem instead of pointers.
2524
2525         * WebProcess/InjectedBundle/InjectedBundleBackForwardListItem.cpp:
2526         (WebKit::InjectedBundleBackForwardListItem::children):
2527         * WebProcess/WebCoreSupport/SessionStateConversion.cpp:
2528         (WebKit::toFrameState):
2529         (WebKit::applyFrameState):
2530         * WebProcess/WebPage/WebBackForwardListProxy.cpp:
2531         (WebKit::WebBackForwardListProxy::addItem):
2532         * WebProcess/WebPage/WebBackForwardListProxy.h:
2533
2534 2015-02-01  Dan Bernstein  <mitz@apple.com>
2535
2536         Remove ViewGestureController tracing
2537         https://bugs.webkit.org/show_bug.cgi?id=141137
2538
2539         Reviewed by Tim Horton.
2540
2541         Remove the tracing added in r176133, now that http://webkit.org/b/138750 is fixed.
2542
2543         * UIProcess/ios/ViewGestureControllerIOS.mm:
2544         (WebKit::ViewGestureController::beginSwipeGesture):
2545         (WebKit::ViewGestureController::endSwipeGesture):
2546         (WebKit::ViewGestureController::willCommitPostSwipeTransitionLayerTree):
2547         (WebKit::ViewGestureController::removeSwipeSnapshot):
2548         (WebKit::addLogEntry): Deleted.
2549         (WebKit::dumpLogEntries): Deleted.
2550         * UIProcess/mac/ViewGestureController.h:
2551
2552 2015-01-31  Sam Weinig  <sam@webkit.org>
2553
2554         Remove even more Mountain Lion support
2555         https://bugs.webkit.org/show_bug.cgi?id=141124
2556
2557         Reviewed by Alexey Proskuryakov.
2558
2559         * Configurations/Base.xcconfig:
2560         * Configurations/DebugRelease.xcconfig:
2561         * Configurations/FeatureDefines.xcconfig:
2562         * Configurations/Version.xcconfig:
2563         * Configurations/WebContentService.Development.xcconfig:
2564         * Configurations/WebContentService.xcconfig:
2565         * Configurations/WebKit.xcconfig:
2566         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
2567
2568 2015-01-31  Antti Koivisto  <antti@apple.com>
2569
2570         Enable WebKit disk cache on OS X
2571         https://bugs.webkit.org/show_bug.cgi?id=141022
2572
2573         Reviewed by Gavin Barraclough.
2574
2575         * config.h: Flip the switch.
2576
2577 2015-01-31  Antti Koivisto  <antti@apple.com>
2578
2579         Unreviewed, rolling out r179447.
2580
2581         Forgot to include the test.
2582
2583         Reverted changeset:
2584
2585         "Enable WebKit disk cache on OS X"
2586         https://bugs.webkit.org/show_bug.cgi?id=141022
2587         http://trac.webkit.org/changeset/179447
2588
2589 2015-01-31  Antti Koivisto  <antti@apple.com>
2590
2591         Enable WebKit disk cache on OS X
2592         https://bugs.webkit.org/show_bug.cgi?id=141022
2593
2594         Reviewed by Gavin Barraclough.
2595
2596         * config.h: Flip the switch.
2597
2598 2015-01-31  Antti Koivisto  <antti@apple.com>
2599
2600         OSObjectPtr does not work with dispatch_data_t on Maverics
2601         https://bugs.webkit.org/show_bug.cgi?id=141081
2602
2603         Reviewed by Zalan Bujtas.
2604
2605         Previous attempt to special case dispatch_data_t in OSObjectPtr didn't work in all cases
2606         probably due to the context sensitivity of the definition of the dispatch_data_t type.
2607
2608         For now, add DispatchPtr for the cache code and use it.
2609
2610         * NetworkProcess/cache/NetworkCacheStorage.h:
2611         (WebKit::DispatchPtr::DispatchPtr):
2612         (WebKit::DispatchPtr::~DispatchPtr):
2613         (WebKit::DispatchPtr::operator=):
2614         (WebKit::DispatchPtr::get):
2615         (WebKit::DispatchPtr::operator bool):
2616         (WebKit::adoptDispatch):
2617         * NetworkProcess/cache/NetworkCacheStorageCocoa.mm:
2618         (WebKit::NetworkCacheStorage::Data::Data):
2619         (WebKit::NetworkCacheStorage::Data::data):
2620         (WebKit::NetworkCacheStorage::NetworkCacheStorage):
2621         (WebKit::createIOChannelForKey):
2622         (WebKit::decodeEntry):
2623         (WebKit::encodeEntryMetaData):
2624         (WebKit::encodeEntry):
2625
2626 2015-01-30  Tim Horton  <timothy_horton@apple.com>
2627
2628         Add and hook up APINavigationClient
2629         https://bugs.webkit.org/show_bug.cgi?id=140698
2630
2631         Reviewed by Sam Weinig.
2632
2633         Add a single APINavigationClient that NavigationState implements and
2634         WebPageProxy prefers over APILoaderClient and APIPolicyClient.
2635
2636         * UIProcess/API/APILoaderClient.h:
2637         Fix a comment.
2638
2639         * UIProcess/API/APINavigationClient.h: Added.
2640         APINavigationClient is the union of NavigationState's overrides of APILoaderClient and APIPolicyClient.
2641         Names are adjusted to more closely match the Modern API.
2642
2643         * UIProcess/Cocoa/NavigationState.h:
2644         * UIProcess/Cocoa/NavigationState.mm:
2645         Instead of having policy and loader clients, NavigationState has a single navigation client.
2646         Adjust as necessary.
2647
2648         Move as much logic as possible (isMainFrame checks, construction of API objects) out of here
2649         and into WebPageProxy.
2650
2651         * UIProcess/API/Cocoa/WKWebView.mm:
2652         (-[WKWebView initWithFrame:configuration:]):
2653         Install the aforementioned single navigation client.
2654
2655         * UIProcess/WebPageProxy.cpp:
2656         (WebKit::WebPageProxy::setNavigationClient):
2657         Add a navigation client setter.
2658
2659         For all policy and loader client calls, if we have a navigation client, use that;
2660         otherwise, fall back on the policy and loader clients.
2661
2662         * UIProcess/WebPageProxy.h:
2663         * WebKit2.xcodeproj/project.pbxproj:
2664
2665 2015-01-30  Chris Dumez  <cdumez@apple.com>
2666
2667         Update MemoryCache code to use more references instead of pointers
2668         https://bugs.webkit.org/show_bug.cgi?id=141099
2669
2670         Reviewed by Andreas Kling.
2671
2672         * WebProcess/ResourceCache/WebResourceCacheManager.cpp:
2673         (WebKit::WebResourceCacheManager::clearCacheForOrigin):
2674
2675 2015-01-30  Chris Dumez  <cdumez@apple.com>
2676
2677         Rename shared() static member functions to singleton() for singleton classes.
2678         https://bugs.webkit.org/show_bug.cgi?id=141088
2679
2680         Reviewed by Ryosuke Niwa and Benjamin Poulain.
2681
2682         Rename shared() static member functions to singleton() for singleton
2683         classes as per the recent coding style change.
2684
2685 2015-01-30  Alexey Proskuryakov  <ap@apple.com>
2686
2687         Build fix.
2688
2689         * Shared/API/c/WKDeprecatedFunctions.cpp:
2690         * UIProcess/API/C/WKPreferencesRefPrivate.h:
2691         The screen font substitution functions still need to be present in the header.
2692
2693 2015-01-29  Carlos Garcia Campos  <cgarcia@igalia.com>
2694
2695         [GTK] Resize the redirected XComposite again after leaving accelerated compositing mode
2696         https://bugs.webkit.org/show_bug.cgi?id=140935
2697
2698         Reviewed by Sergio Villar Senin.
2699
2700         Since r178414 we don't resize the redirected XComposite window
2701         until we enter accelerated compositing mode, but after leaving it
2702         the redirected window keeps its size. We should resize it to 1x1
2703         again and free the XPixmap and cairo surface to save that memory
2704         while not in accelerated compositing mode.
2705
2706         * UIProcess/API/gtk/PageClientImpl.cpp:
2707         (WebKit::PageClientImpl::enterAcceleratedCompositingMode): Notify
2708         the WebKitWebViewBase.
2709         (WebKit::PageClientImpl::exitAcceleratedCompositingMode): Ditto.
2710         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
2711         (webkitWebViewBaseEnterAcceleratedCompositingMode): Resize the
2712         XComposite window to the current drawing area size.
2713         (webkitWebViewBaseExitAcceleratedCompositingMode): Resize the
2714         XComposite window to and empty size.
2715         * UIProcess/API/gtk/WebKitWebViewBasePrivate.h:
2716         * UIProcess/gtk/RedirectedXCompositeWindow.cpp:
2717         (WebKit::RedirectedXCompositeWindow::RedirectedXCompositeWindow):
2718         Do not initialize m_size since we now handle the empty size as a
2719         especial case. Make sure we always create the X window with at
2720         least 1x1 size.
2721         (WebKit::RedirectedXCompositeWindow::resize): Resize the window to
2722         at least 1x1, but when en empty size is given, call
2723         cleanupPixmapAndPixmapSurface() to release those resources.
2724         (WebKit::RedirectedXCompositeWindow::surface): Create the cairo
2725         surface with at least 1x1 size.
2726
2727 2015-01-29  Carlos Garcia Campos  <cgarcia@igalia.com>
2728
2729         [GTK] Runtime critical warnings sometimes at start up when using the network process
2730         https://bugs.webkit.org/show_bug.cgi?id=140998
2731
2732         Reviewed by Žan Doberšek.
2733
2734         This is caused by the CustomProtocolManager work queue
2735         theread. This WorkQueue is created when the CustomProtocolManager
2736         object is constructed, but destroyed when it's initialized when
2737         the UI process asks to use the network process. In this case,
2738         sometimes happens that the work queue thread that runs the main
2739         loop is executed once the object has been destroyed and the main
2740         loop pointer is nullptr.
2741
2742         * Platform/WorkQueue.h:
2743         * Platform/gtk/WorkQueueGtk.cpp:
2744         (WorkQueue::platformInitialize): Use a lambda function for the
2745         thread body.
2746         (WorkQueue::platformInvalidate): Detach the worker thread before
2747         deleting the main loop object.
2748         (WorkQueue::startWorkQueueThread): Deleted.
2749         (WorkQueue::workQueueThreadBody): Deleted.
2750
2751 2015-01-29  Beth Dakin  <bdakin@apple.com>
2752
2753         Another follow-on, spotted this mistake. This used to be 
2754         #if PLATFORM(IOS) || __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090 , so it should now be 
2755         COCOA.
2756
2757         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2758         (WebKit::registerUserDefaultsIfNeeded):
2759
2760 2015-01-29  Beth Dakin  <bdakin@apple.com>
2761
2762         Follow-on, fixing a bad merge from my last change. 
2763
2764         * Shared/WebPreferencesDefinitions.h:
2765
2766 2015-01-29  Beth Dakin  <bdakin@apple.com>
2767
2768         Remove more Mountain Lion code from WebKit2
2769         https://bugs.webkit.org/show_bug.cgi?id=141052
2770
2771         Reviewed by Tim Horton.
2772
2773         * NetworkProcess/NetworkResourceLoader.cpp:
2774         (WebKit::NetworkResourceLoader::sendBufferMaybeAborting):
2775         * NetworkProcess/NetworkResourceLoader.h:
2776         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
2777         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
2778         * NetworkProcess/mac/NetworkDiskCacheMonitor.mm:
2779         * NetworkProcess/mac/NetworkResourceLoaderMac.mm:
2780         (WebKit::NetworkResourceLoader::willCacheResponseAsync):
2781         * Platform/IPC/MessageDecoder.cpp:
2782         * Platform/IPC/MessageDecoder.h:
2783         * Platform/IPC/mac/ConnectionMac.mm:
2784         (IPC::ConnectionTerminationWatchdog::watchdogTimerFired):
2785         (IPC::Connection::open):
2786         (IPC::Connection::receiveSourceEventHandler):
2787         (IPC::Connection::kill):
2788         * Platform/IPC/mac/ImportanceAssertion.h:
2789         * PluginProcess/mac/PluginProcessMac.mm:
2790         (WebKit::PluginProcess::initializeProcessName):
2791         * Shared/WebPreferencesDefinitions.h:
2792         * Shared/mac/ChildProcessMac.mm:
2793         (WebKit::initializeTimerCoalescingPolicy):
2794         (WebKit::ChildProcess::setApplicationIsDaemon):
2795         (WebKit::ChildProcess::platformInitialize):
2796         (WebKit::ChildProcess::setQOS):
2797         * Shared/mac/CookieStorageShim.mm:
2798         (WebKit::CookieStorageShim::initialize):
2799         * UIProcess/API/mac/WKView.mm:
2800         (-[WKView addWindowObserversForWindow:]):
2801         (-[WKView removeWindowObservers]):
2802         (-[WKView _windowDidChangeOcclusionState:]):
2803         * UIProcess/Cocoa/NavigationState.mm:
2804         (WebKit::NavigationState::LoaderClient::didReceiveAuthenticationChallengeInFrame):
2805         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2806         (WebKit::registerUserDefaultsIfNeeded):
2807         (WebKit::WebProcessPool::platformInitializeWebProcess):
2808         (WebKit::WebProcessPool::registerNotificationObservers):
2809         (WebKit::WebProcessPool::unregisterNotificationObservers):
2810         (WebKit::privateBrowsingSession):
2811         (WebKit::WebProcessPool::isURLKnownHSTSHost):
2812         (WebKit::WebProcessPool::resetHSTSHosts):
2813         * UIProcess/Databases/mac/DatabaseProcessProxyMac.mm:
2814         (WebKit::shouldUseXPC):
2815         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
2816         (WebKit::shouldUseXPC):
2817         * UIProcess/WebProcessPool.h:
2818         * UIProcess/mac/TextCheckerMac.mm:
2819         (WebKit::shouldAutomaticQuoteSubstitutionBeEnabled):
2820         (WebKit::shouldAutomaticDashSubstitutionBeEnabled):
2821         (WebKit::TextChecker::didChangeAutomaticQuoteSubstitutionEnabled):
2822         (WebKit::TextChecker::didChangeAutomaticDashSubstitutionEnabled):
2823         * UIProcess/mac/ViewGestureControllerMac.mm:
2824         (WebKit::ViewGestureController::applyDebuggingPropertiesToSwipeViews):
2825         * UIProcess/mac/WebProcessProxyMac.mm:
2826         (WebKit::shouldUseXPC):
2827         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
2828         (InitWebCoreSystemInterface):
2829         * WebProcess/cocoa/WebProcessCocoa.mm:
2830         (WebKit::WebProcess::updateActivePages):
2831         * WebProcess/com.apple.WebProcess.sb.in:
2832         * config.h:
2833
2834 2015-01-29  Sam Weinig  <sam@webkit.org>
2835
2836         Remove support for screen font substitution
2837         https://bugs.webkit.org/show_bug.cgi?id=141038
2838
2839         Reviewed by Tim Horton.
2840
2841         * Shared/API/c/WKDeprecatedFunctions.cpp:
2842         (WKPreferencesSetScreenFontSubstitutionEnabled):
2843         (WKPreferencesGetScreenFontSubstitutionEnabled):
2844         Move now empty preferences SPI to WKDeprecatedFunctions.
2845         
2846         * Shared/WebPreferencesDefinitions.h:
2847         * Shared/WebProcessCreationParameters.cpp:
2848         (WebKit::WebProcessCreationParameters::WebProcessCreationParameters):
2849         (WebKit::WebProcessCreationParameters::encode):
2850         (WebKit::WebProcessCreationParameters::decode):
2851         * Shared/WebProcessCreationParameters.h:
2852         * UIProcess/API/C/WKPreferences.cpp:
2853         (WKPreferencesSetScreenFontSubstitutionEnabled): Deleted.
2854         (WKPreferencesGetScreenFontSubstitutionEnabled): Deleted.
2855         * UIProcess/API/C/WKPreferencesRefPrivate.h:
2856         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2857         (WebKit::WebProcessPool::platformInitializeWebProcess):
2858         * WebProcess/WebPage/WebPage.cpp:
2859         (WebKit::WebPage::updatePreferences):
2860         * WebProcess/WebProcess.h:
2861         (WebKit::WebProcess::presenterApplicationPid):
2862         (WebKit::WebProcess::shouldForceScreenFontSubstitution): Deleted.
2863         * WebProcess/cocoa/WebProcessCocoa.mm:
2864         (WebKit::WebProcess::platformInitializeWebProcess):
2865         Stop piping screen font substitution setting to the web process.
2866
2867 2015-01-29  Alexey Proskuryakov  <ap@apple.com>
2868
2869         Frequent kernel panics when running WebKit regression tests
2870         https://bugs.webkit.org/show_bug.cgi?id=141043
2871
2872         Reviewed by Sam Weinig.
2873
2874         Split PluginService.Development into 32-bit and 64-bit variants, to better match
2875         production variant. When building FAT, we'll have the right architecture from
2876         the start now, so no need to re-exec into a different architecture.        
2877
2878         * Configurations/PluginService.Development.xcconfig: Removed.
2879         * Configurations/PluginService.32.Development.xcconfig: Copied from Source/WebKit2/Configurations/PluginService.Development.xcconfig.
2880         * Configurations/PluginService.64.Development.xcconfig: Copied from Source/WebKit2/Configurations/PluginService.Development.xcconfig.
2881         Changed to use ONLY_ACTIVE_ARCH instead of CONFIGURATION, so that we build the
2882         right thing even in debug FAT builds.
2883
2884         * Configurations/PluginService.32.xcconfig:
2885         * Configurations/PluginService.64.xcconfig:
2886         While at it, applied the same changes as in Development variants. This means that
2887         FAT builds will now build only the correct architecture for PluginService.64
2888         (it used to build FAT, unnecessarily).
2889
2890         * PluginProcess/EntryPoint/mac/XPCService/PluginService.Development/Info.plist:
2891         Updated to support multiple product names.
2892
2893         * UIProcess/Launcher/mac/ProcessLauncherMac.mm: (WebKit::serviceName): Launch the
2894         right development service.
2895
2896         * WebKit2.xcodeproj/project.pbxproj: Split the Plugin.Development target into two.
2897
2898 2015-01-29  Tim Horton  <timothy_horton@apple.com>
2899
2900         Fix the build with newer Clang
2901
2902         * NetworkProcess/NetworkConnectionToWebProcess.h:
2903         These should be 'override's.
2904
2905 2015-01-29  Chris Dumez  <cdumez@apple.com>
2906
2907         Clean up / modernize PageCache class
2908         https://bugs.webkit.org/show_bug.cgi?id=141009
2909
2910         Reviewed by Darin Adler.
2911
2912         Clean up / modernize PageCache class.
2913
2914         * WebProcess/WebPage/WebBackForwardListProxy.cpp:
2915         (WebKit::WebBackForwardListProxy::removeItem):
2916         (WebKit::WebBackForwardListProxy::close):
2917         * WebProcess/WebPage/WebPage.cpp:
2918         (WebKit::WebPage::goForward):
2919         (WebKit::WebPage::goBack):
2920         (WebKit::WebPage::goToBackForwardItem):
2921         * WebProcess/WebProcess.cpp:
2922         (WebKit::WebProcess::releasePageCache):
2923         * WebProcess/cocoa/WebProcessCocoa.mm:
2924         (WebKit::WebProcess::platformSetCacheModel):
2925         * WebProcess/soup/WebProcessSoup.cpp:
2926         (WebKit::WebProcess::platformSetCacheModel):
2927
2928 2015-01-29  Csaba Osztrogonác  <ossy@webkit.org>
2929
2930         [EFL][GTK] Fix the build after r179326
2931         https://bugs.webkit.org/show_bug.cgi?id=141027
2932
2933         Reviewed by Alexey Proskuryakov.
2934
2935         Guard MessageRecorder implementation with USE(DTRACE)
2936         for platforms not supporting DTrace.
2937
2938         Original patch by Carlos Garcia Campos <cgarcia@igalia.com>
2939
2940         * Platform/IPC/ArgumentCoders.cpp:
2941         * Platform/IPC/ArgumentCoders.h:
2942         * Platform/IPC/Connection.cpp:
2943         (IPC::Connection::dispatchWorkQueueMessageReceiverMessage):
2944         (IPC::Connection::sendMessage):
2945         (IPC::Connection::sendSyncMessage):
2946         (IPC::Connection::sendSyncMessageFromSecondaryThread):
2947         (IPC::Connection::dispatchSyncMessage):
2948         (IPC::Connection::dispatchMessage):
2949         * Platform/IPC/MessageDecoder.cpp:
2950         (IPC::MessageDecoder::MessageDecoder):
2951         * Platform/IPC/MessageDecoder.h:
2952         * Platform/IPC/MessageEncoder.cpp:
2953         (IPC::MessageEncoder::MessageEncoder):
2954         (IPC::MessageEncoder::encodeHeader):
2955         * Platform/IPC/MessageEncoder.h:
2956         * Platform/IPC/MessageRecorder.h:
2957
2958 2015-01-29  Tim Horton  <timothy_horton@apple.com>
2959
2960         Avoid manually handling quickLookWithEvent: if the immediate action gesture recognizer will do Lookup for us
2961         https://bugs.webkit.orgshow_bug.cgi?id=141018
2962         <rdar://problem/19619999>
2963
2964         * UIProcess/API/mac/WKView.mm:
2965         (-[WKView quickLookWithEvent:]):
2966         Yosemite is 101000, not 10100.
2967
2968 2015-01-28  Tim Horton  <timothy_horton@apple.com>
2969
2970         Add API::{FrameInfo, NavigationAction, NavigationResponse} types
2971         https://bugs.webkit.org/show_bug.cgi?id=140982
2972
2973         Reviewed by Sam Weinig.
2974
2975         Make C++ API objects for WK{FrameInfo, NavigationAction, NavigationResponse}
2976         to wrap around, as a step towards moving Modern API logic down into WebPageProxy.
2977
2978         * Shared/API/APIObject.h:
2979         * Shared/Cocoa/APIObject.mm:
2980         (API::Object::newObject):
2981         * UIProcess/API/APIFrameInfo.cpp: Added.
2982         * UIProcess/API/APIFrameInfo.h: Added.
2983         * UIProcess/API/APINavigationAction.h: Added.
2984         * UIProcess/API/APINavigationResponse.h: Added.
2985         Add API::FrameInfo, API::NavigationAction, and API::NavigationResponse.
2986
2987         * UIProcess/API/Cocoa/WKFrameInfo.mm:
2988         * UIProcess/API/Cocoa/WKFrameInfoInternal.h:
2989         Make WKFrameInfo a WKObject, wrapping a API::FrameInfo.
2990
2991         * UIProcess/API/Cocoa/WKNavigationAction.mm:
2992         * UIProcess/API/Cocoa/WKNavigationActionInternal.h:
2993         Make WKNavigationAction a WKObject, wrapping a API::NavigationAction.
2994
2995         * UIProcess/API/Cocoa/WKNavigationResponse.mm:
2996         * UIProcess/API/Cocoa/WKNavigationResponseInternal.h:
2997         Make WKNavigationResponse a WKObject, wrapping a API::NavigationResponse.
2998
2999         * UIProcess/API/Cocoa/WKUserContentController.mm:
3000         Adopt API::FrameInfo.
3001
3002         * UIProcess/Cocoa/NavigationState.mm:
3003         (WebKit::NavigationState::PolicyClient::decidePolicyForNavigationAction):
3004         Adopt API::FrameInfo, and reorganize the code slightly.
3005         Adopt API::NavigationAction.
3006
3007         (WebKit::NavigationState::PolicyClient::decidePolicyForResponse):
3008         Adopt API::FrameInfo.
3009         Adopt API::NavigationResponse.
3010
3011         (WebKit::NavigationState::LoaderClient::didFailProvisionalLoadWithErrorForFrame):
3012         Adopt API::FrameInfo.
3013
3014         * UIProcess/Cocoa/UIDelegate.mm:
3015         (WebKit::UIDelegate::UIClient::createNewPage):
3016         (WebKit::UIDelegate::UIClient::runJavaScriptAlert):
3017         (WebKit::UIDelegate::UIClient::runJavaScriptConfirm):
3018         (WebKit::UIDelegate::UIClient::runJavaScriptPrompt):
3019         Adopt API::FrameInfo.
3020
3021         * WebKit2.xcodeproj/project.pbxproj:
3022
3023 2015-01-28  Antti Koivisto  <antti@apple.com>
3024
3025         http/tests/xmlhttprequest/workers/methods.html sometimes times out with disk cache enabled
3026         https://bugs.webkit.org/show_bug.cgi?id=140976
3027
3028         Reviewed by Chris Dumez.
3029
3030         The previous fix sometimes invoked the completion handler twice. Explicitly track if we
3031         have called it or not.
3032
3033         * NetworkProcess/cache/NetworkCacheStorageCocoa.mm:
3034         (WebKit::NetworkCacheStorage::dispatchRetrieveOperation):
3035
3036         Also move the error case to the done branch. According to the documentation 'done' is always set on error.
3037
3038 2015-01-28  Timothy Horton  <timothy_horton@apple.com>
3039
3040         Add a WebKitMessageRecorder DTrace provider, exposing IPC details to DTrace
3041         https://bugs.webkit.org/show_bug.cgi?id=140673
3042
3043         Reviewed by Sam Weinig.
3044
3045         * Platform/IPC/ArgumentCoders.cpp:
3046         (IPC::ArgumentCoder<uuid_t>::encode):
3047         (IPC::ArgumentCoder<uuid_t>::decode):
3048         * Platform/IPC/ArgumentCoders.h:
3049         Add a uuid_t (simple) argument coder.
3050         Fix a mis-named header-guard #ifdef.
3051
3052         * Platform/IPC/Connection.cpp:
3053         (IPC::Connection::dispatchWorkQueueMessageReceiverMessage):
3054         (IPC::Connection::dispatchSyncMessage):
3055         Sync message replies inherit the message UUID from the incoming sync message.
3056
3057         (IPC::Connection::sendMessage):
3058         (IPC::Connection::waitForMessage):
3059         (IPC::Connection::sendSyncMessage):
3060         (IPC::Connection::sendSyncMessageFromSecondaryThread):
3061         Record outgoing messages. Because sendSyncMessage calls sendMessage,
3062         we have to explicitly avoid recording the message twice.
3063
3064         (IPC::Connection::dispatchMessage):
3065         Record the incoming message.
3066
3067         (IPC::Connection::remoteProcessID):
3068         Add remoteProcessID(), which tries to determine the pid of the remote process.
3069
3070         * Platform/IPC/Connection.h:
3071         (IPC::Connection::xpcConnection):
3072         This can be const.
3073
3074         (IPC::Connection::isValid):
3075         Make this public.
3076
3077         * Platform/IPC/MessageDecoder.cpp:
3078         (IPC::MessageDecoder::MessageDecoder):
3079         * Platform/IPC/MessageDecoder.h:
3080         (IPC::MessageDecoder::setMessageProcessingToken):
3081         (IPC::MessageDecoder::UUID):
3082         Decode and store the message UUID.
3083         Store a MessageProcessingToken for the lifetime of the MessageDecoder;
3084         this ensures that all time spent processing the incoming message will be
3085         counted against that message.
3086
3087         * Platform/IPC/MessageEncoder.cpp:
3088         (IPC::MessageEncoder::MessageEncoder):
3089         By default, create a new UUID for the message. Alternatively, allow clients
3090         to pass the message UUID in (used for sync message replies).
3091         Store the messageReceiverName and messageName.
3092
3093         (IPC::MessageEncoder::encodeHeader):
3094         Factor encodeHeader() out of the constructors so most of their code can be shared.
3095
3096         (IPC::MessageEncoder::isSyncMessage):
3097         (IPC::MessageEncoder::shouldDispatchMessageWhenWaitingForSyncReply):
3098         Add getters for these flags.
3099
3100         * Platform/IPC/MessageEncoder.h:
3101         (IPC::MessageEncoder::messageReceiverName):
3102         (IPC::MessageEncoder::messageName):
3103         (IPC::MessageEncoder::destinationID):
3104         (IPC::MessageEncoder::UUID):
3105
3106         * Platform/IPC/MessageRecorder.h: Added.
3107         * Platform/IPC/MessageRecorder.cpp: Added.
3108         (MessageRecorder::MessageRecorder):
3109         Add a class that interfaces with a custom DTrace provider to log incoming and outgoing messages.
3110
3111         (MessageRecorder::shared):
3112         (MessageRecorder::isEnabled):
3113         Determine if either of the message probes are enabled. If not, we'll avoid most of the
3114         work associated with MessageRecorder.
3115
3116         (MessageRecorder::recordOutgoingMessage):
3117         (MessageRecorder::recordIncomingMessage):
3118         Build a WebKitMessageRecord and MessageProcessingToken from the Message(De|En)coder.
3119         Once the MessageProcessingToken is deallocated, the probe will be invoked with the WebKitMessageRecord.
3120
3121         (MessageRecorder::MessageProcessingToken::MessageProcessingToken):
3122         (MessageRecorder::MessageProcessingToken::~MessageProcessingToken):
3123         Keep track of when the token is created and destroyed; these are considered the beginning
3124         and ending "processing" times of the message (and as such the token should be kept alive for
3125         exactly as long as the message is being processed).
3126
3127         * Platform/IPC/MessageRecorderProbes.d: Added.
3128         Add a DTrace provider source file with two probes, message_sent and message_received.
3129         The struct must match the struct in MessageRecorder.h.
3130         
3131         * Platform/IPC/ProcessType.h: Added.
3132         Add an enum of process types.
3133
3134         * WebKit2.xcodeproj/project.pbxproj:
3135
3136         * DatabaseProcess/DatabaseProcess.h:
3137         * DatabaseProcess/DatabaseToWebProcessConnection.h:
3138         * NetworkProcess/NetworkConnectionToWebProcess.h:
3139         * NetworkProcess/NetworkProcess.h:
3140         * WebProcess/Databases/WebToDatabaseProcessConnection.h:
3141         * WebProcess/Network/NetworkProcessConnection.h:
3142         * WebProcess/Plugins/PluginProcessConnection.h:
3143         * WebProcess/WebPage/WebInspector.h:
3144         * WebProcess/WebPage/WebInspectorUI.h:
3145         * WebProcess/WebProcess.h:
3146         * UIProcess/Databases/DatabaseProcessProxy.h:
3147         * UIProcess/Network/NetworkProcessProxy.h:
3148         * UIProcess/Plugins/PluginProcessProxy.h:
3149         * UIProcess/WebProcessProxy.h:
3150         * PluginProcess/PluginProcess.h:
3151         * PluginProcess/WebProcessConnection.h:
3152         Annotate Connection::Clients with process types.
3153         
3154 2015-01-28  Joseph Pecoraro  <pecoraro@apple.com>
3155
3156         Web Inspector: Crash closing inspected page with frequent activity
3157         https://bugs.webkit.org/show_bug.cgi?id=140973
3158
3159         Reviewed by Timothy Hatcher.
3160
3161         * WebProcess/WebPage/WebInspector.h:
3162         (WebKit::WebInspector::disconnectFromPage):        
3163         * WebProcess/WebPage/WebPage.cpp:
3164         (WebKit::WebPage::close):
3165         Be sure to close the WebInspector connection through the page
3166         when the page is closing so that the WebKit::WebInspector is
3167         relinquishes itself as the InspectorFrontendChannel.
3168
3169 2015-01-28  Timothy Horton  <timothy_horton@apple.com>
3170
3171         Avoid manually handling quickLookWithEvent: if the immediate action gesture recognizer will do Lookup for us
3172         https://bugs.webkit.org/show_bug.cgi?id=141018
3173         <rdar://problem/19619999>
3174
3175         Reviewed by Beth Dakin.
3176
3177         * UIProcess/API/mac/WKView.mm:
3178         (-[WKView quickLookWithEvent:]):
3179         If we have an immediate action gesture recognizer, just call super and
3180         avoid WebKit's special quickLookWithEvent: implementation.
3181
3182 2015-01-28  Sungmann Cho  <sungmann.cho@navercorp.com>
3183
3184         Remove remaining PLATFORM(WIN) code blocks from WebKit2.
3185         https://bugs.webkit.org/show_bug.cgi?id=140972
3186
3187         Reviewed by Darin Adler.
3188
3189         * WebProcess/Cookies/cf/WebCookieManagerCFNet.cpp:
3190         (WebKit::WebCookieManager::platformSetHTTPCookieAcceptPolicy):
3191
3192 2015-01-28  Beth Dakin  <bdakin@apple.com>
3193
3194         Remove Mountain Lion code from WebKit and WebKit2
3195         https://bugs.webkit.org/show_bug.cgi?id=141010
3196
3197         Reviewed by Sam Weinig.
3198
3199         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
3200         * PluginProcess/EntryPoint/mac/LegacyProcess/PluginProcessMain.mm:
3201         * Shared/mac/ChildProcessMac.mm:
3202         (WebKit::ChildProcess::initializeSandbox):
3203         * Shared/mac/WebEventFactory.mm:
3204         (WebKit::phaseForEvent):
3205         * UIProcess/API/mac/WKView.mm:
3206         (-[WKView quickLookWithEvent:]):
3207         (-[WKView updateLayer]):
3208         (-[WKView createFullScreenWindow]):
3209         * UIProcess/Network/NetworkProcessProxy.cpp:
3210         (WebKit::NetworkProcessProxy::didFinishLaunching):
3211         * UIProcess/Network/mac/NetworkProcessProxyMac.mm:
3212         (WebKit::shouldUseXPC):
3213         * UIProcess/WebProcessProxy.cpp:
3214         (WebKit::WebProcessProxy::didFinishLaunching):
3215         * UIProcess/mac/PageClientImpl.mm:
3216         (WebKit::PageClientImpl::isViewVisible):
3217         * WebKit2Prefix.h:
3218         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
3219         (InitWebCoreSystemInterface):
3220         * WebProcess/com.apple.WebProcess.sb.in:
3221
3222 2015-01-28  Joseph Pecoraro  <pecoraro@apple.com>
3223
3224         Web Inspector: Crash when closing inspected page
3225         https://bugs.webkit.org/show_bug.cgi?id=140968
3226
3227         Reviewed by Timothy Hatcher.
3228
3229         Handle cases where the corePage could be null. With the Inspector Process
3230         in its own process, messages may come to the WebContentProcess after
3231         the WebCore::Page has itself been destroyed.
3232
3233         * WebProcess/WebPage/WebInspector.cpp:
3234         (WebKit::WebInspector::show):
3235         (WebKit::WebInspector::close):
3236         (WebKit::WebInspector::openInNewTab):
3237         (WebKit::WebInspector::evaluateScriptForTest):
3238         (WebKit::WebInspector::showConsole):
3239         (WebKit::WebInspector::showResources):
3240         (WebKit::WebInspector::showMainResourceForFrame):
3241         (WebKit::WebInspector::startPageProfiling):
3242         (WebKit::WebInspector::stopPageProfiling):
3243         (WebKit::WebInspector::canAttachWindow):
3244         (WebKit::WebInspector::sendMessageToBackend):
3245         (WebKit::WebInspector::remoteFrontendConnected):
3246         (WebKit::WebInspector::remoteFrontendDisconnected):
3247
3248 2015-01-28  Sam Weinig  <sam@webkit.org>
3249
3250         Convert WebPreferences and VisitedLinkProvider to be bridged API::Objects
3251         https://bugs.webkit.org/show_bug.cgi?id=141002
3252
3253         Reviewed by Tim Horton.
3254
3255         * Shared/API/APIObject.h:
3256         Add VisitedLinkProvider type.
3257         
3258         * Shared/Cocoa/APIObject.mm:
3259         (API::Object::newObject):
3260         Allocate WebPreferences and VisitedLinkProvider as their Objective-C counterpart.
3261         
3262         * UIProcess/API/Cocoa/WKPreferences.mm:
3263         (-[WKPreferences init]):
3264         Switch to constructInWrapper.
3265
3266         (-[WKPreferences dealloc]):
3267         Call the WebPreferences destructor.
3268         
3269         (-[WKPreferences _apiObject]):
3270         Add implementation of the WKObject protocol.
3271
3272         * UIProcess/API/Cocoa/WKPreferencesInternal.h:
3273         Convert to using ObjectStorage.
3274
3275         * UIProcess/API/Cocoa/_WKVisitedLinkProvider.mm:
3276         (-[_WKVisitedLinkProvider init]):
3277         Switch to constructInWrapper.
3278
3279         (-[_WKVisitedLinkProvider dealloc]):
3280         Call the VisitedLinkProvider destructor.
3281
3282         (-[_WKVisitedLinkProvider _apiObject]):
3283         Add implementation of the WKObject protocol.
3284
3285         * UIProcess/API/Cocoa/_WKVisitedLinkProviderInternal.h:
3286         Convert to using ObjectStorage.
3287
3288         * UIProcess/VisitedLinkProvider.cpp:
3289         (WebKit::VisitedLinkProvider::create):
3290         * UIProcess/VisitedLinkProvider.h:
3291         Switch create() to return a Ref.
3292
3293         * UIProcess/WebPreferences.h:
3294         Make the constructor public for use by constructInWrapper.
3295
3296         * UIProcess/WebProcessPool.cpp:
3297         (WebKit::WebProcessPool::createWebPage):
3298         * UIProcess/WebProcessPool.h:
3299         Store the VisitedLinkProvider in a Ref.
3300
3301 2015-01-28  Dana Burkart  <dburkart@apple.com>
3302
3303         Move ASan flag settings from DebugRelease.xcconfig to Base.xcconfig
3304         https://bugs.webkit.org/show_bug.cgi?id=136765
3305
3306         Reviewed by Alexey Proskuryakov.
3307
3308         * Configurations/Base.xcconfig:
3309         * Configurations/DebugRelease.xcconfig:
3310
3311 2015-01-28  Chris Dumez  <cdumez@apple.com>
3312
3313         Fix typo in markPagesForVistedLinkStyleRecalc()
3314         https://bugs.webkit.org/show_bug.cgi?id=140977
3315
3316         Reviewed by Darin Adler.
3317
3318         * WebProcess/WebPage/VisitedLinkTableController.cpp:
3319         (WebKit::VisitedLinkTableController::setVisitedLinkTable):
3320         (WebKit::VisitedLinkTableController::visitedLinkStateChanged):
3321         (WebKit::VisitedLinkTableController::allVisitedLinkStateChanged):
3322         (WebKit::VisitedLinkTableController::removeAllVisitedLinks):
3323
3324 2015-01-27  Antti Koivisto  <antti@apple.com>
3325
3326         http/tests/xmlhttprequest/workers/methods.html sometimes times out with disk cache enabled
3327         https://bugs.webkit.org/show_bug.cgi?id=140976
3328
3329         Reviewed by Chris Dumez.
3330
3331         Running
3332
3333             run-webkit-tests --release -2 http/tests/xmlhttprequest/workers/methods.html --iterations=100
3334
3335         would usually time out an iteration.
3336
3337         * NetworkProcess/cache/NetworkCacheStorageCocoa.mm:
3338         (WebKit::NetworkCacheStorage::dispatchRetrieveOperation):
3339
3340         Using dispatch_io_read with an empty file calls the handler block immediately with done boolean set
3341         without it being an error. We failed to call the completion handler and any synchronous xhr would hang.
3342         We may see an empty cache file if we are just in process of writing it.
3343
3344         Fix by handling this case specifically.
3345
3346 2015-01-28  Carlos Garcia Campos  <cgarcia@igalia.com>
3347
3348         Unreviewed. Add missing file to WebInspector compilation for GTK+.
3349
3350         * PlatformGTK.cmake: Add UserInterface/External/ESLint/eslint.js
3351
3352 2015-01-28  Chris Dumez  <cdumez@apple.com>
3353
3354         Rename pageCache() to PageCache::shared() and return a reference
3355         https://bugs.webkit.org/show_bug.cgi?id=140983
3356
3357         Reviewed by Andreas Kling.
3358
3359         Rename pageCache() to PageCache::shared() as this is a singleton class
3360         and have it return a reference instead of a pointer.
3361
3362         * WebProcess/WebPage/VisitedLinkTableController.cpp:
3363         (WebKit::VisitedLinkTableController::setVisitedLinkTable):
3364         (WebKit::VisitedLinkTableController::visitedLinkStateChanged):
3365         (WebKit::VisitedLinkTableController::allVisitedLinkStateChanged):
3366         (WebKit::VisitedLinkTableController::removeAllVisitedLinks):
3367         * WebProcess/WebPage/WebBackForwardListProxy.cpp:
3368         (WebKit::WebBackForwardListProxy::removeItem):
3369         (WebKit::WebBackForwardListProxy::close):
3370         * WebProcess/WebProcess.cpp:
3371         (WebKit::WebProcess::releasePageCache):
3372         * WebProcess/cocoa/WebProcessCocoa.mm:
3373         (WebKit::WebProcess::platformSetCacheModel):
3374         * WebProcess/soup/WebProcessSoup.cpp:
3375         (WebKit::WebProcess::platformSetCacheModel):
3376
3377 2015-01-27  Alexey Proskuryakov  <ap@apple.com>
3378
3379         More build fixes for newer clang.
3380
3381         Rubber-stamped by Anders Carlsson.
3382
3383         Added missing override keywords, marked some deprecated accessibility methods as such.
3384
3385         * PluginProcess/EntryPoint/mac/LegacyProcess/PluginProcessMain.mm:
3386         (WebKit::PluginProcessMainDelegate::doPreInitializationWork): Deleted.
3387         (WebKit::PluginProcessMainDelegate::getExtraInitializationData): Deleted.
3388         (WebKit::PluginProcessMainDelegate::doPostRunWork): Deleted.
3389         * PluginProcess/WebProcessConnection.h:
3390         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
3391         (WebKit::WebProcessPool::platformInitializeWebProcess):
3392         * UIProcess/Plugins/PluginProcessProxy.h:
3393         * UIProcess/WebPageProxy.h:
3394         * UIProcess/mac/PageClientImpl.h:
3395         * WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:
3396         (PageOverlayClientImpl::actionContextForResultAtPoint): Deleted.
3397         (PageOverlayClientImpl::dataDetectorsDidPresentUI): Deleted.
3398         (PageOverlayClientImpl::dataDetectorsDidChangeUI): Deleted.
3399         (PageOverlayClientImpl::dataDetectorsDidHideUI): Deleted.
3400         * WebProcess/Plugins/Netscape/NetscapePlugin.h:
3401         (WebKit::NetscapePlugin::isBeingAsynchronouslyInitialized): Deleted.
3402         * WebProcess/Plugins/PDF/PDFPlugin.h:
3403         * WebProcess/Plugins/PluginProcessConnection.h:
3404         * WebProcess/Plugins/PluginProxy.h:
3405         (WebKit::PluginProxy::isBeingAsynchronouslyInitialized): Deleted.
3406         * WebProcess/WebCoreSupport/WebContextMenuClient.h:
3407
3408 2015-01-27  Beth Dakin  <bdakin@apple.com>
3409
3410         Immediate action gesture recognizer still doesn't work well with IB
3411         https://bugs.webkit.org/show_bug.cgi?id=140967
3412         -and corresponding-
3413         rdar://problem/19621509
3414
3415         Reviewed by Tim Horton.
3416
3417         We should add (or remove) the gesture recognizer in viewDidMoveToWindow because 
3418         initWithFrame it too early and IB might mess with it.
3419         * UIProcess/API/mac/WKView.mm:
3420         (-[WKView viewDidMoveToWindow]):
3421         (-[WKView initWithFrame:processPool:configuration:webView:]):
3422
3423 2015-01-27  Beth Dakin  <bdakin@apple.com>
3424
3425         Invoking an immediate action on link often dismisses selection
3426         https://bugs.webkit.org/show_bug.cgi?id=140911
3427         -and corresponding-
3428         rdar://problem/19572685
3429
3430         Reviewed by Tim Horton.
3431
3432         Calling _page->setMaintainsInactiveSelection(false) in complete is often 
3433         too soon. Instead, call it in dismissContentRelativeChildWindows. This is more 
3434         similar to the timing for the TextIndicator.
3435         * UIProcess/mac/WKImmediateActionController.mm:
3436         (-[WKImmediateActionController dismissContentRelativeChildWindows]):
3437         (-[WKImmediateActionController immediateActionRecognizerWillPrepare:]):
3438         (-[WKImmediateActionController immediateActionRecognizerDidCompleteAnimation:]):
3439
3440 2015-01-27  Carlos Garcia Campos  <cgarcia@igalia.com>
3441
3442         REGRESSION(r166975): [GTK] Page overlays are not drawn anymore after r166975
3443         https://bugs.webkit.org/show_bug.cgi?id=131433
3444
3445         Reviewed by Žan Doberšek.
3446
3447         Implement page overlays for the GTK+ port.
3448
3449         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
3450         Override pure virtual setViewOverlayRootLayer().
3451         * WebProcess/WebPage/DrawingAreaImpl.cpp:
3452         (WebKit::DrawingAreaImpl::display): Remove FIXME and use modern
3453         for loop.
3454         (WebKit::DrawingAreaImpl::attachViewOverlayGraphicsLayer): Remove
3455         ifdefs and use LayerTreeHost::setViewOverlayRootLayer().
3456         * WebProcess/WebPage/LayerTreeHost.h: Add pure virtual setViewOverlayRootLayer().
3457         * WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp:
3458         (WebKit::LayerTreeHostGtk::LayerTreeHostGtk): Initialize m_viewOverlayRootLayer.
3459         (WebKit::LayerTreeHostGtk::initialize): Remove FIXME.
3460         (WebKit::LayerTreeHostGtk::setNonCompositedContentsNeedDisplay):
3461         Remove unused old page overlays code.
3462         (WebKit::LayerTreeHostGtk::setNonCompositedContentsNeedDisplayInRect): Ditto.
3463         (WebKit::LayerTreeHostGtk::sizeDidChange): Ditto.
3464         (WebKit::LayerTreeHostGtk::paintContents): Remove FIXME.
3465         (WebKit::LayerTreeHostGtk::flushPendingLayerChanges): Flush
3466         compositing state on m_pageOverlayLayers if present.
3467         (WebKit::LayerTreeHostGtk::setViewOverlayRootLayer): Set m_pageOverlayLayers.
3468         (WebKit::LayerTreeHostGtk::createPageOverlayLayer): Deleted.
3469         (WebKit::LayerTreeHostGtk::destroyPageOverlayLayer): Deleted.
3470         * WebProcess/WebPage/gtk/LayerTreeHostGtk.h: Remove unused old
3471         page overlays code.
3472
3473 2015-01-27  Sungmann Cho  <sungmann.cho@navercorp.com>
3474
3475         Remove remaining PLUGIN_ARCHITECTURE(WIN) code blocks from WebKit2.
3476         https://bugs.webkit.org/show_bug.cgi?id=140912
3477
3478         Reviewed by Anders Carlsson.
3479
3480         * Shared/Plugins/Netscape/NetscapePluginModule.cpp:
3481         (WebKit::NetscapePluginModule::tryLoad):
3482         * Shared/Plugins/PluginQuirks.h:
3483         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
3484         (WebKit::NetscapePlugin::userAgent):
3485         * WebProcess/Plugins/Netscape/NetscapePlugin.h:
3486
3487 2015-01-26  Simon Fraser  <simon.fraser@apple.com>
3488
3489         [iOS WK2] Fix possible crash when -[WKWebView evaluateJavaScript:completionHandler:] was called then the WKWebView is destroyed
3490         https://bugs.webkit.org/show_bug.cgi?id=140203
3491         rdar://problem/19198492
3492
3493         Reviewed by Sam Weinig.
3494         
3495         When handling the OwnerWasInvalidated case in -[WKWebView evaluateJavaScript:completionHandler:],
3496         the block passed to dispatch_async() needs to be retained. Fix by passing the RefPtr
3497         to the lambda.
3498
3499         * UIProcess/API/Cocoa/WKWebView.mm:
3500         (-[WKWebView evaluateJavaScript:completionHandler:]):
3501
3502 2015-01-26  Chris Dumez  <cdumez@apple.com>
3503
3504         Rename Document::body() to Document::bodyOrFrameset() for clarity
3505         https://bugs.webkit.org/show_bug.cgi?id=140902
3506
3507         Reviewed by Andreas Kling.
3508
3509         Rename Document::body() to Document::bodyOrFrameset() for clarity. This