6a2799968e7a974c92189f4cdf1029efc07d40f2
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2015-02-12  Antti Koivisto  <antti@apple.com>
2
3         WebKit persistent cache uses a lot of threads
4         https://bugs.webkit.org/show_bug.cgi?id=141520
5
6         Reviewed by Andreas Kling.
7
8         Parallel retrieves are limited but stores are not. We may end up with lots of backround io
9         dispatch queue threads if they don't complete fast enough.
10
11         This patch adds pending state for write operations similar to what retrieves already have
12         and limits to number of active operations.
13
14         * NetworkProcess/cache/NetworkCacheStorage.h:
15
16             Combine StoreOperation and UpdateOperation and rename to WriteOperation.
17             Rename RetrieveOperation to ReadOperation.
18             The idea is to emphasize that these are disk operations.
19
20         * NetworkProcess/cache/NetworkCacheStorageCocoa.mm:
21         (WebKit::NetworkCacheStorage::dispatchReadOperation):
22         (WebKit::NetworkCacheStorage::dispatchPendingReadOperations):
23         (WebKit::retrieveFromMemory):
24         (WebKit::NetworkCacheStorage::retrieve):
25         (WebKit::NetworkCacheStorage::store):
26         (WebKit::NetworkCacheStorage::update):
27         (WebKit::NetworkCacheStorage::dispatchPendingWriteOperations):
28
29             Only allow 3 parallel writes.
30
31         (WebKit::NetworkCacheStorage::dispatchFullWriteOperation):
32         (WebKit::NetworkCacheStorage::dispatchHeaderWriteOperation):
33
34             More informative names.
35
36         (WebKit::NetworkCacheStorage::dispatchRetrieveOperation): Deleted.
37         (WebKit::NetworkCacheStorage::dispatchPendingRetrieveOperations): Deleted.
38         (WebKit::retrieveActive): Deleted.
39
40 2015-02-12  Carlos Garcia Campos  <cgarcia@igalia.com>
41
42         [GTK] Add API to allow overriding the default color chooser implementation
43         https://bugs.webkit.org/show_bug.cgi?id=98935
44
45         Reviewed by Gustavo Noronha Silva.
46
47         Add API to allow the user to override the default UI of color
48         chooser. Similar to the file chooser API, a new run-color-chooser
49         signal is added to WebKitWebView that passes a WebKitColorChooserRequest
50         parameter to the signal.
51
52         Initial patch by Arnaud Renevier <a.renevier@sisa.samsung.com>.
53
54         * PlatformGTK.cmake: Add new files to compilation.
55         * UIProcess/API/gtk/PageClientImpl.cpp:
56         (WebKit::PageClientImpl::createColorPicker): Create a
57         WebKitColorChooser is the view widget is a WebKitWebView or a
58         WebColorPicker otherwise,
59         * UIProcess/API/gtk/WebKitColorChooser.cpp: Added.
60         (WebKit::WebKitColorChooser::create):
61         (WebKit::WebKitColorChooser::WebKitColorChooser):
62         (WebKit::WebKitColorChooser::~WebKitColorChooser):
63         (WebKit::WebKitColorChooser::endPicker): Chain up to parent class
64         when not having a request, or finish the request if we have one.
65         (WebKit::WebKitColorChooser::colorChooserRequestFinished):
66         (WebKit::WebKitColorChooser::colorChooserRequestRGBAChanged):
67         (WebKit::WebKitColorChooser::showColorPicker): Create a new
68         WebKitColorChooserRequest and emit WebKitWebView::run-color-chooser.
69         If the signal is not handled, fallback to the default color
70         chooser dialog implemented by the parent class.
71         * UIProcess/API/gtk/WebKitColorChooser.h: Added.
72         * UIProcess/API/gtk/WebKitColorChooserRequest.cpp: Added.
73         (webkitColorChooserRequestGetProperty):
74         (webkitColorChooserRequestSetProperty):
75         (webkit_color_chooser_request_class_init):
76         (webkit_color_chooser_request_set_rgba):
77         (webkit_color_chooser_request_get_rgba):
78         (webkit_color_chooser_request_get_element_rectangle):
79         (webkit_color_chooser_request_finish):
80         (webkit_color_chooser_request_cancel):
81         (webkitColorChooserRequestCreate):
82         * UIProcess/API/gtk/WebKitColorChooserRequest.h: Added.
83         * UIProcess/API/gtk/WebKitColorChooserRequestPrivate.h: Added.
84         * UIProcess/API/gtk/WebKitWebView.cpp:
85         (webkit_web_view_class_init): Add run-color-chooser signal.
86         (webkitWebViewEmitRunColorChooser): Emit run-color-chooser signal.
87         * UIProcess/API/gtk/WebKitWebView.h:
88         * UIProcess/API/gtk/WebKitWebViewPrivate.h:
89         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: Add new symbols.
90         * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml: Add new section for WebKitColorChooserRequest.
91         * UIProcess/API/gtk/webkit2.h: Include WebKitColorChooserRequest.h
92
93 2015-02-11  Enrica Casucci  <enrica@apple.com>
94
95         iOS build fix.
96
97         Unreviewed.
98
99         * UIProcess/ios/WKContentViewInteraction.mm:
100         (-[WKContentView inputAssistantItem]):
101         (-[WKContentView _inputAssistantItem]):
102
103 2015-02-11  Chris Dumez  <cdumez@apple.com>
104
105         [WK2] Add logging to validate the network cache efficacy (Part 2)
106         https://bugs.webkit.org/show_bug.cgi?id=141345
107         <rdar://problem/19632080>
108
109         Reviewed by Sam Weinig.
110
111         Add diagnostic logging messages to validate the network cache efficacy.
112         The following 4 messages are added:
113         - networkCache / retrieval / success
114         - networkCache / retrieval / unhandledRequestFailure
115         - networkCache / retrieval / noLongerInCacheFailure
116         - networkCache / retrieval / unusableCachedEntryFailure
117
118         The messages are sent via IPC from the NetworkProcess to the UIProcess,
119         where the WebPageProxy code already handles diagnostic messages sent by
120         the WebProcess.
121
122 2015-02-11  Tim Horton  <timothy_horton@apple.com>
123
124         REGRESSION (iOS 8): PDFs embedded in <object>/<embed> tag don't load at all
125         https://bugs.webkit.org/show_bug.cgi?id=141457
126         <rdar://problem/18221851>
127
128         Reviewed by Alexey Proskuryakov.
129
130         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
131         (WebKit::WebFrameLoaderClient::objectContentType):
132         On iOS, if we don't know what to do with a PDF-in-object, treat it as an image.
133
134 2015-02-11  ChangSeok Oh  <changseok.oh@collabora.com>
135
136         Activate ReliefLogger of a memory pressure handler for linux system.
137         https://bugs.webkit.org/show_bug.cgi?id=123611
138
139         Reviewed by Anders Carlsson.
140
141         * Shared/WebProcessCreationParameters.cpp:
142         (WebKit::WebProcessCreationParameters::WebProcessCreationParameters):
143         Make the parameter, shouldEnableMemoryPressureReliefLogging shareable with COCOA else systems.
144         (WebKit::WebProcessCreationParameters::encode): ditto.
145         (WebKit::WebProcessCreationParameters::decode): ditto.
146         * Shared/WebProcessCreationParameters.h:
147         * UIProcess/WebProcessPool.cpp:
148         (WebKit::WebProcessPool::createNewWebProcess): Set shouldEnableMemoryPressureReliefLogging
149         to true for linux system.
150         * WebProcess/WebProcess.cpp:
151         (WebKit::WebProcess::initializeWebProcess): Pass the shouldEnableMemoryPressureReliefLogging value
152         to MemoryPressureHandler::ReliefLogger::setLoggingEnabled().
153
154 2015-02-11  Yusuke Suzuki  <utatane.tea@gmail.com>
155
156         [GTK][EFL] Suppress a warning of unused params
157         https://bugs.webkit.org/show_bug.cgi?id=141474
158
159         Reviewed by Darin Adler.
160
161         Drop unused argument name, `directoryName`.
162
163         * UIProcess/API/APIWebsiteDataStore.cpp:
164         (API::WebsiteDataStore::websiteDataDirectoryFileSystemRepresentation):
165
166 2015-02-11  Carlos Garcia Campos  <cgarcia@igalia.com>
167
168         [GTK] Add default color chooser implementation using GtkColorChooserDialog
169         https://bugs.webkit.org/show_bug.cgi?id=141392
170
171         Reviewed by Gustavo Noronha Silva.
172
173         * PlatformGTK.cmake: Add new files to compilation.
174         * UIProcess/API/gtk/PageClientImpl.cpp:
175         (WebKit::PageClientImpl::createColorPicker): Call WebColorPickerGtk::create().
176         * UIProcess/gtk/WebColorPickerGtk.cpp: Added.
177         (WebKit::WebColorPickerGtk::create):
178         (WebKit::WebColorPickerGtk::WebColorPickerGtk):
179         (WebKit::WebColorPickerGtk::~WebColorPickerGtk):
180         (WebKit::WebColorPickerGtk::cancel): Set initial color.
181         (WebKit::WebColorPickerGtk::endPicker): Destroy the color chooser dialog.
182         (WebKit::WebColorPickerGtk::didChooseColor): Notify the client.
183         (WebKit::WebColorPickerGtk::colorChooserDialogRGBAChangedCallback):
184         Update the selected color.
185         (WebKit::WebColorPickerGtk::colorChooserDialogResponseCallback):
186         Cancel or finish the operation depending on the dialog response.
187         (WebKit::WebColorPickerGtk::showColorPicker): Create a
188         GtkColorChooserDialog to handle the color picker operation.
189         * UIProcess/gtk/WebColorPickerGtk.h: Added.
190         (WebKit::WebColorPickerGtk::initialColor):
191
192 2015-02-11  Commit Queue  <commit-queue@webkit.org>
193
194         Unreviewed, rolling out r179910.
195         https://bugs.webkit.org/show_bug.cgi?id=141464
196
197         Caused assertions on debug bots (Requested by ap on #webkit).
198
199         Reverted changeset:
200
201         "[WK2] Add logging to validate the network cache efficacy
202         (Part 2)"
203         https://bugs.webkit.org/show_bug.cgi?id=141345
204         http://trac.webkit.org/changeset/179910
205
206 2015-02-10  Chris Dumez  <cdumez@apple.com>
207
208         [WK2] Add logging to validate the network cache efficacy (Part 2)
209         https://bugs.webkit.org/show_bug.cgi?id=141345
210         <rdar://problem/19632080>
211
212         Reviewed by Antti Koivisto.
213
214         Add diagnostic logging messages to validate the network cache efficacy.
215         The following 4 messages are added:
216         - networkCache / retrieval / success
217         - networkCache / retrieval / unhandledRequestFailure
218         - networkCache / retrieval / noLongerInCacheFailure
219         - networkCache / retrieval / unusableCachedEntryFailure
220
221         The messages are sent via IPC from the NetworkProcess to the UIProcess,
222         where the WebPageProxy code already handles diagnostic messages sent by
223         the WebProcess.
224
225 2015-02-10  Conrad Shultz  <conrad_shultz@apple.com>
226
227         Clients need the ability to hook into immediate action lifecycle
228         https://bugs.webkit.org/show_bug.cgi?id=141449
229
230         Reviewed by Tim Horton.
231
232         * UIProcess/API/Cocoa/WKViewPrivate.h:
233         Expose new methods.
234
235         * UIProcess/API/mac/WKView.mm:
236         (-[WKView _prepareForImmediateActionAnimation]):
237         (-[WKView _cancelImmediateActionAnimation]):
238         (-[WKView _completeImmediateActionAnimation]):
239         Stub implementations.
240
241         * UIProcess/mac/WKImmediateActionController.mm:
242         (-[WKImmediateActionController immediateActionRecognizerWillPrepare:]):
243         Send -_prepareForImmediateActionAnimation.
244         (-[WKImmediateActionController immediateActionRecognizerDidCancelAnimation:]):
245         Send -_cancelImmediateActionAnimation.
246         (-[WKImmediateActionController immediateActionRecognizerDidCompleteAnimation:]):
247         Send -_completeImmediateActionAnimation.
248
249 2015-02-10  Dan Bernstein  <mitz@apple.com>
250
251         <rdar://problem/19770264> Starting a navigation gesture dismisses the keyboard
252
253         Reviewed by Tim Horton.
254
255         * UIProcess/ios/ViewGestureControllerIOS.mm:
256         (WebKit::ViewGestureController::beginSwipeGesture): Reordered the view hierarchy changes,
257         such that m_liveSwipeView will not momentarily move out of the window, because that causes
258         the window’s first responder to be set to nil (if it was a descendant of m_liveSwipView).
259
260 2015-02-10  Enrica Casucci  <enrica@apple.com>
261
262         Hit testing is misplaced when selecting on wikipedia page.
263         https://bugs.webkit.org/show_bug.cgi?id=141410
264         rdar://problem/19768211
265
266         Reviewed by Simon Fraser.
267
268         When loading a new document into the same WebPage object, we need
269         to clear the assisted node, since there is no guarantee that the
270         node will be blurred. The bug was caused by the use of a stale
271         assisted node to constrain the point where the gesture occurs.
272         The node was still valid, since the previous page was in the cache.
273         I've added a ASSERT to check that, when constraining the point to
274         node rectangle, the node is in the same document as the one we
275         are performing hit test on. When the frame is detached, we clear
276         the assisted node if the node is part of the document is the frame
277         being detached.
278
279         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
280         (WebKit::WebFrameLoaderClient::detachedFromParent2):
281         * WebProcess/WebPage/WebPage.h:
282         * WebProcess/WebPage/ios/WebPageIOS.mm:
283         (WebKit::constrainPoint):
284         (WebKit::WebPage::resetAssistedNodeForFrame):
285
286 2015-02-10  Joseph Pecoraro  <pecoraro@apple.com>
287
288         [Cocoa] NSData over retain in WKBrowsingContextController loadData
289         https://bugs.webkit.org/show_bug.cgi?id=141437
290
291         Reviewed by Anders Carlsson.
292
293         * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
294         (-[WKBrowsingContextController loadData:MIMEType:textEncodingName:baseURL:userData:]):
295         API::Data::createWithoutCopying will automatically do the retaining / releasing for us.
296
297 2015-02-10  Zhuo Li  <zachli@apple.com>
298
299         [WK2] Add support for registering url schemes to bypass Content Security Policy.
300         https://bugs.webkit.org/show_bug.cgi?id=140736
301
302         Reviewed by Anders Carlsson.
303
304         * Shared/WebProcessCreationParameters.cpp:
305         (WebKit::WebProcessCreationParameters::encode):
306         (WebKit::WebProcessCreationParameters::decode):
307         * Shared/WebProcessCreationParameters.h:
308         * UIProcess/API/C/WKContext.cpp:
309         (WKContextRegisterURLSchemeAsBypassingContentSecurityPolicy):
310         * UIProcess/API/C/WKContextPrivate.h:
311         * UIProcess/WebProcessPool.cpp:
312         (WebKit::WebProcessPool::createNewWebProcess):
313         (WebKit::WebProcessPool::registerURLSchemeAsBypassingContentSecurityPolicy):
314         * UIProcess/WebProcessPool.h:
315         * WebProcess/WebProcess.cpp:
316         (WebKit::WebProcess::initializeWebProcess):
317         (WebKit::WebProcess::registerURLSchemeAsBypassingContentSecurityPolicy):
318         * WebProcess/WebProcess.h:
319         * WebProcess/WebProcess.messages.in:
320
321 2015-02-10  Sanghyup Lee  <sh53.lee@samsung.com>
322
323         [EFL] Use a variable to set flicking time instead of hardcoding
324         https://bugs.webkit.org/show_bug.cgi?id=138950
325
326         Reviewed by Gyuyoung Kim.
327
328         Currently time of flick gesture animation is hardcoded as one second.
329         This patch added a static variable to increase readability.
330
331         * UIProcess/API/efl/GestureRecognizer.cpp:
332         (WebKit::GestureHandler::GestureHandler):
333         (WebKit::GestureHandler::flickAnimatorCallback):
334         (WebKit::GestureHandler::handleFlick):
335
336 2015-02-09  Enrica Casucci  <enrica@apple.com>
337
338         Selection flickers when trying to change size of selection.
339         https://bugs.webkit.org/show_bug.cgi?id=141404
340         rdar://problem/18824863
341
342         Reviewed by Benjamin Poulain.
343
344         When looking for the contracted range from the current range,
345         we were incorrectly choosing a selection whose rectangle is empty
346         as a best match candidate. This was throwing off all the logic
347         and producing a contracted range whose rectangle was bigger than the
348         expanded range, therefore producing a shrink threshold larger than the
349         growth one.
350
351         * WebProcess/WebPage/ios/WebPageIOS.mm:
352         (WebKit::WebPage::contractedRangeFromHandle):
353
354 2015-02-09  Brian J. Burg  <burg@cs.washington.edu>
355
356         REGRESSION(r179705): 2nd-level inspector availability no longer controlled by DeveloperExtrasEnabled user default
357         https://bugs.webkit.org/show_bug.cgi?id=141343
358
359         Reviewed by Timothy Hatcher.
360
361         The regression was caused by the switch to using WKWebViewConfiguration and
362         its default WebPreferences object, which is used to populate the inspector page's
363         Settings object. This WebPreferences is initialized with no identifier, so
364         only preferences in the FOR_EACH_WEBKIT_DEBUG_*_PREFERENCE macros are populated
365         from NSUserDefaults.
366
367         The simplest fix is to move DeveloperExtrasEnabled into the DEBUG group.
368
369         Previously, each inspector level had a unique identifier such as
370         __WebInspectorPageGroupLevelN__, and the n+1 level inspector was enabled
371         by toggling __WebInspectorPageGroupLevelN__.WebKit2DeveloperExrasEnabled.
372         With the move to the DEBUG group, the preference becomes simply
373         WebKitDeveloperExtrasEnabled, which enables any level of inspector.
374         (This does not clash with Safari's "Show Develop Menu" preference, which uses
375         the key "WebKitDeveloperExtrasEnabledPreferenceKey")
376
377         * Shared/WebPreferencesDefinitions.h:
378
379 2015-02-08  Antti Koivisto  <antti@apple.com>
380
381         Measure cache size more accurately
382         https://bugs.webkit.org/show_bug.cgi?id=141378
383         <rdar://problem/19760224>
384
385         Reviewed by Chris Dumez.
386
387         Estimate the cache disk space usage from the actual entry sizes instead of the item count.
388         This prevents large cache items from making the cache grow beyond its bounds.
389
390         * NetworkProcess/cache/NetworkCacheStorage.h:
391         * NetworkProcess/cache/NetworkCacheStorageCocoa.mm:
392         (WebKit::NetworkCacheStorage::initialize):
393         (WebKit::NetworkCacheStorage::removeEntry):
394         (WebKit::NetworkCacheStorage::store):
395         (WebKit::NetworkCacheStorage::clear):
396         (WebKit::NetworkCacheStorage::shrinkIfNeeded):
397
398 2015-02-09  Carlos Garcia Campos  <cgarcia@igalia.com>
399
400         REGRESSION(r179705): [GTK] The Web Inspector doesn't work after r179705
401         https://bugs.webkit.org/show_bug.cgi?id=141333
402
403         Reviewed by Žan Doberšek.
404
405         Create an initialize WebPreferences for the inspector page. This
406         was moved from cross-platform code to platform specific code.
407
408         * UIProcess/gtk/WebInspectorProxyGtk.cpp:
409         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
410
411 2015-02-08  Timothy Horton  <timothy_horton@apple.com>
412
413         Null deref in _clearImmediateActionState when closing a view with a DataDetectors popover open
414         https://bugs.webkit.org/show_bug.cgi?id=141377
415         <rdar://problem/19711203>
416
417         Reviewed by Darin Adler.
418
419         * UIProcess/mac/WKImmediateActionController.mm:
420         (-[WKImmediateActionController _clearImmediateActionState]):
421         We can have already detached the page when DataDetectors calls us back
422         in interactionStoppedHandler. While we have kept a strong reference to the
423         page in the interactionStoppedHandler block, _page is nulled out.
424         It's OK to avoid doing this work, in any case, because closing a page
425         tears down the TextIndicator anyway.
426
427 2015-02-08  Chris Dumez  <cdumez@apple.com>
428
429         [WK2] Add logging to validate the network cache efficacy (Part 1)
430         https://bugs.webkit.org/show_bug.cgi?id=141269
431         <rdar://problem/19632080>
432
433         Reviewed by Antti Koivisto.
434
435         Add console logging to validate the network cache efficacy. This will
436         tell us if how the network cache satisties requests, in particular:
437         - Request cannot be handled by the cache
438         - Entry was not in the cache but is no longer there (pruned)
439         - Entry is in the cache but is not usable
440         - Entry is in the cache and is used.
441
442         This patch introduces a SQLite-based network cache statistics storage
443         that is used to store requests we have seen before, and query if we
444         have seen a request before. The storage is lightweight as it only
445         stores hashes in the database, in a background thread.
446
447         The statistics cache is initially bootstapped from the network disk
448         cache so that we have data initially and get as accurate statistics
449         as possible from the start.
450
451         To maintain an acceptable level of performance, we have a hard limit
452         on the number of unique requests that are retained set to 100000.
453
454         Diagnostic logging for this will be added in a follow-up patch.
455
456 2015-02-07  Chris Dumez  <cdumez@apple.com>
457
458         Add Vector::removeFirstMatching() / removeAllMatching() methods taking lambda functions
459         https://bugs.webkit.org/show_bug.cgi?id=141321
460
461         Reviewed by Darin Adler.
462
463         Use new Vector::removeFirstMatching() / removeAllMatching() methods.
464
465 2015-02-07  Tim Horton  <timothy_horton@apple.com>
466
467         Add API::HistoryClient and split some things out of API::NavigationClient
468         https://bugs.webkit.org/show_bug.cgi?id=141264
469
470         Reviewed by Darin Adler.
471
472         * UIProcess/API/APIHistoryClient.h: Added.
473         (API::HistoryClient::~HistoryClient):
474         (API::HistoryClient::didNavigateWithNavigationData):
475         (API::HistoryClient::didPerformClientRedirect):
476         (API::HistoryClient::didPerformServerRedirect):
477         (API::HistoryClient::didUpdateHistoryTitle):
478         * UIProcess/API/APINavigationClient.h:
479         (API::NavigationClient::didNavigateWithNavigationData): Deleted.
480         (API::NavigationClient::didPerformClientRedirect): Deleted.
481         (API::NavigationClient::didPerformServerRedirect): Deleted.
482         (API::NavigationClient::didUpdateHistoryTitle): Deleted.
483         * UIProcess/Cocoa/NavigationState.h:
484         * UIProcess/Cocoa/NavigationState.mm:
485         (WebKit::NavigationState::createHistoryClient):
486         (WebKit::NavigationState::HistoryClient::HistoryClient):
487         (WebKit::NavigationState::HistoryClient::~HistoryClient):
488         (WebKit::NavigationState::HistoryClient::didNavigateWithNavigationData):
489         (WebKit::NavigationState::HistoryClient::didPerformClientRedirect):
490         (WebKit::NavigationState::HistoryClient::didPerformServerRedirect):
491         (WebKit::NavigationState::HistoryClient::didUpdateHistoryTitle):
492         (WebKit::NavigationState::NavigationClient::didNavigateWithNavigationData): Deleted.
493         (WebKit::NavigationState::NavigationClient::didPerformClientRedirect): Deleted.
494         (WebKit::NavigationState::NavigationClient::didPerformServerRedirect): Deleted.
495         (WebKit::NavigationState::NavigationClient::didUpdateHistoryTitle): Deleted.
496         * UIProcess/WebPageProxy.cpp:
497         (WebKit::WebPageProxy::setHistoryClient):
498         (WebKit::WebPageProxy::didNavigateWithNavigationData):
499         (WebKit::WebPageProxy::didPerformClientRedirect):
500         (WebKit::WebPageProxy::didPerformServerRedirect):
501         (WebKit::WebPageProxy::didUpdateHistoryTitle):
502         * UIProcess/WebPageProxy.h:
503         Add a API::HistoryClient and move the few things that belong on it out of API::NavigationClient.
504         Adjust accordingly in WebPageProxy and NavigationState.
505
506         * UIProcess/API/Cocoa/WKWebView.mm:
507         (-[WKWebView initWithFrame:configuration:]):
508         (-[WKWebView setNavigationDelegate:]):
509         (-[WKWebView setUIDelegate:]):
510         (-[WKWebView _setHistoryDelegate:]):
511         Lazily push the NavigationState/UIDelegate clients down to WebPageProxy upon
512         installation of a delegate, so that alternative (C SPI) delegate setters can
513         be separately created.
514
515         * WebKit2.xcodeproj/project.pbxproj:
516
517 2015-02-07  Antti Koivisto  <antti@apple.com>
518
519         And as a further followup restore the 8bit test too.
520
521         * NetworkProcess/cache/NetworkCacheKey.cpp:
522         (WebKit::hashString):
523
524 2015-02-07  Antti Koivisto  <antti@apple.com>
525
526         Use longer hashes for cache keys
527         https://bugs.webkit.org/show_bug.cgi?id=141356
528
529         Rubber-stamped by Darin Adler.
530
531         Folloup and build fix.
532
533         * NetworkProcess/cache/NetworkCacheCoders.h:
534         * NetworkProcess/cache/NetworkCacheKey.cpp:
535         (WebKit::hashString):
536
537             Use containsOnlyASCII instead of is8Bit so both paths always compute the same hash.
538
539         * NetworkProcess/cache/NetworkCacheKey.h:
540
541 2015-02-07  Antti Koivisto  <antti@apple.com>
542
543         Remove a printf.
544
545         * NetworkProcess/cache/NetworkCache.cpp:
546         (WebKit::NetworkCache::retrieve):
547
548 2015-02-07  Antti Koivisto  <antti@apple.com>
549
550         Use longer hashes for cache keys
551         https://bugs.webkit.org/show_bug.cgi?id=141356
552
553         Reviewed by Darin Adler.
554
555         The current key hashes are 32bit. We should use longer hashes to eliminate collisions.
556
557         This patch switches us to using MD5 digests for the cache key hashes. As a result the file names for the cache
558         entries grow from 8 to 32 character.
559
560         Note that we don't need a cryptographic hash (full cache keys are verified against the entries).
561         MD5 just happens to be fast, convenient and available.
562
563         The patch also moves the whole cache hierarchy down to a versioned subdirectory ("WebKitCache/Version 2")
564         and deletes any old style cache files if they exist.
565
566         * NetworkProcess/cache/NetworkCacheCoders.cpp:
567         (WebKit::NetworkCacheCoder<MD5::Digest>::encode):
568         (WebKit::NetworkCacheCoder<MD5::Digest>::decode):
569         * NetworkProcess/cache/NetworkCacheCoders.h:
570         * NetworkProcess/cache/NetworkCacheKey.cpp:
571         (WebKit::NetworkCacheKey::NetworkCacheKey):
572         (WebKit::hashString):
573         (WebKit::NetworkCacheKey::computeHash):
574         (WebKit::NetworkCacheKey::hashAsString):
575         (WebKit::NetworkCacheKey::stringToHash):
576         * NetworkProcess/cache/NetworkCacheKey.h:
577         (WebKit::NetworkCacheKey::shortHash):
578         (WebKit::NetworkCacheKey::toShortHash):
579
580             32bit hash to use in the bloom filter.
581
582         (WebKit::NetworkCacheKey::hashStringLength):
583         * NetworkProcess/cache/NetworkCacheStorage.h:
584
585             Bump the version.
586
587         * NetworkProcess/cache/NetworkCacheStorageCocoa.mm:
588         (WebKit::traverseCacheFiles):
589         (WebKit::makeVersionedDirectoryPath):
590         (WebKit::NetworkCacheStorage::NetworkCacheStorage):
591         (WebKit::NetworkCacheStorage::initialize):
592         (WebKit::NetworkCacheStorage::removeEntry):
593         (WebKit::NetworkCacheStorage::retrieve):
594         (WebKit::NetworkCacheStorage::store):
595         (WebKit::NetworkCacheStorage::update):
596         (WebKit::NetworkCacheStorage::shrinkIfNeeded):
597         (WebKit::NetworkCacheStorage::deleteOldVersions):
598
599             Wipe out the version 1 cache.
600
601 2015-02-06  Chris Dumez  <cdumez@apple.com>
602
603         Have SQLiteStatement::database() return a reference
604         https://bugs.webkit.org/show_bug.cgi?id=141348
605
606         Reviewed by Andreas Kling.
607
608         Have SQLiteStatement::database() return a reference as it can never
609         return null.
610
611         * DatabaseProcess/IndexedDB/sqlite/SQLiteIDBCursor.cpp:
612         (WebKit::SQLiteIDBCursor::internalAdvanceOnce):
613
614 2015-02-06  Alexey Proskuryakov  <ap@apple.com>
615
616         Report network process crashes during layout tests
617         https://bugs.webkit.org/show_bug.cgi?id=139646
618
619         Reviewed by Anders Carlsson.
620
621         Added a way to get network process pid, modeled after how we do this for web process.
622
623         * UIProcess/API/C/mac/WKContextPrivateMac.h:
624         * UIProcess/API/C/mac/WKContextPrivateMac.mm:
625         (WKContextGetNetworkProcessIdentifier):
626         * UIProcess/WebProcessPool.cpp:
627         (WebKit::WebProcessPool::networkProcessCrashed): Don't reset m_networkProcess until
628         after calling the client, so that the client could retrieve its pid.
629         (WebKit::WebProcessPool::networkProcessIdentifier):
630         * UIProcess/WebProcessPool.h:
631
632 2015-02-05  Timothy Hatcher  <timothy@apple.com>
633
634         Support overriding the deviceScaleFactor per WKWebView/WKView
635         https://bugs.webkit.org/show_bug.cgi?id=141311
636
637         Reviewed by Tim Horton.
638
639         * UIProcess/API/Cocoa/WKViewPrivate.h:
640         * UIProcess/API/Cocoa/WKWebView.mm:
641         (-[WKWebView _setOverrideDeviceScaleFactor:]):
642         (-[WKWebView _overrideDeviceScaleFactor]):
643         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
644         * UIProcess/API/mac/WKView.mm:
645         (-[WKView _intrinsicDeviceScaleFactor]):
646         (-[WKView _setOverrideDeviceScaleFactor:]):
647         (-[WKView _overrideDeviceScaleFactor]):
648
649 2015-02-06  Carlos Garcia Campos  <cgarcia@igalia.com>
650
651         [GTK] Remove WebKitWebView::close-notification signal
652         https://bugs.webkit.org/show_bug.cgi?id=141330
653
654         Reviewed by Gustavo Noronha Silva.
655
656         In favor of a WebKitNotification::closed signal and
657         webkit_notification_close() method that both applications and
658         WebKit can use to close a notification. This also fixes the
659         onclose event that was not fired when the notification was
660         closed. It also brings back padding space in WebKitWebViewClass.
661
662         * UIProcess/API/gtk/WebKitNotification.cpp:
663         (webkit_notification_class_init): Add WebKitNotification::closed signal.
664         (webkit_notification_close): Emit WebKitNotification::closed.
665         * UIProcess/API/gtk/WebKitNotification.h:
666         * UIProcess/API/gtk/WebKitNotificationProvider.cpp:
667         (WebKitNotificationProvider::notificationCloseCallback): Callback
668         for WebKitNotification::closed signal that notifies the WebProcess
669         and removes the notification from the map.
670         (WebKitNotificationProvider::show): Connect to WebKitNotification::closed.
671         (WebKitNotificationProvider::cancelNotificationByID): Call webkit_notification_close().
672         * UIProcess/API/gtk/WebKitNotificationProvider.h:
673         * UIProcess/API/gtk/WebKitWebView.cpp:
674         (notifyNotificationClosed): The user closed the annotation, call
675         webkit_notification_close().
676         (webNotificationClosed): The WebKitNotification has been closed,
677         close the libnotify notification if it hasn't been closed yet.
678         (webkitWebViewShowNotification): Create the libnotifiy
679         notification if needed and associate it to the WebKitNotification
680         as user data. Connect to the closed signal of both, the libnotifiy
681         notification and the WebKit notification.
682         (webkitWebViewCloseNotification): Deleted.
683         (webkit_web_view_class_init): Remove close-notification signal and
684         the default hanlder.
685         (webkitWebViewEmitCloseNotification): Deleted.
686         * UIProcess/API/gtk/WebKitWebView.h:
687         * UIProcess/API/gtk/WebKitWebViewPrivate.h:
688         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: Add webkit_notification_close.
689
690 2015-02-06  Carlos Garcia Campos  <cgarcia@igalia.com>
691
692         ASSERTION FAILED: !m_adoptionIsRequired in WTF::RefCountedBase::ref
693         https://bugs.webkit.org/show_bug.cgi?id=141035
694
695         Reviewed by Sergio Villar Senin.
696
697         Rename PrinterListGtk::singleton() as PrinterListGtk::getOrCreate(), and
698         make it return nullptr when the shared PrinterListGtk object is
699         still being created. This can happen if the nested loop used by
700         gtk_enumerate_printers dispatches a GSource that starts a new
701         synchronous print operation. In that case we just ignore the
702         second print operation, since there's already one ongoing.
703
704         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
705         (WebKit::WebChromeClient::print): Return early if
706         PrinterListGtk::getOrCreate() return nullptr.
707         * WebProcess/WebPage/gtk/PrinterListGtk.cpp:
708         (WebKit::PrinterListGtk::getOrCreate): Return nullptr if the
709         PrinterListGtk is still enumerating the printers.
710         (WebKit::PrinterListGtk::PrinterListGtk): Initialize
711         m_enumeratingPrinters to true before calling
712         gtk_enumerate_printers, and to false once it finishes.
713         (WebKit::PrinterListGtk::singleton): Deleted.
714         (WebKit::PrinterListGtk::enumeratePrintersFunction): Deleted.
715         * WebProcess/WebPage/gtk/PrinterListGtk.h:
716         * WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp: Add an
717         assertion here since PrinterListGtk::getOrCreate() should never
718         return nullptr at this point.
719
720 2015-02-05  Tim Horton  <timothy_horton@apple.com>
721
722         Null deref in ViewGestureController::beginSwipeGesture when swiping while script is navigating
723         https://bugs.webkit.org/show_bug.cgi?id=141308
724         <rdar://problem/18460046>
725
726         Reviewed by Simon Fraser.
727
728         * UIProcess/mac/ViewGestureControllerMac.mm:
729         (WebKit::ViewGestureController::trackSwipeGesture):
730         If script navigates (history.back, probably other cases too) while in the middle of
731         building up enough scroll events to start a swipe, it can destroy the history item
732         that we were planning to swipe to. If this happens, bail from the swipe.
733
734 2015-02-05  Alexey Proskuryakov  <ap@apple.com>
735
736         Don't pass architecture to development plug-in XPC services
737         https://bugs.webkit.org/show_bug.cgi?id=141309
738
739         Reviewed by Anders Carlsson.
740
741         We now have separate services for 32-bit and 64-bit.
742
743         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.Development.mm:
744         (WebKit::reexec):
745         (WebKit::XPCServiceEventHandler):
746         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
747         (WebKit::connectToReExecService):
748
749 2015-02-05  Chris Dumez  <cdumez@apple.com>
750
751         Use deleteEmptyDirectory() in NetworkCacheStorage::clear()
752         https://bugs.webkit.org/show_bug.cgi?id=141314
753
754         Reviewed by Antti Koivisto.
755
756         Use deleteEmptyDirectory() in NetworkCacheStorage::clear() to simplify
757         the code a little bit.
758
759         * NetworkProcess/cache/NetworkCacheStorageCocoa.mm:
760         (WebKit::NetworkCacheStorage::clear):
761
762 2015-02-05  Joseph Pecoraro  <pecoraro@apple.com>
763
764         [iOS] Remove False Positive dispatch_source Leak in WebMemoryPressureHandler singleton
765         https://bugs.webkit.org/show_bug.cgi?id=141307
766
767         Reviewed by Anders Carlsson.
768
769         * UIProcess/ios/WebMemoryPressureHandlerIOS.h:
770         * UIProcess/ios/WebMemoryPressureHandlerIOS.mm:
771         (WebKit::WebMemoryPressureHandler::WebMemoryPressureHandler):
772         We want to keep the dispatch_source around, so just tie it to the
773         singleton so that it is not reported as a leak.
774
775 2015-02-05  Antti Koivisto  <antti@apple.com>
776
777         Switch to file backed buffer when resource is cached to disk
778         https://bugs.webkit.org/show_bug.cgi?id=141295
779
780         Reviewed by Chris Dumez.
781
782         Wire the DidCacheResource mechanism to the new disk cache.
783
784         * NetworkProcess/NetworkResourceLoader.cpp:
785         (WebKit::NetworkResourceLoader::didFinishLoading):
786
787             Send DidCacheResource message to the web process so it can switch the resource to file backing.
788
789         * NetworkProcess/cache/NetworkCache.cpp:
790         (WebKit::NetworkCache::store):
791         (WebKit::NetworkCache::update):
792         * NetworkProcess/cache/NetworkCache.h:
793         * NetworkProcess/cache/NetworkCacheStorage.h:
794         (WebKit::DispatchPtr::DispatchPtr):
795         * NetworkProcess/cache/NetworkCacheStorageCocoa.mm:
796         (WebKit::NetworkCacheStorage::Data::Data):
797         (WebKit::mapFile):
798         (WebKit::decodeEntry):
799         (WebKit::retrieveActive):
800         (WebKit::NetworkCacheStorage::retrieve):
801         (WebKit::NetworkCacheStorage::store):
802
803             Map files larger than a memory page after a successful store.
804
805         (WebKit::NetworkCacheStorage::update):
806         (WebKit::encodeEntry): Deleted.
807
808 2015-02-05  Chris Dumez  <cdumez@apple.com>
809
810         [WK2] Properly check for mmap() error case
811         https://bugs.webkit.org/show_bug.cgi?id=141304
812
813         Reviewed by Anders Carlsson.
814
815         mmap() returns MAP_FAILED, which is (void*)-1, not a null pointer in
816         case of failure. This patch updates several wrong error checks in
817         WebKit2.
818
819         * Platform/IPC/ArgumentEncoder.cpp:
820         (IPC::allocBuffer):
821         (IPC::ArgumentEncoder::reserve):
822         * Platform/IPC/mac/ConnectionMac.mm:
823         (IPC::Connection::sendOutgoingMessage):
824
825 2015-02-05  Brian J. Burg  <burg@cs.washington.edu>
826
827         Clean up WebInspectorProxy and use simpler inspector levels design
828         https://bugs.webkit.org/show_bug.cgi?id=141135
829
830         Reviewed by Timothy Hatcher.
831
832         Inspector levels used to be managed by keeping a set of WebPageGroup
833         instances and doing pointer comparisons to check whether the inspected
834         view is itself a web inspector instance. This is unnecessary, as we
835         can maintain a mapping from WebPageProxy* to its corresponding level.
836
837         When an inspector instance is created, it is inserted into the mapping
838         along with its level. An inspector's level is 1 unless its inspected page
839         is in the mapping, then it is one greater that the inspected page's level.
840
841         The level is provided by inspectorLevel(), rather than a member variable.
842         WebInspectorProxy is created in the constructor of WebPageProxy. Thus, there
843         would be no chance to add the inspector page's level to the mapping before the
844         next level inspector tries to look it up when initializing its members.
845
846         This patch introduces other miscellaneous cleanups, such as naming m_page
847         to m_inspectedPage, using Ref and using an enum class for the attachment side.
848
849         * UIProcess/API/C/WKInspector.cpp:
850         (WKInspectorGetPage):
851         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
852         (resizeWebKitWebViewBaseFromAllocation):
853         * UIProcess/InspectorServer/efl/WebInspectorServerEfl.cpp:
854         * UIProcess/InspectorServer/gtk/WebInspectorServerGtk.cpp:
855         * UIProcess/WebInspectorProxy.cpp:
856         (WebKit::pageLevelMap):
857         (WebKit::WebInspectorProxy::WebInspectorProxy):
858         (WebKit::WebInspectorProxy::inspectorLevel):
859         (WebKit::WebInspectorProxy::inspectorPageGroupIdentifier):
860         (WebKit::WebInspectorProxy::inspectorPagePreferences):
861         (WebKit::WebInspectorProxy::invalidate):
862         (WebKit::WebInspectorProxy::isFront):
863         (WebKit::WebInspectorProxy::connect):
864         (WebKit::WebInspectorProxy::show):
865         (WebKit::WebInspectorProxy::hide):
866         (WebKit::WebInspectorProxy::close):
867         (WebKit::WebInspectorProxy::didRelaunchInspectorPageProcess):
868         (WebKit::WebInspectorProxy::showConsole):
869         (WebKit::WebInspectorProxy::showResources):
870         (WebKit::WebInspectorProxy::showMainResourceForFrame):
871         (WebKit::WebInspectorProxy::attachBottom):
872         (WebKit::WebInspectorProxy::attachRight):
873         (WebKit::WebInspectorProxy::attach):
874         (WebKit::WebInspectorProxy::detach):
875         (WebKit::WebInspectorProxy::togglePageProfiling):
876         (WebKit::WebInspectorProxy::isInspectorPage):
877         (WebKit::decidePolicyForNavigationAction):
878         (WebKit::WebInspectorProxy::remoteFrontendConnected):
879         (WebKit::WebInspectorProxy::remoteFrontendDisconnected):
880         (WebKit::WebInspectorProxy::dispatchMessageFromRemoteFrontend):
881         (WebKit::WebInspectorProxy::eagerlyCreateInspectorPage):
882         (WebKit::WebInspectorProxy::createInspectorPage):
883         (WebKit::WebInspectorProxy::didClose):
884         (WebKit::WebInspectorPageGroups::singleton): Deleted.
885         (WebKit::WebInspectorPageGroups::inspectorLevel): Deleted.
886         (WebKit::WebInspectorPageGroups::isInspectorPageGroup): Deleted.
887         (WebKit::WebInspectorPageGroups::inspectorPageGroupLevel): Deleted.
888         (WebKit::WebInspectorPageGroups::inspectorPageGroupForLevel): Deleted.
889         (WebKit::WebInspectorPageGroups::createInspectorPageGroup): Deleted.
890         (WebKit::WebInspectorProxy::~WebInspectorProxy): Deleted.
891         (WebKit::WebInspectorProxy::inspectorPageGroup): Deleted.
892         (WebKit::WebInspectorProxy::setAttachedWindowHeight): Deleted.
893         (WebKit::WebInspectorProxy::enableRemoteInspection): Deleted.
894         (WebKit::WebInspectorProxy::open): Deleted.
895         * UIProcess/WebInspectorProxy.h:
896         (WebKit::WebInspectorProxy::create):
897         (WebKit::WebInspectorProxy::inspectedPage):
898         (WebKit::WebInspectorProxy::page): Deleted.
899         * UIProcess/efl/WebInspectorProxyEfl.cpp:
900         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
901         * UIProcess/gtk/WebInspectorProxyGtk.cpp:
902         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
903         (WebKit::WebInspectorProxy::dockButtonClicked):
904         (WebKit::WebInspectorProxy::createInspectorWindow):
905         (WebKit::WebInspectorProxy::platformInspectedWindowHeight):
906         (WebKit::WebInspectorProxy::platformInspectedWindowWidth):
907         (WebKit::WebInspectorProxy::platformAttach):
908         (WebKit::WebInspectorProxy::platformDetach):
909         (WebKit::WebInspectorProxy::platformSetAttachedWindowHeight):
910         (WebKit::WebInspectorProxy::platformSetAttachedWindowWidth):
911         * UIProcess/mac/WebInspectorProxyMac.mm:
912         (-[WKWebInspectorProxyObjCAdapter attachRight:]):
913         (-[WKWebInspectorProxyObjCAdapter attachBottom:]):
914         (WebKit::WebInspectorProxy::createInspectorWindow):
915         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
916         (WebKit::WebInspectorProxy::platformBringToFront):
917         (WebKit::WebInspectorProxy::windowFrameDidChange):
918         (WebKit::WebInspectorProxy::inspectedViewFrameDidChange):
919         (WebKit::WebInspectorProxy::platformInspectedWindowHeight):
920         (WebKit::WebInspectorProxy::platformInspectedWindowWidth):
921         (WebKit::WebInspectorProxy::platformAttach):
922         (WebKit::WebInspectorProxy::platformDetach):
923         (-[WKWebInspectorProxyObjCAdapter close]): Deleted.
924
925 2015-02-05  Chris Dumez  <cdumez@apple.com>
926
927         [WK2][Cocoa] Populate m_contentsFilter bloom filter from the main dispatch queue NetworkCacheStorage::initialize()
928         https://bugs.webkit.org/show_bug.cgi?id=141297
929
930         Reviewed by Antti Koivisto.
931
932         Populate m_contentsFilter bloom filter from the main dispatch queue
933         NetworkCacheStorage::initialize() to avoid thread-safety issues.
934
935         * NetworkProcess/cache/NetworkCacheStorageCocoa.mm:
936         (WebKit::NetworkCacheStorage::initialize):
937
938 2015-02-05  Chris Dumez  <cdumez@apple.com>
939
940         Use deleteFile() in NetworkCacheStorageCocoa.mm
941         https://bugs.webkit.org/show_bug.cgi?id=141299
942
943         Reviewed by Antti Koivisto.
944
945         Use deleteFile() in NetworkCacheStorageCocoa.mm to simplify the code
946         a bit.
947
948         * NetworkProcess/cache/NetworkCacheStorageCocoa.mm:
949         (WebKit::NetworkCacheStorage::removeEntry):
950         (WebKit::NetworkCacheStorage::clear):
951         (WebKit::NetworkCacheStorage::shrinkIfNeeded):
952
953 2015-02-04  Antti Koivisto  <antti@apple.com>
954
955         Avoid copying std::functions across threads in NetworkCacheStorage
956         https://bugs.webkit.org/show_bug.cgi?id=141273
957
958         Reviewed by Andreas Kling.
959
960         The current approach is risky. There is possiblity that captured variables are
961         deleted in an unexpected thread.
962
963         * NetworkProcess/cache/NetworkCache.cpp:
964         (WebKit::NetworkCache::retrieve):
965
966             The capture trick here is no longer needed.
967
968         * NetworkProcess/cache/NetworkCacheStorage.h:
969
970             For each cache operation we create Retrive/Store/UpdateOperation object kept alive by the active operation map.
971             This object captures all parameters of the operation including the lambda. When the operation completes
972             the object is removed from the map in the main thread, ensuring safe destruction.
973
974         * NetworkProcess/cache/NetworkCacheStorageCocoa.mm:
975         (WebKit::NetworkCacheStorage::dispatchRetrieveOperation):
976         (WebKit::NetworkCacheStorage::dispatchPendingRetrieveOperations):
977         (WebKit::retrieveActive):
978
979             Instead of maintaining a separate write cache we just look through the active write and update maps.
980
981         (WebKit::NetworkCacheStorage::retrieve):
982
983             Use fixed sized priority array rather than a dynamic one. Vector<Deque<std::unique_ptr>> doesn't quite work.
984
985         (WebKit::NetworkCacheStorage::store):
986         (WebKit::NetworkCacheStorage::update):
987         (WebKit::NetworkCacheStorage::clear):
988
989 2015-02-05  Youenn Fablet  <youenn.fablet@crf.canon.fr> and Xabier Rodriguez Calvar <calvaris@igalia.com>
990
991         [Streams API] Implement a barebone ReadableStream interface
992         https://bugs.webkit.org/show_bug.cgi?id=141045
993
994         Reviewed by Benjamin Poulain.
995
996         * CMakeLists.txt:
997         * Configurations/FeatureDefines.xcconfig:
998
999 2015-02-04  Joseph Pecoraro  <pecoraro@apple.com>
1000
1001         [iOS] Selection callout does not follow selection when double-tap scrolling
1002         https://bugs.webkit.org/show_bug.cgi?id=141214
1003
1004         Reviewed by Benjamin Poulain.
1005
1006         Implement the delegate that gets called after UIScrollView
1007         setContentOffset animations. When scrolling to a rect, do the normal
1008         willScroll, didScroll actions to update the selection assistant.
1009
1010         * UIProcess/API/Cocoa/WKWebView.mm:
1011         (-[WKWebView _scrollToRect:origin:minimumScrollDistance:]):
1012         (-[WKWebView scrollViewDidEndScrollingAnimation:]):
1013
1014 2015-02-04  Simon Fraser  <simon.fraser@apple.com>
1015
1016         [iOS WK2] Layers that are created and destroyed in the same transaction shouldn't be encoded
1017         https://bugs.webkit.org/show_bug.cgi?id=141228
1018
1019         Reviewed by Tim Horton.
1020         
1021         With UI-side compositing, it was possible for layers to get created and
1022         destroyed in the same transaction (e.g. two layouts before a single layer
1023         tree commit). When that happened we would encode layer creation properties
1024         but not encode layer properties, since the layer would be unreachable.
1025         
1026         Fix by removing deleted layers from the created layers list, which is
1027         converted into a map for easy searching.
1028
1029         * WebProcess/WebPage/mac/RemoteLayerTreeContext.h:
1030         * WebProcess/WebPage/mac/RemoteLayerTreeContext.mm:
1031         (WebKit::RemoteLayerTreeContext::layerWasCreated):
1032         (WebKit::RemoteLayerTreeContext::layerWillBeDestroyed):
1033         (WebKit::RemoteLayerTreeContext::buildTransaction):
1034
1035 2015-02-04  Michael Catanzaro  <mcatanzaro@igalia.com>
1036
1037         Build with seccomp filters broken since r179409
1038         https://bugs.webkit.org/show_bug.cgi?id=141206
1039
1040         Reviewed by Darin Adler.
1041
1042         Fix build by renaming SeccompBrokerClient::shared to SeccompBrokerClient::singleton.
1043
1044         * Shared/linux/SeccompFilters/SeccompBroker.cpp:
1045         (WebKit::SeccompBrokerClient::singleton):
1046         (WebKit::SeccompBroker::initialize):
1047         (WebKit::SeccompBrokerClient::shared):
1048         (WebKit::SeccompBroker::runLoop):
1049
1050 2015-02-04  Simon Fraser  <simon.fraser@apple.com>
1051
1052         [iOS WK2] Assert in ScrollingTreeOverflowScrollingNodeIOS::updateAfterChildren() on tab switching
1053         https://bugs.webkit.org/show_bug.cgi?id=141223
1054         rdar://problem/18458993
1055
1056         Reviewed by Tim Horton.
1057
1058         It's possible to submit a RemoteLayerTree transaction that contains data
1059         about a created layer, but doesn't have any properties for that layer. This
1060         happens when the newly created layer isn't reached during the traversal that
1061         gathers layer properties (i.e. it's not rooted). However, whether we create
1062         a scrolling layer or not requires having properties; they are missing, so we
1063         create a normal layer, but then the scrolling tree commit asserts that we
1064         should have a scrolling layer.
1065         
1066         Fix by making scrolling layers have a corresponding layer type, which is
1067         stored in layer creation properties. This required exposing layer types
1068         up through GraphicsLayer, but that allows for some nice cleanup:
1069         
1070         1. No need to have the hokey shouldUseTiledBacking() GraphicsLayerClient hack
1071            for creating the page tiled layer.
1072         2. The notion of "custom behaviors" can be removed from GraphicsLayer entirely.
1073
1074         * Shared/mac/RemoteLayerBackingStore.mm:
1075         (WebKit::RemoteLayerBackingStore::drawInContext):
1076         * Shared/mac/RemoteLayerTreeTransaction.h:
1077         * Shared/mac/RemoteLayerTreeTransaction.mm:
1078         (WebKit::RemoteLayerTreeTransaction::LayerProperties::LayerProperties):
1079         (WebKit::RemoteLayerTreeTransaction::LayerProperties::encode):
1080         (WebKit::RemoteLayerTreeTransaction::LayerProperties::decode):
1081         (WebKit::dumpChangedLayers):
1082         (WebKit::RemoteLayerTreeTransaction::description):
1083         * UIProcess/ios/RemoteLayerTreeHostIOS.mm:
1084         (WebKit::RemoteLayerTreeHost::createLayer):
1085         * UIProcess/mac/RemoteLayerTreeHost.mm:
1086         (WebKit::RemoteLayerTreeHost::createLayer):
1087         * WebProcess/WebPage/mac/GraphicsLayerCARemote.h:
1088         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
1089         (WebKit::PlatformCALayerRemote::customBehavior): Deleted.
1090         (WebKit::PlatformCALayerRemote::updateCustomBehavior): Deleted.
1091         * WebProcess/WebPage/mac/PlatformCALayerRemote.h:
1092         * WebProcess/WebPage/mac/RemoteLayerTreeContext.h:
1093         * WebProcess/WebPage/mac/RemoteLayerTreeContext.mm:
1094         (WebKit::RemoteLayerTreeContext::createGraphicsLayer):
1095
1096 2015-02-04  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
1097
1098         [EFL][WK2] Manage failing API tests
1099         https://bugs.webkit.org/show_bug.cgi?id=141250
1100
1101         Reviewed by Csaba Osztrogonác.
1102
1103         * PlatformEfl.cmake: Skip to test test_ewk2_storage_manager.
1104         * UIProcess/API/efl/tests/test_ewk2_view.cpp: Disable 2 unit test functions.
1105         (TEST_F):
1106
1107 2015-02-04  Chris Dumez  <cdumez@apple.com>
1108
1109         Add removeFirst(value) / removeAll(value) methods to WTF::Vector
1110         https://bugs.webkit.org/show_bug.cgi?id=141192
1111
1112         Reviewed by Benjamin Poulain.
1113
1114         Use new Vector::removeFirst(value) / removeAll(value) API to simplify the
1115         code a bit.
1116
1117         * UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManager.cpp:
1118         (WebKit::WebSoupCustomProtocolRequestManager::unregisterSchemeForCustomProtocol):
1119         * UIProcess/PageLoadState.cpp:
1120         (WebKit::PageLoadState::removeObserver):
1121         * UIProcess/WebProcessPool.cpp:
1122         (WebKit::WebProcessPool::~WebProcessPool):
1123         (WebKit::WebProcessPool::disconnectProcess):
1124         * WebProcess/InjectedBundle/API/efl/ewk_extension.cpp:
1125         (EwkExtension::remove):
1126
1127 2015-02-03  Chris Dumez  <cdumez@apple.com>
1128
1129         Unreviewed attempt to fix GTK/EFL build after r179588.
1130
1131         Add new files to CMakeLists.txt.
1132
1133         * CMakeLists.txt:
1134
1135 2015-02-03  Shivakumar JM  <shiva.jm@samsung.com>
1136
1137         Fix build warning in WebKit2/Platform/IPC module.
1138         https://bugs.webkit.org/show_bug.cgi?id=141229
1139
1140         Reviewed by Chris Dumez.
1141
1142         Fix build warning by using UNUSED_PARAM macro.
1143
1144         * Platform/IPC/Connection.cpp:
1145         (IPC::Connection::sendMessage):
1146
1147 2015-02-03  Tim Horton  <timothy_horton@apple.com>
1148
1149         Add WKPageNavigationClient as C SPI around API::NavigationClient, and adopt in WKTR
1150         https://bugs.webkit.org/show_bug.cgi?id=141217
1151
1152         * UIProcess/API/C/WKPageRenderingProgressEventsInternal.h:
1153         Include, not import.
1154
1155 2015-02-03  Tim Horton  <timothy_horton@apple.com>
1156
1157         Add WKPageNavigationClient as C SPI around API::NavigationClient, and adopt in WKTR
1158         https://bugs.webkit.org/show_bug.cgi?id=141217
1159
1160         Reviewed by Sam Weinig.
1161
1162         * Shared/API/c/WKBase.h:
1163         * UIProcess/API/C/WKAPICast.h:
1164         * UIProcess/API/C/WKFrameInfoRef.cpp: Added.
1165         (WKFrameInfoGetTypeID):
1166         * UIProcess/API/C/WKFrameInfoRef.h: Added.
1167         * UIProcess/API/C/WKNavigationActionRef.cpp: Added.
1168         (WKNavigationActionGetTypeID):
1169         * UIProcess/API/C/WKNavigationActionRef.h: Added.
1170         * UIProcess/API/C/WKNavigationRef.cpp: Added.
1171         (WKNavigationGetTypeID):
1172         * UIProcess/API/C/WKNavigationRef.h: Added.
1173         * UIProcess/API/C/WKNavigationResponseRef.cpp: Added.
1174         (WKNavigationResponseGetTypeID):
1175         (WKNavigationResponseCanShowMIMEType):
1176         * UIProcess/API/C/WKNavigationResponseRef.h: Added.
1177         Add tiny C wrappers around API::{FrameInfo, NavigationAction, Navigation, NavigationResponse}.
1178
1179         * UIProcess/API/APINavigationClient.h:
1180         (API::NavigationClient::decidePolicyForPluginLoad):
1181         Add a default implementation of decidePolicyForPluginLoad.
1182
1183         * UIProcess/API/C/WKPage.cpp:
1184         (WKPageSetPageNavigationClient):
1185         * UIProcess/API/C/WKPage.h:
1186         Add WKPageSetPageNavigationClient, which connects API::NavigationClient to
1187         the new WKPageNavigationClient C SPI.
1188         
1189         * UIProcess/API/C/WKPageNavigationClient.h: Added.
1190         Add WKPageNavigationClient, which one can use in place of WKPageLoaderClient
1191         and WKPagePolicyClient and which has the same semantics as the Modern ObjC API
1192         (including things like API::Navigation as WKNavigationRef, etc.)
1193
1194         * UIProcess/API/C/WKPageLoaderClient.h:
1195         * UIProcess/API/C/WKPageRenderingProgressEvents.h: Added.
1196         * UIProcess/API/C/WKPageRenderingProgressEventsInternal.h: Added.
1197         (pageRenderingProgressEvents):
1198         * UIProcess/API/C/WKPluginLoadPolicy.h: Added.
1199         Pull some enums out into their own files (WKPageRenderingProgressEvents is
1200         duplicated from the Modern ObjC API's _WKRenderingProgressEvents, WKPluginLoadPolicy
1201         is pulled out of WKPageLoaderClient).
1202
1203         * UIProcess/WebPageProxy.cpp:
1204         (WebKit::WebPageProxy::findPlugin):
1205         Add an equivalent of pluginLoadPolicy to the NavigationClient.
1206
1207         * WebKit2.xcodeproj/project.pbxproj:
1208
1209 2015-02-03  Timothy Horton  <timothy_horton@apple.com>
1210
1211         Every PageOverlayClientImpl leaks
1212         https://bugs.webkit.org/show_bug.cgi?id=141224
1213         <rdar://problem/19652939>
1214
1215         Reviewed by Simon Fraser.
1216
1217         * WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:
1218         (WKBundlePageOverlayCreate):
1219         * WebProcess/WebPage/WebPageOverlay.cpp:
1220         (WebKit::WebPageOverlay::create):
1221         (WebKit::WebPageOverlay::WebPageOverlay):
1222         (WebKit::WebPageOverlay::pageOverlayDestroyed):
1223         (WebKit::WebPageOverlay::willMoveToPage):
1224         (WebKit::WebPageOverlay::didMoveToPage):
1225         (WebKit::WebPageOverlay::drawRect):
1226         (WebKit::WebPageOverlay::mouseEvent):
1227         (WebKit::WebPageOverlay::didScrollFrame):
1228         (WebKit::WebPageOverlay::actionContextForResultAtPoint):
1229         (WebKit::WebPageOverlay::dataDetectorsDidPresentUI):
1230         (WebKit::WebPageOverlay::dataDetectorsDidChangeUI):
1231         (WebKit::WebPageOverlay::dataDetectorsDidHideUI):
1232         (WebKit::WebPageOverlay::copyAccessibilityAttributeStringValueForPoint):
1233         (WebKit::WebPageOverlay::copyAccessibilityAttributeBoolValueForPoint):
1234         (WebKit::WebPageOverlay::copyAccessibilityAttributeNames):
1235         * WebProcess/WebPage/WebPageOverlay.h:
1236         (WebKit::WebPageOverlay::client):
1237         Keep the PageOverlayClientImpl as a unique_ptr instead of a leaked reference,
1238         ensuring that it's cleaned up when the WebPageOverlay is torn down.
1239
1240 2015-02-03  Chris Dumez  <cdumez@apple.com>
1241
1242         Drop ResourceLoadPriorityUnresolved resource load priority and use Optional<> instead
1243         https://bugs.webkit.org/show_bug.cgi?id=141186
1244
1245         Reviewed by Antti Koivisto.
1246
1247         Update code now that ResourceLoadPriorityUnresolved is not longer a
1248         ResourceLoadPriority enum value.
1249
1250         * NetworkProcess/cache/NetworkCache.cpp:
1251         (WebKit::NetworkCache::retrieve):
1252         * WebProcess/Network/WebResourceLoadScheduler.cpp:
1253         (WebKit::WebResourceLoadScheduler::scheduleLoad):
1254
1255 2015-02-03  Enrica Casucci  <enrica@apple.com>
1256
1257         [iOS] Add support for deleteFromInputWithFlags.
1258         https://bugs.webkit.org/show_bug.cgi?id=141216
1259         rdar://problem/19130081
1260
1261         Reviewed by Benjamin Poulain.
1262
1263         Adopts the new method as soon as it is available.
1264         The patch also removes some obsolete code used for staging.
1265
1266         * Platform/spi/ios/UIKitSPI.h:
1267         * UIProcess/ios/WKContentViewInteraction.mm:
1268         (-[WKContentView _interpretKeyEvent:isCharEvent:]):
1269
1270 2015-02-03  Joseph Pecoraro  <pecoraro@apple.com>
1271
1272         [iOS] Selection Callout should not immediately disappear on pages with frequent layouts
1273         https://bugs.webkit.org/show_bug.cgi?id=141210
1274
1275         Reviewed by Enrica Casucci.
1276
1277         In iOS WebKit2 in order to keep caret refreshes in sync with WebCore layouts
1278         the selection assistant is told to update whenever WebKit's layer tree
1279         commits. Unfortunately, for pages with JavaScript animation that are
1280         frequently doing a layout / layer tree update, this would trigger very
1281         frequent selection updates that would keep the caret from blinking and
1282         dismiss any selection callouts.
1283
1284         This change tracks the last selection drawing information so that we can
1285         avoid informing the assistant of a selection updates unless it has changed
1286         visually or needs to redraw (zoom).
1287
1288         * Shared/EditorState.cpp:
1289         Remove include already in header.
1290
1291         * UIProcess/ios/WKContentViewInteraction.h:
1292         * UIProcess/ios/WKContentViewInteraction.mm:
1293         (WebKit::WKSelectionDrawingInfo::WKSelectionDrawingInfo):
1294         (WebKit::operator==):
1295         (WebKit::operator!=):
1296         (-[WKContentView observeValueForKeyPath:ofObject:change:context:]):
1297         When zooming, force the selection update, even though the drawing
1298         information hasn't changed, the views will need to be updated.
1299
1300         (-[WKContentView _updateChangedSelection]):
1301         (-[WKContentView _updateChangedSelection:]):
1302         Monitor EditorState for changes in selection drawing and avoid
1303         informing the selection assistant unless necessary.
1304
1305 2015-02-03  Jeremy Jones  <jeremyj@apple.com>
1306
1307         Prevent flicker when exiting fullscreen by synchronizing transactions.
1308         https://bugs.webkit.org/show_bug.cgi?id=140897
1309
1310         Reviewed by Tim Horton.
1311
1312         Flush transactions before removing layerHost. This allows existing transactions to be completed before the hosting layer disappears.
1313
1314         * UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
1315         (WebKit::WebVideoFullscreenManagerProxy::didCleanupFullscreen):
1316
1317 2015-02-03  Brian J. Burg  <burg@cs.washington.edu>
1318
1319         Convert WebInspectorProxy to use WKWebView API for the inspector view
1320         https://bugs.webkit.org/show_bug.cgi?id=141037
1321
1322         Reviewed by Timothy Hatcher.
1323
1324         Use the newer API for PLATFORM(MAC). The main difference is that the
1325         WKWebView's page group cannot be set directly; instead, the group identifier
1326         is passed. Also add some preference setters needed for the inspector.
1327
1328         Refactor some code to not use page groups directly. In a future patch,
1329         the PageGroup-based inspector level system will be simplified. It is
1330         it is no longer necessary to keep a static map of PageGroup instances,
1331         since they are only used to save inspector window preferences. (These used
1332         to prevent all levels of inspector from pausing together when a second-level
1333         inspector hit a breakpoint. This is not necessary with multi-process
1334         web inspectors.)
1335
1336         Also, adjust window resizing behavior when the inspector is docked to
1337         the right. Window width resizes should not affect the width of the inspector
1338         frame. This matches the behavior of height changes when docked to the bottom.
1339
1340         To support 32-bit Mac builds where WKWebView is not defined, share the stub
1341         platformFoo() implementations with PLATFORM(IOS). The stubs are now located
1342         in the platform-independent WebInspectorProxy.cpp.
1343
1344         * UIProcess/API/Cocoa/WKPreferences.mm:
1345         (-[WKPreferences _logsPageMessagesToSystemConsoleEnabled]): Added.
1346         (-[WKPreferences _setLogsPageMessagesToSystemConsoleEnabled:]): Added.
1347         (-[WKPreferences _allowFileAccessFromFileURLs]): Added.
1348         (-[WKPreferences _setAllowFileAccessFromFileURLs:]): Added.
1349         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
1350         * UIProcess/WebInspectorProxy.cpp:
1351         (WebKit::WebInspectorProxy::WebInspectorProxy):
1352         (WebKit::WebInspectorProxy::inspectorPagePreferences):
1353         (WebKit::WebInspectorProxy::attach):
1354         (WebKit::WebInspectorProxy::detach):
1355         (WebKit::WebInspectorProxy::setAttachedWindowHeight):
1356         (WebKit::WebInspectorProxy::setAttachedWindowWidth):
1357         (WebKit::WebInspectorProxy::createInspectorPage):
1358         (WebKit::WebInspectorProxy::shouldOpenAttached):
1359         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
1360         (WebKit::WebInspectorProxy::platformOpen):
1361         (WebKit::WebInspectorProxy::platformDidClose):
1362         (WebKit::WebInspectorProxy::platformInvalidate):
1363         (WebKit::WebInspectorProxy::platformBringToFront):
1364         (WebKit::WebInspectorProxy::platformHide):
1365         (WebKit::WebInspectorProxy::platformIsFront):
1366         (WebKit::WebInspectorProxy::platformInspectedURLChanged):
1367         (WebKit::WebInspectorProxy::platformSave):
1368         (WebKit::WebInspectorProxy::platformAppend):
1369         (WebKit::WebInspectorProxy::platformInspectedWindowHeight):
1370         (WebKit::WebInspectorProxy::platformInspectedWindowWidth):
1371         (WebKit::WebInspectorProxy::platformAttach):
1372         (WebKit::WebInspectorProxy::platformDetach):
1373         (WebKit::WebInspectorProxy::platformSetAttachedWindowHeight):
1374         (WebKit::WebInspectorProxy::platformSetToolbarHeight):
1375         (WebKit::WebInspectorProxy::inspectorPageURL):
1376         (WebKit::WebInspectorProxy::inspectorTestPageURL):
1377         (WebKit::WebInspectorProxy::inspectorBaseURL):
1378         (WebKit::WebInspectorProxy::platformSetAttachedWindowWidth):
1379         (WebKit::WebInspectorProxy::platformAttachAvailabilityChanged):
1380         * UIProcess/WebInspectorProxy.h:
1381         * UIProcess/ios/WebInspectorProxyIOS.mm: Removed.
1382         * UIProcess/mac/WebInspectorProxyMac.mm:
1383         (-[WKWebInspectorWKWebView _didRelaunchProcess]):
1384         WKWebView doesn't implement this, so remove the super call.
1385         (WebKit::WebInspectorProxy::closeTimerFired):
1386         (WebKit::createDockButton):
1387         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
1388         (WebKit::WebInspectorProxy::platformAttach):
1389         (-[WKWebInspectorWKView _didRelaunchProcess]): Deleted.
1390         * WebKit2.xcodeproj/project.pbxproj:
1391
1392 2015-02-03  Antti Koivisto  <antti@apple.com>
1393
1394         Memory cache for resources pending disk write
1395         https://bugs.webkit.org/show_bug.cgi?id=141159
1396
1397         Reviewed by Andreas Kling.
1398
1399         If a resource was requested from the disk cache before it has been written we ended up
1400         loading it again. Add a short lived memory cache to avoid this.
1401
1402         * NetworkProcess/cache/NetworkCache.cpp:
1403         (WebKit::decodeStorageEntry):
1404         * NetworkProcess/cache/NetworkCacheStorage.h:
1405         (WebKit::NetworkCacheStorage::Data::isMap):
1406
1407             Add a way to know whether a Data is backed by map or not. SharedMemory does not work correctly
1408             if it is not a map.
1409
1410         * NetworkProcess/cache/NetworkCacheStorageCocoa.mm:
1411         (WebKit::NetworkCacheStorage::Data::Data):
1412         (WebKit::NetworkCacheStorage::initialize):
1413
1414             Also do some renaming.
1415
1416         (WebKit::decodeEntry):
1417         (WebKit::NetworkCacheStorage::removeEntry):
1418         (WebKit::NetworkCacheStorage::retrieve):
1419         (WebKit::NetworkCacheStorage::store):
1420         (WebKit::NetworkCacheStorage::clear):
1421         (WebKit::NetworkCacheStorage::shrinkIfNeeded):
1422
1423 2015-02-02  Antti Koivisto  <antti@apple.com>
1424
1425         Update cache header after revalidation without rewriting the body data
1426         https://bugs.webkit.org/show_bug.cgi?id=141182
1427
1428         Reviewed by Andreas Kling.
1429
1430         Currently we just rewrite the entire entry after revalidation.
1431
1432         * NetworkProcess/cache/NetworkCache.cpp:
1433         (WebKit::decodeStorageEntry):
1434
1435             Include the strorage entry to the cache response so we can more easily update it.
1436
1437         (WebKit::NetworkCache::update):
1438
1439             Call the storage update function with the new and the exisiting storage entry.
1440
1441         * NetworkProcess/cache/NetworkCache.h:
1442         * NetworkProcess/cache/NetworkCacheStorage.h:
1443         * NetworkProcess/cache/NetworkCacheStorageCocoa.mm:
1444         (WebKit::openFileForKey):
1445
1446             Added an option for opening a file for writing without creating a new one.
1447             Renamed for clarity.
1448
1449         (WebKit::encodeEntryHeader):
1450
1451             Separate header encoding to a function.
1452
1453         (WebKit::encodeEntry):
1454         (WebKit::NetworkCacheStorage::dispatchRetrieveOperation):
1455         (WebKit::NetworkCacheStorage::store):
1456         (WebKit::NetworkCacheStorage::update):
1457
1458             New update function.
1459             If the page-rounded header size would stay unchanged we can just write the new header over the old one.
1460             In the unlikely event it doesn't we rewrite the whole thing.
1461
1462         (WebKit::createIOChannelForKey): Deleted.
1463
1464 2015-02-02  Commit Queue  <commit-queue@webkit.org>
1465
1466         Unreviewed, rolling out r179540.
1467         https://bugs.webkit.org/show_bug.cgi?id=141190
1468
1469         need further investigation to fix !WK_API_ENABLED (32bit)
1470         build. (Requested by brrian_ on #webkit).
1471
1472         Reverted changeset:
1473
1474         "Convert WebInspectorProxy to use WKWebView API for the
1475         inspector view"
1476         https://bugs.webkit.org/show_bug.cgi?id=141037
1477         http://trac.webkit.org/changeset/179540
1478
1479 2015-02-02  Brian J. Burg  <burg@cs.washington.edu>
1480
1481         Convert WebInspectorProxy to use WKWebView API for the inspector view
1482         https://bugs.webkit.org/show_bug.cgi?id=141037
1483
1484         Reviewed by Timothy Hatcher.
1485
1486         Use the newer API for PLATFORM(MAC). The main difference is that the
1487         WKWebView's page group cannot be set directly; instead, the group identifier
1488         is passed. Also add some preference setters needed for the inspector.
1489
1490         Refactor some code to not use page groups directly. In a future patch,
1491         the PageGroup-based inspector level system will be simplified. It is
1492         it is no longer necessary to keep a static map of PageGroup instances,
1493         since they are only used to save inspector window preferences. (These used
1494         to prevent all levels of inspector from pausing together when a second-level
1495         inspector hit a breakpoint. This is not necessary with multi-process
1496         web inspectors.)
1497
1498         Also, adjust window resizing behavior when the inspector is docked to
1499         the right. Window width resizes should not affect the width of the inspector
1500         frame. This matches the behavior of height changes when docked to the bottom.
1501
1502         * UIProcess/API/Cocoa/WKPreferences.mm:
1503         (-[WKPreferences _logsPageMessagesToSystemConsoleEnabled]): Added.
1504         (-[WKPreferences _setLogsPageMessagesToSystemConsoleEnabled:]): Added.
1505         (-[WKPreferences _allowFileAccessFromFileURLs]): Added.
1506         (-[WKPreferences _setAllowFileAccessFromFileURLs:]): Added.
1507         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
1508         * UIProcess/WebInspectorProxy.cpp:
1509         (WebKit::WebInspectorProxy::WebInspectorProxy):
1510         (WebKit::WebInspectorProxy::inspectorPagePreferences): Added.
1511         (WebKit::WebInspectorProxy::attach):
1512         (WebKit::WebInspectorProxy::detach):
1513         (WebKit::WebInspectorProxy::setAttachedWindowHeight):
1514         (WebKit::WebInspectorProxy::setAttachedWindowWidth):
1515         (WebKit::WebInspectorProxy::createInspectorPage):
1516         (WebKit::WebInspectorProxy::shouldOpenAttached):
1517         * UIProcess/WebInspectorProxy.h: Use default member initializers.
1518         * UIProcess/mac/WebInspectorProxyMac.mm:
1519         (-[WKWebInspectorWKWebView _didRelaunchProcess]):
1520         WKWebView doesn't implement this, so remove the super call.
1521         (WebKit::WebInspectorProxy::closeTimerFired):
1522         (WebKit::createDockButton):
1523         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
1524         (WebKit::WebInspectorProxy::platformAttach):
1525         (-[WKWebInspectorWKView _didRelaunchProcess]): Deleted.
1526
1527 2015-02-02  Chris Dumez  <cdumez@apple.com>
1528
1529         Make NetworkCache's constructor private
1530         https://bugs.webkit.org/show_bug.cgi?id=141181
1531
1532         Reviewed by Antti Koivisto.
1533
1534         Make NetworkCache's constructor private and mark its destructor as
1535         deleted as it is a singleton class.
1536
1537         * NetworkProcess/cache/NetworkCache.cpp:
1538         (WebKit::NetworkCache::NetworkCache): Deleted.
1539         * NetworkProcess/cache/NetworkCache.h:
1540
1541 2015-02-02  Filip Pizlo  <fpizlo@apple.com>
1542
1543         Revert accidental (and super bad) change in r179490.
1544
1545         * WebProcess/com.apple.WebProcess.sb.in:
1546
1547 2015-02-02  Chris Dumez  <cdumez@apple.com>
1548
1549         Access MemoryCache singleton using MemoryCache::singleton()
1550         https://bugs.webkit.org/show_bug.cgi?id=141104
1551
1552         Reviewed by Andreas Kling.
1553
1554         Access MemoryCache singleton using MemoryCache::singleton() static
1555         member function, instead of a free function, as per the recent
1556         coding style discussion on WebKit-dev.
1557
1558 2015-02-02  Jeremy Jones  <jeremyj@apple.com>
1559
1560         Prevent crash when accessing WebAVPlayerController.delegate.
1561         https://bugs.webkit.org/show_bug.cgi?id=140893
1562
1563         Reviewed by Darin Adler.
1564
1565         Plumb new resetMediaState() through IPC interface WebVideoFullscreenManagerProxy.
1566
1567         * UIProcess/ios/WebVideoFullscreenManagerProxy.messages.in:
1568         * UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
1569         (WebKit::WebVideoFullscreenManagerProxy::invalidate): remove redundant set to nullptr.
1570         * WebProcess/ios/WebVideoFullscreenManager.h:
1571         * WebProcess/ios/WebVideoFullscreenManager.mm:
1572         (WebKit::WebVideoFullscreenManager::resetMediaState):
1573
1574 2015-02-01  Chris Dumez  <cdumez@apple.com>
1575
1576         Use more references in HistoryItem
1577         https://bugs.webkit.org/show_bug.cgi?id=141133
1578
1579         Reviewed by Andreas Kling.
1580
1581         Use more references in HistoryItem instead of pointers.
1582
1583         * WebProcess/InjectedBundle/InjectedBundleBackForwardListItem.cpp:
1584         (WebKit::InjectedBundleBackForwardListItem::children):
1585         * WebProcess/WebCoreSupport/SessionStateConversion.cpp:
1586         (WebKit::toFrameState):
1587         (WebKit::applyFrameState):
1588         * WebProcess/WebPage/WebBackForwardListProxy.cpp:
1589         (WebKit::WebBackForwardListProxy::addItem):
1590         * WebProcess/WebPage/WebBackForwardListProxy.h:
1591
1592 2015-02-01  Dan Bernstein  <mitz@apple.com>
1593
1594         Remove ViewGestureController tracing
1595         https://bugs.webkit.org/show_bug.cgi?id=141137
1596
1597         Reviewed by Tim Horton.
1598
1599         Remove the tracing added in r176133, now that http://webkit.org/b/138750 is fixed.
1600
1601         * UIProcess/ios/ViewGestureControllerIOS.mm:
1602         (WebKit::ViewGestureController::beginSwipeGesture):
1603         (WebKit::ViewGestureController::endSwipeGesture):
1604         (WebKit::ViewGestureController::willCommitPostSwipeTransitionLayerTree):
1605         (WebKit::ViewGestureController::removeSwipeSnapshot):
1606         (WebKit::addLogEntry): Deleted.
1607         (WebKit::dumpLogEntries): Deleted.
1608         * UIProcess/mac/ViewGestureController.h:
1609
1610 2015-01-31  Sam Weinig  <sam@webkit.org>
1611
1612         Remove even more Mountain Lion support
1613         https://bugs.webkit.org/show_bug.cgi?id=141124
1614
1615         Reviewed by Alexey Proskuryakov.
1616
1617         * Configurations/Base.xcconfig:
1618         * Configurations/DebugRelease.xcconfig:
1619         * Configurations/FeatureDefines.xcconfig:
1620         * Configurations/Version.xcconfig:
1621         * Configurations/WebContentService.Development.xcconfig:
1622         * Configurations/WebContentService.xcconfig:
1623         * Configurations/WebKit.xcconfig:
1624         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
1625
1626 2015-01-31  Antti Koivisto  <antti@apple.com>
1627
1628         Enable WebKit disk cache on OS X
1629         https://bugs.webkit.org/show_bug.cgi?id=141022
1630
1631         Reviewed by Gavin Barraclough.
1632
1633         * config.h: Flip the switch.
1634
1635 2015-01-31  Antti Koivisto  <antti@apple.com>
1636
1637         Unreviewed, rolling out r179447.
1638
1639         Forgot to include the test.
1640
1641         Reverted changeset:
1642
1643         "Enable WebKit disk cache on OS X"
1644         https://bugs.webkit.org/show_bug.cgi?id=141022
1645         http://trac.webkit.org/changeset/179447
1646
1647 2015-01-31  Antti Koivisto  <antti@apple.com>
1648
1649         Enable WebKit disk cache on OS X
1650         https://bugs.webkit.org/show_bug.cgi?id=141022
1651
1652         Reviewed by Gavin Barraclough.
1653
1654         * config.h: Flip the switch.
1655
1656 2015-01-31  Antti Koivisto  <antti@apple.com>
1657
1658         OSObjectPtr does not work with dispatch_data_t on Maverics
1659         https://bugs.webkit.org/show_bug.cgi?id=141081
1660
1661         Reviewed by Zalan Bujtas.
1662
1663         Previous attempt to special case dispatch_data_t in OSObjectPtr didn't work in all cases
1664         probably due to the context sensitivity of the definition of the dispatch_data_t type.
1665
1666         For now, add DispatchPtr for the cache code and use it.
1667
1668         * NetworkProcess/cache/NetworkCacheStorage.h:
1669         (WebKit::DispatchPtr::DispatchPtr):
1670         (WebKit::DispatchPtr::~DispatchPtr):
1671         (WebKit::DispatchPtr::operator=):
1672         (WebKit::DispatchPtr::get):
1673         (WebKit::DispatchPtr::operator bool):
1674         (WebKit::adoptDispatch):
1675         * NetworkProcess/cache/NetworkCacheStorageCocoa.mm:
1676         (WebKit::NetworkCacheStorage::Data::Data):
1677         (WebKit::NetworkCacheStorage::Data::data):
1678         (WebKit::NetworkCacheStorage::NetworkCacheStorage):
1679         (WebKit::createIOChannelForKey):
1680         (WebKit::decodeEntry):
1681         (WebKit::encodeEntryMetaData):
1682         (WebKit::encodeEntry):
1683
1684 2015-01-30  Tim Horton  <timothy_horton@apple.com>
1685
1686         Add and hook up APINavigationClient
1687         https://bugs.webkit.org/show_bug.cgi?id=140698
1688
1689         Reviewed by Sam Weinig.
1690
1691         Add a single APINavigationClient that NavigationState implements and
1692         WebPageProxy prefers over APILoaderClient and APIPolicyClient.
1693
1694         * UIProcess/API/APILoaderClient.h:
1695         Fix a comment.
1696
1697         * UIProcess/API/APINavigationClient.h: Added.
1698         APINavigationClient is the union of NavigationState's overrides of APILoaderClient and APIPolicyClient.
1699         Names are adjusted to more closely match the Modern API.
1700
1701         * UIProcess/Cocoa/NavigationState.h:
1702         * UIProcess/Cocoa/NavigationState.mm:
1703         Instead of having policy and loader clients, NavigationState has a single navigation client.
1704         Adjust as necessary.
1705
1706         Move as much logic as possible (isMainFrame checks, construction of API objects) out of here
1707         and into WebPageProxy.
1708
1709         * UIProcess/API/Cocoa/WKWebView.mm:
1710         (-[WKWebView initWithFrame:configuration:]):
1711         Install the aforementioned single navigation client.
1712
1713         * UIProcess/WebPageProxy.cpp:
1714         (WebKit::WebPageProxy::setNavigationClient):
1715         Add a navigation client setter.
1716
1717         For all policy and loader client calls, if we have a navigation client, use that;
1718         otherwise, fall back on the policy and loader clients.
1719
1720         * UIProcess/WebPageProxy.h:
1721         * WebKit2.xcodeproj/project.pbxproj:
1722
1723 2015-01-30  Chris Dumez  <cdumez@apple.com>
1724
1725         Update MemoryCache code to use more references instead of pointers
1726         https://bugs.webkit.org/show_bug.cgi?id=141099
1727
1728         Reviewed by Andreas Kling.
1729
1730         * WebProcess/ResourceCache/WebResourceCacheManager.cpp:
1731         (WebKit::WebResourceCacheManager::clearCacheForOrigin):
1732
1733 2015-01-30  Chris Dumez  <cdumez@apple.com>
1734
1735         Rename shared() static member functions to singleton() for singleton classes.
1736         https://bugs.webkit.org/show_bug.cgi?id=141088
1737
1738         Reviewed by Ryosuke Niwa and Benjamin Poulain.
1739
1740         Rename shared() static member functions to singleton() for singleton
1741         classes as per the recent coding style change.
1742
1743 2015-01-30  Alexey Proskuryakov  <ap@apple.com>
1744
1745         Build fix.
1746
1747         * Shared/API/c/WKDeprecatedFunctions.cpp:
1748         * UIProcess/API/C/WKPreferencesRefPrivate.h:
1749         The screen font substitution functions still need to be present in the header.
1750
1751 2015-01-29  Carlos Garcia Campos  <cgarcia@igalia.com>
1752
1753         [GTK] Resize the redirected XComposite again after leaving accelerated compositing mode
1754         https://bugs.webkit.org/show_bug.cgi?id=140935
1755
1756         Reviewed by Sergio Villar Senin.
1757
1758         Since r178414 we don't resize the redirected XComposite window
1759         until we enter accelerated compositing mode, but after leaving it
1760         the redirected window keeps its size. We should resize it to 1x1
1761         again and free the XPixmap and cairo surface to save that memory
1762         while not in accelerated compositing mode.
1763
1764         * UIProcess/API/gtk/PageClientImpl.cpp:
1765         (WebKit::PageClientImpl::enterAcceleratedCompositingMode): Notify
1766         the WebKitWebViewBase.
1767         (WebKit::PageClientImpl::exitAcceleratedCompositingMode): Ditto.
1768         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
1769         (webkitWebViewBaseEnterAcceleratedCompositingMode): Resize the
1770         XComposite window to the current drawing area size.
1771         (webkitWebViewBaseExitAcceleratedCompositingMode): Resize the
1772         XComposite window to and empty size.
1773         * UIProcess/API/gtk/WebKitWebViewBasePrivate.h:
1774         * UIProcess/gtk/RedirectedXCompositeWindow.cpp:
1775         (WebKit::RedirectedXCompositeWindow::RedirectedXCompositeWindow):
1776         Do not initialize m_size since we now handle the empty size as a
1777         especial case. Make sure we always create the X window with at
1778         least 1x1 size.
1779         (WebKit::RedirectedXCompositeWindow::resize): Resize the window to
1780         at least 1x1, but when en empty size is given, call
1781         cleanupPixmapAndPixmapSurface() to release those resources.
1782         (WebKit::RedirectedXCompositeWindow::surface): Create the cairo
1783         surface with at least 1x1 size.
1784
1785 2015-01-29  Carlos Garcia Campos  <cgarcia@igalia.com>
1786
1787         [GTK] Runtime critical warnings sometimes at start up when using the network process
1788         https://bugs.webkit.org/show_bug.cgi?id=140998
1789
1790         Reviewed by Žan Doberšek.
1791
1792         This is caused by the CustomProtocolManager work queue
1793         theread. This WorkQueue is created when the CustomProtocolManager
1794         object is constructed, but destroyed when it's initialized when
1795         the UI process asks to use the network process. In this case,
1796         sometimes happens that the work queue thread that runs the main
1797         loop is executed once the object has been destroyed and the main
1798         loop pointer is nullptr.
1799
1800         * Platform/WorkQueue.h:
1801         * Platform/gtk/WorkQueueGtk.cpp:
1802         (WorkQueue::platformInitialize): Use a lambda function for the
1803         thread body.
1804         (WorkQueue::platformInvalidate): Detach the worker thread before
1805         deleting the main loop object.
1806         (WorkQueue::startWorkQueueThread): Deleted.
1807         (WorkQueue::workQueueThreadBody): Deleted.
1808
1809 2015-01-29  Beth Dakin  <bdakin@apple.com>
1810
1811         Another follow-on, spotted this mistake. This used to be 
1812         #if PLATFORM(IOS) || __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090 , so it should now be 
1813         COCOA.
1814
1815         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1816         (WebKit::registerUserDefaultsIfNeeded):
1817
1818 2015-01-29  Beth Dakin  <bdakin@apple.com>
1819
1820         Follow-on, fixing a bad merge from my last change. 
1821
1822         * Shared/WebPreferencesDefinitions.h:
1823
1824 2015-01-29  Beth Dakin  <bdakin@apple.com>
1825
1826         Remove more Mountain Lion code from WebKit2
1827         https://bugs.webkit.org/show_bug.cgi?id=141052
1828
1829         Reviewed by Tim Horton.
1830
1831         * NetworkProcess/NetworkResourceLoader.cpp:
1832         (WebKit::NetworkResourceLoader::sendBufferMaybeAborting):
1833         * NetworkProcess/NetworkResourceLoader.h:
1834         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
1835         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
1836         * NetworkProcess/mac/NetworkDiskCacheMonitor.mm:
1837         * NetworkProcess/mac/NetworkResourceLoaderMac.mm:
1838         (WebKit::NetworkResourceLoader::willCacheResponseAsync):
1839         * Platform/IPC/MessageDecoder.cpp:
1840         * Platform/IPC/MessageDecoder.h:
1841         * Platform/IPC/mac/ConnectionMac.mm:
1842         (IPC::ConnectionTerminationWatchdog::watchdogTimerFired):
1843         (IPC::Connection::open):
1844         (IPC::Connection::receiveSourceEventHandler):
1845         (IPC::Connection::kill):
1846         * Platform/IPC/mac/ImportanceAssertion.h:
1847         * PluginProcess/mac/PluginProcessMac.mm:
1848         (WebKit::PluginProcess::initializeProcessName):
1849         * Shared/WebPreferencesDefinitions.h:
1850         * Shared/mac/ChildProcessMac.mm:
1851         (WebKit::initializeTimerCoalescingPolicy):
1852         (WebKit::ChildProcess::setApplicationIsDaemon):
1853         (WebKit::ChildProcess::platformInitialize):
1854         (WebKit::ChildProcess::setQOS):
1855         * Shared/mac/CookieStorageShim.mm:
1856         (WebKit::CookieStorageShim::initialize):
1857         * UIProcess/API/mac/WKView.mm:
1858         (-[WKView addWindowObserversForWindow:]):
1859         (-[WKView removeWindowObservers]):
1860         (-[WKView _windowDidChangeOcclusionState:]):
1861         * UIProcess/Cocoa/NavigationState.mm:
1862         (WebKit::NavigationState::LoaderClient::didReceiveAuthenticationChallengeInFrame):
1863         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1864         (WebKit::registerUserDefaultsIfNeeded):
1865         (WebKit::WebProcessPool::platformInitializeWebProcess):
1866         (WebKit::WebProcessPool::registerNotificationObservers):
1867         (WebKit::WebProcessPool::unregisterNotificationObservers):
1868         (WebKit::privateBrowsingSession):
1869         (WebKit::WebProcessPool::isURLKnownHSTSHost):
1870         (WebKit::WebProcessPool::resetHSTSHosts):
1871         * UIProcess/Databases/mac/DatabaseProcessProxyMac.mm:
1872         (WebKit::shouldUseXPC):
1873         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
1874         (WebKit::shouldUseXPC):
1875         * UIProcess/WebProcessPool.h:
1876         * UIProcess/mac/TextCheckerMac.mm:
1877         (WebKit::shouldAutomaticQuoteSubstitutionBeEnabled):
1878         (WebKit::shouldAutomaticDashSubstitutionBeEnabled):
1879         (WebKit::TextChecker::didChangeAutomaticQuoteSubstitutionEnabled):
1880         (WebKit::TextChecker::didChangeAutomaticDashSubstitutionEnabled):
1881         * UIProcess/mac/ViewGestureControllerMac.mm:
1882         (WebKit::ViewGestureController::applyDebuggingPropertiesToSwipeViews):
1883         * UIProcess/mac/WebProcessProxyMac.mm:
1884         (WebKit::shouldUseXPC):
1885         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
1886         (InitWebCoreSystemInterface):
1887         * WebProcess/cocoa/WebProcessCocoa.mm:
1888         (WebKit::WebProcess::updateActivePages):
1889         * WebProcess/com.apple.WebProcess.sb.in:
1890         * config.h:
1891
1892 2015-01-29  Sam Weinig  <sam@webkit.org>
1893
1894         Remove support for screen font substitution
1895         https://bugs.webkit.org/show_bug.cgi?id=141038
1896
1897         Reviewed by Tim Horton.
1898
1899         * Shared/API/c/WKDeprecatedFunctions.cpp:
1900         (WKPreferencesSetScreenFontSubstitutionEnabled):
1901         (WKPreferencesGetScreenFontSubstitutionEnabled):
1902         Move now empty preferences SPI to WKDeprecatedFunctions.
1903         
1904         * Shared/WebPreferencesDefinitions.h:
1905         * Shared/WebProcessCreationParameters.cpp:
1906         (WebKit::WebProcessCreationParameters::WebProcessCreationParameters):
1907         (WebKit::WebProcessCreationParameters::encode):
1908         (WebKit::WebProcessCreationParameters::decode):
1909         * Shared/WebProcessCreationParameters.h:
1910         * UIProcess/API/C/WKPreferences.cpp:
1911         (WKPreferencesSetScreenFontSubstitutionEnabled): Deleted.
1912         (WKPreferencesGetScreenFontSubstitutionEnabled): Deleted.
1913         * UIProcess/API/C/WKPreferencesRefPrivate.h:
1914         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1915         (WebKit::WebProcessPool::platformInitializeWebProcess):
1916         * WebProcess/WebPage/WebPage.cpp:
1917         (WebKit::WebPage::updatePreferences):
1918         * WebProcess/WebProcess.h:
1919         (WebKit::WebProcess::presenterApplicationPid):
1920         (WebKit::WebProcess::shouldForceScreenFontSubstitution): Deleted.
1921         * WebProcess/cocoa/WebProcessCocoa.mm:
1922         (WebKit::WebProcess::platformInitializeWebProcess):
1923         Stop piping screen font substitution setting to the web process.
1924
1925 2015-01-29  Alexey Proskuryakov  <ap@apple.com>
1926
1927         Frequent kernel panics when running WebKit regression tests
1928         https://bugs.webkit.org/show_bug.cgi?id=141043
1929
1930         Reviewed by Sam Weinig.
1931
1932         Split PluginService.Development into 32-bit and 64-bit variants, to better match
1933         production variant. When building FAT, we'll have the right architecture from
1934         the start now, so no need to re-exec into a different architecture.        
1935
1936         * Configurations/PluginService.Development.xcconfig: Removed.
1937         * Configurations/PluginService.32.Development.xcconfig: Copied from Source/WebKit2/Configurations/PluginService.Development.xcconfig.
1938         * Configurations/PluginService.64.Development.xcconfig: Copied from Source/WebKit2/Configurations/PluginService.Development.xcconfig.
1939         Changed to use ONLY_ACTIVE_ARCH instead of CONFIGURATION, so that we build the
1940         right thing even in debug FAT builds.
1941
1942         * Configurations/PluginService.32.xcconfig:
1943         * Configurations/PluginService.64.xcconfig:
1944         While at it, applied the same changes as in Development variants. This means that
1945         FAT builds will now build only the correct architecture for PluginService.64
1946         (it used to build FAT, unnecessarily).
1947
1948         * PluginProcess/EntryPoint/mac/XPCService/PluginService.Development/Info.plist:
1949         Updated to support multiple product names.
1950
1951         * UIProcess/Launcher/mac/ProcessLauncherMac.mm: (WebKit::serviceName): Launch the
1952         right development service.
1953
1954         * WebKit2.xcodeproj/project.pbxproj: Split the Plugin.Development target into two.
1955
1956 2015-01-29  Tim Horton  <timothy_horton@apple.com>
1957
1958         Fix the build with newer Clang
1959
1960         * NetworkProcess/NetworkConnectionToWebProcess.h:
1961         These should be 'override's.
1962
1963 2015-01-29  Chris Dumez  <cdumez@apple.com>
1964
1965         Clean up / modernize PageCache class
1966         https://bugs.webkit.org/show_bug.cgi?id=141009
1967
1968         Reviewed by Darin Adler.
1969
1970         Clean up / modernize PageCache class.
1971
1972         * WebProcess/WebPage/WebBackForwardListProxy.cpp:
1973         (WebKit::WebBackForwardListProxy::removeItem):
1974         (WebKit::WebBackForwardListProxy::close):
1975         * WebProcess/WebPage/WebPage.cpp:
1976         (WebKit::WebPage::goForward):
1977         (WebKit::WebPage::goBack):
1978         (WebKit::WebPage::goToBackForwardItem):
1979         * WebProcess/WebProcess.cpp:
1980         (WebKit::WebProcess::releasePageCache):
1981         * WebProcess/cocoa/WebProcessCocoa.mm:
1982         (WebKit::WebProcess::platformSetCacheModel):
1983         * WebProcess/soup/WebProcessSoup.cpp:
1984         (WebKit::WebProcess::platformSetCacheModel):
1985
1986 2015-01-29  Csaba Osztrogonác  <ossy@webkit.org>
1987
1988         [EFL][GTK] Fix the build after r179326
1989         https://bugs.webkit.org/show_bug.cgi?id=141027
1990
1991         Reviewed by Alexey Proskuryakov.
1992
1993         Guard MessageRecorder implementation with USE(DTRACE)
1994         for platforms not supporting DTrace.
1995
1996         Original patch by Carlos Garcia Campos <cgarcia@igalia.com>
1997
1998         * Platform/IPC/ArgumentCoders.cpp:
1999         * Platform/IPC/ArgumentCoders.h:
2000         * Platform/IPC/Connection.cpp:
2001         (IPC::Connection::dispatchWorkQueueMessageReceiverMessage):
2002         (IPC::Connection::sendMessage):
2003         (IPC::Connection::sendSyncMessage):
2004         (IPC::Connection::sendSyncMessageFromSecondaryThread):
2005         (IPC::Connection::dispatchSyncMessage):
2006         (IPC::Connection::dispatchMessage):
2007         * Platform/IPC/MessageDecoder.cpp:
2008         (IPC::MessageDecoder::MessageDecoder):
2009         * Platform/IPC/MessageDecoder.h:
2010         * Platform/IPC/MessageEncoder.cpp:
2011         (IPC::MessageEncoder::MessageEncoder):
2012         (IPC::MessageEncoder::encodeHeader):
2013         * Platform/IPC/MessageEncoder.h:
2014         * Platform/IPC/MessageRecorder.h:
2015
2016 2015-01-29  Tim Horton  <timothy_horton@apple.com>
2017
2018         Avoid manually handling quickLookWithEvent: if the immediate action gesture recognizer will do Lookup for us
2019         https://bugs.webkit.orgshow_bug.cgi?id=141018
2020         <rdar://problem/19619999>
2021
2022         * UIProcess/API/mac/WKView.mm:
2023         (-[WKView quickLookWithEvent:]):
2024         Yosemite is 101000, not 10100.
2025
2026 2015-01-28  Tim Horton  <timothy_horton@apple.com>
2027
2028         Add API::{FrameInfo, NavigationAction, NavigationResponse} types
2029         https://bugs.webkit.org/show_bug.cgi?id=140982
2030
2031         Reviewed by Sam Weinig.
2032
2033         Make C++ API objects for WK{FrameInfo, NavigationAction, NavigationResponse}
2034         to wrap around, as a step towards moving Modern API logic down into WebPageProxy.
2035
2036         * Shared/API/APIObject.h:
2037         * Shared/Cocoa/APIObject.mm:
2038         (API::Object::newObject):
2039         * UIProcess/API/APIFrameInfo.cpp: Added.
2040         * UIProcess/API/APIFrameInfo.h: Added.
2041         * UIProcess/API/APINavigationAction.h: Added.
2042         * UIProcess/API/APINavigationResponse.h: Added.
2043         Add API::FrameInfo, API::NavigationAction, and API::NavigationResponse.
2044
2045         * UIProcess/API/Cocoa/WKFrameInfo.mm:
2046         * UIProcess/API/Cocoa/WKFrameInfoInternal.h:
2047         Make WKFrameInfo a WKObject, wrapping a API::FrameInfo.
2048
2049         * UIProcess/API/Cocoa/WKNavigationAction.mm:
2050         * UIProcess/API/Cocoa/WKNavigationActionInternal.h:
2051         Make WKNavigationAction a WKObject, wrapping a API::NavigationAction.
2052
2053         * UIProcess/API/Cocoa/WKNavigationResponse.mm:
2054         * UIProcess/API/Cocoa/WKNavigationResponseInternal.h:
2055         Make WKNavigationResponse a WKObject, wrapping a API::NavigationResponse.
2056
2057         * UIProcess/API/Cocoa/WKUserContentController.mm:
2058         Adopt API::FrameInfo.
2059
2060         * UIProcess/Cocoa/NavigationState.mm:
2061         (WebKit::NavigationState::PolicyClient::decidePolicyForNavigationAction):
2062         Adopt API::FrameInfo, and reorganize the code slightly.
2063         Adopt API::NavigationAction.
2064
2065         (WebKit::NavigationState::PolicyClient::decidePolicyForResponse):
2066         Adopt API::FrameInfo.
2067         Adopt API::NavigationResponse.
2068
2069         (WebKit::NavigationState::LoaderClient::didFailProvisionalLoadWithErrorForFrame):
2070         Adopt API::FrameInfo.
2071
2072         * UIProcess/Cocoa/UIDelegate.mm:
2073         (WebKit::UIDelegate::UIClient::createNewPage):
2074         (WebKit::UIDelegate::UIClient::runJavaScriptAlert):
2075         (WebKit::UIDelegate::UIClient::runJavaScriptConfirm):
2076         (WebKit::UIDelegate::UIClient::runJavaScriptPrompt):
2077         Adopt API::FrameInfo.
2078
2079         * WebKit2.xcodeproj/project.pbxproj:
2080
2081 2015-01-28  Antti Koivisto  <antti@apple.com>
2082
2083         http/tests/xmlhttprequest/workers/methods.html sometimes times out with disk cache enabled
2084         https://bugs.webkit.org/show_bug.cgi?id=140976
2085
2086         Reviewed by Chris Dumez.
2087
2088         The previous fix sometimes invoked the completion handler twice. Explicitly track if we
2089         have called it or not.
2090
2091         * NetworkProcess/cache/NetworkCacheStorageCocoa.mm:
2092         (WebKit::NetworkCacheStorage::dispatchRetrieveOperation):
2093
2094         Also move the error case to the done branch. According to the documentation 'done' is always set on error.
2095
2096 2015-01-28  Timothy Horton  <timothy_horton@apple.com>
2097
2098         Add a WebKitMessageRecorder DTrace provider, exposing IPC details to DTrace
2099         https://bugs.webkit.org/show_bug.cgi?id=140673
2100
2101         Reviewed by Sam Weinig.
2102
2103         * Platform/IPC/ArgumentCoders.cpp:
2104         (IPC::ArgumentCoder<uuid_t>::encode):
2105         (IPC::ArgumentCoder<uuid_t>::decode):
2106         * Platform/IPC/ArgumentCoders.h:
2107         Add a uuid_t (simple) argument coder.
2108         Fix a mis-named header-guard #ifdef.
2109
2110         * Platform/IPC/Connection.cpp:
2111         (IPC::Connection::dispatchWorkQueueMessageReceiverMessage):
2112         (IPC::Connection::dispatchSyncMessage):
2113         Sync message replies inherit the message UUID from the incoming sync message.
2114
2115         (IPC::Connection::sendMessage):
2116         (IPC::Connection::waitForMessage):
2117         (IPC::Connection::sendSyncMessage):
2118         (IPC::Connection::sendSyncMessageFromSecondaryThread):
2119         Record outgoing messages. Because sendSyncMessage calls sendMessage,
2120         we have to explicitly avoid recording the message twice.
2121
2122         (IPC::Connection::dispatchMessage):
2123         Record the incoming message.
2124
2125         (IPC::Connection::remoteProcessID):
2126         Add remoteProcessID(), which tries to determine the pid of the remote process.
2127
2128         * Platform/IPC/Connection.h:
2129         (IPC::Connection::xpcConnection):
2130         This can be const.
2131
2132         (IPC::Connection::isValid):
2133         Make this public.
2134
2135         * Platform/IPC/MessageDecoder.cpp:
2136         (IPC::MessageDecoder::MessageDecoder):
2137         * Platform/IPC/MessageDecoder.h:
2138         (IPC::MessageDecoder::setMessageProcessingToken):
2139         (IPC::MessageDecoder::UUID):
2140         Decode and store the message UUID.
2141         Store a MessageProcessingToken for the lifetime of the MessageDecoder;
2142         this ensures that all time spent processing the incoming message will be
2143         counted against that message.
2144
2145         * Platform/IPC/MessageEncoder.cpp:
2146         (IPC::MessageEncoder::MessageEncoder):
2147         By default, create a new UUID for the message. Alternatively, allow clients
2148         to pass the message UUID in (used for sync message replies).
2149         Store the messageReceiverName and messageName.
2150
2151         (IPC::MessageEncoder::encodeHeader):
2152         Factor encodeHeader() out of the constructors so most of their code can be shared.
2153
2154         (IPC::MessageEncoder::isSyncMessage):
2155         (IPC::MessageEncoder::shouldDispatchMessageWhenWaitingForSyncReply):
2156         Add getters for these flags.
2157
2158         * Platform/IPC/MessageEncoder.h:
2159         (IPC::MessageEncoder::messageReceiverName):
2160         (IPC::MessageEncoder::messageName):
2161         (IPC::MessageEncoder::destinationID):
2162         (IPC::MessageEncoder::UUID):
2163
2164         * Platform/IPC/MessageRecorder.h: Added.
2165         * Platform/IPC/MessageRecorder.cpp: Added.
2166         (MessageRecorder::MessageRecorder):
2167         Add a class that interfaces with a custom DTrace provider to log incoming and outgoing messages.
2168
2169         (MessageRecorder::shared):
2170         (MessageRecorder::isEnabled):
2171         Determine if either of the message probes are enabled. If not, we'll avoid most of the
2172         work associated with MessageRecorder.
2173
2174         (MessageRecorder::recordOutgoingMessage):
2175         (MessageRecorder::recordIncomingMessage):
2176         Build a WebKitMessageRecord and MessageProcessingToken from the Message(De|En)coder.
2177         Once the MessageProcessingToken is deallocated, the probe will be invoked with the WebKitMessageRecord.
2178
2179         (MessageRecorder::MessageProcessingToken::MessageProcessingToken):
2180         (MessageRecorder::MessageProcessingToken::~MessageProcessingToken):
2181         Keep track of when the token is created and destroyed; these are considered the beginning
2182         and ending "processing" times of the message (and as such the token should be kept alive for
2183         exactly as long as the message is being processed).
2184
2185         * Platform/IPC/MessageRecorderProbes.d: Added.
2186         Add a DTrace provider source file with two probes, message_sent and message_received.
2187         The struct must match the struct in MessageRecorder.h.
2188         
2189         * Platform/IPC/ProcessType.h: Added.
2190         Add an enum of process types.
2191
2192         * WebKit2.xcodeproj/project.pbxproj:
2193
2194         * DatabaseProcess/DatabaseProcess.h:
2195         * DatabaseProcess/DatabaseToWebProcessConnection.h:
2196         * NetworkProcess/NetworkConnectionToWebProcess.h:
2197         * NetworkProcess/NetworkProcess.h:
2198         * WebProcess/Databases/WebToDatabaseProcessConnection.h:
2199         * WebProcess/Network/NetworkProcessConnection.h:
2200         * WebProcess/Plugins/PluginProcessConnection.h:
2201         * WebProcess/WebPage/WebInspector.h:
2202         * WebProcess/WebPage/WebInspectorUI.h:
2203         * WebProcess/WebProcess.h:
2204         * UIProcess/Databases/DatabaseProcessProxy.h:
2205         * UIProcess/Network/NetworkProcessProxy.h:
2206         * UIProcess/Plugins/PluginProcessProxy.h:
2207         * UIProcess/WebProcessProxy.h:
2208         * PluginProcess/PluginProcess.h:
2209         * PluginProcess/WebProcessConnection.h:
2210         Annotate Connection::Clients with process types.
2211         
2212 2015-01-28  Joseph Pecoraro  <pecoraro@apple.com>
2213
2214         Web Inspector: Crash closing inspected page with frequent activity
2215         https://bugs.webkit.org/show_bug.cgi?id=140973
2216
2217         Reviewed by Timothy Hatcher.
2218
2219         * WebProcess/WebPage/WebInspector.h:
2220         (WebKit::WebInspector::disconnectFromPage):        
2221         * WebProcess/WebPage/WebPage.cpp:
2222         (WebKit::WebPage::close):
2223         Be sure to close the WebInspector connection through the page
2224         when the page is closing so that the WebKit::WebInspector is
2225         relinquishes itself as the InspectorFrontendChannel.
2226
2227 2015-01-28  Timothy Horton  <timothy_horton@apple.com>
2228
2229         Avoid manually handling quickLookWithEvent: if the immediate action gesture recognizer will do Lookup for us
2230         https://bugs.webkit.org/show_bug.cgi?id=141018
2231         <rdar://problem/19619999>
2232
2233         Reviewed by Beth Dakin.
2234
2235         * UIProcess/API/mac/WKView.mm:
2236         (-[WKView quickLookWithEvent:]):
2237         If we have an immediate action gesture recognizer, just call super and
2238         avoid WebKit's special quickLookWithEvent: implementation.
2239
2240 2015-01-28  Sungmann Cho  <sungmann.cho@navercorp.com>
2241
2242         Remove remaining PLATFORM(WIN) code blocks from WebKit2.
2243         https://bugs.webkit.org/show_bug.cgi?id=140972
2244
2245         Reviewed by Darin Adler.
2246
2247         * WebProcess/Cookies/cf/WebCookieManagerCFNet.cpp:
2248         (WebKit::WebCookieManager::platformSetHTTPCookieAcceptPolicy):
2249
2250 2015-01-28  Beth Dakin  <bdakin@apple.com>
2251
2252         Remove Mountain Lion code from WebKit and WebKit2
2253         https://bugs.webkit.org/show_bug.cgi?id=141010
2254
2255         Reviewed by Sam Weinig.
2256
2257         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
2258         * PluginProcess/EntryPoint/mac/LegacyProcess/PluginProcessMain.mm:
2259         * Shared/mac/ChildProcessMac.mm:
2260         (WebKit::ChildProcess::initializeSandbox):
2261         * Shared/mac/WebEventFactory.mm:
2262         (WebKit::phaseForEvent):
2263         * UIProcess/API/mac/WKView.mm:
2264         (-[WKView quickLookWithEvent:]):
2265         (-[WKView updateLayer]):
2266         (-[WKView createFullScreenWindow]):
2267         * UIProcess/Network/NetworkProcessProxy.cpp:
2268         (WebKit::NetworkProcessProxy::didFinishLaunching):
2269         * UIProcess/Network/mac/NetworkProcessProxyMac.mm:
2270         (WebKit::shouldUseXPC):
2271         * UIProcess/WebProcessProxy.cpp:
2272         (WebKit::WebProcessProxy::didFinishLaunching):
2273         * UIProcess/mac/PageClientImpl.mm:
2274         (WebKit::PageClientImpl::isViewVisible):
2275         * WebKit2Prefix.h:
2276         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
2277         (InitWebCoreSystemInterface):
2278         * WebProcess/com.apple.WebProcess.sb.in:
2279
2280 2015-01-28  Joseph Pecoraro  <pecoraro@apple.com>
2281
2282         Web Inspector: Crash when closing inspected page
2283         https://bugs.webkit.org/show_bug.cgi?id=140968
2284
2285         Reviewed by Timothy Hatcher.
2286
2287         Handle cases where the corePage could be null. With the Inspector Process
2288         in its own process, messages may come to the WebContentProcess after
2289         the WebCore::Page has itself been destroyed.
2290
2291         * WebProcess/WebPage/WebInspector.cpp:
2292         (WebKit::WebInspector::show):
2293         (WebKit::WebInspector::close):
2294         (WebKit::WebInspector::openInNewTab):
2295         (WebKit::WebInspector::evaluateScriptForTest):
2296         (WebKit::WebInspector::showConsole):
2297         (WebKit::WebInspector::showResources):
2298         (WebKit::WebInspector::showMainResourceForFrame):
2299         (WebKit::WebInspector::startPageProfiling):
2300         (WebKit::WebInspector::stopPageProfiling):
2301         (WebKit::WebInspector::canAttachWindow):
2302         (WebKit::WebInspector::sendMessageToBackend):
2303         (WebKit::WebInspector::remoteFrontendConnected):
2304         (WebKit::WebInspector::remoteFrontendDisconnected):
2305
2306 2015-01-28  Sam Weinig  <sam@webkit.org>
2307
2308         Convert WebPreferences and VisitedLinkProvider to be bridged API::Objects
2309         https://bugs.webkit.org/show_bug.cgi?id=141002
2310
2311         Reviewed by Tim Horton.
2312
2313         * Shared/API/APIObject.h:
2314         Add VisitedLinkProvider type.
2315         
2316         * Shared/Cocoa/APIObject.mm:
2317         (API::Object::newObject):
2318         Allocate WebPreferences and VisitedLinkProvider as their Objective-C counterpart.
2319         
2320         * UIProcess/API/Cocoa/WKPreferences.mm:
2321         (-[WKPreferences init]):
2322         Switch to constructInWrapper.
2323
2324         (-[WKPreferences dealloc]):
2325         Call the WebPreferences destructor.
2326         
2327         (-[WKPreferences _apiObject]):
2328         Add implementation of the WKObject protocol.
2329
2330         * UIProcess/API/Cocoa/WKPreferencesInternal.h:
2331         Convert to using ObjectStorage.
2332
2333         * UIProcess/API/Cocoa/_WKVisitedLinkProvider.mm:
2334         (-[_WKVisitedLinkProvider init]):
2335         Switch to constructInWrapper.
2336
2337         (-[_WKVisitedLinkProvider dealloc]):
2338         Call the VisitedLinkProvider destructor.
2339
2340         (-[_WKVisitedLinkProvider _apiObject]):
2341         Add implementation of the WKObject protocol.
2342
2343         * UIProcess/API/Cocoa/_WKVisitedLinkProviderInternal.h:
2344         Convert to using ObjectStorage.
2345
2346         * UIProcess/VisitedLinkProvider.cpp:
2347         (WebKit::VisitedLinkProvider::create):
2348         * UIProcess/VisitedLinkProvider.h:
2349         Switch create() to return a Ref.
2350
2351         * UIProcess/WebPreferences.h:
2352         Make the constructor public for use by constructInWrapper.
2353
2354         * UIProcess/WebProcessPool.cpp:
2355         (WebKit::WebProcessPool::createWebPage):
2356         * UIProcess/WebProcessPool.h:
2357         Store the VisitedLinkProvider in a Ref.
2358
2359 2015-01-28  Dana Burkart  <dburkart@apple.com>
2360
2361         Move ASan flag settings from DebugRelease.xcconfig to Base.xcconfig
2362         https://bugs.webkit.org/show_bug.cgi?id=136765
2363
2364         Reviewed by Alexey Proskuryakov.
2365
2366         * Configurations/Base.xcconfig:
2367         * Configurations/DebugRelease.xcconfig:
2368
2369 2015-01-28  Chris Dumez  <cdumez@apple.com>
2370
2371         Fix typo in markPagesForVistedLinkStyleRecalc()
2372         https://bugs.webkit.org/show_bug.cgi?id=140977
2373
2374         Reviewed by Darin Adler.
2375
2376         * WebProcess/WebPage/VisitedLinkTableController.cpp:
2377         (WebKit::VisitedLinkTableController::setVisitedLinkTable):
2378         (WebKit::VisitedLinkTableController::visitedLinkStateChanged):
2379         (WebKit::VisitedLinkTableController::allVisitedLinkStateChanged):
2380         (WebKit::VisitedLinkTableController::removeAllVisitedLinks):
2381
2382 2015-01-27  Antti Koivisto  <antti@apple.com>
2383
2384         http/tests/xmlhttprequest/workers/methods.html sometimes times out with disk cache enabled
2385         https://bugs.webkit.org/show_bug.cgi?id=140976
2386
2387         Reviewed by Chris Dumez.
2388
2389         Running
2390
2391             run-webkit-tests --release -2 http/tests/xmlhttprequest/workers/methods.html --iterations=100
2392
2393         would usually time out an iteration.
2394
2395         * NetworkProcess/cache/NetworkCacheStorageCocoa.mm:
2396         (WebKit::NetworkCacheStorage::dispatchRetrieveOperation):
2397
2398         Using dispatch_io_read with an empty file calls the handler block immediately with done boolean set
2399         without it being an error. We failed to call the completion handler and any synchronous xhr would hang.
2400         We may see an empty cache file if we are just in process of writing it.
2401
2402         Fix by handling this case specifically.
2403
2404 2015-01-28  Carlos Garcia Campos  <cgarcia@igalia.com>
2405
2406         Unreviewed. Add missing file to WebInspector compilation for GTK+.
2407
2408         * PlatformGTK.cmake: Add UserInterface/External/ESLint/eslint.js
2409
2410 2015-01-28  Chris Dumez  <cdumez@apple.com>
2411
2412         Rename pageCache() to PageCache::shared() and return a reference
2413         https://bugs.webkit.org/show_bug.cgi?id=140983
2414
2415         Reviewed by Andreas Kling.
2416
2417         Rename pageCache() to PageCache::shared() as this is a singleton class
2418         and have it return a reference instead of a pointer.
2419
2420         * WebProcess/WebPage/VisitedLinkTableController.cpp:
2421         (WebKit::VisitedLinkTableController::setVisitedLinkTable):
2422         (WebKit::VisitedLinkTableController::visitedLinkStateChanged):
2423         (WebKit::VisitedLinkTableController::allVisitedLinkStateChanged):
2424         (WebKit::VisitedLinkTableController::removeAllVisitedLinks):
2425         * WebProcess/WebPage/WebBackForwardListProxy.cpp:
2426         (WebKit::WebBackForwardListProxy::removeItem):
2427         (WebKit::WebBackForwardListProxy::close):
2428         * WebProcess/WebProcess.cpp:
2429         (WebKit::WebProcess::releasePageCache):
2430         * WebProcess/cocoa/WebProcessCocoa.mm:
2431         (WebKit::WebProcess::platformSetCacheModel):
2432         * WebProcess/soup/WebProcessSoup.cpp:
2433         (WebKit::WebProcess::platformSetCacheModel):
2434
2435 2015-01-27  Alexey Proskuryakov  <ap@apple.com>
2436
2437         More build fixes for newer clang.
2438
2439         Rubber-stamped by Anders Carlsson.
2440
2441         Added missing override keywords, marked some deprecated accessibility methods as such.
2442
2443         * PluginProcess/EntryPoint/mac/LegacyProcess/PluginProcessMain.mm:
2444         (WebKit::PluginProcessMainDelegate::doPreInitializationWork): Deleted.
2445         (WebKit::PluginProcessMainDelegate::getExtraInitializationData): Deleted.
2446         (WebKit::PluginProcessMainDelegate::doPostRunWork): Deleted.
2447         * PluginProcess/WebProcessConnection.h:
2448         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2449         (WebKit::WebProcessPool::platformInitializeWebProcess):
2450         * UIProcess/Plugins/PluginProcessProxy.h:
2451         * UIProcess/WebPageProxy.h:
2452         * UIProcess/mac/PageClientImpl.h:
2453         * WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:
2454         (PageOverlayClientImpl::actionContextForResultAtPoint): Deleted.
2455         (PageOverlayClientImpl::dataDetectorsDidPresentUI): Deleted.
2456         (PageOverlayClientImpl::dataDetectorsDidChangeUI): Deleted.
2457         (PageOverlayClientImpl::dataDetectorsDidHideUI): Deleted.
2458         * WebProcess/Plugins/Netscape/NetscapePlugin.h:
2459         (WebKit::NetscapePlugin::isBeingAsynchronouslyInitialized): Deleted.
2460         * WebProcess/Plugins/PDF/PDFPlugin.h:
2461         * WebProcess/Plugins/PluginProcessConnection.h:
2462         * WebProcess/Plugins/PluginProxy.h:
2463         (WebKit::PluginProxy::isBeingAsynchronouslyInitialized): Deleted.
2464         * WebProcess/WebCoreSupport/WebContextMenuClient.h:
2465
2466 2015-01-27  Beth Dakin  <bdakin@apple.com>
2467
2468         Immediate action gesture recognizer still doesn't work well with IB
2469         https://bugs.webkit.org/show_bug.cgi?id=140967
2470         -and corresponding-
2471         rdar://problem/19621509
2472
2473         Reviewed by Tim Horton.
2474
2475         We should add (or remove) the gesture recognizer in viewDidMoveToWindow because 
2476         initWithFrame it too early and IB might mess with it.
2477         * UIProcess/API/mac/WKView.mm:
2478         (-[WKView viewDidMoveToWindow]):
2479         (-[WKView initWithFrame:processPool:configuration:webView:]):
2480
2481 2015-01-27  Beth Dakin  <bdakin@apple.com>
2482
2483         Invoking an immediate action on link often dismisses selection
2484         https://bugs.webkit.org/show_bug.cgi?id=140911
2485         -and corresponding-
2486         rdar://problem/19572685
2487
2488         Reviewed by Tim Horton.
2489
2490         Calling _page->setMaintainsInactiveSelection(false) in complete is often 
2491         too soon. Instead, call it in dismissContentRelativeChildWindows. This is more 
2492         similar to the timing for the TextIndicator.
2493         * UIProcess/mac/WKImmediateActionController.mm:
2494         (-[WKImmediateActionController dismissContentRelativeChildWindows]):
2495         (-[WKImmediateActionController immediateActionRecognizerWillPrepare:]):
2496         (-[WKImmediateActionController immediateActionRecognizerDidCompleteAnimation:]):
2497
2498 2015-01-27  Carlos Garcia Campos  <cgarcia@igalia.com>
2499
2500         REGRESSION(r166975): [GTK] Page overlays are not drawn anymore after r166975
2501         https://bugs.webkit.org/show_bug.cgi?id=131433
2502
2503         Reviewed by Žan Doberšek.
2504
2505         Implement page overlays for the GTK+ port.
2506
2507         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
2508         Override pure virtual setViewOverlayRootLayer().
2509         * WebProcess/WebPage/DrawingAreaImpl.cpp:
2510         (WebKit::DrawingAreaImpl::display): Remove FIXME and use modern
2511         for loop.
2512         (WebKit::DrawingAreaImpl::attachViewOverlayGraphicsLayer): Remove
2513         ifdefs and use LayerTreeHost::setViewOverlayRootLayer().
2514         * WebProcess/WebPage/LayerTreeHost.h: Add pure virtual setViewOverlayRootLayer().
2515         * WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp:
2516         (WebKit::LayerTreeHostGtk::LayerTreeHostGtk): Initialize m_viewOverlayRootLayer.
2517         (WebKit::LayerTreeHostGtk::initialize): Remove FIXME.
2518         (WebKit::LayerTreeHostGtk::setNonCompositedContentsNeedDisplay):
2519         Remove unused old page overlays code.
2520         (WebKit::LayerTreeHostGtk::setNonCompositedContentsNeedDisplayInRect): Ditto.
2521         (WebKit::LayerTreeHostGtk::sizeDidChange): Ditto.
2522         (WebKit::LayerTreeHostGtk::paintContents): Remove FIXME.
2523         (WebKit::LayerTreeHostGtk::flushPendingLayerChanges): Flush
2524         compositing state on m_pageOverlayLayers if present.
2525         (WebKit::LayerTreeHostGtk::setViewOverlayRootLayer): Set m_pageOverlayLayers.
2526         (WebKit::LayerTreeHostGtk::createPageOverlayLayer): Deleted.
2527         (WebKit::LayerTreeHostGtk::destroyPageOverlayLayer): Deleted.
2528         * WebProcess/WebPage/gtk/LayerTreeHostGtk.h: Remove unused old
2529         page overlays code.
2530
2531 2015-01-27  Sungmann Cho  <sungmann.cho@navercorp.com>
2532
2533         Remove remaining PLUGIN_ARCHITECTURE(WIN) code blocks from WebKit2.
2534         https://bugs.webkit.org/show_bug.cgi?id=140912
2535
2536         Reviewed by Anders Carlsson.
2537
2538         * Shared/Plugins/Netscape/NetscapePluginModule.cpp:
2539         (WebKit::NetscapePluginModule::tryLoad):
2540         * Shared/Plugins/PluginQuirks.h:
2541         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
2542         (WebKit::NetscapePlugin::userAgent):
2543         * WebProcess/Plugins/Netscape/NetscapePlugin.h:
2544
2545 2015-01-26  Simon Fraser  <simon.fraser@apple.com>
2546
2547         [iOS WK2] Fix possible crash when -[WKWebView evaluateJavaScript:completionHandler:] was called then the WKWebView is destroyed
2548         https://bugs.webkit.org/show_bug.cgi?id=140203
2549         rdar://problem/19198492
2550
2551         Reviewed by Sam Weinig.
2552         
2553         When handling the OwnerWasInvalidated case in -[WKWebView evaluateJavaScript:completionHandler:],
2554         the block passed to dispatch_async() needs to be retained. Fix by passing the RefPtr
2555         to the lambda.
2556
2557         * UIProcess/API/Cocoa/WKWebView.mm:
2558         (-[WKWebView evaluateJavaScript:completionHandler:]):
2559
2560 2015-01-26  Chris Dumez  <cdumez@apple.com>
2561
2562         Rename Document::body() to Document::bodyOrFrameset() for clarity
2563         https://bugs.webkit.org/show_bug.cgi?id=140902
2564
2565         Reviewed by Andreas Kling.
2566
2567         Rename Document::body() to Document::bodyOrFrameset() for clarity. This
2568         method does not necessarily return an HTMLBodyElement, it can also
2569         return a frameset as per the specification:
2570         http://www.w3.org/TR/html5/dom.html#dom-tree-accessors
2571
2572         This method is often misused internally (the caller is only interested
2573         in the <body> element). I will fix these instances in a follow-up patch,
2574         this patch is only renaming mechanically.
2575
2576 2015-01-26  Antti Koivisto  <antti@apple.com>
2577
2578         Add a user default for disabling network cache
2579         https://bugs.webkit.org/show_bug.cgi?id=140904
2580
2581         Reviewed by Andreas Kling
2582
2583         defaults write com.apple.Safari WebKitNetworkCacheEnabled -bool YES/NO
2584
2585         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
2586         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
2587         * Shared/Network/NetworkProcessCreationParameters.cpp:
2588         (WebKit::NetworkProcessCreationParameters::encode):
2589         (WebKit::NetworkProcessCreationParameters::decode):
2590         * Shared/Network/NetworkProcessCreationParameters.h:
2591         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2592         (WebKit::registerUserDefaultsIfNeeded):
2593         (WebKit::WebProcessPool::platformInitializeWebProcess):
2594         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
2595
2596 2015-01-26  Chris Dumez  <cdumez@apple.com>
2597
2598         First argument to DOM traversal functions should be a reference
2599         https://bugs.webkit.org/show_bug.cgi?id=140895
2600
2601         Reviewed by Antti Koivisto.
2602
2603         First argument to DOM traversal functions should be a reference instead
2604         of a pointer as it is dereferenced without null-check.
2605
2606 2015-01-26  Beth Dakin  <bdakin@apple.com>
2607
2608         Blacklist iBooks for WebKit's default immediate actions
2609         https://bugs.webkit.org/show_bug.cgi?id=140854
2610         -and corresponding-
2611         rdar://problem/19489518
2612
2613         Reviewed by Tim Horton.
2614
2615         Blacklist iBooks.
2616         * UIProcess/mac/WKImmediateActionController.mm:
2617         (-[WKImmediateActionController _updateImmediateActionItem]):
2618
2619 2015-01-26  Myles C. Maxfield  <mmaxfield@apple.com>
2620
2621         [iOS] [SVG -> OTF Converter] Flip the switch off on iOS
2622         https://bugs.webkit.org/show_bug.cgi?id=140860
2623
2624         Reviewed by Darin Adler.
2625
2626         The fonts it makes are grotesque. (See what I did there? Typographic
2627         humor is the best humor.)
2628
2629         * Configurations/FeatureDefines.xcconfig:
2630
2631 2015-01-26  Fabien Vallée  <fvallee@connected-labs.com>
2632
2633         AX: crash in accessibilityRootObjectWrapper method (WebPageAccessibilityObjectAtk.cpp)
2634         <https://bugs.webkit.org/show_bug.cgi?id=140618>
2635
2636         Reviewed by Chris Fleizach.
2637
2638         Check if document()->axObjectCache() is nullptr to fix the crash.
2639         Similar patch has been applied on mac port:
2640         <http://trac.webkit.org/changeset/167136>
2641
2642         Crash occured on <http://itv.mit-xperts.com/hbbtvtest/appmanager/>
2643         (this page needs CEHTML / HbbTV extensions, conditions cannot
2644         be reproduced using regression tests)
2645
2646         * WebProcess/WebPage/atk/WebPageAccessibilityObjectAtk.cpp:
2647         (accessibilityRootObjectWrapper):
2648
2649 2015-01-26  Michael Catanzaro  <mcatanzaro@igalia.com>
2650
2651         [GTK] gtkdoc does not appear in DevHelp
2652         https://bugs.webkit.org/show_bug.cgi?id=139369
2653
2654         Reviewed by Philippe Normand.
2655
2656         * PlatformGTK.cmake: Include the API version in the gtkdoc filenames.
2657         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: Renamed from Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-sections.txt.
2658         * UIProcess/API/gtk/docs/webkit2gtk-4.0.types: Renamed from Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk.types.
2659
2660 2015-01-25  Timothy Horton  <timothy_horton@apple.com>
2661
2662         Unresponsive Web processes sometimes throw ObjC exceptions under didPerformActionMenuHitTest:
2663         https://bugs.webkit.org/show_bug.cgi?id=140859
2664         <rdar://problem/19571057>
2665
2666         Reviewed by Darin Adler.
2667
2668         * UIProcess/mac/WKImmediateActionController.mm:
2669         (-[WKImmediateActionController didPerformActionMenuHitTest:userData:]):
2670         If we've already given up on this gesture (either because it was canceled or the
2671         willBeginAnimation timeout expired), we shouldn't build a new animationController for it.
2672         This is true both because it wouldn't look good to swap animationControllers out
2673         from under the gesture, but also because AppKit throws an exception when you do this
2674         and that breaks a lot of things.
2675
2676 2015-01-24  Chris Dumez  <cdumez@apple.com>
2677
2678         [WK2][Cocoa] Drop WKDiagnosticLoggingResultType defines
2679         https://bugs.webkit.org/show_bug.cgi?id=140838
2680
2681         Reviewed by Sam Weinig.
2682
2683         Drop WKDiagnosticLoggingResultType defines in _WKDiagnosticLoggingDelegate.h
2684         header now that the client-side is correctly using
2685         _WKDiagnosticLoggingResultType instead.
2686
2687         * UIProcess/API/Cocoa/_WKDiagnosticLoggingDelegate.h:
2688
2689 2015-01-23  Antti Koivisto  <antti@apple.com>
2690
2691         Implement cache size limit
2692         https://bugs.webkit.org/show_bug.cgi?id=140844
2693
2694         Reviewed by Andreas Kling.
2695
2696         Prevent the cache from growing without bounds. The simple scheme implemented here
2697         estimates the cache size from number of entries. When the estimated size exceeds
2698         the maximum size we randomly clear 1/4 of the entries.
2699
2700         * NetworkProcess/cache/NetworkCacheStorage.h:
2701         * NetworkProcess/cache/NetworkCacheStorageCocoa.mm:
2702         (WebKit::NetworkCacheStorage::NetworkCacheStorage):
2703         (WebKit::NetworkCacheStorage::initialize):
2704         (WebKit::NetworkCacheStorage::removeEntry):
2705         (WebKit::NetworkCacheStorage::store):
2706         (WebKit::NetworkCacheStorage::setMaximumSize):
2707         (WebKit::NetworkCacheStorage::clear):
2708         (WebKit::NetworkCacheStorage::shrinkIfNeeded):
2709         (WebKit::NetworkCacheStorage::initializeKeyFilter): Deleted.
2710
2711 2015-01-23  Timothy Horton  <timothy_horton@apple.com>
2712
2713         Fix the pre-Yosemite build.
2714
2715         * UIProcess/API/mac/WKView.mm:
2716         (-[WKView _dismissContentRelativeChildWindows]):
2717
2718 2015-01-23  Timothy Horton  <timothy_horton@apple.com>
2719
2720         QLPreviewMenuItem popovers don't close when the page scrolls
2721         https://bugs.webkit.org/show_bug.cgi?id=140806
2722         <rdar://problem/19555618>
2723
2724         Reviewed by Beth Dakin.
2725
2726         Now that QLPreviewMenuItem's popover doesn't eat scrolls, we need to dismiss it if the page scrolls.
2727
2728         * UIProcess/API/mac/WKView.mm:
2729         (-[WKView _dismissContentRelativeChildWindows]):
2730         Send _dismissContentRelativeChildWindows on to WKImmediateActionController.
2731
2732         * UIProcess/mac/WKImmediateActionController.h:
2733         * UIProcess/mac/WKImmediateActionController.mm:
2734         (-[WKImmediateActionController _clearImmediateActionState]):
2735         (-[WKImmediateActionController dismissContentRelativeChildWindows]):
2736         (-[WKImmediateActionController _defaultAnimationController]):
2737         Keep track of the active QLPreviewMenuItem, and close it upon scroll.
2738
2739 2015-01-23  Timothy Horton  <timothy_horton@apple.com>
2740
2741         Infinite recursion in _clearImmediateActionState
2742         https://bugs.webkit.org/show_bug.cgi?id=140807
2743         <rdar://problem/19571601>
2744
2745         Reviewed by Anders Carlsson.
2746
2747         * UIProcess/mac/WKImmediateActionController.mm:
2748         (-[WKImmediateActionController _clearImmediateActionState]):
2749         Clear _hasActivatedActionContext before calling didUseActions, because
2750         didUseActions can call _clearImmediateActionState.
2751
2752 2015-01-23  Carlos Garcia Campos  <cgarcia@igalia.com>
2753
2754         [GTK] Add initial database process support
2755         https://bugs.webkit.org/show_bug.cgi?id=139491
2756
2757         Reviewed by Sergio Villar Senin.
2758
2759         Add initial support for DatabaseProcess, disabled by default for
2760         now.
2761
2762         * CMakeLists.txt: Add required files to compilation.
2763         * DatabaseProcess/DatabaseProcess.cpp:
2764         (WebKit::DatabaseProcess::createDatabaseToWebProcessConnection):
2765         Add the unix domain sockets implementation.
2766         * DatabaseProcess/EntryPoint/unix/DatabaseProcessMain.cpp: Added.
2767         (main):
2768         * DatabaseProcess/gtk/DatabaseProcessMainGtk.cpp: Added.
2769         (WebKit::DatabaseProcessMainUnix):
2770         * DatabaseProcess/unix/DatabaseProcessMainUnix.h: Added.
2771         * PlatformGTK.cmake: Add required files to compilation.
2772         * Shared/ProcessExecutablePath.h:
2773         * Shared/gtk/KeyedDecoder.cpp: Added.
2774         (WebKit::KeyedDecoder::KeyedDecoder):
2775         (WebKit::KeyedDecoder::~KeyedDecoder):
2776         (WebKit::KeyedDecoder::buildDictionaryFromGVariant):
2777         (WebKit::KeyedDecoder::decodeBytes):
2778         (WebKit::KeyedDecoder::decodeBool):
2779         (WebKit::KeyedDecoder::decodeUInt32):
2780         (WebKit::KeyedDecoder::decodeInt32):
2781         (WebKit::KeyedDecoder::decodeInt64):
2782         (WebKit::KeyedDecoder::decodeFloat):
2783         (WebKit::KeyedDecoder::decodeDouble):
2784         (WebKit::KeyedDecoder::decodeString):
2785         (WebKit::KeyedDecoder::beginObject):
2786         (WebKit::KeyedDecoder::endObject):
2787         (WebKit::KeyedDecoder::beginArray):
2788         (WebKit::KeyedDecoder::beginArrayElement):
2789         (WebKit::KeyedDecoder::endArrayElement):
2790         (WebKit::KeyedDecoder::endArray):
2791         * Shared/gtk/KeyedDecoder.h: Added.
2792         * Shared/gtk/KeyedEncoder.cpp: Added.
2793         (WebKit::KeyedEncoder::KeyedEncoder):
2794         (WebKit::KeyedEncoder::~KeyedEncoder):
2795         (WebKit::KeyedEncoder::encodeBytes):
2796         (WebKit::KeyedEncoder::encodeBool):
2797         (WebKit::KeyedEncoder::encodeUInt32):
2798         (WebKit::KeyedEncoder::encodeInt32):
2799         (WebKit::KeyedEncoder::encodeInt64):
2800         (WebKit::KeyedEncoder::encodeFloat):
2801         (WebKit::KeyedEncoder::encodeDouble):
2802         (WebKit::KeyedEncoder::encodeString):
2803         (WebKit::KeyedEncoder::beginObject):
2804         (WebKit::KeyedEncoder::endObject):
2805         (WebKit::KeyedEncoder::beginArray):
2806         (WebKit::KeyedEncoder::beginArrayElement):
2807         (WebKit::KeyedEncoder::endArrayElement):
2808         (WebKit::KeyedEncoder::endArray):
2809         (WebKit::KeyedEncoder::finishEncoding):
2810         * Shared/gtk/KeyedEncoder.h: Added.
2811         * Shared/gtk/ProcessExecutablePathGtk.cpp:
2812         (WebKit::executablePathOfDatabaseProcess):
2813         * UIProcess/Databases/DatabaseProcessProxy.cpp:
2814         (WebKit::DatabaseProcessProxy::didCreateDatabaseToWebProcessConnection):
2815         Add the unix domain sockets implementation.
2816         * UIProcess/Launcher/gtk/ProcessLauncherGtk.cpp:
2817         (WebKit::ProcessLauncher::launchProcess): Handle the
2818         DatabaseProcess too.
2819         * UIProcess/gtk/WebContextGtk.cpp:
2820         (WebKit::WebContext::platformDefaultIndexedDBDatabaseDirectory):
2821         * WebProcess/WebProcess.cpp:
2822         (WebKit::WebProcess::ensureWebToDatabaseProcessConnection): Add
2823         the unix domain sockets implementation.
2824
2825 2015-01-22  Benjamin Poulain  <bpoulain@apple.com>
2826
2827         [iOS][WK2] Ignore synthetic click initiated on a previous page
2828         https://bugs.webkit.org/show_bug.cgi?id=139556
2829         rdar://problem/18586008
2830
2831         Reviewed by David Kilzer.
2832
2833         Under the right accumulation of bad luck, a synthetic click could be generated
2834         on a page that never asked for it.
2835
2836         What happened was:
2837         1) Page Foo listen to touch event.
2838         2) In response to touch events, Foo decides to navigate to page Bar
2839            *but* it does not cancel the native gesture recognizers with preventDefault().
2840         3) Page Bar loads.
2841         4) The native gesture recognizer ask us to click, we forward that to the WebProcess
2842            and generate a synthetic mouse event.
2843         -> Bar receives a click.
2844         If you are unlucky enough, it looks like a single tap does a double click.
2845
2846         There are two ways this patch avoids the problem:
2847
2848         First, in the UIProcess, we just cancel the HighlightLongPressGestureRecognizer
2849         on didCommitLoadForMainFrame. This prevents "fast clicks" from accidentally going through.
2850         This is not bullet proof because we get didCommitLoadForMainFrame asynchronously but
2851         killing the timer and gesture seems like a good idea.
2852
2853         Second, we skip any tap command at the WebProcess level when it was issued for
2854         the previous page. This is using the same principle we used for VisibleContentRect:
2855         any input generated before the current layer tree commit is useless for the current page.
2856
2857         We track the commit ID in the UIProcess when we decide to do the tracking or not.
2858         Note that we keep the ID regardless of the tracking state, it does not matter if we have sent
2859         touch events, what matters is what content was on screen when the touch events were handled.
2860
2861         If the user interaction result in a tap, we send the commit ID along the tap commands.
2862         In the WebProcess, we know the actual layer tree commit associated with the current page.
2863         If the tap was generated with a layer ID preceding the current page, we fail the command.
2864
2865         * UIProcess/WebPageProxy.cpp:
2866         (WebKit::WebPageProxy::WebPageProxy):
2867         (WebKit::WebPageProxy::handleTouchEventSynchronously):
2868         (WebKit::WebPageProxy::resetState):
2869         * UIProcess/WebPageProxy.h:
2870         * UIProcess/ios/WKContentView.mm:
2871         (-[WKContentView _didCommitLoadForMainFrame]):
2872         * UIProcess/ios/WKContentViewInteraction.mm:
2873         (-[WKContentView _attemptClickAtLocation:]):
2874         * UIProcess/ios/WebPageProxyIOS.mm:
2875         (WebKit::WebPageProxy::commitPotentialTap):
2876         (WebKit::WebPageProxy::handleTap):
2877         * WebProcess/WebPage/WebPage.cpp:
2878         (WebKit::WebPage::didCommitLoad):
2879         * WebProcess/WebPage/WebPage.h:
2880         * WebProcess/WebPage/WebPage.messages.in:
2881         * WebProcess/WebPage/ios/WebPageIOS.mm:
2882         (WebKit::WebPage::handleTap):
2883         (WebKit::WebPage::commitPotentialTap):
2884
2885 2015-01-22  Chris Dumez  <cdumez@apple.com>
2886
2887         [WK2][Cocoa] Drop WKWebViewConfiguration._featureCounterEnabled SPI.
2888         https://bugs.webkit.org/show_bug.cgi?id=140799
2889
2890         Reviewed by Dan Bernstein.
2891
2892         Drop WKWebViewConfiguration._featureCounterEnabled SPI now that the
2893         client-side has been updated.
2894
2895         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
2896         (-[WKWebViewConfiguration _setAllowsAlternateFullscreen:]):
2897         (-[WKWebViewConfiguration _featureCounterEnabled]): Deleted.
2898         (-[WKWebViewConfiguration _setFeatureCounterEnabled:]): Deleted.
2899         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
2900
2901 2015-01-22  Antti Koivisto  <antti@apple.com>
2902
2903         Fix ENABLE(NETWORK_CACHE) build
2904
2905         * NetworkProcess/NetworkResourceLoader.cpp:
2906         (WebKit::NetworkResourceLoader::didFinishLoading):
2907
2908 2015-01-22  Timothy Horton  <timothy_horton@apple.com>
2909
2910         UserData decoding of WKTypeRefWrapper always fails
2911         https://bugs.webkit.org/show_bug.cgi?id=140791
2912         <rdar://problem/19438402>
2913
2914         Reviewed by Anders Carlsson.
2915
2916         * Shared/mac/ObjCObjectGraph.mm:
2917         (WebKit::ObjCObjectGraph::decode):
2918         Add a missing break.
2919
2920 2015-01-22  Ryosuke Niwa  <rniwa@webkit.org>
2921
2922         Add a build flag for ES6 class syntax
2923         https://bugs.webkit.org/show_bug.cgi?id=140760
2924
2925         Reviewed by Michael Saboff.
2926
2927         * Configurations/FeatureDefines.xcconfig:
2928
2929 2015-01-22  Chris Dumez  <cdumez@apple.com>
2930
2931         Drop the legacy FeatureCounter class
2932         https://bugs.webkit.org/show_bug.cgi?id=140749
2933
2934         Reviewed by Andreas Kling.
2935
2936         Drop the legacy FeatureCounter class and use DiagnosticLoggingClient
2937         instead.
2938
2939         * Shared/WebPreferencesDefinitions.h:
2940         * UIProcess/API/Cocoa/WKWebView.mm:
2941         (-[WKWebView initWithFrame:configuration:]):
2942         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
2943         (-[WKWebViewConfiguration init]):
2944         (-[WKWebViewConfiguration copyWithZone:]):
2945         (-[WKWebViewConfiguration _featureCounterEnabled]):
2946         (-[WKWebViewConfiguration _setFeatureCounterEnabled:]):
2947         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
2948         * WebProcess/WebPage/WebPage.cpp:
2949         (WebKit::WebPage::updatePreferences):
2950         * WebProcess/WebPage/ios/WebPageIOS.mm:
2951         (WebKit::WebPage::willStartUserTriggeredZooming):
2952
2953 2015-01-22  Beth Dakin  <bdakin@apple.com>
2954
2955         ibtoold crash below -[WebView close]
2956         https://bugs.webkit.org/show_bug.cgi?id=140782
2957         -and corresponding-
2958         rdar://problem/19558472
2959
2960         Reviewed by Tim Horton.
2961
2962         Retain the NSImmediateActionGestureRecognizer. This should not be necessary, but 
2963         it is because interface builder can mess with our views.
2964         * UIProcess/mac/WKImmediateActionController.h:
2965         * UIProcess/mac/WKImmediateActionController.mm:
2966         (-[WKImmediateActionController willDestroyView:]):
2967         (-[WKImmediateActionController _cancelImmediateAction]):
2968         (-[WKImmediateActionController _cancelImmediateActionIfNeeded]):
2969         (-[WKImmediateActionController _updateImmediateActionItem]):
2970
2971 2015-01-22  David Kilzer  <ddkilzer@apple.com>
2972
2973         [iOS] Fix iphoneos SDK builds for ios-ews queue
2974         <http://webkit.org/b/140748>
2975
2976         Reviewed by Daniel Bates.
2977
2978         * Platform/spi/ios/BKSProcessAssertionSPI.h: Add -invalidate
2979         definition.  Sort @property to the top of BKSProcessAssertion.
2980
2981 2015-01-22  Shivakumar JM  <shiva.jm@samsung.com>
2982
2983         Fix build warning in WebKit2/UIProcess module
2984         https://bugs.webkit.org/show_bug.cgi?id=140758
2985
2986         Reviewed by Csaba Osztrogonác.
2987
2988         Fix build warnings by using UNUSED_PARAM macro
2989
2990         * UIProcess/API/C/WKPageGroup.cpp:
2991         (WKPageGroupAddUserContentFilter):
2992         (WKPageGroupRemoveAllUserContentFilters):
2993
2994 2014-11-06  Carlos Garcia Campos  <cgarcia@igalia.com>
2995
2996         [GTK] Use API::ContextMenuClient and API::InjectedBundle::PageContextMenuClient classes
2997         https://bugs.webkit.org/show_bug.cgi?id=138467
2998
2999         Reviewed by Gustavo Noronha Silva.
3000
3001         * UIProcess/API/gtk/WebKitContextMenu.cpp:
3002         (webkitContextMenuPopulate): Add a version that receives a Vector<WebContextMenuItemData>&.
3003         (webkitContextMenuCreate): Change it to receive a const
3004         Vector<WebContextMenuItemData>& instead of a API::Array* and also
3005         add a another version that receives const Vector<ContextMenuItem>&.
3006         * UIProcess/API/gtk/WebKitContextMenuClient.cpp:
3007         (attachContextMenuClientToView): Use a class derived from
3008         API::ContextMenuClient to implement the context menu client.
3009         (getContextMenuFromProposedMenu): Deleted.
3010         * UIProcess/API/gtk/WebKitContextMenuItem.cpp:
3011         (webkitContextMenuItemCreate): Change it to receive a const
3012         WebContextMenuItemData& and added another version that receives a
3013         const ContextMenuItem&.
3014         * UIProcess/API/gtk/WebKitContextMenuItemPrivate.h:
3015         * UIProcess/API/gtk/WebKitContextMenuPrivate.h:
3016         * UIProcess/API/gtk/WebKitWebView.cpp:
3017         (webkitWebViewPopulateContextMenu): Remove the creation of a
3018         WebHitTestResult::Data, since it receives it now as parameter.
3019         * UIProcess/API/gtk/WebKitWebViewPrivate.h:
3020         * WebProcess/InjectedBundle/API/gtk/WebKitWebHitTestResult.cpp:
3021         (webkitWebHitTestResultCreate): Change it to receive a const
3022         HitTestResult& instead of const InjectedBundleHitTestResult&.
3023         * WebProcess/InjectedBundle/API/gtk/WebKitWebHitTestResultPrivate.h:
3024         * WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp:
3025         (webkitWebPageCreate): Use a class derived from
3026         API::InjectedBundle::PageContextMenuClient to implement the
3027         context menu client.
3028         (getContextMenuFromDefaultMenu): Deleted.
3029
3030 2015-01-22  Carlos Garcia Campos  <cgarcia@igalia.com>
3031
3032         Unreviewed. Try to fix Debug build after r178889.
3033
3034         * UIProcess/API/C/WKPage.cpp: Include Logging.h.
3035
3036 2015-01-21  Carlos Garcia Campos  <cgarcia@igalia.com>
3037
3038         Add API::ContextMenuClient and API::InjectedBundle::PageContextMenuClient classes
3039         https://bugs.webkit.org/show_bug.cgi?id=138466
3040
3041         Reviewed by Anders Carlsson.
3042
3043         Move ContextMenuClient to use API classes in both UI and Injected
3044         Bundle APIs.
3045
3046         * CMakeLists.txt: Remove WebPageContextMenuClient.cpp.
3047         * UIProcess/API/APIContextMenuClient.h: Renamed from Source/WebKit2/UIProcess/WebPageContextMenuClient.h.
3048         (API::ContextMenuClient::~ContextMenuClient):
3049         (API::ContextMenuClient::getContextMenuFromProposedMenu):
3050         (API::ContextMenuClient::customContextMenuItemSelected):
3051         (API::ContextMenuClient::contextMenuDismissed):
3052         (API::ContextMenuClient::showContextMenu):
3053         (API::ContextMenuClient::hideContextMenu):
3054         * UIProcess/API/C/WKPage.cpp:
3055         (WKPageSetPageContextMenuClient):
3056         * UIProcess/WebPageContextMenuClient.cpp: Removed.
3057         * UIProcess/WebPageProxy.cpp:
3058         (WebKit::WebPageProxy::WebPageProxy):
3059         (WebKit::WebPageProxy::setContextMenuClient):
3060         (WebKit::WebPageProxy::close):
3061         (WebKit::WebPageProxy::internalShowContextMenu):
3062         (WebKit::WebPageProxy::contextMenuItemSelected):
3063         (WebKit::WebPageProxy::initializeContextMenuClient): Deleted.
3064         * UIProcess/WebPageProxy.h:
3065         * WebKit2.xcodeproj/project.pbxproj: Remove deleted files and add
3066         new files to compilation.
3067         * WebProcess/InjectedBundle/API/APIInjectedBundlePageContextMenuClient.h: Copied from Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageContextMenuClient.h.
3068         (API::InjectedBundle::PageContextMenuClient::~PageContextMenuClient):
3069         (API::InjectedBundle::PageContextMenuClient::getCustomMenuFromDefaultItems):
3070         (API::InjectedBundle::PageContextMenuClient::prepareForActionMenu):
3071         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
3072         (WKBundlePageSetContextMenuClient):
3073         * WebProcess/InjectedBundle/InjectedBundlePageContextMenuClient.cpp:
3074         (WebKit::InjectedBundlePageContextMenuClient::InjectedBundlePageContextMenuClient):
3075         (WebKit::InjectedBundlePageContextMenuClient::getCustomMenuFromDefaultItems):
3076         (WebKit::InjectedBundlePageContextMenuClient::prepareForActionMenu):
3077         * WebProcess/InjectedBundle/InjectedBundlePageContextMenuClient.h:
3078         * WebProcess/WebPage/WebContextMenu.cpp:
3079         (WebKit::WebContextMenu::menuItemsWithUserData):
3080         * WebProcess/WebPage/WebPage.cpp:
3081         (WebKit::WebPage::WebPage):
3082         (WebKit::WebPage::setInjectedBundleContextMenuClient):
3083         (WebKit::WebPage::close):
3084         (WebKit::WebPage::initializeInjectedBundleContextMenuClient): Deleted.
3085         * WebProcess/WebPage/WebPage.h:
3086         (WebKit::WebPage::injectedBundleContextMenuClient):
3087         * WebProcess/WebPage/mac/WebPageMac.mm:
3088         (WebKit::WebPage::performActionMenuHitTestAtLocation):
3089
3090 2015-01-20  Jon Honeycutt  <jhoneycutt@apple.com>
3091
3092         [iOS] WebKitTestRunner: Tests fail due to incorrect web view size
3093
3094         <https://bugs.webkit.org/show_bug.cgi?id=139736>
3095         <rdar://problem/19282196>
3096
3097         This starts happening after we fail to reset the test controller to
3098         consistent values in TestInvocation::invoke(). When we terminate the
3099         web process and relaunch it, the new WebPage object created in the web
3100         process is using the default ViewportConfiguration with dimensions of
3101         1024x768.
3102
3103         The PageClient on iOS currently notifies the WKWebView and the
3104         WKContentView when the web process is relaunched. This patch extends
3105         that to also notify the WKView.
3106
3107         Reviewed by Benjamin Poulain.
3108
3109         * UIProcess/API/Cocoa/WKViewPrivate.h:
3110         Declare -_didRelaunchProcess.
3111
3112         * UIProcess/API/ios/WKViewIOS.mm:
3113         (-[WKView _commonInitializationWithContextRef:pageGroupRef:relatedToPage:]):
3114         Call the new method that accepts a WKView.
3115         (-[WKView _didRelaunchProcess]):
3116         Call -_frameOrBoundsChanged to update the web process's size to the
3117         size of the WKView.
3118
3119         * UIProcess/ios/PageClientImplIOS.h:
3120         Add a constructor that takes a WKView, and add a member var to hold it.
3121
3122         * UIProcess/ios/PageClientImplIOS.mm:
3123         (WebKit::PageClientImpl::PageClientImpl):
3124         Implement the constructor that takes a WKView.
3125         (WebKit::PageClientImpl::didRelaunchProcess):
3126         Tell the WKView that the web process relaunched.
3127
3128         * UIProcess/ios/WKContentView.h:
3129         Declare an initializer that takes a WKView.
3130
3131         * UIProcess/ios/WKContentView.mm:
3132         (-[WKContentView _commonInitializationWithProcessPool:configuration:]):
3133         Split out from -[WKContentView initWithFrame:processPool:configuration:webView:].
3134         (-[WKContentView initWithFrame:processPool:configuration:webView:]):
3135         Perform some initialization, including creating the PageClient, and
3136         call the common initializer.
3137         (-[WKContentView initWithFrame:processPool:configuration:wkView:]):
3138         Ditto.
3139
3140 2015-01-21  Sam Weinig  <sam@webkit.org>
3141
3142         Add WKPageGroupRef SPI for user content filters
3143         https://bugs.webkit.org/show_bug.cgi?id=140728
3144
3145         Reviewed by Anders Carlsson.
3146
3147         While Safari is transitioning to WKUserContentController, it is useful
3148         for them to have access to have access to content filters on the page group
3149         where they currently have user content related functionality.
3150
3151         * Shared/WebPageGroupData.cpp:
3152         (WebKit::WebPageGroupData::encode):
3153         (WebKit::WebPageGroupData::decode):
3154         * Shared/WebPageGroupData.h:
3155         * UIProcess/API/C/WKPageGroup.cpp:
3156         (WKPageGroupAddUserContentFilter):
3157         (WKPageGroupRemoveAllUserContentFilters):
3158         * UIProcess/API/C/WKPageGroup.h:
3159         * UIProcess/WebPageGroup.cpp:
3160         (WebKit::WebPageGroup::addUserContentFilter):
3161         (WebKit::WebPageGroup::removeAllUserContentFilters):
3162         * UIProcess/WebPageGroup.h:
3163         * WebProcess/WebPage/WebPageGroupProxy.cpp:
3164         (WebKit::WebPageGroupProxy::WebPageGroupProxy):
3165         (WebKit::WebPageGroupProxy::addUserContentFilter):
3166         (WebKit::WebPageGroupProxy::removeAllUserContentFilters):
3167         * WebProcess/WebPage/WebPageGroupProxy.h:
3168         * WebProcess/WebPage/WebPageGroupProxy.messages.in:
3169
3170 2015-01-21  Beth Dakin  <bdakin@apple.com>
3171
3172         Crash in QuickLook preview delegate method
3173         https://bugs.webkit.org/show_bug.cgi?id=140740
3174         -and corresponding-
3175         rdar://problem/19540806
3176
3177         Reviewed by Tim Horton.
3178
3179         Clear out the delegate.
3180         * UIProcess/mac/WKImmediateActionController.mm:
3181         (-[WKImmediateActionController willDestroyView:]):
3182
3183 2015-01-21  Zan Dobersek  <zdobersek@igalia.com>
3184
3185         AsyncRequestImpl casting in AsyncRequest::completeRequest() is incorrect
3186         https://bugs.webkit.org/show_bug.cgi?id=139724
3187
3188         Reviewed by Darin Adler.
3189
3190         AsyncRequestImpl casting in AsyncRequest::completeRequest() relies on
3191         the parameter pack to properly determine the type of the AsyncRequestImpl
3192         object. The casting result can be incorrect when an argument is passed
3193         by reference while the original object was constructed with a callback
3194         that expects an argument that's passed by value.
3195
3196         To avoid this the AsyncRequestImpl template is now instantiated with
3197         raw types, with callback parameters remaining raw types in case
3198         of being integral (enforcing passing-by-value these arguments when
3199         dispatching), and const references being used otherwise (enforcing
3200         passing-by-reference).
3201
3202         This enables casting AsyncRequest objects to the correct AsyncRequestImpl<>
3203         by running the parameter pack through std::decay.
3204
3205         * DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:
3206         (WebKit::UniqueIDBDatabase::putRecord):
3207         (WebKit::UniqueIDBDatabase::getRecord):
3208         (WebKit::UniqueIDBDatabase::openCursor):
3209         (WebKit::UniqueIDBDatabase::cursorAdvance):
3210         (WebKit::UniqueIDBDatabase::cursorIterate):
3211         (WebKit::UniqueIDBDatabase::count):
3212         (WebKit::UniqueIDBDatabase::deleteRange):
3213         * Shared/AsyncRequest.h:
3214         (WebKit::AsyncRequest::completeRequest):
3215         * WebProcess/Databases/IndexedDB/WebIDBServerConnection.cpp:
3216         (WebKit::WebIDBServerConnection::getOrEstablishIDBDatabaseMetadata):
3217         (WebKit::WebIDBServerConnection::get):
3218
3219 2015-01-21  Chris Dumez  <cdumez@apple.com>
3220
3221         [WK2] Stop using WKDiagnosticLoggingResultType.h C API header in Cocoa API
3222         https://bugs.webkit.org/show_bug.cgi?id=140655
3223
3224         Reviewed by Anders Carlsson.
3225
3226         Stop using WKDiagnosticLoggingResultType.h C API header in Cocoa API.
3227         Instead, introduce a new _WKDiagnosticLoggingResultType enum in
3228         _WKDiagnosticLoggingDelegate.h.
3229
3230         A few defines mapping WKDiagnosticLoggingResultType enum and its values
3231         to the new _WKDiagnosticLoggingResultType are temporarily added until
3232         the client-side is transitioned.
3233
3234         * UIProcess/API/Cocoa/_WKDiagnosticLoggingDelegate.h:
3235         * UIProcess/Cocoa/DiagnosticLoggingClient.mm:
3236         (WebKit::toWKDiagnosticLoggingResultType):
3237         (WebKit::DiagnosticLoggingClient::logDiagnosticMessageWithResult):
3238
3239 2015-01-21  Zan Dobersek  <zdobersek@igalia.com>
3240
3241         [WK2] Use C++ lambdas in ProcessLauncher class
3242         https://bugs.webkit.org/show_bug.cgi?id=138186
3243
3244         Reviewed by Darin Adler.
3245
3246         Replace uses of WTF::bind() in the ProcessLauncher class with C++ lambdas.
3247
3248         * UIProcess/Launcher/efl/ProcessLauncherEfl.cpp:
3249         (WebKit::ProcessLauncher::launchProcess):
3250         * UIProcess/Launcher/gtk/ProcessLauncherGtk.cpp:
3251         (WebKit::ProcessLauncher::launchProcess):
3252         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
3253         (WebKit::connectToService):
3254         (WebKit::tryPreexistingProcess):
3255         (WebKit::createProcess):
3256
3257 2015-01-21  Zan Dobersek  <zdobersek@igalia.com>
3258
3259         Clean up ViewUpdateDispatcher
3260         https://bugs.webkit.org/show_bug.cgi?id=140619
3261
3262         Reviewed by Darin Adler.
3263
3264         * WebProcess/WebPage/ViewUpdateDispatcher.cpp:
3265         (WebKit::ViewUpdateDispatcher::visibleContentRectUpdate):
3266         Replace WTF::bind() with a C++ lambda.
3267         (WebKit::ViewUpdateDispatcher::dispatchVisibleContentRectUpdate):
3268         Use WTF::move() to move the HashMap member into the local variable.
3269
3270 2015-01-21  Csaba Osztrogonác  <ossy@webkit.org>
3271
3272         Remove ENABLE(INSPECTOR) ifdef guards
3273         https://bugs.webkit.org/show_bug.cgi?id=140668
3274
3275         Reviewed by Darin Adler.
3276
3277         * Configurations/FeatureDefines.xcconfig:
3278         * Shared/API/c/WKSharedAPICast.h:
3279         (WebKit::toAPI):
3280         (WebKit::toImpl):
3281         * Shared/WebCoreArgumentCoders.cpp:
3282         (IPC::ArgumentCoder<ResourceRequest>::encode):
3283         (IPC::ArgumentCoder<ResourceRequest>::decode):
3284         * UIProcess/API/C/WKInspector.cpp:
3285         (WKInspectorGetTypeID):
3286         (WKInspectorGetPage):
3287         (WKInspectorIsConnected):
3288         (WKInspectorIsVisible):
3289         (WKInspectorIsFront):
3290         (WKInspectorConnect):
3291         (WKInspectorShow):
3292         (WKInspectorHide):
3293         (WKInspectorClose):
3294         (WKInspectorShowConsole):
3295         (WKInspectorShowResources):
3296         (WKInspectorShowMainResourceForFrame):
3297         (WKInspectorIsAttached):
3298         (WKInspectorAttach):
3299         (WKInspectorDetach):
3300         (WKInspectorIsProfilingPage):
3301         (WKInspectorTogglePageProfiling):
3302         * UIProcess/API/C/WKPage.cpp:
3303         (WKPageGetInspector):
3304         * UIProcess/API/efl/ewk_view.cpp:
3305         (ewk_view_inspector_show):
3306         (ewk_view_inspector_close):
3307         * UIProcess/API/efl/tests/test_ewk2_view.cpp:
3308         (TEST_F):
3309         * UIProcess/PageClient.h:
3310         * UIProcess/WebInspectorProxy.cpp:
3311         * UIProcess/WebInspectorProxy.h:
3312         * UIProcess/WebInspectorProxy.messages.in:
3313         * UIProcess/WebPageProxy.cpp:
3314         (WebKit::WebPageProxy::WebPageProxy):
3315         (WebKit::WebPageProxy::reattachToWebProcess):
3316         (WebKit::WebPageProxy::maybeInitializeSandboxExtensionHandle):
3317         (WebKit::WebPageProxy::resetState):
3318         * UIProcess/WebPageProxy.h:
3319         * UIProcess/WebPageProxy.messages.in:
3320         * UIProcess/WebProcessProxy.cpp:
3321         (WebKit::WebProcessProxy::getLaunchOptions):
3322         * UIProcess/efl/WebInspectorProxyEfl.cpp:
3323         * UIProcess/gtk/WebInspectorProxyGtk.cpp:
3324         * UIProcess/ios/PageClientImplIOS.h:
3325         * UIProcess/ios/PageClientImplIOS.mm:
3326         (WebKit::PageClientImpl::disableInspectorNodeSearch):
3327         * UIProcess/ios/WebInspectorProxyIOS.mm:
3328         * UIProcess/ios/WebPageProxyIOS.mm:
3329         (WebKit::WebPageProxy::disableInspectorNodeSearch):
3330         * UIProcess/mac/WebInspectorProxyMac.mm:
3331         * WebProcess/InjectedBundle/API/c/WKBundleInspector.cpp:
3332         (WKBundleInspectorGetTypeID):
3333         (WKBundleInspectorShow):
3334         (WKBundleInspectorClose):
3335         (WKBundleInspectorEvaluateScriptForTest):
3336         (WKBundleInspectorSetPageProfilingEnabled):
3337         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
3338         (WKBundlePageGetInspector):
3339         * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
3340         * WebProcess/WebCoreSupport/WebInspectorClient.h:
3341         * WebProcess/WebCoreSupport/WebInspectorFrontendClient.h:
3342         * WebProcess/WebPage/WebInspector.cpp:
3343         * WebProcess/WebPage/WebInspector.h:
3344         * WebProcess/WebPage/WebInspector.messages.in:
3345         * WebProcess/WebPage/WebInspectorUI.cpp:
3346         * WebProcess/WebPage/WebInspectorUI.h:
3347         * WebProcess/WebPage/WebInspectorUI.messages.in:
3348         * WebProcess/WebPage/WebPage.cpp:
3349         (WebKit::WebPage::WebPage):
3350         (WebKit::WebPage::~WebPage):
3351         (WebKit::WebPage::close):
3352         (WebKit::WebPage::inspectorUI):
3353         (WebKit::WebPage::didReceiveMessage):
3354         * WebProcess/WebPage/WebPage.h:
3355         * WebProcess/WebPage/efl/WebInspectorEfl.cpp:
3356         * WebProcess/WebPage/efl/WebInspectorUIEfl.cpp:
3357         * WebProcess/WebPage/gtk/WebInspectorGtk.cpp:
3358         * WebProcess/WebPage/gtk/WebInspectorUIGtk.cpp:
3359         * WebProcess/WebPage/ios/WebPageIOS.mm:
3360         (WebKit::WebPage::disableInspectorNodeSearch):
3361         * WebProcess/WebPage/mac/WebInspectorMac.mm:
3362         * WebProcess/WebPage/mac/WebInspectorUIMac.mm:
3363         * config.h:
3364
3365 2015-01-20  Martin Hock  <mhock@apple.com>
3366
3367         [iOS][WK2] Redraw find-in-page indicator on rotation
3368         https://bugs.webkit.org/show_bug.cgi?id=140632
3369         <rdar://problem/18858394>
3370
3371         Reviewed by Tim Horton.
3372
3373         * WebProcess/WebPage/FindController.cpp:
3374         (WebKit::FindController::redraw): Add method to redraw find indicator (only used by iOS).
3375         * WebProcess/WebPage/FindController.h:
3376         * WebProcess/WebPage/WebPage.cpp:
3377         (WebKit::WebPage::mainFrameDidLayout):
3378         * WebProcess/WebPage/ios/FindControllerIOS.mm:
3379         (WebKit::FindController::updateFindIndicator): Redraw should not trigger zoom.
3380
3381 2015-01-20  David Kilzer  <ddkilzer@apple.com>
3382
3383         Switch to comparing PLATFORM_NAME in terms of macosx
3384         <http://webkit.org/b/139516>
3385
3386         Reviewed by Timothy Hatcher.
3387
3388         * WebKit2.xcodeproj/project.pbxproj:
3389         * mac/rewrite-availability-macros.sh: Remove the else block that
3390         checked for an unknown PLATFORM_NAME.
3391
3392 2015-01-19  Simon Fraser  <simon.fraser@apple.com>
3393
3394         Add a way to collect scrolling performance data (viewport tile coverage) with UI-side compositing
3395         https://bugs.webkit.org/show_bug.cgi?id=140474
3396
3397         Reviewed by Tim Horton.
3398         
3399         Add a private method to enable scrolling data collection to WKWebView. When enabled, create
3400         a RemoteLayerTreeScrollingPerformanceData object that collects "blank pixel" data on
3401         every layer tree commit and scroll, and stores them in a vector. A second SPI call
3402         allows retrieval of an NSArray of this data.
3403         
3404         To allow RemoteLayerTreeScrollingPerformanceData to find the correct layer which
3405         contains the main tile grid, we set a layer name on the appropriate layer (even
3406         in release builds).
3407
3408         * UIProcess/API/Cocoa/WKWebView.mm:
3409         (-[WKWebView visibleRectInScreenCoordinates]):
3410         (-[WKWebView _didCommitLayerTree:]):
3411         (-[WKWebView scrollViewDidScroll:]):
3412         (-[WKWebView _setScrollPerformanceDataCollectionEnabled:]):
3413         (-[WKWebView _scrollPerformanceDataCollectionEnabled]):
3414         (-[WKWebView _scrollPerformanceData]):
3415         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3416         * UIProcess/Cocoa/RemoteLayerTreeScrollingPerformanceData.h: Added.
3417         (WebKit::RemoteLayerTreeScrollingPerformanceData::BlankPixelCount::BlankPixelCount):
3418         * UIProcess/Cocoa/RemoteLayerTreeScrollingPerformanceData.mm: Added.
3419         (WebKit::RemoteLayerTreeScrollingPerformanceData::RemoteLayerTreeScrollingPerformanceData):
3420         (WebKit::RemoteLayerTreeScrollingPerformanceData::~RemoteLayerTreeScrollingPerformanceData):
3421         (WebKit::RemoteLayerTreeScrollingPerformanceData::didCommitLayerTree):
3422         (WebKit::RemoteLayerTreeScrollingPerformanceData::didScroll):
3423         (WebKit::RemoteLayerTreeScrollingPerformanceData::BlankPixelCount::canCoalesce):
3424         (WebKit::RemoteLayerTreeScrollingPerformanceData::appendBlankPixelCount):
3425         (WebKit::RemoteLayerTreeScrollingPerformanceData::data):
3426         (WebKit::findTileGridContainerLayer):
3427         (WebKit::RemoteLayerTreeScrollingPerformanceData::blankPixelCount):
3428         * UIProcess/WebPageProxy.cpp:
3429         (WebKit::WebPageProxy::WebPageProxy):
3430         (WebKit::WebPageProxy::setScrollPerformanceDataCollectionEnabled):
3431         * UIProcess/WebPageProxy.h:
3432         (WebKit::WebPageProxy::scrollPerformanceDataCollectionEnabled):
3433         (WebKit::WebPageProxy::scrollingPerformanceData):
3434         * WebKit2.xcodeproj/project.pbxproj:
3435
3436 2015-01-19  Dean Jackson  <dino@apple.com>
3437
3438         Support "plus-darker" in mix-blend mode
3439         https://bugs.webkit.org/show_bug.cgi?id=140646
3440         <rdar://problem/19523370>
3441
3442         Reviewed by Simon Fraser.
3443
3444         Output the appropriate blending type when logging.
3445
3446         * Shared/mac/RemoteLayerTreeTransaction.mm:
3447         (WebKit::RemoteLayerTreeTextStream::operator<<):
3448
3449 2015-01-20  Carlos Garcia Campos  <cgarcia@igalia.com>
3450
3451         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.7.4 release.
3452
3453         * gtk/NEWS: Add release notes for 2.7.4.
3454
3455 2015-01-20  Tomas Popela  <tpopela@redhat.com>
3456
3457         [GTK] Add API to set the web view editable into WebKit2 GTK+ API
3458         https://bugs.webkit.org/show_bug.cgi?id=139443
3459
3460         Reviewed by Carlos Garcia Campos.
3461
3462         Provide a way to set the web view editable, without accessing the DOM
3463         and setting the contenteditable attribute to elements.
3464
3465         * UIProcess/API/gtk/WebKitWebView.cpp:
3466         (webkitWebViewSetProperty):
3467         (webkitWebViewGetProperty):
3468         (webkit_web_view_class_init):
3469         (webkit_web_view_is_editable):
3470         (webkit_web_view_set_editable):
3471         * UIProcess/API/gtk/WebKitWebView.h:
3472         * UIProcess/API/gtk/docs/webkit2gtk-sections.txt:
3473
3474 2015-01-20  Carlos Garcia Campos  <cgarcia@igalia.com>
3475
3476         [GTK] Add an option to create WebKitWebView snapshots with transparent background
3477         https://bugs.webkit.org/show_bug.cgi?id=140617
3478
3479         Reviewed by Gustavo Noronha Silva.
3480
3481         Add WEBKIT_SNAPSHOT_OPTIONS_TRANSPARENT_BACKGROUND flag to not
3482         fill with white the background before rendering the snapshot.
3483
3484         * UIProcess/API/gtk/WebKitWebView.cpp:
3485         (webkit_web_view_get_snapshot): Pass a TransparentBackground
3486         boolean argument to the WEbProcess.
3487         * UIProcess/API/gtk/WebKitWebView.h:
3488         * WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp:
3489         (webkitWebPageDidReceiveMessage): Set the FrameView background as
3490         transparent when TransparentBackground option is True before
3491         rendering the snapshot.
3492
3493 2015-01-19  Carlos Garcia Campos  <cgarcia@igalia.com>
3494
3495         [GTK] Add API to change the WebKitWebView background color
3496         https://bugs.webkit.org/show_bug.cgi?id=140610
3497
3498         Reviewed by Gustavo Noronha Silva.
3499
3500         When a color different than the default one (opaque white) is
3501         used, the SetDrawsBackground message is sent to the WebProcess with
3502         a False value to indicate WebCore to not render backgrounds. The
3503         background color passed is saved in the WebPageProxy and used by
3504         the backing store to fill the background before the actual
3505         contents are rendered in the WebView.
3506
3507         * UIProcess/API/gtk/WebKitWebView.cpp:
3508         (webkit_web_view_set_background_color):
3509         (webkit_web_view_get_background_color):
3510         * UIProcess/API/gtk/WebKitWebView.h:
3511         * UIProcess/API/gtk/docs/webkit2gtk-sections.txt: Add new symbols.
3512         * UIProcess/WebPageProxy.cpp:
3513         (WebKit::WebPageProxy::WebPageProxy): Initialize m_backgroundColor member.
3514         * UIProcess/WebPageProxy.h:
3515         (WebKit::WebPageProxy::backgroundColor): Return m_backgroundColor.
3516         (WebKit::WebPageProxy::setBackgroundColor): Set m_backgroundColor.
3517         * UIProcess/cairo/BackingStoreCairo.cpp:
3518         (WebKit::BackingStore::incorporateUpdate): Fill the damage region
3519         with the WebPageProxy background color when the WebProcess is not
3520         rendering backgrounds. If the background color is not fully opaque
3521         we need to clear the region before filling it with the color.
3522
3523 2015-01-19  Myles C. Maxfield  <mmaxfield@apple.com>
3524
3525         [SVG -> OTF Converter] Flip the switch on
3526         https://bugs.webkit.org/show_bug.cgi?id=140592
3527
3528         Reviewed by Antti Koivisto.
3529
3530         * Configurations/FeatureDefines.xcconfig:
3531
3532 2015-01-19  Mark Rowe  <mrowe@apple.com>
3533
3534         <https://webkit.org/b/140504> REGRESSION (r178452): Visited link coloring only appears to work in the first web process
3535
3536         Roll out r178452 since it broke visited link coloring.
3537
3538         Reviewed by Anders Carlsson.
3539
3540         * UIProcess/VisitedLinkProvider.cpp:
3541         (WebKit::VisitedLinkProvider::~VisitedLinkProvider):
3542         (WebKit::VisitedLinkProvider::addProcess):
3543         (WebKit::VisitedLinkProvider::removeProcess):
3544         (WebKit::VisitedLinkProvider::removeAll):
3545         (WebKit::VisitedLinkProvider::webProcessWillOpenConnection):
3546         (WebKit::VisitedLinkProvider::webProcessDidCloseConnection):
3547         (WebKit::VisitedLinkProvider::pendingVisitedLinksTimerFired):
3548         (WebKit::VisitedLinkProvider::resizeTable):
3549         * UIProcess/VisitedLinkProvider.h:
3550         * UIProcess/WebPageProxy.cpp:
3551         (WebKit::WebPageProxy::WebPageProxy):
3552         (WebKit::WebPageProxy::processDidFinishLaunching):
3553         * UIProcess/WebProcessProxy.cpp:
3554         (WebKit::WebProcessProxy::disconnect):
3555         (WebKit::WebProcessProxy::addVisitedLinkProvider):
3556         (WebKit::WebProcessProxy::didDestroyVisitedLinkProvider):
3557         * UIProcess/WebProcessProxy.h:
3558
3559 2015-01-19  Sam Weinig  <sam@webkit.org>
3560
3561         Sprinkle some CTTE on API::PolicyClient and API::FormClient
3562         https://bugs.webkit.org/show_bug.cgi?id=140656
3563
3564         Reviewed by Tim Horton.
3565
3566         - Use references rather than pointers where possible.
3567         - Store and pass the listeners as Refs.
3568         - Make API::FormClient more like API::PolicyClient by making it the
3569           responsibility of the client implementation to call the default policy.
3570
3571         * UIProcess/API/APIFormClient.h:
3572         (API::FormClient::willSubmitForm):
3573         * UIProcess/API/APIPolicyClient.h:
3574         (API::PolicyClient::decidePolicyForNavigationAction):
3575         (API::PolicyClient::decidePolicyForNewWindowAction):
3576         (API::PolicyClient::decidePolicyForResponse):
3577         (API::PolicyClient::unableToImplementPolicy):
3578         * UIProcess/API/C/WKPage.cpp:
3579         (WKPageSetPagePolicyClient):
3580         * UIProcess/API/Cocoa/WKWebView.mm:
3581         (-[WKWebView _setFormDelegate:]):
3582         * UIProcess/API/gtk/WebKitPolicyClient.cpp:
3583         * UIProcess/Cocoa/NavigationState.h:
3584         * UIProcess/Cocoa/NavigationState.mm:
3585         (WebKit::NavigationState::PolicyClient::decidePolicyForNavigationAction):
3586         (WebKit::NavigationState::PolicyClient::decidePolicyForNewWindowAction):
3587         (WebKit::NavigationState::PolicyClient::decidePolicyForResponse):
3588         * UIProcess/WebFormClient.cpp:
3589         (WebKit::WebFormClient::willSubmitForm):
3590         * UIProcess/WebFormClient.h:
3591         * UIProcess/WebFrameProxy.cpp:
3592         (WebKit::WebFrameProxy::setUpPolicyListenerProxy):
3593         (WebKit::WebFrameProxy::setUpFormSubmissionListenerProxy):
3594         * UIProcess/WebFrameProxy.h:
3595         * UIProcess/WebPageProxy.cpp:
3596         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
3597         (WebKit::WebPageProxy::decidePolicyForNewWindowAction):
3598         (WebKit::WebPageProxy::decidePolicyForResponse):
3599         (WebKit::WebPageProxy::unableToImplementPolicy):
3600         (WebKit::WebPageProxy::willSubmitForm):
3601
3602 2015-01-18  Sam Weinig  <sam@webkit.org>
3603
3604         Merge API::ProcessPoolConfiguration and _WKProcessPoolConfiguration
3605         https://bugs.webkit.org/show_bug.cgi?id=140601
3606
3607         Reviewed by Anders Carlsson.
3608
3609         - Converts _WKProcessPoolConfiguration to be backed via API::ProcessPoolConfiguration.
3610         - Expands API::ProcessPoolConfiguration to add all the parameters necessary to fully
3611           initialize a WebProcessPool. This allows -[WKProcessPool _initWithConfiguration:] to
3612           be a simple pass through initializer, which in turn allows us to consider WebProcessPools
3613           created on the C++ and Objective-C sides as equivalent.
3614         - Makes WebProcessPool own the reference to the API::ProcessPoolConfiguration (rather than
3615           the WKProcessPool wrapper).
3616
3617         * Shared/Cocoa/APIObject.mm:
3618         (API::Object::newObject):
3619         Create the API::ProcessPoolConfigurations using [_WKProcessPoolConfiguration alloc] as its 
3620         storage..
3621
3622         * UIProcess/API/APIProcessPoolConfiguration.cpp:
3623         (API::ProcessPoolConfiguration::create):
3624         (API::ProcessPoolConfiguration::createWithLegacyOptions):
3625         (API::ProcessPoolConfiguration::ProcessPoolConfiguration):
3626         (API::ProcessPoolConfiguration::~ProcessPoolConfiguration):
3627         (API::ProcessPoolConfiguration::copy):
3628         (API::ProcessPoolConfiguration::webProcessPoolConfiguration): Deleted.
3629         * UIProcess/API/APIProcessPoolConfiguration.h:
3630         Add the remaining initialization parameters and add a convenience create function
3631         for configuring legacy WebProcessPools (for use by the C-SPI).
3632
3633         * UIProcess/API/APIWebsiteDataStore.cpp:
3634         (API::WebsiteDataStore::websiteDataDirectoryFileSystemRepresentation):
3635         * UIProcess/API/APIWebsiteDataStore.h:
3636         * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
3637         (API::WebsiteDataStore::websiteDataDirectoryFileSystemRepresentation):
3638         (API::WebsiteDataStore::defaultDataStoreConfiguration):
3639         Expose helper for getting the website data directories for use in the ProcessPoolConfiguration.
3640
3641         * UIProcess/API/C/WKContext.cpp:
3642         (WKContextCreate):
3643         (WKContextCreateWithInjectedBundlePath):
3644         (WKContextCreateWithConfiguration):
3645         Use ProcessPoolConfiguration::createWithLegacyOptions() to keep backwards compatibility.
3646
3647         * UIProcess/API/C/WKContextConfigurationRef.cpp:
3648         (WKContextConfigurationCreate):
3649         Update for ProcessPoolConfiguration::create() returning a Ref. Note, this function
3650         was not changed to call ProcessPoolConfiguration::createWithLegacyOptions() since
3651         it has not been around long enough to warrant it.
3652
3653         * UIProcess/API/Cocoa/WKProcessGroup.mm:
3654         (-[WKProcessGroup initWithInjectedBundleURL:]):
3655         Use ProcessPoolConfiguration::createWithLegacyOptions() to keep backwards compatibility.
3656
3657         * UIProcess/API/Cocoa/WKProcessPool.mm:
3658         (-[WKProcessPool description]):
3659         Change to pull the configuration from the underlying API::Object.
3660
3661         (-[WKProcessPool _configuration]):
3662         Change to pull the configuration from the underlying API::Object and call the new
3663         copy() helper on it.
3664         
3665         (-[WKProcessPool _initWithConfiguration:]):
3666         Convert to be a simple pass through to API::Object::constructInWrapper.
3667
3668         (websiteDataDirectoryURL): Deleted.
3669         Moved to APIWebsiteDataStore.h
3670
3671         * UIProcess/API/Cocoa/WKProcessPoolInternal.h:
3672         Removes the _WKProcessPoolConfiguration member, now that it is stored on the WebProcessPool.
3673         
3674         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
3675         (-[_WKProcessPoolConfiguration init]):
3676         (-[_WKProcessPoolConfiguration dealloc]):
3677         Added to support API::Object bridging.
3678
3679         (-[_WKProcessPoolConfiguration injectedBundleURL]):
3680         (-[_WKProcessPoolConfiguration setInjectedBundleURL:]):
3681         Convert to getting the URL from the underlying object. Moved the exception
3682         that used to be on creation of the WKProcessPool.
3683
3684         (-[_WKProcessPoolConfiguration maximumProcessCount]):
3685         (-[_WKProcessPoolConfiguration setMaximumProcessCount:]):
3686         Convert to getting the count from the underlying object.
3687
3688         (-[_WKProcessPoolConfiguration cachePartitionedURLSchemes]):
3689         Convert to constructing the NSArray on demand from the underlying Vector.
3690
3691         (-[_WKProcessPoolConfiguration setCachePartitionedURLSchemes:]):
3692         Converts the NSArray to a Vector rather than storing the array.
3693
3694         * UIProcess/API/Cocoa/_WKProcessPoolConfigurationInternal.h: Added.
3695         (API::wrapper):
3696         Add boilerplate for API::Object bridging.
3697
3698         * UIProcess/API/gtk/WebKitWebContext.cpp:
3699         (webkitWebContextConstructed):
3700         Update to use API::ProcessPoolConfiguration::createWithLegacyOptions() to keep backwards compatibility.
3701
3702
3703         * UIProcess/WebInspectorProxy.cpp:
3704         (WebKit::WebInspectorProxy::inspectorProcessPool):
3705         Update to call API::ProcessPoolConfiguration::createWithLegacyOptions().
3706
3707         * UIProcess/WebProcessPool.cpp:
3708         (WebKit::WebProcessPool::create):
3709         (WebKit::websiteDataStoreConfiguration):
3710         (WebKit::WebProcessPool::WebProcessPool):
3711         (WebKit::WebProcessPool::applyPlatformSpecificConfigurationDefaults): Deleted.
3712         This functionality was moved to the constructor of the API::ProcessPoolConfiguration.
3713         * UIProcess/WebProcessPool.h:
3714         Changed to take (and store) a API::ProcessPoolConfiguration rather than the WebProcessPoolConfiguration.
3715
3716         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
3717         (WebKit::WebProcessPool::legacyPlatformDefaultWebSQLDatabaseDirectory):
3718         (WebKit::WebProcessPool::legacyPlatformDefaultIndexedDBDatabaseDirectory):
3719         (WebKit::WebProcessPool::legacyPlatformDefaultLocalStorageDirectory):
3720         (WebKit::WebProcessPool::legacyPlatformDefaultMediaKeysStorageDirectory):
3721         (WebKit::WebProcessPool::platformDefaultWebSQLDatabaseDirectory): Deleted.
3722         (WebKit::WebProcessPool::platformDefaultIndexedDBDatabaseDirectory): Deleted.
3723         (WebKit::WebProcessPool::platformDefaultLocalStorageDirectory): Deleted.
3724         (WebKit::WebProcessPool::platformDefaultMediaKeysStorageDirectory): Deleted.
3725         * UIProcess/efl/WebContextEfl.cpp:
3726         (WebKit::WebProcessPool::legacyPlatformDefaultWebSQLDatabaseDirectory):
3727         (WebKit::WebProcessPool::legacyPlatformDefaultIndexedDBDatabaseDirectory):
3728         (WebKit::WebProcessPool::legacyPlatformDefaultLocalStorageDirectory):
3729         (WebKit::WebProcessPool::legacyPlatformDefaultMediaKeysStorageDirectory):
3730         (WebKit::WebProcessPool::platformDefaultWebSQLDatabaseDirectory): Deleted.
3731         (WebKit::WebProcessPool::platformDefaultIndexedDBDatabaseDirectory): Deleted.
3732         (WebKit::WebProcessPool::platformDefaultLocalStorageDirectory): Deleted.
3733         (WebKit::WebProcessPool::platformDefaultMediaKeysStorageDirectory): Deleted.
3734         * UIProcess/gtk/WebProcessPoolGtk.cpp:
3735         (WebKit::WebProcessPool::legacyPlatformDefaultWebSQLDatabaseDirectory):
3736         (WebKit::WebProcessPool::legacyPlatformDefaultIndexedDBDatabaseDirectory):
3737         (WebKit::WebProcessPool::legacyPlatformDefaultLocalStorageDirectory):
3738         (WebKit::WebProcessPool::legacyPlatformDefaultMediaKeysStorageDirectory):
3739         (WebKit::WebProcessPool::platformDefaultWebSQLDatabaseDirectory): Deleted.
3740         (WebKit::WebProcessPool::platformDefaultIndexedDBDatabaseDirectory): Deleted.
3741         (WebKit::WebProcessPool::platformDefaultLocalStorageDirectory): Deleted.
3742         (WebKit::WebProcessPool::platformDefaultMediaKeysStorageDirectory): Deleted.
3743         Renamed to make it clear these were the legacy locations for these directories.
3744
3745         * WebKit2.xcodeproj/project.pbxproj:
3746         Added new files.
3747
3748 2015-01-19  Beth Dakin  <bdakin@apple.com>
3749
3750          Speculative build fix.
3751
3752         * UIProcess/API/mac/WKView.mm:
3753         (-[WKView initWithFrame:processPool:configuration:webView:]):
3754
3755 2015-01-19  Timothy Horton  <timothy_horton@apple.com>
3756
3757         Adjust naming of action menu SPI
3758         https://bugs.webkit.org/show_bug.cgi?id=140644
3759         <rdar://problem/19448129>
3760
3761         Reviewed by Brian Weinstein.
3762
3763         * UIProcess/API/mac/WKView.mm:
3764         (-[WKView initWithFrame:processPool:configuration:webView:]):
3765         * UIProcess/mac/WKActionMenuController.mm:
3766         (-[WKActionMenuController prepareForMenu:withEvent:]):
3767         (-[WKActionMenuController willOpenMenu:withEvent:]):
3768         (-[WKActionMenuController didCloseMenu:withEvent:]):
3769         (-[WKActionMenuController menuNeedsUpdate:]):
3770         (-[WKActionMenuController _updateActionMenuItems]):
3771
3772 2015-01-19  Zan Dobersek  <zdobersek@igalia.com>
3773
3774         [CoordinatedGraphics] Use C++ lambda instead of WTF::bind() in ThreadedCompositor::updateSceneState()
3775         https://bugs.webkit.org/show_bug.cgi?id=140613
3776
3777         Reviewed by Carlos Garcia Campos.
3778
3779         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
3780         (WebKit::ThreadedCompositor::updateSceneState): Replace the use of WTF::bind() with a C++ lambda.
3781
3782 2015-01-19  Commit Queue  <commit-queue@webkit.org>
3783
3784         Unreviewed, rolling out r178653.
3785         https://bugs.webkit.org/show_bug.cgi?id=140634
3786
3787         Broke multiple SVG tests on Mountain Lion (Requested by ap on
3788         #webkit).
3789
3790         Reverted changeset:
3791
3792         "[SVG -> OTF Converter] Flip the switch on"
3793         https://bugs.webkit.org/show_bug.cgi?id=140592
3794         http://trac.webkit.org/changeset/178653
3795
3796 2015-01-19  Dean Jackson  <dino@apple.com>
3797
3798         Add "override" to fix the build with newer clangs.
3799
3800         * UIProcess/Cocoa/WebProcessProxyCocoa.mm:
3801         (WebKit::WebProcessProxy::transformHandlesToObjects):
3802         (WebKit::WebProcessProxy::transformObjectsToHandles):
3803         * UIProcess/WebProcessProxy.cpp:
3804         (WebKit::WebProcessProxy::transformObjectsToHandles):
3805         * UIProcess/ios/WebVideoFullscreenManagerProxy.h:
3806         * WebProcess/cocoa/WebProcessCocoa.mm:
3807         (WebKit::WebProcess::transformHandlesToObjects):
3808         (WebKit::WebProcess::transformObjectsToHandles):
3809
3810 2015-01-19  Myles C. Maxfield  <mmaxfield@apple.com>
3811
3812         [SVG -> OTF Converter] Flip the switch on
3813         https://bugs.webkit.org/show_bug.cgi?id=140592
3814
3815         Reviewed by Antti Koivisto.
3816
3817         * Configurations/FeatureDefines.xcconfig:
3818
3819 2015-01-18  Daniel Bates  <dabates@apple.com>
3820
3821         Attempt to fix the iOS build after <http://trac.webkit.org/changeset/178631>
3822         (https://bugs.webkit.org/show_bug.cgi?id=129441)
3823
3824         * UIProcess/WKInspectorHighlightView.mm:
3825         (-[WKInspectorHighlightView update:]): Substitute HighlightType::Node and
3826         HighlightType::Rects for HighlightTypeNode and HighlightTypeRects, respectively.
3827         * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
3828         (WebKit::WebInspectorClient::highlight): Pass lvalue reference to WebCore::Highlight
3829         instead of pointer in call to InspectorController::getHighlight().
3830
3831 2015-01-18  Sam Weinig  <sam@webkit.org>
3832
3833         Fix style issues and add availability macros missed in r178634
3834         https://bugs.webkit.org/show_bug.cgi?id=140597
3835
3836         Reviewed by Dan Bernstein.
3837
3838         * UIProcess/API/Cocoa/WKUserContentControllerPrivate.h:
3839         Add missing availability macros.
3840
3841         * UIProcess/API/Cocoa/_WKUserContentFilter.h:
3842         * UIProcess/API/Cocoa/_WKUserContentFilter.mm:
3843         (-[_WKUserContentFilter initWithName:serializedRules:]):
3844         (-[_WKUserContentFilter _initWithName:serializedRules:]): Deleted.
3845         Removed unnecessary leading underscore from init method.
3846
3847 2015-01-17  Sam Weinig  <sam@webkit.org>
3848
3849         Add initial experimental user content filtering API
3850         https://bugs.webkit.org/show_bug.cgi?id=140584
3851
3852         Reviewed by Benjamin Poulain.
3853
3854         Moves content filtering from being per-ProcessPool to per-UserContentController.
3855
3856         * Shared/API/APIObject.h:
3857         * Shared/API/c/WKBase.h:
3858         * UIProcess/API/APIUserContentFilter.cpp: Added.
3859         (API::UserContentFilter::UserContentFilter):
3860         (API::UserContentFilter::~UserContentFilter):
3861         * UIProcess/API/APIUserContentFilter.h: Added.
3862         * UIProcess/API/C/WKAPICast.h:
3863         * UIProcess/API/C/WKUserContentFilterRef.cpp: Added.
3864         (WKUserContentFilterGetTypeID):
3865         (WKUserContentFilterCreate):
3866         * UIProcess/API/C/WKUserContentFilterRef.h: Added.
3867         * UIProcess/API/C/WebKit2_C.h:
3868         * UIProcess/API/Cocoa/_WKUserContentFilter.h: Added.
3869         * UIProcess/API/Cocoa/_WKUserContentFilter.mm: Added.
3870         (WKUserContentControllerAddUserContentFilter):
3871         (WKUserContentControllerRemoveAllUserContentFilters):
3872         (-[_WKUserContentFilter _initWithName:ruleList:]):
3873         * UIProcess/API/Cocoa/_WKUserContentFilterInternal.h: Added.
3874         Add a basic UserContentFilter type and expose it via both the Objective-C API (as _WKUserContentFilter)
3875         and via the C SPI (as WKUserContentFilterRef).
3876
3877         * UIProcess/API/C/WKUserContentControllerRef.h:
3878         * UIProcess/API/C/WKUserContentControllerRef.cpp:
3879         Add C-SPI to set and remove WKUserContentFilterRefs.
3880
3881         * UIProcess/API/Cocoa/WKProcessPool.mm:
3882         (-[WKProcessPool _loadContentExtensionWithIdentifier:serializedRules:successCompletionHandler:errorCompletionHandler:]): Deleted.
3883         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
3884         * UIProcess/WebProcessPool.cpp:
3885         (WebKit::WebProcessPool::processDidFinishLaunching):
3886         (WebKit::WebProcessPool::loadContentExtension): Deleted.
3887         * UIProcess/WebProcessPool.h:
3888         * WebProcess/WebProcess.cpp:
3889         (WebKit::WebProcess::loadContentExtension): Deleted.
3890         * WebProcess/WebProcess.h:
3891         * WebProcess/WebProcess.messages.in:
3892         Remove the old SPI for loading content filters that was per-ProcessPool. Content filters now follow
3893         the same pattern as UserScripts and UserStyleSheets as being per-UserContentController.
3894
3895         * UIProcess/API/Cocoa/WKUserContentController.mm:
3896         (-[WKUserContentController _addUserContentFilter:]):
3897         (-[WKUserContentController _removeAllUserContentFilters]):
3898         * UIProcess/API/Cocoa/WKUserContentControllerInternal.h:
3899         * UIProcess/API/Cocoa/WKUserContentControllerPrivate.h: Added.
3900         * UIProcess/UserContent/WebUserContentControllerProxy.cpp:
3901         (WebKit::WebUserContentControllerProxy::WebUserContentControllerProxy):
3902         (WebKit::WebUserContentControllerProxy::addProcess):
3903         (WebKit::WebUserContentControllerProxy::addUserContentFilter):
3904         (WebKit::WebUserContentControllerProxy::removeAllUserContentFilters):
3905         * UIProcess/UserContent/WebUserContentControllerProxy.h:
3906         * WebProcess/UserContent/WebUserContentController.cpp:
3907         (WebKit::WebUserContentController::addUserContentFilters):
3908         (WebKit::WebUserContentController::removeAllUserContentFilters):
3909         * WebProcess/UserContent/WebUserContentController.h:
3910         * WebProcess/UserContent/WebUserContentController.messages.in:
3911         Pipe user content filters over to all the WebProcesses that the UserContentController is
3912         connected to.
3913
3914         * WebKit2.xcodeproj/project.pbxproj:
3915         Add new files.
3916
3917 2015-01-17  Chris Dumez  <cdumez@apple.com>
3918
3919         [WK2][iOS] Add Cocoa delegate for logging diagnostic messages
3920         https://bugs.webkit.org/show_bug.cgi?id=140410
3921
3922         Reviewed by Sam Weinig.
3923
3924         Add Cocoa delegate for logging diagnostic messages.
3925
3926         * UIProcess/API/APIDiagnosticLoggingClient.h: Copied from Source/WebKit2/UIProcess/WebPageDiagnosticLoggingClient.h.
3927         (API::DiagnosticLoggingClient::~DiagnosticLoggingClient):
3928         (API::DiagnosticLoggingClient::logDiagnosticMessage):
3929         (API::DiagnosticLoggingClient::logDiagnosticMessageWithResult):
3930         (API::DiagnosticLoggingClient::logDiagnosticMessageWithValue):
3931         * UIProcess/API/C/WKPage.cpp:
3932         (WKPageSetPageDiagnosticLoggingClient):
3933         * UIProcess/API/Cocoa/WKWebView.mm:
3934         (-[WKWebView initWithFrame:configuration:]):
3935         (-[WKWebView _diagnosticLoggingDelegate]):
3936         (-[WKWebView _setDiagnosticLoggingDelegate:]):
3937         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3938         * UIProcess/API/Cocoa/_WKDiagnosticLoggingDelegate.h: Copied from Source/WebKit2/UIProcess/WebPageDiagnosticLoggingClient.h.
3939         * UIProcess/Cocoa/DiagnosticLoggingClient.h: Copied from Source/WebKit2/UIProcess/WebPageDiagnosticLoggingClient.h.
3940         * UIProcess/Cocoa/DiagnosticLoggingClient.mm: Added.
3941         (WebKit::DiagnosticLoggingClient::DiagnosticLoggingClient):
3942         (WebKit::DiagnosticLoggingClient::delegate):
3943         (WebKit::DiagnosticLoggingClient::setDelegate):
3944         (WebKit::DiagnosticLoggingClient::logDiagnosticMessage):
3945         (WebKit::DiagnosticLoggingClient::logDiagnosticMessageWithResult):
3946         (WebKit::DiagnosticLoggingClient::logDiagnosticMessageWithValue):
3947         * UIProcess/WebPageDiagnosticLoggingClient.cpp:
3948         (WebKit::WebPageDiagnosticLoggingClient::WebPageDiagnosticLoggingClient):
3949         * UIProcess/WebPageDiagnosticLoggingClient.h:
3950         * UIProcess/WebPageProxy.cpp:
3951         (WebKit::WebPageProxy::WebPageProxy):
3952         (WebKit::WebPageProxy::setDiagnosticLoggingClient):
3953         (WebKit::WebPageProxy::close):
3954         (WebKit::WebPageProxy::logDiagnosticMessage):
3955         (WebKit::WebPageProxy::logDiagnosticMessageWithResult):
3956         (WebKit::WebPageProxy::logDiagnosticMessageWithValue):
3957         (WebKit::WebPageProxy::initializeDiagnosticLoggingClient): Deleted.
3958         * UIProcess/WebPageProxy.h:
3959         (WebKit::WebPageProxy::diagnosticLoggingClient):
3960         * WebKit2.xcodeproj/project.pbxproj:
3961
3962 2015-01-17  David Kilzer  <ddkilzer@apple.com>
3963
3964         REGRESSION (r178618): Change to WKWebViewConfiguration broke iOS build
3965         <https://bugs.webkit.org/show_bug.cgi?id=140559>
3966
3967         Blind fix to address the following build failure:
3968
3969             Source/WebKit2/UIProcess/API/Cocoa/WKWebViewConfiguration.mm:79:7: error: interface type cannot be statically allocated
3970                 T m_value;
3971                   ^
3972                   *
3973             Source/WebKit2/UIProcess/API/Cocoa/WKWebViewConfiguration.mm:94:55: note: in instantiation of template class 'LazyInitialized<WKWebViewContentProviderRegistry>' requested here
3974                 LazyInitialized<WKWebViewContentProviderRegistry> _contentProviderRegistry;
3975                                                                   ^
3976             Source/WebKit2/UIProcess/API/Cocoa/WKWebViewConfiguration.mm:53:21: error: assigning to 'WKWebViewContentProviderRegistry *' from incompatible type 'RetainPtr<WKWebViewContentProviderRegistry *>'
3977                         m_value = f();
3978                                 ^ ~~~
3979             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
3980                 return _contentProviderRegistry.get([] { return adoptNS([[WKWebViewContentProviderRegistry alloc] init]); });
3981                                                 ^
3982             Source/WebKit2/UIProcess/API/Cocoa/WKWebViewConfiguration.mm:57:24: error: property 'get' not found on object of type 'WKWebViewContentProviderRegistry *'
3983                     return m_value.get();
3984                                    ^
3985             3 errors generated.
3986
3987         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: Change
3988         _contentProviderRegistry to be a LazyInitialized<RetainPtr<>> to
3989         match other instance variables.
3990
3991 2015-01-16  Sam Weinig  <sam@webkit.org>
3992
3993         Add a basic configuration object for WKView
3994         https://bugs.webkit.org/show_bug.cgi?id=140559
3995
3996         Reviewed by Anders Carlsson.
3997
3998         - Adds WKPageConfigurationRef (backed by API::PageConfiguration). WKWebView configuration
3999           is not yet bridged to this, but that will happen soon. For now, it has a few basic
4000           configuration options.
4001         - Adds WKUserContentControllerRef as C-SPI version of WKUserContentController.
4002         - Adds WKUserScriptRef as C-SPI version of WKUserScript.
4003
4004         * Shared/API/APIObject.h:
4005         * Shared/API/c/WKBase.h:
4006         * Shared/API/c/WKSharedAPICast.h:
4007         (WebKit::toWKUserScriptInjectionTime):
4008         * UIProcess/API/APIPageConfiguration.cpp: Added.
4009         (API::PageConfiguration::PageConfiguration):
4010         (API::PageConfiguration::~PageConfiguration):
4011         (API::PageConfiguration::processPool):
4012         (API::PageConfiguration::setProcessPool):
4013         (API::PageConfiguration::userContentController):
4014         (API::PageConfiguration::setUserContentController):
4015         (API::PageConfiguration::pageGroup):
4016         (API::PageConfiguration::setPageGroup):
4017         (API::PageConfiguration::preferences):
4018         (API::PageConfiguration::setPreferences):
4019         (API::PageConfiguration::relatedPage):
4020         (API::PageConfiguration::setRelatedPage):
4021         (API::PageConfiguration::webPageConfiguration):
4022         * UIProcess/API/APIPageConfiguration.h: Added.
4023         (API::PageConfiguration::create):
4024         * UIProcess/API/APIUserScript.cpp: Added.
4025         (API::generateIdentifier):
4026         (API::UserScript::generateUniqueURL):
4027         * UIProcess/API/APIUserScript.h:
4028         * UIProcess/API/C/WKAPICast.h:
4029         * UIProcess/API/C/WKPageConfigurationRef.cpp: Added.
4030         (WKPageConfigurationGetTypeID):
4031         (WKPageConfigurationCreate):
4032         (WKPageConfigurationGetContext):
4033         (WKPageConfigurationSetContext):
4034         (WKPageConfigurationGetPageGroup):
4035         (WKPageConfigurationSetPageGroup):
4036         (WKPageConfigurationGetUserContentController):
4037         (WKPageConfigurationSetUserContentController):
4038         (WKPageConfigurationGetPreferences):
4039         (WKPageConfigurationSetPreferences):
4040         (WKPageConfigurationGetRelatedPage):
4041         (WKPageConfigurationSetRelatedPage):
4042         * UIProcess/API/C/WKPageConfigurationRef.h: Added.
4043         * UIProcess/API/C/WKUserContentControllerRef.cpp: Added.
4044         (WKUserContentControllerGetTypeID):
4045         (WKUserContentControllerCreate):
4046         (WKUserContentControllerCopyUserScripts):
4047         (WKUserContentControllerAddUserScript):
4048         (WKUserContentControllerRemoveAllUserScripts):
4049         * UIProcess/API/C/WKUserContentControllerRef.h: Added.
4050         * UIProcess/API/C/WKUserScriptRef.cpp: Added.
4051         (WKUserScriptGetTypeID):
4052         (WKUserScriptCreateWithSource):
4053         (WKUserScriptCopySource):
4054         (WKUserScriptGetInjectionTime):
4055         (WKUserScriptGetMainFrameOnly):
4056         * UIProcess/API/C/WKUserScriptRef.h: Added.
4057         * UIProcess/API/C/WebKit2_C.h:
4058         * UIProcess/API/Cocoa/WKUserScript.mm:
4059         (-[WKUserScript initWithSource:injectionTime:forMainFrameOnly:]):
4060         (generateIdentifier): Deleted.
4061         * UIProcess/API/Cocoa/WKViewPrivate.h:
4062         * UIProcess/A