Drop ResourceLoadPriorityUnresolved resource load priority and use Optional<> instead
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2015-02-03  Chris Dumez  <cdumez@apple.com>
2
3         Drop ResourceLoadPriorityUnresolved resource load priority and use Optional<> instead
4         https://bugs.webkit.org/show_bug.cgi?id=141186
5
6         Reviewed by Antti Koivisto.
7
8         Update code now that ResourceLoadPriorityUnresolved is not longer a
9         ResourceLoadPriority enum value.
10
11         * NetworkProcess/cache/NetworkCache.cpp:
12         (WebKit::NetworkCache::retrieve):
13         * WebProcess/Network/WebResourceLoadScheduler.cpp:
14         (WebKit::WebResourceLoadScheduler::scheduleLoad):
15
16 2015-02-03  Enrica Casucci  <enrica@apple.com>
17
18         [iOS] Add support for deleteFromInputWithFlags.
19         https://bugs.webkit.org/show_bug.cgi?id=141216
20         rdar://problem/19130081
21
22         Reviewed by Benjamin Poulain.
23
24         Adopts the new method as soon as it is available.
25         The patch also removes some obsolete code used for staging.
26
27         * Platform/spi/ios/UIKitSPI.h:
28         * UIProcess/ios/WKContentViewInteraction.mm:
29         (-[WKContentView _interpretKeyEvent:isCharEvent:]):
30
31 2015-02-03  Joseph Pecoraro  <pecoraro@apple.com>
32
33         [iOS] Selection Callout should not immediately disappear on pages with frequent layouts
34         https://bugs.webkit.org/show_bug.cgi?id=141210
35
36         Reviewed by Enrica Casucci.
37
38         In iOS WebKit2 in order to keep caret refreshes in sync with WebCore layouts
39         the selection assistant is told to update whenever WebKit's layer tree
40         commits. Unfortunately, for pages with JavaScript animation that are
41         frequently doing a layout / layer tree update, this would trigger very
42         frequent selection updates that would keep the caret from blinking and
43         dismiss any selection callouts.
44
45         This change tracks the last selection drawing information so that we can
46         avoid informing the assistant of a selection updates unless it has changed
47         visually or needs to redraw (zoom).
48
49         * Shared/EditorState.cpp:
50         Remove include already in header.
51
52         * UIProcess/ios/WKContentViewInteraction.h:
53         * UIProcess/ios/WKContentViewInteraction.mm:
54         (WebKit::WKSelectionDrawingInfo::WKSelectionDrawingInfo):
55         (WebKit::operator==):
56         (WebKit::operator!=):
57         (-[WKContentView observeValueForKeyPath:ofObject:change:context:]):
58         When zooming, force the selection update, even though the drawing
59         information hasn't changed, the views will need to be updated.
60
61         (-[WKContentView _updateChangedSelection]):
62         (-[WKContentView _updateChangedSelection:]):
63         Monitor EditorState for changes in selection drawing and avoid
64         informing the selection assistant unless necessary.
65
66 2015-02-03  Jeremy Jones  <jeremyj@apple.com>
67
68         Prevent flicker when exiting fullscreen by synchronizing transactions.
69         https://bugs.webkit.org/show_bug.cgi?id=140897
70
71         Reviewed by Tim Horton.
72
73         Flush transactions before removing layerHost. This allows existing transactions to be completed before the hosting layer disappears.
74
75         * UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
76         (WebKit::WebVideoFullscreenManagerProxy::didCleanupFullscreen):
77
78 2015-02-03  Brian J. Burg  <burg@cs.washington.edu>
79
80         Convert WebInspectorProxy to use WKWebView API for the inspector view
81         https://bugs.webkit.org/show_bug.cgi?id=141037
82
83         Reviewed by Timothy Hatcher.
84
85         Use the newer API for PLATFORM(MAC). The main difference is that the
86         WKWebView's page group cannot be set directly; instead, the group identifier
87         is passed. Also add some preference setters needed for the inspector.
88
89         Refactor some code to not use page groups directly. In a future patch,
90         the PageGroup-based inspector level system will be simplified. It is
91         it is no longer necessary to keep a static map of PageGroup instances,
92         since they are only used to save inspector window preferences. (These used
93         to prevent all levels of inspector from pausing together when a second-level
94         inspector hit a breakpoint. This is not necessary with multi-process
95         web inspectors.)
96
97         Also, adjust window resizing behavior when the inspector is docked to
98         the right. Window width resizes should not affect the width of the inspector
99         frame. This matches the behavior of height changes when docked to the bottom.
100
101         To support 32-bit Mac builds where WKWebView is not defined, share the stub
102         platformFoo() implementations with PLATFORM(IOS). The stubs are now located
103         in the platform-independent WebInspectorProxy.cpp.
104
105         * UIProcess/API/Cocoa/WKPreferences.mm:
106         (-[WKPreferences _logsPageMessagesToSystemConsoleEnabled]): Added.
107         (-[WKPreferences _setLogsPageMessagesToSystemConsoleEnabled:]): Added.
108         (-[WKPreferences _allowFileAccessFromFileURLs]): Added.
109         (-[WKPreferences _setAllowFileAccessFromFileURLs:]): Added.
110         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
111         * UIProcess/WebInspectorProxy.cpp:
112         (WebKit::WebInspectorProxy::WebInspectorProxy):
113         (WebKit::WebInspectorProxy::inspectorPagePreferences):
114         (WebKit::WebInspectorProxy::attach):
115         (WebKit::WebInspectorProxy::detach):
116         (WebKit::WebInspectorProxy::setAttachedWindowHeight):
117         (WebKit::WebInspectorProxy::setAttachedWindowWidth):
118         (WebKit::WebInspectorProxy::createInspectorPage):
119         (WebKit::WebInspectorProxy::shouldOpenAttached):
120         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
121         (WebKit::WebInspectorProxy::platformOpen):
122         (WebKit::WebInspectorProxy::platformDidClose):
123         (WebKit::WebInspectorProxy::platformInvalidate):
124         (WebKit::WebInspectorProxy::platformBringToFront):
125         (WebKit::WebInspectorProxy::platformHide):
126         (WebKit::WebInspectorProxy::platformIsFront):
127         (WebKit::WebInspectorProxy::platformInspectedURLChanged):
128         (WebKit::WebInspectorProxy::platformSave):
129         (WebKit::WebInspectorProxy::platformAppend):
130         (WebKit::WebInspectorProxy::platformInspectedWindowHeight):
131         (WebKit::WebInspectorProxy::platformInspectedWindowWidth):
132         (WebKit::WebInspectorProxy::platformAttach):
133         (WebKit::WebInspectorProxy::platformDetach):
134         (WebKit::WebInspectorProxy::platformSetAttachedWindowHeight):
135         (WebKit::WebInspectorProxy::platformSetToolbarHeight):
136         (WebKit::WebInspectorProxy::inspectorPageURL):
137         (WebKit::WebInspectorProxy::inspectorTestPageURL):
138         (WebKit::WebInspectorProxy::inspectorBaseURL):
139         (WebKit::WebInspectorProxy::platformSetAttachedWindowWidth):
140         (WebKit::WebInspectorProxy::platformAttachAvailabilityChanged):
141         * UIProcess/WebInspectorProxy.h:
142         * UIProcess/ios/WebInspectorProxyIOS.mm: Removed.
143         * UIProcess/mac/WebInspectorProxyMac.mm:
144         (-[WKWebInspectorWKWebView _didRelaunchProcess]):
145         WKWebView doesn't implement this, so remove the super call.
146         (WebKit::WebInspectorProxy::closeTimerFired):
147         (WebKit::createDockButton):
148         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
149         (WebKit::WebInspectorProxy::platformAttach):
150         (-[WKWebInspectorWKView _didRelaunchProcess]): Deleted.
151         * WebKit2.xcodeproj/project.pbxproj:
152
153 2015-02-03  Antti Koivisto  <antti@apple.com>
154
155         Memory cache for resources pending disk write
156         https://bugs.webkit.org/show_bug.cgi?id=141159
157
158         Reviewed by Andreas Kling.
159
160         If a resource was requested from the disk cache before it has been written we ended up
161         loading it again. Add a short lived memory cache to avoid this.
162
163         * NetworkProcess/cache/NetworkCache.cpp:
164         (WebKit::decodeStorageEntry):
165         * NetworkProcess/cache/NetworkCacheStorage.h:
166         (WebKit::NetworkCacheStorage::Data::isMap):
167
168             Add a way to know whether a Data is backed by map or not. SharedMemory does not work correctly
169             if it is not a map.
170
171         * NetworkProcess/cache/NetworkCacheStorageCocoa.mm:
172         (WebKit::NetworkCacheStorage::Data::Data):
173         (WebKit::NetworkCacheStorage::initialize):
174
175             Also do some renaming.
176
177         (WebKit::decodeEntry):
178         (WebKit::NetworkCacheStorage::removeEntry):
179         (WebKit::NetworkCacheStorage::retrieve):
180         (WebKit::NetworkCacheStorage::store):
181         (WebKit::NetworkCacheStorage::clear):
182         (WebKit::NetworkCacheStorage::shrinkIfNeeded):
183
184 2015-02-02  Antti Koivisto  <antti@apple.com>
185
186         Update cache header after revalidation without rewriting the body data
187         https://bugs.webkit.org/show_bug.cgi?id=141182
188
189         Reviewed by Andreas Kling.
190
191         Currently we just rewrite the entire entry after revalidation.
192
193         * NetworkProcess/cache/NetworkCache.cpp:
194         (WebKit::decodeStorageEntry):
195
196             Include the strorage entry to the cache response so we can more easily update it.
197
198         (WebKit::NetworkCache::update):
199
200             Call the storage update function with the new and the exisiting storage entry.
201
202         * NetworkProcess/cache/NetworkCache.h:
203         * NetworkProcess/cache/NetworkCacheStorage.h:
204         * NetworkProcess/cache/NetworkCacheStorageCocoa.mm:
205         (WebKit::openFileForKey):
206
207             Added an option for opening a file for writing without creating a new one.
208             Renamed for clarity.
209
210         (WebKit::encodeEntryHeader):
211
212             Separate header encoding to a function.
213
214         (WebKit::encodeEntry):
215         (WebKit::NetworkCacheStorage::dispatchRetrieveOperation):
216         (WebKit::NetworkCacheStorage::store):
217         (WebKit::NetworkCacheStorage::update):
218
219             New update function.
220             If the page-rounded header size would stay unchanged we can just write the new header over the old one.
221             In the unlikely event it doesn't we rewrite the whole thing.
222
223         (WebKit::createIOChannelForKey): Deleted.
224
225 2015-02-02  Commit Queue  <commit-queue@webkit.org>
226
227         Unreviewed, rolling out r179540.
228         https://bugs.webkit.org/show_bug.cgi?id=141190
229
230         need further investigation to fix !WK_API_ENABLED (32bit)
231         build. (Requested by brrian_ on #webkit).
232
233         Reverted changeset:
234
235         "Convert WebInspectorProxy to use WKWebView API for the
236         inspector view"
237         https://bugs.webkit.org/show_bug.cgi?id=141037
238         http://trac.webkit.org/changeset/179540
239
240 2015-02-02  Brian J. Burg  <burg@cs.washington.edu>
241
242         Convert WebInspectorProxy to use WKWebView API for the inspector view
243         https://bugs.webkit.org/show_bug.cgi?id=141037
244
245         Reviewed by Timothy Hatcher.
246
247         Use the newer API for PLATFORM(MAC). The main difference is that the
248         WKWebView's page group cannot be set directly; instead, the group identifier
249         is passed. Also add some preference setters needed for the inspector.
250
251         Refactor some code to not use page groups directly. In a future patch,
252         the PageGroup-based inspector level system will be simplified. It is
253         it is no longer necessary to keep a static map of PageGroup instances,
254         since they are only used to save inspector window preferences. (These used
255         to prevent all levels of inspector from pausing together when a second-level
256         inspector hit a breakpoint. This is not necessary with multi-process
257         web inspectors.)
258
259         Also, adjust window resizing behavior when the inspector is docked to
260         the right. Window width resizes should not affect the width of the inspector
261         frame. This matches the behavior of height changes when docked to the bottom.
262
263         * UIProcess/API/Cocoa/WKPreferences.mm:
264         (-[WKPreferences _logsPageMessagesToSystemConsoleEnabled]): Added.
265         (-[WKPreferences _setLogsPageMessagesToSystemConsoleEnabled:]): Added.
266         (-[WKPreferences _allowFileAccessFromFileURLs]): Added.
267         (-[WKPreferences _setAllowFileAccessFromFileURLs:]): Added.
268         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
269         * UIProcess/WebInspectorProxy.cpp:
270         (WebKit::WebInspectorProxy::WebInspectorProxy):
271         (WebKit::WebInspectorProxy::inspectorPagePreferences): Added.
272         (WebKit::WebInspectorProxy::attach):
273         (WebKit::WebInspectorProxy::detach):
274         (WebKit::WebInspectorProxy::setAttachedWindowHeight):
275         (WebKit::WebInspectorProxy::setAttachedWindowWidth):
276         (WebKit::WebInspectorProxy::createInspectorPage):
277         (WebKit::WebInspectorProxy::shouldOpenAttached):
278         * UIProcess/WebInspectorProxy.h: Use default member initializers.
279         * UIProcess/mac/WebInspectorProxyMac.mm:
280         (-[WKWebInspectorWKWebView _didRelaunchProcess]):
281         WKWebView doesn't implement this, so remove the super call.
282         (WebKit::WebInspectorProxy::closeTimerFired):
283         (WebKit::createDockButton):
284         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
285         (WebKit::WebInspectorProxy::platformAttach):
286         (-[WKWebInspectorWKView _didRelaunchProcess]): Deleted.
287
288 2015-02-02  Chris Dumez  <cdumez@apple.com>
289
290         Make NetworkCache's constructor private
291         https://bugs.webkit.org/show_bug.cgi?id=141181
292
293         Reviewed by Antti Koivisto.
294
295         Make NetworkCache's constructor private and mark its destructor as
296         deleted as it is a singleton class.
297
298         * NetworkProcess/cache/NetworkCache.cpp:
299         (WebKit::NetworkCache::NetworkCache): Deleted.
300         * NetworkProcess/cache/NetworkCache.h:
301
302 2015-02-02  Filip Pizlo  <fpizlo@apple.com>
303
304         Revert accidental (and super bad) change in r179490.
305
306         * WebProcess/com.apple.WebProcess.sb.in:
307
308 2015-02-02  Chris Dumez  <cdumez@apple.com>
309
310         Access MemoryCache singleton using MemoryCache::singleton()
311         https://bugs.webkit.org/show_bug.cgi?id=141104
312
313         Reviewed by Andreas Kling.
314
315         Access MemoryCache singleton using MemoryCache::singleton() static
316         member function, instead of a free function, as per the recent
317         coding style discussion on WebKit-dev.
318
319 2015-02-02  Jeremy Jones  <jeremyj@apple.com>
320
321         Prevent crash when accessing WebAVPlayerController.delegate.
322         https://bugs.webkit.org/show_bug.cgi?id=140893
323
324         Reviewed by Darin Adler.
325
326         Plumb new resetMediaState() through IPC interface WebVideoFullscreenManagerProxy.
327
328         * UIProcess/ios/WebVideoFullscreenManagerProxy.messages.in:
329         * UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
330         (WebKit::WebVideoFullscreenManagerProxy::invalidate): remove redundant set to nullptr.
331         * WebProcess/ios/WebVideoFullscreenManager.h:
332         * WebProcess/ios/WebVideoFullscreenManager.mm:
333         (WebKit::WebVideoFullscreenManager::resetMediaState):
334
335 2015-02-01  Chris Dumez  <cdumez@apple.com>
336
337         Use more references in HistoryItem
338         https://bugs.webkit.org/show_bug.cgi?id=141133
339
340         Reviewed by Andreas Kling.
341
342         Use more references in HistoryItem instead of pointers.
343
344         * WebProcess/InjectedBundle/InjectedBundleBackForwardListItem.cpp:
345         (WebKit::InjectedBundleBackForwardListItem::children):
346         * WebProcess/WebCoreSupport/SessionStateConversion.cpp:
347         (WebKit::toFrameState):
348         (WebKit::applyFrameState):
349         * WebProcess/WebPage/WebBackForwardListProxy.cpp:
350         (WebKit::WebBackForwardListProxy::addItem):
351         * WebProcess/WebPage/WebBackForwardListProxy.h:
352
353 2015-02-01  Dan Bernstein  <mitz@apple.com>
354
355         Remove ViewGestureController tracing
356         https://bugs.webkit.org/show_bug.cgi?id=141137
357
358         Reviewed by Tim Horton.
359
360         Remove the tracing added in r176133, now that http://webkit.org/b/138750 is fixed.
361
362         * UIProcess/ios/ViewGestureControllerIOS.mm:
363         (WebKit::ViewGestureController::beginSwipeGesture):
364         (WebKit::ViewGestureController::endSwipeGesture):
365         (WebKit::ViewGestureController::willCommitPostSwipeTransitionLayerTree):
366         (WebKit::ViewGestureController::removeSwipeSnapshot):
367         (WebKit::addLogEntry): Deleted.
368         (WebKit::dumpLogEntries): Deleted.
369         * UIProcess/mac/ViewGestureController.h:
370
371 2015-01-31  Sam Weinig  <sam@webkit.org>
372
373         Remove even more Mountain Lion support
374         https://bugs.webkit.org/show_bug.cgi?id=141124
375
376         Reviewed by Alexey Proskuryakov.
377
378         * Configurations/Base.xcconfig:
379         * Configurations/DebugRelease.xcconfig:
380         * Configurations/FeatureDefines.xcconfig:
381         * Configurations/Version.xcconfig:
382         * Configurations/WebContentService.Development.xcconfig:
383         * Configurations/WebContentService.xcconfig:
384         * Configurations/WebKit.xcconfig:
385         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
386
387 2015-01-31  Antti Koivisto  <antti@apple.com>
388
389         Enable WebKit disk cache on OS X
390         https://bugs.webkit.org/show_bug.cgi?id=141022
391
392         Reviewed by Gavin Barraclough.
393
394         * config.h: Flip the switch.
395
396 2015-01-31  Antti Koivisto  <antti@apple.com>
397
398         Unreviewed, rolling out r179447.
399
400         Forgot to include the test.
401
402         Reverted changeset:
403
404         "Enable WebKit disk cache on OS X"
405         https://bugs.webkit.org/show_bug.cgi?id=141022
406         http://trac.webkit.org/changeset/179447
407
408 2015-01-31  Antti Koivisto  <antti@apple.com>
409
410         Enable WebKit disk cache on OS X
411         https://bugs.webkit.org/show_bug.cgi?id=141022
412
413         Reviewed by Gavin Barraclough.
414
415         * config.h: Flip the switch.
416
417 2015-01-31  Antti Koivisto  <antti@apple.com>
418
419         OSObjectPtr does not work with dispatch_data_t on Maverics
420         https://bugs.webkit.org/show_bug.cgi?id=141081
421
422         Reviewed by Zalan Bujtas.
423
424         Previous attempt to special case dispatch_data_t in OSObjectPtr didn't work in all cases
425         probably due to the context sensitivity of the definition of the dispatch_data_t type.
426
427         For now, add DispatchPtr for the cache code and use it.
428
429         * NetworkProcess/cache/NetworkCacheStorage.h:
430         (WebKit::DispatchPtr::DispatchPtr):
431         (WebKit::DispatchPtr::~DispatchPtr):
432         (WebKit::DispatchPtr::operator=):
433         (WebKit::DispatchPtr::get):
434         (WebKit::DispatchPtr::operator bool):
435         (WebKit::adoptDispatch):
436         * NetworkProcess/cache/NetworkCacheStorageCocoa.mm:
437         (WebKit::NetworkCacheStorage::Data::Data):
438         (WebKit::NetworkCacheStorage::Data::data):
439         (WebKit::NetworkCacheStorage::NetworkCacheStorage):
440         (WebKit::createIOChannelForKey):
441         (WebKit::decodeEntry):
442         (WebKit::encodeEntryMetaData):
443         (WebKit::encodeEntry):
444
445 2015-01-30  Tim Horton  <timothy_horton@apple.com>
446
447         Add and hook up APINavigationClient
448         https://bugs.webkit.org/show_bug.cgi?id=140698
449
450         Reviewed by Sam Weinig.
451
452         Add a single APINavigationClient that NavigationState implements and
453         WebPageProxy prefers over APILoaderClient and APIPolicyClient.
454
455         * UIProcess/API/APILoaderClient.h:
456         Fix a comment.
457
458         * UIProcess/API/APINavigationClient.h: Added.
459         APINavigationClient is the union of NavigationState's overrides of APILoaderClient and APIPolicyClient.
460         Names are adjusted to more closely match the Modern API.
461
462         * UIProcess/Cocoa/NavigationState.h:
463         * UIProcess/Cocoa/NavigationState.mm:
464         Instead of having policy and loader clients, NavigationState has a single navigation client.
465         Adjust as necessary.
466
467         Move as much logic as possible (isMainFrame checks, construction of API objects) out of here
468         and into WebPageProxy.
469
470         * UIProcess/API/Cocoa/WKWebView.mm:
471         (-[WKWebView initWithFrame:configuration:]):
472         Install the aforementioned single navigation client.
473
474         * UIProcess/WebPageProxy.cpp:
475         (WebKit::WebPageProxy::setNavigationClient):
476         Add a navigation client setter.
477
478         For all policy and loader client calls, if we have a navigation client, use that;
479         otherwise, fall back on the policy and loader clients.
480
481         * UIProcess/WebPageProxy.h:
482         * WebKit2.xcodeproj/project.pbxproj:
483
484 2015-01-30  Chris Dumez  <cdumez@apple.com>
485
486         Update MemoryCache code to use more references instead of pointers
487         https://bugs.webkit.org/show_bug.cgi?id=141099
488
489         Reviewed by Andreas Kling.
490
491         * WebProcess/ResourceCache/WebResourceCacheManager.cpp:
492         (WebKit::WebResourceCacheManager::clearCacheForOrigin):
493
494 2015-01-30  Chris Dumez  <cdumez@apple.com>
495
496         Rename shared() static member functions to singleton() for singleton classes.
497         https://bugs.webkit.org/show_bug.cgi?id=141088
498
499         Reviewed by Ryosuke Niwa and Benjamin Poulain.
500
501         Rename shared() static member functions to singleton() for singleton
502         classes as per the recent coding style change.
503
504 2015-01-30  Alexey Proskuryakov  <ap@apple.com>
505
506         Build fix.
507
508         * Shared/API/c/WKDeprecatedFunctions.cpp:
509         * UIProcess/API/C/WKPreferencesRefPrivate.h:
510         The screen font substitution functions still need to be present in the header.
511
512 2015-01-29  Carlos Garcia Campos  <cgarcia@igalia.com>
513
514         [GTK] Resize the redirected XComposite again after leaving accelerated compositing mode
515         https://bugs.webkit.org/show_bug.cgi?id=140935
516
517         Reviewed by Sergio Villar Senin.
518
519         Since r178414 we don't resize the redirected XComposite window
520         until we enter accelerated compositing mode, but after leaving it
521         the redirected window keeps its size. We should resize it to 1x1
522         again and free the XPixmap and cairo surface to save that memory
523         while not in accelerated compositing mode.
524
525         * UIProcess/API/gtk/PageClientImpl.cpp:
526         (WebKit::PageClientImpl::enterAcceleratedCompositingMode): Notify
527         the WebKitWebViewBase.
528         (WebKit::PageClientImpl::exitAcceleratedCompositingMode): Ditto.
529         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
530         (webkitWebViewBaseEnterAcceleratedCompositingMode): Resize the
531         XComposite window to the current drawing area size.
532         (webkitWebViewBaseExitAcceleratedCompositingMode): Resize the
533         XComposite window to and empty size.
534         * UIProcess/API/gtk/WebKitWebViewBasePrivate.h:
535         * UIProcess/gtk/RedirectedXCompositeWindow.cpp:
536         (WebKit::RedirectedXCompositeWindow::RedirectedXCompositeWindow):
537         Do not initialize m_size since we now handle the empty size as a
538         especial case. Make sure we always create the X window with at
539         least 1x1 size.
540         (WebKit::RedirectedXCompositeWindow::resize): Resize the window to
541         at least 1x1, but when en empty size is given, call
542         cleanupPixmapAndPixmapSurface() to release those resources.
543         (WebKit::RedirectedXCompositeWindow::surface): Create the cairo
544         surface with at least 1x1 size.
545
546 2015-01-29  Carlos Garcia Campos  <cgarcia@igalia.com>
547
548         [GTK] Runtime critical warnings sometimes at start up when using the network process
549         https://bugs.webkit.org/show_bug.cgi?id=140998
550
551         Reviewed by Žan Doberšek.
552
553         This is caused by the CustomProtocolManager work queue
554         theread. This WorkQueue is created when the CustomProtocolManager
555         object is constructed, but destroyed when it's initialized when
556         the UI process asks to use the network process. In this case,
557         sometimes happens that the work queue thread that runs the main
558         loop is executed once the object has been destroyed and the main
559         loop pointer is nullptr.
560
561         * Platform/WorkQueue.h:
562         * Platform/gtk/WorkQueueGtk.cpp:
563         (WorkQueue::platformInitialize): Use a lambda function for the
564         thread body.
565         (WorkQueue::platformInvalidate): Detach the worker thread before
566         deleting the main loop object.
567         (WorkQueue::startWorkQueueThread): Deleted.
568         (WorkQueue::workQueueThreadBody): Deleted.
569
570 2015-01-29  Beth Dakin  <bdakin@apple.com>
571
572         Another follow-on, spotted this mistake. This used to be 
573         #if PLATFORM(IOS) || __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090 , so it should now be 
574         COCOA.
575
576         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
577         (WebKit::registerUserDefaultsIfNeeded):
578
579 2015-01-29  Beth Dakin  <bdakin@apple.com>
580
581         Follow-on, fixing a bad merge from my last change. 
582
583         * Shared/WebPreferencesDefinitions.h:
584
585 2015-01-29  Beth Dakin  <bdakin@apple.com>
586
587         Remove more Mountain Lion code from WebKit2
588         https://bugs.webkit.org/show_bug.cgi?id=141052
589
590         Reviewed by Tim Horton.
591
592         * NetworkProcess/NetworkResourceLoader.cpp:
593         (WebKit::NetworkResourceLoader::sendBufferMaybeAborting):
594         * NetworkProcess/NetworkResourceLoader.h:
595         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
596         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
597         * NetworkProcess/mac/NetworkDiskCacheMonitor.mm:
598         * NetworkProcess/mac/NetworkResourceLoaderMac.mm:
599         (WebKit::NetworkResourceLoader::willCacheResponseAsync):
600         * Platform/IPC/MessageDecoder.cpp:
601         * Platform/IPC/MessageDecoder.h:
602         * Platform/IPC/mac/ConnectionMac.mm:
603         (IPC::ConnectionTerminationWatchdog::watchdogTimerFired):
604         (IPC::Connection::open):
605         (IPC::Connection::receiveSourceEventHandler):
606         (IPC::Connection::kill):
607         * Platform/IPC/mac/ImportanceAssertion.h:
608         * PluginProcess/mac/PluginProcessMac.mm:
609         (WebKit::PluginProcess::initializeProcessName):
610         * Shared/WebPreferencesDefinitions.h:
611         * Shared/mac/ChildProcessMac.mm:
612         (WebKit::initializeTimerCoalescingPolicy):
613         (WebKit::ChildProcess::setApplicationIsDaemon):
614         (WebKit::ChildProcess::platformInitialize):
615         (WebKit::ChildProcess::setQOS):
616         * Shared/mac/CookieStorageShim.mm:
617         (WebKit::CookieStorageShim::initialize):
618         * UIProcess/API/mac/WKView.mm:
619         (-[WKView addWindowObserversForWindow:]):
620         (-[WKView removeWindowObservers]):
621         (-[WKView _windowDidChangeOcclusionState:]):
622         * UIProcess/Cocoa/NavigationState.mm:
623         (WebKit::NavigationState::LoaderClient::didReceiveAuthenticationChallengeInFrame):
624         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
625         (WebKit::registerUserDefaultsIfNeeded):
626         (WebKit::WebProcessPool::platformInitializeWebProcess):
627         (WebKit::WebProcessPool::registerNotificationObservers):
628         (WebKit::WebProcessPool::unregisterNotificationObservers):
629         (WebKit::privateBrowsingSession):
630         (WebKit::WebProcessPool::isURLKnownHSTSHost):
631         (WebKit::WebProcessPool::resetHSTSHosts):
632         * UIProcess/Databases/mac/DatabaseProcessProxyMac.mm:
633         (WebKit::shouldUseXPC):
634         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
635         (WebKit::shouldUseXPC):
636         * UIProcess/WebProcessPool.h:
637         * UIProcess/mac/TextCheckerMac.mm:
638         (WebKit::shouldAutomaticQuoteSubstitutionBeEnabled):
639         (WebKit::shouldAutomaticDashSubstitutionBeEnabled):
640         (WebKit::TextChecker::didChangeAutomaticQuoteSubstitutionEnabled):
641         (WebKit::TextChecker::didChangeAutomaticDashSubstitutionEnabled):
642         * UIProcess/mac/ViewGestureControllerMac.mm:
643         (WebKit::ViewGestureController::applyDebuggingPropertiesToSwipeViews):
644         * UIProcess/mac/WebProcessProxyMac.mm:
645         (WebKit::shouldUseXPC):
646         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
647         (InitWebCoreSystemInterface):
648         * WebProcess/cocoa/WebProcessCocoa.mm:
649         (WebKit::WebProcess::updateActivePages):
650         * WebProcess/com.apple.WebProcess.sb.in:
651         * config.h:
652
653 2015-01-29  Sam Weinig  <sam@webkit.org>
654
655         Remove support for screen font substitution
656         https://bugs.webkit.org/show_bug.cgi?id=141038
657
658         Reviewed by Tim Horton.
659
660         * Shared/API/c/WKDeprecatedFunctions.cpp:
661         (WKPreferencesSetScreenFontSubstitutionEnabled):
662         (WKPreferencesGetScreenFontSubstitutionEnabled):
663         Move now empty preferences SPI to WKDeprecatedFunctions.
664         
665         * Shared/WebPreferencesDefinitions.h:
666         * Shared/WebProcessCreationParameters.cpp:
667         (WebKit::WebProcessCreationParameters::WebProcessCreationParameters):
668         (WebKit::WebProcessCreationParameters::encode):
669         (WebKit::WebProcessCreationParameters::decode):
670         * Shared/WebProcessCreationParameters.h:
671         * UIProcess/API/C/WKPreferences.cpp:
672         (WKPreferencesSetScreenFontSubstitutionEnabled): Deleted.
673         (WKPreferencesGetScreenFontSubstitutionEnabled): Deleted.
674         * UIProcess/API/C/WKPreferencesRefPrivate.h:
675         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
676         (WebKit::WebProcessPool::platformInitializeWebProcess):
677         * WebProcess/WebPage/WebPage.cpp:
678         (WebKit::WebPage::updatePreferences):
679         * WebProcess/WebProcess.h:
680         (WebKit::WebProcess::presenterApplicationPid):
681         (WebKit::WebProcess::shouldForceScreenFontSubstitution): Deleted.
682         * WebProcess/cocoa/WebProcessCocoa.mm:
683         (WebKit::WebProcess::platformInitializeWebProcess):
684         Stop piping screen font substitution setting to the web process.
685
686 2015-01-29  Alexey Proskuryakov  <ap@apple.com>
687
688         Frequent kernel panics when running WebKit regression tests
689         https://bugs.webkit.org/show_bug.cgi?id=141043
690
691         Reviewed by Sam Weinig.
692
693         Split PluginService.Development into 32-bit and 64-bit variants, to better match
694         production variant. When building FAT, we'll have the right architecture from
695         the start now, so no need to re-exec into a different architecture.        
696
697         * Configurations/PluginService.Development.xcconfig: Removed.
698         * Configurations/PluginService.32.Development.xcconfig: Copied from Source/WebKit2/Configurations/PluginService.Development.xcconfig.
699         * Configurations/PluginService.64.Development.xcconfig: Copied from Source/WebKit2/Configurations/PluginService.Development.xcconfig.
700         Changed to use ONLY_ACTIVE_ARCH instead of CONFIGURATION, so that we build the
701         right thing even in debug FAT builds.
702
703         * Configurations/PluginService.32.xcconfig:
704         * Configurations/PluginService.64.xcconfig:
705         While at it, applied the same changes as in Development variants. This means that
706         FAT builds will now build only the correct architecture for PluginService.64
707         (it used to build FAT, unnecessarily).
708
709         * PluginProcess/EntryPoint/mac/XPCService/PluginService.Development/Info.plist:
710         Updated to support multiple product names.
711
712         * UIProcess/Launcher/mac/ProcessLauncherMac.mm: (WebKit::serviceName): Launch the
713         right development service.
714
715         * WebKit2.xcodeproj/project.pbxproj: Split the Plugin.Development target into two.
716
717 2015-01-29  Tim Horton  <timothy_horton@apple.com>
718
719         Fix the build with newer Clang
720
721         * NetworkProcess/NetworkConnectionToWebProcess.h:
722         These should be 'override's.
723
724 2015-01-29  Chris Dumez  <cdumez@apple.com>
725
726         Clean up / modernize PageCache class
727         https://bugs.webkit.org/show_bug.cgi?id=141009
728
729         Reviewed by Darin Adler.
730
731         Clean up / modernize PageCache class.
732
733         * WebProcess/WebPage/WebBackForwardListProxy.cpp:
734         (WebKit::WebBackForwardListProxy::removeItem):
735         (WebKit::WebBackForwardListProxy::close):
736         * WebProcess/WebPage/WebPage.cpp:
737         (WebKit::WebPage::goForward):
738         (WebKit::WebPage::goBack):
739         (WebKit::WebPage::goToBackForwardItem):
740         * WebProcess/WebProcess.cpp:
741         (WebKit::WebProcess::releasePageCache):
742         * WebProcess/cocoa/WebProcessCocoa.mm:
743         (WebKit::WebProcess::platformSetCacheModel):
744         * WebProcess/soup/WebProcessSoup.cpp:
745         (WebKit::WebProcess::platformSetCacheModel):
746
747 2015-01-29  Csaba Osztrogonác  <ossy@webkit.org>
748
749         [EFL][GTK] Fix the build after r179326
750         https://bugs.webkit.org/show_bug.cgi?id=141027
751
752         Reviewed by Alexey Proskuryakov.
753
754         Guard MessageRecorder implementation with USE(DTRACE)
755         for platforms not supporting DTrace.
756
757         Original patch by Carlos Garcia Campos <cgarcia@igalia.com>
758
759         * Platform/IPC/ArgumentCoders.cpp:
760         * Platform/IPC/ArgumentCoders.h:
761         * Platform/IPC/Connection.cpp:
762         (IPC::Connection::dispatchWorkQueueMessageReceiverMessage):
763         (IPC::Connection::sendMessage):
764         (IPC::Connection::sendSyncMessage):
765         (IPC::Connection::sendSyncMessageFromSecondaryThread):
766         (IPC::Connection::dispatchSyncMessage):
767         (IPC::Connection::dispatchMessage):
768         * Platform/IPC/MessageDecoder.cpp:
769         (IPC::MessageDecoder::MessageDecoder):
770         * Platform/IPC/MessageDecoder.h:
771         * Platform/IPC/MessageEncoder.cpp:
772         (IPC::MessageEncoder::MessageEncoder):
773         (IPC::MessageEncoder::encodeHeader):
774         * Platform/IPC/MessageEncoder.h:
775         * Platform/IPC/MessageRecorder.h:
776
777 2015-01-29  Tim Horton  <timothy_horton@apple.com>
778
779         Avoid manually handling quickLookWithEvent: if the immediate action gesture recognizer will do Lookup for us
780         https://bugs.webkit.orgshow_bug.cgi?id=141018
781         <rdar://problem/19619999>
782
783         * UIProcess/API/mac/WKView.mm:
784         (-[WKView quickLookWithEvent:]):
785         Yosemite is 101000, not 10100.
786
787 2015-01-28  Tim Horton  <timothy_horton@apple.com>
788
789         Add API::{FrameInfo, NavigationAction, NavigationResponse} types
790         https://bugs.webkit.org/show_bug.cgi?id=140982
791
792         Reviewed by Sam Weinig.
793
794         Make C++ API objects for WK{FrameInfo, NavigationAction, NavigationResponse}
795         to wrap around, as a step towards moving Modern API logic down into WebPageProxy.
796
797         * Shared/API/APIObject.h:
798         * Shared/Cocoa/APIObject.mm:
799         (API::Object::newObject):
800         * UIProcess/API/APIFrameInfo.cpp: Added.
801         * UIProcess/API/APIFrameInfo.h: Added.
802         * UIProcess/API/APINavigationAction.h: Added.
803         * UIProcess/API/APINavigationResponse.h: Added.
804         Add API::FrameInfo, API::NavigationAction, and API::NavigationResponse.
805
806         * UIProcess/API/Cocoa/WKFrameInfo.mm:
807         * UIProcess/API/Cocoa/WKFrameInfoInternal.h:
808         Make WKFrameInfo a WKObject, wrapping a API::FrameInfo.
809
810         * UIProcess/API/Cocoa/WKNavigationAction.mm:
811         * UIProcess/API/Cocoa/WKNavigationActionInternal.h:
812         Make WKNavigationAction a WKObject, wrapping a API::NavigationAction.
813
814         * UIProcess/API/Cocoa/WKNavigationResponse.mm:
815         * UIProcess/API/Cocoa/WKNavigationResponseInternal.h:
816         Make WKNavigationResponse a WKObject, wrapping a API::NavigationResponse.
817
818         * UIProcess/API/Cocoa/WKUserContentController.mm:
819         Adopt API::FrameInfo.
820
821         * UIProcess/Cocoa/NavigationState.mm:
822         (WebKit::NavigationState::PolicyClient::decidePolicyForNavigationAction):
823         Adopt API::FrameInfo, and reorganize the code slightly.
824         Adopt API::NavigationAction.
825
826         (WebKit::NavigationState::PolicyClient::decidePolicyForResponse):
827         Adopt API::FrameInfo.
828         Adopt API::NavigationResponse.
829
830         (WebKit::NavigationState::LoaderClient::didFailProvisionalLoadWithErrorForFrame):
831         Adopt API::FrameInfo.
832
833         * UIProcess/Cocoa/UIDelegate.mm:
834         (WebKit::UIDelegate::UIClient::createNewPage):
835         (WebKit::UIDelegate::UIClient::runJavaScriptAlert):
836         (WebKit::UIDelegate::UIClient::runJavaScriptConfirm):
837         (WebKit::UIDelegate::UIClient::runJavaScriptPrompt):
838         Adopt API::FrameInfo.
839
840         * WebKit2.xcodeproj/project.pbxproj:
841
842 2015-01-28  Antti Koivisto  <antti@apple.com>
843
844         http/tests/xmlhttprequest/workers/methods.html sometimes times out with disk cache enabled
845         https://bugs.webkit.org/show_bug.cgi?id=140976
846
847         Reviewed by Chris Dumez.
848
849         The previous fix sometimes invoked the completion handler twice. Explicitly track if we
850         have called it or not.
851
852         * NetworkProcess/cache/NetworkCacheStorageCocoa.mm:
853         (WebKit::NetworkCacheStorage::dispatchRetrieveOperation):
854
855         Also move the error case to the done branch. According to the documentation 'done' is always set on error.
856
857 2015-01-28  Timothy Horton  <timothy_horton@apple.com>
858
859         Add a WebKitMessageRecorder DTrace provider, exposing IPC details to DTrace
860         https://bugs.webkit.org/show_bug.cgi?id=140673
861
862         Reviewed by Sam Weinig.
863
864         * Platform/IPC/ArgumentCoders.cpp:
865         (IPC::ArgumentCoder<uuid_t>::encode):
866         (IPC::ArgumentCoder<uuid_t>::decode):
867         * Platform/IPC/ArgumentCoders.h:
868         Add a uuid_t (simple) argument coder.
869         Fix a mis-named header-guard #ifdef.
870
871         * Platform/IPC/Connection.cpp:
872         (IPC::Connection::dispatchWorkQueueMessageReceiverMessage):
873         (IPC::Connection::dispatchSyncMessage):
874         Sync message replies inherit the message UUID from the incoming sync message.
875
876         (IPC::Connection::sendMessage):
877         (IPC::Connection::waitForMessage):
878         (IPC::Connection::sendSyncMessage):
879         (IPC::Connection::sendSyncMessageFromSecondaryThread):
880         Record outgoing messages. Because sendSyncMessage calls sendMessage,
881         we have to explicitly avoid recording the message twice.
882
883         (IPC::Connection::dispatchMessage):
884         Record the incoming message.
885
886         (IPC::Connection::remoteProcessID):
887         Add remoteProcessID(), which tries to determine the pid of the remote process.
888
889         * Platform/IPC/Connection.h:
890         (IPC::Connection::xpcConnection):
891         This can be const.
892
893         (IPC::Connection::isValid):
894         Make this public.
895
896         * Platform/IPC/MessageDecoder.cpp:
897         (IPC::MessageDecoder::MessageDecoder):
898         * Platform/IPC/MessageDecoder.h:
899         (IPC::MessageDecoder::setMessageProcessingToken):
900         (IPC::MessageDecoder::UUID):
901         Decode and store the message UUID.
902         Store a MessageProcessingToken for the lifetime of the MessageDecoder;
903         this ensures that all time spent processing the incoming message will be
904         counted against that message.
905
906         * Platform/IPC/MessageEncoder.cpp:
907         (IPC::MessageEncoder::MessageEncoder):
908         By default, create a new UUID for the message. Alternatively, allow clients
909         to pass the message UUID in (used for sync message replies).
910         Store the messageReceiverName and messageName.
911
912         (IPC::MessageEncoder::encodeHeader):
913         Factor encodeHeader() out of the constructors so most of their code can be shared.
914
915         (IPC::MessageEncoder::isSyncMessage):
916         (IPC::MessageEncoder::shouldDispatchMessageWhenWaitingForSyncReply):
917         Add getters for these flags.
918
919         * Platform/IPC/MessageEncoder.h:
920         (IPC::MessageEncoder::messageReceiverName):
921         (IPC::MessageEncoder::messageName):
922         (IPC::MessageEncoder::destinationID):
923         (IPC::MessageEncoder::UUID):
924
925         * Platform/IPC/MessageRecorder.h: Added.
926         * Platform/IPC/MessageRecorder.cpp: Added.
927         (MessageRecorder::MessageRecorder):
928         Add a class that interfaces with a custom DTrace provider to log incoming and outgoing messages.
929
930         (MessageRecorder::shared):
931         (MessageRecorder::isEnabled):
932         Determine if either of the message probes are enabled. If not, we'll avoid most of the
933         work associated with MessageRecorder.
934
935         (MessageRecorder::recordOutgoingMessage):
936         (MessageRecorder::recordIncomingMessage):
937         Build a WebKitMessageRecord and MessageProcessingToken from the Message(De|En)coder.
938         Once the MessageProcessingToken is deallocated, the probe will be invoked with the WebKitMessageRecord.
939
940         (MessageRecorder::MessageProcessingToken::MessageProcessingToken):
941         (MessageRecorder::MessageProcessingToken::~MessageProcessingToken):
942         Keep track of when the token is created and destroyed; these are considered the beginning
943         and ending "processing" times of the message (and as such the token should be kept alive for
944         exactly as long as the message is being processed).
945
946         * Platform/IPC/MessageRecorderProbes.d: Added.
947         Add a DTrace provider source file with two probes, message_sent and message_received.
948         The struct must match the struct in MessageRecorder.h.
949         
950         * Platform/IPC/ProcessType.h: Added.
951         Add an enum of process types.
952
953         * WebKit2.xcodeproj/project.pbxproj:
954
955         * DatabaseProcess/DatabaseProcess.h:
956         * DatabaseProcess/DatabaseToWebProcessConnection.h:
957         * NetworkProcess/NetworkConnectionToWebProcess.h:
958         * NetworkProcess/NetworkProcess.h:
959         * WebProcess/Databases/WebToDatabaseProcessConnection.h:
960         * WebProcess/Network/NetworkProcessConnection.h:
961         * WebProcess/Plugins/PluginProcessConnection.h:
962         * WebProcess/WebPage/WebInspector.h:
963         * WebProcess/WebPage/WebInspectorUI.h:
964         * WebProcess/WebProcess.h:
965         * UIProcess/Databases/DatabaseProcessProxy.h:
966         * UIProcess/Network/NetworkProcessProxy.h:
967         * UIProcess/Plugins/PluginProcessProxy.h:
968         * UIProcess/WebProcessProxy.h:
969         * PluginProcess/PluginProcess.h:
970         * PluginProcess/WebProcessConnection.h:
971         Annotate Connection::Clients with process types.
972         
973 2015-01-28  Joseph Pecoraro  <pecoraro@apple.com>
974
975         Web Inspector: Crash closing inspected page with frequent activity
976         https://bugs.webkit.org/show_bug.cgi?id=140973
977
978         Reviewed by Timothy Hatcher.
979
980         * WebProcess/WebPage/WebInspector.h:
981         (WebKit::WebInspector::disconnectFromPage):        
982         * WebProcess/WebPage/WebPage.cpp:
983         (WebKit::WebPage::close):
984         Be sure to close the WebInspector connection through the page
985         when the page is closing so that the WebKit::WebInspector is
986         relinquishes itself as the InspectorFrontendChannel.
987
988 2015-01-28  Timothy Horton  <timothy_horton@apple.com>
989
990         Avoid manually handling quickLookWithEvent: if the immediate action gesture recognizer will do Lookup for us
991         https://bugs.webkit.org/show_bug.cgi?id=141018
992         <rdar://problem/19619999>
993
994         Reviewed by Beth Dakin.
995
996         * UIProcess/API/mac/WKView.mm:
997         (-[WKView quickLookWithEvent:]):
998         If we have an immediate action gesture recognizer, just call super and
999         avoid WebKit's special quickLookWithEvent: implementation.
1000
1001 2015-01-28  Sungmann Cho  <sungmann.cho@navercorp.com>
1002
1003         Remove remaining PLATFORM(WIN) code blocks from WebKit2.
1004         https://bugs.webkit.org/show_bug.cgi?id=140972
1005
1006         Reviewed by Darin Adler.
1007
1008         * WebProcess/Cookies/cf/WebCookieManagerCFNet.cpp:
1009         (WebKit::WebCookieManager::platformSetHTTPCookieAcceptPolicy):
1010
1011 2015-01-28  Beth Dakin  <bdakin@apple.com>
1012
1013         Remove Mountain Lion code from WebKit and WebKit2
1014         https://bugs.webkit.org/show_bug.cgi?id=141010
1015
1016         Reviewed by Sam Weinig.
1017
1018         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
1019         * PluginProcess/EntryPoint/mac/LegacyProcess/PluginProcessMain.mm:
1020         * Shared/mac/ChildProcessMac.mm:
1021         (WebKit::ChildProcess::initializeSandbox):
1022         * Shared/mac/WebEventFactory.mm:
1023         (WebKit::phaseForEvent):
1024         * UIProcess/API/mac/WKView.mm:
1025         (-[WKView quickLookWithEvent:]):
1026         (-[WKView updateLayer]):
1027         (-[WKView createFullScreenWindow]):
1028         * UIProcess/Network/NetworkProcessProxy.cpp:
1029         (WebKit::NetworkProcessProxy::didFinishLaunching):
1030         * UIProcess/Network/mac/NetworkProcessProxyMac.mm:
1031         (WebKit::shouldUseXPC):
1032         * UIProcess/WebProcessProxy.cpp:
1033         (WebKit::WebProcessProxy::didFinishLaunching):
1034         * UIProcess/mac/PageClientImpl.mm:
1035         (WebKit::PageClientImpl::isViewVisible):
1036         * WebKit2Prefix.h:
1037         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
1038         (InitWebCoreSystemInterface):
1039         * WebProcess/com.apple.WebProcess.sb.in:
1040
1041 2015-01-28  Joseph Pecoraro  <pecoraro@apple.com>
1042
1043         Web Inspector: Crash when closing inspected page
1044         https://bugs.webkit.org/show_bug.cgi?id=140968
1045
1046         Reviewed by Timothy Hatcher.
1047
1048         Handle cases where the corePage could be null. With the Inspector Process
1049         in its own process, messages may come to the WebContentProcess after
1050         the WebCore::Page has itself been destroyed.
1051
1052         * WebProcess/WebPage/WebInspector.cpp:
1053         (WebKit::WebInspector::show):
1054         (WebKit::WebInspector::close):
1055         (WebKit::WebInspector::openInNewTab):
1056         (WebKit::WebInspector::evaluateScriptForTest):
1057         (WebKit::WebInspector::showConsole):
1058         (WebKit::WebInspector::showResources):
1059         (WebKit::WebInspector::showMainResourceForFrame):
1060         (WebKit::WebInspector::startPageProfiling):
1061         (WebKit::WebInspector::stopPageProfiling):
1062         (WebKit::WebInspector::canAttachWindow):
1063         (WebKit::WebInspector::sendMessageToBackend):
1064         (WebKit::WebInspector::remoteFrontendConnected):
1065         (WebKit::WebInspector::remoteFrontendDisconnected):
1066
1067 2015-01-28  Sam Weinig  <sam@webkit.org>
1068
1069         Convert WebPreferences and VisitedLinkProvider to be bridged API::Objects
1070         https://bugs.webkit.org/show_bug.cgi?id=141002
1071
1072         Reviewed by Tim Horton.
1073
1074         * Shared/API/APIObject.h:
1075         Add VisitedLinkProvider type.
1076         
1077         * Shared/Cocoa/APIObject.mm:
1078         (API::Object::newObject):
1079         Allocate WebPreferences and VisitedLinkProvider as their Objective-C counterpart.
1080         
1081         * UIProcess/API/Cocoa/WKPreferences.mm:
1082         (-[WKPreferences init]):
1083         Switch to constructInWrapper.
1084
1085         (-[WKPreferences dealloc]):
1086         Call the WebPreferences destructor.
1087         
1088         (-[WKPreferences _apiObject]):
1089         Add implementation of the WKObject protocol.
1090
1091         * UIProcess/API/Cocoa/WKPreferencesInternal.h:
1092         Convert to using ObjectStorage.
1093
1094         * UIProcess/API/Cocoa/_WKVisitedLinkProvider.mm:
1095         (-[_WKVisitedLinkProvider init]):
1096         Switch to constructInWrapper.
1097
1098         (-[_WKVisitedLinkProvider dealloc]):
1099         Call the VisitedLinkProvider destructor.
1100
1101         (-[_WKVisitedLinkProvider _apiObject]):
1102         Add implementation of the WKObject protocol.
1103
1104         * UIProcess/API/Cocoa/_WKVisitedLinkProviderInternal.h:
1105         Convert to using ObjectStorage.
1106
1107         * UIProcess/VisitedLinkProvider.cpp:
1108         (WebKit::VisitedLinkProvider::create):
1109         * UIProcess/VisitedLinkProvider.h:
1110         Switch create() to return a Ref.
1111
1112         * UIProcess/WebPreferences.h:
1113         Make the constructor public for use by constructInWrapper.
1114
1115         * UIProcess/WebProcessPool.cpp:
1116         (WebKit::WebProcessPool::createWebPage):
1117         * UIProcess/WebProcessPool.h:
1118         Store the VisitedLinkProvider in a Ref.
1119
1120 2015-01-28  Dana Burkart  <dburkart@apple.com>
1121
1122         Move ASan flag settings from DebugRelease.xcconfig to Base.xcconfig
1123         https://bugs.webkit.org/show_bug.cgi?id=136765
1124
1125         Reviewed by Alexey Proskuryakov.
1126
1127         * Configurations/Base.xcconfig:
1128         * Configurations/DebugRelease.xcconfig:
1129
1130 2015-01-28  Chris Dumez  <cdumez@apple.com>
1131
1132         Fix typo in markPagesForVistedLinkStyleRecalc()
1133         https://bugs.webkit.org/show_bug.cgi?id=140977
1134
1135         Reviewed by Darin Adler.
1136
1137         * WebProcess/WebPage/VisitedLinkTableController.cpp:
1138         (WebKit::VisitedLinkTableController::setVisitedLinkTable):
1139         (WebKit::VisitedLinkTableController::visitedLinkStateChanged):
1140         (WebKit::VisitedLinkTableController::allVisitedLinkStateChanged):
1141         (WebKit::VisitedLinkTableController::removeAllVisitedLinks):
1142
1143 2015-01-27  Antti Koivisto  <antti@apple.com>
1144
1145         http/tests/xmlhttprequest/workers/methods.html sometimes times out with disk cache enabled
1146         https://bugs.webkit.org/show_bug.cgi?id=140976
1147
1148         Reviewed by Chris Dumez.
1149
1150         Running
1151
1152             run-webkit-tests --release -2 http/tests/xmlhttprequest/workers/methods.html --iterations=100
1153
1154         would usually time out an iteration.
1155
1156         * NetworkProcess/cache/NetworkCacheStorageCocoa.mm:
1157         (WebKit::NetworkCacheStorage::dispatchRetrieveOperation):
1158
1159         Using dispatch_io_read with an empty file calls the handler block immediately with done boolean set
1160         without it being an error. We failed to call the completion handler and any synchronous xhr would hang.
1161         We may see an empty cache file if we are just in process of writing it.
1162
1163         Fix by handling this case specifically.
1164
1165 2015-01-28  Carlos Garcia Campos  <cgarcia@igalia.com>
1166
1167         Unreviewed. Add missing file to WebInspector compilation for GTK+.
1168
1169         * PlatformGTK.cmake: Add UserInterface/External/ESLint/eslint.js
1170
1171 2015-01-28  Chris Dumez  <cdumez@apple.com>
1172
1173         Rename pageCache() to PageCache::shared() and return a reference
1174         https://bugs.webkit.org/show_bug.cgi?id=140983
1175
1176         Reviewed by Andreas Kling.
1177
1178         Rename pageCache() to PageCache::shared() as this is a singleton class
1179         and have it return a reference instead of a pointer.
1180
1181         * WebProcess/WebPage/VisitedLinkTableController.cpp:
1182         (WebKit::VisitedLinkTableController::setVisitedLinkTable):
1183         (WebKit::VisitedLinkTableController::visitedLinkStateChanged):
1184         (WebKit::VisitedLinkTableController::allVisitedLinkStateChanged):
1185         (WebKit::VisitedLinkTableController::removeAllVisitedLinks):
1186         * WebProcess/WebPage/WebBackForwardListProxy.cpp:
1187         (WebKit::WebBackForwardListProxy::removeItem):
1188         (WebKit::WebBackForwardListProxy::close):
1189         * WebProcess/WebProcess.cpp:
1190         (WebKit::WebProcess::releasePageCache):
1191         * WebProcess/cocoa/WebProcessCocoa.mm:
1192         (WebKit::WebProcess::platformSetCacheModel):
1193         * WebProcess/soup/WebProcessSoup.cpp:
1194         (WebKit::WebProcess::platformSetCacheModel):
1195
1196 2015-01-27  Alexey Proskuryakov  <ap@apple.com>
1197
1198         More build fixes for newer clang.
1199
1200         Rubber-stamped by Anders Carlsson.
1201
1202         Added missing override keywords, marked some deprecated accessibility methods as such.
1203
1204         * PluginProcess/EntryPoint/mac/LegacyProcess/PluginProcessMain.mm:
1205         (WebKit::PluginProcessMainDelegate::doPreInitializationWork): Deleted.
1206         (WebKit::PluginProcessMainDelegate::getExtraInitializationData): Deleted.
1207         (WebKit::PluginProcessMainDelegate::doPostRunWork): Deleted.
1208         * PluginProcess/WebProcessConnection.h:
1209         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1210         (WebKit::WebProcessPool::platformInitializeWebProcess):
1211         * UIProcess/Plugins/PluginProcessProxy.h:
1212         * UIProcess/WebPageProxy.h:
1213         * UIProcess/mac/PageClientImpl.h:
1214         * WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:
1215         (PageOverlayClientImpl::actionContextForResultAtPoint): Deleted.
1216         (PageOverlayClientImpl::dataDetectorsDidPresentUI): Deleted.
1217         (PageOverlayClientImpl::dataDetectorsDidChangeUI): Deleted.
1218         (PageOverlayClientImpl::dataDetectorsDidHideUI): Deleted.
1219         * WebProcess/Plugins/Netscape/NetscapePlugin.h:
1220         (WebKit::NetscapePlugin::isBeingAsynchronouslyInitialized): Deleted.
1221         * WebProcess/Plugins/PDF/PDFPlugin.h:
1222         * WebProcess/Plugins/PluginProcessConnection.h:
1223         * WebProcess/Plugins/PluginProxy.h:
1224         (WebKit::PluginProxy::isBeingAsynchronouslyInitialized): Deleted.
1225         * WebProcess/WebCoreSupport/WebContextMenuClient.h:
1226
1227 2015-01-27  Beth Dakin  <bdakin@apple.com>
1228
1229         Immediate action gesture recognizer still doesn't work well with IB
1230         https://bugs.webkit.org/show_bug.cgi?id=140967
1231         -and corresponding-
1232         rdar://problem/19621509
1233
1234         Reviewed by Tim Horton.
1235
1236         We should add (or remove) the gesture recognizer in viewDidMoveToWindow because 
1237         initWithFrame it too early and IB might mess with it.
1238         * UIProcess/API/mac/WKView.mm:
1239         (-[WKView viewDidMoveToWindow]):
1240         (-[WKView initWithFrame:processPool:configuration:webView:]):
1241
1242 2015-01-27  Beth Dakin  <bdakin@apple.com>
1243
1244         Invoking an immediate action on link often dismisses selection
1245         https://bugs.webkit.org/show_bug.cgi?id=140911
1246         -and corresponding-
1247         rdar://problem/19572685
1248
1249         Reviewed by Tim Horton.
1250
1251         Calling _page->setMaintainsInactiveSelection(false) in complete is often 
1252         too soon. Instead, call it in dismissContentRelativeChildWindows. This is more 
1253         similar to the timing for the TextIndicator.
1254         * UIProcess/mac/WKImmediateActionController.mm:
1255         (-[WKImmediateActionController dismissContentRelativeChildWindows]):
1256         (-[WKImmediateActionController immediateActionRecognizerWillPrepare:]):
1257         (-[WKImmediateActionController immediateActionRecognizerDidCompleteAnimation:]):
1258
1259 2015-01-27  Carlos Garcia Campos  <cgarcia@igalia.com>
1260
1261         REGRESSION(r166975): [GTK] Page overlays are not drawn anymore after r166975
1262         https://bugs.webkit.org/show_bug.cgi?id=131433
1263
1264         Reviewed by Žan Doberšek.
1265
1266         Implement page overlays for the GTK+ port.
1267
1268         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
1269         Override pure virtual setViewOverlayRootLayer().
1270         * WebProcess/WebPage/DrawingAreaImpl.cpp:
1271         (WebKit::DrawingAreaImpl::display): Remove FIXME and use modern
1272         for loop.
1273         (WebKit::DrawingAreaImpl::attachViewOverlayGraphicsLayer): Remove
1274         ifdefs and use LayerTreeHost::setViewOverlayRootLayer().
1275         * WebProcess/WebPage/LayerTreeHost.h: Add pure virtual setViewOverlayRootLayer().
1276         * WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp:
1277         (WebKit::LayerTreeHostGtk::LayerTreeHostGtk): Initialize m_viewOverlayRootLayer.
1278         (WebKit::LayerTreeHostGtk::initialize): Remove FIXME.
1279         (WebKit::LayerTreeHostGtk::setNonCompositedContentsNeedDisplay):
1280         Remove unused old page overlays code.
1281         (WebKit::LayerTreeHostGtk::setNonCompositedContentsNeedDisplayInRect): Ditto.
1282         (WebKit::LayerTreeHostGtk::sizeDidChange): Ditto.
1283         (WebKit::LayerTreeHostGtk::paintContents): Remove FIXME.
1284         (WebKit::LayerTreeHostGtk::flushPendingLayerChanges): Flush
1285         compositing state on m_pageOverlayLayers if present.
1286         (WebKit::LayerTreeHostGtk::setViewOverlayRootLayer): Set m_pageOverlayLayers.
1287         (WebKit::LayerTreeHostGtk::createPageOverlayLayer): Deleted.
1288         (WebKit::LayerTreeHostGtk::destroyPageOverlayLayer): Deleted.
1289         * WebProcess/WebPage/gtk/LayerTreeHostGtk.h: Remove unused old
1290         page overlays code.
1291
1292 2015-01-27  Sungmann Cho  <sungmann.cho@navercorp.com>
1293
1294         Remove remaining PLUGIN_ARCHITECTURE(WIN) code blocks from WebKit2.
1295         https://bugs.webkit.org/show_bug.cgi?id=140912
1296
1297         Reviewed by Anders Carlsson.
1298
1299         * Shared/Plugins/Netscape/NetscapePluginModule.cpp:
1300         (WebKit::NetscapePluginModule::tryLoad):
1301         * Shared/Plugins/PluginQuirks.h:
1302         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
1303         (WebKit::NetscapePlugin::userAgent):
1304         * WebProcess/Plugins/Netscape/NetscapePlugin.h:
1305
1306 2015-01-26  Simon Fraser  <simon.fraser@apple.com>
1307
1308         [iOS WK2] Fix possible crash when -[WKWebView evaluateJavaScript:completionHandler:] was called then the WKWebView is destroyed
1309         https://bugs.webkit.org/show_bug.cgi?id=140203
1310         rdar://problem/19198492
1311
1312         Reviewed by Sam Weinig.
1313         
1314         When handling the OwnerWasInvalidated case in -[WKWebView evaluateJavaScript:completionHandler:],
1315         the block passed to dispatch_async() needs to be retained. Fix by passing the RefPtr
1316         to the lambda.
1317
1318         * UIProcess/API/Cocoa/WKWebView.mm:
1319         (-[WKWebView evaluateJavaScript:completionHandler:]):
1320
1321 2015-01-26  Chris Dumez  <cdumez@apple.com>
1322
1323         Rename Document::body() to Document::bodyOrFrameset() for clarity
1324         https://bugs.webkit.org/show_bug.cgi?id=140902
1325
1326         Reviewed by Andreas Kling.
1327
1328         Rename Document::body() to Document::bodyOrFrameset() for clarity. This
1329         method does not necessarily return an HTMLBodyElement, it can also
1330         return a frameset as per the specification:
1331         http://www.w3.org/TR/html5/dom.html#dom-tree-accessors
1332
1333         This method is often misused internally (the caller is only interested
1334         in the <body> element). I will fix these instances in a follow-up patch,
1335         this patch is only renaming mechanically.
1336
1337 2015-01-26  Antti Koivisto  <antti@apple.com>
1338
1339         Add a user default for disabling network cache
1340         https://bugs.webkit.org/show_bug.cgi?id=140904
1341
1342         Reviewed by Andreas Kling
1343
1344         defaults write com.apple.Safari WebKitNetworkCacheEnabled -bool YES/NO
1345
1346         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
1347         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
1348         * Shared/Network/NetworkProcessCreationParameters.cpp:
1349         (WebKit::NetworkProcessCreationParameters::encode):
1350         (WebKit::NetworkProcessCreationParameters::decode):
1351         * Shared/Network/NetworkProcessCreationParameters.h:
1352         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1353         (WebKit::registerUserDefaultsIfNeeded):
1354         (WebKit::WebProcessPool::platformInitializeWebProcess):
1355         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
1356
1357 2015-01-26  Chris Dumez  <cdumez@apple.com>
1358
1359         First argument to DOM traversal functions should be a reference
1360         https://bugs.webkit.org/show_bug.cgi?id=140895
1361
1362         Reviewed by Antti Koivisto.
1363
1364         First argument to DOM traversal functions should be a reference instead
1365         of a pointer as it is dereferenced without null-check.
1366
1367 2015-01-26  Beth Dakin  <bdakin@apple.com>
1368
1369         Blacklist iBooks for WebKit's default immediate actions
1370         https://bugs.webkit.org/show_bug.cgi?id=140854
1371         -and corresponding-
1372         rdar://problem/19489518
1373
1374         Reviewed by Tim Horton.
1375
1376         Blacklist iBooks.
1377         * UIProcess/mac/WKImmediateActionController.mm:
1378         (-[WKImmediateActionController _updateImmediateActionItem]):
1379
1380 2015-01-26  Myles C. Maxfield  <mmaxfield@apple.com>
1381
1382         [iOS] [SVG -> OTF Converter] Flip the switch off on iOS
1383         https://bugs.webkit.org/show_bug.cgi?id=140860
1384
1385         Reviewed by Darin Adler.
1386
1387         The fonts it makes are grotesque. (See what I did there? Typographic
1388         humor is the best humor.)
1389
1390         * Configurations/FeatureDefines.xcconfig:
1391
1392 2015-01-26  Fabien Vallée  <fvallee@connected-labs.com>
1393
1394         AX: crash in accessibilityRootObjectWrapper method (WebPageAccessibilityObjectAtk.cpp)
1395         <https://bugs.webkit.org/show_bug.cgi?id=140618>
1396
1397         Reviewed by Chris Fleizach.
1398
1399         Check if document()->axObjectCache() is nullptr to fix the crash.
1400         Similar patch has been applied on mac port:
1401         <http://trac.webkit.org/changeset/167136>
1402
1403         Crash occured on <http://itv.mit-xperts.com/hbbtvtest/appmanager/>
1404         (this page needs CEHTML / HbbTV extensions, conditions cannot
1405         be reproduced using regression tests)
1406
1407         * WebProcess/WebPage/atk/WebPageAccessibilityObjectAtk.cpp:
1408         (accessibilityRootObjectWrapper):
1409
1410 2015-01-26  Michael Catanzaro  <mcatanzaro@igalia.com>
1411
1412         [GTK] gtkdoc does not appear in DevHelp
1413         https://bugs.webkit.org/show_bug.cgi?id=139369
1414
1415         Reviewed by Philippe Normand.
1416
1417         * PlatformGTK.cmake: Include the API version in the gtkdoc filenames.
1418         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: Renamed from Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-sections.txt.
1419         * UIProcess/API/gtk/docs/webkit2gtk-4.0.types: Renamed from Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk.types.
1420
1421 2015-01-25  Timothy Horton  <timothy_horton@apple.com>
1422
1423         Unresponsive Web processes sometimes throw ObjC exceptions under didPerformActionMenuHitTest:
1424         https://bugs.webkit.org/show_bug.cgi?id=140859
1425         <rdar://problem/19571057>
1426
1427         Reviewed by Darin Adler.
1428
1429         * UIProcess/mac/WKImmediateActionController.mm:
1430         (-[WKImmediateActionController didPerformActionMenuHitTest:userData:]):
1431         If we've already given up on this gesture (either because it was canceled or the
1432         willBeginAnimation timeout expired), we shouldn't build a new animationController for it.
1433         This is true both because it wouldn't look good to swap animationControllers out
1434         from under the gesture, but also because AppKit throws an exception when you do this
1435         and that breaks a lot of things.
1436
1437 2015-01-24  Chris Dumez  <cdumez@apple.com>
1438
1439         [WK2][Cocoa] Drop WKDiagnosticLoggingResultType defines
1440         https://bugs.webkit.org/show_bug.cgi?id=140838
1441
1442         Reviewed by Sam Weinig.
1443
1444         Drop WKDiagnosticLoggingResultType defines in _WKDiagnosticLoggingDelegate.h
1445         header now that the client-side is correctly using
1446         _WKDiagnosticLoggingResultType instead.
1447
1448         * UIProcess/API/Cocoa/_WKDiagnosticLoggingDelegate.h:
1449
1450 2015-01-23  Antti Koivisto  <antti@apple.com>
1451
1452         Implement cache size limit
1453         https://bugs.webkit.org/show_bug.cgi?id=140844
1454
1455         Reviewed by Andreas Kling.
1456
1457         Prevent the cache from growing without bounds. The simple scheme implemented here
1458         estimates the cache size from number of entries. When the estimated size exceeds
1459         the maximum size we randomly clear 1/4 of the entries.
1460
1461         * NetworkProcess/cache/NetworkCacheStorage.h:
1462         * NetworkProcess/cache/NetworkCacheStorageCocoa.mm:
1463         (WebKit::NetworkCacheStorage::NetworkCacheStorage):
1464         (WebKit::NetworkCacheStorage::initialize):
1465         (WebKit::NetworkCacheStorage::removeEntry):
1466         (WebKit::NetworkCacheStorage::store):
1467         (WebKit::NetworkCacheStorage::setMaximumSize):
1468         (WebKit::NetworkCacheStorage::clear):
1469         (WebKit::NetworkCacheStorage::shrinkIfNeeded):
1470         (WebKit::NetworkCacheStorage::initializeKeyFilter): Deleted.
1471
1472 2015-01-23  Timothy Horton  <timothy_horton@apple.com>
1473
1474         Fix the pre-Yosemite build.
1475
1476         * UIProcess/API/mac/WKView.mm:
1477         (-[WKView _dismissContentRelativeChildWindows]):
1478
1479 2015-01-23  Timothy Horton  <timothy_horton@apple.com>
1480
1481         QLPreviewMenuItem popovers don't close when the page scrolls
1482         https://bugs.webkit.org/show_bug.cgi?id=140806
1483         <rdar://problem/19555618>
1484
1485         Reviewed by Beth Dakin.
1486
1487         Now that QLPreviewMenuItem's popover doesn't eat scrolls, we need to dismiss it if the page scrolls.
1488
1489         * UIProcess/API/mac/WKView.mm:
1490         (-[WKView _dismissContentRelativeChildWindows]):
1491         Send _dismissContentRelativeChildWindows on to WKImmediateActionController.
1492
1493         * UIProcess/mac/WKImmediateActionController.h:
1494         * UIProcess/mac/WKImmediateActionController.mm:
1495         (-[WKImmediateActionController _clearImmediateActionState]):
1496         (-[WKImmediateActionController dismissContentRelativeChildWindows]):
1497         (-[WKImmediateActionController _defaultAnimationController]):
1498         Keep track of the active QLPreviewMenuItem, and close it upon scroll.
1499
1500 2015-01-23  Timothy Horton  <timothy_horton@apple.com>
1501
1502         Infinite recursion in _clearImmediateActionState
1503         https://bugs.webkit.org/show_bug.cgi?id=140807
1504         <rdar://problem/19571601>
1505
1506         Reviewed by Anders Carlsson.
1507
1508         * UIProcess/mac/WKImmediateActionController.mm:
1509         (-[WKImmediateActionController _clearImmediateActionState]):
1510         Clear _hasActivatedActionContext before calling didUseActions, because
1511         didUseActions can call _clearImmediateActionState.
1512
1513 2015-01-23  Carlos Garcia Campos  <cgarcia@igalia.com>
1514
1515         [GTK] Add initial database process support
1516         https://bugs.webkit.org/show_bug.cgi?id=139491
1517
1518         Reviewed by Sergio Villar Senin.
1519
1520         Add initial support for DatabaseProcess, disabled by default for
1521         now.
1522
1523         * CMakeLists.txt: Add required files to compilation.
1524         * DatabaseProcess/DatabaseProcess.cpp:
1525         (WebKit::DatabaseProcess::createDatabaseToWebProcessConnection):
1526         Add the unix domain sockets implementation.
1527         * DatabaseProcess/EntryPoint/unix/DatabaseProcessMain.cpp: Added.
1528         (main):
1529         * DatabaseProcess/gtk/DatabaseProcessMainGtk.cpp: Added.
1530         (WebKit::DatabaseProcessMainUnix):
1531         * DatabaseProcess/unix/DatabaseProcessMainUnix.h: Added.
1532         * PlatformGTK.cmake: Add required files to compilation.
1533         * Shared/ProcessExecutablePath.h:
1534         * Shared/gtk/KeyedDecoder.cpp: Added.
1535         (WebKit::KeyedDecoder::KeyedDecoder):
1536         (WebKit::KeyedDecoder::~KeyedDecoder):
1537         (WebKit::KeyedDecoder::buildDictionaryFromGVariant):
1538         (WebKit::KeyedDecoder::decodeBytes):
1539         (WebKit::KeyedDecoder::decodeBool):
1540         (WebKit::KeyedDecoder::decodeUInt32):
1541         (WebKit::KeyedDecoder::decodeInt32):
1542         (WebKit::KeyedDecoder::decodeInt64):
1543         (WebKit::KeyedDecoder::decodeFloat):
1544         (WebKit::KeyedDecoder::decodeDouble):
1545         (WebKit::KeyedDecoder::decodeString):
1546         (WebKit::KeyedDecoder::beginObject):
1547         (WebKit::KeyedDecoder::endObject):
1548         (WebKit::KeyedDecoder::beginArray):
1549         (WebKit::KeyedDecoder::beginArrayElement):
1550         (WebKit::KeyedDecoder::endArrayElement):
1551         (WebKit::KeyedDecoder::endArray):
1552         * Shared/gtk/KeyedDecoder.h: Added.
1553         * Shared/gtk/KeyedEncoder.cpp: Added.
1554         (WebKit::KeyedEncoder::KeyedEncoder):
1555         (WebKit::KeyedEncoder::~KeyedEncoder):
1556         (WebKit::KeyedEncoder::encodeBytes):
1557         (WebKit::KeyedEncoder::encodeBool):
1558         (WebKit::KeyedEncoder::encodeUInt32):
1559         (WebKit::KeyedEncoder::encodeInt32):
1560         (WebKit::KeyedEncoder::encodeInt64):
1561         (WebKit::KeyedEncoder::encodeFloat):
1562         (WebKit::KeyedEncoder::encodeDouble):
1563         (WebKit::KeyedEncoder::encodeString):
1564         (WebKit::KeyedEncoder::beginObject):
1565         (WebKit::KeyedEncoder::endObject):
1566         (WebKit::KeyedEncoder::beginArray):
1567         (WebKit::KeyedEncoder::beginArrayElement):
1568         (WebKit::KeyedEncoder::endArrayElement):
1569         (WebKit::KeyedEncoder::endArray):
1570         (WebKit::KeyedEncoder::finishEncoding):
1571         * Shared/gtk/KeyedEncoder.h: Added.
1572         * Shared/gtk/ProcessExecutablePathGtk.cpp:
1573         (WebKit::executablePathOfDatabaseProcess):
1574         * UIProcess/Databases/DatabaseProcessProxy.cpp:
1575         (WebKit::DatabaseProcessProxy::didCreateDatabaseToWebProcessConnection):
1576         Add the unix domain sockets implementation.
1577         * UIProcess/Launcher/gtk/ProcessLauncherGtk.cpp:
1578         (WebKit::ProcessLauncher::launchProcess): Handle the
1579         DatabaseProcess too.
1580         * UIProcess/gtk/WebContextGtk.cpp:
1581         (WebKit::WebContext::platformDefaultIndexedDBDatabaseDirectory):
1582         * WebProcess/WebProcess.cpp:
1583         (WebKit::WebProcess::ensureWebToDatabaseProcessConnection): Add
1584         the unix domain sockets implementation.
1585
1586 2015-01-22  Benjamin Poulain  <bpoulain@apple.com>
1587
1588         [iOS][WK2] Ignore synthetic click initiated on a previous page
1589         https://bugs.webkit.org/show_bug.cgi?id=139556
1590         rdar://problem/18586008
1591
1592         Reviewed by David Kilzer.
1593
1594         Under the right accumulation of bad luck, a synthetic click could be generated
1595         on a page that never asked for it.
1596
1597         What happened was:
1598         1) Page Foo listen to touch event.
1599         2) In response to touch events, Foo decides to navigate to page Bar
1600            *but* it does not cancel the native gesture recognizers with preventDefault().
1601         3) Page Bar loads.
1602         4) The native gesture recognizer ask us to click, we forward that to the WebProcess
1603            and generate a synthetic mouse event.
1604         -> Bar receives a click.
1605         If you are unlucky enough, it looks like a single tap does a double click.
1606
1607         There are two ways this patch avoids the problem:
1608
1609         First, in the UIProcess, we just cancel the HighlightLongPressGestureRecognizer
1610         on didCommitLoadForMainFrame. This prevents "fast clicks" from accidentally going through.
1611         This is not bullet proof because we get didCommitLoadForMainFrame asynchronously but
1612         killing the timer and gesture seems like a good idea.
1613
1614         Second, we skip any tap command at the WebProcess level when it was issued for
1615         the previous page. This is using the same principle we used for VisibleContentRect:
1616         any input generated before the current layer tree commit is useless for the current page.
1617
1618         We track the commit ID in the UIProcess when we decide to do the tracking or not.
1619         Note that we keep the ID regardless of the tracking state, it does not matter if we have sent
1620         touch events, what matters is what content was on screen when the touch events were handled.
1621
1622         If the user interaction result in a tap, we send the commit ID along the tap commands.
1623         In the WebProcess, we know the actual layer tree commit associated with the current page.
1624         If the tap was generated with a layer ID preceding the current page, we fail the command.
1625
1626         * UIProcess/WebPageProxy.cpp:
1627         (WebKit::WebPageProxy::WebPageProxy):
1628         (WebKit::WebPageProxy::handleTouchEventSynchronously):
1629         (WebKit::WebPageProxy::resetState):
1630         * UIProcess/WebPageProxy.h:
1631         * UIProcess/ios/WKContentView.mm:
1632         (-[WKContentView _didCommitLoadForMainFrame]):
1633         * UIProcess/ios/WKContentViewInteraction.mm:
1634         (-[WKContentView _attemptClickAtLocation:]):
1635         * UIProcess/ios/WebPageProxyIOS.mm:
1636         (WebKit::WebPageProxy::commitPotentialTap):
1637         (WebKit::WebPageProxy::handleTap):
1638         * WebProcess/WebPage/WebPage.cpp:
1639         (WebKit::WebPage::didCommitLoad):
1640         * WebProcess/WebPage/WebPage.h:
1641         * WebProcess/WebPage/WebPage.messages.in:
1642         * WebProcess/WebPage/ios/WebPageIOS.mm:
1643         (WebKit::WebPage::handleTap):
1644         (WebKit::WebPage::commitPotentialTap):
1645
1646 2015-01-22  Chris Dumez  <cdumez@apple.com>
1647
1648         [WK2][Cocoa] Drop WKWebViewConfiguration._featureCounterEnabled SPI.
1649         https://bugs.webkit.org/show_bug.cgi?id=140799
1650
1651         Reviewed by Dan Bernstein.
1652
1653         Drop WKWebViewConfiguration._featureCounterEnabled SPI now that the
1654         client-side has been updated.
1655
1656         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
1657         (-[WKWebViewConfiguration _setAllowsAlternateFullscreen:]):
1658         (-[WKWebViewConfiguration _featureCounterEnabled]): Deleted.
1659         (-[WKWebViewConfiguration _setFeatureCounterEnabled:]): Deleted.
1660         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
1661
1662 2015-01-22  Antti Koivisto  <antti@apple.com>
1663
1664         Fix ENABLE(NETWORK_CACHE) build
1665
1666         * NetworkProcess/NetworkResourceLoader.cpp:
1667         (WebKit::NetworkResourceLoader::didFinishLoading):
1668
1669 2015-01-22  Timothy Horton  <timothy_horton@apple.com>
1670
1671         UserData decoding of WKTypeRefWrapper always fails
1672         https://bugs.webkit.org/show_bug.cgi?id=140791
1673         <rdar://problem/19438402>
1674
1675         Reviewed by Anders Carlsson.
1676
1677         * Shared/mac/ObjCObjectGraph.mm:
1678         (WebKit::ObjCObjectGraph::decode):
1679         Add a missing break.
1680
1681 2015-01-22  Ryosuke Niwa  <rniwa@webkit.org>
1682
1683         Add a build flag for ES6 class syntax
1684         https://bugs.webkit.org/show_bug.cgi?id=140760
1685
1686         Reviewed by Michael Saboff.
1687
1688         * Configurations/FeatureDefines.xcconfig:
1689
1690 2015-01-22  Chris Dumez  <cdumez@apple.com>
1691
1692         Drop the legacy FeatureCounter class
1693         https://bugs.webkit.org/show_bug.cgi?id=140749
1694
1695         Reviewed by Andreas Kling.
1696
1697         Drop the legacy FeatureCounter class and use DiagnosticLoggingClient
1698         instead.
1699
1700         * Shared/WebPreferencesDefinitions.h:
1701         * UIProcess/API/Cocoa/WKWebView.mm:
1702         (-[WKWebView initWithFrame:configuration:]):
1703         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
1704         (-[WKWebViewConfiguration init]):
1705         (-[WKWebViewConfiguration copyWithZone:]):
1706         (-[WKWebViewConfiguration _featureCounterEnabled]):
1707         (-[WKWebViewConfiguration _setFeatureCounterEnabled:]):
1708         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
1709         * WebProcess/WebPage/WebPage.cpp:
1710         (WebKit::WebPage::updatePreferences):
1711         * WebProcess/WebPage/ios/WebPageIOS.mm:
1712         (WebKit::WebPage::willStartUserTriggeredZooming):
1713
1714 2015-01-22  Beth Dakin  <bdakin@apple.com>
1715
1716         ibtoold crash below -[WebView close]
1717         https://bugs.webkit.org/show_bug.cgi?id=140782
1718         -and corresponding-
1719         rdar://problem/19558472
1720
1721         Reviewed by Tim Horton.
1722
1723         Retain the NSImmediateActionGestureRecognizer. This should not be necessary, but 
1724         it is because interface builder can mess with our views.
1725         * UIProcess/mac/WKImmediateActionController.h:
1726         * UIProcess/mac/WKImmediateActionController.mm:
1727         (-[WKImmediateActionController willDestroyView:]):
1728         (-[WKImmediateActionController _cancelImmediateAction]):
1729         (-[WKImmediateActionController _cancelImmediateActionIfNeeded]):
1730         (-[WKImmediateActionController _updateImmediateActionItem]):
1731
1732 2015-01-22  David Kilzer  <ddkilzer@apple.com>
1733
1734         [iOS] Fix iphoneos SDK builds for ios-ews queue
1735         <http://webkit.org/b/140748>
1736
1737         Reviewed by Daniel Bates.
1738
1739         * Platform/spi/ios/BKSProcessAssertionSPI.h: Add -invalidate
1740         definition.  Sort @property to the top of BKSProcessAssertion.
1741
1742 2015-01-22  Shivakumar JM  <shiva.jm@samsung.com>
1743
1744         Fix build warning in WebKit2/UIProcess module
1745         https://bugs.webkit.org/show_bug.cgi?id=140758
1746
1747         Reviewed by Csaba Osztrogonác.
1748
1749         Fix build warnings by using UNUSED_PARAM macro
1750
1751         * UIProcess/API/C/WKPageGroup.cpp:
1752         (WKPageGroupAddUserContentFilter):
1753         (WKPageGroupRemoveAllUserContentFilters):
1754
1755 2014-11-06  Carlos Garcia Campos  <cgarcia@igalia.com>
1756
1757         [GTK] Use API::ContextMenuClient and API::InjectedBundle::PageContextMenuClient classes
1758         https://bugs.webkit.org/show_bug.cgi?id=138467
1759
1760         Reviewed by Gustavo Noronha Silva.
1761
1762         * UIProcess/API/gtk/WebKitContextMenu.cpp:
1763         (webkitContextMenuPopulate): Add a version that receives a Vector<WebContextMenuItemData>&.
1764         (webkitContextMenuCreate): Change it to receive a const
1765         Vector<WebContextMenuItemData>& instead of a API::Array* and also
1766         add a another version that receives const Vector<ContextMenuItem>&.
1767         * UIProcess/API/gtk/WebKitContextMenuClient.cpp:
1768         (attachContextMenuClientToView): Use a class derived from
1769         API::ContextMenuClient to implement the context menu client.
1770         (getContextMenuFromProposedMenu): Deleted.
1771         * UIProcess/API/gtk/WebKitContextMenuItem.cpp:
1772         (webkitContextMenuItemCreate): Change it to receive a const
1773         WebContextMenuItemData& and added another version that receives a
1774         const ContextMenuItem&.
1775         * UIProcess/API/gtk/WebKitContextMenuItemPrivate.h:
1776         * UIProcess/API/gtk/WebKitContextMenuPrivate.h:
1777         * UIProcess/API/gtk/WebKitWebView.cpp:
1778         (webkitWebViewPopulateContextMenu): Remove the creation of a
1779         WebHitTestResult::Data, since it receives it now as parameter.
1780         * UIProcess/API/gtk/WebKitWebViewPrivate.h:
1781         * WebProcess/InjectedBundle/API/gtk/WebKitWebHitTestResult.cpp:
1782         (webkitWebHitTestResultCreate): Change it to receive a const
1783         HitTestResult& instead of const InjectedBundleHitTestResult&.
1784         * WebProcess/InjectedBundle/API/gtk/WebKitWebHitTestResultPrivate.h:
1785         * WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp:
1786         (webkitWebPageCreate): Use a class derived from
1787         API::InjectedBundle::PageContextMenuClient to implement the
1788         context menu client.
1789         (getContextMenuFromDefaultMenu): Deleted.
1790
1791 2015-01-22  Carlos Garcia Campos  <cgarcia@igalia.com>
1792
1793         Unreviewed. Try to fix Debug build after r178889.
1794
1795         * UIProcess/API/C/WKPage.cpp: Include Logging.h.
1796
1797 2015-01-21  Carlos Garcia Campos  <cgarcia@igalia.com>
1798
1799         Add API::ContextMenuClient and API::InjectedBundle::PageContextMenuClient classes
1800         https://bugs.webkit.org/show_bug.cgi?id=138466
1801
1802         Reviewed by Anders Carlsson.
1803
1804         Move ContextMenuClient to use API classes in both UI and Injected
1805         Bundle APIs.
1806
1807         * CMakeLists.txt: Remove WebPageContextMenuClient.cpp.
1808         * UIProcess/API/APIContextMenuClient.h: Renamed from Source/WebKit2/UIProcess/WebPageContextMenuClient.h.
1809         (API::ContextMenuClient::~ContextMenuClient):
1810         (API::ContextMenuClient::getContextMenuFromProposedMenu):
1811         (API::ContextMenuClient::customContextMenuItemSelected):
1812         (API::ContextMenuClient::contextMenuDismissed):
1813         (API::ContextMenuClient::showContextMenu):
1814         (API::ContextMenuClient::hideContextMenu):
1815         * UIProcess/API/C/WKPage.cpp:
1816         (WKPageSetPageContextMenuClient):
1817         * UIProcess/WebPageContextMenuClient.cpp: Removed.
1818         * UIProcess/WebPageProxy.cpp:
1819         (WebKit::WebPageProxy::WebPageProxy):
1820         (WebKit::WebPageProxy::setContextMenuClient):
1821         (WebKit::WebPageProxy::close):
1822         (WebKit::WebPageProxy::internalShowContextMenu):
1823         (WebKit::WebPageProxy::contextMenuItemSelected):
1824         (WebKit::WebPageProxy::initializeContextMenuClient): Deleted.
1825         * UIProcess/WebPageProxy.h:
1826         * WebKit2.xcodeproj/project.pbxproj: Remove deleted files and add
1827         new files to compilation.
1828         * WebProcess/InjectedBundle/API/APIInjectedBundlePageContextMenuClient.h: Copied from Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageContextMenuClient.h.
1829         (API::InjectedBundle::PageContextMenuClient::~PageContextMenuClient):
1830         (API::InjectedBundle::PageContextMenuClient::getCustomMenuFromDefaultItems):
1831         (API::InjectedBundle::PageContextMenuClient::prepareForActionMenu):
1832         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
1833         (WKBundlePageSetContextMenuClient):
1834         * WebProcess/InjectedBundle/InjectedBundlePageContextMenuClient.cpp:
1835         (WebKit::InjectedBundlePageContextMenuClient::InjectedBundlePageContextMenuClient):
1836         (WebKit::InjectedBundlePageContextMenuClient::getCustomMenuFromDefaultItems):
1837         (WebKit::InjectedBundlePageContextMenuClient::prepareForActionMenu):
1838         * WebProcess/InjectedBundle/InjectedBundlePageContextMenuClient.h:
1839         * WebProcess/WebPage/WebContextMenu.cpp:
1840         (WebKit::WebContextMenu::menuItemsWithUserData):
1841         * WebProcess/WebPage/WebPage.cpp:
1842         (WebKit::WebPage::WebPage):
1843         (WebKit::WebPage::setInjectedBundleContextMenuClient):
1844         (WebKit::WebPage::close):
1845         (WebKit::WebPage::initializeInjectedBundleContextMenuClient): Deleted.
1846         * WebProcess/WebPage/WebPage.h:
1847         (WebKit::WebPage::injectedBundleContextMenuClient):
1848         * WebProcess/WebPage/mac/WebPageMac.mm:
1849         (WebKit::WebPage::performActionMenuHitTestAtLocation):
1850
1851 2015-01-20  Jon Honeycutt  <jhoneycutt@apple.com>
1852
1853         [iOS] WebKitTestRunner: Tests fail due to incorrect web view size
1854
1855         <https://bugs.webkit.org/show_bug.cgi?id=139736>
1856         <rdar://problem/19282196>
1857
1858         This starts happening after we fail to reset the test controller to
1859         consistent values in TestInvocation::invoke(). When we terminate the
1860         web process and relaunch it, the new WebPage object created in the web
1861         process is using the default ViewportConfiguration with dimensions of
1862         1024x768.
1863
1864         The PageClient on iOS currently notifies the WKWebView and the
1865         WKContentView when the web process is relaunched. This patch extends
1866         that to also notify the WKView.
1867
1868         Reviewed by Benjamin Poulain.
1869
1870         * UIProcess/API/Cocoa/WKViewPrivate.h:
1871         Declare -_didRelaunchProcess.
1872
1873         * UIProcess/API/ios/WKViewIOS.mm:
1874         (-[WKView _commonInitializationWithContextRef:pageGroupRef:relatedToPage:]):
1875         Call the new method that accepts a WKView.
1876         (-[WKView _didRelaunchProcess]):
1877         Call -_frameOrBoundsChanged to update the web process's size to the
1878         size of the WKView.
1879
1880         * UIProcess/ios/PageClientImplIOS.h:
1881         Add a constructor that takes a WKView, and add a member var to hold it.
1882
1883         * UIProcess/ios/PageClientImplIOS.mm:
1884         (WebKit::PageClientImpl::PageClientImpl):
1885         Implement the constructor that takes a WKView.
1886         (WebKit::PageClientImpl::didRelaunchProcess):
1887         Tell the WKView that the web process relaunched.
1888
1889         * UIProcess/ios/WKContentView.h:
1890         Declare an initializer that takes a WKView.
1891
1892         * UIProcess/ios/WKContentView.mm:
1893         (-[WKContentView _commonInitializationWithProcessPool:configuration:]):
1894         Split out from -[WKContentView initWithFrame:processPool:configuration:webView:].
1895         (-[WKContentView initWithFrame:processPool:configuration:webView:]):
1896         Perform some initialization, including creating the PageClient, and
1897         call the common initializer.
1898         (-[WKContentView initWithFrame:processPool:configuration:wkView:]):
1899         Ditto.
1900
1901 2015-01-21  Sam Weinig  <sam@webkit.org>
1902
1903         Add WKPageGroupRef SPI for user content filters
1904         https://bugs.webkit.org/show_bug.cgi?id=140728
1905
1906         Reviewed by Anders Carlsson.
1907
1908         While Safari is transitioning to WKUserContentController, it is useful
1909         for them to have access to have access to content filters on the page group
1910         where they currently have user content related functionality.
1911
1912         * Shared/WebPageGroupData.cpp:
1913         (WebKit::WebPageGroupData::encode):
1914         (WebKit::WebPageGroupData::decode):
1915         * Shared/WebPageGroupData.h:
1916         * UIProcess/API/C/WKPageGroup.cpp:
1917         (WKPageGroupAddUserContentFilter):
1918         (WKPageGroupRemoveAllUserContentFilters):
1919         * UIProcess/API/C/WKPageGroup.h:
1920         * UIProcess/WebPageGroup.cpp:
1921         (WebKit::WebPageGroup::addUserContentFilter):
1922         (WebKit::WebPageGroup::removeAllUserContentFilters):
1923         * UIProcess/WebPageGroup.h:
1924         * WebProcess/WebPage/WebPageGroupProxy.cpp:
1925         (WebKit::WebPageGroupProxy::WebPageGroupProxy):
1926         (WebKit::WebPageGroupProxy::addUserContentFilter):
1927         (WebKit::WebPageGroupProxy::removeAllUserContentFilters):
1928         * WebProcess/WebPage/WebPageGroupProxy.h:
1929         * WebProcess/WebPage/WebPageGroupProxy.messages.in:
1930
1931 2015-01-21  Beth Dakin  <bdakin@apple.com>
1932
1933         Crash in QuickLook preview delegate method
1934         https://bugs.webkit.org/show_bug.cgi?id=140740
1935         -and corresponding-
1936         rdar://problem/19540806
1937
1938         Reviewed by Tim Horton.
1939
1940         Clear out the delegate.
1941         * UIProcess/mac/WKImmediateActionController.mm:
1942         (-[WKImmediateActionController willDestroyView:]):
1943
1944 2015-01-21  Zan Dobersek  <zdobersek@igalia.com>
1945
1946         AsyncRequestImpl casting in AsyncRequest::completeRequest() is incorrect
1947         https://bugs.webkit.org/show_bug.cgi?id=139724
1948
1949         Reviewed by Darin Adler.
1950
1951         AsyncRequestImpl casting in AsyncRequest::completeRequest() relies on
1952         the parameter pack to properly determine the type of the AsyncRequestImpl
1953         object. The casting result can be incorrect when an argument is passed
1954         by reference while the original object was constructed with a callback
1955         that expects an argument that's passed by value.
1956
1957         To avoid this the AsyncRequestImpl template is now instantiated with
1958         raw types, with callback parameters remaining raw types in case
1959         of being integral (enforcing passing-by-value these arguments when
1960         dispatching), and const references being used otherwise (enforcing
1961         passing-by-reference).
1962
1963         This enables casting AsyncRequest objects to the correct AsyncRequestImpl<>
1964         by running the parameter pack through std::decay.
1965
1966         * DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:
1967         (WebKit::UniqueIDBDatabase::putRecord):
1968         (WebKit::UniqueIDBDatabase::getRecord):
1969         (WebKit::UniqueIDBDatabase::openCursor):
1970         (WebKit::UniqueIDBDatabase::cursorAdvance):
1971         (WebKit::UniqueIDBDatabase::cursorIterate):
1972         (WebKit::UniqueIDBDatabase::count):
1973         (WebKit::UniqueIDBDatabase::deleteRange):
1974         * Shared/AsyncRequest.h:
1975         (WebKit::AsyncRequest::completeRequest):
1976         * WebProcess/Databases/IndexedDB/WebIDBServerConnection.cpp:
1977         (WebKit::WebIDBServerConnection::getOrEstablishIDBDatabaseMetadata):
1978         (WebKit::WebIDBServerConnection::get):
1979
1980 2015-01-21  Chris Dumez  <cdumez@apple.com>
1981
1982         [WK2] Stop using WKDiagnosticLoggingResultType.h C API header in Cocoa API
1983         https://bugs.webkit.org/show_bug.cgi?id=140655
1984
1985         Reviewed by Anders Carlsson.
1986
1987         Stop using WKDiagnosticLoggingResultType.h C API header in Cocoa API.
1988         Instead, introduce a new _WKDiagnosticLoggingResultType enum in
1989         _WKDiagnosticLoggingDelegate.h.
1990
1991         A few defines mapping WKDiagnosticLoggingResultType enum and its values
1992         to the new _WKDiagnosticLoggingResultType are temporarily added until
1993         the client-side is transitioned.
1994
1995         * UIProcess/API/Cocoa/_WKDiagnosticLoggingDelegate.h:
1996         * UIProcess/Cocoa/DiagnosticLoggingClient.mm:
1997         (WebKit::toWKDiagnosticLoggingResultType):
1998         (WebKit::DiagnosticLoggingClient::logDiagnosticMessageWithResult):
1999
2000 2015-01-21  Zan Dobersek  <zdobersek@igalia.com>
2001
2002         [WK2] Use C++ lambdas in ProcessLauncher class
2003         https://bugs.webkit.org/show_bug.cgi?id=138186
2004
2005         Reviewed by Darin Adler.
2006
2007         Replace uses of WTF::bind() in the ProcessLauncher class with C++ lambdas.
2008
2009         * UIProcess/Launcher/efl/ProcessLauncherEfl.cpp:
2010         (WebKit::ProcessLauncher::launchProcess):
2011         * UIProcess/Launcher/gtk/ProcessLauncherGtk.cpp:
2012         (WebKit::ProcessLauncher::launchProcess):
2013         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
2014         (WebKit::connectToService):
2015         (WebKit::tryPreexistingProcess):
2016         (WebKit::createProcess):
2017
2018 2015-01-21  Zan Dobersek  <zdobersek@igalia.com>
2019
2020         Clean up ViewUpdateDispatcher
2021         https://bugs.webkit.org/show_bug.cgi?id=140619
2022
2023         Reviewed by Darin Adler.
2024
2025         * WebProcess/WebPage/ViewUpdateDispatcher.cpp:
2026         (WebKit::ViewUpdateDispatcher::visibleContentRectUpdate):
2027         Replace WTF::bind() with a C++ lambda.
2028         (WebKit::ViewUpdateDispatcher::dispatchVisibleContentRectUpdate):
2029         Use WTF::move() to move the HashMap member into the local variable.
2030
2031 2015-01-21  Csaba Osztrogonác  <ossy@webkit.org>
2032
2033         Remove ENABLE(INSPECTOR) ifdef guards
2034         https://bugs.webkit.org/show_bug.cgi?id=140668
2035
2036         Reviewed by Darin Adler.
2037
2038         * Configurations/FeatureDefines.xcconfig:
2039         * Shared/API/c/WKSharedAPICast.h:
2040         (WebKit::toAPI):
2041         (WebKit::toImpl):
2042         * Shared/WebCoreArgumentCoders.cpp:
2043         (IPC::ArgumentCoder<ResourceRequest>::encode):
2044         (IPC::ArgumentCoder<ResourceRequest>::decode):
2045         * UIProcess/API/C/WKInspector.cpp:
2046         (WKInspectorGetTypeID):
2047         (WKInspectorGetPage):
2048         (WKInspectorIsConnected):
2049         (WKInspectorIsVisible):
2050         (WKInspectorIsFront):
2051         (WKInspectorConnect):
2052         (WKInspectorShow):
2053         (WKInspectorHide):
2054         (WKInspectorClose):
2055         (WKInspectorShowConsole):
2056         (WKInspectorShowResources):
2057         (WKInspectorShowMainResourceForFrame):
2058         (WKInspectorIsAttached):
2059         (WKInspectorAttach):
2060         (WKInspectorDetach):
2061         (WKInspectorIsProfilingPage):
2062         (WKInspectorTogglePageProfiling):
2063         * UIProcess/API/C/WKPage.cpp:
2064         (WKPageGetInspector):
2065         * UIProcess/API/efl/ewk_view.cpp:
2066         (ewk_view_inspector_show):
2067         (ewk_view_inspector_close):
2068         * UIProcess/API/efl/tests/test_ewk2_view.cpp:
2069         (TEST_F):
2070         * UIProcess/PageClient.h:
2071         * UIProcess/WebInspectorProxy.cpp:
2072         * UIProcess/WebInspectorProxy.h:
2073         * UIProcess/WebInspectorProxy.messages.in:
2074         * UIProcess/WebPageProxy.cpp:
2075         (WebKit::WebPageProxy::WebPageProxy):
2076         (WebKit::WebPageProxy::reattachToWebProcess):
2077         (WebKit::WebPageProxy::maybeInitializeSandboxExtensionHandle):
2078         (WebKit::WebPageProxy::resetState):
2079         * UIProcess/WebPageProxy.h:
2080         * UIProcess/WebPageProxy.messages.in:
2081         * UIProcess/WebProcessProxy.cpp:
2082         (WebKit::WebProcessProxy::getLaunchOptions):
2083         * UIProcess/efl/WebInspectorProxyEfl.cpp:
2084         * UIProcess/gtk/WebInspectorProxyGtk.cpp:
2085         * UIProcess/ios/PageClientImplIOS.h:
2086         * UIProcess/ios/PageClientImplIOS.mm:
2087         (WebKit::PageClientImpl::disableInspectorNodeSearch):
2088         * UIProcess/ios/WebInspectorProxyIOS.mm:
2089         * UIProcess/ios/WebPageProxyIOS.mm:
2090         (WebKit::WebPageProxy::disableInspectorNodeSearch):
2091         * UIProcess/mac/WebInspectorProxyMac.mm:
2092         * WebProcess/InjectedBundle/API/c/WKBundleInspector.cpp:
2093         (WKBundleInspectorGetTypeID):
2094         (WKBundleInspectorShow):
2095         (WKBundleInspectorClose):
2096         (WKBundleInspectorEvaluateScriptForTest):
2097         (WKBundleInspectorSetPageProfilingEnabled):
2098         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
2099         (WKBundlePageGetInspector):
2100         * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
2101         * WebProcess/WebCoreSupport/WebInspectorClient.h:
2102         * WebProcess/WebCoreSupport/WebInspectorFrontendClient.h:
2103         * WebProcess/WebPage/WebInspector.cpp:
2104         * WebProcess/WebPage/WebInspector.h:
2105         * WebProcess/WebPage/WebInspector.messages.in:
2106         * WebProcess/WebPage/WebInspectorUI.cpp:
2107         * WebProcess/WebPage/WebInspectorUI.h:
2108         * WebProcess/WebPage/WebInspectorUI.messages.in:
2109         * WebProcess/WebPage/WebPage.cpp:
2110         (WebKit::WebPage::WebPage):
2111         (WebKit::WebPage::~WebPage):
2112         (WebKit::WebPage::close):
2113         (WebKit::WebPage::inspectorUI):
2114         (WebKit::WebPage::didReceiveMessage):
2115         * WebProcess/WebPage/WebPage.h:
2116         * WebProcess/WebPage/efl/WebInspectorEfl.cpp:
2117         * WebProcess/WebPage/efl/WebInspectorUIEfl.cpp:
2118         * WebProcess/WebPage/gtk/WebInspectorGtk.cpp:
2119         * WebProcess/WebPage/gtk/WebInspectorUIGtk.cpp:
2120         * WebProcess/WebPage/ios/WebPageIOS.mm:
2121         (WebKit::WebPage::disableInspectorNodeSearch):
2122         * WebProcess/WebPage/mac/WebInspectorMac.mm:
2123         * WebProcess/WebPage/mac/WebInspectorUIMac.mm:
2124         * config.h:
2125
2126 2015-01-20  Martin Hock  <mhock@apple.com>
2127
2128         [iOS][WK2] Redraw find-in-page indicator on rotation
2129         https://bugs.webkit.org/show_bug.cgi?id=140632
2130         <rdar://problem/18858394>
2131
2132         Reviewed by Tim Horton.
2133
2134         * WebProcess/WebPage/FindController.cpp:
2135         (WebKit::FindController::redraw): Add method to redraw find indicator (only used by iOS).
2136         * WebProcess/WebPage/FindController.h:
2137         * WebProcess/WebPage/WebPage.cpp:
2138         (WebKit::WebPage::mainFrameDidLayout):
2139         * WebProcess/WebPage/ios/FindControllerIOS.mm:
2140         (WebKit::FindController::updateFindIndicator): Redraw should not trigger zoom.
2141
2142 2015-01-20  David Kilzer  <ddkilzer@apple.com>
2143
2144         Switch to comparing PLATFORM_NAME in terms of macosx
2145         <http://webkit.org/b/139516>
2146
2147         Reviewed by Timothy Hatcher.
2148
2149         * WebKit2.xcodeproj/project.pbxproj:
2150         * mac/rewrite-availability-macros.sh: Remove the else block that
2151         checked for an unknown PLATFORM_NAME.
2152
2153 2015-01-19  Simon Fraser  <simon.fraser@apple.com>
2154
2155         Add a way to collect scrolling performance data (viewport tile coverage) with UI-side compositing
2156         https://bugs.webkit.org/show_bug.cgi?id=140474
2157
2158         Reviewed by Tim Horton.
2159         
2160         Add a private method to enable scrolling data collection to WKWebView. When enabled, create
2161         a RemoteLayerTreeScrollingPerformanceData object that collects "blank pixel" data on
2162         every layer tree commit and scroll, and stores them in a vector. A second SPI call
2163         allows retrieval of an NSArray of this data.
2164         
2165         To allow RemoteLayerTreeScrollingPerformanceData to find the correct layer which
2166         contains the main tile grid, we set a layer name on the appropriate layer (even
2167         in release builds).
2168
2169         * UIProcess/API/Cocoa/WKWebView.mm:
2170         (-[WKWebView visibleRectInScreenCoordinates]):
2171         (-[WKWebView _didCommitLayerTree:]):
2172         (-[WKWebView scrollViewDidScroll:]):
2173         (-[WKWebView _setScrollPerformanceDataCollectionEnabled:]):
2174         (-[WKWebView _scrollPerformanceDataCollectionEnabled]):
2175         (-[WKWebView _scrollPerformanceData]):
2176         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2177         * UIProcess/Cocoa/RemoteLayerTreeScrollingPerformanceData.h: Added.
2178         (WebKit::RemoteLayerTreeScrollingPerformanceData::BlankPixelCount::BlankPixelCount):
2179         * UIProcess/Cocoa/RemoteLayerTreeScrollingPerformanceData.mm: Added.
2180         (WebKit::RemoteLayerTreeScrollingPerformanceData::RemoteLayerTreeScrollingPerformanceData):
2181         (WebKit::RemoteLayerTreeScrollingPerformanceData::~RemoteLayerTreeScrollingPerformanceData):
2182         (WebKit::RemoteLayerTreeScrollingPerformanceData::didCommitLayerTree):
2183         (WebKit::RemoteLayerTreeScrollingPerformanceData::didScroll):
2184         (WebKit::RemoteLayerTreeScrollingPerformanceData::BlankPixelCount::canCoalesce):
2185         (WebKit::RemoteLayerTreeScrollingPerformanceData::appendBlankPixelCount):
2186         (WebKit::RemoteLayerTreeScrollingPerformanceData::data):
2187         (WebKit::findTileGridContainerLayer):
2188         (WebKit::RemoteLayerTreeScrollingPerformanceData::blankPixelCount):
2189         * UIProcess/WebPageProxy.cpp:
2190         (WebKit::WebPageProxy::WebPageProxy):
2191         (WebKit::WebPageProxy::setScrollPerformanceDataCollectionEnabled):
2192         * UIProcess/WebPageProxy.h:
2193         (WebKit::WebPageProxy::scrollPerformanceDataCollectionEnabled):
2194         (WebKit::WebPageProxy::scrollingPerformanceData):
2195         * WebKit2.xcodeproj/project.pbxproj:
2196
2197 2015-01-19  Dean Jackson  <dino@apple.com>
2198
2199         Support "plus-darker" in mix-blend mode
2200         https://bugs.webkit.org/show_bug.cgi?id=140646
2201         <rdar://problem/19523370>
2202
2203         Reviewed by Simon Fraser.
2204
2205         Output the appropriate blending type when logging.
2206
2207         * Shared/mac/RemoteLayerTreeTransaction.mm:
2208         (WebKit::RemoteLayerTreeTextStream::operator<<):
2209
2210 2015-01-20  Carlos Garcia Campos  <cgarcia@igalia.com>
2211
2212         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.7.4 release.
2213
2214         * gtk/NEWS: Add release notes for 2.7.4.
2215
2216 2015-01-20  Tomas Popela  <tpopela@redhat.com>
2217
2218         [GTK] Add API to set the web view editable into WebKit2 GTK+ API
2219         https://bugs.webkit.org/show_bug.cgi?id=139443
2220
2221         Reviewed by Carlos Garcia Campos.
2222
2223         Provide a way to set the web view editable, without accessing the DOM
2224         and setting the contenteditable attribute to elements.
2225
2226         * UIProcess/API/gtk/WebKitWebView.cpp:
2227         (webkitWebViewSetProperty):
2228         (webkitWebViewGetProperty):
2229         (webkit_web_view_class_init):
2230         (webkit_web_view_is_editable):
2231         (webkit_web_view_set_editable):
2232         * UIProcess/API/gtk/WebKitWebView.h:
2233         * UIProcess/API/gtk/docs/webkit2gtk-sections.txt:
2234
2235 2015-01-20  Carlos Garcia Campos  <cgarcia@igalia.com>
2236
2237         [GTK] Add an option to create WebKitWebView snapshots with transparent background
2238         https://bugs.webkit.org/show_bug.cgi?id=140617
2239
2240         Reviewed by Gustavo Noronha Silva.
2241
2242         Add WEBKIT_SNAPSHOT_OPTIONS_TRANSPARENT_BACKGROUND flag to not
2243         fill with white the background before rendering the snapshot.
2244
2245         * UIProcess/API/gtk/WebKitWebView.cpp:
2246         (webkit_web_view_get_snapshot): Pass a TransparentBackground
2247         boolean argument to the WEbProcess.
2248         * UIProcess/API/gtk/WebKitWebView.h:
2249         * WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp:
2250         (webkitWebPageDidReceiveMessage): Set the FrameView background as
2251         transparent when TransparentBackground option is True before
2252         rendering the snapshot.
2253
2254 2015-01-19  Carlos Garcia Campos  <cgarcia@igalia.com>
2255
2256         [GTK] Add API to change the WebKitWebView background color
2257         https://bugs.webkit.org/show_bug.cgi?id=140610
2258
2259         Reviewed by Gustavo Noronha Silva.
2260
2261         When a color different than the default one (opaque white) is
2262         used, the SetDrawsBackground message is sent to the WebProcess with
2263         a False value to indicate WebCore to not render backgrounds. The
2264         background color passed is saved in the WebPageProxy and used by
2265         the backing store to fill the background before the actual
2266         contents are rendered in the WebView.
2267
2268         * UIProcess/API/gtk/WebKitWebView.cpp:
2269         (webkit_web_view_set_background_color):
2270         (webkit_web_view_get_background_color):
2271         * UIProcess/API/gtk/WebKitWebView.h:
2272         * UIProcess/API/gtk/docs/webkit2gtk-sections.txt: Add new symbols.
2273         * UIProcess/WebPageProxy.cpp:
2274         (WebKit::WebPageProxy::WebPageProxy): Initialize m_backgroundColor member.
2275         * UIProcess/WebPageProxy.h:
2276         (WebKit::WebPageProxy::backgroundColor): Return m_backgroundColor.
2277         (WebKit::WebPageProxy::setBackgroundColor): Set m_backgroundColor.
2278         * UIProcess/cairo/BackingStoreCairo.cpp:
2279         (WebKit::BackingStore::incorporateUpdate): Fill the damage region
2280         with the WebPageProxy background color when the WebProcess is not
2281         rendering backgrounds. If the background color is not fully opaque
2282         we need to clear the region before filling it with the color.
2283
2284 2015-01-19  Myles C. Maxfield  <mmaxfield@apple.com>
2285
2286         [SVG -> OTF Converter] Flip the switch on
2287         https://bugs.webkit.org/show_bug.cgi?id=140592
2288
2289         Reviewed by Antti Koivisto.
2290
2291         * Configurations/FeatureDefines.xcconfig:
2292
2293 2015-01-19  Mark Rowe  <mrowe@apple.com>
2294
2295         <https://webkit.org/b/140504> REGRESSION (r178452): Visited link coloring only appears to work in the first web process
2296
2297         Roll out r178452 since it broke visited link coloring.
2298
2299         Reviewed by Anders Carlsson.
2300
2301         * UIProcess/VisitedLinkProvider.cpp:
2302         (WebKit::VisitedLinkProvider::~VisitedLinkProvider):
2303         (WebKit::VisitedLinkProvider::addProcess):
2304         (WebKit::VisitedLinkProvider::removeProcess):
2305         (WebKit::VisitedLinkProvider::removeAll):
2306         (WebKit::VisitedLinkProvider::webProcessWillOpenConnection):
2307         (WebKit::VisitedLinkProvider::webProcessDidCloseConnection):
2308         (WebKit::VisitedLinkProvider::pendingVisitedLinksTimerFired):
2309         (WebKit::VisitedLinkProvider::resizeTable):
2310         * UIProcess/VisitedLinkProvider.h:
2311         * UIProcess/WebPageProxy.cpp:
2312         (WebKit::WebPageProxy::WebPageProxy):
2313         (WebKit::WebPageProxy::processDidFinishLaunching):
2314         * UIProcess/WebProcessProxy.cpp:
2315         (WebKit::WebProcessProxy::disconnect):
2316         (WebKit::WebProcessProxy::addVisitedLinkProvider):
2317         (WebKit::WebProcessProxy::didDestroyVisitedLinkProvider):
2318         * UIProcess/WebProcessProxy.h:
2319
2320 2015-01-19  Sam Weinig  <sam@webkit.org>
2321
2322         Sprinkle some CTTE on API::PolicyClient and API::FormClient
2323         https://bugs.webkit.org/show_bug.cgi?id=140656
2324
2325         Reviewed by Tim Horton.
2326
2327         - Use references rather than pointers where possible.
2328         - Store and pass the listeners as Refs.
2329         - Make API::FormClient more like API::PolicyClient by making it the
2330           responsibility of the client implementation to call the default policy.
2331
2332         * UIProcess/API/APIFormClient.h:
2333         (API::FormClient::willSubmitForm):
2334         * UIProcess/API/APIPolicyClient.h:
2335         (API::PolicyClient::decidePolicyForNavigationAction):
2336         (API::PolicyClient::decidePolicyForNewWindowAction):
2337         (API::PolicyClient::decidePolicyForResponse):
2338         (API::PolicyClient::unableToImplementPolicy):
2339         * UIProcess/API/C/WKPage.cpp:
2340         (WKPageSetPagePolicyClient):
2341         * UIProcess/API/Cocoa/WKWebView.mm:
2342         (-[WKWebView _setFormDelegate:]):
2343         * UIProcess/API/gtk/WebKitPolicyClient.cpp:
2344         * UIProcess/Cocoa/NavigationState.h:
2345         * UIProcess/Cocoa/NavigationState.mm:
2346         (WebKit::NavigationState::PolicyClient::decidePolicyForNavigationAction):
2347         (WebKit::NavigationState::PolicyClient::decidePolicyForNewWindowAction):
2348         (WebKit::NavigationState::PolicyClient::decidePolicyForResponse):
2349         * UIProcess/WebFormClient.cpp:
2350         (WebKit::WebFormClient::willSubmitForm):
2351         * UIProcess/WebFormClient.h:
2352         * UIProcess/WebFrameProxy.cpp:
2353         (WebKit::WebFrameProxy::setUpPolicyListenerProxy):
2354         (WebKit::WebFrameProxy::setUpFormSubmissionListenerProxy):
2355         * UIProcess/WebFrameProxy.h:
2356         * UIProcess/WebPageProxy.cpp:
2357         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
2358         (WebKit::WebPageProxy::decidePolicyForNewWindowAction):
2359         (WebKit::WebPageProxy::decidePolicyForResponse):
2360         (WebKit::WebPageProxy::unableToImplementPolicy):
2361         (WebKit::WebPageProxy::willSubmitForm):
2362
2363 2015-01-18  Sam Weinig  <sam@webkit.org>
2364
2365         Merge API::ProcessPoolConfiguration and _WKProcessPoolConfiguration
2366         https://bugs.webkit.org/show_bug.cgi?id=140601
2367
2368         Reviewed by Anders Carlsson.
2369
2370         - Converts _WKProcessPoolConfiguration to be backed via API::ProcessPoolConfiguration.
2371         - Expands API::ProcessPoolConfiguration to add all the parameters necessary to fully
2372           initialize a WebProcessPool. This allows -[WKProcessPool _initWithConfiguration:] to
2373           be a simple pass through initializer, which in turn allows us to consider WebProcessPools
2374           created on the C++ and Objective-C sides as equivalent.
2375         - Makes WebProcessPool own the reference to the API::ProcessPoolConfiguration (rather than
2376           the WKProcessPool wrapper).
2377
2378         * Shared/Cocoa/APIObject.mm:
2379         (API::Object::newObject):
2380         Create the API::ProcessPoolConfigurations using [_WKProcessPoolConfiguration alloc] as its 
2381         storage..
2382
2383         * UIProcess/API/APIProcessPoolConfiguration.cpp:
2384         (API::ProcessPoolConfiguration::create):
2385         (API::ProcessPoolConfiguration::createWithLegacyOptions):
2386         (API::ProcessPoolConfiguration::ProcessPoolConfiguration):
2387         (API::ProcessPoolConfiguration::~ProcessPoolConfiguration):
2388         (API::ProcessPoolConfiguration::copy):
2389         (API::ProcessPoolConfiguration::webProcessPoolConfiguration): Deleted.
2390         * UIProcess/API/APIProcessPoolConfiguration.h:
2391         Add the remaining initialization parameters and add a convenience create function
2392         for configuring legacy WebProcessPools (for use by the C-SPI).
2393
2394         * UIProcess/API/APIWebsiteDataStore.cpp:
2395         (API::WebsiteDataStore::websiteDataDirectoryFileSystemRepresentation):
2396         * UIProcess/API/APIWebsiteDataStore.h:
2397         * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
2398         (API::WebsiteDataStore::websiteDataDirectoryFileSystemRepresentation):
2399         (API::WebsiteDataStore::defaultDataStoreConfiguration):
2400         Expose helper for getting the website data directories for use in the ProcessPoolConfiguration.
2401
2402         * UIProcess/API/C/WKContext.cpp:
2403         (WKContextCreate):
2404         (WKContextCreateWithInjectedBundlePath):
2405         (WKContextCreateWithConfiguration):
2406         Use ProcessPoolConfiguration::createWithLegacyOptions() to keep backwards compatibility.
2407
2408         * UIProcess/API/C/WKContextConfigurationRef.cpp:
2409         (WKContextConfigurationCreate):
2410         Update for ProcessPoolConfiguration::create() returning a Ref. Note, this function
2411         was not changed to call ProcessPoolConfiguration::createWithLegacyOptions() since
2412         it has not been around long enough to warrant it.
2413
2414         * UIProcess/API/Cocoa/WKProcessGroup.mm:
2415         (-[WKProcessGroup initWithInjectedBundleURL:]):
2416         Use ProcessPoolConfiguration::createWithLegacyOptions() to keep backwards compatibility.
2417
2418         * UIProcess/API/Cocoa/WKProcessPool.mm:
2419         (-[WKProcessPool description]):
2420         Change to pull the configuration from the underlying API::Object.
2421
2422         (-[WKProcessPool _configuration]):
2423         Change to pull the configuration from the underlying API::Object and call the new
2424         copy() helper on it.
2425         
2426         (-[WKProcessPool _initWithConfiguration:]):
2427         Convert to be a simple pass through to API::Object::constructInWrapper.
2428
2429         (websiteDataDirectoryURL): Deleted.
2430         Moved to APIWebsiteDataStore.h
2431
2432         * UIProcess/API/Cocoa/WKProcessPoolInternal.h:
2433         Removes the _WKProcessPoolConfiguration member, now that it is stored on the WebProcessPool.
2434         
2435         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
2436         (-[_WKProcessPoolConfiguration init]):
2437         (-[_WKProcessPoolConfiguration dealloc]):
2438         Added to support API::Object bridging.
2439
2440         (-[_WKProcessPoolConfiguration injectedBundleURL]):
2441         (-[_WKProcessPoolConfiguration setInjectedBundleURL:]):
2442         Convert to getting the URL from the underlying object. Moved the exception
2443         that used to be on creation of the WKProcessPool.
2444
2445         (-[_WKProcessPoolConfiguration maximumProcessCount]):
2446         (-[_WKProcessPoolConfiguration setMaximumProcessCount:]):
2447         Convert to getting the count from the underlying object.
2448
2449         (-[_WKProcessPoolConfiguration cachePartitionedURLSchemes]):
2450         Convert to constructing the NSArray on demand from the underlying Vector.
2451
2452         (-[_WKProcessPoolConfiguration setCachePartitionedURLSchemes:]):
2453         Converts the NSArray to a Vector rather than storing the array.
2454
2455         * UIProcess/API/Cocoa/_WKProcessPoolConfigurationInternal.h: Added.
2456         (API::wrapper):
2457         Add boilerplate for API::Object bridging.
2458
2459         * UIProcess/API/gtk/WebKitWebContext.cpp:
2460         (webkitWebContextConstructed):
2461         Update to use API::ProcessPoolConfiguration::createWithLegacyOptions() to keep backwards compatibility.
2462
2463
2464         * UIProcess/WebInspectorProxy.cpp:
2465         (WebKit::WebInspectorProxy::inspectorProcessPool):
2466         Update to call API::ProcessPoolConfiguration::createWithLegacyOptions().
2467
2468         * UIProcess/WebProcessPool.cpp:
2469         (WebKit::WebProcessPool::create):
2470         (WebKit::websiteDataStoreConfiguration):
2471         (WebKit::WebProcessPool::WebProcessPool):
2472         (WebKit::WebProcessPool::applyPlatformSpecificConfigurationDefaults): Deleted.
2473         This functionality was moved to the constructor of the API::ProcessPoolConfiguration.
2474         * UIProcess/WebProcessPool.h:
2475         Changed to take (and store) a API::ProcessPoolConfiguration rather than the WebProcessPoolConfiguration.
2476
2477         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2478         (WebKit::WebProcessPool::legacyPlatformDefaultWebSQLDatabaseDirectory):
2479         (WebKit::WebProcessPool::legacyPlatformDefaultIndexedDBDatabaseDirectory):
2480         (WebKit::WebProcessPool::legacyPlatformDefaultLocalStorageDirectory):
2481         (WebKit::WebProcessPool::legacyPlatformDefaultMediaKeysStorageDirectory):
2482         (WebKit::WebProcessPool::platformDefaultWebSQLDatabaseDirectory): Deleted.
2483         (WebKit::WebProcessPool::platformDefaultIndexedDBDatabaseDirectory): Deleted.
2484         (WebKit::WebProcessPool::platformDefaultLocalStorageDirectory): Deleted.
2485         (WebKit::WebProcessPool::platformDefaultMediaKeysStorageDirectory): Deleted.
2486         * UIProcess/efl/WebContextEfl.cpp:
2487         (WebKit::WebProcessPool::legacyPlatformDefaultWebSQLDatabaseDirectory):
2488         (WebKit::WebProcessPool::legacyPlatformDefaultIndexedDBDatabaseDirectory):
2489         (WebKit::WebProcessPool::legacyPlatformDefaultLocalStorageDirectory):
2490         (WebKit::WebProcessPool::legacyPlatformDefaultMediaKeysStorageDirectory):
2491         (WebKit::WebProcessPool::platformDefaultWebSQLDatabaseDirectory): Deleted.
2492         (WebKit::WebProcessPool::platformDefaultIndexedDBDatabaseDirectory): Deleted.
2493         (WebKit::WebProcessPool::platformDefaultLocalStorageDirectory): Deleted.
2494         (WebKit::WebProcessPool::platformDefaultMediaKeysStorageDirectory): Deleted.
2495         * UIProcess/gtk/WebProcessPoolGtk.cpp:
2496         (WebKit::WebProcessPool::legacyPlatformDefaultWebSQLDatabaseDirectory):
2497         (WebKit::WebProcessPool::legacyPlatformDefaultIndexedDBDatabaseDirectory):
2498         (WebKit::WebProcessPool::legacyPlatformDefaultLocalStorageDirectory):
2499         (WebKit::WebProcessPool::legacyPlatformDefaultMediaKeysStorageDirectory):
2500         (WebKit::WebProcessPool::platformDefaultWebSQLDatabaseDirectory): Deleted.
2501         (WebKit::WebProcessPool::platformDefaultIndexedDBDatabaseDirectory): Deleted.
2502         (WebKit::WebProcessPool::platformDefaultLocalStorageDirectory): Deleted.
2503         (WebKit::WebProcessPool::platformDefaultMediaKeysStorageDirectory): Deleted.
2504         Renamed to make it clear these were the legacy locations for these directories.
2505
2506         * WebKit2.xcodeproj/project.pbxproj:
2507         Added new files.
2508
2509 2015-01-19  Beth Dakin  <bdakin@apple.com>
2510
2511          Speculative build fix.
2512
2513         * UIProcess/API/mac/WKView.mm:
2514         (-[WKView initWithFrame:processPool:configuration:webView:]):
2515
2516 2015-01-19  Timothy Horton  <timothy_horton@apple.com>
2517
2518         Adjust naming of action menu SPI
2519         https://bugs.webkit.org/show_bug.cgi?id=140644
2520         <rdar://problem/19448129>
2521
2522         Reviewed by Brian Weinstein.
2523
2524         * UIProcess/API/mac/WKView.mm:
2525         (-[WKView initWithFrame:processPool:configuration:webView:]):
2526         * UIProcess/mac/WKActionMenuController.mm:
2527         (-[WKActionMenuController prepareForMenu:withEvent:]):
2528         (-[WKActionMenuController willOpenMenu:withEvent:]):
2529         (-[WKActionMenuController didCloseMenu:withEvent:]):
2530         (-[WKActionMenuController menuNeedsUpdate:]):
2531         (-[WKActionMenuController _updateActionMenuItems]):
2532
2533 2015-01-19  Zan Dobersek  <zdobersek@igalia.com>
2534
2535         [CoordinatedGraphics] Use C++ lambda instead of WTF::bind() in ThreadedCompositor::updateSceneState()
2536         https://bugs.webkit.org/show_bug.cgi?id=140613
2537
2538         Reviewed by Carlos Garcia Campos.
2539
2540         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
2541         (WebKit::ThreadedCompositor::updateSceneState): Replace the use of WTF::bind() with a C++ lambda.
2542
2543 2015-01-19  Commit Queue  <commit-queue@webkit.org>
2544
2545         Unreviewed, rolling out r178653.
2546         https://bugs.webkit.org/show_bug.cgi?id=140634
2547
2548         Broke multiple SVG tests on Mountain Lion (Requested by ap on
2549         #webkit).
2550
2551         Reverted changeset:
2552
2553         "[SVG -> OTF Converter] Flip the switch on"
2554         https://bugs.webkit.org/show_bug.cgi?id=140592
2555         http://trac.webkit.org/changeset/178653
2556
2557 2015-01-19  Dean Jackson  <dino@apple.com>
2558
2559         Add "override" to fix the build with newer clangs.
2560
2561         * UIProcess/Cocoa/WebProcessProxyCocoa.mm:
2562         (WebKit::WebProcessProxy::transformHandlesToObjects):
2563         (WebKit::WebProcessProxy::transformObjectsToHandles):
2564         * UIProcess/WebProcessProxy.cpp:
2565         (WebKit::WebProcessProxy::transformObjectsToHandles):
2566         * UIProcess/ios/WebVideoFullscreenManagerProxy.h:
2567         * WebProcess/cocoa/WebProcessCocoa.mm:
2568         (WebKit::WebProcess::transformHandlesToObjects):
2569         (WebKit::WebProcess::transformObjectsToHandles):
2570
2571 2015-01-19  Myles C. Maxfield  <mmaxfield@apple.com>
2572
2573         [SVG -> OTF Converter] Flip the switch on
2574         https://bugs.webkit.org/show_bug.cgi?id=140592
2575
2576         Reviewed by Antti Koivisto.
2577
2578         * Configurations/FeatureDefines.xcconfig:
2579
2580 2015-01-18  Daniel Bates  <dabates@apple.com>
2581
2582         Attempt to fix the iOS build after <http://trac.webkit.org/changeset/178631>
2583         (https://bugs.webkit.org/show_bug.cgi?id=129441)
2584
2585         * UIProcess/WKInspectorHighlightView.mm:
2586         (-[WKInspectorHighlightView update:]): Substitute HighlightType::Node and
2587         HighlightType::Rects for HighlightTypeNode and HighlightTypeRects, respectively.
2588         * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
2589         (WebKit::WebInspectorClient::highlight): Pass lvalue reference to WebCore::Highlight
2590         instead of pointer in call to InspectorController::getHighlight().
2591
2592 2015-01-18  Sam Weinig  <sam@webkit.org>
2593
2594         Fix style issues and add availability macros missed in r178634
2595         https://bugs.webkit.org/show_bug.cgi?id=140597
2596
2597         Reviewed by Dan Bernstein.
2598
2599         * UIProcess/API/Cocoa/WKUserContentControllerPrivate.h:
2600         Add missing availability macros.
2601
2602         * UIProcess/API/Cocoa/_WKUserContentFilter.h:
2603         * UIProcess/API/Cocoa/_WKUserContentFilter.mm:
2604         (-[_WKUserContentFilter initWithName:serializedRules:]):
2605         (-[_WKUserContentFilter _initWithName:serializedRules:]): Deleted.
2606         Removed unnecessary leading underscore from init method.
2607
2608 2015-01-17  Sam Weinig  <sam@webkit.org>
2609
2610         Add initial experimental user content filtering API
2611         https://bugs.webkit.org/show_bug.cgi?id=140584
2612
2613         Reviewed by Benjamin Poulain.
2614
2615         Moves content filtering from being per-ProcessPool to per-UserContentController.
2616
2617         * Shared/API/APIObject.h:
2618         * Shared/API/c/WKBase.h:
2619         * UIProcess/API/APIUserContentFilter.cpp: Added.
2620         (API::UserContentFilter::UserContentFilter):
2621         (API::UserContentFilter::~UserContentFilter):
2622         * UIProcess/API/APIUserContentFilter.h: Added.
2623         * UIProcess/API/C/WKAPICast.h:
2624         * UIProcess/API/C/WKUserContentFilterRef.cpp: Added.
2625         (WKUserContentFilterGetTypeID):
2626         (WKUserContentFilterCreate):
2627         * UIProcess/API/C/WKUserContentFilterRef.h: Added.
2628         * UIProcess/API/C/WebKit2_C.h:
2629         * UIProcess/API/Cocoa/_WKUserContentFilter.h: Added.
2630         * UIProcess/API/Cocoa/_WKUserContentFilter.mm: Added.
2631         (WKUserContentControllerAddUserContentFilter):
2632         (WKUserContentControllerRemoveAllUserContentFilters):
2633         (-[_WKUserContentFilter _initWithName:ruleList:]):
2634         * UIProcess/API/Cocoa/_WKUserContentFilterInternal.h: Added.
2635         Add a basic UserContentFilter type and expose it via both the Objective-C API (as _WKUserContentFilter)
2636         and via the C SPI (as WKUserContentFilterRef).
2637
2638         * UIProcess/API/C/WKUserContentControllerRef.h:
2639         * UIProcess/API/C/WKUserContentControllerRef.cpp:
2640         Add C-SPI to set and remove WKUserContentFilterRefs.
2641
2642         * UIProcess/API/Cocoa/WKProcessPool.mm:
2643         (-[WKProcessPool _loadContentExtensionWithIdentifier:serializedRules:successCompletionHandler:errorCompletionHandler:]): Deleted.
2644         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
2645         * UIProcess/WebProcessPool.cpp:
2646         (WebKit::WebProcessPool::processDidFinishLaunching):
2647         (WebKit::WebProcessPool::loadContentExtension): Deleted.
2648         * UIProcess/WebProcessPool.h:
2649         * WebProcess/WebProcess.cpp:
2650         (WebKit::WebProcess::loadContentExtension): Deleted.
2651         * WebProcess/WebProcess.h:
2652         * WebProcess/WebProcess.messages.in:
2653         Remove the old SPI for loading content filters that was per-ProcessPool. Content filters now follow
2654         the same pattern as UserScripts and UserStyleSheets as being per-UserContentController.
2655
2656         * UIProcess/API/Cocoa/WKUserContentController.mm:
2657         (-[WKUserContentController _addUserContentFilter:]):
2658         (-[WKUserContentController _removeAllUserContentFilters]):
2659         * UIProcess/API/Cocoa/WKUserContentControllerInternal.h:
2660         * UIProcess/API/Cocoa/WKUserContentControllerPrivate.h: Added.
2661         * UIProcess/UserContent/WebUserContentControllerProxy.cpp:
2662         (WebKit::WebUserContentControllerProxy::WebUserContentControllerProxy):
2663         (WebKit::WebUserContentControllerProxy::addProcess):
2664         (WebKit::WebUserContentControllerProxy::addUserContentFilter):
2665         (WebKit::WebUserContentControllerProxy::removeAllUserContentFilters):
2666         * UIProcess/UserContent/WebUserContentControllerProxy.h:
2667         * WebProcess/UserContent/WebUserContentController.cpp:
2668         (WebKit::WebUserContentController::addUserContentFilters):
2669         (WebKit::WebUserContentController::removeAllUserContentFilters):
2670         * WebProcess/UserContent/WebUserContentController.h:
2671         * WebProcess/UserContent/WebUserContentController.messages.in:
2672         Pipe user content filters over to all the WebProcesses that the UserContentController is
2673         connected to.
2674
2675         * WebKit2.xcodeproj/project.pbxproj:
2676         Add new files.
2677
2678 2015-01-17  Chris Dumez  <cdumez@apple.com>
2679
2680         [WK2][iOS] Add Cocoa delegate for logging diagnostic messages
2681         https://bugs.webkit.org/show_bug.cgi?id=140410
2682
2683         Reviewed by Sam Weinig.
2684
2685         Add Cocoa delegate for logging diagnostic messages.
2686
2687         * UIProcess/API/APIDiagnosticLoggingClient.h: Copied from Source/WebKit2/UIProcess/WebPageDiagnosticLoggingClient.h.
2688         (API::DiagnosticLoggingClient::~DiagnosticLoggingClient):
2689         (API::DiagnosticLoggingClient::logDiagnosticMessage):
2690         (API::DiagnosticLoggingClient::logDiagnosticMessageWithResult):
2691         (API::DiagnosticLoggingClient::logDiagnosticMessageWithValue):
2692         * UIProcess/API/C/WKPage.cpp:
2693         (WKPageSetPageDiagnosticLoggingClient):
2694         * UIProcess/API/Cocoa/WKWebView.mm:
2695         (-[WKWebView initWithFrame:configuration:]):
2696         (-[WKWebView _diagnosticLoggingDelegate]):
2697         (-[WKWebView _setDiagnosticLoggingDelegate:]):
2698         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2699         * UIProcess/API/Cocoa/_WKDiagnosticLoggingDelegate.h: Copied from Source/WebKit2/UIProcess/WebPageDiagnosticLoggingClient.h.
2700         * UIProcess/Cocoa/DiagnosticLoggingClient.h: Copied from Source/WebKit2/UIProcess/WebPageDiagnosticLoggingClient.h.
2701         * UIProcess/Cocoa/DiagnosticLoggingClient.mm: Added.
2702         (WebKit::DiagnosticLoggingClient::DiagnosticLoggingClient):
2703         (WebKit::DiagnosticLoggingClient::delegate):
2704         (WebKit::DiagnosticLoggingClient::setDelegate):
2705         (WebKit::DiagnosticLoggingClient::logDiagnosticMessage):
2706         (WebKit::DiagnosticLoggingClient::logDiagnosticMessageWithResult):
2707         (WebKit::DiagnosticLoggingClient::logDiagnosticMessageWithValue):
2708         * UIProcess/WebPageDiagnosticLoggingClient.cpp:
2709         (WebKit::WebPageDiagnosticLoggingClient::WebPageDiagnosticLoggingClient):
2710         * UIProcess/WebPageDiagnosticLoggingClient.h:
2711         * UIProcess/WebPageProxy.cpp:
2712         (WebKit::WebPageProxy::WebPageProxy):
2713         (WebKit::WebPageProxy::setDiagnosticLoggingClient):
2714         (WebKit::WebPageProxy::close):
2715         (WebKit::WebPageProxy::logDiagnosticMessage):
2716         (WebKit::WebPageProxy::logDiagnosticMessageWithResult):
2717         (WebKit::WebPageProxy::logDiagnosticMessageWithValue):
2718         (WebKit::WebPageProxy::initializeDiagnosticLoggingClient): Deleted.
2719         * UIProcess/WebPageProxy.h:
2720         (WebKit::WebPageProxy::diagnosticLoggingClient):
2721         * WebKit2.xcodeproj/project.pbxproj:
2722
2723 2015-01-17  David Kilzer  <ddkilzer@apple.com>
2724
2725         REGRESSION (r178618): Change to WKWebViewConfiguration broke iOS build
2726         <https://bugs.webkit.org/show_bug.cgi?id=140559>
2727
2728         Blind fix to address the following build failure:
2729
2730             Source/WebKit2/UIProcess/API/Cocoa/WKWebViewConfiguration.mm:79:7: error: interface type cannot be statically allocated
2731                 T m_value;
2732                   ^
2733                   *
2734             Source/WebKit2/UIProcess/API/Cocoa/WKWebViewConfiguration.mm:94:55: note: in instantiation of template class 'LazyInitialized<WKWebViewContentProviderRegistry>' requested here
2735                 LazyInitialized<WKWebViewContentProviderRegistry> _contentProviderRegistry;
2736                                                                   ^
2737             Source/WebKit2/UIProcess/API/Cocoa/WKWebViewConfiguration.mm:53:21: error: assigning to 'WKWebViewContentProviderRegistry *' from incompatible type 'RetainPtr<WKWebViewContentProviderRegistry *>'
2738                         m_value = f();
2739                                 ^ ~~~
2740             Source/WebKit2/UIProcess/API/Cocoa/WKWebViewConfiguration.mm:222:37: note: in instantiation of function template specialization 'LazyInitialized<WKWebViewContentProviderRegistry>::get<(lambda at Source/WebKit2/UIProcess/API/Cocoa/WKWebViewConfiguration.mm:222:41)>' requested here
2741                 return _contentProviderRegistry.get([] { return adoptNS([[WKWebViewContentProviderRegistry alloc] init]); });
2742                                                 ^
2743             Source/WebKit2/UIProcess/API/Cocoa/WKWebViewConfiguration.mm:57:24: error: property 'get' not found on object of type 'WKWebViewContentProviderRegistry *'
2744                     return m_value.get();
2745                                    ^
2746             3 errors generated.
2747
2748         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: Change
2749         _contentProviderRegistry to be a LazyInitialized<RetainPtr<>> to
2750         match other instance variables.
2751
2752 2015-01-16  Sam Weinig  <sam@webkit.org>
2753
2754         Add a basic configuration object for WKView
2755         https://bugs.webkit.org/show_bug.cgi?id=140559
2756
2757         Reviewed by Anders Carlsson.
2758
2759         - Adds WKPageConfigurationRef (backed by API::PageConfiguration). WKWebView configuration
2760           is not yet bridged to this, but that will happen soon. For now, it has a few basic
2761           configuration options.
2762         - Adds WKUserContentControllerRef as C-SPI version of WKUserContentController.
2763         - Adds WKUserScriptRef as C-SPI version of WKUserScript.
2764
2765         * Shared/API/APIObject.h:
2766         * Shared/API/c/WKBase.h:
2767         * Shared/API/c/WKSharedAPICast.h:
2768         (WebKit::toWKUserScriptInjectionTime):
2769         * UIProcess/API/APIPageConfiguration.cpp: Added.
2770         (API::PageConfiguration::PageConfiguration):
2771         (API::PageConfiguration::~PageConfiguration):
2772         (API::PageConfiguration::processPool):
2773         (API::PageConfiguration::setProcessPool):
2774         (API::PageConfiguration::userContentController):
2775         (API::PageConfiguration::setUserContentController):
2776         (API::PageConfiguration::pageGroup):
2777         (API::PageConfiguration::setPageGroup):
2778         (API::PageConfiguration::preferences):
2779         (API::PageConfiguration::setPreferences):
2780         (API::PageConfiguration::relatedPage):
2781         (API::PageConfiguration::setRelatedPage):
2782         (API::PageConfiguration::webPageConfiguration):
2783         * UIProcess/API/APIPageConfiguration.h: Added.
2784         (API::PageConfiguration::create):
2785         * UIProcess/API/APIUserScript.cpp: Added.
2786         (API::generateIdentifier):
2787         (API::UserScript::generateUniqueURL):
2788         * UIProcess/API/APIUserScript.h:
2789         * UIProcess/API/C/WKAPICast.h:
2790         * UIProcess/API/C/WKPageConfigurationRef.cpp: Added.
2791         (WKPageConfigurationGetTypeID):
2792         (WKPageConfigurationCreate):
2793         (WKPageConfigurationGetContext):
2794         (WKPageConfigurationSetContext):
2795         (WKPageConfigurationGetPageGroup):
2796         (WKPageConfigurationSetPageGroup):
2797         (WKPageConfigurationGetUserContentController):
2798         (WKPageConfigurationSetUserContentController):
2799         (WKPageConfigurationGetPreferences):
2800         (WKPageConfigurationSetPreferences):
2801         (WKPageConfigurationGetRelatedPage):
2802         (WKPageConfigurationSetRelatedPage):
2803         * UIProcess/API/C/WKPageConfigurationRef.h: Added.
2804         * UIProcess/API/C/WKUserContentControllerRef.cpp: Added.
2805         (WKUserContentControllerGetTypeID):
2806         (WKUserContentControllerCreate):
2807         (WKUserContentControllerCopyUserScripts):
2808         (WKUserContentControllerAddUserScript):
2809         (WKUserContentControllerRemoveAllUserScripts):
2810         * UIProcess/API/C/WKUserContentControllerRef.h: Added.
2811         * UIProcess/API/C/WKUserScriptRef.cpp: Added.
2812         (WKUserScriptGetTypeID):
2813         (WKUserScriptCreateWithSource):
2814         (WKUserScriptCopySource):
2815         (WKUserScriptGetInjectionTime):
2816         (WKUserScriptGetMainFrameOnly):
2817         * UIProcess/API/C/WKUserScriptRef.h: Added.
2818         * UIProcess/API/C/WebKit2_C.h:
2819         * UIProcess/API/Cocoa/WKUserScript.mm:
2820         (-[WKUserScript initWithSource:injectionTime:forMainFrameOnly:]):
2821         (generateIdentifier): Deleted.
2822         * UIProcess/API/Cocoa/WKViewPrivate.h:
2823         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
2824         (LazyInitialized::get):
2825         (LazyInitialized::set):
2826         (LazyInitialized::peek):
2827         * UIProcess/API/mac/WKView.mm:
2828         (-[WKView initWithFrame:configurationRef:]):
2829         * UIProcess/UserContent/WebUserContentControllerProxy.h:
2830         (WebKit::WebUserContentControllerProxy::create):
2831         * WebKit2.xcodeproj/project.pbxproj:
2832
2833 2015-01-16  Anders Carlsson  <andersca@apple.com>
2834
2835         Pass the connection along to WebProcessLifetimeTracker
2836         https://bugs.webkit.org/show_bug.cgi?id=140569
2837
2838         Reviewed by Andreas Kling.
2839
2840         * UIProcess/WebPageProxy.cpp:
2841         (WebKit::WebPageProxy::connectionWillOpen):
2842         (WebKit::WebPageProxy::connectionDidClose):
2843         * UIProcess/WebProcessLifetimeTracker.cpp:
2844         (WebKit::WebProcessLifetimeTracker::connectionWillOpen):
2845         (WebKit::WebProcessLifetimeTracker::connectionDidClose):
2846         (WebKit::WebProcessLifetimeTracker::connectionWillClose): Deleted.
2847         * UIProcess/WebProcessLifetimeTracker.h:
2848
2849 2015-01-16  Anders Carlsson  <andersca@apple.com>
2850
2851         More WebPageProxy CTTE
2852         https://bugs.webkit.org/show_bug.cgi?id=140565
2853
2854         Reviewed by Andreas Kling.
2855
2856         * UIProcess/WebPageProxy.cpp:
2857         (WebKit::WebPageProxy::connectionWillOpen):
2858         (WebKit::WebPageProxy::connectionDidClose):
2859         (WebKit::WebPageProxy::connectionWillClose): Deleted.
2860         * UIProcess/WebPageProxy.h:
2861         * UIProcess/WebProcessProxy.cpp:
2862         (WebKit::WebProcessProxy::connectionWillOpen):
2863         (WebKit::WebProcessProxy::connectionDidClose):
2864
2865 2015-01-16  Anders Carlsson  <andersca@apple.com>
2866
2867         Remove dead code
2868         https://bugs.webkit.org/show_bug.cgi?id=140563
2869
2870         Reviewed by Geoffrey Garen.
2871
2872         * UIProcess/WebProcessPool.cpp:
2873         (WebKit::WebProcessPool::processWillOpenConnection): Deleted.
2874         (WebKit::WebProcessPool::processWillCloseConnection): Deleted.
2875         * UIProcess/WebProcessPool.h:
2876         * UIProcess/WebProcessProxy.cpp:
2877         (WebKit::WebProcessProxy::connectionWillOpen):
2878         (WebKit::WebProcessProxy::connectionDidClose):
2879
2880 2015-01-16  Anders Carlsson  <andersca@apple.com>
2881
2882         Sprinkle some CTTE in ChildProcessProxy member functions
2883         https://bugs.webkit.org/show_bug.cgi?id=140562
2884
2885         Reviewed by Andreas Kling.
2886
2887         * Shared/ChildProcessProxy.cpp:
2888         (WebKit::ChildProcessProxy::didFinishLaunching):
2889         (WebKit::ChildProcessProxy::clearConnection):
2890         (WebKit::ChildProcessProxy::connectionWillOpen):
2891         (WebKit::ChildProcessProxy::connectionDidClose):
2892         (WebKit::ChildProcessProxy::connectionWillClose): Deleted.
2893         * Shared/ChildProcessProxy.h:
2894         * UIProcess/Databases/DatabaseProcessProxy.cpp:
2895         (WebKit::DatabaseProcessProxy::connectionWillOpen): Deleted.
2896         (WebKit::DatabaseProcessProxy::connectionWillClose): Deleted.
2897         * UIProcess/Databases/DatabaseProcessProxy.h:
2898         * UIProcess/Network/NetworkProcessProxy.cpp:
2899         (WebKit::NetworkProcessProxy::connectionWillOpen):
2900         (WebKit::NetworkProcessProxy::connectionWillClose): Deleted.
2901         * UIProcess/Network/NetworkProcessProxy.h:
2902         * UIProcess/WebProcessProxy.cpp:
2903         (WebKit::WebProcessProxy::connectionWillOpen):
2904         (WebKit::WebProcessProxy::connectionDidClose):
2905         (WebKit::WebProcessProxy::connectionWillClose): Deleted.
2906         * UIProcess/WebProcessProxy.h:
2907         * UIProcess/mac/SecItemShimProxy.cpp:
2908         (WebKit::SecItemShimProxy::initializeConnection):
2909         * UIProcess/mac/SecItemShimProxy.h:
2910
2911 2015-01-16  Beth Dakin  <bdakin@apple.com>
2912
2913         Should cancel immediate action sooner in WK2
2914         https://bugs.webkit.org/show_bug.cgi?id=140561
2915         -and corresponding-
2916         rdar://problem/19490114
2917
2918         Reviewed by Tim Horton.
2919
2920         _cancelImmediateActionIfNeeded will cancel the immediate action if there is no 
2921         animation controller or if the DDActionContext doesn’t want to use its actions.
2922         * UIProcess/mac/WKImmediateActionController.mm:
2923         (-[WKImmediateActionController _cancelImmediateActionIfNeeded]):
2924
2925         Call _cancelImmediateActionIfNeeded to cancel earlier.
2926         (-[WKImmediateActionController didPerformActionMenuHitTest:userData:]):
2927
2928         Re-factor this code to use the newly-added method _cancelImmediateActionIfNeeded
2929         (-[WKImmediateActionController immediateActionRecognizerWillBeginAnimation:]):
2930
2931 2015-01-16  Anders Carlsson  <andersca@apple.com>
2932
2933         Don't try to send SetSession messages before the web page has been constructed in the web process
2934         https://bugs.webkit.org/show_bug.cgi?id=140558
2935
2936         Reviewed by Andreas Kling.
2937
2938         * UIProcess/WebPageProxy.cpp:
2939         (WebKit::WebPageProxy::WebPageProxy):
2940         We already send the session ID along in the page creation parameters so just message the network process
2941         if we need to create an ephemeral session.
2942
2943         (WebKit::WebPageProxy::setSessionID):
2944         Add an isValid call for good measure.
2945
2946 2015-01-16  Anders Carlsson  <andersca@apple.com>
2947
2948         Log unhandled messages in the web process
2949         https://bugs.webkit.org/show_bug.cgi?id=140549
2950
2951         Reviewed by Andreas Kling.
2952
2953         * WebProcess/WebProcess.cpp:
2954         (WebKit::WebProcess::didReceiveSyncMessage):
2955         (WebKit::WebProcess::didReceiveMessage):
2956
2957 2015-01-16  Shivakumar JM  <shiva.jm@samsung.com>
2958
2959         Fix build warning in WebKit2/UIProcess module.
2960         https://bugs.webkit.org/show_bug.cgi?id=140538
2961
2962         Reviewed by Csaba Osztrogonác.
2963
2964         Fix build warnings by removing parameter name from functions
2965
2966         * UIProcess/Storage/StorageManager.cpp:
2967         (WebKit::StorageManager::processWillOpenConnection):
2968         (WebKit::StorageManager::processDidCloseConnection):
2969         * UIProcess/WebProcessPool.cpp:
2970         (WebKit::WebProcessPool::processWillOpenConnection):
2971         (WebKit::WebProcessPool::processWillCloseConnection):
2972
2973 2015-01-15  Csaba Osztrogonác  <ossy@webkit.org>
2974
2975         Remove ENABLE(SQL_DATABASE) guards
2976         https://bugs.webkit.org/show_bug.cgi?id=140434
2977
2978         Reviewed by Darin Adler.
2979
2980         * Configurations/FeatureDefines.xcconfig:
2981         * Shared/OriginAndDatabases.cpp:
2982         * Shared/OriginAndDatabases.h:
2983         * Shared/WebCoreArgumentCoders.cpp:
2984         * UIProcess/API/C/WKContext.cpp:
2985         (WKContextGetDatabaseManager):
2986         * UIProcess/API/C/WKDatabaseManager.cpp:
2987         (WKDatabaseManagerGetTypeID):
2988         (WKDatabaseManagerGetOriginKey):
2989         (WKDatabaseManagerGetOriginQuotaKey):
2990         (WKDatabaseManagerGetOriginUsageKey):
2991         (WKDatabaseManagerGetDatabaseDetailsKey):
2992         (WKDatabaseManagerGetDatabaseDetailsNameKey):
2993         (WKDatabaseManagerGetDatabaseDetailsDisplayNameKey):
2994         (WKDatabaseManagerGetDatabaseDetailsExpectedUsageKey):
2995         (WKDatabaseManagerGetDatabaseDetailsCurrentUsageKey):
2996         (WKDatabaseManagerGetDatabaseDetailsCreationTimeKey):
2997         (WKDatabaseManagerGetDatabaseDetailsModificationTimeKey):
2998         (WKDatabaseManagerSetClient):
2999         (WKDatabaseManagerGetDatabasesByOrigin):
3000         (WKDatabaseManagerGetDatabaseOrigins):
3001         (WKDatabaseManagerDeleteDatabasesWithNameForOrigin):
3002         (WKDatabaseManagerDeleteDatabasesForOrigin):
3003         (WKDatabaseManagerDeleteAllDatabases):
3004         (WKDatabaseManagerSetQuotaForOrigin):
3005         * UIProcess/API/efl/EwkView.cpp:
3006         (EwkView::informDatabaseQuotaReached):
3007         * UIProcess/WebDatabaseManagerProxy.cpp:
3008         * UIProcess/WebDatabaseManagerProxy.h:
3009         * UIProcess/WebDatabaseManagerProxy.messages.in:
3010         * UIProcess/WebProcessPool.cpp:
3011         * UIProcess/efl/PageUIClientEfl.cpp:
3012         (WebKit::PageUIClientEfl::PageUIClientEfl):
3013         (WebKit::PageUIClientEfl::exceededDatabaseQuota):
3014         * UIProcess/efl/PageUIClientEfl.h:
3015         * WebProcess/InjectedBundle/InjectedBundle.cpp:
3016         (WebKit::InjectedBundle::clearAllDatabases):
3017         (WebKit::InjectedBundle::setDatabaseQuota):
3018         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3019         (WebKit::WebChromeClient::exceededDatabaseQuota):
3020         * WebProcess/WebCoreSupport/WebChromeClient.h:
3021         * WebProcess/WebCoreSupport/WebDatabaseManager.cpp:
3022         * WebProcess/WebCoreSupport/WebDatabaseManager.h:
3023         * WebProcess/WebCoreSupport/WebDatabaseManager.messages.in:
3024         * WebProcess/WebCoreSupport/WebSQLiteDatabaseTracker.cpp:
3025         * WebProcess/WebCoreSupport/WebSQLiteDatabaseTracker.h:
3026         * WebProcess/WebPage/WebPage.cpp:
3027         (WebKit::WebPage::updatePreferences):
3028         * WebProcess/WebProcess.cpp:
3029         (WebKit::WebProcess::WebProcess):
3030
3031 2015-01-15  Anders Carlsson  <andersca@apple.com>
3032
3033         Add a connection parameter to StorageManager willOpen/didClose functions
3034         https://bugs.webkit.org/show_bug.cgi?id=140527
3035
3036         Reviewed by Tim Horton.
3037
3038         Rename processWillCloseConnection to processDidCloseConnection and pass connections
3039         to both functions since in the near future we won't be able to get the connection from 
3040         the web process proxy in these scenarios.
3041
3042         * UIProcess/Storage/StorageManager.cpp:
3043         (WebKit::StorageManager::processWillOpenConnection):
3044         (WebKit::StorageManager::processDidCloseConnection):
3045         (WebKit::StorageManager::processWillCloseConnection): Deleted.
3046         * UIProcess/Storage/StorageManager.h:
3047         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3048         (WebKit::WebsiteDataStore::webProcessWillOpenConnection):
3049         (WebKit::WebsiteDataStore::webProcessDidCloseConnection):
3050
3051 2015-01-15  Chris Dumez  <cdumez@apple.com>
3052
3053         [WK2] Wire diagnostic logging messages through the UIProcess
3054         https://bugs.webkit.org/show_bug.cgi?id=140486
3055
3056         Reviewed by Sam Weinig.
3057
3058         Wire diagnostic logging messages through the UIProcess.
3059         Eventually, the corresponding bundle API should go away.
3060
3061         * CMakeLists.txt:
3062         Add UIProcess/WebPageDiagnosticLoggingClient.cpp to CMake.
3063
3064         * Shared/API/c/WKDiagnosticLoggingResultType.h:
3065         Extract WKDiagnosticLoggingResultType enumeration from
3066         WKBundlePageDiagnosticLoggingClient.h into its own header so that
3067         it can be shared with the new WKPageDiagnosticLoggingClient.h.
3068
3069         * Shared/API/c/WKSharedAPICast.h:
3070         (WebKit::toAPI):
3071         (WebKit::toDiagnosticLoggingResultType):
3072         Add WebCore::DiagnosticLoggingResultType <-> WKDiagnosticLoggingResultType
3073         casting functions.
3074
3075         * UIProcess/API/C/WKPage.cpp:
3076         (WKPageSetPageDiagnosticLoggingClient):
3077         * UIProcess/API/C/WKPage.h:
3078         Add WKPage API so that the application can set the DiagnosticLoggingClient.
3079
3080         * UIProcess/API/C/WKPageDiagnosticLoggingClient.h: Added.
3081         New WK2 diagnostic logging client that will eventually replace the existing
3082         WKBundlePageDiagnosticLoggingClient.h injected bundle client.
3083
3084         * UIProcess/WebPageDiagnosticLoggingClient.cpp: Copied from Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageDiagnosticLoggingClient.cpp.
3085         * UIProcess/WebPageDiagnosticLoggingClient.h: Copied from Source/WebCore/page/DiagnosticLoggingClient.h.
3086         * UIProcess/WebPageProxy.cpp:
3087         * UIProcess/WebPageProxy.h:
3088         Handle new IPC messages for logging diagnostic messages.
3089
3090         * UIProcess/WebPageProxy.messages.in:
3091         Add 3 IPC messages for logging diagnostic messages.
3092
3093         * WebKit2.xcodeproj/project.pbxproj:
3094         Add new files to XCode project.
3095
3096         * WebProcess/InjectedBundle/API/c/WKBundlePageDiagnosticLoggingClient.h:
3097         Remove WKDiagnosticLoggingResultType enum as it was moved to its own
3098         header.
3099
3100         * WebProcess/InjectedBundle/InjectedBundlePageDiagnosticLoggingClient.cpp:
3101         * WebProcess/InjectedBundle/InjectedBundlePageDiagnosticLoggingClient.h:
3102         Use WebCore::DiagnosticLoggingResultType enum type instead of
3103         WKDiagnosticLoggingResultType and call toAPI() to convert to
3104         WKDiagnosticLoggingResultType type.
3105
3106         * WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.cpp:
3107         (WebKit::WebDiagnosticLoggingClient::logDiagnosticMessage):
3108         (WebKit::WebDiagnosticLoggingClient::logDiagnosticMessageWithResult):
3109         (WebKit::WebDiagnosticLoggingClient::logDiagnosticMessageWithValue):
3110         Send IPC to WebPageProxy in addition to calling the injected bundle client.
3111
3112         * WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.h:
3113         Use new DiagnosticLoggingResultType enum instead of the old LogType one.
3114
3115 2015-01-15  Dan Bernstein  <mitz@apple.com>
3116
3117         Added availability annotations to modern Cocoa SPI.
3118
3119         Rubber-stamped by Anders Carlsson.
3120
3121         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3122
3123 2015-01-15  Anders Carlsson  <andersca@apple.com>
3124
3125         Fix assertions on the Mountain Lion bots.
3126
3127         It is allowed to call addWorkQueueMessageReceiver even if the connection is open
3128         so remove that assertion.
3129
3130         * Platform/IPC/Connection.cpp:
3131         (IPC::Connection::addWorkQueueMessageReceiver):
3132
3133 2015-01-15  Joseph Pecoraro  <pecoraro@apple.com>
3134
3135         Unreviewed build fix after r178536.
3136
3137         Initialize member variables in the proper order.
3138
3139         * UIProcess/WebPageProxy.cpp:
3140         (WebKit::WebPageProxy::WebPageProxy):
3141
3142 2015-01-15  Enrica Casucci  <enrica@apple.com>
3143
3144         [WK2] Add support for fully editable WKWebView.
3145         https://bugs.webkit.org/show_bug.cgi?id=140515
3146
3147         Reviewed by Anders Carlsson.
3148
3149         WKWebView has now a new property (_editable) to control
3150         the editability of the entire content.
3151
3152         * Shared/WebPageCreationParameters.cpp:
3153         (WebKit::WebPageCreationParameters::encode):
3154         (WebKit::WebPageCreationParameters::decode):
3155         * Shared/WebPageCreationParameters.h:
3156         * UIProcess/API/Cocoa/WKWebView.mm:
3157         (-[WKWebView _isEditable]):
3158         (-[WKWebView _setEditable:]):
3159         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3160         * UIProcess/API/mac/WKView.mm:
3161         * UIProcess/WebPageProxy.cpp:
3162         (WebKit::WebPageProxy::WebPageProxy):
3163         (WebKit::WebPageProxy::setEditable):
3164         (WebKit::WebPageProxy::creationParameters):
3165         * UIProcess/WebPageProxy.h:
3166         (WebKit::WebPageProxy::isEditable):
3167         * WebProcess/WebPage/WebPage.cpp:
3168         (WebKit::WebPage::setEditable):
3169         * WebProcess/WebPage/WebPage.h:
3170         * WebProcess/WebPage/WebPage.messages.in:
3171
3172 2015-01-15  Anders Carlsson  <andersca@apple.com>
3173
3174         Clearing the website data store should clear local storage
3175         https://bugs.webkit.org/show_bug.cgi?id=140507
3176
3177         Reviewed by Andreas Kling.
3178
3179         * Shared/WebsiteData/WebsiteDataTypes.h:
3180         Add WebsiteDataTypeLocalStorage.
3181
3182         * UIProcess/API/Cocoa/_WKWebsiteDataStore.h:
3183         Add WKWebsiteDataTypeLocalStorage
3184
3185         * UIProcess/API/Cocoa/_WKWebsiteDataStore.mm:
3186         (toWebsiteDataTypes):
3187         Handle WKWebsiteDataTypeLocalStorage.
3188
3189         * UIProcess/Storage/LocalStorageDatabaseTracker.cpp:
3190         (WebKit::fileModificationTime):
3191         Use an early return.
3192
3193         (WebKit::LocalStorageDatabaseTracker::deleteDatabasesModifiedSince):
3194         Change this to take an std::chrono::system_clock::time_point and don't
3195         try to modifiy m_origins while iterating it.
3196
3197         * UIProcess/Storage/LocalStorageDatabaseTracker.h:
3198         Update declarations.
3199
3200         * UIProcess/Storage/StorageManager.cpp:
3201         (WebKit::StorageManager::deleteLocalStorageOriginsModifiedSince):
3202         Change this to take an std::chrono::system_clock::time_point.
3203
3204         * UIProcess/Storage/StorageManager.h:
3205         Update declarations.
3206
3207         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3208         (WebKit::WebsiteDataStore::removeData):
3209         Remove data from the storage manager as well.
3210
3211 2015-01-15  Anders Carlsson  <andersca@apple.com>
3212
3213         Give WebsiteDataStore a StorageManager
3214         https://bugs.webkit.org/show_bug.cgi?id=140505
3215
3216         Reviewed by Andreas Kling.
3217
3218         The process pool storage manager is still around but is only used for clearing data. It will be removed
3219         completely in an upcoming commit.
3220
3221         * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
3222         (API::WebsiteDataStore::defaultDataStoreConfiguration):
3223         Set up the local storage directory.
3224
3225         * UIProcess/API/Cocoa/WKProcessPool.mm:
3226         (websiteDataDirectoryURL):
3227         Export this so it can be called from APIWebsiteDataStoreCocoa.
3228
3229         * UIProcess/WebPageProxy.cpp:
3230         (WebKit::WebPageProxy::createNewPage):
3231         Call WebsiteDataStore::cloneSessionData instead.
3232
3233         * UIProcess/WebPageProxy.h:
3234         (WebKit::WebPageProxy::websiteDataStore):
3235         Add getter.
3236
3237         * UIProcess/WebProcessPool.cpp:
3238         (WebKit::websiteDataStoreConfiguration):
3239         Update this to take a WebProcessPoolConfiguration object and assign the local storage directory.
3240
3241         (WebKit::WebProcessPool::WebProcessPool):
3242         Pass the configuration to websiteDataStoreConfiguration.
3243
3244         (WebKit::WebProcessPool::processWillOpenConnection):
3245         (WebKit::WebProcessPool::processWillCloseConnection):
3246         Remove storage manager calls.
3247
3248         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3249         (WebKit::WebsiteDataStore::WebsiteDataStore):
3250         When creating a persistent data store, also create a storage manager.
3251
3252         (WebKit::WebsiteDataStore::cloneSessionData):
3253         Clone the session storage namespace.
3254
3255         (WebKit::WebsiteDataStore::webPageWasAdded):
3256         Create a session storage namespace for this page.
3257
3258         (WebKit::WebsiteDataStore::webPageWasRemoved):
3259         Destroy the session storage namespace.
3260
3261         (WebKit::WebsiteDataStore::webProcessWillOpenConnection):
3262         Tell the storage manager about the new process connection.
3263
3264         (WebKit::WebsiteDataStore::webPageWillOpenConnection):
3265         Set the allowed connection.
3266
3267         (WebKit::WebsiteDataStore::webPageDidCloseConnection):
3268         Clear the allowed connection.
3269
3270         (WebKit::WebsiteDataStore::webProcessDidCloseConnection):
3271         Tell the storage manager that the process connection has been closed.
3272
3273         * UIProcess/WebsiteData/WebsiteDataStore.h:
3274         Add new members.
3275
3276 2015-01-15  Anders Carlsson  <andersca@apple.com>
3277
3278         More work on the lifetime observer
3279         https://bugs.webkit.org/show_bug.cgi?id=140500
3280
3281         Reviewed by Andreas Kling.
3282
3283         Add webPageWasAdded/webPageWasRemoved functions; these will be called first and last during the
3284         lifetime of the web page. Also remove removeObserver since nobody is calling it.
3285
3286         * UIProcess/WebProcessLifetimeObserver.h:
3287         (WebKit::WebProcessLifetimeObserver::webPageWasAdded):
3288         (WebKit::WebProcessLifetimeObserver::webPageWasRemoved):
3289         * UIProcess/WebProcessLifetimeTracker.cpp:
3290         (WebKit::WebProcessLifetimeTracker::addObserver):
3291         (WebKit::WebProcessLifetimeTracker::pageWasInvalidated):
3292         (WebKit::WebProcessLifetimeTracker::removeObserver): Deleted.
3293         * UIProcess/WebProcessLifetimeTracker.h:
3294
3295 2015-01-14  Anders Carlsson  <andersca@apple.com>
3296
3297         Don't pass an allowed connection when creating a session storage namespace
3298         https://bugs.webkit.org/show_bug.cgi?id=140482
3299
3300         Reviewed by Sam Weinig.
3301
3302         Instead, always call setAllowedSessionStorageNamespaceConnection. This will make it easier to
3303         move the storage manager into WebsiteDataStore and make it use the process lifetime observer machinery.
3304
3305         * UIProcess/Storage/StorageManager.cpp:
3306         (WebKit::StorageManager::SessionStorageNamespace::create):
3307         (WebKit::StorageManager::SessionStorageNamespace::SessionStorageNamespace):
3308         (WebKit::StorageManager::createSessionStorageNamespace):
3309         * UIProcess/Storage/StorageManager.h:
3310         * UIProcess/WebPageProxy.cpp:
3311         (WebKit::WebPageProxy::WebPageProxy):
3312
3313 2015-01-15  Carlos Garcia Campos  <cgarcia@igalia.com>
3314
3315         REGRESSION(r177075): [GTK] Creating a second web view disables accelerated compositing in existing web view
3316         https://bugs.webkit.org/show_bug.cgi?id=140494
3317
3318         Reviewed by Gustavo Noronha Silva.
3319
3320         The problem is that r177075 moved the creation of the redirected
3321         XComposite window to realize method, but leaving the call to
3322         webkitWebViewBaseUpdatePreferences() in both places Realize() and
3323         CreateWebPage(). webkitWebViewBaseUpdatePreferences() only updates
3324         the accelerating compositing setting nowadays, depending on
3325         whether the redirected XComposited window could be created or not
3326         (something that depends on whether XRender, XComposite and XDamage
3327         extensions are available in the current display). So, when the
3328         first web view is created, webkitWebViewBaseUpdatePreferences() is
3329         called first from CreateWebPage(), and always disabling
3330         accelerated compositing because the redirected window hasn't been
3331         created yet, and then from Realize() right after the redirected
3332         window is created so that accelerated compositing is enabled. When
3333         the second web view is created the same happens, but since
3334         settings are shared among web views, the first call to
3335         webkitWebViewBaseUpdatePreferences() from CreateWebPage() disables
3336         accelerated compositing and the web page exists accelerated
3337         compositing mode and never enters it again unless the page is
3338         reloaded. I guess the web page should enter accelerated
3339         compositing mode again when the setting is enabled again from
3340         Realize(), but since the setting is global and doesn't depend on
3341         every web view, we should never disable it once it has been
3342         enabled in any case.
3343         Since we want to enable accelerated compositing mode when the
3344         redirected XComposite window has been successfully created, we can
3345         use the SetNativeSurfaceHandleForCompositing message to enable the
3346         setting and remove webkitWebViewBaseUpdatePreferences().
3347
3348         * UIProcess/API/gtk/WebKitWebView.cpp:
3349         (webkitWebViewUpdateSettings):
3350         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
3351         (webkitWebViewBaseRealize):
3352         (webkitWebViewBaseCreateWebPage):
3353         (webkitWebViewBaseUpdatePreferences): Deleted.
3354         * UIProcess/API/gtk/WebKitWebViewBasePrivate.h:
3355         * WebProcess/WebPage/DrawingAreaImpl.cpp:
3356         (WebKit::DrawingAreaImpl::setNativeSurfaceHandleForCompositing):
3357
3358 2015-01-14  Carlos Garcia Campos  <cgarcia@igalia.com>
3359
3360         Unreviewed. Fix GTK+ build after r178464.
3361
3362         * UIProcess/API/gtk/WebKitUserContent.cpp:
3363         (_WebKitUserScript::_WebKitUserScript):
3364         (webkitUserScriptGetUserScript):
3365         * UIProcess/API/gtk/WebKitUserContentPrivate.h:
3366
3367 2015-01-14  Sam Weinig  <sam@webkit.org>
3368
3369         Convert WKUserScript to be an API::Object bridged object
3370         https://bugs.webkit.org/show_bug.cgi?id=140471
3371
3372         Reviewed by Dan Bernstein.
3373
3374         * Shared/API/APIObject.h:
3375         * Shared/Cocoa/APIObject.mm:
3376         (API::Object::newObject):
3377         Add Type::UserScript.
3378
3379         * UIProcess/API/APIUserScript.h: Added.
3380         Add API object for UserScripts.
3381
3382         * UIProcess/API/Cocoa/WKUserContentController.mm:
3383         (-[WKUserContentController init]):
3384         (-[WKUserContentController userScripts]):
3385         (-[WKUserContentController addUserScript:]):
3386         (-[WKUserContentController removeAllUserScripts]):
3387         (toWebCoreUserScriptInjectionTime): Deleted.
3388         * UIProcess/UserContent/WebUserContentControllerProxy.cpp:
3389         (WebKit::WebUserContentControllerProxy::WebUserContentControllerProxy):
3390         (WebKit::WebUserContentControllerProxy::addProcess):
3391         (WebKit::WebUserContentControllerProxy::addUserScript):
3392         (WebKit::WebUserContentControllerProxy::removeAllUserScripts):
3393         * UIProcess/UserContent/WebUserContentControllerProxy.h:
3394         (WebKit::WebUserContentControllerProxy::userScripts):
3395         Store the WKUserScripts in the WebUserContentControllerProxy instead of the
3396         Objective-C layer WKUserContentController, to allow creation of the object
3397         from either the Objective-C or C++ sides.
3398
3399         * UIProcess/API/Cocoa/WKUserScript.mm:
3400         (generateIdentifier):
3401         (-[WKUserScript initWithSource:injectionTime:forMainFrameOnly:]):
3402         (-[WKUserScript source]):
3403         (-[WKUserScript injectionTime]):
3404         (-[WKUserScript isForMainFrameOnly]):
3405         (-[WKUserScript _apiObject]):
3406         * UIProcess/API/Cocoa/WKUserScriptInternal.h:
3407         (API::wrapper):
3408         (API::toWebCoreUserScriptInjectionTime):
3409         (API::toWKUserScriptInjectionTime):
3410         Convert to get properties from the API::UserScript.
3411
3412         * WebKit2.xcodeproj/project.pbxproj:
3413         Add the new file.
3414
3415 2015-01-14  Anders Carlsson  <andersca@apple.com>
3416
3417         Add per page connection callbacks to the lifetime observer
3418         https://bugs.webkit.org/show_bug.cgi?id=140475
3419
3420         Reviewed by Andreas Kling.
3421
3422         * UIProcess/WebProcessLifetimeObserver.cpp:
3423         (WebKit::WebProcessLifetimeObserver::addWebPage):
3424         (WebKit::WebProcessLifetimeObserver::removeWebPage):
3425         * UIProcess/WebProcessLifetimeObserver.h:
3426         (WebKit::WebProcessLifetimeObserver::webPageWillOpenConnection):
3427         (WebKit::WebProcessLifetimeObserver::webPageDidCloseConnection):
3428
3429 2015-01-14  Anders Carlsson  <andersca@apple.com>
3430
3431         Make WebsiteDataStore a WebProcessLifetimeObserver
3432         https://bugs.webkit.org/show_bug.cgi?id=140472
3433
3434         Reviewed by Andreas Kling.
3435
3436         * UIProcess/WebPageProxy.cpp:
3437         (WebKit::WebPageProxy::WebPageProxy):
3438         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3439         (WebKit::WebsiteDataStore::~WebsiteDataStore):
3440         (WebKit::WebsiteDataStore::removeData):
3441         (WebKit::WebsiteDataStore::addWebPage): Deleted.
3442         (WebKit::WebsiteDataStore::removeWebPage): Deleted.
3443         * UIProcess/WebsiteData/WebsiteDataStore.h:
3444
3445 2015-01-14  Chris Dumez  <cdumez@apple.com>
3446
3447         [WK2][iOS] Add private API to toggle diagnostic logging setting
3448         https://bugs.webkit.org/show_bug.cgi?id=140464
3449
3450         Reviewed by Dan Bernstein.
3451
3452         Add private API to toggle diagnostic logging setting for iOS.
3453         Previously, there was only a WK2 private C API for this.
3454
3455         * UIProcess/API/Cocoa/WKPreferences.mm:
3456         (-[WKPreferences _diagnosticLoggingEnabled]):
3457         (-[WKPreferences _setDiagnosticLoggingEnabled:]):
3458         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
3459
3460 2015-01-14  Anders Carlsson  <andersca@apple.com>
3461
3462         Switch VisitedLinkProvider over to WebProcessLifetimeObserver
3463         https://bugs.webkit.org/show_bug.cgi?id=140469
3464
3465         Reviewed by Andreas Kling.
3466
3467         * UIProcess/VisitedLinkProvider.cpp:
3468         (WebKit::VisitedLinkProvider::~VisitedLinkProvider):
3469         (WebKit::VisitedLinkProvider::removeAll):
3470         (WebKit::VisitedLinkProvider::webProcessWillOpenConnection):
3471         (WebKit::VisitedLinkProvider::webProcessDidCloseConnection):
3472         (WebKit::VisitedLinkProvider::pendingVisitedLinksTimerFired):
3473         (WebKit::VisitedLinkProvider::resizeTable):
3474         (WebKit::VisitedLinkProvider::addProcess): Deleted.
3475         (WebKit::VisitedLinkProvider::removeProcess): Deleted.
3476         * UIProcess/VisitedLinkProvider.h:
3477         * UIProcess/WebPageProxy.cpp:
3478         (WebKit::WebPageProxy::WebPageProxy):
3479         (WebKit::WebPageProxy::processDidFinishLaunchin