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