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