915ed8695558c21ef35ada0b83d5ec0ade0d5a11
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2015-05-14  Anders Carlsson  <andersca@apple.com>
2
3         Local storage origins should include origins with transient local storage
4         https://bugs.webkit.org/show_bug.cgi?id=145017
5         rdar://problem/10690447
6
7         Reviewed by Sam Weinig.
8
9         The transient local storage namespaces are used for third party data blocking and will stay
10         around until the UI process exits so we need to be able to include website data from transient storage
11         in the website data store APIs.
12
13         * UIProcess/Storage/StorageManager.cpp:
14         (WebKit::StorageManager::TransientLocalStorageNamespace::origins):
15         (WebKit::StorageManager::getLocalStorageOrigins):
16         * UIProcess/Storage/StorageManager.h:
17         * UIProcess/WebKeyValueStorageManager.cpp:
18         (WebKit::WebKeyValueStorageManager::getKeyValueStorageOrigins):
19         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
20         (WebKit::WebsiteDataStore::fetchData):
21
22 2015-05-14  Beth Dakin  <bdakin@apple.com>
23
24         Change range of possible forces for mouseforcechanged DOM event
25         https://bugs.webkit.org/show_bug.cgi?id=144987
26         -and corresponding-
27         rdar://problem/20472802
28
29         Reviewed by Tim Horton.
30
31         Change to a 0-3 range.
32         * Shared/mac/WebEventFactory.mm:
33         (WebKit::WebEventFactory::createWebMouseEvent):
34
35 2015-05-14  Zan Dobersek  <zdobersek@igalia.com>
36
37         [GTK] Add missing ENABLE(NETSCAPE_PLUGIN_API) build guards
38         https://bugs.webkit.org/show_bug.cgi?id=144994
39
40         Reviewed by Carlos Garcia Campos.
41
42         This fixes the build when configured with Netscape plugin API
43         support disabled.
44
45         * UIProcess/API/gtk/WebKitWebContext.cpp:
46         (webkit_web_context_set_additional_plugins_directory):
47         (webkitWebContextGetPluginThread):
48         * UIProcess/Launcher/gtk/ProcessLauncherGtk.cpp:
49         (WebKit::ProcessLauncher::launchProcess):
50
51 2015-05-13  Carlos Garcia Campos  <cgarcia@igalia.com>
52
53         [SOUP] Network Cache: NetworkProcess segfault when file system doesn't support xattrs
54         https://bugs.webkit.org/show_bug.cgi?id=144953
55
56         Reviewed by Martin Robinson.
57
58         Return early if we fail to get the birthtime xattr.
59
60         * NetworkProcess/cache/NetworkCacheFileSystemPosix.h:
61         (WebKit::NetworkCache::fileTimes):
62
63 2015-05-13  Daniel Bates  <dabates@apple.com>
64
65         Rename ProcessThrottlerClient::{send, cancel}ProcessWillSuspend() to {send, cancel}PrepareToSuspend()
66         https://bugs.webkit.org/show_bug.cgi?id=144619
67         <rdar://problem/20812779>
68
69         Reviewed by Andy Estes.
70
71         The names of the functions ProcessThrottlerClient::{send, cancel}ProcessWillSuspend() are misnomers. These
72         functions are called when the ProcessThrottler wants to prepare the process that it manages for suspension
73         and changes its mind, respectively. That is, these functions do not actually correspond to the OS decision
74         to suspend a process or cancel the suspension of a process, respectively. So, rename these functions and
75         associated {Network, Web}ProcessProxy message names to better describe their purpose.
76
77         * NetworkProcess/NetworkProcess.cpp:
78         (WebKit::NetworkProcess::prepareToSuspend):
79         (WebKit::NetworkProcess::cancelPrepareToSuspend):
80         (WebKit::NetworkProcess::processWillSuspend): Deleted.
81         (WebKit::NetworkProcess::cancelProcessWillSuspend): Deleted.
82         * NetworkProcess/NetworkProcess.h:
83         * NetworkProcess/NetworkProcess.messages.in:
84         * UIProcess/Network/NetworkProcessProxy.cpp:
85         (WebKit::NetworkProcessProxy::sendPrepareToSuspend):
86         (WebKit::NetworkProcessProxy::sendCancelPrepareToSuspend):
87         (WebKit::NetworkProcessProxy::sendProcessWillSuspend): Deleted.
88         (WebKit::NetworkProcessProxy::sendCancelProcessWillSuspend): Deleted.
89         * UIProcess/Network/NetworkProcessProxy.h:
90         * UIProcess/ProcessThrottler.cpp:
91         (WebKit::ProcessThrottler::updateAssertion):
92         * UIProcess/ProcessThrottlerClient.h:
93         * UIProcess/WebProcessProxy.cpp:
94         (WebKit::WebProcess::actualPrepareToSuspend): Formerly named prepareToSuspend.
95         (WebKit::WebProcessProxy::sendPrepareToSuspend):
96         (WebKit::WebProcessProxy::sendCancelPrepareToSuspend):
97         (WebKit::WebProcessProxy::sendProcessWillSuspend): Deleted.
98         (WebKit::WebProcessProxy::sendCancelProcessWillSuspend): Deleted.
99         * UIProcess/WebProcessProxy.h:
100         * WebProcess/WebProcess.cpp:
101         (WebKit::WebProcess::prepareToSuspend):
102         (WebKit::WebProcess::cancelPrepareToSuspend):
103         (WebKit::WebProcess::processWillSuspend): Deleted.
104         (WebKit::WebProcess::cancelProcessWillSuspend): Deleted.
105         * WebProcess/WebProcess.h:
106         * WebProcess/WebProcess.messages.in:
107
108 2015-05-13  Anders Carlsson  <andersca@apple.com>
109
110         Don't create a per-pool data store when using the modern API
111         https://bugs.webkit.org/show_bug.cgi?id=144963
112         rdar://problem/20331756
113
114         Reviewed by Tim Horton.
115
116         * UIProcess/API/APIProcessPoolConfiguration.cpp:
117         (API::ProcessPoolConfiguration::createWithLegacyOptions):
118         (API::ProcessPoolConfiguration::copy):
119         * UIProcess/API/APIProcessPoolConfiguration.h:
120         Keep track of whether the process pool should have a data store.
121
122         * UIProcess/API/C/WKContext.cpp:
123         (WKContextGetWebsiteDataStore):
124         * UIProcess/WebKeyValueStorageManager.cpp:
125         (WebKit::WebKeyValueStorageManager::getKeyValueStorageOrigins):
126         (WebKit::WebKeyValueStorageManager::getStorageDetailsByOrigin):
127         (WebKit::WebKeyValueStorageManager::deleteEntriesForOrigin):
128         (WebKit::WebKeyValueStorageManager::deleteAllEntries):
129         Update now that WebProcessPool::dataStore() no longer returns a reference.
130
131         * UIProcess/WebProcessPool.cpp:
132         (WebKit::WebProcessPool::WebProcessPool):
133         Only create a data store if the configuration states that we should.
134
135         * UIProcess/WebProcessPool.h:
136         Change dataStore() to return a pointer instead of a reference.
137
138 2015-05-13  Alexey Proskuryakov  <ap@apple.com>
139
140         [Mac] Sandbox violation reading SubmitDiagInfo.domains
141         https://bugs.webkit.org/show_bug.cgi?id=144962
142         rdar://problem/20719330
143
144         Reviewed by Darin Adler.
145
146         * WebProcess/com.apple.WebProcess.sb.in:
147
148 2015-05-13  Beth Dakin  <bdakin@apple.com>
149
150         Speculative build fix.
151
152         * UIProcess/API/Cocoa/_WKOverlayScrollbarStyle.h:
153
154 2015-05-13  Michael Catanzaro  <mcatanzaro@igalia.com>
155
156         [GTK][CMake] Extra include directory when libnotify is present but disabled
157         https://bugs.webkit.org/show_bug.cgi?id=144941
158
159         Reviewed by Martin Robinson.
160
161         Add LIBNOTIFY_INCLUDE_DIRS to WebKit2_INCLUDE_DIRECTORIES only if USE_LIBNOTIFY is true,
162         rather than checking LIBNOTIFY_FOUND.
163
164         * PlatformGTK.cmake:
165
166 2015-05-13  Beth Dakin  <bdakin@apple.com>
167
168         Need SPI to set the overlay scroll bar style
169         https://bugs.webkit.org/show_bug.cgi?id=144928
170         -and corresponding-
171         rdar://problem/20143614
172
173         Reviewed by Anders Carlsson.
174
175         Make scrollbarOverlayStyle a part of the creation parameters. 
176         * Shared/WebPageCreationParameters.cpp:
177         (WebKit::WebPageCreationParameters::encode):
178         (WebKit::WebPageCreationParameters::decode):
179         * Shared/WebPageCreationParameters.h:
180
181         New SPI.
182         * UIProcess/API/Cocoa/WKViewPrivate.h:
183         * UIProcess/API/Cocoa/_WKOverlayScrollbarStyle.h: Added.
184         * UIProcess/API/mac/WKView.mm:
185         (-[WKView _setOverlayScrollbarStyle:]):
186         (-[WKView _overlayScrollbarStyle]):
187
188         Store m_scrollbarOverlayStyle on WebPageProxy, and set it to the WebProcess.
189         * UIProcess/WebPageProxy.cpp:
190         (WebKit::WebPageProxy::WebPageProxy):
191         (WebKit::WebPageProxy::creationParameters):
192         (WebKit::WebPageProxy::setOverlayScrollbarStyle):
193         * UIProcess/WebPageProxy.h:
194         (WebKit::WebPageProxy::overlayScrollbarStyle):
195         * WebKit2.xcodeproj/project.pbxproj:
196
197         Return WebPage’s scrollbarOverlayStyle().
198         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
199         (WebKit::WebChromeClient::preferredScrollbarOverlayStyle):
200         * WebProcess/WebCoreSupport/WebChromeClient.h:
201
202         Cache the scrollbarOverlayStyle() here for the WebProcess. 
203         * WebProcess/WebPage/WebPage.cpp:
204         (WebKit::WebPage::WebPage):
205         (WebKit::WebPage::setScrollbarOverlayStyle):
206         * WebProcess/WebPage/WebPage.h:
207         (WebKit::WebPage::scrollbarOverlayStyle):
208         * WebProcess/WebPage/WebPage.messages.in:
209
210 2015-05-13  Anders Carlsson  <andersca@apple.com>
211
212         Rename some StorageManager functions to indicate that they work on local storage entries
213         https://bugs.webkit.org/show_bug.cgi?id=144958
214         First part of rdar://problem/10690447.
215
216         Reviewed by Beth Dakin.
217
218         * UIProcess/Storage/StorageManager.cpp:
219         (WebKit::StorageManager::getLocalStorageOrigins):
220         (WebKit::StorageManager::getLocalStorageDetailsByOrigin):
221         (WebKit::StorageManager::deleteLocalStorageEntriesForOrigin):
222         (WebKit::StorageManager::deleteAllLocalStorageEntries):
223         (WebKit::StorageManager::deleteLocalStorageEntriesForOrigins):
224         (WebKit::StorageManager::getOrigins): Deleted.
225         (WebKit::StorageManager::getStorageDetailsByOrigin): Deleted.
226         (WebKit::StorageManager::deleteEntriesForOrigin): Deleted.
227         (WebKit::StorageManager::deleteAllEntries): Deleted.
228         (WebKit::StorageManager::deleteEntriesForOrigins): Deleted.
229         * UIProcess/Storage/StorageManager.h:
230         * UIProcess/WebKeyValueStorageManager.cpp:
231         (WebKit::WebKeyValueStorageManager::getKeyValueStorageOrigins):
232         (WebKit::WebKeyValueStorageManager::getStorageDetailsByOrigin):
233         (WebKit::WebKeyValueStorageManager::deleteEntriesForOrigin):
234         (WebKit::WebKeyValueStorageManager::deleteAllEntries):
235         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
236         (WebKit::WebsiteDataStore::fetchData):
237         (WebKit::WebsiteDataStore::removeData):
238
239 2015-05-13  Joseph Pecoraro  <pecoraro@apple.com>
240
241         Crash under WebKit::WebInspectorProxy::attachAvailabilityChanged sometimes opening new page
242         https://bugs.webkit.org/show_bug.cgi?id=144957
243
244         Reviewed by Simon Fraser.
245
246         * UIProcess/WebInspectorProxy.cpp:
247         (WebKit::WebInspectorProxy::attachAvailabilityChanged):
248
249 2015-05-13  Joseph Pecoraro  <pecoraro@apple.com>
250
251         Pass String as reference in more places
252         https://bugs.webkit.org/show_bug.cgi?id=144769
253
254         Reviewed by Daniel Bates.
255
256         * WebProcess/WebPage/WebInspectorUI.cpp:
257         (WebKit::WebInspectorUI::showMainResourceForFrame):
258         * WebProcess/WebPage/WebInspectorUI.h:
259
260 2015-05-13  Timothy Horton  <timothy_horton@apple.com>
261
262         View scale changes are temporarily lost after restoring a page from the page cache
263         https://bugs.webkit.org/show_bug.cgi?id=144934
264
265         Reviewed by Brady Eidson.
266
267         * WebProcess/WebPage/WebPage.cpp:
268         (WebKit::WebPage::WebPage):
269         (WebKit::WebPage::scalePage):
270         (WebKit::WebPage::scalePageInViewCoordinates):
271         (WebKit::WebPage::pageScaleFactor):
272         (WebKit::WebPage::viewScaleFactor):
273         (WebKit::WebPage::scaleView):
274         * WebProcess/WebPage/WebPage.h:
275         (WebKit::WebPage::viewScaleFactor): Deleted.
276         Get rid of m_viewScaleFactor, instead using Page::viewScaleFactor.
277
278 2015-05-13  Sungmann Cho  <sungmann.cho@navercorp.com>
279
280         Minor cleanups to PluginProxy.cpp.
281         https://bugs.webkit.org/show_bug.cgi?id=144948
282
283         Reviewed by Gyuyoung Kim.
284
285         1. Remove unnecessary #include.
286         2. Remove unnecessary return statement from PluginProxy::paint().
287
288         No new tests, no behavior change.
289
290         * WebProcess/Plugins/PluginProxy.cpp:
291         (WebKit::PluginProxy::paint):
292
293 2015-05-13  Daegyu Lee  <daegyu.lee@navercorp.com>
294
295         REGRESSION(r176631): [EFL] Fullscreen feature doesn't work correctly on MiniBrowser
296         https://bugs.webkit.org/show_bug.cgi?id=144906
297
298         Reviewed by Gyuyoung Kim.
299
300         * UIProcess/CoordinatedGraphics/PageViewportController.cpp:
301         (WebKit::PageViewportController::updateMinimumScaleToFit): Recover the r176631 condition to
302         call applyScaleAfterRenderingContents function to apply correct scale.
303
304 2015-05-12  Dan Bernstein  <mitz@apple.com>
305
306         In Safari, Debug > Get Bytecode Profile crashes the Web Content process
307         https://bugs.webkit.org/show_bug.cgi?id=144944
308
309         Reviewed by Darin Adler.
310
311         * WebProcess/WebPage/WebPage.cpp:
312         (WebKit::WebPage::getBytecodeProfile): Don’t assert that m_perBytecodeProfiler isn’t null,
313         because it is when the profiler is disabled, which is the default. In that case, return
314         after sending back the empty string, rather than continuing to dereference a null pointer.
315
316 2015-05-12  Jon Honeycutt  <jhoneycutt@apple.com>
317
318         Crash when using <input type=file>
319
320         <https://bugs.webkit.org/show_bug.cgi?id=144939>
321         <rdar://problem/20172315>
322
323         Reviewed by Andy Estes.
324
325         * UIProcess/ios/forms/WKFileUploadPanel.mm:
326         Use a RefPtr to hold the WebOpenPanelResultListenerProxy, because the
327         WKFileUploadPanel can outlive it.
328
329 2015-05-12  Simon Fraser  <simon.fraser@apple.com>
330
331         Turn antialiased font dilation off by default
332         https://bugs.webkit.org/show_bug.cgi?id=144940
333         rdar://problem/20923031
334
335         Reviewed by Sam Weinig.
336
337         Turn antialised font dilation off by default.
338
339         * Shared/WebPreferencesDefinitions.h:
340         * UIProcess/API/C/WKPreferencesRefPrivate.h:
341
342 2015-05-12  Daniel Bates  <dabates@apple.com>
343
344         Make {Network, Web}ProcessProxy inherit from ProcessThrottleClient privately
345         https://bugs.webkit.org/show_bug.cgi?id=144886
346
347         Reviewed by Darin Adler.
348
349         {Network, Web}ProcessProxy are implemented in terms of ProcessThrottleClient, an
350         interface that defines the callbacks that ProcessThrottler makes to a client. We
351         do not want to allow arbitrary callers to make use of the interface ProcessThrottleClient.
352         So, we should use private inheritance to represent the relationship between
353         {Network, Web}ProcessProxy and ProcessThrottleClient instead of public inheritance.
354
355         Additionally make ProcessThrottler a instance variable of {Network, Web}ProcessProxy instead
356         of holding a smart pointer to a ProcessThrottler instance because we always want to
357         have a ProcessThrottler for each instance of {Network, Web}ProcessProxy.
358
359         * UIProcess/Network/NetworkProcessProxy.cpp:
360         (WebKit::NetworkProcessProxy::NetworkProcessProxy): Update code to work now that m_throttler
361         is an instance of ProcessThrottler instead of a smart pointer to a ProcessThrottler instance.
362         (WebKit::NetworkProcessProxy::didFinishLaunching): Update code to access functions of
363         m_throttler by reference instead of by pointer.
364         (WebKit::NetworkProcessProxy::didCancelProcessSuspension): Ditto.
365         (WebKit::NetworkProcessProxy::processReadyToSuspend): Ditto.
366         (WebKit::NetworkProcessProxy::setIsHoldingLockedFiles): Ditto.
367         * UIProcess/Network/NetworkProcessProxy.h: Inherit from ProcessThrottleClient privately.
368         (WebKit::NetworkProcessProxy::throttler): Update code to work now that m_throttler is an
369         instance of ProcessThrottler instead of a smart pointer to a ProcessThrottler instance.
370         * UIProcess/ProcessThrottler.cpp:
371         (WebKit::ProcessThrottler::ProcessThrottler): Update code to work now that m_process is
372         a lvalue reference instead of a pointer.
373         (WebKit::ProcessThrottler::updateAssertion): Ditto.
374         (WebKit::ProcessThrottler::assertionWillExpireImminently): Ditto.
375         * UIProcess/ProcessThrottler.h: Ditto.
376         * UIProcess/WebProcessProxy.cpp:
377         (WebKit::WebProcessProxy::WebProcessProxy): Update code to work now that m_throttler is an
378         instance of ProcessThrottler instead of a smart pointer to a ProcessThrottler instance. 
379         (WebKit::WebProcessProxy::didFinishLaunching): Update code to access functions of
380         m_throttler by reference instead of by pointer.
381         (WebKit::WebProcessProxy::processReadyToSuspend): Ditto.
382         (WebKit::WebProcessProxy::didCancelProcessSuspension): Ditto.
383         (WebKit::WebProcessProxy::setIsHoldingLockedFiles): Ditto.
384         * UIProcess/WebProcessProxy.h: Inherit from ProcessThrottleClient privately.
385         (WebKit::WebProcessProxy::throttler): Update code to work now that m_throttler is an
386         instance of ProcessThrottler instead of a smart pointer to a ProcessThrottler instance.
387
388 2015-05-12  Anders Carlsson  <andersca@apple.com>
389
390         Production builds should link against the shims directly
391         https://bugs.webkit.org/show_bug.cgi?id=144922
392         rdar://problem/19708579
393
394         Reviewed by Dan Bernstein.
395
396         * Configurations/NetworkService.xcconfig:
397         Point to an Info.plist that has DYLD_INSERT_LIBRARIES set on 10.10 and earlier.
398         Link directly against SecItemShim.dylib where possible.
399
400         * Configurations/PluginProcessShim.xcconfig:
401         Set the install name and install path.
402
403         * Configurations/PluginService.32.xcconfig:
404         Point to an Info.plist that has DYLD_INSERT_LIBRARIES set on 10.10 and earlier.
405         Link directly against PluginProcessShim.dylib where possible.
406
407         * Configurations/PluginService.64.xcconfig:
408         Point to an Info.plist that has DYLD_INSERT_LIBRARIES set on 10.10 and earlier.
409         Link directly against PluginProcessShim.dylib where possible.
410
411         * Configurations/SecItemShim.xcconfig:
412         Set the install name and install path.
413
414         * Configurations/WebContentService.xcconfig:
415         Point to an Info.plist that has DYLD_INSERT_LIBRARIES set on 10.10 and earlier.
416         Link directly against WebProcessShim.dylib where possible.
417
418         * Configurations/WebProcessShim.xcconfig:
419         Set the install name and install path.
420
421         * NetworkProcess/EntryPoint/mac/XPCService/NetworkService/Info-OSX-10.9-10.10.plist: Copied from Source/WebKit2/NetworkProcess/EntryPoint/mac/XPCService/NetworkService/Info-OSX.plist.
422         * NetworkProcess/EntryPoint/mac/XPCService/NetworkService/Info-OSX.plist:
423         Add an Info.plist for 10.9 and 10.10 and remove DYLD_INSERT_LIBRARIES from the non-legacy plist.
424
425         * PluginProcess/EntryPoint/mac/XPCService/PluginService.32-64-10.9-10.10.Info.plist: Copied from Source/WebKit2/PluginProcess/EntryPoint/mac/XPCService/PluginService.32-64.Info.plist.
426         * PluginProcess/EntryPoint/mac/XPCService/PluginService.32-64.Info.plist:
427         Add an Info.plist for 10.9 and 10.10 and remove DYLD_INSERT_LIBRARIES from the non-legacy plist.
428
429         * WebKit2.xcodeproj/project.pbxproj:
430         Add new files.
431
432         * WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-OSX-10.9-10.10.plist: Copied from Source/WebKit2/WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-OSX.plist.
433         * WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-OSX.plist:
434         Add an Info.plist for 10.9 and 10.10 and remove DYLD_INSERT_LIBRARIES from the non-legacy plist.
435
436 2015-05-12  Alexey Proskuryakov  <ap@apple.com>
437
438         Undo a mistaken part of r184211.
439
440         * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::cookieStorageDirectory):
441         * UIProcess/WebProcessPool.h:
442         cookieStorageDirectory() is used on iOS, so bring it back.
443
444 2015-05-08  Alexey Proskuryakov  <ap@apple.com>
445
446         [Mac] Share cookie storage between UI process and secondary processes
447         https://bugs.webkit.org/show_bug.cgi?id=144820
448         rdar://problem/20572830
449
450         Reviewed by Darin Adler.
451
452         Pass a cookie storage descriptor that includes file path as well as other data that
453         CFNetwork needs to use the same cookies storage as in another process (session cookies
454         are still separate).
455
456         While at it, started to clean up code that passes cookie storage path. It was mostly
457         dead and unimplemented, only used in child processes when USE(SECCOMP_FILTERS) was enabled.
458
459         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
460         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
461         * Shared/Network/NetworkProcessCreationParameters.cpp:
462         (WebKit::NetworkProcessCreationParameters::encode):
463         (WebKit::NetworkProcessCreationParameters::decode):
464         * Shared/Network/NetworkProcessCreationParameters.h:
465         * Shared/WebProcessCreationParameters.cpp:
466         (WebKit::WebProcessCreationParameters::encode):
467         (WebKit::WebProcessCreationParameters::decode):
468         * Shared/WebProcessCreationParameters.h:
469         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
470         (WebKit::WebProcessPool::platformInitializeWebProcess):
471         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
472         (WebKit::WebProcessPool::platformDefaultCookieStorageDirectory): Deleted.
473         * UIProcess/WebProcessPool.cpp:
474         (WebKit::WebProcessPool::ensureNetworkProcess):
475         (WebKit::WebProcessPool::createNewWebProcess):
476         (WebKit::WebProcessPool::cookieStorageDirectory):
477         * UIProcess/WebProcessPool.h:
478         * UIProcess/efl/WebProcessPoolEfl.cpp:
479         (WebKit::WebProcessPool::platformDefaultCookieStorageDirectory): Deleted.
480         * UIProcess/gtk/WebProcessPoolGtk.cpp:
481         (WebKit::WebProcessPool::platformDefaultCookieStorageDirectory): Deleted.
482         * WebProcess/cocoa/WebProcessCocoa.mm:
483         (WebKit::WebProcess::platformInitializeWebProcess):
484
485 2015-05-12  Chris Dumez  <cdumez@apple.com>
486
487         [WK2] Log using diagnostic logging how far back in history we navigate
488         https://bugs.webkit.org/show_bug.cgi?id=144919
489         <rdar://problem/20920043>
490
491         Reviewed by Gavin Barraclough.
492
493         Log using diagnostic logging how far back in history we navigate.
494         When a back navigation or a backward indexed navigation occurs, we
495         log the delta: (HistoryListSize - 1) - NewHistoryItemIndex.
496
497         * UIProcess/WebBackForwardList.cpp:
498         (WebKit::WebBackForwardList::goToItem):
499
500 2015-05-11  Sam Weinig  <sam@webkit.org>
501
502         ChildProcess should take an os_activity
503         https://bugs.webkit.org/show_bug.cgi?id=141781
504
505         Reviewed by Ryosuke Niwa.
506
507         * DatabaseProcess/EntryPoint/mac/XPCService/DatabaseServiceEntryPoint.mm:
508         (DatabaseServiceInitializer):
509         * NetworkProcess/EntryPoint/mac/XPCService/NetworkServiceEntryPoint.mm:
510         (NetworkServiceInitializer):
511         * PluginProcess/EntryPoint/mac/XPCService/PluginServiceEntryPoint.mm:
512         (PluginServiceInitializer):
513         * WebProcess/EntryPoint/mac/XPCService/WebContentServiceEntryPoint.mm:
514         (WebContentServiceInitializer):
515         Start an os_activity in the initializer for each XPC service.
516
517         * config.h:
518         Add HAVE_OS_ACTIVITY where available.
519
520 2015-05-12  Carlos Garcia Campos  <cgarcia@igalia.com>
521
522         Unreviewed. Fix GTK+ debug build after r184197.
523
524         * UIProcess/gtk/RedirectedXCompositeWindow.cpp: Add missing include.
525
526 2015-05-08  Carlos Garcia Campos  <cgarcia@igalia.com>
527
528         [X11] Add XUniquePtr and XUniqueResource to automatically free X resources
529         https://bugs.webkit.org/show_bug.cgi?id=144521
530
531         Reviewed by Darin Adler.
532
533         Use XUniquePtr and XUniqueResource to free X resources.
534
535         * PlatformEfl.cmake: Add Source/WebCore/platform/graphics/x11 dir
536         to the include dir list.
537         * PlatformGTK.cmake: Ditto.
538         * UIProcess/cairo/BackingStoreCairo.cpp:
539         (WebKit::BackingStore::createBackend): Do not pass the display to
540         the BackingStoreBackendCairoX11 constructor.
541         * UIProcess/gtk/RedirectedXCompositeWindow.cpp:
542         (WebKit::RedirectedXCompositeWindow::RedirectedXCompositeWindow):
543         (WebKit::RedirectedXCompositeWindow::~RedirectedXCompositeWindow):
544         (WebKit::RedirectedXCompositeWindow::resize):
545         (WebKit::RedirectedXCompositeWindow::cleanupPixmapAndPixmapSurface):
546         (WebKit::RedirectedXCompositeWindow::surface):
547         * UIProcess/gtk/RedirectedXCompositeWindow.h:
548         (WebKit::RedirectedXCompositeWindow::windowID):
549         * WebProcess/Plugins/Netscape/NetscapePlugin.h:
550         * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:
551         (WebKit::NetscapePlugin::platformPostInitializeWindowless):
552         (WebKit::NetscapePlugin::platformDestroy):
553         (WebKit::NetscapePlugin::platformGeometryDidChange):
554         (WebKit::NetscapePlugin::platformPaint):
555
556 2015-05-11  Dan Bernstein  <mitz@apple.com>
557
558         WebKit2 part of <rdar://problem/20878075> Trying to navigate to an invalid URL loads about:blank, but -[WKWebView URL] returns the invalid URL
559
560         Reviewed by Alexey Proskuryakov.
561
562         * UIProcess/WebPageProxy.cpp:
563         (WebKit::WebPageProxy::didChangeProvisionalURLForFrame): Added. Update internal state the
564         same way we update it for server redirects, but don’t make client callbacks. Clients
565         observing the URL property will see it change.
566         * UIProcess/WebPageProxy.h:
567
568         * UIProcess/WebPageProxy.messages.in: Added DidChangeProvisionalURLForFrame.
569
570         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
571         (WebKit::WebFrameLoaderClient::dispatchDidChangeProvisionalURL): Override this new
572         FrameLoaderClient function to send a DidChangeProvisionalURLForFrame message to the UI
573         process.
574         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
575
576 2015-05-11  Dan Bernstein  <mitz@apple.com>
577
578         <rdar://problem/19773721> [iOS] Find on page feels like it zooms in too much
579         https://bugs.webkit.org/show_bug.cgi?id=144891
580
581         Reviewed by Darin Adler.
582
583         Sometimes, Find on Page’s constant 1.6 scale factor is too much. Smart magnification is
584         designed to choose a scale factor that is just right.
585
586         * UIProcess/ios/SmartMagnificationController.h:
587         * UIProcess/ios/SmartMagnificationController.messages.in: Added Magnify message.
588         * UIProcess/ios/SmartMagnificationController.mm:
589         (WebKit::SmartMagnificationController::magnify): Added. Handle the new message using
590         -[WKContentView _soomToRect:withOrigin:fitEntireRect:minimumScale:maximumScale:minimumScrollDistance:].
591         * WebProcess/WebPage/ios/FindControllerIOS.mm:
592         (WebKit::FindController::updateFindIndicator): Instead of zooming to the selection rect,
593         get the surrounding render rect (the area we would target for a double-tap at the beginning
594         of the selection), and tell the magnification controller to target it. Use the center of the
595         start of the selection as the origin.
596
597 2015-05-11  Brent Fulgham  <bfulgham@apple.com>
598
599         Scroll snap logic should be triggered when resizing the WebView
600         https://bugs.webkit.org/show_bug.cgi?id=142590
601         <rdar://problem/20125088>
602
603         Reviewed by Simon Fraser.
604
605         * UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm:
606         (RemoteScrollingCoordinatorProxy::closestSnapOffsetForMainFrameScrolling): Modify use of 'closestSnapOffset' to satisfy the additional
607         argument I added. This is currently not used for anything on iOS.
608         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm: Ditto.
609
610 2015-05-11  Andreas Kling  <akling@apple.com>
611
612         Force a rebuild of JSNPObject.cpp on bots.
613
614         * WebProcess/Plugins/Netscape/JSNPObject.cpp:
615         (WebKit::JSNPObject::callMethod):
616
617 2015-05-11  Anders Carlsson  <andersca@apple.com>
618
619         Simplify shim path computation
620         https://bugs.webkit.org/show_bug.cgi?id=144884
621         Part of rdar://problem/19708579.
622
623         Reviewed by Sam Weinig.
624
625         Factor the code that computes the shim path out into a separate function. Also make this mac only
626         since we don't have any shims on iOS.
627
628         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
629         (WebKit::computeProcessShimPath):
630         (WebKit::addDYLDEnvironmentAdditions):
631
632 2015-05-11  Myles C. Maxfield  <mmaxfield@apple.com>
633
634         Unreviewed build fix
635
636         Unreviewed.
637
638         * UIProcess/API/APIUserContentExtensionStore.cpp:
639         (API::compiledToFile):
640
641 2015-05-11  Alex Christensen  <achristensen@webkit.org>
642
643         [Content Extensions] Support domain-specific rules and exceptions.
644         https://bugs.webkit.org/show_bug.cgi?id=144833
645
646         Reviewed by Darin Adler.
647
648         * Shared/WebCompiledContentExtension.cpp:
649         (WebKit::WebCompiledContentExtension::filtersWithoutDomainsBytecode):
650         (WebKit::WebCompiledContentExtension::filtersWithoutDomainsBytecodeLength):
651         (WebKit::WebCompiledContentExtension::filtersWithDomainsBytecode):
652         (WebKit::WebCompiledContentExtension::filtersWithDomainsBytecodeLength):
653         (WebKit::WebCompiledContentExtension::domainFiltersBytecode):
654         (WebKit::WebCompiledContentExtension::domainFiltersBytecodeLength):
655         (WebKit::WebCompiledContentExtension::bytecode): Deleted.
656         (WebKit::WebCompiledContentExtension::bytecodeLength): Deleted.
657         * Shared/WebCompiledContentExtension.h:
658         * Shared/WebCompiledContentExtensionData.cpp:
659         (WebKit::WebCompiledContentExtensionData::encode):
660         (WebKit::WebCompiledContentExtensionData::decode):
661         * Shared/WebCompiledContentExtensionData.h:
662         (WebKit::WebCompiledContentExtensionData::WebCompiledContentExtensionData):
663         * UIProcess/API/APIUserContentExtensionStore.cpp:
664         (API::ContentExtensionMetaData::fileSize):
665         (API::encodeContentExtensionMetaData):
666         (API::decodeContentExtensionMetaData):
667         (API::compiledToFile):
668         (API::createExtension):
669         Keep track of 3 different types of bytecode to be able to handle domain-specific rules.
670
671 2015-05-11  Tim Horton  <timothy_horton@apple.com>
672
673         Page overlay action context override should indicate the source of the request
674         https://bugs.webkit.org/show_bug.cgi?id=144832
675         <rdar://problem/20562594>
676
677         Reviewed by Darin Adler.
678
679         * WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:
680         * WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.h:
681         * WebProcess/WebPage/WebPageOverlay.cpp:
682         (WebKit::WebPageOverlay::actionContextForResultAtPoint):
683         * WebProcess/WebPage/WebPageOverlay.h:
684         (WebKit::WebPageOverlay::Client::actionContextForResultAtPoint):
685         * WebProcess/WebPage/mac/WebPageMac.mm:
686         (WebKit::WebPage::performActionMenuHitTestAtLocation):
687         Add a parameter to WKBundlePageOverlayActionContextForResultAtPoint so that
688         clients can tell whether the requested action context should be targetted
689         at an action menu or immediate action.
690
691 2015-05-11  Daniel Bates  <dabates@apple.com>
692
693         [iOS] Close all open databases in expiration handler of process assertion
694         https://bugs.webkit.org/show_bug.cgi?id=144661
695         <rdar://problem/20845052>
696
697         Reviewed by Darin Adler.
698
699         For WebKit2, close all open databases when the process assertion expiration
700         handler is called.
701
702         When the process assertion expiration handler is called we dispatch a synchronous
703         message called ProcessWillSuspendImminently to the {Web, Network} processes to inform
704         them that they will be suspended imminently. The {Web, Network} process will always
705         service this message regardless if they were waiting for another message. In the
706         WebProcess, we will close all open databases among other tasks upon receiving this
707         message. In the NetworkProcess, we will purge some data from memory.
708
709         * NetworkProcess/NetworkProcess.cpp:
710         (WebKit::NetworkProcess::didReceiveSyncMessage): Modified to call NetworkProcess::didReceiveSyncNetworkProcessMessage()
711         to process the synchronous ProcessWillSuspendImminently message.
712         (WebKit::NetworkProcess::processWillSuspendImminently): Added; free some memory.
713         * NetworkProcess/NetworkProcess.h:
714         * NetworkProcess/NetworkProcess.messages.in: Added synchronous message ProcessWillSuspendImminently.
715         * Shared/ChildProcessProxy.h:
716         (WebKit::ChildProcessProxy::sendSync): Added parameter sendSyncFlags so that we can send
717         a sync message with flag IPC::InterruptWaitingIfSyncMessageArrives to cause the {Web, Network}Process
718         to process the message regardless of whether it is waiting for another message.
719         * UIProcess/Network/NetworkProcessProxy.cpp:
720         (WebKit::NetworkProcessProxy::sendProcessWillSuspendImminently): Added. Sends the message
721         ProcessWillSuspendImminently to the NetworkProcess.
722         * UIProcess/Network/NetworkProcessProxy.h:
723         * UIProcess/ProcessAssertion.cpp:
724         (WebKit::ProcessAndUIAssertion::setClient): Added.
725         * UIProcess/ProcessAssertion.h: Added abstract class ProcessAssertionClient.
726         (WebKit::ProcessAssertionClient::~ProcessAssertionClient): Added.
727         (WebKit::ProcessAssertion::setClient): Added.
728         (WebKit::ProcessAssertion::client): Added.
729         * UIProcess/ProcessThrottler.cpp:
730         (WebKit::ProcessThrottler::didConnectToProcess):
731         (WebKit::ProcessThrottler::assertionWillExpireImminently): Added; implements the ProcessAssertionClient
732         interface. Notify the process throttler clients that the assertion is near expiration.
733         * UIProcess/ProcessThrottler.h:
734         * UIProcess/ProcessThrottlerClient.h: Added 
735         * UIProcess/WebProcessProxy.cpp:
736         (WebKit::WebProcessProxy::sendProcessWillSuspendImminently): Added. Sends the message
737         ProcessWillSuspendImminently to the WebProcess.
738         * UIProcess/WebProcessProxy.h:
739         * UIProcess/ios/ProcessAssertionIOS.mm:
740         (-[WKProcessAssertionBackgroundTaskManager addClient:]): Added.
741         (-[WKProcessAssertionBackgroundTaskManager removeClient:]): Added.
742         (-[WKProcessAssertionBackgroundTaskManager _updateBackgroundTask]): Modified expiration handler
743         to notify ProcessAssertionClient clients that the assertion is near expiration.
744         (WebKit::ProcessAssertion::~ProcessAssertion): Remove the client on destruction.
745         (WebKit::ProcessAndUIAssertion::setClient): Added.
746         * WebProcess/WebCoreSupport/WebDatabaseManager.cpp:
747         (WebKit::WebDatabaseManager::closeAllDatabases): Added; turns around and calls DatabaseManager::closeAllDatabases().
748         * WebProcess/WebCoreSupport/WebDatabaseManager.h:
749         * WebProcess/WebProcess.cpp:
750         (WebKit::WebProcess::didReceiveSyncMessage): Call WebProcess::didReceiveSyncWebProcessMessage() to process
751         the synchronous ProcessWillSuspendImminently message. Removed logging for an unhandled synchronous message
752         since WebProcess::didReceiveSyncWebProcessMessage() will ASSERT_NOT_REACHED() for such a message.
753         (WebKit::WebProcess::prepareToSuspend): Extracted code from WebProcess::processWillSuspend() so that it can
754         be used from both WebProcess::processWillSuspend() and WebProcess::processWillSuspendImminently(). And modified
755         it to conditionally dispatch a ProcessReadyToSuspend message to the WebProcessProxy. We only want to dispatch
756         such a message as part of a coordinated suspension by the ProcessThrottler. That is, we do not want to dispatch
757         the ProcessReadyToSuspend message when the background assertion is near expiration (i.e. WebProcess::processWillSuspendImminently()
758         is called).
759         (WebKit::WebProcess::processWillSuspendImminently): Added. Suspend all open databases among other tasks.
760         (WebKit::WebProcess::processWillSuspend): Implemented in terms of WebProcess::prepareToSuspend().
761         (WebKit::WebProcess::processSuspensionCleanupTimerFired): Modified to conditionally dispatch a ProcessReadyToSuspend
762         message to the WebProcessProxy.
763         (WebKit::WebProcess::processDidResume): Stop the suspension cleanup timer, which may be active if the WebProcess
764         did not mark all its graphics layers as volatile before process suspension.
765         * WebProcess/WebProcess.h:
766         * WebProcess/WebProcess.messages.in: Added synchronous message ProcessWillSuspendImminently.
767
768 2015-05-10  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
769
770         Use Ref instead of PassRefPtr in WebCore/page
771         https://bugs.webkit.org/show_bug.cgi?id=144841
772
773         Reviewed by Darin Adler.
774
775         To kill PassRefPtr, this patch replaces PassRefPtr with Ref or RefPtr
776         in WebCore/page.
777
778         (WebKit::WebUserContentController::WebUserContentController):
779         * UIProcess/WebPageProxy.cpp:
780         (WebKit::WebPageProxy::setTextIndicator):
781         * UIProcess/mac/PageClientImpl.mm:
782         (WebKit::PageClientImpl::didPerformDictionaryLookup):
783         * WebProcess/UserContent/WebUserContentController.cpp:
784         (WebKit::WebUserContentController::WebUserContentController):
785
786 2015-05-10  Philip Chimento  <philip.chimento@gmail.com>
787
788         [GTK][SOUP] Web and Network processes don't know how to get memory size on OSX
789         https://bugs.webkit.org/show_bug.cgi?id=144554
790
791         Reviewed by Darin Adler.
792
793         * NetworkProcess/soup/NetworkProcessSoup.cpp:
794         (WebKit::NetworkProcess::platformSetCacheModel): Use WTF::ramSize()
795         instead of local function. Also use WTF::MB instead of dividing by
796         1024 * 1024.
797         (WebKit::getMemorySize): Deleted.
798         * WebProcess/soup/WebProcessSoup.cpp:
799         (WebKit::WebProcess::platformSetCacheModel): Ditto.
800         (WebKit::getMemorySize): Deleted.
801
802 2015-05-10  Yongjun Zhang  <yongjun_zhang@apple.com>
803
804         Use preview view controller from WebKitSystemInterface.
805         https://bugs.webkit.org/show_bug.cgi?id=144836
806
807         Add a property _allowsLinkPreview to WKWebView so that we can turn on/off preview at runtime. Also,
808         for client that doesn't provide preview view controller, use the default view controller prepared
809         by WebKitSystemInterface.
810
811         Reviewed by Dan Bernstein.
812
813         * UIProcess/API/Cocoa/WKWebView.mm:
814         (-[WKWebView initWithFrame:configuration:]):
815         (-[WKWebView _allowsLinkPreview]):
816         (-[WKWebView _setAllowsLinkPreview:]):
817         * UIProcess/API/Cocoa/WKWebViewPrivate.h: Add _allowsLinkPreview property
818         * UIProcess/ios/WKContentView.mm:
819         (-[WKContentView willMoveToWindow:]):
820         * UIProcess/ios/WKContentViewInteraction.h:
821         * UIProcess/ios/WKContentViewInteraction.mm:
822         (-[WKContentView _registerPreviewInWindow:]):
823         (-[WKContentView _unregisterPreviewInWindow:]):
824         (-[WKContentView previewViewControllerForPosition:inSourceView:]): : For client that doesn't provide
825             preview delegate, use preview view controller in WebKitSystemInterface.
826         (-[WKContentView commitPreviewViewController:]):
827
828 2015-05-10  Darin Adler  <darin@apple.com>
829
830         Fix internal Apple builds on Mavericks.
831
832         * UIProcess/API/mac/WKView.mm:
833         (-[WKView _dismissContentRelativeChildWindows]): Added missing conditionals around
834         some code that is for OS X 10.10 or newer only. There were similar conditionals around
835         other nearby code in this file, and around other uses of the same method in other files,
836         so matched the style.
837
838 2015-05-10  Dan Bernstein  <mitz@apple.com>
839
840         iOS internal build fix.
841
842         * Platform/mac/MenuUtilities.mm:
843
844 2015-05-10  Sungmann Cho  <sungmann.cho@navercorp.com>
845
846         Remove unnecessary semicolons.
847         https://bugs.webkit.org/show_bug.cgi?id=144844
848
849         Reviewed by Darin Adler.
850
851         No new tests, no behavior change.
852
853         * Shared/Downloads/mac/DownloadMac.mm:
854         (-[WKDownloadAsDelegate download:shouldDecodeSourceDataOfMIMEType:]):
855         * UIProcess/WebProcessProxy.cpp:
856         (WebKit::WebProcessProxy::transformHandlesToObjects):
857         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
858         (WebKit::RemoteLayerTreeDrawingAreaProxy::indicatorLocation):
859         * WebProcess/WebPage/WebBackForwardListProxy.cpp:
860         (WebKit::idToHistoryItemMap):
861
862 2015-05-10  Darin Adler  <darin@apple.com>
863
864         Fix build.
865
866         * Platform/mac/MenuUtilities.mm: Added includes that were somehow omitted in what
867         I committed before.
868
869 2015-05-10  Darin Adler  <darin@apple.com>
870
871         [Cocoa] Don't soft link DataDetectorsCore
872         https://bugs.webkit.org/show_bug.cgi?id=144837
873
874         Reviewed by Dan Bernstein.
875
876         * Platform/mac/MenuUtilities.mm: Use DataDetectorsSPI.h instead of doing it here.
877
878         * WebProcess/WebPage/mac/WebPageMac.mm: Removed unneeded include of unused header,
879         DataDetectorsSPI.h.
880
881 2015-05-09  Dan Bernstein  <mitz@apple.com>
882
883         Deployment-target __NSi_ and __NSd_ definitions in WKFoundation.h are redundant
884         https://bugs.webkit.org/show_bug.cgi?id=144831
885
886         Reviewed by Sam Weinig.
887
888         Reverted r182846 and r182904.
889
890         * Shared/API/Cocoa/WKFoundation.h:
891         * WebKit2.xcodeproj/project.pbxproj:
892
893 2015-05-09  Yoav Weiss  <yoav@yoav.ws>
894
895         Remove the PICTURE_SIZES build flag
896         https://bugs.webkit.org/show_bug.cgi?id=144679
897
898         Reviewed by Benjamin Poulain.
899
900         Removed the PICTURE_SIZES build time flag.
901
902         * Configurations/FeatureDefines.xcconfig:
903
904 2015-05-08  Beth Dakin  <bdakin@apple.com>
905
906         Shuffle touch-related code to keep the internal builds working
907         https://bugs.webkit.org/show_bug.cgi?id=144812
908
909         Reviewed by Benjamin Poulain.
910
911         * Shared/NativeWebTouchEvent.h:
912         * Shared/WebEvent.h:
913         * Shared/WebEventConversion.cpp:
914         * Shared/ios/NativeWebTouchEventIOS.mm:
915         (WebKit::NativeWebTouchEvent::extractWebTouchPoint):
916         (WebKit::extractWebTouchPoint): Deleted.
917         * Shared/ios/WebPlatformTouchPointIOS.cpp:
918
919 2015-05-08  Dan Bernstein  <mitz@apple.com>
920
921         <rdar://problem/20757196> NSInternalInconsistencyException raised in -[NSString encodeWithCoder:] beneath createEncodedObject when using WKRemoteObjectEncoder for Safari AutoFill
922         https://bugs.webkit.org/show_bug.cgi?id=144818
923
924         Reviewed by Anders Carlsson.
925
926         Allow NSString instances that contain unpaired surrogates to be encoded by
927         WKRemoteObjectCoder by encoding them directly rather than using
928         -[NSString encodeWithCoder:].
929
930         * Shared/API/Cocoa/WKRemoteObjectCoder.mm:
931         (encodeString): Added. Sets an API::String as the object to encode.
932         (encodeObject): Changed to use encodeString for NSString instances.
933         (decodeString): Added. Gets an API::String from the dictionary and returns it as an
934         NSString.
935         (decodeObject): Changed to use decodeString for NSString instances.
936
937 2015-05-08  Timothy Horton  <timothy_horton@apple.com>
938
939         Fix the build.
940
941         * Platform/mac/LayerHostingContext.mm:
942         (WebKit::LayerHostingContext::createFencePort):
943
944 2015-05-08  Timothy Horton  <timothy_horton@apple.com>
945
946         Periodically repaint during resize while using the DynamicSizeWithMinimumViewSize layout strategy
947         https://bugs.webkit.org/show_bug.cgi?id=144816
948
949         Reviewed by Simon Fraser.
950
951         * UIProcess/mac/WKViewLayoutStrategy.mm:
952         (-[WKViewDynamicSizeWithMinimumViewSizeLayoutStrategy initWithPage:view:mode:]):
953         (-[WKViewDynamicSizeWithMinimumViewSizeLayoutStrategy _updateTransientScale:]):
954         (-[WKViewDynamicSizeWithMinimumViewSizeLayoutStrategy updateLayout]):
955         Factor out _updateTransientScale from updateLayout.
956         Keep track of the last viewScaleFactor that we know is being displayed
957         (_lastCommittedViewScale) and use that for computing the transient scale,
958         so that we can recompute the transient scale while the UI process's notion
959         of the actual view scale might have moved ahead of what the Web process has
960         painted.
961
962 2015-05-08  Timothy Horton  <timothy_horton@apple.com>
963
964         Fix the build.
965
966         * UIProcess/WebPageProxy.cpp:
967
968 2015-05-08  Timothy Horton  <timothy_horton@apple.com>
969
970         Fix the build.
971
972         * Platform/mac/LayerHostingContext.mm:
973         (WebKit::LayerHostingContext::createFencePort):
974
975 2015-05-08  Timothy Horton  <timothy_horton@apple.com>
976
977         Fix the build.
978
979         * Platform/mac/LayerHostingContext.mm:
980         (WebKit::LayerHostingContext::createFencePort):
981
982 2015-05-08  Timothy Horton  <timothy_horton@apple.com>
983
984         Flip the direction of the fence in scaleViewAndUpdateGeometryFenced
985         https://bugs.webkit.org/show_bug.cgi?id=144810
986
987         Reviewed by Simon Fraser.
988
989         Send the fence from the Web process to the UI process, instead of vice versa.
990         This means that we won't keep the UI process CAContext blocked for the whole
991         time that the Web process is doing layout/painting/etc. Instead, we'll start
992         blocking the Web process CAContext immediately after flushing and before committing,
993         and send the fence to the UI process to be applied immediately. This minimizes
994         the amount of time in both processes spent blocked on the fence.
995
996         * Platform/mac/LayerHostingContext.h:
997         * Platform/mac/LayerHostingContext.mm:
998         (WebKit::LayerHostingContext::createFencePort):
999         Add createFencePort, which creates a MachSendRight wrapping a CA fence port.
1000         Note that you must setFencePort() with this port if you want the LayerHostingContext's
1001         CAContext to block on it!
1002
1003         * UIProcess/WebPageProxy.cpp:
1004         (WebKit::WebPageProxy::scaleViewAndUpdateGeometryFenced):
1005         (WebKit::WebPageProxy::machSendRightCallback):
1006         * UIProcess/WebPageProxy.h:
1007         * UIProcess/WebPageProxy.messages.in:
1008         Create a callback and send it to the Web process along with scaleViewAndUpdateGeometryFenced.
1009
1010         * UIProcess/mac/WKViewLayoutStrategy.mm:
1011         (-[WKViewDynamicSizeWithMinimumViewSizeLayoutStrategy updateLayout]):
1012         When called back, install the fence port in our CAContext; when the commit goes through,
1013         remove the transient scale as we did previously.
1014
1015         * WebProcess/WebPage/DrawingArea.h:
1016         (WebKit::DrawingArea::replyWithFenceAfterNextFlush):
1017         (WebKit::DrawingArea::updateGeometry): Deleted.
1018         * WebProcess/WebPage/WebPage.cpp:
1019         (WebKit::WebPage::scaleViewAndUpdateGeometryFenced):
1020         * WebProcess/WebPage/WebPage.h:
1021         * WebProcess/WebPage/WebPage.messages.in:
1022         Instead of installing a fence created in the UI process, tell the DrawingArea
1023         to create one and reply to the UI process with it after the next flush.
1024
1025         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
1026         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
1027         (WebKit::TiledCoreAnimationDrawingArea::flushLayers):
1028         (WebKit::TiledCoreAnimationDrawingArea::replyWithFenceAfterNextFlush):
1029         After flushing, before committing, create a fence and reply to any
1030         callbacks that requested fences, and install it in our context.
1031
1032 2015-05-08  Michael Catanzaro  <mcatanzaro@igalia.com>, Martin Robinson <mrobinson@igalia.com>
1033
1034         [GTK] Checks for DEVELOPMENT_BUILD are all wrong
1035         https://bugs.webkit.org/show_bug.cgi?id=144746
1036
1037         Reviewed by Carlos Garcia Campos.
1038
1039         Use ENABLE(DEVELOPER_MODE) rather than DEVELOPMENT_BUILD.
1040
1041         * Shared/gtk/ProcessExecutablePathGtk.cpp:
1042         (WebKit::findWebKitProcess):
1043         * UIProcess/API/gtk/WebKitWebContext.cpp:
1044         (injectedBundleDirectory):
1045         * UIProcess/gtk/TextCheckerGtk.cpp:
1046         (WebKit::enchantTextChecker):
1047
1048 2015-05-08  Anders Carlsson  <andersca@apple.com>
1049
1050         Fix ProcessLauncher port leak
1051         https://bugs.webkit.org/show_bug.cgi?id=144807
1052         rdar://problem/20593291
1053
1054         Reviewed by Sam Weinig.
1055
1056         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
1057         (WebKit::connectToService):
1058         xpc_dictionary_set_mach_send increments the send right count so make sure to
1059         balance it with a call to mach_port_deallocate.
1060
1061 2015-05-08  Beth Dakin  <bdakin@apple.com>
1062
1063         Fix performance tests after r183954
1064         https://bugs.webkit.org/show_bug.cgi?id=144805
1065
1066         Reviewed by Alexey Proskuryakov.
1067
1068         Web* is traditionally a WK1 prefix, so use the WK2 prefix instead in WK2 so that 
1069         we don’t have two classes with the same name in the two projects.
1070         * UIProcess/mac/WKImmediateActionController.mm:
1071         (-[WKImmediateActionController _defaultAnimationController]):
1072
1073 2015-05-08  Carlos Garcia Campos  <cgarcia@igalia.com>
1074
1075         [GTK] Expose allowFileAccessFromFileURLs setting to WebKit2 GTK+ API
1076         https://bugs.webkit.org/show_bug.cgi?id=144748
1077
1078         Reviewed by Sergio Villar Senin.
1079
1080         This is needed by local applications loaded as a file URI that do XMLHttpRequests.
1081
1082         * UIProcess/API/gtk/WebKitSettings.cpp:
1083         (webKitSettingsSetProperty):
1084         (webKitSettingsGetProperty):
1085         (webkit_settings_class_init):
1086         (webkit_settings_get_allow_file_access_from_file_urls):
1087         (webkit_settings_set_allow_file_access_from_file_urls):
1088         * UIProcess/API/gtk/WebKitSettings.h:
1089         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
1090         * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml:
1091
1092 2015-05-08  Andreas Kling  <akling@apple.com>
1093
1094         Optimize serialization of quoted JSON strings.
1095         <https://webkit.org/b/144754>
1096
1097         Reviewed by Darin Adler.
1098
1099         * NetworkProcess/cache/NetworkCacheEntry.cpp:
1100         (WebKit::NetworkCache::Entry::asJSON): Use the new StringBuilder API.
1101
1102 2015-05-08  Commit Queue  <commit-queue@webkit.org>
1103
1104         Unreviewed, rolling out r183945.
1105         https://bugs.webkit.org/show_bug.cgi?id=144789
1106
1107         "It broke all the GTK+ tests" (Requested by KaL on #webkit).
1108
1109         Reverted changeset:
1110
1111         "[GTK] Checks for DEVELOPMENT_BUILD are all wrong"
1112         https://bugs.webkit.org/show_bug.cgi?id=144746
1113         http://trac.webkit.org/changeset/183945
1114
1115 2015-05-07  Conrad Shultz  <conrad_shultz@apple.com>
1116
1117         Don't register for Lookup notifications until needed
1118         https://bugs.webkit.org/show_bug.cgi?id=144783
1119
1120         Reviewed by Tim Horton.
1121
1122         * UIProcess/API/mac/WKView.mm:
1123         Add a WKViewData ivar to track whether we've already registered for popover notifications.
1124         (-[WKView _prepareForDictionaryLookup]):
1125         Added; moved notification registration from -[WKView initWithFrame:processPool:configuration:webView:.
1126         (-[WKView initWithFrame:processPool:configuration:webView:]):
1127         Move notification registration to -_prepareForDictionaryLookup.
1128
1129         * UIProcess/API/mac/WKViewInternal.h:
1130         Expose -_prepareForDictionaryLookup.
1131
1132         * UIProcess/mac/PageClientImpl.mm:
1133         (WebKit::PageClientImpl::didPerformDictionaryLookup):
1134         Send -[WKView _prepareForDictionaryLookup].
1135
1136         * UIProcess/mac/WKImmediateActionController.mm:
1137         (-[WKImmediateActionController _animationControllerForText]):
1138         Ditto.
1139
1140 2015-05-07  Commit Queue  <commit-queue@webkit.org>
1141
1142         Unreviewed, rolling out r183961.
1143         https://bugs.webkit.org/show_bug.cgi?id=144784
1144
1145         Broke js/dom/JSON-stringify.html (Requested by kling on
1146         #webkit).
1147
1148         Reverted changeset:
1149
1150         "Optimize serialization of quoted JSON strings."
1151         https://bugs.webkit.org/show_bug.cgi?id=144754
1152         http://trac.webkit.org/changeset/183961
1153
1154 2015-05-07  Anders Carlsson  <andersca@apple.com>
1155
1156         Build fixes.
1157
1158         * UIProcess/API/mac/WKView.mm:
1159         (-[WKView initWithFrame:processPool:configuration:webView:]):
1160         Use the regular init method.
1161
1162         * UIProcess/mac/WKSharingServicePickerDelegate.mm:
1163         (-[WKSharingServicePickerDelegate sharingService:didShareItems:]):
1164         * WebProcess/WebPage/mac/WebPageMac.mm:
1165         (WebKit::WebPage::handleSelectionServiceClick):
1166         Pass empty dictionaries instead of nil.
1167
1168 2015-05-07  Chris Dumez  <cdumez@apple.com>
1169
1170         ASSERTION when pasting text into the WebInspector console
1171         https://bugs.webkit.org/show_bug.cgi?id=144774
1172
1173         Reviewed by Ryosuke Niwa.
1174
1175         Fix assertion in didChangeSelection() meant to check that calling
1176         editorState() does not cause a synchronous layout. The assertion
1177         was not correct as it was relying on FrameView::needsLayout() and
1178         we would hit it if calling editorState() would schedule a layout.
1179         Instead, the new assertion relies on FrameView::layoutCount(),
1180         which is more accurate.
1181
1182         * WebProcess/WebPage/WebPage.cpp:
1183         (WebKit::WebPage::didChangeSelection):
1184
1185 2015-05-07  Andreas Kling  <akling@apple.com>
1186
1187         Optimize serialization of quoted JSON strings.
1188         <https://webkit.org/b/144754>
1189
1190         Reviewed by Darin Adler.
1191
1192         * NetworkProcess/cache/NetworkCacheEntry.cpp:
1193         (WebKit::NetworkCache::Entry::asJSON): Use the new StringBuilder API.
1194
1195 2015-05-07  Martin Robinson  <mrobinson@igalia.com>
1196
1197         Followup fixes to r183936
1198
1199         I neglected to include a few review comments when I landed the patch.
1200
1201         * UIProcess/gtk/TextCheckerGtk.cpp:
1202         (WebKit::checkerState): Remove double semicolons.
1203         (WebKit::updateStateForAllProcessPools): Use range-based-for loop here and
1204         give the function a better name.
1205         (WebKit::TextChecker::setContinuousSpellCheckingEnabled): Use new function name
1206         (WebKit::TextChecker::setGrammarCheckingEnabled):Use new function name
1207         (WebKit::TextChecker::ignoreWord): Fix unused parameter warning.
1208         (WebKit::updateStateForAllContexts): Deleted.
1209
1210 2015-05-07  Michael Catanzaro  <mcatanzaro@igalia.com>
1211
1212         [GTK] Checks for DEVELOPMENT_BUILD are all wrong
1213         https://bugs.webkit.org/show_bug.cgi?id=144746
1214
1215         Reviewed by Martin Robinson.
1216
1217         Use DEVELOPER_MODE rather than DEVELOPMENT_BUILD.
1218
1219         * Shared/gtk/ProcessExecutablePathGtk.cpp:
1220         (WebKit::findWebKitProcess):
1221         * UIProcess/API/gtk/WebKitWebContext.cpp:
1222         (injectedBundleDirectory):
1223         * UIProcess/gtk/TextCheckerGtk.cpp:
1224         (WebKit::enchantTextChecker):
1225
1226 2015-05-06  Dean Jackson  <dino@apple.com>
1227
1228         Handle backdrop views that have to tile
1229         https://bugs.webkit.org/show_bug.cgi?id=142317
1230         <rdar://problem/20049088>
1231
1232         Reviewed by Simon Fraser.
1233
1234         Take 2 - this was rolled out because Mavericks was crashing.
1235
1236         Add some better logging for custom appearance.
1237
1238         * Shared/mac/RemoteLayerTreeTransaction.mm:
1239         (WebKit::RemoteLayerTreeTextStream::operator<<):
1240
1241 2015-05-07  Sungmann Cho  <sungmann.cho@navercorp.com>
1242
1243         Add PLUGIN_ARCHITECTURE(X11) around m_frameRectInWindowCoordinates in NetscapePlugin.
1244         https://bugs.webkit.org/show_bug.cgi?id=144490
1245
1246         Reviewed by Darin Adler.
1247
1248         m_frameRectInWindowCoordinates in NetscapePlugin is currently being used only for
1249         the windowed plugins, and the windowed plugins are only supported on X11. So we can
1250         guard it with PLUGIN_ARCHITECTURE(X11).
1251
1252         No new tests, no behavior change.
1253
1254         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
1255         (WebKit::NetscapePlugin::geometryDidChange):
1256         * WebProcess/Plugins/Netscape/NetscapePlugin.h:
1257
1258 2015-05-05  Myles C. Maxfield  <mmaxfield@apple.com>
1259
1260         Revert "Introducing the Platform Abstraction Layer (PAL)"
1261         https://bugs.webkit.org/show_bug.cgi?id=144751
1262
1263         Unreviewed.
1264
1265         PAL should be a new target inside WebCore, rather than a top-level folder.
1266
1267         * Configurations/FeatureDefines.xcconfig: Updated
1268
1269 2015-05-07  Jer Noble  <jer.noble@apple.com>
1270
1271         [WK2][Fullscreen] Fullscreen video does not enter low-power mode.
1272         https://bugs.webkit.org/show_bug.cgi?id=144744
1273
1274         Reviewed by Darin Adler.
1275
1276         One of the requirements of entering low-power compositing mode is that no masking layers
1277         are present in any of the ancestors of the fullscreen video layer. So once our fullscreen
1278         transition animation completes, remove the mask layer entirely from our clipping layer.
1279         This means it needs to be re-created and added when entering fullscreen, rather than just
1280         at initialization time.
1281
1282         * UIProcess/mac/WKFullScreenWindowController.mm:
1283         (-[WKFullScreenWindowController initWithWindow:webView:]):
1284         (-[WKFullScreenWindowController finishedEnterFullScreenAnimation:]):
1285         (-[WKFullScreenWindowController _startEnterFullScreenAnimationWithDuration:]):
1286
1287 2015-05-07  Martin Robinson  <mrobinson@igalia.com>
1288
1289         [GTK] All spell checking layout tests fail
1290         https://bugs.webkit.org/show_bug.cgi?id=144648
1291
1292         Reviewed by Carlos Garcia Campos.
1293
1294         Simplify and complete the GTK+ spell-checking implementation. Instead of using
1295         the EFL/GTK+ only WKTextChecker interface, directly implement Enchant spell-checking
1296         in TextCheckerGtk. The per-context spell checking API is an illusion, since all
1297         WKTextChecker implementations will adjust the same singleton. This can be a first step
1298         toward removing it entirely.
1299
1300         Also complete the implementation of the TextChecker interface by duplicating the EFL code,
1301         which reuses other methods in the same class. Eventually this duplication will collapse,
1302         once GTK+ and EFL can share an Enchant implementation.
1303
1304         * PlatformGTK.cmake:
1305         * UIProcess/API/gtk/WebKitPrivate.h:
1306         * UIProcess/API/gtk/WebKitTextChecker.cpp: Removed.
1307         * UIProcess/API/gtk/WebKitTextChecker.h: Removed.
1308         * UIProcess/API/gtk/WebKitWebContext.cpp: Remove WebTextChecker usage and
1309         replace it with calls directly to the TextChecker singleton via static methods.
1310         * UIProcess/TextChecker.h:
1311         * UIProcess/gtk/TextCheckerGtk.cpp: Move the WebTextChecker enchant implementation
1312         here and reuse the EFL version of WebKit::TextChecker::requestCheckingOfString.
1313         Also initialize languages properly when building for developer builds. This
1314         allows WebKitTestRunner to work even when it doesn't explicitly set the languages.
1315
1316 2015-05-07  Ada Chan  <adachan@apple.com>
1317
1318         Fix a couple of cases where the backForwardListState's currentIndex is not set correctly in WebBackForwardList::backForwardListState().
1319         https://bugs.webkit.org/show_bug.cgi?id=144666
1320
1321         Reviewed by Darin Adler.
1322
1323         * UIProcess/WebBackForwardList.cpp:
1324         (WebKit::WebBackForwardList::backForwardListState):
1325         If the first item is filtered out and the currentIndex is 0, don't decrement currentIndex.
1326         If all the items are filtered out, set currentIndex to the uninitialized value.
1327
1328 2015-05-07  Csaba Osztrogonác  <ossy@webkit.org>
1329
1330         [WK2] Remove Windows cruft
1331         https://bugs.webkit.org/show_bug.cgi?id=144745
1332
1333         Reviewed by Darin Adler.
1334
1335         * NetworkProcess/soup/NetworkProcessSoup.cpp:
1336         (WebKit::getMemorySize):
1337         * Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp:
1338         (IPC::ArgumentCoder<WebCore::GraphicsSurfaceToken>::encode):
1339         (IPC::ArgumentCoder<WebCore::GraphicsSurfaceToken>::decode):
1340         * WebProcess/soup/WebProcessSoup.cpp:
1341         (WebKit::getMemorySize):
1342
1343 2015-05-07  Carlos Garcia Campos  <cgarcia@igalia.com>
1344
1345         REGRESSION(r182032): [GTK] Production build is broken after r182032
1346         https://bugs.webkit.org/show_bug.cgi?id=144736
1347
1348         Reviewed by Martin Robinson.
1349
1350         The problem is that r182032 moved the NetworkProcess sources from
1351         WebKit2 sources to NetworkProcess sources. That's not a problem
1352         for developer builds where all internal symbols are exported, but
1353         doesn't work for production builds because all those internal
1354         symbols are private.
1355
1356         * CMakeLists.txt: Use a different name for common network process
1357         sources variable.
1358         * PlatformMac.cmake: Append common network process sources to the
1359         network process source list for Mac.
1360
1361 2015-05-07  Dan Bernstein  <mitz@apple.com>
1362
1363         <rdar://problem/19317140> [Xcode] Remove usage of AspenFamily.xcconfig in Source/
1364         https://bugs.webkit.org/show_bug.cgi?id=144727
1365
1366         Reviewed by Darin Adler.
1367
1368         * Configurations/Base.xcconfig: Don’t include AspenFamily.xcconfig, and define
1369         INSTALL_PATH_PREFIX and LD_DYLIB_INSTALL_NAME for the iOS 8.x Simulator.
1370         * Configurations/WebKit2.xcconfig: Define INSTALL_PATH_ACTUAL and let INSTALL_PATH be
1371         derived from it and INSTALL_PATH_PREFIX. Don’t override DYLIB_INSTALL_NAME_BASE for iOS,
1372         because we define LD_DYLIB_INSTALL_NAME directly where needed.
1373
1374 2015-05-07  Carlos Garcia Campos  <cgarcia@igalia.com>
1375
1376         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.9.1 release.
1377
1378         * gtk/NEWS: Add release notes for 2.9.1.
1379
1380 2015-05-07  Carlos Garcia Campos  <cgarcia@igalia.com>
1381
1382         [GTK] Remove dock button from Web Inspector window
1383         https://bugs.webkit.org/show_bug.cgi?id=144728
1384
1385         Reviewed by Sergio Villar Senin.
1386
1387         We added the dock buttons to the headerbar, because they were
1388         removed from the inspector toolbar, but with the new tabbed
1389         design, the dock buttons are back in the toolbar and look redundant.
1390
1391         * UIProcess/WebInspectorProxy.h:
1392         * UIProcess/gtk/WebInspectorProxyGtk.cpp:
1393         (WebKit::WebInspectorProxy::createInspectorWindow):
1394         (WebKit::WebInspectorProxy::platformAttachAvailabilityChanged):
1395         (WebKit::WebInspectorProxy::dockButtonClicked): Deleted.
1396
1397 2015-05-06  Jer Noble  <jer.noble@apple.com>
1398
1399         [WK2][Fullscreen] Elements whose children extend beyond their bounds are clipped in fullscreen mode.
1400         https://bugs.webkit.org/show_bug.cgi?id=144716
1401
1402         Reviewed by Darin Adler.
1403
1404         We create a mask animation for the transition between windowed and fullscreen modes, on the
1405         assumption that the element being taken into fullscreen mode does not have visible children
1406         who extend beyond that elements bounds. This assumption breaks down in the case where div
1407         with absolutely positioned children is taken fullscreen. While we can't necessarily make the
1408         transition look correct in this case, we can remove the mask after the transition completes.
1409
1410         * UIProcess/mac/WKFullScreenWindowController.mm:
1411         (-[WKFullScreenWindowController finishedEnterFullScreenAnimation:]):
1412         * WebProcess/MediaCache/WebMediaKeyStorageManager.cpp:
1413         (WebKit::removeAllMediaKeyStorageForOriginPath):
1414
1415 2015-05-06  Jinwoo Jeong  <jw00.jeong@samsung.com>
1416
1417         Fix a build break on EFL debug build
1418         https://bugs.webkit.org/show_bug.cgi?id=144654
1419
1420         Reviewed by Gyuyoung Kim.
1421
1422         No new tests, just build fix.
1423
1424         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
1425         (WebKit::CoordinatedGraphicsScene::paintToCurrentGLContext):
1426         (WebKit::CoordinatedGraphicsScene::paintToGraphicsContext):
1427
1428 2015-05-06  Daniel Bates  <dabates@apple.com>
1429
1430         [iOS][WK2] Pause/resume database thread when UIProcess enters/leaves the background
1431         https://bugs.webkit.org/show_bug.cgi?id=144657
1432         <rdar://problem/18894598>
1433
1434         Reviewed by Andy Estes.
1435
1436         Pause and resume the database thread when the UIProcess enters and leaves the background,
1437         respectively, so that we avoid WebProcess termination due to holding a locked SQLite
1438         database file when the WebProcess is suspended. This behavior matches the analagous
1439         behavior in Legacy WebKit.
1440
1441         * UIProcess/WebPageProxy.h:
1442         * UIProcess/ios/WKContentView.mm:
1443         (-[WKContentView _applicationDidEnterBackground:]): Call WebPageProxy::applicationDidEnterBackground()
1444         when the UIProcess enters the background.
1445         * UIProcess/ios/WebPageProxyIOS.mm:
1446         (WebKit::WebPageProxy::applicationDidEnterBackground): Added; notify the WebProcess to pause the database thread.
1447         We temporarily take out background assertion on the WebProcess before sending this notification to ensure that the
1448         WebProcess is running to receive it. We'll release this assertion when the WebProcess replies that it received the
1449         notification.
1450         * WebProcess/WebCoreSupport/WebDatabaseManager.cpp:
1451         (WebKit::WebDatabaseManager::setPauseAllDatabases): Added; turns around and calls DatabaseManager::setPauseAllDatabases().
1452         * WebProcess/WebCoreSupport/WebDatabaseManager.h:
1453         * WebProcess/WebPage/WebPage.h:
1454         * WebProcess/WebPage/WebPage.messages.in: Add message ApplicationDidEnterBackground(). Also,
1455         add empty lines to help demarcate this message and the other UIKit application lifecycle-related
1456         messages from the rest of the list of messages.
1457         * WebProcess/WebPage/ios/WebPageIOS.mm:
1458         (WebKit::WebPage::applicationWillEnterForeground): Resume the database thread.
1459         (WebKit::WebPage::applicationDidEnterBackground): Pause the database thread.
1460
1461 2015-05-06  Ryuan Choi  <ryuan.choi@navercorp.com>
1462
1463         [EFL] ewk_view_page_contents_get() API test is flaky
1464         https://bugs.webkit.org/show_bug.cgi?id=144683
1465
1466         Reviewed by Gyuyoung Kim.
1467
1468         Callback of WKPageGetContentsAsMHTMLData contains WKData which does not contain null terminated character.
1469
1470         * UIProcess/API/efl/ewk_view.cpp: Pass the data of string instead of WKData directly.
1471         (ewkViewPageContentsAsMHTMLCallback):
1472
1473 2015-05-06  Joseph Pecoraro  <pecoraro@apple.com>
1474
1475         Web Inspector: Docking Toolbar Buttons do not respect Docking Availability
1476         https://bugs.webkit.org/show_bug.cgi?id=144714
1477
1478         Reviewed by Timothy Hatcher.
1479
1480         * UIProcess/WebInspectorProxy.cpp:
1481         (WebKit::WebInspectorProxy::createInspectorPage):
1482         (WebKit::WebInspectorProxy::attachAvailabilityChanged):
1483         * WebProcess/WebPage/WebInspectorUI.cpp:
1484         (WebKit::WebInspectorUI::setDockingUnavailable):
1485         * WebProcess/WebPage/WebInspectorUI.h:
1486         * WebProcess/WebPage/WebInspectorUI.messages.in:
1487         When docking availability changes, inform the inspector page
1488         so it can respond by updating its UI.
1489
1490 2015-05-06  Joonghun Park  <jh718.park@samsung.com>
1491
1492         [WK2] Simplify AsyncRequestImpl::ArgumentType parameters
1493         https://bugs.webkit.org/show_bug.cgi?id=144689
1494
1495         Reviewed by Darin Adler.
1496
1497         Remove duplicated typename and ::type from AsyncRequestImpl related
1498         function parameters.
1499
1500         * Shared/AsyncRequest.h:
1501
1502 2015-05-06  Commit Queue  <commit-queue@webkit.org>
1503
1504         Unreviewed, rolling out r183894.
1505         https://bugs.webkit.org/show_bug.cgi?id=144719
1506
1507         crashes on mavericks (Requested by dino on #webkit).
1508
1509         Reverted changeset:
1510
1511         "Handle backdrop views that have to tile"
1512         https://bugs.webkit.org/show_bug.cgi?id=142317
1513         http://trac.webkit.org/changeset/183894
1514
1515 2015-05-06  Brady Eidson  <beidson@apple.com>
1516
1517         Addition review followup for:
1518         Crash executing null AsyncRequest in IDB code.
1519         <rdar://problem/18854856> and https://bugs.webkit.org/show_bug.cgi?id=144715
1520
1521         Reviewed by Darin Adler.
1522
1523         This patch adds a layer on top of the UniqueIDBDatabase request map to catch this coding mistake in the future. 
1524  
1525          * DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:
1526         (WebKit::UniqueIDBDatabase::didCompleteBoolRequest): Get rid of the ASSERT and the temporary variable,
1527           make it a single line which reads better.
1528         (WebKit::UniqueIDBDatabase::didPutRecordInBackingStore): Ditto.
1529         (WebKit::UniqueIDBDatabase::didGetRecordFromBackingStore): Ditto.
1530         (WebKit::UniqueIDBDatabase::didOpenCursorInBackingStore): Ditto.
1531         (WebKit::UniqueIDBDatabase::didAdvanceCursorInBackingStore): Ditto.
1532         (WebKit::UniqueIDBDatabase::didIterateCursorInBackingStore): Ditto.
1533         (WebKit::UniqueIDBDatabase::didCountInBackingStore): Ditto.
1534         (WebKit::UniqueIDBDatabase::didDeleteRangeInBackingStore): Ditto.
1535         * DatabaseProcess/IndexedDB/UniqueIDBDatabase.h: Ditto.
1536
1537         Add the class AsyncRequestMap which shadows a HashMap but does aggressive runtime checks
1538         in ::take() to make sure the same request was not dispatched twice in a row, and makes sure we
1539         never try to execute a null AsyncRequest by way of a RELEASE_ASSERT.
1540         * Shared/AsyncRequest.h:
1541         (WebKit::AsyncRequestMap::AsyncRequestMap):
1542         (WebKit::AsyncRequestMap::take):
1543         (WebKit::AsyncRequestMap::add):
1544         (WebKit::AsyncRequestMap::clear):
1545         (WebKit::AsyncRequestMap::values):
1546
1547 2015-05-06  Brady Eidson  <beidson@apple.com>
1548
1549         Crash executing null AsyncRequest in IDB code.
1550         <rdar://problem/18854856> and https://bugs.webkit.org/show_bug.cgi?id=144715
1551
1552         Reviewed by Darin Adler.
1553
1554         When UniqueIDBDatabase fails to execute an operation on the database work queue it usually
1555         dispatches an AsyncRequest ID back to the main thread with an error callback.
1556
1557         For two of its operations it would then also dispatch the success callback.
1558
1559         In those cases the main thread would first take the AsyncRequest for the error callback out
1560         of a map and then execute it.
1561
1562         It would then try to take the same AsyncRequest out of the map again, fail to do so, then
1563         execute a null AsyncRequest.
1564
1565         This patch fixes the two functions to not dispatch both an error and success callback.
1566
1567         * DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:
1568         (WebKit::UniqueIDBDatabase::countInBackingStore): Return after dispatching the error callback.
1569         (WebKit::UniqueIDBDatabase::deleteRangeInBackingStore): Ditto.
1570
1571 2015-05-06  Dean Jackson  <dino@apple.com>
1572
1573         Handle backdrop views that have to tile
1574         https://bugs.webkit.org/show_bug.cgi?id=142317
1575         <rdar://problem/20049088>
1576
1577         Reviewed by Simon Fraser.
1578
1579         Add some better logging for custom appearance.
1580
1581         * Shared/mac/RemoteLayerTreeTransaction.mm:
1582         (WebKit::RemoteLayerTreeTextStream::operator<<):
1583
1584 2015-05-06  Chris Dumez  <cdumez@apple.com>
1585
1586         Disable network cache efficacy logging
1587         https://bugs.webkit.org/show_bug.cgi?id=144703
1588         <rdar://problem/20439143>
1589
1590         Reviewed by Andreas Kling.
1591
1592         Disable network cache efficacy logging by default as we have sufficient
1593         data for now.
1594
1595         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1596         (WebKit::registerUserDefaultsIfNeeded):
1597
1598 2015-05-06  Timothy Horton  <timothy_horton@apple.com>
1599
1600         Fix the build.
1601
1602         * UIProcess/mac/WKViewLayoutStrategy.mm:
1603         (-[WKViewDynamicSizeWithMinimumViewSizeLayoutStrategy updateLayout]):
1604
1605 2015-05-06  Dan Bernstein  <mitz@apple.com>
1606
1607         No way to get a WKWebProcessPlugInFrame’s parent frame
1608         https://bugs.webkit.org/show_bug.cgi?id=144705
1609
1610         Reviewed by Sam Weinig.
1611
1612         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.mm:
1613         (-[WKWebProcessPlugInFrame _parentFrame]): Added this getter.
1614         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFramePrivate.h: Declared new
1615         _parentFrame property.
1616
1617 2015-05-06  Timothy Horton  <timothy_horton@apple.com>
1618
1619         Fix the build.
1620
1621         * UIProcess/mac/WKViewLayoutStrategy.mm:
1622         (-[WKViewDynamicSizeWithMinimumViewSizeLayoutStrategy updateLayout]):
1623
1624 2015-04-02  Myles C. Maxfield  <mmaxfield@apple.com>
1625
1626         Introducing the Platform Abstraction Layer (PAL)
1627         https://bugs.webkit.org/show_bug.cgi?id=143358
1628
1629         Reviewed by Simon Fraser.
1630
1631         * Configurations/FeatureDefines.xcconfig: Updated
1632
1633 2015-05-05  Carlos Garcia Campos  <cgarcia@igalia.com>
1634
1635         [GTK][WK2] The WebKit network disk cache is not enabled
1636         https://bugs.webkit.org/show_bug.cgi?id=142821
1637
1638         Reviewed by Martin Robinson.
1639
1640         Enable NetworkCache for the GTK+ port.
1641
1642         * config.h:
1643
1644 2015-05-06  Ryuan Choi  <ryuan.choi@navercorp.com>
1645
1646         [EFL] Remove redudant condition in ViewClientEfl::didChangeViewportAttributes
1647         https://bugs.webkit.org/show_bug.cgi?id=144672
1648
1649         Reviewed by Gyuyoung Kim.
1650
1651         ViewClientEfl::didChangeViewportAttributes is always called when fixed layout is disabled.
1652
1653         * UIProcess/efl/ViewClientEfl.cpp:
1654         (WebKit::ViewClientEfl::didChangeViewportAttributes):
1655         Removes condition that checks whether fixed layout is enabled.
1656
1657 2015-05-05  Alexey Proskuryakov  <ap@apple.com>
1658
1659         NetworkResourceLoader::cleanup() should clear ResourceHandle client pointer.
1660         https://bugs.webkit.org/show_bug.cgi?id=144641
1661         rdar://problem/20250960
1662
1663         Reviewed by David Kilzer.
1664
1665         * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::cleanup):
1666         Clear the client pointer.
1667
1668         * Shared/Authentication/AuthenticationManager.cpp:
1669         (WebKit::AuthenticationManager::useCredentialForChallenge):
1670         (WebKit::AuthenticationManager::continueWithoutCredentialForChallenge):
1671         (WebKit::AuthenticationManager::cancelChallenge):
1672         (WebKit::AuthenticationManager::performDefaultHandling):
1673         (WebKit::AuthenticationManager::rejectProtectionSpaceAndContinue):
1674         Updated comments, which were not accurate, at least on Mac.
1675
1676 2015-05-05  Tim Horton  <timothy_horton@apple.com>
1677
1678         Views get stuck with viewScale < 1 after switching from DynamicSizeWithMinimumViewSize to ViewSize
1679         https://bugs.webkit.org/show_bug.cgi?id=144656
1680
1681         Reviewed by Dan Bernstein.
1682
1683         * UIProcess/mac/WKViewLayoutStrategy.mm:
1684         (-[WKViewDynamicSizeWithMinimumViewSizeLayoutStrategy willChangeLayoutStrategy]):
1685         Reset the viewScale when we leave the DynamicSizeWithMinimumViewSize strategy.
1686
1687 2015-05-05  Tim Horton  <timothy_horton@apple.com>
1688
1689         Fix the build.
1690
1691         * Platform/mac/LayerHostingContext.mm:
1692         (WebKit::LayerHostingContext::setFencePort):
1693
1694 2015-05-05  Tim Horton  <timothy_horton@apple.com>
1695
1696         Fix the build.
1697
1698         * UIProcess/mac/WKViewLayoutStrategy.mm:
1699         (-[WKViewDynamicSizeWithMinimumViewSizeLayoutStrategy updateLayout]):
1700
1701 2015-05-05  Timothy Horton  <timothy_horton@apple.com>
1702
1703         Add a layout mode for computing fixed layout size from a minimum size
1704         https://bugs.webkit.org/show_bug.cgi?id=144610
1705         <rdar://problem/19790341>
1706
1707         Reviewed by Simon Fraser.
1708
1709         Add a layout mode where WebKit determines the layout size with a set of
1710         (still in flux) heuristics, trying hard to keep the page usable below a
1711         particular client-defined threshold view size.
1712
1713         This can mean that WebKit will start scaling down the page inside the view
1714         to make the whole page fit, using the viewScale mechanism.
1715
1716         * UIProcess/API/C/WKLayoutMode.h:
1717         * UIProcess/API/Cocoa/_WKLayoutMode.h:
1718         Add the new layout mode, and documentation for the two complicated ones.
1719         
1720         * UIProcess/API/Cocoa/WKWebView.mm:
1721         (-[WKWebView _layoutMode]):
1722         (-[WKWebView _setLayoutMode:]):
1723         (-[WKWebView _setViewScale:]):
1724         (-[WKWebView _setMinimumViewSize:]):
1725         (-[WKWebView _minimumViewSize]):
1726         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1727         Forward the layoutMode and viewScale parameters to WKView if we have one.
1728
1729         * UIProcess/API/Cocoa/WKViewPrivate.h:
1730         * UIProcess/API/mac/WKView.mm:
1731         (-[WKView dealloc]):
1732         (-[WKView viewWillStartLiveResize]):
1733         (-[WKView viewDidEndLiveResize]):
1734         (-[WKView setFrameSize:]):
1735         (-[WKView initWithFrame:processPool:configuration:webView:]):
1736         (-[WKView disableFrameSizeUpdates]):
1737         (-[WKView enableFrameSizeUpdates]):
1738         (-[WKView frameSizeUpdatesDisabled]):
1739         (-[WKView _layoutMode]):
1740         (-[WKView _setLayoutMode:]):
1741         (-[WKView _setViewScale:]):
1742         (-[WKView _setMinimumViewSize:]):
1743         (-[WKView _minimumViewSize]):
1744         Store the minimum view size, and update the fixed layout size if needed.
1745
1746         (-[WKView _updateAutomaticallyComputedFixedLayoutSize]): Deleted.
1747         (-[WKView _setAutomaticallyComputesFixedLayoutSizeFromViewScale:]): Deleted.
1748         (-[WKView _automaticallyComputesFixedLayoutSizeFromViewScale]): Deleted.
1749         Store the WKLayoutMode on the WKViewLayoutStrategy instead of having a
1750         bunch of things like _automaticallyComputesFixedLayoutSizeFromViewScale.
1751
1752         * UIProcess/API/mac/WKViewInternal.h:
1753
1754         * UIProcess/mac/WKViewLayoutStrategy.h: Added.
1755         * UIProcess/mac/WKViewLayoutStrategy.mm: Added.
1756         (+[WKViewLayoutStrategy layoutStrategyWithPage:view:mode:]):
1757         (-[WKViewLayoutStrategy initWithPage:view:mode:]):
1758         (-[WKViewLayoutStrategy willDestroyView:]):
1759         (-[WKViewLayoutStrategy layoutMode]):
1760         (-[WKViewLayoutStrategy updateLayout]):
1761         (-[WKViewLayoutStrategy disableFrameSizeUpdates]):
1762         (-[WKViewLayoutStrategy enableFrameSizeUpdates]):
1763         (-[WKViewLayoutStrategy frameSizeUpdatesDisabled]):
1764         (-[WKViewLayoutStrategy didChangeViewScale]):
1765         (-[WKViewLayoutStrategy didChangeMinimumViewSize]):
1766         (-[WKViewLayoutStrategy willStartLiveResize]):
1767         (-[WKViewLayoutStrategy didEndLiveResize]):
1768         (-[WKViewLayoutStrategy didChangeFrameSize]):
1769         (-[WKViewLayoutStrategy willChangeLayoutStrategy]):
1770         (-[WKViewViewSizeLayoutStrategy initWithPage:view:mode:]):
1771         (-[WKViewViewSizeLayoutStrategy updateLayout]):
1772         (-[WKViewFixedSizeLayoutStrategy initWithPage:view:mode:]):
1773         (-[WKViewFixedSizeLayoutStrategy updateLayout]):
1774         (-[WKViewDynamicSizeComputedFromViewScaleLayoutStrategy initWithPage:view:mode:]):
1775         (-[WKViewDynamicSizeComputedFromViewScaleLayoutStrategy updateLayout]):
1776         (-[WKViewDynamicSizeComputedFromViewScaleLayoutStrategy didChangeViewScale]):
1777         (-[WKViewDynamicSizeComputedFromViewScaleLayoutStrategy didChangeFrameSize]):
1778         Move the existing layout strategies from WKView into WKViewLayoutStrategy subclasses.
1779
1780         (-[WKViewDynamicSizeWithMinimumViewSizeLayoutStrategy initWithPage:view:mode:]):
1781         (-[WKViewDynamicSizeWithMinimumViewSizeLayoutStrategy updateLayout]):
1782         (-[WKViewDynamicSizeWithMinimumViewSizeLayoutStrategy didChangeMinimumViewSize]):
1783         (-[WKViewDynamicSizeWithMinimumViewSizeLayoutStrategy willStartLiveResize]):
1784         (-[WKViewDynamicSizeWithMinimumViewSizeLayoutStrategy didEndLiveResize]):
1785         While in live resize with the new layout mode, disable frame size updates.
1786         The new layout mode will do a live scale during part of the resize, and
1787         we don't always want to send the new view size to the Web process.
1788
1789         (-[WKViewDynamicSizeWithMinimumViewSizeLayoutStrategy didChangeFrameSize]):
1790         (-[WKViewDynamicSizeWithMinimumViewSizeLayoutStrategy willChangeLayoutStrategy]):
1791         While in the new layout mode, maintain the viewScale as the minimum of the
1792         scale required to fit the current view frame size inside the minimumViewSize.
1793         If no scaling is required, carry on as usual, pushing the new view frame size
1794         to the DrawingArea and on to the Web process.
1795         If scaling is required, apply a transform to the view in the UI process,
1796         until the live resize completes, in which case we send a fenced viewScale
1797         adjustment to the Web process (so that the tiles paint at the new viewScale
1798         synchronized with the removal of the transform in the UI process).
1799
1800         * UIProcess/WebPageProxy.cpp:
1801         (WebKit::WebPageProxy::scaleViewFenced):
1802         * UIProcess/WebPageProxy.h:
1803         * WebProcess/WebPage/DrawingArea.h:
1804         (WebKit::DrawingArea::addFence):
1805         (WebKit::DrawingArea::acceleratedAnimationDidEnd): Deleted.
1806         * WebProcess/WebPage/WebPage.cpp:
1807         (WebKit::WebPage::scaleViewAndUpdateGeometryFenced):
1808         * WebProcess/WebPage/WebPage.h:
1809         * WebProcess/WebPage/WebPage.messages.in:
1810         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
1811         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
1812         (WebKit::TiledCoreAnimationDrawingArea::addFence):
1813         Add scaleViewAndUpdateGeometryFenced and the ability to install CoreAnimation fences on
1814         TiledCoreAnimationDrawingArea's CAContext.
1815
1816         Add the ability to send updateGeometry out-of-band, so that
1817         we can send it synchronously inside the message along with the CA fence.
1818         We have to both change the viewScale and updateGeometry simultaneously
1819         in the same CA commit that we install the fence into, in order to ensure
1820         that there is no flash.
1821
1822 2015-05-05  Alex Christensen  <achristensen@webkit.org>
1823
1824         [Content Extensions] Release input NSString when finished copying it.
1825         https://bugs.webkit.org/show_bug.cgi?id=144642
1826
1827         Reviewed by Brian Weinstein.
1828
1829         * UIProcess/API/Cocoa/_WKUserContentExtensionStore.h:
1830         * UIProcess/API/Cocoa/_WKUserContentExtensionStore.mm:
1831         (-[_WKUserContentExtensionStore compileContentExtensionForIdentifier:encodedContentExtension:completionHandler:]):
1832
1833 2015-05-05  Alex Christensen  <achristensen@webkit.org>
1834
1835         [Content Extensions] Use less memory to store the json input.
1836         https://bugs.webkit.org/show_bug.cgi?id=144604
1837
1838         Reviewed by Benjamin Poulain.
1839
1840         * UIProcess/API/APIUserContentExtensionStore.cpp:
1841         (API::compiledToFile):
1842         (API::UserContentExtensionStore::compileContentExtension):
1843         * UIProcess/API/APIUserContentExtensionStore.h:
1844         Don't copy strings as much or keep them alive after done using them.
1845
1846 2015-05-04  Alex Christensen  <achristensen@webkit.org>
1847
1848         [Content Extensions] Use less memory when writing byte code to file
1849         https://bugs.webkit.org/show_bug.cgi?id=144602
1850
1851         Reviewed by Darin Adler.
1852
1853         * UIProcess/API/APIUserContentExtensionStore.cpp:
1854         (API::decodeContentExtensionMetaData):
1855         (API::writeDataToFile):
1856         (API::compiledToFile):
1857         (API::createExtension):
1858         Compile and write each DFA to file, then come back and write the header when finalizing.
1859         Also don't copy the DFA bytecode. This way, we don't need to keep more than one DFA's
1860         bytecode in memory at a time.
1861
1862 2015-05-05  Sungmann Cho  <sungmann.cho@navercorp.com>
1863
1864         Make all FrameLoadState data members private.
1865         https://bugs.webkit.org/show_bug.cgi?id=144562
1866
1867         Reviewed by Darin Adler.
1868
1869         Previously, all of the data members in FrameLoadState were public and accessed directly
1870         from outside the class. But these should all be private as noted in FrameLoadState.h
1871         for better encapsulation.
1872
1873         No new tests, no behavior change.
1874
1875         * UIProcess/API/C/WKFrame.cpp:
1876         (WKFrameGetFrameLoadState):
1877         * UIProcess/FrameLoadState.h:
1878         (WebKit::FrameLoadState::state):
1879         (WebKit::FrameLoadState::url):
1880         (WebKit::FrameLoadState::provisionalURL):
1881         (WebKit::FrameLoadState::unreachableURL):
1882         * UIProcess/WebFrameProxy.h:
1883         (WebKit::WebFrameProxy::url):
1884         (WebKit::WebFrameProxy::provisionalURL):
1885         (WebKit::WebFrameProxy::unreachableURL):
1886
1887 2015-05-05  Alexey Proskuryakov  <ap@apple.com>
1888
1889         Crashes in SandboxExtension::consumePermanently when uploading
1890         https://bugs.webkit.org/show_bug.cgi?id=144611
1891         rdar://problem/10156710
1892
1893         Reviewed by Darin Adler.
1894
1895         This only fixes the crashes, uploading still won't work.
1896         Added null checks and some logging that may help us get to the root cause eventually.
1897
1898         * Shared/SandboxExtension.h:
1899         (WebKit::SandboxExtension::createHandle):
1900         (WebKit::SandboxExtension::createHandleForReadWriteDirectory):
1901         * Shared/mac/SandboxExtensionMac.mm:
1902         (WebKit::SandboxExtension::createHandle):
1903         (WebKit::SandboxExtension::createHandleForReadWriteDirectory):
1904         * UIProcess/WebPageProxy.cpp:
1905         (WebKit::WebPageProxy::didChooseFilesForOpenPanel):
1906         * WebProcess/WebPage/WebPage.cpp:
1907         (WebKit::WebPage::extendSandboxForFileFromOpenPanel):
1908
1909 2015-05-05  Csaba Osztrogonác  <ossy@webkit.org>
1910
1911         Remove TextureMapperImageBuffer
1912         https://bugs.webkit.org/show_bug.cgi?id=143561
1913
1914         Reviewed by Žan Doberšek.
1915
1916         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
1917         (WebKit::CoordinatedGraphicsScene::paintToCurrentGLContext):
1918         * WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp:
1919         (WebKit::LayerTreeHostGtk::setNativeSurfaceHandleForCompositing):
1920
1921 2015-05-05  Carlos Garcia Campos  <cgarcia@igalia.com>
1922
1923         [SOUP] Network Cache: IOChannel operations are not sent to the right thread
1924         https://bugs.webkit.org/show_bug.cgi?id=144542
1925
1926         Reviewed by Darin Adler.
1927
1928         We are ignoring the given WorkQueue and running the async
1929         operations in the current thread. Check the given WorkQueue
1930         instead and schedule the operation to the given queue. If the
1931         given queue is nullptr, which means the operation should be run in
1932         the main context, the operation is run directly if the current
1933         context is the main one or sent to the main context using a
1934         GMainLoopSource.
1935
1936         Fixes crashes due to asserts when running disk-cache layout tests
1937         in a Debug build.
1938
1939         * NetworkProcess/cache/NetworkCacheIOChannel.h:
1940         * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:
1941         (WebKit::NetworkCache::runTaskInQueue):
1942         (WebKit::NetworkCache::IOChannel::read):
1943         (WebKit::NetworkCache::IOChannel::readSync):
1944         (WebKit::NetworkCache::IOChannel::write):
1945
1946 2015-05-04  Dan Bernstein  <mitz@apple.com>
1947
1948         WebKit always goes through LaunchServices for main frame navigation actions
1949         https://bugs.webkit.org/show_bug.cgi?id=144608
1950
1951         Reviewed by Tim Horton.
1952
1953         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h: Defined
1954         _WKNavigationActionPolicyAllowWithoutTryingAppLink.
1955         * UIProcess/Cocoa/NavigationState.mm:
1956         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction): If the policy
1957         is _WKNavigationActionPolicyAllowWithoutTryingAppLink, don’t go through tryAppLink.
1958
1959 2015-05-04  Enrica Casucci  <enrica@apple.com>
1960
1961         [iOS WK2] editorState should include information about selection clipping rectangle.
1962         https://bugs.webkit.org/show_bug.cgi?id=144603
1963         rdar://problem/20521252
1964
1965         Reviewed by Chris Dumez.
1966
1967         Adding selectionClipRect to the post-layout portion of EditorState.
1968         This way we can compute the selection clipping rectangle based on
1969         up-to-date information instead of using the rectangle provided when
1970         then element was first focused.
1971
1972         * Shared/EditorState.cpp:
1973         (WebKit::EditorState::PostLayoutData::encode):
1974         (WebKit::EditorState::PostLayoutData::decode):
1975         * Shared/EditorState.h:
1976         * UIProcess/ios/WKContentViewInteraction.mm:
1977         (-[WKContentView _selectionClipRect]):
1978         * WebProcess/WebPage/ios/WebPageIOS.mm:
1979         (WebKit::WebPage::platformEditorState):
1980
1981 2015-05-04  Antti Koivisto  <antti@apple.com>
1982
1983         Network Cache: Support time based cache clearing
1984         https://bugs.webkit.org/show_bug.cgi?id=144568
1985         <rdar://problem/19769820>
1986
1987         Reviewed by Andreas Kling.
1988
1989         Support clearing cache entries newer than given time only.
1990
1991         * NetworkProcess/cache/NetworkCache.cpp:
1992         (WebKit::NetworkCache::Cache::deleteDumpFile):
1993         (WebKit::NetworkCache::Storage::traverse):
1994
1995             Also fix thread safety of traverse handler function.
1996
1997         (WebKit::NetworkCache::Cache::clear):
1998
1999             Also add completion handler to support the API properly.
2000
2001         * NetworkProcess/cache/NetworkCache.h:
2002         * NetworkProcess/cache/NetworkCacheStorage.cpp:
2003         (WebKit::NetworkCache::Storage::clear):
2004         * NetworkProcess/cache/NetworkCacheStorage.h:
2005         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
2006         (WebKit::clearNSURLCache):
2007
2008             Factor to a function.
2009
2010         (WebKit::NetworkProcess::clearDiskCache):
2011
2012 2015-05-04  Zan Dobersek  <zdobersek@igalia.com>
2013
2014         [WTF] Remove Functional.h inclusions
2015         https://bugs.webkit.org/show_bug.cgi?id=144400
2016
2017         Reviewed by Darin Adler.
2018
2019         Remove unnecessary inclusions of the <wtf/Functional.h> header in WebKit2.
2020
2021         * Platform/IPC/unix/ConnectionUnix.cpp:
2022         * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm: Import the <objc/runtime.h>
2023         header that was previously indirectly included through the Functional.h header.
2024         * WebProcess/WebPage/DrawingArea.cpp:
2025
2026 2015-05-04  Csaba Osztrogonác  <ossy@webkit.org>
2027
2028         [ARM] Don't compare unsigned chars to EOF (-1)
2029         https://bugs.webkit.org/show_bug.cgi?id=144439
2030
2031         Reviewed by Geoffrey Garen.
2032
2033         * Shared/linux/WebMemorySamplerLinux.cpp:
2034         (WebKit::nextToken): Don't cast return value of fgetc() to char.
2035
2036 2015-05-04  Antti Koivisto  <antti@apple.com>
2037
2038         Remove NetworkResourceLoadScheduler
2039         https://bugs.webkit.org/show_bug.cgi?id=144550
2040
2041         Reviewed by Sam Weinig.
2042
2043         It doesn't really do anything.
2044
2045         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2046         (WebKit::NetworkConnectionToWebProcess::scheduleResourceLoad):
2047         (WebKit::NetworkConnectionToWebProcess::performSynchronousLoad):
2048         * NetworkProcess/NetworkProcess.cpp:
2049         (WebKit::NetworkProcess::getNetworkProcessStatistics):
2050         * NetworkProcess/NetworkProcess.h:
2051         (WebKit::NetworkProcess::networkResourceLoadScheduler): Deleted.
2052         * NetworkProcess/NetworkResourceLoadScheduler.cpp: Removed.
2053         * NetworkProcess/NetworkResourceLoadScheduler.h: Removed.
2054         * NetworkProcess/NetworkResourceLoader.cpp:
2055         (WebKit::NetworkResourceLoader::cleanup):
2056         * NetworkProcess/NetworkResourceLoader.h:
2057         (WebKit::NetworkResourceLoader::create):
2058         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
2059         (WebKit::initializeNetworkSettings):
2060
2061             Moved from NetworkResourceLoadSchedulerMac.mm.
2062
2063         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
2064         * NetworkProcess/mac/NetworkResourceLoadSchedulerMac.mm: Removed.
2065         * NetworkProcess/soup/NetworkResourceLoadSchedulerSoup.cpp: Removed.
2066         * WebKit2.xcodeproj/project.pbxproj:
2067
2068 2015-05-03  Alexey Proskuryakov  <ap@apple.com>
2069
2070         Crash in SandboxExtension::consume when uploading iWork -tef documents to iCloud
2071         https://bugs.webkit.org/show_bug.cgi?id=144509
2072         rdar://problem/18731910
2073
2074         Reviewed by Daniel Bates.
2075
2076         No test, because testRunner.beginDragWithFiles doesn't work in WKTR, and making
2077         it work is hard.
2078
2079         * Shared/BlobDataFileReferenceWithSandboxExtension.cpp:
2080         (WebKit::BlobDataFileReferenceWithSandboxExtension::prepareForFileAccess):
2081         (WebKit::BlobDataFileReferenceWithSandboxExtension::revokeFileAccess):
2082
2083 2015-05-03  Carlos Garcia Campos  <cgarcia@igalia.com>
2084
2085         [GTK][EFL] Unify platform display handling
2086         https://bugs.webkit.org/show_bug.cgi?id=144517
2087
2088         Reviewed by Martin Robinson.
2089
2090         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
2091         (webkitWebViewBaseRealize): Use PlatformDisplay::sharedDisplay()
2092         to checkt the display type.
2093         (webkitWebViewBaseCreateWebPage): Ditto.
2094         * UIProcess/cairo/BackingStoreCairo.cpp:
2095         (WebKit::BackingStore::createBackend): Pass the native X11 shared
2096         display to BackingStoreBackendCairoX11.
2097         * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:
2098         (WebKit::NetscapePlugin::x11HostDisplay): Return the native X11
2099         shared display.
2100
2101 2015-05-03  Carlos Garcia Campos  <cgarcia@igalia.com>
2102
2103         Unreviewed. Fix Debug build with NETWORK_CACHE enabled and CACHE_PARTITIONING disabled.
2104
2105         * NetworkProcess/cache/NetworkCache.cpp:
2106         (WebKit::NetworkCache::Cache::store):
2107
2108 2015-05-01  Dan Bernstein  <mitz@apple.com>
2109
2110         WebKit2 part of <rdar://problem/8636045> Back/forward navigation to an error page in Safari breaks the back-forward list
2111         https://bugs.webkit.org/show_bug.cgi?id=144501
2112
2113         Reviewed by Darin Adler.
2114
2115         * UIProcess/WebPageProxy.cpp:
2116         (WebKit::WebPageProxy::loadAlternateHTMLString): If this is called during
2117         didFailProvisionalLoadForFrame, send back the provisional URL captured at the time of
2118         failure.
2119         (WebKit::WebPageProxy::didFailProvisionalLoadForFrame): Get the provisioinal URL and keep
2120         it in new member variable m_failingProvisionalLoadURL for the duration of the client’s
2121         handling of this message.
2122         * UIProcess/WebPageProxy.h:
2123
2124         * UIProcess/WebPageProxy.messages.in: Added provisionalURL parameter to
2125         DidFailProvisionalLoadForFrame.
2126
2127         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2128         (WebKit::WebFrameLoaderClient::dispatchDidFailProvisionalLoad): Send the URL for this error
2129         to the UI process.
2130
2131         * WebProcess/WebPage/WebPage.cpp:
2132         (WebKit::WebPage::loadAlternateHTMLString): Temporarily restore the loader’s state to
2133         reflect the provisional load error being handled.
2134
2135         * WebProcess/WebPage/WebPage.h:
2136         * WebProcess/WebPage/WebPage.messages.in: Added provisionalLoadErrorURL parameter to
2137         LoadAlternateHTMLString.
2138
2139 2015-05-01  Martin Robinson  <mrobinson@igalia.com>
2140
2141         USE(...) macro should expect unprefixed variables
2142         https://bugs.webkit.org/show_bug.cgi?id=144454
2143
2144         Reviewed by Daniel Bates.
2145
2146         * Shared/API/c/WKBase.h: Replace all occurrences WTF_USE with USE.
2147         * WebKit2.xcodeproj/project.pbxproj: Ditto.
2148
2149 2015-05-01  Brady Eidson  <beidson@apple.com>
2150
2151         Add API to disable meta refreshes.
2152         <rdar://problem/20333198> and https://bugs.webkit.org/show_bug.cgi?id=144269
2153
2154         Reviewed by Alexey Proskuryakov.
2155
2156         Add a preference to enable/disable meta refreshes, enabled by default.
2157
2158         * Shared/WebPreferencesDefinitions.h:
2159         * UIProcess/API/C/WKPreferences.cpp:
2160         (WKPreferencesSetMetaRefreshEnabled):
2161         (WKPreferencesGetMetaRefreshEnabled):
2162         (WKPreferencesGetIgnoreViewportScalingConstraints): Deleted.
2163         * UIProcess/API/C/WKPreferencesRefPrivate.h:
2164         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2165         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
2166         * WebProcess/WebPage/WebPage.cpp:
2167         (WebKit::WebPage::updatePreferences):
2168
2169 2015-05-01  Antti Koivisto  <antti@apple.com>
2170
2171         Remove network process load serialization code
2172         https://bugs.webkit.org/show_bug.cgi?id=144448
2173
2174         Reviewed by Alexey Proskuryakov.
2175
2176         TestRunner.setSerializeHTTPLoads is used by a few tests but it is unnecessary
2177         with network process. We don't reorder loads anyway so test results are consistent.
2178         There or no other clients for this code.
2179
2180         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2181         (WebKit::NetworkConnectionToWebProcess::NetworkConnectionToWebProcess):
2182         (WebKit::NetworkConnectionToWebProcess::setSerialLoadingEnabled): Deleted.
2183         * NetworkProcess/NetworkConnectionToWebProcess.h:
2184         (WebKit::NetworkConnectionToWebProcess::isSerialLoadingEnabled): Deleted.
2185         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
2186         * NetworkProcess/NetworkProcess.cpp:
2187         (WebKit::NetworkProcess::getNetworkProcessStatistics):
2188         * NetworkProcess/NetworkResourceLoadScheduler.cpp:
2189         (WebKit::NetworkResourceLoadScheduler::scheduleLoader):
2190         (WebKit::NetworkResourceLoadScheduler::removeLoader):
2191         (WebKit::NetworkResourceLoadScheduler::loadsPendingCount): Deleted.
2192         * NetworkProcess/NetworkResourceLoadScheduler.h:
2193         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
2194         (WKBundleSetTabKeyCyclesThroughElements):
2195         (WKBundleSetSerialLoadingEnabled): Deleted.
2196         (WKBundleDispatchPendingLoadRequests): Deleted.
2197         * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
2198         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2199         (WebKit::InjectedBundle::setSerialLoadingEnabled): Deleted.
2200         (WebKit::InjectedBundle::dispatchPendingLoadRequests): Deleted.
2201
2202             Remove also this as it does nothing.
2203
2204         * WebProcess/Network/WebResourceLoadScheduler.cpp:
2205         (WebKit::WebResourceLoadScheduler::WebResourceLoadScheduler):
2206         (WebKit::WebResourceLoadScheduler::suspendPendingRequests):
2207         (WebKit::WebResourceLoadScheduler::resumePendingRequests):
2208
2209             Remove implementation, it does nothing.
2210
2211         (WebKit::WebResourceLoadScheduler::setSerialLoadingEnabled):
2212         * WebProcess/Network/WebResourceLoadScheduler.h:
2213
2214 2015-04-30  Timothy Horton  <timothy_horton@apple.com>
2215
2216         Remove long-deprecated unused WKView minimumLayoutWidth properties
2217         https://bugs.webkit.org/show_bug.cgi?id=144480
2218
2219         Reviewed by Alexey Proskuryakov.
2220
2221         * UIProcess/API/Cocoa/WKViewPrivate.h:
2222         * UIProcess/API/mac/WKView.mm:
2223         (-[WKView minimumLayoutWidth]): Deleted.
2224         (-[WKView setMinimumLayoutWidth:]): Deleted.
2225         (-[WKView minimumWidthForAutoLayout]): Deleted.
2226         (-[WKView setMinimumWidthForAutoLayout:]): Deleted.
2227         These were replaced with minimumSizeForAutoLayout long ago.
2228
2229 2015-04-30  Simon Fraser  <simon.fraser@apple.com>
2230
2231         Fixed elements end up in the middle of the view with pageScale < 1
2232         https://bugs.webkit.org/show_bug.cgi?id=144428
2233         rdar://problem/20404982
2234
2235         Reviewed by Tim Horton.
2236
2237         Encode/decode fixedElementsLayoutRelativeToFrame.
2238
2239         * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp:
2240         (ArgumentCoder<ScrollingStateFrameScrollingNode>::encode):
2241         (ArgumentCoder<ScrollingStateFrameScrollingNode>::decode):
2242
2243 2015-04-30  Tim Horton  <timothy_horton@apple.com>
2244
2245         Asynchronous (or timed-out synchronous) resize flashes white instead of page background color
2246         https://bugs.webkit.org/show_bug.cgi?id=144468
2247
2248         Reviewed by Simon Fraser and Dan Bernstein.
2249
2250         * UIProcess/API/mac/WKView.mm:
2251         (-[WKView _viewBackgroundColor]):
2252         (-[WKView updateLayer]):
2253         Use the pageExtendedBackgroundColor for the background color of the WKView,
2254         if we have one (and aren't using a transparent background). This means
2255         during asynchronous resize or other cases where the Web process isn't keeping
2256         up with the UI process during a resize, we'll see background color instead of white.
2257
2258 2015-04-30  Beth Dakin  <bdakin@apple.com>
2259
2260         Should choose UIScrollView indicatorStyle based on the document background color
2261         https://bugs.webkit.org/show_bug.cgi?id=144473
2262         -and corresponding-
2263         rdar://problem/19897699
2264
2265         Reviewed by Simon Fraser.
2266
2267         Update the indicator style whenever the background color changes.  
2268         * UIProcess/API/Cocoa/WKWebView.mm:
2269         (-[WKWebView _updateScrollViewBackground]):
2270
2271 2015-04-30  Enrica Casucci  <enrica@apple.com>
2272
2273         [iOS] tapping in the middle of a word in editable content should not select the word.
2274         https://bugs.webkit.org/show_bug.cgi?id=144421
2275         rdar://problem/20710948
2276
2277         Reviewed by Tim Horton.
2278
2279         Reverting to the original behavior.
2280
2281         * WebProcess/WebPage/ios/WebPageIOS.mm:
2282         (WebKit::WebPage::selectWithGesture):
2283
2284 2015-04-29  Hunseop Jeong  <hs85.jeong@samsung.com>
2285
2286         Fix the EFL build after r183595
2287         https://bugs.webkit.org/show_bug.cgi?id=144427
2288
2289         Reviewed by Gyuyoung Kim.
2290
2291         updateWheelEventTestTriggersIfNeeded() is guarded by #if ENABLE(CSS_SCROLL_SNAP) || ENABLE(RUBBER_BANDING).
2292
2293         * WebProcess/WebPage/EventDispatcher.cpp:
2294         (WebKit::updateWheelEventTestTriggersIfNeeded):
2295
2296 2015-04-29  Brent Fulgham  <bfulgham@apple.com>
2297
2298         Expand test infrastructure to support scrolling tests
2299         https://bugs.webkit.org/show_bug.cgi?id=143684
2300         <rdar://problem/20375516>
2301
2302         Reviewed by Simon Fraser.
2303
2304         Update test programs to activate (and deactivate) the new WheelEventTestTrigger logic.
2305
2306         * UIProcess/API/C/WKPage.cpp:
2307         (WKPageClearWheelEventTestTriggers): Added.
2308         * UIProcess/API/C/WKPage.h:
2309         * UIProcess/WebPageProxy.cpp:
2310         (WebKit::WebPageProxy::clearWheelEventTestTrigger): Added.
2311         * UIProcess/WebPageProxy.h:
2312         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
2313         (WKBundlePageStartMonitoringScrollOperations): Interact with WheelEventTestTrigger through
2314         the Page, rather than MainFrame.
2315         (WKBundlePageRegisterScrollOperationCompletionCallback): Ditto.
2316         * WebProcess/Plugins/PDF/PDFPlugin.mm:
2317         (WebKit::PDFPlugin::createScrollbar): Make sure scroll animator knows about any
2318         active test triggers.
2319         * WebPage/EventDispatcher.mm:
2320         (WebKit::EventDispatcher::wheelEvent): If the wheel event was passed to the scrolling thread,
2321         defer tests until a Scrolling Thread Sync has occurred.
2322         * WebPage/WebPage.cpp:
2323         (WebKit::WebPage::clearWheelEventTestTrigger): Added.
2324         * WebPage/WebPage.h:
2325         * WebPage/WebPage.message.in: Added ClearWheelEventTestTrigger message.
2326
2327 2015-04-29  Enrica Casucci  <enrica@apple.com>
2328
2329         Adding the ability to move selection by granularity on iOS.
2330         https://bugs.webkit.org/show_bug.cgi?id=144410
2331         rdar://problem/19213337
2332
2333         Reviewed by Benjamin Poulain.
2334
2335         This patch also correctly sets _usingGestureForSelection for all
2336         the functions that change the selection with a gesture.
2337         This way we make sure that the selection drawing is not delayed
2338         until the next time we paint.
2339
2340         * UIProcess/WebPageProxy.h:
2341         * UIProcess/ios/WKContentViewInteraction.mm:
2342         (-[WKContentView moveSelectionAtBoundary:inDirection:completionHandler:]):
2343         * UIProcess/ios/WebPageProxyIOS.mm:
2344         (WebKit::WebPageProxy::moveSelectionAtBoundaryWithDirection):
2345         * WebProcess/WebPage/WebPage.h:
2346         * WebProcess/WebPage/WebPage.messages.in:
2347         * WebProcess/WebPage/ios/WebPageIOS.mm:
2348         (WebKit::WebPage::moveSelectionAtBoundaryWithDirection):
2349
2350 2015-04-29  Tim Horton  <timothy_horton@apple.com>
2351
2352         UI process sometimes crashes under _takeViewSnapshot when the window is off-screen
2353         https://bugs.webkit.org/show_bug.cgi?id=144418
2354         <rdar://problem/20740278>
2355
2356         Reviewed by Alexey Proskuryakov.
2357
2358         * UIProcess/API/mac/WKView.mm:
2359         (-[WKView _takeViewSnapshot]):
2360         Null-check the array before checking if it has any items.
2361         If the window is off-screen, we can't snapshot it.
2362
2363 2015-04-29  Simon Fraser  <simon.fraser@apple.com>
2364
2365         Allow testing of plug-ins that handle wheel events.
2366         https://bugs.webkit.org/show_bug.cgi?id=144413
2367
2368         Reviewed by Tim Horton.
2369         
2370         Allow the Test Netscape Plug-in to pretend to handle wheel events,
2371         so layout tests can use it.
2372
2373         * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
2374         (WebKit::NetscapePluginModule::determineQuirks):
2375
2376 2015-04-29  Filip Pizlo  <fpizlo@apple.com>
2377
2378         JSTypeInfo should have an inline type flag to indicate if getCallData() has been overridden
2379         https://bugs.webkit.org/show_bug.cgi?id=144397
2380
2381         Reviewed by Andreas Kling.
2382
2383         If you override getCallData() and you want to be called a "function", then you need to use the
2384         new TypeOfShouldCallGetCallData flag.
2385
2386         * WebProcess/Plugins/Netscape/JSNPObject.h:
2387
2388 2015-04-29  Antti Koivisto  <antti@apple.com>
2389
2390         ResourceLoadPriority should be enum class
2391         https://bugs.webkit.org/show_bug.cgi?id=144326
2392
2393         Reviewed by Darin Adler.
2394
2395         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2396         (WebKit::NetworkConnectionToWebProcess::servePendingRequests): Deleted.
2397
2398             Remove this unused message.
2399
2400         * NetworkProcess/NetworkConnectionToWebProcess.h:
2401         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
2402         * NetworkProcess/cache/NetworkCache.cpp:
2403         (WebKit::NetworkCache::makeStoreDecision):
2404         (WebKit::NetworkCache::Cache::retrieve):
2405         * NetworkProcess/mac/NetworkResourceLoadSchedulerMac.mm:
2406         (WebKit::NetworkResourceLoadScheduler::platformInitializeNetworkSettings):
2407         * WebProcess/Network/WebResourceLoadScheduler.cpp:
2408         (WebKit::WebResourceLoadScheduler::servePendingRequests):
2409         * WebProcess/Network/WebResourceLoadScheduler.h:
2410
2411 2015-04-29  Myles C. Maxfield  <mmaxfield@apple.com>
2412
2413         [OS X] Use CTFontCreateForCSS instead of doing font search ourselves
2414         https://bugs.webkit.org/show_bug.cgi?id=132159
2415
2416         Reviewed by Darin Adler.
2417
2418         Add SPI to set the font whitelist.
2419
2420         * Shared/WebProcessCreationParameters.cpp:
2421         (WebKit::WebProcessCreationParameters::encode):
2422         (WebKit::WebProcessCreationParameters::decode):
2423         * Shared/WebProcessCreationParameters.h:
2424         * UIProcess/API/C/WKContext.cpp:
2425         (WKContextSetFontWhitelist):
2426         * UIProcess/API/C/WKContextPrivate.h:
2427         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2428         (WebKit::WebProcessPool::platformInitializeWebProcess):
2429         * UIProcess/WebProcessPool.cpp:
2430         (WebKit::WebProcessPool::setFontWhitelist):
2431         * UIProcess/WebProcessPool.h:
2432         * WebProcess/cocoa/WebProcessCocoa.mm:
2433         (WebKit::WebProcess::platformInitializeWebProcess):
2434
2435 2015-04-29  Martin Robinson  <mrobinson@igalia.com>
2436
2437         [CMake] [GTK] Organize and clean up unused CMake variables
2438         https://bugs.webkit.org/show_bug.cgi?id=144364
2439
2440         Reviewed by Gyuyoung Kim.
2441
2442         * PlatformGTK.cmake: Add variables specific to this project.
2443         * webkit2gtk-web-extension.pc.in: Hardcode the GTK+ API version. It rarely changes.
2444         * webkit2gtk.pc.in: Ditto.
2445
2446 2015-04-29  Carlos Garcia Campos  <cgarcia@igalia.com>
2447
2448         REGRESSION(r182573): [GTK] The default context menu contains an empty item since r182573
2449         https://bugs.webkit.org/show_bug.cgi?id=144388
2450
2451         Reviewed by Brady Eidson.
2452
2453         Move the WebContextMenuClient::shareMenuItem() implementation to
2454         platform files, since platforms not supporting share menu item
2455         should return a null ContextMenuIem instead.
2456
2457         * WebProcess/WebCoreSupport/WebContextMenuClient.cpp:
2458         (WebKit::WebContextMenuClient::shareMenuItem): Deleted.
2459         * WebProcess/WebCoreSupport/efl/WebContextMenuClientEfl.cpp:
2460         (WebKit::WebContextMenuClient::shareMenuItem):
2461         * WebProcess/WebCoreSupport/gtk/WebContextMenuClientGtk.cpp:
2462         (WebKit::WebContextMenuClient::shareMenuItem):
2463         * WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm:
2464         (WebKit::WebContextMenuClient::shareMenuItem):
2465
2466 2015-04-29  Carlos Garcia Campos  <cgarcia@igalia.com>
2467
2468         REGRESSION(r183467): [SOUP] isMainResource is no longer passed as resource load parameters to the network process
2469         https://bugs.webkit.org/show_bug.cgi?id=144381
2470
2471         Reviewed by Darin Adler.
2472
2473         A requester enum value is passed now as part of the
2474         ResourceRequest, but it's not encoded/decoded for soup.
2475
2476         * Shared/soup/WebCoreArgumentCodersSoup.cpp:
2477         (IPC::ArgumentCoder<ResourceRequest>::encodePlatformData): Encode requester.
2478         (IPC::ArgumentCoder<ResourceRequest>::decodePlatformData): Decode requester.
2479
2480 2015-04-28  Carlos Garcia Campos  <cgarcia@igalia.com>
2481
2482         [SOUP] Use xattrs to get/set the creation time of disk cache files
2483         https://bugs.webkit.org/show_bug.cgi?id=144251
2484
2485         Reviewed by Martin Robinson.
2486
2487         The network process disk cache uses the creation time to compute a
2488         worth value used to determine the order in which cached resources
2489         are deleted when the cache is shrunk. In some operating systems
2490         like Linux there's no st_birthtime in struct stat, but since cache
2491         files are always created and deleted by us, we could use a custom
2492         xattr to store and retrieve the creation time of cached resources.
2493
2494         * NetworkProcess/cache/NetworkCacheFileSystemPosix.h:
2495         (WebKit::NetworkCache::fileTimes):
2496         * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:
2497         (WebKit::NetworkCache::IOChannel::IOChannel):
2498
2499 2015-04-28  Carlos Garcia Campos  <cgarcia@igalia.com>
2500
2501         Network Cache: Do not create a SharedBuffer for mapped resources unless explicitly requested
2502         https://bugs.webkit.org/show_bug.cgi?id=144337
2503
2504         Reviewed by Antti Koivisto.
2505
2506         We send a buffer or a memory mapped handler to the web process
2507         depending on whether the resource body is mapped or not, but we
2508         are always creating a shared buffer even for mapped resources.
2509         Split initializeBufferFromStorageRecord() moving the mapped memory
2510         handler initialization to its own method.
2511
2512         * NetworkProcess/cache/NetworkCacheEntry.cpp:
2513         (WebKit::NetworkCache::Entry::initializeShareableResourceHandleFromStorageRecord):
2514         Initialize the mapped memory handler if the body data is mapped.
2515         (WebKit::NetworkCache::Entry::initializeBufferFromStorageRecord):
2516         Initialize the buffer by wrapping the mapped memory if the body
2517         data is mapped, or using the body data directly otherwise.
2518         (WebKit::NetworkCache::Entry::shareableResourceHandle): Call
2519         initializeShareableResourceHandleFromStorageRecord() if the
2520         handler is null.
2521         * NetworkProcess/cache/NetworkCacheEntry.h:
2522
2523 2015-04-28  Simon Fraser  <simon.fraser@apple.com>
2524
2525         Make a non-static version of FrameView::yPositionForRootContentLayer()
2526         https://bugs.webkit.org/show_bug.cgi?id=144375
2527
2528         Reviewed by Andy Estes.
2529
2530         There were two calls to the static FrameView::yPositionForRootContentLayer()
2531         which passed in all the arguments for the same FrameView. Make a member
2532         function for convenience.
2533
2534         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
2535         (WebKit::shadowLayerPositionForFrame):
2536
2537 2015-04-28  Ryuan Choi  <ryuan.choi@navercorp.com>
2538
2539         [CoordinatedGraphics] Merge TILED_BACKING_STORE guard with COORDINATED_GRAPHICS
2540         https://bugs.webkit.org/show_bug.cgi?id=143001
2541
2542         Reviewed by Gyuyoung Kim.
2543
2544         * UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.cpp:
2545         (WebKit::CoordinatedLayerTreeHostProxy::commitCoordinatedGraphicsState):
2546         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2547         (WebKit::WebChromeClient::dispatchViewportPropertiesDidChange):
2548         * WebProcess/WebCoreSupport/WebChromeClient.h:
2549         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2550         (WebKit::WebFrameLoaderClient::dispatchDidLayout):
2551         (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage):
2552         * WebProcess/WebPage/WebPage.cpp:
2553         (WebKit::WebPage::setSize):
2554         (WebKit::WebPage::setUseFixedLayout):
2555         (WebKit::WebPage::canHandleUserEvents):
2556         * WebProcess/WebPage/WebPage.h:
2557
2558 2015-04-28  Timothy Horton  <timothy_horton@apple.com>
2559
2560         [TextIndicator] Yellow highlight takes too long to fade out on scroll
2561         https://bugs.webkit.org/show_bug.cgi?id=144358
2562         <rdar://problem/19451011>
2563
2564         Reviewed by Beth Dakin.
2565
2566         * UIProcess/API/Cocoa/WKViewPrivate.h:
2567         * UIProcess/API/mac/WKView.mm:
2568         (-[WKView renewGState]):
2569         (-[WKView viewDidMoveToWindow]):
2570         (-[WKView _dictionaryLookupPopoverWillClose:]):
2571         (-[WKView _setTextIndicator:]):
2572         (-[WKView _setTextIndicator:withLifetime:]):
2573         (-[WKView _clearTextIndicatorWithAnimation:]):
2574         (-[WKView magnifyWithEvent:]):
2575         (-[WKView smartMagnifyWithEvent:]):
2576         (-[WKView setMagnification:centeredAtPoint:]):
2577         (-[WKView setMagnification:]):
2578         (-[WKView _dismissContentRelativeChildWindows]):
2579         (-[WKView _dismissContentRelativeChildWindowsWithAnimation:]):
2580         (-[WKView _setTextIndicator:fadeOut:]): Deleted.
2581         * UIProcess/API/mac/WKViewInternal.h:
2582         * UIProcess/PageClient.h:
2583         * UIProcess/WebPageProxy.cpp:
2584         (WebKit::WebPageProxy::pageDidScroll):
2585         (WebKit::WebPageProxy::setTextIndicator):
2586         (WebKit::WebPageProxy::clearTextIndicator):
2587         * UIProcess/WebPageProxy.h:
2588         * UIProcess/WebPageProxy.messages.in:
2589         * UIProcess/ios/PageClientImplIOS.h:
2590         * UIProcess/ios/PageClientImplIOS.mm:
2591         (WebKit::PageClientImpl::setTextIndicator):
2592         (WebKit::PageClientImpl::clearTextIndicator):
2593         * UIProcess/mac/PageClientImpl.h:
2594         * UIProcess/mac/PageClientImpl.mm:
2595         (WebKit::PageClientImpl::setTextIndicator):
2596         (WebKit::PageClientImpl::clearTextIndicator):
2597         (WebKit::PageClientImpl::didPerformDictionaryLookup):
2598         (WebKit::PageClientImpl::dismissContentRelativeChildWindows):
2599         * UIProcess/mac/WKActionMenuController.mm:
2600         (-[WKActionMenuController _defaultMenuItemsForDataDetectedText]):
2601         * UIProcess/mac/WKImmediateActionController.mm:
2602         (-[WKImmediateActionController _defaultAnimationController]):
2603         (-[WKImmediateActionController _animationControllerForDataDetectedText]):
2604         (-[WKImmediateActionController _animationControllerForDataDetectedLink]):
2605         (-[WKImmediateActionController _animationControllerForText]):
2606         * WebProcess/WebPage/FindController.cpp:
2607         (WebKit::FindController::updateFindIndicator):
2608         Make _setTextIndicator take a reference.
2609         Add a variant of _setTextIndicator that takes a Lifetime.
2610         Make _clearTextIndicatorWithAnimation take a DismissalAnimation.
2611         Make dismissContentRelativeChildWindows take a parameter indicating
2612         whether the dismissal should include animation or not (currently
2613         only applies to TextIndicator).
2614         Don't animate when dismissal occurs because of scrolling, zooming,
2615         or other things in which the content will have changed significantly
2616         underneath the indicator and shouldn't have a slowly-fading-out yellow highlight.
2617
2618 2015-04-28  Michael Catanzaro  <mcatanzaro@igalia.com>
2619
2620         Fully replace ENABLE_LLINT_C_LOOP with ENABLE_JIT
2621         https://bugs.webkit.org/show_bug.cgi?id=144304
2622
2623         Reviewed by Geoffrey Garen.
2624
2625         Define ENABLE_JIT, enabled by default, instead of ENABLE_LLINT_C_LOOP, disabled by default.
2626
2627         * Configurations/FeatureDefines.xcconfig:
2628
2629 2015-04-28  Commit Queue  <commit-queue@webkit.org>
2630
2631         Unreviewed, rolling out r183514.
2632         https://bugs.webkit.org/show_bug.cgi?id=144359
2633
2634         It broke cloop test bots (Requested by mcatanzaro on #webkit).
2635
2636         Reverted changeset:
2637
2638         "Fully replace ENABLE_LLINT_C_LOOP with ENABLE_JIT"
2639         https://bugs.webkit.org/show_bug.cgi?id=144304
2640         http://trac.webkit.org/changeset/183514
2641
2642 2015-04-28  Michael Catanzaro  <mcatanzaro@igalia.com>
2643
2644         Fully replace ENABLE_LLINT_C_LOOP with ENABLE_JIT
2645         https://bugs.webkit.org/show_bug.cgi?id=144304
2646
2647         Reviewed by Geoffrey Garen.
2648
2649         Define ENABLE_JIT, enabled by default, instead of ENABLE_LLINT_C_LOOP, disabled by default.
2650
2651         * Configurations/FeatureDefines.xcconfig:
2652
2653 2015-04-28  Enrica Casucci  <enrica@apple.com>
2654
2655         Add support for lookup on iOS.
2656         https://bugs.webkit.org/show_bug.cgi?id=144342
2657         rdar://problem/19994090
2658
2659         Reviewed by Tim Horton.
2660
2661         * UIProcess/WebPageProxy.h:
2662         * UIProcess/ios/WKContentViewInteraction.mm:
2663         (-[WKContentView _lookup:]):
2664         (-[WKContentView canPerformAction:withSender:]):
2665         * UIProcess/ios/WebPageProxyIOS.mm:
2666         (WebKit::WebPageProxy::getLookupContextAtPoint):
2667         * WebProcess/WebPage/WebPage.h:
2668         * WebProcess/WebPage/WebPage.messages.in:
2669         * WebProcess/WebPage/ios/WebPageIOS.mm:
2670         (WebKit::WebPage::getLookupContextAtPoint):
2671
2672 2015-04-28  Brady Eidson  <beidson@apple.com>
2673
2674         Consolidate most "frame load" arguments into FrameLoadRequest.
2675         https://bugs.webkit.org/show_bug.cgi?id=144276
2676
2677         Reviewed by Alexey Proskuryakov.
2678
2679         * WebProcess/Plugins/PluginView.cpp:
2680         (WebKit::PluginView::loadURL):
2681         
2682         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2683         (WebKit::WebFrameLoaderClient::dispatchCreatePage):
2684         
2685         * WebProcess/WebPage/WebInspector.cpp:
2686         (WebKit::WebInspector::openInNewTab):
2687
2688 2015-04-28  Chris Dumez  <cdumez@apple.com>
2689
2690         [WK2][Mac] Update WebContent process' sandbox profile for AWD
2691         https://bugs.webkit.org/show_bug.cgi?id=144315
2692         <rdar://problem/20719293>
2693
2694         Reviewed by Alexey Proskuryakov.
2695
2696         Update sandbox profile for AWD similarly to what was done for iOS in
2697         r182278.
2698
2699         * WebProcess/com.apple.WebProcess.sb.in:
2700
2701 2015-04-28  Antti Koivisto  <antti@apple.com>
2702
2703         Network Cache: Disk cache getting filled by YouTube video data
2704         https://bugs.webkit.org/show_bug.cgi?id=144259
2705
2706         Reviewed by Darin Adler.
2707
2708         MSE media is loaded via XHR and tends to eventually fill the cache.
2709
2710         YouTube serves the media chunks cacheable, however they are rarely (if ever) reused.
2711         We can reduce disk writes and keep more useful resources around by not caching them
2712
2713         * NetworkProcess/NetworkResourceLoader.cpp:
2714         (WebKit::NetworkResourceLoader::didReceiveResponseAsync):
2715         (WebKit::NetworkResourceLoader::didRetrieveCacheEntry):
2716         * NetworkProcess/cache/NetworkCache.cpp:
2717         (WebKit::NetworkCache::makeStoreDecision):
2718
2719             Don't store if the requester is XHR and response has video or audio content type.
2720
2721         * NetworkProcess/cache/NetworkCache.h:
2722         * NetworkProcess/cache/NetworkCacheStatistics.cpp:
2723         (WebKit::NetworkCache::storeDecisionToDiagnosticKey):
2724         * Shared/Network/NetworkResourceLoadParameters.cpp:
2725         (WebKit::NetworkResourceLoadParameters::NetworkResourceLoadParameters):
2726         (WebKit::NetworkResourceLoadParameters::encode):
2727         (WebKit::NetworkResourceLoadParameters::decode):
2728         * Shared/Network/NetworkResourceLoadParameters.h:
2729
2730             The requester type is now part of the ResourceRequest, no need for separate parameter.
2731
2732         * Shared/mac/WebCoreArgumentCodersMac.mm:
2733         (IPC::ArgumentCoder<ResourceRequest>::encodePlatformData):
2734         (IPC::ArgumentCoder<ResourceRequest>::decodePlatformData):
2735         * WebProcess/Network/WebResourceLoadScheduler.cpp:
2736         (WebKit::WebResourceLoadScheduler::scheduleLoad):
2737
2738 2015-04-28  Zan Dobersek  <zdobersek@igalia.com>
2739
2740         [WK2] API::UserContentURLPattern creation functions should return Ref<>
2741         https://bugs.webkit.org/show_bug.cgi?id=144225
2742
2743         Reviewed by Darin Adler.
2744
2745         Have API::UserContentURLPattern creation functions return Ref<>.
2746         Call-sites are also updated, using and operating on the returned Ref<>
2747         object where possible.
2748
2749         * Shared/API/APIUserContentURLPattern.h:
2750         (API::UserContentURLPattern::create):
2751         * Shared/API/c/WKUserContentURLPattern.cpp:
2752         (WKUserContentURLPatternCreate):
2753
2754 2015-04-28  Zan Dobersek  <zdobersek@igalia.com>
2755
2756         [WK2] API::URLRequest, API::URLResponse creation functions should return Ref<>
2757         https://bugs.webkit.org/show_bug.cgi?id=144224
2758
2759         Reviewed by Darin Adler.
2760
2761         Have API::URLRequest and API::URLResponse creation functions return Ref<>.
2762         The call-sites are also updated, using and operating on the returned Ref<> object
2763         where possible.
2764
2765         * Shared/API/APIURLRequest.h:
2766         (API::URLRequest::create):
2767         * Shared/API/APIURLResponse.h:
2768         (API::URLResponse::create):
2769         * Shared/API/c/WKURLRequest.cpp:
2770         (WKURLRequestCreateWithWKURL):
2771         * Shared/API/c/mac/WKURLRequestNS.mm:
2772         (WKURLRequestCreateWithNSURLRequest):
2773         * Shared/API/c/mac/WKURLResponseNS.mm:
2774         (WKURLResponseCreateWithNSURLResponse):
2775         * UIProcess/API/C/WKContext.cpp:
2776         (WKContextSetDownloadClient):
2777         * UIProcess/API/C/WKDownload.cpp:
2778         (WKDownloadCopyRequest):
2779         * UIProcess/API/C/WKNavigationDataRef.cpp:
2780         (WKNavigationDataCopyOriginalRequest):
2781         * UIProcess/API/C/WKPage.cpp:
2782         (WKPageSetPagePolicyClient):
2783         (WKPageSetPageUIClient):
2784         * UIProcess/Cocoa/NavigationState.mm:
2785         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
2786         * UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManagerClient.cpp:
2787         (WebKit::WebSoupCustomProtocolRequestManagerClient::startLoading):
2788         * WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp:
2789         (willSendRequestForFrame):
2790         * WebProcess/InjectedBundle/InjectedBundlePagePolicyClient.cpp:
2791         (WebKit::InjectedBundlePagePolicyClient::decidePolicyForNavigationAction):
2792         (WebKit::InjectedBundlePagePolicyClient::decidePolicyForNewWindowAction):
2793         (WebKit::InjectedBundlePagePolicyClient::decidePolicyForResponse):
2794
2795 2015-04-27  Zan Dobersek  <zdobersek@igalia.com>
2796
2797         [WK2] API::Point, API::Size, API::Rect creation functions should return Ref<>
2798         https://bugs.webkit.org/show_bug.cgi?id=144223
2799
2800         Reviewed by Darin Adler.
2801
2802         Have API::Point, API::Size and API::Rect creation functions return Ref<>.
2803         Call-sites are also updated, using and operating on the returned Ref<> object
2804         where possible.
2805
2806         * Shared/API/APIGeometry.h:
2807         (API::Size::create):
2808         (API::Point::create):
2809         (API::Rect::create):
2810         * Shared/API/c/WKGeometry.cpp:
2811         (WKPointCreate):
2812         (WKSizeCreate):
2813         (WKRectCreate):
2814
2815 2015-04-27  Zan Dobersek  <zdobersek@igalia.com>
2816
2817         [WK2] API::Error creation functions should return Ref<>
2818         https://bugs.webkit.org/show_bug.cgi?id=144222
2819
2820         Reviewed by Darin Adler.
2821
2822         Have API::Error creation functions return Ref<>.
2823         The call-sites are also updated, using and operating
2824         on the returned Ref<> object where possible.
2825
2826         * Shared/API/APIError.h:
2827         (API::Error::create):
2828         * Shared/API/c/cf/WKErrorCF.cpp:
2829         (WKErrorCreateWithCFError):
2830         * UIProcess/API/C/WKOriginDataManager.cpp:
2831         (WKOriginDataManagerDeleteEntriesForOrigin):
2832         (WKOriginDataManagerDeleteEntriesModifiedBetweenDates):
2833         (WKOriginDataManagerDeleteAllEntries):
2834         * UIProcess/API/C/WKPage.cpp:
2835         (toGenericCallbackFunction):
2836         (WKPageForceRepaint):
2837         (WKPageValidateCommand):
2838         (WKPageComputePagesForPrinting):
2839         * UIProcess/API/C/WKPluginSiteDataManager.cpp:
2840         (WKPluginSiteDataManagerClearSiteData):
2841         (WKPluginSiteDataManagerClearAllSiteData):
2842         * UIProcess/GenericCallback.h:
2843         (WebKit::toGenericCallbackFunction):
2844         * UIProcess/WebPageProxy.cpp:
2845         (WebKit::WebPageProxy::printFinishedCallback):
2846
2847 2015-04-27  Sungmann Cho  <sungmann.cho@navercorp.com>
2848
2849         [GTK] Remove unnecessary semicolon from WebKitNotificationProvider.h.
2850         https://bugs.webkit.org/show_bug.cgi?id=144312
2851
2852         Reviewed by Martin Robinson.
2853
2854         No new tests, no behavior change.
2855
2856         * UIProcess/API/gtk/WebKitNotificationProvider.h:
2857
2858 2015-04-27  Brent Fulgham  <bfulgham@apple.com>
2859
2860         PDF action menu fixes
2861         https://bugs.webkit.org/show_bug.cgi?id=144299
2862         <rdar://problem/20702215>
2863
2864         Reviewed by Tim Horton.
2865
2866         Make two corrections to how PDFs are handled:
2867         1. When calculating the view rect for the user's selection, make sure
2868         that we get coordinates for the correct PDF page. The existing code assumed
2869         that the current PDFLayerControler's current page was correct, but this will
2870         not be true if you zoom the PDF out so that several pages are displayed at
2871         once. Each selection keeps track of the page it is referenced against.
2872         
2873         2. Revise the offsets calculated for the TextIndicator to take into account
2874         the font descender (as well as the ascender), and to adjust by the scaled
2875         amount of margin around the selected text.
2876
2877         * WebProcess/Plugins/PDF/PDFPlugin.mm:
2878         (WebKit::PDFPlugin::viewRectForSelection): Use correct page for calculating
2879         the coordinates.
2880         * WebProcess/WebPage/mac/WebPageMac.mm:
2881         (WebKit::WebPage::dictionaryPopupInfoForSelectionInPDFPlugin): Include font 'descendant'
2882         and (scaled) margin when adjusting the hit target for the TextIndicator to draw.
2883
2884 2015-04-27  Michael Catanzaro  <mcatanzaro@igalia.com>
2885
2886         Rename WTF_USE_3D_GRAPHICS to ENABLE_GRAPHICS_CONTEXT_3D
2887         https://bugs.webkit.org/show_bug.cgi?id=144193
2888
2889         Reviewed by Darin Adler.
2890
2891         * CMakeLists.txt:
2892
2893 2015-04-24  Jon Honeycutt  <jhoneycutt@apple.com>
2894
2895         Context menus are not reshown after an orientation change
2896
2897         <https://bugs.webkit.org/show_bug.cgi?id=144143>
2898         <rdar://problem/20679931>
2899
2900         Reviewed by Darin Adler.
2901
2902         * UIProcess/ios/WKActionSheet.mm:
2903         (-[WKActionSheet updateSheetPosition]):
2904         Return early if we're still in a rotation, not if the rotation is
2905         complete.
2906
2907 2015-04-27  Zan Dobersek  <zdobersek@igalia.com>
2908
2909         [WK2] API::Dictionary creation functions should return Ref<>
2910         https://bugs.webkit.org/show_bug.cgi?id=144221
2911
2912         Reviewed by Darin Adler.
2913
2914         Have API::Dictionary creation functions return Ref<>.
2915         The call-sites are also updated, using and operating
2916         on the returned Ref<> object where possible.
2917
2918         * Shared/API/APIDictionary.cpp:
2919         (API::Dictionary::create):
2920         * Shared/API/APIDictionary.h:
2921         * Shared/API/Cocoa/WKRemoteObjectCoder.mm:
2922         (createEncodedObject):
2923         * Shared/API/Cocoa/_WKRemoteObjectRegistry.mm:
2924         (-[_WKRemoteObjectRegistry _sendInvocation:interface:]):
2925         * Shared/API/c/WKDictionary.cpp:
2926         (WKDictionaryCreate):
2927         * Shared/API/c/WKMutableDictionary.cpp:
2928         (WKMutableDictionaryCreate):
2929         * Shared/Plugins/Netscape/PluginInformation.cpp:
2930         (WebKit::createPluginInformationDictionary):
2931         * Shared/Plugins/Netscape/PluginInformation.h:
2932         * UIProcess/API/C/WKPage.cpp:
2933         (WKPageSetPageUIClient):
2934         * UIProcess/API/gtk/WebKitWebContext.cpp:
2935         (webkit_web_context_prefetch_dns):
2936         * UIProcess/API/gtk/WebKitWebView.cpp:
2937         (webkit_web_view_get_snapshot):
2938         * UIProcess/Plugins/PlugInAutoStartProvider.cpp:
2939         (WebKit::PlugInAutoStartProvider::autoStartOriginsTableCopy):
2940         * UIProcess/Plugins/PlugInAutoStartProvider.h:
2941         * UIProcess/StatisticsRequest.cpp:
2942         (WebKit::createDictionaryFromHashMap):
2943         (WebKit::StatisticsRequest::completedRequest):
2944         * UIProcess/WebFormClient.cpp:
2945         (WebKit::WebFormClient::willSubmitForm):
2946         * UIProcess/WebPageProxy.cpp:
2947         (WebKit::WebPageProxy::didFailToInitializePlugin):
2948         * WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp:
2949         (didInitiateLoadForResource):
2950         (willSendRequestForFrame):
2951         (didReceiveResponseForResource):
2952         (didReceiveContentLengthForResource):
2953         (didFinishLoadForResource):
2954         (didFailLoadForResource):
2955         (webkitWebPageDidReceiveMessage):
2956         * WebProcess/InjectedBundle/InjectedBundlePageFormClient.cpp:
2957         (WebKit::InjectedBundlePageFormClient::willSendSubmitEvent):
2958         (WebKit::InjectedBundlePageFormClient::willSubmitForm):
2959
2960 2015-04-27  Zan Dobersek  <zdobersek@igalia.com>
2961
2962         [WK2] API::Data creation functions should return Ref<>
2963         https://bugs.webkit.org/show_bug.cgi?id=144220
2964
2965         Reviewed by Darin Adler.
2966
2967         Have API::Data creation functions return Ref<>.
2968         The call-sites are also updated, using and operating
2969         on the returned Ref<> object where possible.
2970
2971         * Shared/API/APIData.h:
2972         (API::Data::createWithoutCopying):
2973         (API::Data::create):
2974         * Shared/API/c/WKData.cpp:
2975         (WKDataCreate):
2976         * Shared/API/c/mac/WKWebArchive.cpp:
2977         (WKWebArchiveCopyData):
2978         * Shared/API/c/mac/WKWebArchiveResource.cpp:
2979         (WKWebArchiveResourceCopyData):
2980         * Shared/APIWebArchive.h:
2981         * Shared/APIWebArchive.mm:
2982         (API::WebArchive::data):
2983         * Shared/APIWebArchiveResource.h:
2984         * Shared/APIWebArchiveResource.mm:
2985         (API::WebArchiveResource::data):
2986         * Shared/Cocoa/APIDataCocoa.mm:
2987         (API::Data::createWithoutCopying):
2988         * UIProcess/API/Cocoa/WKWebView.mm:
2989         (-[WKWebView loadData:MIMEType:characterEncodingName:baseURL:]):
2990         * UIProcess/API/gtk/WebKitURISchemeRequest.cpp:
2991         (webkitURISchemeRequestReadCallback):
2992         * UIProcess/API/gtk/WebKitWebView.cpp:
2993         (webkit_web_view_load_bytes):
2994         * UIProcess/Downloads/DownloadProxy.cpp:
2995         (WebKit::createData):
2996         * UIProcess/WebPageProxy.cpp:
2997         (WebKit::WebPageProxy::dataCallback):
2998         (WebKit::WebPageProxy::savePDFToFileInDownloadsFolder):
2999
3000 2015-04-27  Zan Dobersek  <zdobersek@igalia.com>
3001
3002         [WK2] API::URL creation functions should return Ref<>
3003         https://bugs.webkit.org/show_bug.cgi?id=144219
3004
3005         Reviewed by Darin Adler.
3006
3007         Have API::URL creation functions return Ref<>.
3008         The call-sites are also updated, using and operating in the
3009         returned Ref<> object, where possible.
3010
3011         * Shared/API/APIURL.h:
3012         (API::URL::create):
3013         * Shared/API/c/WKSharedAPICast.h:
3014         (WebKit::toCopiedURLAPI):
3015         * Shared/API/c/WKURL.cpp:
3016         (WKURLCreateWithUTF8CString):
3017         (WKURLCreateWithBaseURL):
3018         * UIProcess/API/gtk/WebKitWebResource.cpp:
3019         (webkit_web_resource_get_data):
3020         * UIProcess/WebIconDatabase.cpp:
3021         (WebKit::WebIconDatabase::didChangeIconForPageURL):
3022         (WebKit::WebIconDatabase::notifyIconDataReadyForPageURL):
3023         * WebProcess/WebPage/WebPage.cpp:
3024         (WebKit::WebPage::userAgent):
3025
3026 2015-04-27  Zan Dobersek  <zdobersek@igalia.com>
3027
3028         [WK2] API::String creation functions should return Ref<>
3029         https://bugs.webkit.org/show_bug.cgi?id=144218
3030
3031         Reviewed by Darin Adler.
3032
3033         Have API::String creation functions return Ref<>.
3034         The call-sites are also updated, using and operating on the returned
3035         Ref<> object, where possible.
3036
3037         * Shared/API/APIString.h:
3038         * Shared/API/c/WKPluginInformation.cpp:
3039         (WKPluginInformationBundleIdentifierKey):
3040         (WKPluginInformationBundleVersionKey):
3041         (WKPluginInformationBundleShortVersionKey):
3042         (WKPluginInformationPathKey):
3043         (WKPluginInformationDisplayNameKey):
3044         (WKPluginInformationDefaultLoadPolicyKey):
3045         (WKPluginInformationUpdatePastLastBlockedVersionIsKnownAvailableKey):
3046         (WKPluginInformationHasSandboxProfileKey):
3047         (WKPluginInformationFrameURLKey):
3048         (WKPluginInformationMIMETypeKey):
3049         (WKPluginInformationPageURLKey):
3050         (WKPluginInformationPluginspageAttributeURLKey):
3051         (WKPluginInformationPluginURLKey):
3052         (WKPlugInInformationReplacementObscuredKey):
3053         * Shared/API/c/WKSharedAPICast.h:
3054         (WebKit::ProxyingRefPtr::ProxyingRefPtr):
3055         (WebKit::toCopiedAPI):
3056         * Shared/API/c/WKString.cpp:
3057         (WKStringCreateWithUTF8CString):
3058         (WKStringCreateWithJSString):
3059         * UIProcess/API/C/WKDatabaseManager.cpp:
3060         (WKDatabaseManagerGetOriginKey):
3061         (WKDatabaseManagerGetOriginQuotaKey):
3062         (WKDatabaseManagerGetOriginUsageKey):
3063         (WKDatabaseManagerGetDatabaseDetailsKey):
3064         (WKDatabaseManagerGetDatabaseDetailsNameKey):
3065         (WKDatabaseManagerGetDatabaseDetailsDisplayNameKey):
3066         (WKDatabaseManagerGetDatabaseDetailsExpectedUsageKey):
3067         (WKDatabaseManagerGetDatabaseDetailsCurrentUsageKey):
3068         (WKDatabaseManagerGetDatabaseDetailsCreationTimeKey):
3069         (WKDatabaseManagerGetDatabaseDetailsModificationTimeKey):
3070         * UIProcess/API/C/WKKeyValueStorageManager.cpp:
3071         (WKKeyValueStorageManagerGetOriginKey):
3072         (WKKeyValueStorageManagerGetCreationTimeKey):
3073         (WKKeyValueStorageManagerGetModificationTimeKey):
3074         * UIProcess/API/C/WKPage.cpp:
3075         (WKPageGetSessionHistoryURLValueType):
3076         (WKPageGetSessionBackForwardListItemValueType):
3077         (toGenericCallbackFunction):
3078         (WKPageValidateCommand):
3079         * UIProcess/WebProcessPool.cpp:
3080         (WebKit::WebProcessPool::didReceiveInvalidMessage):
3081
3082 2015-04-27  Brady Eidson  <beidson@apple.com>
3083
3084         Make 'enum NavigationType' be an enum class
3085         https://bugs.webkit.org/show_bug.cgi?id=144270
3086
3087         Reviewed by Alex Christensen.
3088
3089         * Shared/API/c/WKSharedAPICast.h:
3090         (WebKit::toAPI):
3091         
3092         * Shared/NavigationActionData.cpp:
3093         (WebKit::NavigationActionData::NavigationActionData):
3094         
3095         * UIProcess/API/Cocoa/WKNavigationAction.mm:
3096         (toWKNavigationType):
3097         
3098         * UIProcess/API/gtk/WebKitPrivate.cpp:
3099         (toWebKitNavigationType):
3100         
3101         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3102         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
3103         
3104         * WebProcess/WebPage/WebInspector.cpp:
3105         (WebKit::WebInspector::openInNewTab):
3106
3107 2015-04-27  Brent Fulgham  <bfulgham@apple.com>
3108
3109         REGRESSION(r182879): Images and video can no longer be downloaded
3110         https://bugs.webkit.org/show_bug.cgi?id=144267
3111         <rdar://problem/20702844>
3112
3113         Reviewed by Simon Fraser.
3114
3115         * UIProcess/mac/WKActionMenuController.mm:
3116         (-[WKActionMenuController _createActionMenuItemForTag:]): Check for
3117         "!WebCore::protocolIs(..., "file")" for image and media downloads.
3118
3119 2015-04-27  Csaba Osztrogonác  <ossy@webkit.org>
3120
3121         [EFL] TestWebKitAPI's forwarding header generator should depend on WebKit2's generator
3122         https://bugs.webkit.org/show_bug.cgi?id=143874
3123
3124         Reviewed by Gyuyoung Kim.
3125
3126         * PlatformEfl.cmake: Rename the generator to have consistent name with other generators.
3127         * Scripts/generate-forwarding-headers.pl: Removed the unnecessary multiple include-path support.
3128
3129 2015-04-17  Carlos Garcia Campos  <cgarcia@igalia.com>
3130
3131         [SOUP] Add initial implementation of NetworkProcess disk cache
3132         https://bugs.webkit.org/show_bug.cgi?id=143872
3133
3134         Reviewed by Martin Robinson.
3135
3136         Implement the platform specific parts of the disk cache
3137         implementation for Soup. It's mainly NetworkCache::Data and
3138         NetworkCache::IOChannel.
3139
3140         * CMakeLists.txt:
3141         * NetworkProcess/cache/NetworkCache.cpp:
3142         (WebKit::NetworkCache::dumpFileChanged):
3143         (WebKit::NetworkCache::Cache::initialize):
3144         * NetworkProcess/cache/NetworkCacheBlobStorage.cpp:
3145         * NetworkProcess/cache/NetworkCacheData.h:
3146         (WebKit::NetworkCache::Data::soupBuffer):
3147         * NetworkProcess/cache/NetworkCacheDataSoup.cpp: Added.
3148         (WebKit::NetworkCache::Data::Data):
3149         (WebKit::NetworkCache::Data::empty):
3150         (WebKit::NetworkCache::Data::data):
3151         (WebKit::NetworkCache::Data::isNull):
3152         (WebKit::NetworkCache::Data::apply):
3153         (WebKit::NetworkCache::Data::subrange):
3154         (WebKit::NetworkCache::concatenate):
3155         (WebKit::NetworkCache::MapWrapper::~MapWrapper):
3156         (WebKit::NetworkCache::deleteMapWrapper):
3157         (WebKit::NetworkCache::mapFile):
3158         (WebKit::NetworkCache::Data::adoptMap):
3159         (WebKit::NetworkCache::computeSHA1):
3160         (WebKit::NetworkCache::bytesEqual):
3161         * NetworkProcess/cache/NetworkCacheIOChannel.h:
3162         * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp: Added.
3163         (WebKit::NetworkCache::IOChannel::IOChannel):
3164         (WebKit::NetworkCache::IOChannel::open):
3165         (WebKit::NetworkCache::fillDataFromReadBuffer):
3166         (WebKit::NetworkCache::inputStreamReadReadyCallback):
3167         (WebKit::NetworkCache::IOChannel::read):
3168         (WebKit::NetworkCache::IOChannel::readSync):
3169         (WebKit::NetworkCache::outputStreamWriteReadyCallback):
3170         (WebKit::NetworkCache::IOChannel::write):
3171         * NetworkProcess/cache/NetworkCacheStorageSoup.cpp: Removed.
3172         * NetworkProcess/gtk/NetworkProcessMainGtk.cpp:
3173         * NetworkProcess/soup/NetworkProcessSoup.cpp:
3174         (WebKit::NetworkProcess::platformInitializeNetworkProcess):
3175         (WebKit::NetworkProcess::platformSetCacheModel):
3176         (WebKit::NetworkProcess::clearDiskCache):
3177         * PlatformGTK.cmake:
3178
3179 2015-04-26  Yusuke Suzuki  <utatane.tea@gmail.com>
3180
3181         [ES6] Implement ES6 template literals
3182         https://bugs.webkit.org/show_bug.cgi?id=142691
3183
3184         Reviewed by Darin Adler.
3185
3186         Add ENABLE_ES6_TEMPLATE_LITERAL_SYNTAX compile time flag.
3187
3188         * Configurations/FeatureDefines.xcconfig:
3189
3190 2015-04-26  Sungmann Cho  <sungmann.cho@navercorp.com>
3191
3192         Remove PluginView::renderer().
3193         https://bugs.webkit.org/show_bug.cgi?id=144216
3194
3195         Reviewed by Darin Adler.
3196
3197         Nobody should have to know about the plug-in view's renderer except the plug-in view itself.
3198
3199         No new tests, no behavior change.
3200
3201         * WebProcess/Plugins/PDF/PDFPlugin.mm:
3202         (WebKit::PDFPlugin::convertFromScrollbarToContainingView):
3203         (WebKit::PDFPlugin::convertFromContainingViewToScrollbar):
3204         * WebProcess/Plugins/PluginView.cpp:
3205         (WebKit::PluginView::renderer): Deleted.
3206         * WebProcess/Plugins/PluginView.h:
3207
3208 2015-04-26  Doug Russell  <d_russell@apple.com>
3209
3210         AX: richer text change notifications (142719)
3211         https://bugs.webkit.org/show_bug.cgi?id=142719
3212
3213         Reviewed by Darin Adler.
3214
3215         Richer accessibility value change notifications. Introduce AXTextEditType,
3216         postTextStateChangeNotification and postTextReplacementNotification to give assistive
3217         tech apps more reliable context for responding to changes in web content. Also implement
3218         a mechanism to post value changes in password form fields in coalesced ticks to thwart
3219         analyzing the cadence of changes.
3220
3221         Richer accessibility selection change notifications. Introduce AXTextStateChangeIntent,
3222         and an overload of postTextReplacementNotification to give assistive tech apps more
3223         reliable context for responding to changes in web content selection. Also block posting
3224         selection changes on password fields.
3225
3226         * UIProcess/WebEditCommandProxy.cpp:
3227         (WebKit::WebEditCommandProxy::nameForEditAction):
3228
3229 2015-04-26  Dan Bernstein  <mitz@apple.com>
3230
3231         <rdar://problem/20702337> REGRESSION (r182952): Plug-in service fails to load because it links against WebKit2.framework
3232         https://bugs.webkit.org/show_bug.cgi?id=144233
3233
3234         Reviewed by Simon Fraser.
3235
3236         Have the plug-in service link against WebKit.framework rather than WebKit2.framework.
3237
3238         * Configurations/PluginService.32.xcconfig: Removed linker flags for linking against WebKit2
3239         and Foundation from the definition of OTHER_LDFLAGS. Since linking is no longer conditional,
3240         we can just do it in the target’s Link Binary With Libraries build phase.
3241
3242         * Configurations/PluginService.64.xcconfig: Ditto.
3243
3244         * WebKit2.xcodeproj/project.pbxproj: Have Foundation and WebKit listed in the services’ Link
3245         Binariy With Libraries build phases (one service already had WebKit).
3246
3247 2015-04-26  Dan Bernstein  <mitz@apple.com>
3248
3249         Fixed the build.
3250
3251         * UIProcess/ios/forms/WKFileUploadPanel.mm:
3252         (-[WKFileUploadPanel _showDocumentPickerMenu]): Suppressed deprecation warnings around use
3253         of -[UIDocumentMenuViewController _setIgnoreApplicationEntitlementForImport:].
3254
3255 2015-04-25  Tim Horton  <timothy_horton@apple.com>
3256
3257         Further update gesture swipe shadow style
3258         https://bugs.webkit.org/show_bug.cgi?id=144215
3259         <rdar://problem/19295843>
3260
3261         Reviewed by Dan Bernstein.
3262
3263         * Resources/mac/SwipeShadow.png: Removed.
3264         * Resources/mac/SwipeShadow@2x.png: Removed.
3265         * UIProcess/mac/ViewGestureController.h:
3266         * UIProcess/mac/ViewGestureControllerMac.mm:
3267         (WebKit::ViewGestureController::beginSwipeGesture):
3268         * WebKit2.xcodeproj/project.pbxproj:
3269         Use a CAGradientLayer instead of PNGs for the swipe shadow.
3270
3271 2015-04-25  Dan Bernstein  <mitz@apple.com>
3272
3273         WebKit2 part of <rdar://problem/20697966> Avoid using TBD as an argument to NS_AVAILABLE
3274         https://bugs.webkit.org/show_bug.cgi?id=144201
3275
3276         Reviewed by Darin Adler.
3277
3278         Instead of TBD, we use the high version number to which it corresponds in CFAvailability.h,
3279         9876.5.
3280
3281         * mac/MigrateHeadersFromWebKitLegacy.make: To detect not-yet-available declarations in
3282         headers, look for "9876_5" rather than "TBA".
3283
3284 2015-04-24  Timothy Hatcher  <timothy@apple.com>
3285
3286         Web Inspector: Remove native window dock controls
3287         https://bugs.webkit.org/show_bug.cgi?id=144184
3288
3289         Reviewed by Joseph Pecoraro.
3290
3291         * Resources/DockBottom.pdf: Removed.
3292         * Resources/DockBottomLegacy.pdf: Removed.
3293         * Resources/DockRight.pdf: Removed.
3294         * Resources/DockRightLegacy.pdf: Removed.
3295         * UIProcess/WebInspectorProxy.h:
3296         * UIProcess/mac/WebInspectorProxyMac.mm:
3297         (WebKit::WebInspectorProxy::createInspectorWindow):
3298         (WebKit::WebInspectorProxy::platformAttachAvailabilityChanged):
3299         * WebKit2.xcodeproj/project.pbxproj:
3300
3301 2015-04-25  Martin Robinson  <mrobinson@igalia.com>
3302
3303         Rename ENABLE_3D_RENDERING to ENABLE_3D_TRANSFORMS
3304         https://bugs.webkit.org/show_bug.cgi?id=144182
3305
3306         Reviewed by Simon Fraser.
3307
3308         * Configurations/FeatureDefines.xcconfig: Replace all instances of 3D_RENDERING with 3D_TRANSFORMS.
3309
3310 2015-04-24  Simon Fraser  <simon.fraser@apple.com>
3311
3312         Have the web inspector report accurate memory use for layers with detached backing store
3313         https://bugs.webkit.org/show_bug.cgi?id=144179
3314
3315         Reviewed by Dean Jackson.
3316         
3317         Remote layers can make their backing store volatile, so the backing only contributes
3318         to reported memory use when attached.
3319
3320         * WebProcess/WebPage/mac/PlatformCALayerRemote.h:
3321
3322 2015-04-24  Andreas Kling  <akling@apple.com>
3323
3324         theverge.com burning 100% CPU on iPad (due to window.screenX/Y)
3325         <https://webkit.org/b/144175>
3326         <rdar://problem/20694585>
3327
3328         Reviewed by Anders Carlsson.
3329
3330         Return an empty window rect on iOS WK2 builds. This avoids sending a synchronous
3331         IPC request to the UI process that would give the same result, but spend way
3332         more time and CPU cycles to do so.
3333
3334         With this change, theverge.com CPU usage goes from 100% to ~20% when idle.
3335
3336         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3337         (WebKit::WebChromeClient::windowRect):
3338
3339 2015-04-24  Brent Fulgham  <bfulgham@apple.com>
3340
3341         TextIndicator for embedded PDFs is slightly offset
3342         https://bugs.webkit.org/show_bug.cgi?id=144172
3343         <rdar://problem/20691304>
3344
3345         Reviewed by Tim Horton.
3346
3347         When I converted the existing DOM Range logic to work with PDFSelections, I omitted the
3348         step where the font ascent was used to adjust the origin used for the TextIndicator. This
3349         patch determines the correct ascent for the range of characters in the selection, and
3350         adjusts the offset by the difference between the ascent and the height of the selection rect.
3351         
3352         Also, since the PDFSelection only supplies the bounding rect for the selection, I calculate
3353         an equivalent text bounding box by insetting the rect by half the size of the ascent.
3354
3355         * WebProcess/Plugins/PDF/PDFPlugin.mm:
3356         (WebKit::PDFPlugin::scaleFactor): Add accessor for PDF scale factor.
3357         * WebProcess/Plugins/PDF/PDFPlugin.h:
3358         * WebProcess/WebPage/mac/WebPageMac.mm:
3359         (WebKit::WebPage::dictionaryPopupInfoForPDFSelectionInPluginView): Adjusted to take the
3360         font ascent and scale factor into account.
3361
3362 2015-04-24  David Kilzer  <ddkilzer@apple.com>
3363
3364         REGRESSION (r183293): Fix iOS EWS build by adding SPI declaration for +[UIPeripheralHost visiblePeripheralFrame]
3365
3366         Fixes the following build failures:
3367
3368             WebKit2/UIProcess/ios/WKPDFView.mm:740:45: error: class method '+visiblePeripheralFrame' not found (return type defaults to 'id') [-Werror,-Wobjc-method-access]
3369                 CGRect keyboardRect = [UIPeripheralHost visiblePeripheralFrame];
3370                                                         ^~~~~~~~~~~~~~~~~~~~~~
3371             WebKit2/UIProcess/ios/WKPDFView.mm:740:12: error: no viable conversion from 'id' to 'CGRect'
3372                 CGRect keyboardRect = [UIPeripheralHost visiblePeripheralFrame];
3373                        ^              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3374
3375         * Platform/spi/ios/UIKitSPI.h:
3376         (+[UIPeripheralHost visiblePeripheralFrame]): Add declaration.
3377
3378 2015-04-24  Anders Carlsson  <andersca@apple.com>
3379
3380         Change _WKWebsiteDataStore to hold on to an internal WKWebsiteDataStore
3381         https://bugs.webkit.org/show_bug.cgi?id=144171
3382
3383         Reviewed by Tim Horton.
3384
3385         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
3386         (-[WKWebViewConfiguration _websiteDataStore]):
3387         (-[WKWebViewConfiguration _setWebsiteDataStore:]):
3388         * UIProcess/API/Cocoa/_WKWebsiteDataStore.h:
3389         * UIProcess/API/Cocoa/_WKWebsiteDataStore.mm:
3390         (-[_WKWebsiteDataStore initWithDataStore:]):
3391         (+[_WKWebsiteDataStore defaultDataStore]):
3392         (+[_WKWebsiteDataStore nonPersistentDataStore]):
3393         (-[_WKWebsiteDataStore isNonPersistent]):
3394         (-[_WKWebsiteDataStore fetchDataRecordsOfTypes:completionHandler:]):
3395         (-[_WKWebsiteDataStore removeDataOfTypes:forDataRecords:completionHandler:]):
3396         (-[_WKWebsiteDataStore removeDataOfTypes:modifiedSince:completionHandler:]):
3397         * UIProcess/API/Cocoa/_WKWebsiteDataStoreInternal.h: Copied from Source/WebKit2/UIProcess/API/Cocoa/_WKWebsiteDataStore.h.
3398         * WebKit2.xcodeproj/project.pbxproj:
3399
3400 2015-04-24  Tim Horton  <timothy_horton@apple.com>
3401
3402         WKPDFView does not support password-protected PDFs
3403         https://bugs.webkit.org/show_bug.cgi?id=144162
3404         <rdar://problem/18411512>
3405
3406         Reviewed by Andy Estes.
3407
3408         * Platform/spi/ios/UIKitSPI.h:
3409         Add some SPI.
3410
3411         * UIProcess/ios/WKPDFView.h:
3412         * UIProcess/ios/WKPDFView.mm:
3413         (-[WKPDFView _didLoadPDFDocument]):
3414         (-[WKPDFView web_setContentProviderData:suggestedFilename:]):
3415         Move creation of the UIPDFDocument (only possible if the CGPDFDocument is unlocked)
3416         and initial setup of the page views out into _didLoadPDFDocument.
3417
3418         If the CGPDFDocument is locked, we'll show some UI to unlock it; otherwise
3419         we'll continue on to _didLoadPDFDocument as previously.
3420
3421         (-[WKPDFView web_setMinimumSize:]):
3422         Resize the password UI instead of the PDF pages if we have it.
3423
3424         (-[WKPDFView _computePageAndDocumentFrames]):
3425         Don't bother doing any work revalidating PDF pages if the document is locked.
3426
3427         (-[WKPDFView _updatePasswordEntryField]):
3428         Make sure that the UIDocumentPassword view is always the size of the scrollview.
3429         This takes care of rotation.
3430
3431         (-[WKPDFView _keyboardDidShow:]):
3432         Make sure that we scroll the password field around, if necessary, to keep it
3433         on screen when editing begins.
3434
3435         (-[WKPDFView _showPasswordEntryField]):
3436         (-[WKPDFView _hidePasswordEntryField]):
3437         Adjust the background color (to match the UIDocumentPasswordView) and disable zooming
3438         while it's up. The UIDocumentPassword view is installed into the scroll view
3439         to match UIWebView behavior.
3440
3441         (-[WKPDFView userDidEnterPassword:forPasswordView:]):
3442         (-[WKPDFView didBeginEditingPassword:inView:]):
3443         (-[WKPDFView didEndEditingPassword:inView:]):
3444         (-[WKPDFView _didFailToUnlock]):
3445         Pop up a dialog informing the user that they entered the wrong password.
3446
3447         (-[WKPDFView _tryToUnlockWithPassword:]):
3448         Try to unlock the document. If it succeeds, hide the unlock UI and go back to
3449         _didLoadPDFDocument.
3450
3451 2015-04-24  Commit Queue  <commit-queue@webkit.org>
3452
3453         Unreviewed, rolling out r183266.
3454         https://bugs.webkit.org/show_bug.cgi?id=144164
3455
3456         Broke 32-bit build and a test. (Requested by ap on #webkit).
3457
3458         Reverted changeset:
3459
3460         "AX: richer text change notifications (142719)"
3461         https://bugs.webkit.org/show_bug.cgi?id=142719
3462         http://trac.webkit.org/changeset/183266
3463
3464 2015-04-24  Brent Fulgham  <bfulgham@apple.com>
3465
3466         REGRESSION: WebKit2.ActionMenusTest API test fails
3467         https://bugs.webkit.org/show_bug.cgi?id=144149
3468         <rdar://problem/20677770>
3469
3470         Reviewed by Tim Horton.
3471
3472         Tested by TestWebKitAPI 
3473
3474         The 'lookupTextAtLocation' method was not converting the NSEvent coordinates it
3475         was receiving from root view to the plugin view. Consequently, full page PDFs
3476         did hit testing correctly, but an <embed> PDF would not.
3477
3478         Since 'existingSelectionContainsPoint' is exposed as API, I also modified it to
3479         expect 'root view' coordinates and perform the requisite conversions, rather
3480         than expecting 'plugin view' coordinates.
3481
3482         * WebProcess/Plugins/PDF/PDFPlugin.mm:
3483         (WebKit::PDFPlugin::existingSelectionContainsPoint): Expect 'root view' coordinates
3484         for the input.
3485         (WebKit::PDFPlugin::lookupTextAtLocation): Properly convert the passed 'root view'
3486         coordinates to the PDF's view coordinate space.
3487         * WebProcess/WebPage/mac/WebPageMac.mm:
3488         (WebKit::WebPage::performActionMenuHitTestAtLocation): Pass hit point using view coordinates,
3489         not content coordinates.
3490
3491 2015-04-24  Anders Carlsson  <andersca@apple.com>
3492
3493         Address a review comment from Joe Pecoraro.
3494
3495         * UIProcess/API/Cocoa/WKWebsiteDataStore.h:
3496
3497 2015-04-24  Anders Carlsson  <andersca@apple.com>
3498
3499         Rename -[WKWebsiteDataStore isNonPersistent] to -[WKWebsiteDataStore isPersistent]
3500         https://bugs.webkit.org/show_bug.cgi?id=144158
3501
3502         Reviewed by Beth Dakin.
3503
3504         * UIProcess/API/APIWebsiteDataStore.cpp:
3505         (API::WebsiteDataStore::isPersistent):
3506         (API::WebsiteDataStore::isNonPersistent): Deleted.
3507         * UIProcess/API/APIWebsiteDataStore.h:
3508         * UIProcess/API/Cocoa/WKWebsiteDataStore.h:
3509         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
3510         (-[WKWebsiteDataStore isPersistent]):
3511         (-[WKWebsiteDataStore isNonPersistent]): Deleted.
3512         * UIProcess/API/Cocoa/_WKWebsiteDataStore.h:
3513         * UIProcess/API/Cocoa/_WKWebsiteDataStore.mm:
3514         (-[_WKWebsiteDataStore isNonPersistent]):
3515         * UIProcess/WebsiteData/WebsiteDataStore.h:
3516
3517 2015-04-24  Brent Fulgham  <bfulgham@apple.com>
3518
3519         Immediate action not functional for embedded PDFs
3520         https://bugs.webkit.org/show_bug.cgi?id=143952
3521         <rdar://problem/19842365>        
3522
3523         Reviewed by Tim Horton.
3524
3525         Add a new method to retrieve appropriate dictionary lookup content and update the
3526         hit test result with relevant dictionary content and the bounding rect of the
3527         selection.
3528
3529         * WebProcess/Plugins/Netscape/NetscapePlugin.h: Add stub.
3530         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp: Initialize plugin type.
3531         * WebProcess/Plugins/PDF/PDFPlugin.h:
3532         * WebProcess/Plugins/PDF/PDFPlugin.mm:
3533         (WebKit::rectInWindowSpaceForRectInLayoutSpace): New helper function to
3534         convert PDF 'in page' units to the equivalent view units.
3535         (WebKit::PDFPlugin::PDFPlugin): Initialize plugin type.
3536         (WebKit::PDFPlugin::viewRectForSelection): Query a provided PDFSelection for
3537         its bounding rect and return the result in view units.
3538         * WebProcess/Plugins/Plugin.h:
3539         * WebProcess/Plugins/PluginProxy.cpp: Initialize plugin type.
3540         * WebProcess/Plugins/PluginProxy.h: Add stub.
3541         * WebProcess/Plugins/PluginView.cpp: 
3542         (WebKit::PluginView::viewRectForSelection): Added.
3543         * WebProcess/Plugins/PluginView.h:
3544         * WebProcess/WebPage/WebPage.h:
3545         * WebProcess/WebPage/mac/WebPageMac.mm:
3546         (WebKit::WebPage::dictionaryPopupInfoForPDFSelectionInPluginView): Added.
3547         (WebKit::textIndicatorTransitionForActionMenu): Added helper function.
3548         (WebKit::WebPage::performActionMenuHitTestAtLocation): Update the hit test information
3549         with relevant dictionary lookup content, and mark the result as a text node (if
3550         appropriate).
3551
3552 2015-04-24  Jer Noble  <jer.noble@apple.com>
3553
3554         [WK2] Only issue a isPlayingAudioDidChange() notification if the audio playing state actually changed.
3555         https://bugs.webkit.org/show_bug.cgi?id=144153
3556
3557         Reviewed by Alexey Proskuryakov.
3558
3559         Check the old state vs. the new state and only issue the change notification if the IsPlayingAudio state changed.
3560
3561         * UIProcess/WebPageProxy.cpp:
3562         (WebKit::WebPageProxy::isPlayingMediaDidChange):
3563
3564 2015-04-24  Antti Koivisto  <antti@apple.com>
3565
3566         CrashTracer: [USER] com.apple.WebKit.Networking at com.apple.WebKit: WebKit::NetworkResourceLoader::~NetworkResourceLoader + 14
3567         https://bugs.webkit.org/show_bug.cgi?id=144147
3568
3569         Reviewed by Chris Dumez.
3570
3571         Storage::storeBodyAsBlob copies the std::function callback for handling mapped bodies in a thread.
3572         This is thread safe only if the function copy is thread safe. It is currently not as we are capturing
3573         RefPtr<NetworkResourceLoader> and NetworkResourceLoader doesn't use thread safe refcounting.
3574
3575         Fix by avoiding copying of the callback. Use same apporach for WriteOperation as we already use for
3576         ReadOperation: count the active operations in progress and delete WriteOperation when everything is
3577         finished. This way we don't need to copy the function out from WriteOperation.
3578
3579         * NetworkProcess/cache/NetworkCacheStorage.cpp:
3580         (WebKit::NetworkCache::Storage::ReadOperation::ReadOperation):
3581         (WebKit::NetworkCache::Storage::WriteOperation::WriteOperation):
3582
3583             Move definition here from the header.
3584
3585         (WebKit::NetworkCache::Storage::~Storage):
3586         (WebKit::NetworkCache::Storage::storeBodyAsBlob):
3587
3588             Increment the operation count when storing a blob, call finishWriteOperation when done.
3589
3590         (WebKit::NetworkCache::Storage::dispatchReadOperation):
3591         (WebKit::NetworkCache::Storage::finishReadOperation):
3592
3593             Count active operations instead of finished operations. This makes the code clearer.
3594
3595         (WebKit::NetworkCache::Storage::dispatchWriteOperation):
3596         (WebKit::NetworkCache::Storage::finishWriteOperation):
3597
3598             Mirror the way ReadOperations work.
3599
3600         * NetworkProcess/cache/NetworkCacheStorage.h:
3601         (WebKit::NetworkCache::Storage::ReadOperation::ReadOperation): Deleted.
3602
3603 2015-04-24  Timothy Hatcher  <timothy@apple.com>
3604
3605         REGRESSION: Web Inspector: Start Timeline Recording in Develop menu broken
3606         https://bugs.webkit.org/show_bug.cgi?id=144150
3607
3608         Reviewed by Brian Burg.
3609
3610         * WebProcess/WebPage/WebInspectorUI.cpp:
3611         (WebKit::WebInspectorUI::evaluateCommandOnLoad): Properly treat bools as literals
3612         instead of strings by not using the string version of evaluateCommandOnLoad.
3613
3614 2015-04-23  Anders Carlsson  <andersca@apple.com>
3615
3616         Add headerdocs for WKWebsiteDataRecord and WKWebsiteDataStore
3617         https://bugs.webkit.org/show_bug.cgi?id=144138
3618
3619         Reviewed by Darin Adler.
3620
3621         * UIProcess/API/Cocoa/WKWebsiteDataRecord.h:
3622         * UIProcess/API/Cocoa/WKWebsiteDataStore.h:
3623         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
3624         (-[WKWebsiteDataStore fetchDataRecordsOfTypes:completionHandler:]):
3625         (-[WKWebsiteDataStore removeDataOfTypes:modifiedSince:completionHandler:]):
3626         (-[WKWebsiteDataStore removeDataOfTypes:forDataRecords:completionHandler:]):
3627
3628 2015-04-24  Doug Russell  <d_russell@apple.com>
3629
3630         AX: richer text change notifications (142719)
3631         https://bugs.webkit.org/show_bug.cgi?id=142719
3632
3633         Reviewed by Darin Adler.
3634
3635         Richer accessibility value change notifications. Introduce AXTextEditType, postTextStateChangeNotification and postTextReplacementNotification to give assistive tech apps more reliable context for responding to changes in web content. Also implement a mechanism to post value changes in password form fields in coalesced ticks to thwart analyzing the cadence of changes.
3636
3637         Richer accessibility selection change notifications. Introduce AXTextStateChangeIntent, and an overload of postTextReplacementNotification to give assistive tech apps more reliable context for responding to changes in web content selection. Also block posting selection changes on password fields.
3638
3639         * UIProcess/WebEditCommandProxy.cpp:
3640         (WebKit::WebEditCommandProxy::nameForEditAction):
3641
3642 2015-04-24  Darin Adler  <darin@apple.com>
3643
3644         Convert OwnPtr and PassOwnPtr uses to std::unique_ptr
3645         https://bugs.webkit.org/show_bug.cgi?id=128007
3646
3647         Reviewed by Anders Carlsson.
3648
3649         * NetworkProcess/cache/NetworkCacheEncoder.h: Added an include now
3650         needed that was inherited from OwnPtr.h before.
3651
3652 2015-04-24  Antti Koivisto  <antti@apple.com>
3653
3654         Network Cache: Make path functions members
3655         https://bugs.webkit.org/show_bug.cgi?id=144146
3656
3657         Reviewed by Carlos Garcia Campos.
3658
3659         This simplifies the code.
3660
3661         * NetworkProcess/cache/NetworkCacheStorage.cpp:
3662         (WebKit::NetworkCache::Storage::partitionPathForKey):
3663         (WebKit::NetworkCache::Storage::recordPathForKey):
3664         (WebKit::NetworkCache::Storage::bodyPathForKey):
3665         (WebKit::NetworkCache::Storage::storeBodyAsBlob):
3666         (WebKit::NetworkCache::Storage::remove):
3667         (WebKit::NetworkCache::Storage::dispatchReadOperation):
3668         (WebKit::NetworkCache::Storage::finishReadOperation):
3669         (WebKit::NetworkCache::Storage::dispatchWriteOperation):
3670         (WebKit::NetworkCache::partitionPathForKey): Deleted.
3671         (WebKit::NetworkCache::recordPathForKey): Deleted.
3672         (WebKit::NetworkCache::bodyPathForKey): Deleted.
3673         * NetworkProcess/cache/NetworkCacheStorage.h:
3674
3675 2015-04-24  Carlos Garcia Campos  <cgarcia@igalia.com>
3676
3677         Unreviewed. Remove incorrect assert after r183189.
3678
3679         In this case the assert was already there, but it's incorrect
3680         because we are handling uninitialized attachments below in the
3681         same function, and also when sending messages. So, if it's ok to
3682         send uninitialized attachments, it's ok to receive them. This
3683         didn't fail before r183189, because we were only invaliding the
3684         attachments by setting the file descriptor to -1, and they were
3685         handled as null attachments. After r183189, the move operator
3686         resets the moved attachment leaving it uninitialized again.
3687
3688         * Platform/IPC/unix/ConnectionUnix.cpp:
3689         (IPC::Connection::processMessage):
3690
3691 2015-04-24  Carlos Garcia Campos  <cgarcia@igalia.com>
3692
3693         [SOUP] Use a webkit subdirectory for the disk cache
3694         https://bugs.webkit.org/show_bug.cgi?id=144048
3695
3696         Reviewed by Martin Robinson.
3697
3698         Recent versions of libsoup remove any file in cache dir not
3699         referenced by the index when the cache is loaded to workaround
3700         leaked resources when load/dump is unbalanced for whatever reason,
3701         like a crash. We currently use $XDG_CACHE_HOME/app-name as default
3702         disk cache directory, but that directory could be used by apps to
3703         cache other things, and the soup cache might end up deleting other
3704         stuff. The soup cache assumes the given directory is only for the
3705         disk cache, so we should ensure that.
3706
3707         * NetworkProcess/soup/NetworkProcessSoup.cpp:
3708         (WebKit::NetworkProcess::platformInitializeNetworkProcess): Append
3709         webkit to the given disk cache and clear the previous soup cache if it exists.
3710         * WebProcess/soup/WebProcessSoup.cpp:
3711         (WebKit::WebProcess::platformInitializeWebProcess): Ditto.
3712
3713 2015-04-24  Carlos Garcia Campos  <cgarcia@igalia.com>
3714
3715         Unreviewed. Remove incorrect ASSERT added in r183176.
3716
3717         We allow to encode null attachments.
3718
3719         * Platform/unix/SharedMemoryUnix.cpp:
3720         (WebKit::SharedMemory::Handle::releaseAttachment):
3721
3722 2015-04-23  Dan Bernstein  <mitz@apple.com>
3723
3724         <rdar://problem/20680694> Framework header postprocessing isn’t removing WK_DEPRECATED macros when it should.
3725
3726         Reviewed by Andy Estes.
3727
3728         * mac/postprocess-framework-headers.sh:
3729
3730 2015-04-23  Simon Fraser  <simon.fraser@apple.com>
3731
3732         Make it possible to detach GraphicsLayerCA backing store
3733         https://bugs.webkit.org/show_bug.cgi?id=144140
3734
3735         Reviewed by Tim Horton.
3736         
3737         This changes makes it possible to denote a GraphicsLayerCA's backing store
3738         as "attached" or not. When not attached, the backing store is made volatile
3739         and can be purged. This will be used in a future patch.
3740
3741         * Shared/mac/RemoteLayerBackingStore.mm:
3742         (WebKit::RemoteLayerBackingStore::~RemoteLayerBackingStore): Whitespace.
3743         (WebKit::RemoteLayerBackingStore::display): If backingStoreWillBeDisplayed()
3744         returns true, this indicates that the backing store was brought out of the
3745         "unreachable" list, so return true even if the backing store doesn't require
3746         painting.
3747         * Shared/mac/RemoteLayerBackingStoreCollection.h: C++11 initializer, and comments.
3748         * Shared/mac/RemoteLayerBackingStoreCollection.mm:
3749         (WebKit::RemoteLayerBackingStoreCollection::RemoteLayerBackingStoreCollection):
3750         (WebKit::RemoteLayerBackingStoreCollection::backingStoreWillBeDisplayed): Return true
3751         if the caller will need to submit the backing store in the current transaction.
3752         (WebKit::RemoteLayerBackingStoreCollection::backingStoreBecameUnreachable): This
3753         explicit dirtying is no longer necessary given the backingStoreWillBeDisplayed() change.
3754         * Shared/mac/RemoteLayerTreePropertyApplier.mm:
3755         (WebKit::applyPropertiesToLayer): Only set the layer's backing if we both have backing
3756         store, and it's attached.
3757         * Shared/mac/RemoteLayerTreeTransaction.h: New bit, and data member.
3758         * Shared/mac/RemoteLayerTreeTransaction.mm:
3759         (WebKit::RemoteLayerTreeTransaction::LayerProperties::LayerProperties):
3760         (WebKit::RemoteLayerTreeTransaction::LayerProperties::encode):
3761         (WebKit::RemoteLayerTreeTransaction::LayerProperties::decode):
3762         (WebKit::dumpChangedLayers):
3763         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
3764         (WebKit::PlatformCALayerRemote::recursiveBuildTransaction): Only call display()
3765         on the backing store if it's attached.
3766         (WebKit::PlatformCALayerRemote::setBackingStoreAttached):
3767         (WebKit::PlatformCALayerRemote::backingStoreAttached):
3768         * WebProcess/WebPage/mac/PlatformCALayerRemote.h:
3769         * WebProcess/WebPage/mac/RemoteLayerTreeContext.h:
3770         * WebProcess/WebPage/mac/RemoteLayerTreeContext.mm:
3771         (WebKit::RemoteLayerTreeContext::backingStoreWillBeDisplayed):
3772
3773 2015-04-23  Tim Horton  <timothy_horton@apple.com>
3774
3775         Quick Look preview popover is not dismissed on scroll in Mail
3776         https://bugs.webkit.org/show_bug.cgi?id=144119
3777         <rdar://problem/19752045>
3778
3779         Reviewed by Anders Carlsson.
3780
3781         * UIProcess/API/mac/WKView.mm:
3782         (-[WKView renewGState]):
3783         If we have a TextIndicator, dismiss all content relative child windows
3784         on renewGState, not just the TextIndicator itself.
3785
3786         This will fix cases like Mail, where WebKit isn't driving the scrolling,
3787         and we have no way (except renewGState) to know that scrolling is happening.
3788
3789 2015-04-23  Simon Fraser  <simon.fraser@apple.com>
3790
3791         Changing TiledBacking velocity should schedule a tile revalidation
3792         https://bugs.webkit.org/show_bug.cgi?id=144123
3793
3794         Reviewed by Tim Horton.
3795         
3796         Drive-by fix: use the FrameView& that we have already.
3797
3798         * WebProcess/WebPage/ios/WebPageIOS.mm:
3799         (WebKit::WebPage::updateVisibleContentRects):
3800
3801 2015-04-23  Jer Noble  <jer.noble@apple.com>
3802
3803         [Mac] Disable QTKit by default on future OS X.
3804         https://bugs.webkit.org/show_bug.cgi?id=144082
3805
3806         Reviewed by Darin Adler.
3807
3808         QTKitEnabled defaults to false.
3809
3810         * Shared/WebPreferencesDefinitions.h:
3811
3812 2015-04-23  Jer Noble  <jer.noble@apple.com>
3813
3814         [WK2][Mac] Tweak the timing curve of the WebKit Fullscreen animation
3815         https://bugs.webkit.org/show_bug.cgi?id=144120
3816
3817         Reviewed by Eric Carlson.
3818
3819         Tweak the curve to ease-in faster when the fullscreen animation duration is short.
3820
3821         * UIProcess/mac/WKFullScreenWindowController.mm:
3822         (timingFunctionForDuration):
3823         (zoomAnimation):
3824         (maskAnimation):
3825         (fadeAnimation):
3826
3827 2015-04-23  Enrica Casucci  <enrica@apple.com>
3828
3829         iOS build fix after r183208.
3830
3831         Unreviewed.
3832
3833         * UIProcess/ios/WKContentViewInteraction.mm:
3834
3835 2015-04-22  Alexey Proskuryakov  <ap@apple.com>
3836
3837         [iOS] WebKit services should inherit environment variables for home
3838         https://bugs.webkit.org/show_bug.cgi?id=144078
3839         rdar://problem/20571678
3840
3841         Reviewed by Dan Bernstein.
3842
3843         Pass current environment variables as XPC bootstrap. Also while at it, made
3844         _CFBundleSetupXPCBootstrap not soft linked.
3845
3846         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.mm:
3847         (main):
3848         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
3849         (WebKit::connectToService):
3850
3851 2015-04-23  Enrica Casucci  <enrica@apple.com>
3852
3853         Support share button.
3854         https://bugs.webkit.org/show_bug.cgi?id=144077
3855         rdar://problem/19772892
3856
3857         Reviewed by Darin Adler.
3858
3859         * UIProcess/ios/WKContentViewInteraction.mm:
3860         (-[WKContentView _share:]):
3861         (-[WKContentView canPerformAction:withSender:]):
3862         (-[WKContentView _define:]):
3863         (-[WKContentView accessibilityRetrieveSpeakSelectionContent]):
3864         (-[WKContentView moveByOffset:]):
3865         (-[WKContentView requestAutocorrectionRectsForString:withCompletionHandler:]):
3866         (-[WKContentView applyAutocorrection:toString:withCompletionHandler:]):
3867         (-[WKContentView requestAutocorrectionContextWithCompletionHandler:]):
3868         (-[WKContentView accessoryTab:]):
3869         (-[WKContentView _becomeFirstResponderWithSelectionMovingForward:completionHandler:]):
3870         (-[WKContentView executeEditCommandWithCallback:]):
3871
3872 2015-04-23  Carlos Garcia Campos  <cgarcia@igalia.com>
3873
3874         [UNIX] Do not allow copies of IPC::Attachment
3875         https://bugs.webkit.org/show_bug.cgi?id=144096
3876
3877         Reviewed by Darin Adler.
3878
3879         It ensures that the file descriptor ownership is always correctly
3880         transferred. This way we can remove the dispose() method to
3881         explicitly close the file descriptor and always close it in the
3882         Attachment destructor (unless explicitly transferred to
3883         IPC::Connection or SharedMemory). It simplifies the code and
3884         ensure we don't leak file descriptors.
3885
3886         * Platform/IPC/ArgumentDecoder.cpp:
3887         (IPC::ArgumentDecoder::~ArgumentDecoder): Remove the code to
3888         explicitly dispose attachments.
3889         (IPC::ArgumentDecoder::removeAttachment): Use WTF::move().
3890         * Platform/IPC/ArgumentEncoder.cpp:
3891         (IPC::ArgumentEncoder::~ArgumentEncoder): Remove the code to
3892         explicitly dispose attachments.
3893         (IPC::ArgumentEncoder::addAttachment): Use WTF::move().
3894         (IPC::ArgumentEncoder::releaseAttachments): Simplify by using WTF::move().
3895         * Platform/IPC/ArgumentEncoder.h:
3896         * Platform/IPC/Attachment.cpp:
3897         (IPC::Attachment::encode): Move a copy of the attachment, and
3898         reset the file descriptor, since the ownership is passed to the encoder.
3899         * Platform/IPC/Attachment.h: Make copy constructor and assignment
3900         private to not allow public copies. The only copy allowed is done
3901         by Attachment::encode(). Make m_fileDescriptor mutable so that we
3902         can reset it in Attachment::encode() after passing the ownership
3903         to the encoder.
3904         * Platform/IPC/unix/AttachmentUnix.cpp:
3905         (IPC::Attachment::~Attachment): Close the file descriptor if it
3906         hasn't been released explicitly.
3907         (IPC::Attachment::dispose): Deleted.
3908         * Platform/IPC/unix/ConnectionUnix.cpp:
3909         (IPC::Connection::processMessage): Do not use AttachmentResourceGuard.
3910         (IPC::Connection::sendOutgoingMessage): Ditto.
3911         (IPC::AttachmentResourceGuard::AttachmentResourceGuard): Deleted.
3912         (IPC::AttachmentResourceGuard::~AttachmentResourceGuard): Deleted.
3913         * Platform/unix/SharedMemoryUnix.cpp:
3914         (WebKit::SharedMemory::Handle::~Handle): Do not call clear().
3915         (WebKit::SharedMemory::Handle::clear): Reset the attachment.
3916         * UIProcess/WebInspectorProxy.cpp:
3917         (WebKit::WebInspectorProxy::createInspectorPage): Use WTF::move().
3918         * WebProcess/Plugins/PluginProcessConnectionManager.cpp:
3919         (WebKit::PluginProcessConnectionManager::getPluginProcessConnection):
3920         Call releaseFileDescriptor() instead of fileDescritpro() since the
3921         ownership is passed to the connection.
3922
3923 2015-04-23  Alexey Proskuryakov  <ap@apple.com>
3924
3925         Build fix.
3926
3927         * WebProcess/cocoa/WebProcessCocoa.mm: Correct the case of an include file name.
3928
3929 2015-04-23  Carlos Garcia Campos  <cgarcia@igalia.com>
3930
3931         Unreviewed. Fix debug build after r183176.
3932
3933         * Platform/unix/SharedMemoryUnix.cpp:
3934         (WebKit::SharedMemory::Handle::decode):
3935         (WebKit::SharedMemory::createHandle):
3936
3937 2015-04-23  Andreas Kling  <akling@apple.com>
3938
3939         There should only be one way to get the system memory size.
3940         <https://webkit.org/b/144081>
3941
3942         Reviewed by Antti Koivisto.
3943
3944         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
3945         (WebKit::NetworkProcess::platformSetCacheModel):
3946         (WebKit::memorySize): Deleted.
3947         * WebProcess/cocoa/WebProcessCocoa.mm:
3948         (WebKit::WebProcess::platformSetCacheModel):
3949         (WebKit::memorySize): Deleted.
3950
3951 2015-04-23  Chris Dumez  <cdumez@apple.com>
3952
3953         [WK2] WebDiagnosticLoggingClient is leaking
3954         https://bugs.webkit.org/show_bug.cgi?id=144089
3955         <rdar://problem/19706214>
3956
3957         Reviewed by Darin Adler.
3958
3959         WebDiagnosticLoggingClient is leaking. It is constructed inside WebPage
3960         constructor but there is no code destroying it.
3961
3962         This patch adds a new xxxDestroyed() virtual function to
3963         DiagnosticLoggingClient and that is overriden in
3964         WebDiagnosticLoggingClient to call "delete this". This is the same
3965         pattern as for other WK2 clients (e.g. WebFrameLoaderClient,
3966         WebProgressTrackerClient).
3967
3968         * WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.cpp:
3969         (WebKit::WebDiagnosticLoggingClient::mainFrameDestroyed):
3970         * WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.h:
3971
3972 2015-04-23  Carlos Garcia Campos  <cgarcia@igalia.com>
3973
3974         [UNIX] Simplify the file descriptor handling in SharedMemory
3975         https://bugs.webkit.org/show_bug.cgi?id=144046
3976
3977         Reviewed by Darin Adler.
3978
3979         Simplify the file descriptor handling and clarify its ownership by
3980         using IPC::Attachment in SharedMemory::Handle instead of fd and
3981         size members. SharedMemory::Handle::adoptFromAttachment() has been
3982         renamed as SharedMemory::Handle::adoptAttachment() and receives an
3983         IPC::Attachment. And SharedMemory::Handle::releaseToAttachment()
3984         has been renamed as SharedMemory::Handle::releaseAttachment().
3985
3986         * Platform/IPC/Attachment.h: Add move constructor and move assigned operator.
3987         * Platform/IPC/Connection.h:
3988         (IPC::Connection::identifierIsNull): A file descriptor is null
3989         when it's -1 no 0.
3990         * Platform/IPC/unix/AttachmentUnix.cpp:
3991         (IPC::Attachment::Attachment):
3992         (IPC::Attachment::operator=):
3993         (IPC::Attachment::dispose): Reset the file descriptor after
3994         closing it.
3995         * Platform/IPC/unix/ConnectionUnix.cpp:
3996         (IPC::Connection::processMessage): Use
3997         SharedMemory::Handle::adoptAttachment() that receives an
3998         IPC::Attachment now.
3999         (IPC::Connection::sendOutgoingMessage): Use
4000         SharedMemory::Handle::releaseAttachment().
4001         * Platform/SharedMemory.h:
4002         * Platform/unix/SharedMemoryUnix.cpp:
4003         (WebKit::SharedMemory::Handle::Handle): Remove initializers for
4004         file descriptor and size members.
4005         (WebKit::SharedMemory::Handle::clear): Dispose the attachment.
4006         (WebKit::SharedMemory::Handle::isNull): Handle is null if the
4007         attachment file descriptor is -1.
4008         (WebKit::SharedMemory::Handle::encode): Use releaseAttachment().
4009         (WebKit::SharedMemory::Handle::decode): Use adoptAttachment().
4010         (WebKit::SharedMemory::Handle::releaseAttachment): Implement it
4011         using move.
4012         (WebKit::SharedMemory::Handle::adoptAttachment): Ditto.
4013         (WebKit::SharedMemory::map): Use
4014         IPC::Attachment::releaseFileDescriptor() instead of manually
4015         changing the member.
4016         (WebKit::SharedMemory::createHandle): Initialize the handle
4017         attachment with the duplicated file descriptor and size.
4018
4019 2015-04-22  Darin Adler  <darin@apple.com>
4020
4021         Remove OwnPtr and PassOwnPtr use from WebKit/cf, WebKit/mac, and WebKit2
4022         https://bugs.webkit.org/show_bug.cgi?id=143943
4023
4024         Reviewed by Anders Carlsson.
4025
4026         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h:
4027         Removed unneeded include.
4028
4029 2015-04-22  Brent Fulgham  <bfulgham@apple.com>
4030
4031         VisibleSelection should only accept Range by reference
4032         https://bugs.webkit.org/show_bug.cgi?id=144047
4033
4034         Reviewed by Tim Horton.
4035
4036         Update all uses of VisibleSelection to pass a Range reference instead
4037         of a Range pointer.
4038
4039         * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
4040         (WebKit::InjectedBundleRangeHandle::renderedImage):
4041         * WebProcess/WebPage/FindController.cpp:
4042         (WebKit::FindController::getImageForFindMatch):
4043         (WebKit::FindController::selectFindMatch):
4044         * WebProcess/WebPage/WebPage.cpp:
4045         (WebKit::WebPage::insertTextAsync):
4046         (WebKit::WebPage::setCompositionAsync):
4047         * WebProcess/WebPage/mac/WebPageMac.mm:
4048         (WebKit::WebPage::insertDictatedTextAsync):
4049
4050 2015-04-22  Anders Carlsson  <andersca@apple.com>
4051
4052         Add WK_ARRAY and WK_SET annotations
4053         https://bugs.webkit.org/show_bug.cgi?id=144075
4054         rdar://problem/19417770
4055
4056         Reviewed by Dan Bernstein.
4057
4058         * Shared/API/Cocoa/WKFoundation.h:
4059         * UIProcess/API/Cocoa/WKBackForwardList.h:
4060         * UIProcess/API/Cocoa/WKUserContentController.h:
4061         * UIProcess/API/Cocoa/WKWebsiteDataRecord.h:
4062         * UIProcess/API/Cocoa/WKWebsiteDataStore.h:
4063         * mac/postprocess-framework-headers.sh:
4064
4065 2015-04-22  Brent Fulgham  <bfulgham@apple.com>
4066
4067         Unreviewed build fix after r183136.
4068
4069         * WebProcess/WebPage/mac/WebPageMac.mm: Correct capitalization of
4070         'HTMLPluginImageElement.h' -> 'HTMLPlugInImageElement.h'
4071
4072 2015-04-21  Brent Fulgham  <bfulgham@apple.com>
4073
4074         Extend action menus to support PDF
4075         https://bugs.webkit.org/show_bug.cgi?id=143895
4076         <rdar://problem/19003333>
4077
4078         Reviewed by Tim Horton.
4079
4080         If the mouse pointer is over a PDF, try to provide a relevant action menu for whatever
4081         content is under the mouse. For now, we only support copying text and handling URLs.
4082
4083         If no text is selected, use the dictionary lookup service to find a semantically appropriate
4084         selection underneath the mouse. This is consistent with how normal text is treated in pure HTML
4085         views. If some text is already selected, and the mouse is over the existing selection, continue
4086         using the selected text. Otherwise, discard the old selection and select the most appropriate
4087         region under the mouse pointer.