af935baa76d8d49106c63f24937c6a56715157d2
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2015-06-06  Dan Bernstein  <mitz@apple.com>
2
3         Don’t enable manual sandboxing in the iOS Simulator. This should fix all the tests timing out.
4
5         * Configurations/DebugRelease.xcconfig:
6
7 2015-06-06  Dan Bernstein  <mitz@apple.com>
8
9         [iOS] Can’t debug with Development XPC services due to automatic sandboxing
10         https://bugs.webkit.org/show_bug.cgi?id=145731
11
12         Rubber-stamped by Darin Adler.
13
14         In iOS, the XPC services are automatically sandboxed based on their entitlements. The
15         sandbox doesn’t allow them to re-exec, which is necessary for linking against engineering
16         builds of the WebKit frameworks placed in a non-system location.
17
18         The solution is to opt Engineering builds into manual sandboxing.
19
20         * Configurations/BaseTarget.xcconfig:
21         - Add ENABLE_MANUAL_SANDBOXING to
22           GCC_PREPROCESSOR_DEFINITIONS when WK_MANUAL_SANDBOXING_ENABLED is YES.
23         - Set WK_MANUAL_SANDBOXING_ENABLED to YES for OS X, because we always use manual
24           sandboxing on that platform.
25
26         * Configurations/DebugRelease.xcconfig: Removed unused definition of DEBUG_OR_RELEASE. Set
27           WK_MANUAL_SANDBOXING_ENABLED to YES for all engineering builds.
28
29         * Configurations/BaseXPCService.xcconfig: Define CODE_SIGN_ENTITLEMENTS for iOS to be empty
30           if the service is not installed; to use the base entitlements file from Configurations if
31           manual sandboxing is not enabled; and to use a derived entitlements file, which doesn’t
32           specify a sandbox profile, if manual sandboxing is enabled.
33
34         * Configurations/DatabaseService.Development.xcconfig: Define
35           WK_XPC_SERVICE_IOS_ENTITLEMENTS_BASE and let BaseXPCService.xcconfig define
36           CODE_SIGN_ENTITLEMENTS for iOS.
37
38         * Configurations/DatabaseService.xcconfig: Ditto.
39         * Configurations/NetworkService.Development.xcconfig: Ditto.
40         * Configurations/NetworkService.xcconfig: Ditto.
41         * Configurations/WebContentService.Development.xcconfig: Ditto.
42         * Configurations/WebContentService.xcconfig: Ditto.
43
44         * WebKit2.xcodeproj/project.pbxproj:
45         - In the Derived Sources target, added a Derive Entitlements for Manual Sandboxing script
46           build phase. When building for iOS with manual sandboxing enabled, it creates copies of
47           the iOS entitlements files with a -no-sandbox suffix and the seatbelt-profiles key
48           removed.
49         - In the WebKit target, added a Copy iOS Sandbox Profiles for Manual Sandboxing script build
50           phase. When building for iOS with manual sandboxing enabled, it copies the iOS sandbox
51           profiles into the framework, so that the services can apply them to themselves at runtime.
52
53         * Shared/ios/ChildProcessIOS.mm:
54         (WebKit::ChildProcess::initializeSandbox): Use ENABLE(MANUAL_SANDBOXING) and don’t define it
55         here.
56
57         * WebProcess/cocoa/WebProcessCocoa.mm:
58         (WebKit::WebProcess::initializeSandbox): Use ENABLE(MANUAL_SANDBOXING) instead of defining
59         and using ENABLE_MANUAL_WEBPROCESS_SANDBOXING here.
60
61 2015-06-06  Anders Carlsson  <andersca@apple.com>
62
63         Remove support from getting plug-in information from Carbon resources
64         https://bugs.webkit.org/show_bug.cgi?id=145730
65
66         Reviewed by Dan Bernstein.
67
68         No current plug-in versions use this feature, and both Chrome and Mozilla for
69         Mac stopped looking at Carbon resources years ago.
70
71         * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
72         (WebKit::NetscapePluginModule::getPluginInfo):
73         (WebKit::ResourceMap::ResourceMap): Deleted.
74         (WebKit::ResourceMap::~ResourceMap): Deleted.
75         (WebKit::ResourceMap::isValid): Deleted.
76         (WebKit::getStringListResource): Deleted.
77         (WebKit::getPluginInfoFromCarbonResources): Deleted.
78
79 2015-06-05  Anders Carlsson  <andersca@apple.com>
80
81         Only allow plug-ins to create custom MIME property lists on older versions of OS X
82         https://bugs.webkit.org/show_bug.cgi?id=145716
83
84         Reviewed by Dan Bernstein.
85
86         * PluginProcess/EntryPoint/mac/LegacyProcess/PluginProcessMain.mm:
87         * Shared/Plugins/Netscape/NetscapePluginModule.h:
88         * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
89         (WebKit::getMIMETypesFromPluginBundle):
90         * UIProcess/Plugins/PluginProcessProxy.h:
91         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
92
93 2015-06-05  Chris Dumez  <cdumez@apple.com>
94
95         [WK2][iOS] Limit the number of vnodes used by the WebContent processes
96         https://bugs.webkit.org/show_bug.cgi?id=145672
97         <rdar://problem/21126637>
98
99         Reviewed by Antti Koivisto.
100
101         Have the WebContent process register a vnode pressure handler on iOS,
102         which calls the memory pressure handler.
103
104         On non-critical pressure, it will prune dead resources from the memory
105         cache, which should free up some vnodes. On critical pressure, the
106         handler will clear the PageCache and do a JS GC, which should free even
107         more vnodes.
108
109         * WebProcess/cocoa/WebProcessCocoa.mm:
110         (WebKit::WebProcess::platformInitializeWebProcess):
111
112 2015-06-05  Anders Carlsson  <andersca@apple.com>
113
114         Fix refacto, don't put IndexedDB databases in the cache directory
115         https://bugs.webkit.org/show_bug.cgi?id=145714
116
117         Reviewed by Antti Koivisto.
118
119         * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
120         (API::WebsiteDataStore::defaultIndexedDBDatabaseDirectory):
121
122 2015-06-05  Anders Carlsson  <andersca@apple.com>
123
124         Make the network cache directory part of WKContextConfigurationRef
125         https://bugs.webkit.org/show_bug.cgi?id=145711
126
127         Reviewed by Antti Koivisto.
128
129         Also, make the UI process be in control of where we place the new network cache.
130         When using the Modern WebKit API, put the cache in ~/Library/Caches/<Bundle ID>/WebKit/NetworkCache,
131         and put the cache in ~/Library/Caches/<Bundle ID>/WebKitCache otherwise (this is just for Safari).
132
133         * NetworkProcess/cache/NetworkCacheStorage.cpp:
134         (WebKit::NetworkCache::Storage::open):
135         * UIProcess/API/APIProcessPoolConfiguration.cpp:
136         (API::ProcessPoolConfiguration::createWithLegacyOptions):
137         (API::ProcessPoolConfiguration::ProcessPoolConfiguration):
138         (API::ProcessPoolConfiguration::copy):
139         * UIProcess/API/APIProcessPoolConfiguration.h:
140         * UIProcess/API/C/WKContext.cpp:
141         (WKContextSetDiskCacheDirectory): Deleted.
142         * UIProcess/API/C/WKContextConfigurationRef.cpp:
143         (WKContextConfigurationCopyDiskCacheDirectory):
144         (WKContextConfigurationSetDiskCacheDirectory):
145         * UIProcess/API/C/WKContextConfigurationRef.h:
146         * UIProcess/API/C/WKContextPrivate.h:
147         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
148         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
149         (WebKit::WebProcessPool::legacyPlatformDefaultNetworkCacheDirectory):
150         (WebKit::WebProcessPool::isNetworkCacheEnabled):
151         (WebKit::WebProcessPool::platformDefaultDiskCacheDirectory): Deleted.
152         * UIProcess/WebProcessPool.cpp:
153         (WebKit::legacyWebsiteDataStoreConfiguration):
154         (WebKit::WebProcessPool::WebProcessPool):
155         (WebKit::WebProcessPool::ensureNetworkProcess):
156         (WebKit::WebProcessPool::diskCacheDirectory): Deleted.
157         * UIProcess/WebProcessPool.h:
158
159 2015-06-05  Anders Carlsson  <andersca@apple.com>
160
161         Make the application cache directory part of WKContextConfigurationRef
162         https://bugs.webkit.org/show_bug.cgi?id=145704
163
164         Reviewed by Geoffrey Garen.
165
166         * UIProcess/API/APIProcessPoolConfiguration.cpp:
167         (API::ProcessPoolConfiguration::createWithLegacyOptions):
168         (API::ProcessPoolConfiguration::ProcessPoolConfiguration):
169         (API::ProcessPoolConfiguration::copy):
170         * UIProcess/API/APIProcessPoolConfiguration.h:
171         * UIProcess/API/C/WKContext.cpp:
172         (WKContextSetApplicationCacheDirectory): Deleted.
173         * UIProcess/API/C/WKContextConfigurationRef.cpp:
174         (WKContextConfigurationCopyApplicationCacheDirectory):
175         (WKContextConfigurationSetApplicationCacheDirectory):
176         * UIProcess/API/C/WKContextConfigurationRef.h:
177         * UIProcess/API/C/WKContextPrivate.h:
178         * UIProcess/WebProcessPool.cpp:
179         (WebKit::WebProcessPool::WebProcessPool):
180         (WebKit::WebProcessPool::createNewWebProcess):
181         (WebKit::WebProcessPool::applicationCacheDirectory): Deleted.
182         * UIProcess/WebProcessPool.h:
183
184 2015-06-05  Mark Lam  <mark.lam@apple.com>
185
186         finally blocks should not set the exception stack trace when re-throwing the exception.
187         https://bugs.webkit.org/show_bug.cgi?id=145525
188
189         Reviewed by Geoffrey Garen.
190
191         * WebProcess/InjectedBundle/InjectedBundle.cpp:
192         (WebKit::InjectedBundle::reportException):
193         - Changed to use the new Exception object.
194
195 2015-06-05  Anders Carlsson  <andersca@apple.com>
196
197         Disable the CFNetwork cache in the web process
198         https://bugs.webkit.org/show_bug.cgi?id=145700
199         rdar://problem/20243343
200
201         Reviewed by Geoffrey Garen.
202
203         * NetworkProcess/cache/NetworkCacheStorage.cpp:
204         (WebKit::NetworkCache::Storage::open):
205         * Shared/WebProcessCreationParameters.cpp:
206         (WebKit::WebProcessCreationParameters::WebProcessCreationParameters): Deleted.
207         (WebKit::WebProcessCreationParameters::encode): Deleted.
208         (WebKit::WebProcessCreationParameters::decode): Deleted.
209         * Shared/WebProcessCreationParameters.h:
210         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
211         (WebKit::WebProcessPool::platformInitializeWebProcess): Deleted.
212         * UIProcess/WebProcessPool.cpp:
213         (WebKit::WebProcessPool::createNewWebProcess): Deleted.
214         * WebProcess/WebProcess.cpp:
215         (WebKit::WebProcess::WebProcess): Deleted.
216         (WebKit::WebProcess::initializeWebProcess): Deleted.
217         * WebProcess/WebProcess.h:
218         * WebProcess/cocoa/WebProcessCocoa.mm:
219         (WebKit::WebProcess::platformClearResourceCaches):
220         (WebKit::WebProcess::platformInitializeWebProcess):
221         (WebKit::WebProcess::platformSetCacheModel): Deleted.
222         (WebKit::WebProcess::platformTerminate): Deleted.
223
224 2015-06-05  Anders Carlsson  <andersca@apple.com>
225
226         Consolidate default website data directory computations
227         https://bugs.webkit.org/show_bug.cgi?id=145698
228
229         Reviewed by Andreas Kling.
230
231         * UIProcess/API/APIProcessPoolConfiguration.cpp:
232         (API::ProcessPoolConfiguration::ProcessPoolConfiguration):
233         * UIProcess/API/APIWebsiteDataStore.h:
234         * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
235         (API::WebsiteDataStore::defaultApplicationCacheDirectory):
236         (API::WebsiteDataStore::defaultNetworkCacheDirectory):
237         (API::WebsiteDataStore::defaultIndexedDBDatabaseDirectory):
238         (API::WebsiteDataStore::defaultLocalStorageDirectory):
239         (API::WebsiteDataStore::defaultMediaKeysStorageDirectory):
240         (API::WebsiteDataStore::defaultWebSQLDatabaseDirectory):
241         (API::WebsiteDataStore::defaultDataStoreConfiguration):
242         (API::applicationCacheDirectory): Deleted.
243
244 2015-06-01  Jon Honeycutt  <jhoneycutt@apple.com>
245
246         [iOS] Uploading an animated GIF from the photo library uploads a JPEG
247
248         <https://bugs.webkit.org/show_bug.cgi?id=145539>
249         <rdar://problem/19760877
250
251         Selecting a photo from the photo library using UIImagePickerController
252         results in an NSDictionary with image info and a UIImage with the
253         image. It's not possible to get the original image data from the
254         UIImage, only a PNG or JPEG representation, so we were getting a JPEG
255         representation and uploading that to the server. For animated GIFs,
256         this meant a JPEG representation of the first frame.
257
258         To fix this, we'll get the asset URL, if available, and use the Photos
259         API to query for the original image data.
260
261         Reviewed by Andy Estes and Joe Pecoraro.
262
263         * UIProcess/ios/forms/WKFileUploadPanel.mm:
264         Soft link the Photos framework.
265
266         (-[WKFileUploadPanel _uploadItemForImageData:originalImage:imageName:successBlock:failureBlock:]):
267         Save the image's data to a temporary location, and create a
268         _WKImageFileUploadItem. Code moved from
269         -_uploadItemFromMediaInfo:successBlock:failureBlock:.
270
271         (-[WKFileUploadPanel _uploadItemForJPEGRepresentationOfImage:successBlock:failureBlock:]):
272         Get a JPEG representation of the UIImage, and create an upload item
273         from that data.
274
275         (uploadImageNameFromUTI):
276         Return a filename for the uploaded image based on the UTI.
277
278         (-[WKFileUploadPanel _uploadItemForImage:withAssetURL:successBlock:failureBlock:]):
279         Fetch the photo asset with the given asset URL. Create an image manager
280         object, and request the image data for the photo asset. Create an
281         upload item from that data. If we fail, fall back to a JPEG
282         representation.
283
284         (-[WKFileUploadPanel _uploadItemFromMediaInfo:successBlock:failureBlock:]):
285         Return early if the media item is not an image type. If it is, and we
286         have an asset URL, try to create an upload item for the native image.
287         If we don't have an asset URL, use a JPEG representation of the image.
288
289 2015-06-04  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
290
291         REGRESSION(r185091): Crash happens on indexdb tests
292         https://bugs.webkit.org/show_bug.cgi?id=145549
293
294         Reviewed by Darin Adler.
295
296         * WebProcess/Databases/IndexedDB/WebIDBServerConnection.cpp: Remove leakRef() use.
297         (WebKit::WebIDBServerConnection::didCreateObjectStore):
298         (WebKit::WebIDBServerConnection::didCreateIndex):
299         (WebKit::WebIDBServerConnection::didDeleteIndex):
300         (WebKit::WebIDBServerConnection::didPutRecord):
301         (WebKit::WebIDBServerConnection::didGetRecord):
302         (WebKit::WebIDBServerConnection::didOpenCursor):
303         (WebKit::WebIDBServerConnection::didAdvanceCursor):
304         (WebKit::WebIDBServerConnection::didIterateCursor):
305         (WebKit::WebIDBServerConnection::didCount):
306         (WebKit::WebIDBServerConnection::didDeleteRange):
307         (WebKit::WebIDBServerConnection::didClearObjectStore):
308         (WebKit::WebIDBServerConnection::didDeleteObjectStore):
309         (WebKit::WebIDBServerConnection::didChangeDatabaseVersion):
310
311 2015-06-04  Joseph Pecoraro  <pecoraro@apple.com>
312
313         Web Inspector: REGRESSION: dragged node in the DOM Tree isn't positioned correctly
314         https://bugs.webkit.org/show_bug.cgi?id=143912
315
316         Reviewed by Simon Fraser.
317
318         * UIProcess/mac/PageClientImpl.mm:
319         (WebKit::PageClientImpl::setDragImage):
320         When using the WKWebView, convert the position from the WKView's
321         coordinate system to the WKWebView's.
322
323         * UIProcess/API/Cocoa/WKWebView.mm:
324         (-[WKWebView draggingUpdated:]):
325         * UIProcess/API/mac/WKView.mm:
326         (-[WKView _dragImageForView:withImage:at:linkDrag:]):
327         Whitespace cleanup in original drag code.
328
329 2015-06-04  Dan Bernstein  <mitz@apple.com>
330
331         Fixed the build.
332
333         * UIProcess/API/Cocoa/WKErrorPrivate.h:
334
335 2015-06-04  Dan Bernstein  <mitz@apple.com>
336
337         Renamed the WebKit2SandboxProfiles target to Sandbox Profiles.
338
339         Rubber-stamped by Anders Carlsson.
340
341         * WebKit2.xcodeproj/project.pbxproj: Renamed the target. For now, added an aggregate
342         target with the old name that depends on the renamed target. We can remove it once the build
343         system doesn’t reference to old name.
344
345 2015-06-03  Dan Bernstein  <mitz@apple.com>
346
347         [Cocoa] Expose interruptedForPolicyChangeError
348         https://bugs.webkit.org/show_bug.cgi?id=145627
349
350         Reviewed by Anders Carlsson.
351
352         * UIProcess/API/Cocoa/WKErrorPrivate.h: Added WKErrorCodeFrameLoadInterruptedByPolicyChange with the same value as
353         kWKErrorCodeFrameLoadInterruptedByPolicyChange.
354
355 2015-06-04  Chris Dumez  <cdumez@apple.com>
356
357         [WK2] Prune more resources from the MemoryCache before process suspension
358         https://bugs.webkit.org/show_bug.cgi?id=145633
359
360         Reviewed by Andreas Kling.
361
362         * NetworkProcess/NetworkProcess.cpp:
363         (WebKit::NetworkProcess::lowMemoryHandler):
364         (WebKit::NetworkProcess::initializeNetworkProcess):
365         (WebKit::NetworkProcess::processWillSuspendImminently):
366         (WebKit::NetworkProcess::prepareToSuspend):
367         * NetworkProcess/NetworkProcess.h:
368         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
369         (WebKit::NetworkProcess::platformLowMemoryHandler):
370         * PluginProcess/PluginProcess.cpp:
371         (WebKit::PluginProcess::initializeProcess):
372
373         Update low memory handler prototype to match WebCore changes.
374
375         * WebProcess/WebProcess.cpp:
376         (WebKit::WebProcess::actualPrepareToSuspend):
377
378         Pass Synchronous::Yes argument to MemoryPressureHandler::releaseMemory()
379         to request that the memory is free up synchronously (e.g. synchronous
380         JS garbage collection) as the process is about to be suspended.
381         Previously, the memory pressure handler was trying to detect this case
382         by checking if the system was really under memory pressure but this was
383         a bit hackish and it wouldn't work if the process happened to get
384         suspended while the system was under memory pressure.
385
386 2015-06-03  Carlos Alberto Lopez Perez  <clopez@igalia.com>
387
388         [GTK] [Wayland] Build is broken on trunk
389         https://bugs.webkit.org/show_bug.cgi?id=142879
390
391         Reviewed by Carlos Garcia Campos.
392
393         * WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp:
394         (WebKit::LayerTreeHostGtk::makeContextCurrent): When Wayland target
395         is enabled GLNativeWindowType is not an u_int64 type.
396         Cast contextID to avoid a build failure.
397
398 2015-06-03  Dan Bernstein  <mitz@apple.com>
399
400         Made WKBackForwardListItemPrivate.h a private header after it was added as internal in r185183.
401
402         * WebKit2.xcodeproj/project.pbxproj:
403
404 2015-06-03  Hyungwook Lee  <hyungwook.lee@navercorp.com>
405
406         [EFL] Implement window_object_cleared callback in EwkPageClient.
407         https://bugs.webkit.org/show_bug.cgi?id=145603
408
409         Reviewed by Gyuyoung Kim.
410
411         We need to provide right timing for custom JS API that may need to work at the beginning of the page.
412
413         * UIProcess/API/efl/tests/extensions/extension_sample.cpp:
414         * WebProcess/InjectedBundle/API/efl/ewk_page.cpp:
415         (EwkPage::EwkPage):
416         (EwkPage::didStartProvisionalLoadForFrame):
417         (EwkPage::didClearWindowObjectForFrame):
418         (EwkPage::didFinishDocumentLoadForFrame):
419         * WebProcess/InjectedBundle/API/efl/ewk_page.h:
420         * WebProcess/InjectedBundle/API/efl/ewk_page_private.h:
421
422 2015-06-03  Anders Carlsson  <andersca@apple.com>
423
424         Add SPI that returns the snapshot layer contents for a given back/forward list item
425         https://bugs.webkit.org/show_bug.cgi?id=145621
426
427         Reviewed by Dan Bernstein.
428
429         * UIProcess/API/Cocoa/WKBackForwardListItem.mm:
430         (-[WKBackForwardListItem _snapshotLayerContents]):
431         * UIProcess/API/Cocoa/WKBackForwardListItemInternal.h:
432         * UIProcess/API/Cocoa/WKBackForwardListItemPrivate.h: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKBackForwardListItemInternal.h.
433         * WebKit2.xcodeproj/project.pbxproj:
434
435 2015-06-02  Hyungwook Lee  <hyungwook.lee@navercorp.com>
436
437         [EFL] Implement load_started callback in EwkPageClient.
438         https://bugs.webkit.org/show_bug.cgi?id=145545
439
440         Reviewed by Gyuyoung Kim.
441
442         We need to provide load_started callback to web extension module.
443
444         * UIProcess/API/efl/tests/extensions/extension_sample.cpp:
445         * WebProcess/InjectedBundle/API/efl/ewk_page.cpp:
446         (EwkPage::EwkPage):
447         (EwkPage::remove):
448         (EwkPage::didStartProvisionalLoadForFrame):
449         (EwkPage::didFinishDocumentLoadForFrame):
450         * WebProcess/InjectedBundle/API/efl/ewk_page.h:
451         * WebProcess/InjectedBundle/API/efl/ewk_page_private.h:
452
453 2015-06-02  Gavin Barraclough  <barraclough@apple.com>
454
455         PDFs always think they're visible on iOS.
456         https://bugs.webkit.org/show_bug.cgi?id=145493
457         <rdar://problem/19668879>
458
459         Reviewed by Andreas Kling & Sam Weinig.
460
461         The problem here is that WKContentView is currently responsible for notifying the WebPageProxy
462         that the visibility may have changed, but when a PDF isn't showing the WKContentView isn't in
463         the view hierarchy and doesn't receive the didMoveToWindow notifications – and the WKPDFView
464         (which is in the view hierarchy) does not listen for these events.
465
466         Visibility of the page should really just track the visibility of the WKWebView (and when
467         actually assessing the visibility it largely does - the page client checks the web view's
468         visibility, bar a FIXME, and the foreground/background check, which needs to change).
469         So notifications should really just come from the WKWebView.
470
471         The WKWebView already listens for the didMoveToWindow notification, it just was only updating
472         the IsInWindow flag. Instead just update all flags, and the call to viewStateDidChange from
473         WKContentView can just be removed.
474
475         There is one problem with this in that it would reverse the order of the calls to
476         viewStateDidChange & _updateForScreen:, which would mean the the view would become visible before
477         updating the screen pixel density. To fix this, moving the call to _updateForScreen:
478         to willMoveToWindow:, to ensure it occurs before the page becomes visible.
479
480         This will also change behavior on Mac for WKWebView clients, in coalescing all view state changes
481         within the didMoveToWindow call. This is the direction we intended to go in anyway (the plan is
482         to remove the mayHaveChanged argument from viewStateDidChange - we're currently adding unnecessary
483         IPC traffic).
484
485         * UIProcess/API/Cocoa/WKWebView.mm:
486         (-[WKWebView didMoveToWindow]):
487             - should update all view state flags.
488         * UIProcess/API/ios/WKViewIOS.mm:
489         (-[WKView didMoveToWindow]):
490             - added to match WKWebView.mm, for WebKitTestRunner.
491         * UIProcess/ios/WKContentView.mm:
492         (-[WKContentView willMoveToWindow:]):
493             - should _updateForScreen:
494         (-[WKContentView didMoveToWindow]): Deleted.
495             - functionality moved to -[WKWebView didMoveToWindow], -[WKContentView didMoveToWindow].
496
497 2015-06-02  Chris Dumez  <cdumez@apple.com>
498
499         [iOS][WK2] Always mark layers as volatile for background pages
500         https://bugs.webkit.org/show_bug.cgi?id=145547
501         <rdar://problem/20663184>
502
503         Reviewed by Simon Fraser.
504
505         We previously marked layers as volatile when the WebProcess was about
506         to be suspended. Most of the time the WebProcess gets suspended when a
507         page goes into the background. However, it is not always true (see
508         radar), in which case the layers won't be marked as volatile and use
509         memory even though they are not visible.
510
511         We now mark layers as volatile as soon as the page goes into the
512         background, instead of relying on the WebProcess suspension mechanism
513         to do so.
514
515         A new ApplicationDidEnterBackground IPC message from the UIProcess to
516         the WebProcess is added (in addition to the pre-existing
517         ApplicationWillEnterForeground one). When the WebProcess receives this
518         message, it will freeze the layer tree state and mark the layers as
519         volatile (with a timer to keep retrying if needed), similarly to what
520         is already done in WebProcess::actualPrepareToSuspend().
521         When the ApplicationWillEnterForeground is received, we unfreeze the
522         layer tree state. The layers' volatile state will be automatically
523         updated when they are displayed (see setBufferVolatility() call in
524         RemoteLayerBackingStore::display()).
525
526         * UIProcess/WebPageProxy.h:
527         * UIProcess/ios/WKContentView.mm:
528         (-[WKContentView _applicationDidEnterBackground:]):
529         * UIProcess/ios/WebPageProxyIOS.mm:
530         (WebKit::WebPageProxy::applicationDidEnterBackground):
531         * WebProcess/WebPage/WebPage.cpp:
532         (WebKit::WebPage::WebPage):
533         (WebKit::WebPage::setLayerTreeStateIsFrozen):
534         (WebKit::WebPage::markLayersVolatileImmediatelyIfPossible):
535         * WebProcess/WebPage/WebPage.h:
536         * WebProcess/WebPage/WebPage.messages.in:
537         * WebProcess/WebPage/ios/WebPageIOS.mm:
538         (WebKit::WebPage::volatilityTimerFired):
539         (WebKit::WebPage::applicationDidEnterBackground):
540         (WebKit::WebPage::applicationWillEnterForeground):
541         * WebProcess/WebProcess.cpp:
542         (WebKit::WebProcess::markAllLayersVolatileIfPossible):
543         (WebKit::WebProcess::setAllLayerTreeStatesFrozen):
544
545 2015-06-02  Brady Eidson  <beidson@apple.com>
546
547         WebKit policy delegate should suggest if a navigation should be allowed to open URLs externally.
548         rdar://problem/21025301 and https://bugs.webkit.org/show_bug.cgi?id=145280
549         
550         Reviewed by Alex Christensen.
551
552         * WebProcess/Plugins/PDF/PDFPlugin.mm:
553         (WebKit::PDFPlugin::clickedLink):
554         
555         * WebProcess/Plugins/PluginView.cpp:
556         (WebKit::PluginView::performFrameLoadURLRequest):
557         (WebKit::PluginView::loadURL):
558         
559         * WebProcess/WebCoreSupport/WebContextMenuClient.cpp:
560         (WebKit::WebContextMenuClient::searchWithGoogle):
561         
562         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
563         (WebKit::WebFrameLoaderClient::dispatchCreatePage):
564         
565         * WebProcess/WebPage/WebInspector.cpp:
566         (WebKit::WebInspector::openInNewTab):
567         
568         * WebProcess/WebPage/WebPage.cpp:
569         (WebKit::WebPage::loadURLInFrame):
570         (WebKit::WebPage::loadRequest):
571         (WebKit::WebPage::loadDataImpl):
572         (WebKit::WebPage::navigateToPDFLinkWithSimulatedClick):
573
574 2015-06-02  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
575
576         REGRESSION(r185091): Crash happens on indexdb tests
577         https://bugs.webkit.org/show_bug.cgi?id=145549
578
579         Reviewed by Csaba Osztrogonác.
580
581         r185091 caused crash on some indexeddb tests. The crash happens because IDBDatabaseError::create() doesn't
582         dereference count by using ptr(). It makes a crash when dereferencing on ~Ref() destructor. To fix this issue,
583         this patch uses leakRef() instead of ptr().
584
585         * WebProcess/Databases/IndexedDB/WebIDBServerConnection.cpp:
586         (WebKit::WebIDBServerConnection::didCreateObjectStore):
587         (WebKit::WebIDBServerConnection::didCreateIndex):
588         (WebKit::WebIDBServerConnection::didDeleteIndex):
589         (WebKit::WebIDBServerConnection::didPutRecord):
590         (WebKit::WebIDBServerConnection::didGetRecord):
591         (WebKit::WebIDBServerConnection::didOpenCursor):
592         (WebKit::WebIDBServerConnection::didAdvanceCursor):
593         (WebKit::WebIDBServerConnection::didIterateCursor):
594         (WebKit::WebIDBServerConnection::didCount):
595         (WebKit::WebIDBServerConnection::didDeleteRange):
596         (WebKit::WebIDBServerConnection::didClearObjectStore):
597         (WebKit::WebIDBServerConnection::didDeleteObjectStore):
598         (WebKit::WebIDBServerConnection::didChangeDatabaseVersion):
599
600 2015-06-01  Enrica Casucci  <enrica@apple.com>
601
602         [iOS] Hardware Keyboard: All combinations for arrow keys with Shift do not extend the selection.
603         https://bugs.webkit.org/show_bug.cgi?id=145538
604         rdar://problem/18504199
605
606         Reviewed by Darin Adler.
607
608         The extend parameter was ignored in all the functions below.
609
610         * UIProcess/ios/WKContentViewInteraction.mm:
611         (-[WKContentView _moveUp:withHistory:]):
612         (-[WKContentView _moveDown:withHistory:]):
613         (-[WKContentView _moveLeft:withHistory:]):
614         (-[WKContentView _moveRight:withHistory:]):
615         (-[WKContentView _moveToStartOfWord:withHistory:]):
616         (-[WKContentView _moveToStartOfParagraph:withHistory:]):
617         (-[WKContentView _moveToStartOfLine:withHistory:]):
618         (-[WKContentView _moveToStartOfDocument:withHistory:]):
619         (-[WKContentView _moveToEndOfWord:withHistory:]):
620         (-[WKContentView _moveToEndOfParagraph:withHistory:]):
621         (-[WKContentView _moveToEndOfLine:withHistory:]):
622         (-[WKContentView _moveToEndOfDocument:withHistory:]):
623
624 2015-06-01  Anders Carlsson  <andersca@apple.com>
625
626         Use xpc_connection_set_oneshot_instance where possible
627         https://bugs.webkit.org/show_bug.cgi?id=145535
628         rdar://problem/21109994
629
630         Reviewed by Sam Weinig.
631
632         Use xpc_connection_set_oneshot_instance where possible; this will make sure that the 
633         web process instances go away when the web process exits.
634
635         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
636         (WebKit::connectToService):
637         (WebKit::connectToReExecService):
638
639 2015-06-01  Enrica Casucci  <enrica@apple.com>
640
641         [iOS] Hardware Keyboard: Command + left arrow does not work.
642         https://bugs.webkit.org/show_bug.cgi?id=145531
643         rdar://problem/18576402
644
645         Reviewed by Anders Carlsson.
646
647         We were calling a non existent command (moveToStartOfLine) instead of
648         moveToBeginningOfLine.
649
650         * UIProcess/ios/WKContentViewInteraction.mm:
651         (-[WKContentView _moveToStartOfLine:withHistory:]):
652
653 2015-06-01  Brady Eidson  <beidson@apple.com>
654
655         Add WKTR support for "should open external URLs".
656         https://bugs.webkit.org/show_bug.cgi?id=145505
657
658         Reviewed by Darin Adler.
659
660         Expose C-spi to allow WKTR to set this bit on new loads:
661         * UIProcess/API/C/WKPage.cpp:
662         (WKPageLoadURLWithShouldOpenExternalURLsPolicy):
663         * UIProcess/API/C/WKPagePrivate.h:
664         
665         Expose the bit on NavigationAction for the policy delegate:        
666         * WebProcess/InjectedBundle/API/c/WKBundleNavigationAction.cpp:
667         (WKBundleNavigationActionGetShouldOpenExternalURLs):
668         * WebProcess/InjectedBundle/API/c/WKBundleNavigationActionPrivate.h: Copied from Tools/WebKitTestRunner/WorkQueueManager.h.
669
670         * WebProcess/InjectedBundle/InjectedBundleNavigationAction.cpp:
671         (WebKit::InjectedBundleNavigationAction::InjectedBundleNavigationAction):
672         * WebProcess/InjectedBundle/InjectedBundleNavigationAction.h:
673         (WebKit::InjectedBundleNavigationAction::shouldOpenExternalURLs):
674     
675         * WebKit2.xcodeproj/project.pbxproj:
676
677 2015-06-01  Gavin Barraclough  <barraclough@apple.com>
678
679         PDFs always think they're visible on iOS.
680         https://bugs.webkit.org/show_bug.cgi?id=145493
681         <rdar://problem/19668879>
682
683         Unreviewed roll-out.
684
685         Temporarily reverting this change – will need a workaround for test harness craziness.
686
687         * UIProcess/API/Cocoa/WKWebView.mm:
688         (-[WKWebView didMoveToWindow]):
689         (-[WKWebView setOpaque:]):
690         * UIProcess/ios/WKContentView.mm:
691         (-[WKContentView willMoveToWindow:]):
692         (-[WKContentView didMoveToWindow]):
693         (-[WKContentView browsingContextController]):
694
695 2015-06-01  Csaba Osztrogonác  <ossy@webkit.org>
696
697         [EFL] Remove unused const variable from EwkView.cpp
698         https://bugs.webkit.org/show_bug.cgi?id=145512
699
700         Reviewed by Gyuyoung Kim.
701
702         * UIProcess/API/efl/EwkView.cpp:
703
704 2015-06-01  Csaba Osztrogonác  <ossy@webkit.org>
705
706         [cmake] Suppress unused parameter warnings in WebKit2 and TestNetscapePlugIn
707         https://bugs.webkit.org/show_bug.cgi?id=145264
708
709         Reviewed by Carlos Garcia Campos.
710
711         * CMakeLists.txt: Use COMPILE_FLAGS instead of CMAKE_<C|CXX>_FLAGS to put -Wno-unused-parameter after -Wextra.
712
713 2015-05-31  Gavin Barraclough  <barraclough@apple.com>
714
715         PDFs always think they're visible on iOS.
716         https://bugs.webkit.org/show_bug.cgi?id=145493
717         <rdar://problem/19668879>
718
719         Reviewed by Andreas Kling.
720
721         The problem here is that WKContentView is currently responsible for notifying the WebPageProxy
722         that the visibility may have changed, but when a PDF isn't showing the WKContentView isn't in
723         the view hierarchy and doesn't receive the didMoveToWindow notifications – and the WKPDFView
724         (which is in the view hierarchy) does not listen for these events.
725
726         Visibility of the page should really just track the visibility of the WKWebView (and when
727         actually assessing the visibility it largely does - the page client checks the web view's
728         visibility, bar a FIXME, and the foreground/background check, which needs to change).
729         So notifications should really just come from the WKWebView.
730
731         The WKWebView already listens for the didMoveToWindow notification, it just was only updating
732         the IsInWindow flag. Instead just update all flags, and the call to viewStateDidChange from
733         WKContentView can just be removed.
734
735         There is one problem with this in that it would reverse the order of the calls to
736         viewStateDidChange & _updateForScreen:, which would mean the the view would become visible before
737         updating the screen pixel density. To fix this, move the call to _updateForScreen: to
738         willMoveToWindow:, to ensure it occurs before the page becomes visible.
739
740         This will also change behavior on Mac for WKWebView clients, in coalescing all view state changes
741         within the didMoveToWindow call. This is the direction we intended to go in anyway (the plan is
742         to remove the mayHaveChanged argument from viewStateDidChange - we're currently adding unnecessary
743         IPC traffic).
744
745         * UIProcess/API/Cocoa/WKWebView.mm:
746         (-[WKWebView didMoveToWindow]):
747             - should update all view state flags.
748         * UIProcess/ios/WKContentView.mm:
749         (-[WKContentView willMoveToWindow:]):
750             - should _updateForScreen:
751         (-[WKContentView didMoveToWindow]): Deleted.
752             - functionality moved to -[WKWebView didMoveToWindow], -[WKContentView didMoveToWindow].
753
754 2015-05-30  Brady Eidson  <beidson@apple.com>
755
756         Make FrameLoader methods that take PassRefPtr<Event> take raw pointers instead.
757         https://bugs.webkit.org/show_bug.cgi?id=145495
758
759         Reviewed by Alexey Proskuryakov.
760
761         * WebProcess/WebPage/WebPage.cpp:
762         (WebKit::WebPage::navigateToPDFLinkWithSimulatedClick):
763
764 2015-05-29  Joseph Pecoraro  <pecoraro@apple.com>
765
766         Web Inspector: Crash closing a related tab with Web Inspector open while page is refreshing
767         https://bugs.webkit.org/show_bug.cgi?id=145488
768
769         Reviewed by Alexey Proskuryakov.
770
771         * WebProcess/WebPage/WebInspector.h:
772         * WebProcess/WebPage/WebInspector.cpp:
773         (WebKit::WebInspector::~WebInspector):
774         Ensure, no matter how we close, that we have invalidated the
775         frontend connection of which we are the client.
776
777         (WebKit::WebInspector::createInspectorPage):
778         This member variable will never be null.
779
780 2015-05-29  Andreas Kling  <akling@apple.com>
781
782         [iOS] When bouncing back from max pinch zoom scale, scaleChangeRate should be 0.
783         <https://webkit.org/b/145487>
784         <rdar://problem/20989389>
785
786         Reviewed by Benjamin Poulain.
787
788         Make sure we don't send WebCore some velocity data with non-zero scaleChangeRate
789         when we bounce back from being pinch-zoomed past the maximum scale.
790
791         This fixes an issue where the bounce-back animation would cause a burst of
792         unnecessary tile generation.
793
794         * WebProcess/WebPage/ios/WebPageIOS.mm:
795         (WebKit::adjustVelocityDataForBoundedScale):
796         (WebKit::WebPage::updateVisibleContentRects):
797
798 2015-05-29  Jon Lee  <jonlee@apple.com>
799
800         Fix preferences for wireless playback
801         https://bugs.webkit.org/show_bug.cgi?id=145477
802         rdar://problem/21166767
803
804         Reviewed by Anders Carlsson.
805
806         * UIProcess/API/C/WKPreferences.cpp: Add missing preference calls in C API.
807         * UIProcess/API/C/WKPreferencesRef.h:
808
809 2015-05-29  Enrica Casucci  <enrica@apple.com>
810
811         [iOS] Cursor hidden in text area once it scrolls.
812         https://bugs.webkit.org/show_bug.cgi?id=145451
813         rdar://problem/20356413
814
815         Reviewed by Simon Fraser.
816
817         This patch fixes both the touch scrolling inside the
818         overflow area as well as the programmatic scroll that
819         occurs when inserting a new line. The first issue is fixed by
820         implementing the chrome client methods didLayout,
821         didStartOverflowScroll and didEndOverflowScroll. The second
822         required changing the implementation of notifyRevealedSelectionByScrollingFrame.
823         We not only need to notify the client to redraw the selection,
824         but we also need to recompute the editorState, because scrolling
825         might have occurred.
826         I've removed the NotifyRevealedSelection message that was not needed
827         any longer, since EditorStateChanged will do exactly what we want.
828
829         * UIProcess/WebPageProxy.h:
830         * UIProcess/WebPageProxy.messages.in:
831         * UIProcess/ios/WebPageProxyIOS.mm:
832         (WebKit::WebPageProxy::editorStateChanged):
833         (WebKit::WebPageProxy::notifyRevealedSelection): Deleted.
834         * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
835         (WebKit::WebChromeClient::notifyRevealedSelectionByScrollingFrame):
836         (WebKit::WebChromeClient::didLayout):
837         (WebKit::WebChromeClient::didStartOverflowScroll):
838         (WebKit::WebChromeClient::didEndOverflowScroll):
839
840 2015-05-29  Chris Dumez  <cdumez@apple.com>
841
842         [iOS] Update WebContent process sandbox profile for AWD logging
843         https://bugs.webkit.org/show_bug.cgi?id=145473
844         <rdar://problem/20543269>
845
846         Reviewed by Darin Adler.
847
848         Update WebContent process sandbox profile for AWD logging.
849
850         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
851
852 2015-05-29  Anders Carlsson  <andersca@apple.com>
853
854         WebKit.framework installs or references Mac-only headers on iOS
855         https://bugs.webkit.org/show_bug.cgi?id=145471
856         rdar://problem/21161459
857
858         Reviewed by Dan Bernstein.
859
860         * UIProcess/API/C/mac/WKInspectorPrivateMac.h:
861         Add an #if !TARGET_OS_IPHONE guard around the entire header.
862
863 2015-05-29  Anders Carlsson  <andersca@apple.com>
864
865         WKScriptMessageInternal.h should be a project header, not a private header
866         https://bugs.webkit.org/show_bug.cgi?id=145464
867         rdar://problem/21161639
868
869         Reviewed by Dan Bernstein.
870
871         * WebKit2.xcodeproj/project.pbxproj:
872
873 2015-05-28  Alexey Proskuryakov  <ap@apple.com>
874
875         Clean up VisitedLinkProvider teardown
876         https://bugs.webkit.org/show_bug.cgi?id=145450
877         rdar://problem/20244726
878
879         Reviewed by Brady Eidson.
880
881         * UIProcess/VisitedLinkProvider.cpp:
882         (WebKit::VisitedLinkProvider::~VisitedLinkProvider):
883
884 2015-05-28  Brady Eidson  <beidson@apple.com>
885
886         Change method of signaling "should open external urls" to WebKit.
887         https://bugs.webkit.org/show_bug.cgi?id=145454
888
889         Reviewed by Dan Bernstein.
890
891         Making this a property on the request was never a good idea.
892
893         Adding a new extensible load SPI seems much better.
894
895         * Shared/API/Cocoa/_WKNSURLRequestExtras.h: Removed.
896         * Shared/API/Cocoa/_WKNSURLRequestExtras.mm: Removed.
897
898         * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
899         (-[WKBrowsingContextController loadRequest:userData:]): Since this API is deprecated,
900           it always gets the default restrictive behavior.
901
902         * UIProcess/API/Cocoa/WKWebView.mm:
903         (-[WKWebView loadRequest:]):
904         (-[WKWebView loadRequest:withOptions:]): Take an options dictionary that, for now, 
905           only supports one option.
906         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
907
908         * WebKit2.xcodeproj/project.pbxproj:
909
910 2015-05-28  Anders Carlsson  <andersca@apple.com>
911
912         Make sure that we create the private WebKit.framework symlinks last
913         https://bugs.webkit.org/show_bug.cgi?id=145442
914         <rdar://problem/21142213>
915
916         Reviewed by Dan Bernstein.
917
918         Move the "Add Symlinks in /System/Library/PrivateFrameworks/WebKit.framework" build phase to
919         the "All" aggregate target. Also update the script now that INSTALL_PATH is different.
920
921         * WebKit2.xcodeproj/project.pbxproj:
922
923 2015-05-28  Said Abou-Hallawa  <sabouhallawa@apple.com>
924
925         Code clean up for extracting information from the mix of WritingMode and TextDirection
926         https://bugs.webkit.org/show_bug.cgi?id=143399
927
928         Reviewed by Darin Adler.
929
930         * Shared/WebPopupItem.h:
931         * UIProcess/API/C/efl/WKAPICastEfl.h:
932         * UIProcess/WebPopupMenuProxy.h:
933         enum TextDirection is moved from TextFlags.h to WritingMode.h. So include
934         WritingMode.h instead of including TextFlags.h.
935
936 2015-05-28  Antti Koivisto  <antti@apple.com>
937
938         Disable network cache for old clients
939         https://bugs.webkit.org/show_bug.cgi?id=145418
940
941         Reviewed by Andreas Kling.
942
943         Follow-up: Don't do linked-on-or-after checks for iOS Safari.
944
945         * UIProcess/Cocoa/VersionChecks.mm:
946         (WebKit::linkTimeVersion):
947         (WebKit::linkedOnOrAfter):
948
949 2015-05-28  Matt Rajca  <mrajca@apple.com>
950
951         Add ENABLE_MEDIA_SESSION feature flag (which is off by default).
952         https://bugs.webkit.org/show_bug.cgi?id=145415
953
954         Reviewed by Eric Carlson.
955
956         * Configurations/FeatureDefines.xcconfig:
957
958 2015-05-28  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
959
960         Unreviewed, Fix build break since r184930.
961
962         * UIProcess/Storage/StorageManager.cpp:
963         (WebKit::StorageManager::createTransientLocalStorageMap): Pass a pointer of SecurityOrigin
964         in isSameSchemeHostPort().
965
966 2015-05-28  Zan Dobersek  <zdobersek@igalia.com>
967
968         Unreviewed. Fixing the build after r184950.
969
970         * UIProcess/Storage/StorageManager.cpp:
971         (WebKit::StorageManager::createSessionStorageMap): getOrCreateStorageArea()
972         now expects a Ref<WebCore::SecurityOrigin> object.
973
974 2015-05-28  Zan Dobersek  <zdobersek@igalia.com>
975
976         [WK2] Handle WebCore::SecurityOrigin objects through Ref<> where possible
977         https://bugs.webkit.org/show_bug.cgi?id=145373
978
979         Reviewed by Andreas Kling.
980
981         WebCore::SecurityOrigin creation functions in most cases return a
982         Ref<WebCore::SecurityOrigin> object. In the WebKit2 layer, those objects
983         were still largely converted to RefPtr<>s.
984
985         This patch switches to using Ref<> where possible. The remaining uses of
986         RefPtr<WebCore::SecurityOrigin> are present due to HashTables, to-be-copied
987         Vectors, WebCore::DatabaseManager::origins() API and code where non-null
988         WebCore::SecurityOrigin can't be guaranteed.
989
990         * DatabaseProcess/DatabaseProcess.cpp:
991         (WebKit::DatabaseProcess::deleteIndexedDatabaseEntriesForOrigin):
992         * NetworkProcess/NetworkProcess.cpp:
993         (WebKit::cfURLCacheOrigins):
994         * UIProcess/Storage/LocalStorageDatabase.cpp:
995         (WebKit::LocalStorageDatabase::create):
996         (WebKit::LocalStorageDatabase::LocalStorageDatabase):
997         (WebKit::LocalStorageDatabase::openDatabase):
998         (WebKit::LocalStorageDatabase::close):
999         * UIProcess/Storage/LocalStorageDatabase.h:
1000         * UIProcess/Storage/LocalStorageDatabaseTracker.cpp:
1001         (WebKit::LocalStorageDatabaseTracker::origins):
1002         * UIProcess/Storage/LocalStorageDatabaseTracker.h:
1003         * UIProcess/Storage/StorageManager.cpp:
1004         (WebKit::StorageManager::StorageArea::securityOrigin):
1005         (WebKit::StorageManager::TransientLocalStorageNamespace::getOrCreateStorageArea):
1006         (WebKit::StorageManager::TransientLocalStorageNamespace::origins):
1007         (WebKit::StorageManager::TransientLocalStorageNamespace::clearStorageAreasMatchingOrigin):
1008         (WebKit::StorageManager::StorageArea::create):
1009         (WebKit::StorageManager::StorageArea::StorageArea):
1010         (WebKit::StorageManager::StorageArea::openDatabaseAndImportItemsIfNeeded):
1011         (WebKit::StorageManager::LocalStorageNamespace::getOrCreateStorageArea):
1012         (WebKit::StorageManager::LocalStorageNamespace::didDestroyStorageArea):
1013         (WebKit::StorageManager::SessionStorageNamespace::origins):
1014         (WebKit::StorageManager::SessionStorageNamespace::clearStorageAreasMatchingOrigin):
1015         (WebKit::StorageManager::SessionStorageNamespace::getOrCreateStorageArea):
1016         * UIProcess/WebPageProxy.cpp:
1017         (WebKit::WebPageProxy::reachedApplicationCacheOriginQuota):
1018         * WebProcess/ApplicationCache/WebApplicationCacheManager.cpp:
1019         (WebKit::WebApplicationCacheManager::getApplicationCacheOrigins):
1020         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1021         (WebKit::InjectedBundle::setApplicationCacheOriginQuota):
1022         (WebKit::InjectedBundle::resetApplicationCacheOriginQuota):
1023         * WebProcess/ResourceCache/WebResourceCacheManager.cpp:
1024         (WebKit::WebResourceCacheManager::returnCacheOrigins):
1025         (WebKit::WebResourceCacheManager::clearCacheForOrigin):
1026         * WebProcess/WebCoreSupport/WebDatabaseManager.cpp:
1027         (WebKit::WebDatabaseManager::deleteDatabaseWithNameForOrigin):
1028         (WebKit::WebDatabaseManager::deleteDatabasesForOrigin):
1029         (WebKit::WebDatabaseManager::setQuotaForOrigin):
1030
1031 2015-05-19  Jon Honeycutt  <jhoneycutt@apple.com>
1032
1033         [iOS] When viewing an MJPEG stream as the main resource, only the first
1034         frame paints
1035
1036         <https://bugs.webkit.org/show_bug.cgi?id=145185>
1037         <rdar://problem/20124694>
1038
1039         Reviewed by Darin Adler.
1040
1041         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1042         (WebKit::WebFrameLoaderClient::willReplaceMultipartContent):
1043         Tell the WebPage that we will replace multipart content.
1044
1045         (WebKit::WebFrameLoaderClient::didReplaceMultipartContent):
1046         Tell the WebPage that we did replace multipart content.
1047
1048         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
1049         * WebProcess/WebPage/DrawingArea.h:
1050
1051         * WebProcess/WebPage/WebPage.cpp:
1052         (WebKit::WebPage::willReplaceMultipartContent):
1053         Save the exposed content rect.
1054         (WebKit::WebPage::didReplaceMultipartContent):
1055         Restore the exposed content rect that was saved before this load. This
1056         fixes the issue for WK2.
1057
1058         * WebProcess/WebPage/WebPage.h:
1059
1060         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
1061         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
1062         (WebKit::RemoteLayerTreeDrawingArea::exposedContentRect):
1063
1064 2015-05-22  Jon Lee  <jonlee@apple.com>
1065
1066         Fix macros for wireless playback
1067         https://bugs.webkit.org/show_bug.cgi?id=145239
1068         rdar://problem/21049541
1069
1070         Reviewed by Anders Carlsson.
1071
1072         Encompass the logic within ENABLE(WIRELESS_TARGET_PLAYBACK). Update property name.
1073
1074         * UIProcess/API/Cocoa/WKWebView.mm:
1075         (-[WKWebView initWithFrame:configuration:]):
1076         * UIProcess/API/Cocoa/WKWebViewConfiguration.h: Update names. Add a WKDeprecated
1077         category section.
1078         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
1079         (-[WKWebViewConfiguration init]): Update name of variables to reflect new property names.
1080         (-[WKWebViewConfiguration copyWithZone:]): Ditto.
1081         (-[WKWebViewConfiguration mediaPlaybackAllowsAirPlay]): Get and set off of the new
1082         variable.
1083         (-[WKWebViewConfiguration setMediaPlaybackAllowsAirPlay:]): Ditto.
1084         (-[WKWebViewConfiguration mediaPlaybackRequiresUserAction]): Ditto.
1085         (-[WKWebViewConfiguration setMediaPlaybackRequiresUserAction:]): Ditto.
1086
1087 2015-05-27  Brady Eidson  <beidson@apple.com>
1088
1089         Add a "should open urls externally" flag to DocumentLoader.
1090         rdar://problem/21025301 and https://bugs.webkit.org/show_bug.cgi?id=145417
1091
1092         Reviewed by Geoff Garen.
1093
1094         Rename "user initiated" to "should open external URLs":
1095         * Shared/API/Cocoa/_WKNSURLRequestExtras.h:
1096         * Shared/API/Cocoa/_WKNSURLRequestExtras.mm:
1097         (-[NSURLRequest _web_shouldOpenExternalURLs]):
1098         (-[NSMutableURLRequest _web_setShouldOpenExternalURLs:]):
1099         (-[NSURLRequest _web_isUserInitiated]): Deleted.
1100         (-[NSMutableURLRequest _web_setIsUserInitiated:]): Deleted.
1101         
1102         Hold the new flag as a bool, and encode/decode it across IPC:
1103         * Shared/NavigationActionData.cpp:
1104         (WebKit::NavigationActionData::encode):
1105         (WebKit::NavigationActionData::decode):
1106         (WebKit::NavigationActionData::NavigationActionData): Deleted.
1107         * Shared/NavigationActionData.h:
1108
1109         * UIProcess/API/APINavigationAction.h: Add accessor for the bool flag.
1110
1111         * UIProcess/API/C/WKPage.cpp:
1112         (WKPageLoadURLWithUserData): Use "ShouldNotAllow" in the legacy C API for now.
1113         (WKPageLoadURLRequestWithUserData): Ditto.
1114
1115         * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
1116         (-[WKBrowsingContextController loadRequest:userData:]): Set the value of the flag
1117           based on whether or not the initiating NSURLRequest was user initiated.
1118
1119         * UIProcess/API/Cocoa/WKNavigationAction.mm:
1120         (-[WKNavigationAction _shouldOpenExternalURLs]): Add accessor for the bool flag.
1121         * UIProcess/API/Cocoa/WKNavigationActionPrivate.h:
1122
1123         * UIProcess/API/Cocoa/WKWebView.mm:
1124         (-[WKWebView loadRequest:]): Set the value of the flag based on whether or not the
1125           initiating NSURLRequest was user initiated.
1126
1127         * UIProcess/WebPageProxy.cpp:
1128         (WebKit::WebPageProxy::loadRequest): Pass the value down to the WebProcess to load.
1129         (WebKit::WebPageProxy::loadFile): Ditto, but always with "ShouldNotAllow".
1130         * UIProcess/WebPageProxy.h:
1131
1132         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1133         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): Translate 
1134           the NavigationAction flag to a bool in the NavigationActionData object.
1135
1136         * WebProcess/WebPage/WebPage.cpp:
1137         (WebKit::WebPage::loadRequest): Set the value of the flag in the FrameLoadRequest that
1138           will be loaded.
1139         * WebProcess/WebPage/WebPage.h:
1140         * WebProcess/WebPage/WebPage.messages.in:
1141
1142 2015-05-27  Anders Carlsson  <andersca@apple.com>
1143
1144         Can't load local files in WKWebView from containerized app
1145         https://bugs.webkit.org/show_bug.cgi?id=145424
1146         rdar://problem/20831176
1147
1148         Reviewed by Dan Bernstein.
1149
1150         Allow the network process to load local files from its bundle as long as it has
1151         the sandbox extensions to do so.
1152
1153         This was originally added to only allow SSO to read the Info.plist inside its own application
1154         bundle, but being able to read the application bundle from within the network process should be OK.
1155
1156         * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
1157
1158 2015-05-27  Andreas Kling  <akling@apple.com>
1159
1160         [WK2] Local storage areas should get torn down when they have no remaining references.
1161         <https://webkit.org/b/143339>
1162         <rdar://problem/20156436>
1163
1164         Reviewed by Darin Adler.
1165
1166         Let StorageNamespaceImpl own its StorageAreaMaps weakly instead of through RefPtr.
1167         Ownership is flipped so that StorageAreaMap refs the StorageNamespaceImpl instead.
1168         This allows the StorageAreaMaps to get destroyed once all of its clients are gone.
1169
1170         Practically speaking, this means that the garbage collector now decides when local
1171         storage databases can be closed, instead of us keeping them open for the lifetime
1172         of the web process.
1173
1174         For session storage, it works a bit differently. In the web process, they get torn
1175         down when their last client disappears, but they stay alive in the UI process.
1176         If/when the web process asks the UI process to open session storage for an origin,
1177         the UI process checks if one already exists, and if so, just updates the ID of the
1178         old storage with the new one provided by the web process.
1179
1180         * UIProcess/Storage/StorageManager.cpp:
1181         (WebKit::StorageManager::StorageArea::isSessionStorage):
1182         (WebKit::StorageManager::createTransientLocalStorageMap):
1183         (WebKit::StorageManager::createSessionStorageMap):
1184         (WebKit::StorageManager::destroyStorageMap):
1185         * WebProcess/Storage/StorageAreaImpl.cpp:
1186         (WebKit::StorageAreaImpl::securityOrigin):
1187         * WebProcess/Storage/StorageAreaImpl.h:
1188         * WebProcess/Storage/StorageAreaMap.cpp:
1189         (WebKit::StorageAreaMap::StorageAreaMap):
1190         (WebKit::StorageAreaMap::~StorageAreaMap):
1191         * WebProcess/Storage/StorageAreaMap.h:
1192         (WebKit::StorageAreaMap::securityOrigin):
1193         * WebProcess/Storage/StorageNamespaceImpl.cpp:
1194         (WebKit::StorageNamespaceImpl::didDestroyStorageAreaMap):
1195         (WebKit::StorageNamespaceImpl::storageArea):
1196         * WebProcess/Storage/StorageNamespaceImpl.h:
1197
1198 2015-05-27  Antti Koivisto  <antti@apple.com>
1199
1200         Disable network cache for old clients
1201         https://bugs.webkit.org/show_bug.cgi?id=145418
1202         rdar://problem/21126587
1203
1204         Reviewed by Andy Estes.
1205
1206         Old clients might use NSURLCache API to clear the cache. New cache requires use of new APIs.
1207
1208         * UIProcess/Cocoa/VersionChecks.h: Added.
1209         * UIProcess/Cocoa/VersionChecks.mm: Added.
1210
1211             Add linked-on-or-after check mechanism similar to WebKit1.
1212
1213         (WebKit::linkTimeVersion):
1214         (WebKit::linkedOnOrAfter):
1215         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1216         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
1217
1218             Use it when deciding whether to enable the cache.
1219
1220         * WebKit2.xcodeproj/project.pbxproj:
1221
1222 2015-05-27  Dean Jackson  <dino@apple.com>
1223
1224         img.currentSrc problem in strict mode with old picturefill
1225         https://bugs.webkit.org/show_bug.cgi?id=144095
1226         <rdar://problem/21087013>
1227
1228         Reviewed by Simon Fraser.
1229
1230         Add a PICTURE_SIZES flag.
1231
1232         * Configurations/FeatureDefines.xcconfig:
1233
1234 2015-05-27  Chris Dumez  <cdumez@apple.com>
1235
1236         Assertion hit in WebPage::didChangeSelection()
1237         https://bugs.webkit.org/show_bug.cgi?id=145413
1238         <rdar://problem/21001129>
1239
1240         Reviewed by Ryosuke Niwa.
1241
1242         We sometimes hit the "ASSERT(layoutCount == view->layoutCount())"
1243         assertion in WebPage::didChangeSelection(). We manage to prevent
1244         synchronous layouts in most cases when calling editorState(). However,
1245         it seems it can still happen in some cases. Crashing in this case seems
1246         overkill and can be annoying to other developers, especially
1247         considering the implications are only on performance.
1248
1249         This patch drops the assertion.
1250
1251         * WebProcess/WebPage/WebPage.cpp:
1252         (WebKit::WebPage::didChangeSelection): Deleted.
1253
1254 2015-05-27  Anders Carlsson  <andersca@apple.com>
1255
1256         Address a follow-up review comment from Darin.
1257
1258         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1259         (WebKit::WebsiteDataStore::removeMediaKeys):
1260
1261 2015-05-26  Anders Carlsson  <andersca@apple.com>
1262
1263         WKWebsiteDataStore should handle media keys
1264         https://bugs.webkit.org/show_bug.cgi?id=145394
1265         rdar://problem/20617794.
1266
1267         Reviewed by Darin Adler.
1268
1269         * Shared/WebsiteData/WebsiteDataTypes.h:
1270         Add WebsiteDataTypeMediaKeys enum.
1271
1272         * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
1273         (API::WebsiteDataStore::defaultDataStoreConfiguration):
1274         Set up mediaKeysStorageDirectory.
1275
1276         * UIProcess/API/Cocoa/WKWebsiteDataRecord.mm:
1277         (dataTypesToString):
1278         * UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h:
1279         (WebKit::toWebsiteDataTypes):
1280         (WebKit::toWKWebsiteDataTypes):
1281         * UIProcess/API/Cocoa/WKWebsiteDataRecordPrivate.h: Added.
1282         Add _WKWebsiteDataTypeMediaKeys.
1283
1284         * UIProcess/WebProcessPool.cpp:
1285         (WebKit::legacyWebsiteDataStoreConfiguration):
1286         Set up mediaKeysStorageDirectory.
1287
1288         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1289         (WebKit::WebsiteDataStore::WebsiteDataStore):
1290         Set m_mediaKeysStorageDirectory.
1291
1292         (WebKit::WebsiteDataStore::fetchData):
1293         Make CallbackAggregator ThreadSafeRefCounted.
1294         Handle WebsiteDataTypeMediaKeys by calling mediaKeyOrigins on our background queue.
1295
1296         (WebKit::WebsiteDataStore::removeData):
1297         Make CallbackAggregator ThreadSafeRefCounted.
1298         Handle WebsiteDataTypeMediaKeys by calling removeMediaKeys on our background queue.
1299
1300         (WebKit::WebsiteDataStore::mediaKeyOrigins):
1301         Compute the origins.
1302
1303         (WebKit::computeMediaKeyFile):
1304         Add helper function that returns the media key given a containing directory.
1305
1306         (WebKit::WebsiteDataStore::removeMediaKeys):
1307         Remove media key files.
1308
1309         * UIProcess/WebsiteData/WebsiteDataStore.h:
1310         Add new members.
1311
1312         * WebKit2.xcodeproj/project.pbxproj:
1313         Add new files.
1314
1315 2015-05-27  Carlos Garcia Campos  <cgarcia@igalia.com>
1316
1317         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.9.2 release.
1318
1319         * gtk/NEWS: Add release notes for 2.9.2.
1320
1321 2015-05-27  Carlos Garcia Campos  <cgarcia@igalia.com>
1322
1323         [SOUP] Network Cache: Handle the case when we fail to create the IO stream
1324         https://bugs.webkit.org/show_bug.cgi?id=145406
1325
1326         Reviewed by Sergio Villar Senin.
1327
1328         We were asserting in that case, but it can happen that we
1329         fail to create the stream. It happened to me after r184690, that
1330         changed the NetworkCache::Key hash. Since this was not expected to
1331         happen, the async operation never finished and the completion
1332         handler never called, leaving resources loading forever. We
1333         should make sure we call the completion handler with an error
1334         code, so that the load finishes and the entry is silently removed
1335         from the cache.
1336
1337         * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:
1338         (WebKit::NetworkCache::IOChannel::read):
1339         (WebKit::NetworkCache::IOChannel::readSync):
1340         (WebKit::NetworkCache::IOChannel::write):
1341
1342 2015-05-26  Carlos Garcia Campos  <cgarcia@igalia.com>
1343
1344         Network Cache: Add cache capacity to the totals of JSON file
1345         https://bugs.webkit.org/show_bug.cgi?id=145246
1346
1347         Reviewed by Antti Koivisto.
1348
1349         * NetworkProcess/cache/NetworkCache.cpp:
1350         (WebKit::NetworkCache::Cache::dumpContentsToFile):
1351         * NetworkProcess/cache/NetworkCacheStorage.h:
1352         (WebKit::NetworkCache::Storage::capacity):
1353
1354 2015-05-26  Anders Carlsson  <andersca@apple.com>
1355
1356         Add a symlink for every file inside /S/L/F/WebKit.framework to the PrivateFrameworks mirror.
1357
1358         rdar://problem/21111232.
1359
1360         Reviewed by Dan Bernstein.
1361
1362         * WebKit2.xcodeproj/project.pbxproj:
1363
1364 2015-05-26  Hunseop Jeong  <hs85.jeong@samsung.com>
1365
1366         [EFL] webview should be updated from (0,0) when using the evasGL.
1367         https://bugs.webkit.org/show_bug.cgi?id=137948
1368
1369         Reviewed by Gyuyoung Kim.
1370
1371         Changed the point of the start position to update the evasObject
1372         correctly when using the evasGL for graphics backend.
1373
1374         * UIProcess/API/efl/EwkView.cpp:
1375         (EwkView::displayTimerFired):
1376
1377 2015-05-26  Dan Bernstein  <mitz@apple.com>
1378
1379         <rdar://problem/21104551> Update build settings
1380
1381         Reviewed by Anders Carlsson.
1382
1383         * Configurations/DebugRelease.xcconfig:
1384         * Configurations/FeatureDefines.xcconfig:
1385         * Configurations/Version.xcconfig:
1386         * Configurations/WebContentService.Development.xcconfig:
1387         * Configurations/WebContentService.xcconfig:
1388
1389 2015-05-26  Milan Crha  <mcrha@redhat.com>
1390
1391         [GTK] Expand wildcards inside generate-inspector-gresource-manifest.py
1392         https://bugs.webkit.org/show_bug.cgi?id=138134
1393
1394         Reviewed by Žan Doberšek.
1395
1396         * PlatformGTK.cmake: Command line with expanded resources exceeds 32KB, which
1397         is a limit on Windows. It's better to expand wildcards inside the python script.
1398
1399 2015-05-25  Dan Bernstein  <mitz@apple.com>
1400
1401         ASSERT_MAIN_THREAD and DOM_ASSERT_MAIN_THREAD are unnecessary no-ops
1402         https://bugs.webkit.org/show_bug.cgi?id=145372
1403
1404         Reviewed by Sam Weinig.
1405
1406         * Configurations/Base.xcconfig: Removed DISABLE_THREAD_CHECK from DEBUG_DEFINES.
1407
1408 2015-05-25  Carlos Garcia Campos  <cgarcia@igalia.com>
1409
1410         [GTK] Add construct property to WebKitWebContext to set the IndexedDB database directory
1411         https://bugs.webkit.org/show_bug.cgi?id=140882
1412
1413         Reviewed by Gustavo Noronha Silva.
1414
1415         Add WebKitWebContext:indexed-db-database-directory construct only property.
1416
1417         * UIProcess/API/gtk/WebKitWebContext.cpp:
1418         (webkitWebContextGetProperty):
1419         (webkitWebContextSetProperty):
1420         (webkitWebContextConstructed):
1421         (webkit_web_context_class_init):
1422
1423 2015-05-24  Sam Weinig  <sam@webkit.org>
1424
1425         Crash when using a removed ScriptMessageHandler
1426         <rdar://problem/20888499>
1427         https://bugs.webkit.org/show_bug.cgi?id=145359
1428
1429         Reviewed by Dan Bernstein.
1430
1431         * WebProcess/UserContent/WebUserContentController.cpp:
1432         (WebKit::WebUserMessageHandlerDescriptorProxy::~WebUserMessageHandlerDescriptorProxy):
1433         Invalidate the descriptor when the message handler client (as implemented by WebUserMessageHandlerDescriptorProxy)
1434         goes away. This will happen if a script message handler is removed at the API level or the WebUserContentController
1435         is destroyed (which will happen if all the pages get destroyed).
1436
1437 2015-05-23  Dan Bernstein  <mitz@apple.com>
1438
1439         <rdar://problem/21090327> /S/L/PrivateFrameworks/WebKit.framework is missing Headers and PrivateHeaders symlinks
1440         https://bugs.webkit.org/show_bug.cgi?id=145354
1441
1442         Reviewed by David Kilzer.
1443
1444         * WebKit2.xcodeproj/project.pbxproj: Create Headers and PrivateHeaders symlinks alongside
1445         the dylib symlink.
1446
1447 2015-05-23  Sungmann Cho  <sungmann.cho@navercorp.com>
1448
1449         Rename ShareableResource::create(Handle&) to map(Handle&) to match SharedMemory.
1450         https://bugs.webkit.org/show_bug.cgi?id=145288
1451
1452         Reviewed by Sam Weinig.
1453
1454         * Shared/ShareableResource.cpp:
1455         (WebKit::ShareableResource::Handle::tryWrapInSharedBuffer):
1456         (WebKit::ShareableResource::map):
1457         (WebKit::ShareableResource::create): Deleted.
1458         * Shared/ShareableResource.h:
1459
1460 2015-05-22  Jon Lee  <jonlee@apple.com>
1461
1462         Rename MediaPlaybackAllowsInline
1463         https://bugs.webkit.org/show_bug.cgi?id=145315
1464
1465         Reviewed by Eric Carlson.
1466
1467         Our API uses allowsInlineMediaPlayback. Our symbols should reflect the same.
1468
1469         * Shared/WebPreferencesDefinitions.h:
1470         * UIProcess/API/C/WKPreferences.cpp:
1471         (WKPreferencesSetMediaPlaybackAllowsInline): Update the call to preferences.
1472         The C API will not change in a future patch.
1473         (WKPreferencesGetMediaPlaybackAllowsInline): Ditto.
1474         * UIProcess/API/Cocoa/WKWebView.mm:
1475         (-[WKWebView initWithFrame:configuration:]): Update the name of the key.
1476         * WebProcess/WebPage/WebPage.cpp:
1477         (WebKit::WebPage::updatePreferences): Ditto.
1478
1479         * UIProcess/API/gtk/WebKitSettings.cpp: Update the call.
1480         (webkit_settings_get_media_playback_allows_inline):
1481         (webkit_settings_set_media_playback_allows_inline):
1482
1483 2015-05-22  Jon Lee  <jonlee@apple.com>
1484
1485         Rename MediaPlaybackAllowsAirPlay
1486         https://bugs.webkit.org/show_bug.cgi?id=145316
1487
1488         Reviewed by Eric Carlson.
1489
1490         In preparation for an API rename, update internal symbols from mediaPlaybackAllowsAirPlay
1491         to allowsAirPlayForMediaPlayback.
1492
1493         * Shared/WebPreferencesDefinitions.h: Update the name.
1494         * UIProcess/API/Cocoa/WKWebView.mm:
1495         (-[WKWebView initWithFrame:configuration:]): Ditto.
1496         * WebProcess/WebPage/WebPage.cpp:
1497         (WebKit::WebPage::updatePreferences): Update the call to settings.
1498
1499 2015-05-22  Jon Lee  <jonlee@apple.com>
1500
1501         Unreviewed GTK fix after r184802.
1502
1503         * UIProcess/API/gtk/WebKitSettings.cpp:
1504         (webkit_settings_get_media_playback_requires_user_gesture):
1505         (webkit_settings_set_media_playback_requires_user_gesture):
1506
1507 2015-05-22  Jon Lee  <jonlee@apple.com>
1508
1509         Rename MediaPlaybackRequiresUserGesture
1510         https://bugs.webkit.org/show_bug.cgi?id=145314
1511
1512         Reviewed by Anders Carlsson.
1513
1514         In preparation for an API rename, update internal symbols from mediaPlaybackRequiresUserGesture
1515         to requiresUserGestureForMediaPlayback.
1516
1517         No changes are being made to the API in this patch.
1518
1519         * Shared/WebPreferencesDefinitions.h: Update the name of the macro and the setting.
1520         * UIProcess/API/C/WKPreferences.cpp: The C API will not change in a future patch.
1521         (WKPreferencesSetMediaPlaybackRequiresUserGesture): Update the call to preferences.
1522         (WKPreferencesGetMediaPlaybackRequiresUserGesture): Ditto.
1523         * UIProcess/API/Cocoa/WKWebView.mm:
1524         (-[WKWebView initWithFrame:configuration:]): Update the name of the key.
1525         * WebProcess/WebPage/WebPage.cpp:
1526         (WebKit::WebPage::updatePreferences): Ditto.
1527
1528 2015-05-22  Commit Queue  <commit-queue@webkit.org>
1529
1530         Unreviewed, rolling out r183647.
1531         https://bugs.webkit.org/show_bug.cgi?id=145326
1532
1533         broke some toolbar blurring behavior (Requested by thorton on
1534         #webkit).
1535
1536         Reverted changeset:
1537
1538         "Asynchronous (or timed-out synchronous) resize flashes white
1539         instead of page background color"
1540         https://bugs.webkit.org/show_bug.cgi?id=144468
1541         http://trac.webkit.org/changeset/183647
1542
1543 2015-05-22  Yongjun Zhang  <yongjun_zhang@apple.com>
1544
1545         Image link doesn't create a preview view controller.
1546         https://bugs.webkit.org/show_bug.cgi?id=145320
1547
1548         Also try to create the preview view controller if the hit-tested node
1549         is a image link.
1550
1551         Reviewed by Beth Dakin.
1552
1553         * UIProcess/ios/WKContentViewInteraction.mm:
1554         (-[WKContentView gestureRecognizerShouldBegin:]):
1555         (-[WKContentView previewViewControllerForPosition:inSourceView:]):
1556
1557 2015-05-22  Tim Horton  <timothy_horton@apple.com>
1558
1559         Avoid doing an extra layout in some cases while doing scale-to-fit
1560         https://bugs.webkit.org/show_bug.cgi?id=145321
1561         <rdar://problem/21051165>
1562
1563         Reviewed by Beth Dakin.
1564
1565         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
1566         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
1567         (WebKit::TiledCoreAnimationDrawingArea::scaleViewToFitDocumentIfNeeded):
1568         If we make it to scaleViewToFitDocumentIfNeeded with valid layout,
1569         the view width is still less than the last-known minimum document size,
1570         and the document size hasn't changed, update the view scale without
1571         doing an extra layout, keeping the fixed layout size at the previously
1572         computed minimum document size.
1573
1574 2015-05-22  Beth Dakin  <bdakin@apple.com>
1575
1576         Yellow highlight and DD popover don't go away when scrolling an iframe
1577         https://bugs.webkit.org/show_bug.cgi?id=145312
1578         -and corresponding-
1579         rdar://problem/19692334
1580
1581         Reviewed by Tim Horton.
1582
1583         Match what Lookup already does for their popover and dismiss our popovers on 
1584         scroll.
1585         * UIProcess/API/mac/WKView.mm:
1586         (-[WKView scrollWheel:]):
1587
1588         This should not be needed anymore.
1589         * UIProcess/WebPageProxy.cpp:
1590         (WebKit::WebPageProxy::pageDidScroll):
1591
1592 2015-05-22  Tim Horton  <timothy_horton@apple.com>
1593
1594         Remove action menu support
1595         https://bugs.webkit.org/show_bug.cgi?id=145305
1596         <rdar://problem/21070771>
1597
1598         Reviewed by Anders Carlsson.
1599
1600         * Configurations/WebKit.xcconfig:
1601         * Shared/API/c/WKActionMenuItemTypes.h:
1602         * Shared/API/c/WKActionMenuTypes.h:
1603         * UIProcess/API/Cocoa/WKViewPrivate.h:
1604         * UIProcess/API/mac/WKView.mm:
1605         (-[WKView _didPerformImmediateActionHitTest:contentPreventsDefault:userData:]):
1606         (-[WKView dealloc]): Deleted.
1607         (-[WKView mouseDown:]): Deleted.
1608         (-[WKView initWithFrame:processPool:configuration:webView:]): Deleted.
1609         (-[WKView prepareForMenu:withEvent:]): Deleted.
1610         (-[WKView willOpenMenu:withEvent:]): Deleted.
1611         (-[WKView didCloseMenu:withEvent:]): Deleted.
1612         (-[WKView _didPerformActionMenuHitTest:forImmediateAction:contentPreventsDefault:userData:]): Deleted.
1613         (-[WKView _actionMenuItemsForHitTestResult:withType:defaultActionMenuItems:]): Deleted.
1614         (-[WKView _actionMenuItemsForHitTestResult:withType:defaultActionMenuItems:userData:]): Deleted.
1615         * UIProcess/API/mac/WKViewInternal.h:
1616         * UIProcess/PageClient.h:
1617         * UIProcess/WebPageProxy.cpp:
1618         (WebKit::WebPageProxy::performImmediateActionHitTestAtLocation):
1619         (WebKit::WebPageProxy::didPerformImmediateActionHitTest):
1620         (WebKit::WebPageProxy::performActionMenuHitTestAtLocation): Deleted.
1621         (WebKit::WebPageProxy::selectLastActionMenuRange): Deleted.
1622         (WebKit::WebPageProxy::focusAndSelectLastActionMenuHitTestResult): Deleted.
1623         (WebKit::WebPageProxy::didPerformActionMenuHitTest): Deleted.
1624         * UIProcess/WebPageProxy.h:
1625         * UIProcess/WebPageProxy.messages.in:
1626         * UIProcess/mac/PageClientImpl.h:
1627         * UIProcess/mac/PageClientImpl.mm:
1628         (WebKit::PageClientImpl::didPerformImmediateActionHitTest):
1629         (WebKit::PageClientImpl::didPerformActionMenuHitTest): Deleted.
1630         * UIProcess/mac/WKActionMenuController.h: Removed.
1631         * UIProcess/mac/WKActionMenuController.mm: Removed.
1632         * UIProcess/mac/WKImmediateActionController.h:
1633         * UIProcess/mac/WKImmediateActionController.mm:
1634         (-[WKImmediateActionController didPerformImmediateActionHitTest:contentPreventsDefault:userData:]):
1635         (-[WKImmediateActionController immediateActionRecognizerWillPrepare:]):
1636         (-[WKImmediateActionController immediateActionRecognizerWillBeginAnimation:]):
1637         (-[WKImmediateActionController didPerformActionMenuHitTest:contentPreventsDefault:userData:]): Deleted.
1638         * WebKit2.xcodeproj/project.pbxproj:
1639         * WebProcess/InjectedBundle/API/APIInjectedBundlePageContextMenuClient.h:
1640         (API::InjectedBundle::PageContextMenuClient::prepareForImmediateAction):
1641         (API::InjectedBundle::PageContextMenuClient::prepareForActionMenu): Deleted.
1642         * WebProcess/InjectedBundle/API/c/WKBundlePageContextMenuClient.h:
1643         * WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:
1644         * WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.h:
1645         * WebProcess/InjectedBundle/InjectedBundlePageContextMenuClient.cpp:
1646         (WebKit::InjectedBundlePageContextMenuClient::prepareForImmediateAction):
1647         (WebKit::InjectedBundlePageContextMenuClient::prepareForActionMenu): Deleted.
1648         * WebProcess/InjectedBundle/InjectedBundlePageContextMenuClient.h:
1649         * WebProcess/WebPage/WebPage.h:
1650         * WebProcess/WebPage/WebPage.messages.in:
1651         * WebProcess/WebPage/WebPageOverlay.cpp:
1652         (WebKit::WebPageOverlay::actionContextForResultAtPoint):
1653         * WebProcess/WebPage/WebPageOverlay.h:
1654         (WebKit::WebPageOverlay::Client::actionContextForResultAtPoint):
1655         * WebProcess/WebPage/mac/WebPageMac.mm:
1656         (WebKit::textIndicatorTransitionForImmediateAction):
1657         (WebKit::WebPage::performImmediateActionHitTestAtLocation):
1658         (WebKit::textIndicatorTransitionForActionMenu): Deleted.
1659         (WebKit::WebPage::performActionMenuHitTestAtLocation): Deleted.
1660         (WebKit::WebPage::selectLastActionMenuRange): Deleted.
1661         (WebKit::WebPage::focusAndSelectLastActionMenuHitTestResult): Deleted.
1662         Remove everything, except some enums that clients still refer to.
1663         Also, leave SPI that used to be shared between immediate actions and
1664         action menus intact, even if it had "action menu" in the name. We can
1665         deprecate and rename in another patch... except for the very recently-added
1666         support from r184106, which we'll revert entirely, removing WKBundlePageOverlayV2, 
1667         which was not adopted by any clients.
1668
1669 2015-05-22  Brady Eidson  <beidson@apple.com>
1670
1671         Rework how the ResourceRequest user initiated property key is used.
1672         Followup to https://bugs.webkit.org/show_bug.cgi?id=145281
1673
1674         Reviewed by Dan Bernstein.
1675
1676         * Shared/API/Cocoa/_WKNSURLRequestExtras.mm:
1677         (-[NSURLRequest _web_isUserInitiated]):
1678         (-[NSMutableURLRequest _web_setIsUserInitiated:]):
1679
1680         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
1681         (WKResourceRequestIsUserInitiatedKey): Deleted.
1682         (InitWebCoreSystemInterface): Deleted.
1683
1684 2015-05-21  Gavin Barraclough  <barraclough@apple.com>
1685
1686         Networking process sometimes suspended while WebContent runnable
1687         https://bugs.webkit.org/show_bug.cgi?id=145291
1688         <rdar://problem/21033029>
1689
1690         Reviewed by Andreas Kling.
1691
1692         There is an asymmetry in how the Networking process suspension is managed.
1693         We drop the assertion (& suspend the process) whenever the WebProcess says
1694         it is ready to suspend, but we only take the assertion (& resume execution)
1695         when the WebContent process is actually resumed. This leaves a race – where
1696         the WebContent process was willing to be suspended, but the UI app changed
1697         its mind suspending it. Since the WebContent process never actually suspended
1698         (we only prepared it to), we never send a resume, and since we never resume,
1699         we never wake the Networking process.
1700
1701         The fix is pretty clean. A web process should take a token on the networking
1702         process precisely whenever it holds an assertion on the web content process.
1703         This also enables a nice refinement, that when holding a BG assertion on the
1704         WebContent process we only need to hold a BG assertion on the networking
1705         process.
1706
1707         * UIProcess/Network/NetworkProcessProxy.cpp:
1708         (WebKit::NetworkProcessProxy::didSetAssertionState):
1709             - no-op
1710         * UIProcess/Network/NetworkProcessProxy.h:
1711             - added didSetAssertionState.
1712         * UIProcess/ProcessThrottler.cpp:
1713         (WebKit::ProcessThrottler::updateAssertionNow):
1714         (WebKit::ProcessThrottler::updateAssertion):
1715         (WebKit::ProcessThrottler::didConnectToProcess):
1716             - whenever taking/updating the assertion, inform the client via didSetAssertionState.
1717         * UIProcess/ProcessThrottlerClient.h:
1718             - added didSetAssertionState.
1719         * UIProcess/WebProcessProxy.cpp:
1720         (WebKit::WebProcessProxy::didFinishLaunching):
1721             removed initializeNetworkProcessActivityToken - this is taken via ProcessThrottler::didConnectToProcess.
1722         (WebKit::WebProcessProxy::sendProcessDidResume):
1723             - removed call to initializeNetworkProcessActivityToken - updated via didSetAssertionState.
1724         (WebKit::WebProcessProxy::processReadyToSuspend):
1725             - removed update of m_tokenForNetworkProcess - updated via didSetAssertionState.
1726         (WebKit::WebProcessProxy::didSetAssertionState):
1727             - update m_backgroundTokenForNetworkProcess/m_foregroundTokenForNetworkProcess.
1728         (WebKit::WebProcessProxy::initializeNetworkProcessActivityToken): Deleted.
1729             - updated via didSetAssertionState.
1730         * UIProcess/WebProcessProxy.h:
1731             - added didSetAssertionState, added separate FG/BG activity tokens for Networking process.
1732
1733 2015-05-22  Dan Bernstein  <mitz@apple.com>
1734
1735         Fixed the fix for <rdar://problem/20830673> Symlink the WebKit dylib instead of just the framework directory
1736         https://bugs.webkit.org/show_bug.cgi?id=145287
1737
1738         Reviewed by Anders Carlsson.
1739
1740         * WebKit2.xcodeproj/project.pbxproj: Give the symlink the correct destination.
1741
1742 2015-05-21  Brady Eidson  <beidson@apple.com>
1743
1744         Add an "initiated by user gesture" flag to ResourceRequest.
1745         https://bugs.webkit.org/show_bug.cgi?id=145281
1746
1747         Reviewed by Alex Christensen.
1748
1749         Expose a new category on NSURLRequest to allow SPI clients to easily set/get the flag:
1750         * Shared/API/Cocoa/_WKNSURLRequestExtras.h: Added.
1751         * Shared/API/Cocoa/_WKNSURLRequestExtras.mm: Added.
1752         (-[NSURLRequest _web_isUserInitiated]):
1753         (-[NSMutableURLRequest _web_setIsUserInitiated:]):
1754
1755         * WebKit2.xcodeproj/project.pbxproj:
1756
1757         Expose the new property key to WebCore:
1758         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
1759         (WKResourceRequestIsUserInitiatedKey):
1760         (InitWebCoreSystemInterface):
1761
1762 2015-05-21  Daniel Bates  <dabates@apple.com>
1763
1764         Rollout <http://trac.webkit.org/changeset/183909>
1765         (https://bugs.webkit.org/show_bug.cgi?id=144657)
1766
1767         Revert <http://trac.webkit.org/changeset/183909> since pausing the database
1768         thread prevents in-progress transactions from completing. We need to think
1769         about this change some more.
1770
1771         * UIProcess/WebPageProxy.h:
1772         * UIProcess/ios/WKContentView.mm:
1773         (-[WKContentView _applicationDidEnterBackground:]): Deleted.
1774         * UIProcess/ios/WebPageProxyIOS.mm:
1775         (WebKit::WebPageProxy::applicationDidEnterBackground): Deleted.
1776         * WebProcess/WebCoreSupport/WebDatabaseManager.cpp:
1777         (WebKit::WebDatabaseManager::setPauseAllDatabases): Deleted.
1778         * WebProcess/WebCoreSupport/WebDatabaseManager.h:
1779         * WebProcess/WebPage/WebPage.h:
1780         * WebProcess/WebPage/WebPage.messages.in:
1781         * WebProcess/WebPage/ios/WebPageIOS.mm:
1782         (WebKit::WebPage::applicationWillEnterForeground): Deleted.
1783         (WebKit::WebPage::applicationDidEnterBackground): Deleted.
1784
1785 2015-05-21  Enrica Casucci  <enrica@apple.com>
1786
1787         [iOS] Crash when taking a snapshot of a large PDF.
1788         https://bugs.webkit.org/show_bug.cgi?id=145286
1789         rdar://problem/20892362
1790
1791         Reviewed by Tim Horton.
1792
1793         The code for the PDF case was incorrectly computing the snapshot rect.
1794         On top of that drawViewHierarchyInRect was ignoring the rect and
1795         always creating an image using the view bounds causing the crash.
1796         We are now always using the IOSurface if we are parented or
1797         an image context when we are not.
1798
1799         * UIProcess/API/Cocoa/WKWebView.mm:
1800         (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]):
1801
1802 2015-05-21  Anders Carlsson  <andersca@apple.com>
1803
1804         Symlink the WebKit dylib instead of just the framework directory
1805         https://bugs.webkit.org/show_bug.cgi?id=145287
1806         rdar://problem/20830673
1807
1808         Reviewed by Dan Bernstein.
1809
1810         * WebKit2.xcodeproj/project.pbxproj:
1811
1812 2015-05-21  Anders Carlsson  <andersca@apple.com>
1813
1814         WKWebsiteDataStore doesn't track and remove iOS Safari's offline application cache entries
1815         https://bugs.webkit.org/show_bug.cgi?id=145279
1816         rdar://problem/20657912
1817
1818         Reviewed by Dan Bernstein.
1819
1820         Special-case iOS Safari and WebApp when computing the default application cache directory.
1821
1822         * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
1823         (API::applicationCacheDirectory):
1824         (API::WebsiteDataStore::defaultDataStoreConfiguration):
1825
1826 2015-05-21  Brian Weinstein  <bweinstein@apple.com>
1827
1828         Add a _WKWebKitContentExtensionStore initializer that takes a path.
1829         https://bugs.webkit.org/show_bug.cgi?id=145269 and work towards <rdar://problem/21031414>
1830
1831         Reviewed by Anders Carlsson.
1832
1833         * UIProcess/API/APIUserContentExtensionStore.cpp:
1834         (API::UserContentExtensionStore::storeWithPath):
1835         * UIProcess/API/APIUserContentExtensionStore.h:
1836         * UIProcess/API/Cocoa/_WKUserContentExtensionStore.h:
1837         * UIProcess/API/Cocoa/_WKUserContentExtensionStore.mm:
1838         (+[_WKUserContentExtensionStore storeWithURL:]):
1839
1840 2015-05-21  Alexey Proskuryakov  <ap@apple.com>
1841
1842         Build fix. Silence some deprecation warnings.
1843
1844         * UIProcess/ios/forms/WKFileUploadPanel.mm:
1845         (-[WKFileUploadPanel _presentPopoverWithContentViewController:animated:]):
1846         * UIProcess/ios/forms/WKFormInputControl.mm:
1847         (-[WKDateTimePopover initWithView:datePickerMode:]):
1848         * UIProcess/ios/forms/WKFormPopover.h:
1849         * UIProcess/ios/forms/WKFormPopover.mm:
1850         * UIProcess/ios/forms/WKFormSelectPopover.mm:
1851         (-[WKSelectPopover initWithView:hasGroups:]):
1852
1853 2015-05-21  Csaba Osztrogonác  <ossy@webkit.org>
1854
1855         [EFL] Remove an unused private field from EwkPopupMenuItem class
1856         https://bugs.webkit.org/show_bug.cgi?id=145249
1857
1858         Reviewed by Gyuyoung Kim.
1859
1860         * UIProcess/API/efl/ewk_popup_menu.cpp:
1861         (EwkPopupMenu::EwkPopupMenu):
1862         * UIProcess/API/efl/ewk_popup_menu_private.h:
1863
1864 2015-05-21  Csaba Osztrogonác  <ossy@webkit.org>
1865
1866         [EFL] Fix mismatched-tags warnings in UIProcess/API/efl
1867         https://bugs.webkit.org/show_bug.cgi?id=145129
1868
1869         Reviewed by Gyuyoung Kim.
1870
1871         * UIProcess/API/efl/EwkViewCallbacks.h:
1872         * UIProcess/API/efl/ewk_application_cache_manager.h:
1873         * UIProcess/API/efl/ewk_auth_request.h:
1874         * UIProcess/API/efl/ewk_back_forward_list.h:
1875         * UIProcess/API/efl/ewk_back_forward_list_item.h:
1876         * UIProcess/API/efl/ewk_color_picker.h:
1877         * UIProcess/API/efl/ewk_context.h:
1878         * UIProcess/API/efl/ewk_context_menu_item.h:
1879         * UIProcess/API/efl/ewk_cookie_manager.h:
1880         * UIProcess/API/efl/ewk_database_manager.h:
1881         * UIProcess/API/efl/ewk_download_job.h:
1882         * UIProcess/API/efl/ewk_error.h:
1883         * UIProcess/API/efl/ewk_favicon_database.h:
1884         * UIProcess/API/efl/ewk_file_chooser_request.h:
1885         * UIProcess/API/efl/ewk_form_submission_request.h:
1886         * UIProcess/API/efl/ewk_navigation_data.h:
1887         * UIProcess/API/efl/ewk_navigation_policy_decision.h:
1888         * UIProcess/API/efl/ewk_object.h:
1889         * UIProcess/API/efl/ewk_page_group.h:
1890         * UIProcess/API/efl/ewk_popup_menu.h:
1891         * UIProcess/API/efl/ewk_popup_menu_item.h:
1892         * UIProcess/API/efl/ewk_security_origin.h:
1893         * UIProcess/API/efl/ewk_settings.h:
1894         * UIProcess/API/efl/ewk_storage_manager.h:
1895         * UIProcess/API/efl/ewk_url_request.h:
1896         * UIProcess/API/efl/ewk_url_response.h:
1897         * UIProcess/API/efl/ewk_url_scheme_request.h:
1898         * UIProcess/API/efl/ewk_view.h:
1899         * UIProcess/API/efl/ewk_window_features.h:
1900         * WebProcess/InjectedBundle/API/efl/ewk_extension.h:
1901         * WebProcess/InjectedBundle/API/efl/ewk_page.h:
1902
1903 2015-05-21  Csaba Osztrogonác  <ossy@webkit.org>
1904
1905         Fix mismatched-tags warnings related to CoordinatedGraphics
1906         https://bugs.webkit.org/show_bug.cgi?id=145130
1907
1908         Reviewed by Darin Adler.
1909
1910         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
1911         * UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.messages.in:
1912         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h:
1913
1914 2015-05-20  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
1915
1916         Unreviewed GTK build fix since r184686.
1917
1918         * UIProcess/gtk/WebProcessPoolGtk.cpp:
1919         (WebKit::WebProcessPool::legacyPlatformDefaultApplicationCacheDirectory): Add *legacy* prefix.
1920         (WebKit::WebProcessPool::platformDefaultApplicationCacheDirectory): Deleted.
1921
1922 2015-05-20  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
1923
1924         Unreviewed EFL build fix since r184686.
1925
1926         * UIProcess/efl/WebProcessPoolEfl.cpp:
1927         (WebKit::WebProcessPool::legacyPlatformDefaultApplicationCacheDirectory): Add *legacy* prefix.
1928         (WebKit::WebProcessPool::platformDefaultApplicationCacheDirectory): Deleted.
1929
1930 2015-05-20  Chris Dumez  <cdumez@apple.com>
1931
1932         [WK2][iOS] Update WebContent process sandbox profile for AWD logging
1933         https://bugs.webkit.org/show_bug.cgi?id=145229
1934         <rdar://problem/20543269>
1935
1936         Reviewed by Alexey Proskuryakov.
1937
1938         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
1939
1940 2015-05-20  Gavin Barraclough  <barraclough@apple.com>
1941
1942         dispatchViewStateChange should not wait for sync reply if the page isn't visible
1943         https://bugs.webkit.org/show_bug.cgi?id=145242
1944         <rdar://problem/20967937>
1945
1946         Reviewed by Ben Poulain.
1947
1948         This is particularly problematic on iOS, since if the page isn't visible the process is likely suspended.
1949
1950
1951         * UIProcess/WebPageProxy.cpp:
1952         (WebKit::WebPageProxy::dispatchViewStateChange):
1953         (WebKit::WebPageProxy::waitForDidUpdateViewState):
1954
1955 2015-05-20  Marcos Chavarría Teijeiro  <mchavarria@igalia.com>
1956
1957         Enable disk cache for range requests
1958         https://bugs.webkit.org/show_bug.cgi?id=144682
1959
1960         Reviewed by Antti Koivisto.
1961
1962         Add Range header value to the network cache key constructor so we take
1963         into account this value. The 206 response code is also marked to be cached.
1964
1965         * NetworkProcess/cache/NetworkCache.cpp:
1966         (WebKit::NetworkCache::makeCacheKey):
1967         (WebKit::NetworkCache::isStatusCodeCacheableByDefault):
1968         * NetworkProcess/cache/NetworkCacheKey.cpp:
1969         (WebKit::NetworkCache::Key::Key):
1970         (WebKit::NetworkCache::Key::operator=):
1971         (WebKit::NetworkCache::Key::computeHash):
1972         (WebKit::NetworkCache::Key::operator==):
1973         (WebKit::NetworkCache::Key::encode):
1974         (WebKit::NetworkCache::Key::decode):
1975         (WebKit::NetworkCache::Key::stringToHash): Deleted.
1976         * NetworkProcess/cache/NetworkCacheKey.h:
1977
1978 2015-05-20  Anders Carlsson  <andersca@apple.com>
1979
1980         WKWebsiteDataStore API doesn't report webkit.org as using Databases or App Cache after visiting http://www.webkit.org/demos/sticky-notes/
1981         https://bugs.webkit.org/show_bug.cgi?id=145238
1982         rdar://problem/20581175
1983
1984         Reviewed by Tim Horton.
1985
1986         Make sure to set the application cache and WebSQL directories when using the legacy data store.
1987
1988         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1989         (WebKit::WebProcessPool::legacyPlatformDefaultApplicationCacheDirectory):
1990         (WebKit::WebProcessPool::platformDefaultApplicationCacheDirectory):
1991         Rename this and move it to the right place.
1992
1993         * UIProcess/WebProcessPool.cpp:
1994         (WebKit::legacyWebsiteDataStoreConfiguration):
1995         Rename this and add the application cache and WebSQL directories.
1996
1997         (WebKit::WebProcessPool::WebProcessPool):
1998         Call legacyWebsiteDataStoreConfiguration.
1999
2000         (WebKit::WebProcessPool::applicationCacheDirectory):
2001         Call legacyPlatformDefaultApplicationCacheDirectory.
2002
2003         * UIProcess/WebProcessPool.h:
2004
2005 2015-05-20  Enrica Casucci  <enrica@apple.com>
2006
2007         [iOS] Using CSS viewport units causes incorrect layout.
2008         https://bugs.webkit.org/show_bug.cgi?id=145225
2009         rdar://problem/20924495
2010
2011         Reviewed by Benjamin Poulain.
2012
2013         * WebProcess/WebPage/ios/WebPageIOS.mm:
2014         (WebKit::WebPage::updateViewportSizeForCSSViewportUnits):
2015
2016 2015-05-20  Tim Horton  <timothy_horton@apple.com>
2017
2018         Allow overriding the waitForDidUpdateViewState timeout
2019         https://bugs.webkit.org/show_bug.cgi?id=145230
2020         <rdar://problem/20990162>
2021
2022         Reviewed by Darin Adler.
2023
2024         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
2025         (WebKit::RemoteLayerTreeDrawingAreaProxy::waitForDidUpdateViewState):
2026         Use the value from NSUserDefaults, if it exists.
2027         We'll only check once, so changing the default requires a restart of the UI process.
2028
2029 2015-05-20  Anders Carlsson  <andersca@apple.com>
2030
2031         Make sure we always have a process pool to perform data store operations with
2032         https://bugs.webkit.org/show_bug.cgi?id=145231
2033         rdar://problem/20618248
2034
2035         Reviewed by Tim Horton.
2036
2037         Make sure that we always return a process pool. If we're a legacy C SPI per-context data store,
2038         find the process pool we're a part of and use that. Otherwise, create a new one.
2039     
2040         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2041         (WebKit::WebsiteDataStore::processPools):
2042
2043 2015-05-19  Jer Noble  <jer.noble@apple.com>
2044
2045         Touching HTMLMediaElement.h or MediaPlayer.h causes a world rebuild.
2046         https://bugs.webkit.org/show_bug.cgi?id=145193
2047
2048         Reviewed by Eric Carlson.
2049
2050         Use HTMLMediaElementEnums instead of HTMLMediaElement.
2051
2052         * UIProcess/API/Cocoa/WKWebView.mm:
2053         (-[WKWebView _isShowingVideoOptimized]): HTMLMediaElement -> HTMLMediaElementEnums.
2054         * UIProcess/ios/WebVideoFullscreenManagerProxy.h:
2055         * UIProcess/ios/WebVideoFullscreenManagerProxy.messages.in:
2056         * UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
2057         (WebKit::WebVideoFullscreenManagerProxy::hasMode): Ditto.
2058         (WebKit::WebVideoFullscreenModelContext::fullscreenModeChanged): Ditto.
2059         (WebKit::WebVideoFullscreenManagerProxy::setupFullscreenWithID): Ditto.
2060         (WebKit::WebVideoFullscreenManagerProxy::fullscreenModeChanged): Ditto.
2061         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2062         (WebKit::WebChromeClient::enterVideoFullscreenForVideoElement): Ditto.
2063         * WebProcess/WebCoreSupport/WebChromeClient.h:
2064         * WebProcess/ios/WebVideoFullscreenManager.h:
2065         (WebKit::WebVideoFullscreenInterfaceContext::fullscreenMode): Ditto.
2066         (WebKit::WebVideoFullscreenInterfaceContext::setFullscreenMode): Ditto.
2067         * WebProcess/ios/WebVideoFullscreenManager.messages.in:
2068         * WebProcess/ios/WebVideoFullscreenManager.mm:
2069         (WebKit::WebVideoFullscreenManager::enterVideoFullscreenForVideoElement): Ditto.
2070         (WebKit::WebVideoFullscreenManager::fullscreenModeChanged): Ditto.
2071         (WebKit::WebVideoFullscreenManager::didCleanupFullscreen): Ditto.
2072
2073 2015-05-20  Anders Carlsson  <andersca@apple.com>
2074
2075         Refactor process pool enumeration code in WebsiteDataStore
2076         https://bugs.webkit.org/show_bug.cgi?id=145218
2077
2078         Reviewed by Tim Horton.
2079
2080         Also make sure to keep the WebProcessPool objects alive for the duration of the various data store
2081         operations. This is the first step towards having the data store create a single process pool lazily if
2082         there are no web views associated with the data store.
2083
2084         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2085         (WebKit::WebsiteDataStore::fetchData):
2086         (WebKit::WebsiteDataStore::removeData):
2087         (WebKit::WebsiteDataStore::processPools):
2088         * UIProcess/WebsiteData/WebsiteDataStore.h:
2089
2090 2015-05-20  Alex Christensen  <achristensen@webkit.org>
2091
2092         [Content Extensions] Relax restrictions on triggers that match everything.
2093         https://bugs.webkit.org/show_bug.cgi?id=145069
2094
2095         Reviewed by Benjamin Poulain.
2096
2097         * UIProcess/API/APIUserContentExtensionStore.h:
2098         Increment version number to reflect changes in DFABytecode.
2099
2100 2015-05-20  Sungmann Cho  <sungmann.cho@navercorp.com>
2101
2102         Minor cleanups to PluginProcessProxy.
2103         https://bugs.webkit.org/show_bug.cgi?id=145199
2104
2105         Reviewed by Anders Carlsson.
2106
2107         1. Remove unnecessary forward declaration.
2108         2. Remove unnecessary #include.
2109
2110         * UIProcess/Plugins/PluginProcessProxy.cpp:
2111         * UIProcess/Plugins/PluginProcessProxy.h:
2112
2113 2015-05-20  Marcos Chavarría Teijeiro  <mchavarria@igalia.com>
2114
2115         [GTK] Add some documentation to WebKitWebExtension
2116         https://bugs.webkit.org/show_bug.cgi?id=142786
2117
2118         Reviewed by Carlos Garcia Campos.
2119
2120         WebKitWebExtension API documentation lacks of some details and the information
2121         available is in some contributors blog posts. I add the section
2122         documentation with a small guide about how to use WebExtensions.
2123
2124         The code examples were taken from Carlos García and Adrián Pérez blog
2125         posts.
2126
2127         * WebProcess/InjectedBundle/API/gtk/WebKitWebExtension.cpp:
2128
2129 2015-05-20  Sungmann Cho  <sungmann.cho@navercorp.com>
2130
2131         Rename WebsiteDataStore::isNonPersistent() to WebsiteDataStore::isPersistent().
2132         https://bugs.webkit.org/show_bug.cgi?id=145111
2133
2134         Reviewed by Darin Adler.
2135
2136         This is a follow up to https://bugs.webkit.org/show_bug.cgi?id=144158.
2137
2138         * UIProcess/API/APIWebsiteDataStore.cpp:
2139         (API::WebsiteDataStore::isPersistent):
2140         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2141         (WebKit::WebsiteDataStore::fetchData):
2142         (WebKit::WebsiteDataStore::removeData):
2143         * UIProcess/WebsiteData/WebsiteDataStore.h:
2144         (WebKit::WebsiteDataStore::isPersistent):
2145         (WebKit::WebsiteDataStore::isNonPersistent): Deleted.
2146
2147 2015-05-20  Hyungwook Lee  <hyungwook.lee@navercorp.com>
2148
2149         [EFL] Fix build failure, linker does not find libXext.
2150         https://bugs.webkit.org/show_bug.cgi?id=144100
2151
2152         Reviewed by Gyuyoung Kim.
2153
2154         Move Xext library from WebProcess_LIBRARIES to WebKit2_LIBRARIES.
2155
2156         * PlatformEfl.cmake:
2157
2158 2015-05-19  Carlos Garcia Campos  <cgarcia@igalia.com>
2159
2160         [SOUP] Network Cache: Implement ShareableResource for Soup and enable it for GTK platform
2161         https://bugs.webkit.org/show_bug.cgi?id=144380
2162
2163         Reviewed by Antti Koivisto.
2164
2165         It improves the network cache performance, by mmaping big
2166         resources and sending only the file descriptor to the web process
2167         instead of the actual file data. It needs some changes in
2168         cross-platform code, because we can't use the same approach as
2169         mac (it uses a platform specific implementation not available in
2170         other platforms).
2171
2172         * NetworkProcess/cache/NetworkCache.cpp:
2173         (WebKit::NetworkCache::Cache::store): Use
2174         Data::tryCreateSharedMemory() to create the shared memory used by
2175         the ShareableResource. Also add an ASSERT instead of checking the
2176         shareable resource created is not nullptr, because the
2177         ShareableResource::create() that receives a shared memory should
2178         never return nullptr.
2179         * NetworkProcess/cache/NetworkCacheData.h:
2180         * NetworkProcess/cache/NetworkCacheDataCocoa.mm:
2181         (WebKit::NetworkCache::Data::tryCreateSharedMemory):
2182         * NetworkProcess/cache/NetworkCacheDataSoup.cpp:
2183         (WebKit::NetworkCache::Data::tryCreateSharedMemory): Create a
2184         SharedMemory object to wrap the mapped file, but keeping the ownership.
2185         * NetworkProcess/cache/NetworkCacheEntry.cpp:
2186         (WebKit::NetworkCache::Entry::initializeShareableResourceHandleFromStorageRecord):
2187         Use Data::tryCreateSharedMemory() to create the shared memory used
2188         bythe ShareableResource. Also add an ASSERT instead of checking
2189         the shareable resource created is not nullptr, because the
2190         ShareableResource::create() that receives a shared memory should
2191         never return nullptr.
2192         * Platform/SharedMemory.h:
2193         * Platform/unix/SharedMemoryUnix.cpp:
2194         (WebKit::SharedMemory::map): Use wrapMap() and initialize
2195         m_isWrappingMap to false.
2196         (WebKit::SharedMemory::wrapMap): Create a SharedMemory object for
2197         the given map, without taking its ownership.
2198         (WebKit::SharedMemory::~SharedMemory): Do not unmap and close the
2199         file descriptor if m_isWrappingMap is true.
2200         * Shared/ShareableResource.cpp:
2201         (WebKit::createShareableResourceDeallocator):
2202         (WebKit::ShareableResource::wrapInSharedBuffer): Create a SharedBuffer
2203         wrapping the ShareableResource data.
2204         (WebKit::ShareableResource::Handle::tryWrapInSharedBuffer): Create
2205         a ShareableResource for the handle and create a SharedBuffer
2206         wrapping it.
2207         * Shared/ShareableResource.h:
2208         * WebKit2Prefix.h: Enable ENABLE_SHAREABLE_RESOURCE for GTK.
2209         * WebProcess/Network/WebResourceLoader.cpp:
2210         (WebKit::WebResourceLoader::didReceiveResource): Get the CFData
2211         from the SharedBuffer for QuickLook instead of wrapping the handle again.
2212
2213 2015-05-19  Carlos Garcia Campos  <cgarcia@igalia.com>
2214
2215         [SOUP] Network Cache: Disable network cache efficacy logging
2216         https://bugs.webkit.org/show_bug.cgi?id=145172
2217
2218         Reviewed by Martin Robinson.
2219
2220         Disable network cache efficacy logging by default, since we are
2221         not currently using the collected data.
2222
2223         * UIProcess/soup/WebProcessPoolSoup.cpp:
2224         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
2225
2226 2015-05-19  Michael Saboff  <msaboff@apple.com>
2227
2228         REGRESSION(183787): JIT is enabled for all builds
2229         https://bugs.webkit.org/show_bug.cgi?id=145179
2230
2231         Reviewed by Geoffrey Garen.
2232
2233         Eliminated the setting of ENABLE_JIT, as wtf/Platform.h has appropriate logic to
2234         set it depending on OS and CPU type.
2235
2236         * Configurations/FeatureDefines.xcconfig:
2237
2238 2015-05-19  Brady Eidson  <beidson@apple.com>
2239
2240         X-Frame-Options headers not respected when loading from application cache.
2241         <rdar://problem/14877623> and https://bugs.webkit.org/show_bug.cgi?id=131800
2242
2243         Reviewed by Alexey Proskuryakov.
2244
2245         * WebProcess/WebPage/WebPage.cpp:
2246         (WebKit::WebPage::loadDataImpl):
2247
2248 2015-05-19  Sungmann Cho  <sungmann.cho@navercorp.com>
2249
2250         Add PLUGIN_ARCHITECTURE(MAC) around WKNVCALayerRenderServerPort in NetscapeBrowserFunc.h.
2251         https://bugs.webkit.org/show_bug.cgi?id=145173
2252
2253         Reviewed by Anders Carlsson.
2254
2255         WKNVCALayerRenderServerPort in NetscapeBrowserFunc.h is meaningful only for Mac.
2256         So we need to add PLUGIN_ARCHITECTURE(MAC) around it.
2257
2258         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.h:
2259
2260 2015-05-19  Brent Fulgham  <bfulgham@apple.com>
2261
2262         REGRESSION(142590): Part 2: Scroll-snap points are improperly snapping to earlier index values (Scrolling Thread) 
2263         https://bugs.webkit.org/show_bug.cgi?id=145175
2264         <rdar://problem/21023785>
2265
2266         Reviewed by Beth Dakin.
2267
2268         Add a stub implementation of isScrollSnapInProgress to match ScrollingCoordinator signature.
2269
2270         * WebProcess/Scrolling/RemoteScrollingCoordinator.h:
2271         * WebProcess/Scrolling/RemoteScrollingCoordinator.mm:
2272         (WebKit::RemoteScrollingCoordinator::isScrollSnapInProgress): Added stub.
2273
2274 2015-05-19  Jeremy Jones  <jeremyj@apple.com>
2275
2276         WebVideoFullscreenManagerProxy has incorrect OS_VERSION_MIN_REQUIRED conditionals.
2277         https://bugs.webkit.org/show_bug.cgi?id=145158
2278
2279         Reviewed by Eric Carlson.
2280
2281         * UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
2282         (WebKit::WebVideoFullscreenManagerProxy::setVideoLayerFrame):
2283
2284 2015-05-19  Ting-Wei Lan  <lantw44@gmail.com>
2285
2286         [SOUP] Use st_birthtime to get creation time of files on systems support it
2287         https://bugs.webkit.org/show_bug.cgi?id=144989
2288
2289         Reviewed by Carlos Garcia Campos.
2290
2291         FreeBSD and NetBSD have either st_birthtime field or compatiblity macro
2292         with the same name in stat. It is better to use it instead of manually
2293         setting xattr, which is unreliable because both operating systems and
2294         file systems support are required.
2295
2296         * NetworkProcess/cache/NetworkCacheFileSystemPosix.h:
2297         (WebKit::NetworkCache::fileTimes):
2298         * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:
2299         (WebKit::NetworkCache::IOChannel::IOChannel):
2300
2301 2015-05-19  Chris Dumez  <cdumez@apple.com>
2302
2303         Mark static variables as const when possible
2304         https://bugs.webkit.org/show_bug.cgi?id=145161
2305
2306         Reviewed by Andreas Kling.
2307
2308         * Platform/IPC/MessageEncoder.cpp:
2309         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2310         (WebKit::networkProcessLatencyQOS):
2311         (WebKit::networkProcessThroughputQOS):
2312         (WebKit::webProcessLatencyQOS):
2313         (WebKit::webProcessThroughputQOS):
2314         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
2315         (WebKit::PluginProcessProxy::pluginNeedsExecutableHeap):
2316         (WebKit::pluginProcessLatencyQOS):
2317         (WebKit::pluginProcessThroughputQOS):
2318         * WebProcess/WebPage/WebPage.cpp:
2319
2320 2015-05-18  Michael Catanzaro  <mcatanzaro@igalia.com>
2321
2322         [CMake] Ignore warnings in system headers
2323         https://bugs.webkit.org/show_bug.cgi?id=144747
2324
2325         Reviewed by Darin Adler.
2326
2327         Separate include directories into WebKit project includes and system includes. Suppress all
2328         warnings from headers in system include directories using the SYSTEM argument to
2329         the include_directories command.
2330
2331         * CMakeLists.txt:
2332         * PlatformEfl.cmake:
2333         * PlatformGTK.cmake:
2334
2335 2015-05-18  Csaba Osztrogonác  <ossy@webkit.org>
2336
2337         Fix return-type warnings in test_ewk2_color_picker.cpp
2338         https://bugs.webkit.org/show_bug.cgi?id=145122
2339
2340         Reviewed by Gyuyoung Kim.
2341
2342         * UIProcess/API/efl/tests/test_ewk2_color_picker.cpp:
2343         (EWK2ColorPickerTest::hideColorPicker):
2344         (EWK2ColorPickerTest::hideColorPickerByRemovingElement):
2345
2346 2015-05-18  Skachkov Alexandr  <gskachkov@gmail.com>
2347
2348         [ES6] Arrow function syntax. Feature flag for arrow function
2349         https://bugs.webkit.org/show_bug.cgi?id=145108
2350
2351         Reviewed by Ryosuke Niwa.
2352
2353         Added feature flag ENABLE_ES6_ARROWFUNCTION_SYNTAX for arrow function
2354
2355         * Configurations/FeatureDefines.xcconfig:
2356
2357 2015-05-18  Anders Carlsson  <andersca@apple.com>
2358
2359         WKWebsiteDataStore should fully support session storage
2360         https://bugs.webkit.org/show_bug.cgi?id=145145
2361         rdar://problem/10690447
2362
2363         Reviewed by Sam Weinig.
2364
2365         Add a session store data type and handle it when clearing and fetching data.
2366
2367         * Shared/WebsiteData/WebsiteDataTypes.h:
2368         * UIProcess/API/Cocoa/WKWebsiteDataRecord.h:
2369         * UIProcess/API/Cocoa/WKWebsiteDataRecord.mm:
2370         (dataTypesToString):
2371         * UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h:
2372         (WebKit::toWebsiteDataTypes):
2373         (WebKit::toWKWebsiteDataTypes):
2374         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
2375         (+[WKWebsiteDataStore allWebsiteDataTypes]):
2376         * UIProcess/Storage/StorageManager.cpp:
2377         (WebKit::StorageManager::SessionStorageNamespace::origins):
2378         (WebKit::StorageManager::SessionStorageNamespace::clearStorageAreasMatchingOrigin):
2379         (WebKit::StorageManager::SessionStorageNamespace::clearAllStorageAreas):
2380         (WebKit::StorageManager::getSessionStorageOrigins):
2381         (WebKit::StorageManager::deleteSessionStorageOrigins):
2382         (WebKit::StorageManager::deleteSessionStorageEntriesForOrigins):
2383         * UIProcess/Storage/StorageManager.h:
2384         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2385         (WebKit::WebsiteDataStore::fetchData):
2386         (WebKit::WebsiteDataStore::removeData):
2387
2388 2015-05-18  Brady Eidson  <beidson@apple.com>
2389
2390         Followup to: Networking process on iOS can be suspended and never exit
2391         https://bugs.webkit.org/show_bug.cgi?id=144971.
2392
2393         Unreviewed. Fixing API tests that revealed the unintentional change in behavior.
2394
2395         * Shared/ChildProcessProxy.cpp:
2396         (WebKit::ChildProcessProxy::shutDownProcess): The on WebProcessProxy code path that this
2397           was adopted from had an m_connection null check, and that null check needs to remain.
2398
2399 2015-05-18  Csaba Osztrogonác  <ossy@webkit.org>
2400
2401         [GTK] URTBF after r184503.
2402
2403         * PlatformGTK.cmake:
2404
2405 2015-05-18  Brady Eidson  <beidson@apple.com>
2406
2407         Networking process on iOS can be suspended and never exit.
2408         <rdar://problem/20368630> and https://bugs.webkit.org/show_bug.cgi?id=144971
2409
2410         Reviewed by Darin Adler.
2411
2412         There's a few issues here.
2413         
2414         1 - When the NetworkProcessProxy goes away, it takes its process assertion with it. This causes
2415             the Network process to suspend indefinitely, unable to ever respond to IPC::Connection callbacks.
2416             We already solved this with WebProcess with a watchdog timer keeping both the process assertion
2417             and xpc_connection alive while the process shuts down. This patch expands that to the network
2418             process, and it will be easy to expand that to database and plugin processes doing forward.
2419         
2420         2 - All of our child processes either decide to self-terminate or listen for their connection to
2421             close at which point they terminate. This leads to various races. We should
2422             move to a model where the UI process explicitly tells them to shutdown, and this patch starts us 
2423             down that path.
2424         
2425         * CMakeLists.txt:
2426         * DerivedSources.make:
2427         * WebKit2.xcodeproj/project.pbxproj:
2428         
2429         * NetworkProcess/NetworkProcess.cpp:
2430         (WebKit::NetworkProcess::didReceiveMessage): Send ChildProcess messages to ChildProcess.
2431         
2432         * Shared/ChildProcess.cpp:
2433         (WebKit::ChildProcess::shutDown): For now, just terminate the process. In the future have the
2434           process do cleanup work before it is terminated.
2435         * Shared/ChildProcess.h:
2436         * Shared/ChildProcess.messages.in: Added.
2437         
2438         * Shared/ChildProcessProxy.cpp:
2439         (WebKit::ChildProcessProxy::shutDownProcess): Set a watchdog and - if possible - explicitly message 
2440           the process to ShutDown.
2441         (WebKit::ChildProcessProxy::abortProcessLaunchIfNeeded): Deleted.
2442         * Shared/ChildProcessProxy.h:
2443         
2444         * UIProcess/WebProcessPool.cpp:
2445         (WebKit::WebProcessPool::~WebProcessPool): Explicitly tell the network process to shut down.
2446         
2447         * UIProcess/WebProcessProxy.cpp:
2448         (WebKit::WebProcessProxy::removeWebPage): Move abortProcessLaunchIfNeeded() and the watchdog timer
2449           code to ChildProcessProxy::shutDownProcess.
2450         
2451         * WebProcess/WebProcess.cpp:
2452         (WebKit::WebProcess::didReceiveMessage): Send ChildProcess messages to ChildProcess::didReceiveMessage.
2453
2454 2015-05-17  Carlos Garcia Campos  <cgarcia@igalia.com>
2455
2456         Network Cache: Make Data::adoptMap take the ownership of the file descriptor
2457         https://bugs.webkit.org/show_bug.cgi?id=144950
2458
2459         Reviewed by Antti Koivisto.
2460
2461         It will be required to implement ShareableResource for soup
2462         network backend. Also move the common code of Data to a common
2463         file and add mapToFile(). The mapFile version that receives a file
2464         descriptor has been renamed to adoptAndMapFile().
2465
2466         * CMakeLists.txt: Add new file to compilation.
2467         * NetworkProcess/cache/NetworkCacheBlobStorage.cpp:
2468         (WebKit::NetworkCache::BlobStorage::add): Use mapToFile().
2469         * NetworkProcess/cache/NetworkCacheData.cpp: Added.
2470         (WebKit::NetworkCache::Data::mapToFile): Write the data to the
2471         given file and map it.
2472         (WebKit::NetworkCache::mapFile):
2473         (WebKit::NetworkCache::adoptAndMapFile):
2474         (WebKit::NetworkCache::computeSHA1):
2475         (WebKit::NetworkCache::bytesEqual):
2476         * NetworkProcess/cache/NetworkCacheData.h:
2477         * NetworkProcess/cache/NetworkCacheDataCocoa.mm:
2478         (WebKit::NetworkCache::Data::adoptMap): Close the file descriptor.
2479         * NetworkProcess/cache/NetworkCacheDataSoup.cpp:
2480         (WebKit::NetworkCache::Data::Data): Use a constructor that
2481         receives a file descriptor instead of the one receiving
2482         Backing. If the file descriptor is not -1 then the Data is a map.
2483         (WebKit::NetworkCache::MapWrapper::~MapWrapper): Also close the
2484         file descriptor.
2485         (WebKit::NetworkCache::Data::adoptMap): Pass the file descriptor
2486         to the MapWrapper and create the Data passing the file descriptor.
2487         * UIProcess/API/APIUserContentExtensionStore.cpp:
2488         (API::openAndMapContentExtension): Use mapFile that receives a
2489         file path.
2490         (API::compiledToFile): Use adoptAndMapFile() and don't close the
2491         descriptor.
2492
2493 2015-05-16  Andy Estes  <aestes@apple.com>
2494
2495         [iOS] WKPDFView should not follow javascript: links
2496         https://bugs.webkit.org/show_bug.cgi?id=145101
2497
2498         Reviewed by Dan Bernstein.
2499
2500         * UIProcess/WebPageProxy.cpp:
2501         (WebKit::WebPageProxy::navigateToPDFLinkWithSimulatedClick): Returned early if url's protocol is javascript:.
2502         (WebKit::WebPageProxy::navigateToURLWithSimulatedClick): Renamed to navigateToPDFLinkWithSimulatedClick to
2503         reflect that this function is exclusively for following PDF links.
2504         * UIProcess/WebPageProxy.h:
2505         * UIProcess/ios/WKPDFView.mm:
2506         (-[WKPDFView annotation:wasTouchedAtPoint:controller:]):
2507         (-[WKPDFView actionSheetAssistant:openElementAtLocation:]):
2508         * WebProcess/WebPage/WebPage.cpp:
2509         (WebKit::WebPage::navigateToPDFLinkWithSimulatedClick): Renamed from navigateToURLWithSimulatedClick.
2510         (WebKit::WebPage::navigateToURLWithSimulatedClick): Renamed to navigateToPDFLinkWithSimulatedClick.
2511         * WebProcess/WebPage/WebPage.h:
2512         * WebProcess/WebPage/WebPage.messages.in:
2513
2514 2015-05-16  Brent Fulgham  <bfulgham@apple.com>
2515
2516         [iOS] Remote scrolling tree needs to coordinate scroll snap state during resize/rotations
2517         https://bugs.webkit.org/show_bug.cgi?id=145059
2518         <rdar://problem/20975978>
2519
2520         Reviewed by Simon Fraser.
2521
2522         The web view needs to update its scroll snap point offsets to take into account any
2523         adjustments to the view size caused by content insets. We also need to update the
2524         offstes after device rotation.
2525
2526         * UIProcess/API/Cocoa/WKWebView.mm:
2527         (-[WKWebView scrollViewWillEndDragging:withVelocity:targetContentOffset:]): Retrieve the proper
2528         computed content inset for the view and incorporate into any scroll snap point adjustments.
2529         (-[WKWebView _updateVisibleContentRects]): If we have active scroll snap points, 
2530         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h:
2531         * UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm:
2532         (WebKit::RemoteScrollingCoordinatorProxy::adjustTargetContentOffsetForSnapping): Update to account
2533         for content inset.
2534         (WebKit::RemoteScrollingCoordinatorProxy::shouldSnapForMainFrameScrolling): Also validate that the
2535         active index is valid.
2536         (WebKit::RemoteScrollingCoordinatorProxy::closestSnapOffsetForMainFrameScrolling): Update to track
2537         current active snap offset index.
2538         (WebKit::RemoteScrollingCoordinatorProxy::hasActiveSnapPoint): Added.
2539         (WebKit::RemoteScrollingCoordinatorProxy::nearestActiveSnapPoint): Added. It calculates the proper
2540         scroll position incorporating any snap point and content insets.
2541
2542 2015-05-15  Yongjun Zhang  <yongjun_zhang@apple.com>
2543
2544         Don't reset the preview recognizer in [WKContentViewInteraction cleanupInteraction]
2545         https://bugs.webkit.org/show_bug.cgi?id=145081
2546
2547         We shouldn't reset the recognizer in [WKContentViewInteraction cleanupInteraction] since we don't re-add it
2548         back to WKContentView when the process relaunched. Since we already add/remove it when the view is move into/
2549         removed from the window, we don't need reset it in cleanupInteraction.
2550
2551         Reviewed by Dan Bernstein.
2552
2553         * UIProcess/ios/WKContentViewInteraction.mm:
2554         (-[WKContentView cleanupInteraction]):
2555
2556 2015-05-15  James Savage  <james.savage@apple.com>
2557
2558         REGRESSION (r181910): WKWebView incorrectly scales snapshot
2559         https://bugs.webkit.org/show_bug.cgi?id=145076
2560
2561         Reviewed by Tim Horton.
2562
2563         We added a fast path to snapshotting using IOSurfaces with
2564         http://trac.webkit.org/changeset/181910 which incorrectly determined
2565         scale and transform and resulted in bad snapshots in some situations.
2566
2567         * UIProcess/API/Cocoa/WKWebView.mm:
2568         (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]):
2569         When snapshotting an IOSurface we need to compute our scale based off of
2570         the rect in the WKWebView coordinates, we also failed to account for
2571         non-zero origins in the snapshot rect. Remove an unused varible while
2572         we're here.
2573
2574 2015-05-15  Alex Christensen  <achristensen@webkit.org>
2575
2576         [Content Extensions] Fail to load old content extension files
2577         https://bugs.webkit.org/show_bug.cgi?id=145027
2578
2579         Reviewed by Eric Carlson.
2580
2581         * UIProcess/API/APIUserContentExtensionStore.cpp:
2582         (API::openAndMapContentExtension):
2583         * UIProcess/API/APIUserContentExtensionStore.h:
2584
2585 2015-05-15  Jeremy Jones  <jeremyj@apple.com>
2586
2587         Limit alternate fullscreen with linked on or after.
2588         https://bugs.webkit.org/show_bug.cgi?id=144894
2589
2590         Reviewed by Dean Jackson.
2591
2592         * UIProcess/API/Cocoa/WKWebView.mm:
2593         (shouldAllowAlternateFullscreen): Added.
2594         (-[WKWebView initWithFrame:configuration:]):
2595
2596 2015-05-15  Chris Dumez  <cdumez@apple.com>
2597
2598         [WK2][Cocoa] Back swipe tab snapshot takes a long time to be removed on bing.com
2599         https://bugs.webkit.org/show_bug.cgi?id=145061
2600         <rdar://problem/20939743>
2601
2602         Reviewed by Tim Horton.
2603
2604         When swiping back from a video search result to the list of video
2605         search results on bing.com, the back swipe gesture tab snapshot takes
2606         ~3 seconds to be removed, even though the page gets loaded almost
2607         instantly from PageCache. The tab snapshot should be removed as soon as
2608         the load is done.
2609
2610         The issue is that we only cleared the back swipe gesture tab snapshot
2611         after PageClient::didFinishLoadForMainFrame() has been called. However,
2612         PageClient::didFinishLoadForMainFrame() was only being called by
2613         WebPageProxy if the main frame loaded *without* error. In case the main
2614         frame loaded with an error, only WebPageProxy::didFailLoadForFrame() is
2615         called, not WebPageProxy::didFinishLoadForFrame() and we would fail to
2616         remove the gesture snapshot until the 3 seconds timeout.
2617
2618         This patch calls PageClient::didFinishLoadForMainFrame() from
2619         WebPageProxy::didFailLoadForFrame() so we remove the snapshot in the
2620         error case as well.
2621
2622         The reason didFailLoadForFrame() is being called on bing.com video
2623         search results is because a "ping" load is aborted when the page is
2624         entering PageCache. Aborting any kind of resource load sets a
2625         "cancellation" error on the main document.
2626
2627         * UIProcess/WebPageProxy.cpp:
2628         (WebKit::WebPageProxy::didFailLoadForFrame):
2629
2630 2015-05-14  Carlos Garcia Campos  <cgarcia@igalia.com>
2631
2632         REGRESSION(r183861): [SOUP] Downloads are broken when using the Network Process
2633         https://bugs.webkit.org/show_bug.cgi?id=144738
2634
2635         Reviewed by Alexey Proskuryakov.
2636
2637         When converting the main resource handle to a download, the
2638         NetworkResourceLoader is aborted, and the ResourceHandle is
2639         cleaned up aborting the download operation. We need to use a
2640         different ResourceHandle for the download operation.
2641
2642         * Shared/Downloads/soup/DownloadSoup.cpp:
2643         (WebKit::Download::startWithHandle): Use ResourceHandle::releaseForDownload()
2644         instead of reusing the given handle.
2645
2646 2015-05-14  Brady Eidson  <beidson@apple.com>
2647
2648         Rename connectionDidClose and related methods to be more clear.
2649         https://bugs.webkit.org/show_bug.cgi?id=145030
2650
2651         Reviewed by Darin Adler.
2652
2653         These methods were easy to confuse with "Connection::Client::didClose()", yet they
2654         were about something much more explicit: A child process being shut down by the UI Process.
2655
2656         Let's call them as such.
2657
2658         * Shared/ChildProcessProxy.cpp:
2659         (WebKit::ChildProcessProxy::shutDownProcess):
2660         (WebKit::ChildProcessProxy::clearConnection): Deleted.
2661         (WebKit::ChildProcessProxy::connectionDidClose): Deleted.
2662         * Shared/ChildProcessProxy.h:
2663
2664         * UIProcess/Databases/DatabaseProcessProxy.cpp:
2665         (WebKit::DatabaseProcessProxy::processWillShutDown):
2666         * UIProcess/Databases/DatabaseProcessProxy.h:
2667
2668         * UIProcess/Network/NetworkProcessProxy.cpp:
2669         (WebKit::NetworkProcessProxy::processWillShutDown):
2670         * UIProcess/Network/NetworkProcessProxy.h:
2671
2672         * UIProcess/Plugins/PluginProcessProxy.cpp:
2673         (WebKit::PluginProcessProxy::processWillShutDown):
2674         * UIProcess/Plugins/PluginProcessProxy.h:
2675
2676         * UIProcess/WebFrameProxy.cpp:
2677         (WebKit::WebFrameProxy::webProcessWillShutDown):
2678         (WebKit::WebFrameProxy::disconnect): Deleted.
2679         * UIProcess/WebFrameProxy.h:
2680
2681         * UIProcess/WebPageProxy.cpp:
2682         (WebKit::WebPageProxy::webProcessWillShutDown):
2683         (WebKit::WebPageProxy::connectionDidClose): Deleted.
2684         * UIProcess/WebPageProxy.h:
2685
2686         * UIProcess/WebProcessLifetimeTracker.cpp:
2687         (WebKit::WebProcessLifetimeTracker::webProcessWillShutDown):
2688         (WebKit::WebProcessLifetimeTracker::connectionDidClose): Deleted.
2689         * UIProcess/WebProcessLifetimeTracker.h:
2690
2691         * UIProcess/WebProcessProxy.cpp:
2692         (WebKit::WebProcessProxy::processWillShutDown):
2693         (WebKit::WebProcessProxy::shutDown):
2694         (WebKit::WebProcessProxy::removeWebPage):
2695         (WebKit::WebProcessProxy::didClose):
2696         (WebKit::WebProcessProxy::disconnectFramesFromPage):
2697         (WebKit::WebProcessProxy::shouldTerminate):
2698         (WebKit::WebProcessProxy::requestTermination):
2699         (WebKit::WebProcessProxy::connectionDidClose): Deleted.
2700         (WebKit::WebProcessProxy::disconnect): Deleted.
2701         * UIProcess/WebProcessProxy.h:
2702
2703 2015-05-14  Zhuo Li  <zachli@apple.com>
2704
2705         Some CFNetwork SPI to reset HSTS hosts added since a date should not be used on Yosemite.
2706         https://bugs.webkit.org/show_bug.cgi?id=145025.
2707         and
2708         rdar://problem/20646308.
2709
2710         Reviewed by Alexey Proskuryakov.
2711
2712         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2713         (WebKit::WebProcessPool::resetHSTSHostsAddedAfterDate):
2714
2715 2015-05-14  Timothy Horton  <timothy_horton@apple.com>
2716
2717         Add a layout mode that scales down the view to try to fit the document
2718         https://bugs.webkit.org/show_bug.cgi?id=145022
2719         <rdar://problem/19790341>
2720
2721         Reviewed by Dean Jackson.
2722
2723         * Shared/WebPageCreationParameters.cpp:
2724         (WebKit::WebPageCreationParameters::encode):
2725         (WebKit::WebPageCreationParameters::decode):
2726         * Shared/WebPageCreationParameters.h:
2727         * UIProcess/WebPageProxy.cpp:
2728         (WebKit::WebPageProxy::creationParameters):
2729         (WebKit::WebPageProxy::setShouldScaleViewToFitDocument):
2730         * UIProcess/WebPageProxy.h:
2731         * WebProcess/WebPage/DrawingArea.h:
2732         (WebKit::DrawingArea::setShouldScaleViewToFitDocument):
2733         * WebProcess/WebPage/WebPage.cpp:
2734         (WebKit::WebPage::WebPage):
2735         (WebKit::WebPage::setShouldScaleViewToFitDocument):
2736         * WebProcess/WebPage/WebPage.h:
2737         * WebProcess/WebPage/WebPage.messages.in:
2738         Plumb shouldScaleViewToFitDocument through to the DrawingArea.
2739
2740         * UIProcess/mac/WKViewLayoutStrategy.mm:
2741         (+[WKViewLayoutStrategy layoutStrategyWithPage:view:mode:]):
2742         (-[WKViewDynamicSizeComputedFromMinimumDocumentSizeLayoutStrategy initWithPage:view:mode:]):
2743         (-[WKViewDynamicSizeComputedFromMinimumDocumentSizeLayoutStrategy updateLayout]):
2744         (-[WKViewDynamicSizeComputedFromMinimumDocumentSizeLayoutStrategy willChangeLayoutStrategy]):
2745         * UIProcess/API/C/WKLayoutMode.h:
2746         * UIProcess/API/Cocoa/_WKLayoutMode.h:
2747         Add a new layout mode, which just turns on shouldScaleViewToFitDocument,
2748         and otherwise behaves as normal.
2749
2750         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
2751         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
2752         (WebKit::TiledCoreAnimationDrawingArea::setShouldScaleViewToFitDocument):
2753         (WebKit::TiledCoreAnimationDrawingArea::scaleViewToFitDocumentIfNeeded):
2754         (WebKit::TiledCoreAnimationDrawingArea::flushLayers):
2755         On every flush where either the document size or view size has changed,
2756         or layout is outstanding, do a layout with fixed layout off to determine
2757         whether the document fits inside the view. If it doesn't, scale it down
2758         to fit. This will require an extra layout for every resize while in the
2759         scaled-down state, but there is potential for future optimization.
2760
2761 2015-05-14  Anders Carlsson  <andersca@apple.com>
2762
2763         Local storage origins should include origins with transient local storage
2764         https://bugs.webkit.org/show_bug.cgi?id=145017
2765         rdar://problem/10690447
2766
2767         Reviewed by Sam Weinig.
2768
2769         The transient local storage namespaces are used for third party data blocking and will stay
2770         around until the UI process exits so we need to be able to include website data from transient storage
2771         in the website data store APIs.
2772
2773         * UIProcess/Storage/StorageManager.cpp:
2774         (WebKit::StorageManager::TransientLocalStorageNamespace::origins):
2775         (WebKit::StorageManager::getLocalStorageOrigins):
2776         * UIProcess/Storage/StorageManager.h:
2777         * UIProcess/WebKeyValueStorageManager.cpp:
2778         (WebKit::WebKeyValueStorageManager::getKeyValueStorageOrigins):
2779         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2780         (WebKit::WebsiteDataStore::fetchData):
2781
2782 2015-05-14  Beth Dakin  <bdakin@apple.com>
2783
2784         Change range of possible forces for mouseforcechanged DOM event
2785         https://bugs.webkit.org/show_bug.cgi?id=144987
2786         -and corresponding-
2787         rdar://problem/20472802
2788
2789         Reviewed by Tim Horton.
2790
2791         Change to a 0-3 range.
2792         * Shared/mac/WebEventFactory.mm:
2793         (WebKit::WebEventFactory::createWebMouseEvent):
2794
2795 2015-05-14  Zan Dobersek  <zdobersek@igalia.com>
2796
2797         [GTK] Add missing ENABLE(NETSCAPE_PLUGIN_API) build guards
2798         https://bugs.webkit.org/show_bug.cgi?id=144994
2799
2800         Reviewed by Carlos Garcia Campos.
2801
2802         This fixes the build when configured with Netscape plugin API
2803         support disabled.
2804
2805         * UIProcess/API/gtk/WebKitWebContext.cpp:
2806         (webkit_web_context_set_additional_plugins_directory):
2807         (webkitWebContextGetPluginThread):
2808         * UIProcess/Launcher/gtk/ProcessLauncherGtk.cpp:
2809         (WebKit::ProcessLauncher::launchProcess):
2810
2811 2015-05-13  Carlos Garcia Campos  <cgarcia@igalia.com>
2812
2813         [SOUP] Network Cache: NetworkProcess segfault when file system doesn't support xattrs
2814         https://bugs.webkit.org/show_bug.cgi?id=144953
2815
2816         Reviewed by Martin Robinson.
2817
2818         Return early if we fail to get the birthtime xattr.
2819
2820         * NetworkProcess/cache/NetworkCacheFileSystemPosix.h:
2821         (WebKit::NetworkCache::fileTimes):
2822
2823 2015-05-13  Daniel Bates  <dabates@apple.com>
2824
2825         Rename ProcessThrottlerClient::{send, cancel}ProcessWillSuspend() to {send, cancel}PrepareToSuspend()
2826         https://bugs.webkit.org/show_bug.cgi?id=144619
2827         <rdar://problem/20812779>
2828
2829         Reviewed by Andy Estes.
2830
2831         The names of the functions ProcessThrottlerClient::{send, cancel}ProcessWillSuspend() are misnomers. These
2832         functions are called when the ProcessThrottler wants to prepare the process that it manages for suspension
2833         and changes its mind, respectively. That is, these functions do not actually correspond to the OS decision
2834         to suspend a process or cancel the suspension of a process, respectively. So, rename these functions and
2835         associated {Network, Web}ProcessProxy message names to better describe their purpose.
2836
2837         * NetworkProcess/NetworkProcess.cpp:
2838         (WebKit::NetworkProcess::prepareToSuspend):
2839         (WebKit::NetworkProcess::cancelPrepareToSuspend):
2840         (WebKit::NetworkProcess::processWillSuspend): Deleted.
2841         (WebKit::NetworkProcess::cancelProcessWillSuspend): Deleted.
2842         * NetworkProcess/NetworkProcess.h:
2843         * NetworkProcess/NetworkProcess.messages.in:
2844         * UIProcess/Network/NetworkProcessProxy.cpp:
2845         (WebKit::NetworkProcessProxy::sendPrepareToSuspend):
2846         (WebKit::NetworkProcessProxy::sendCancelPrepareToSuspend):
2847         (WebKit::NetworkProcessProxy::sendProcessWillSuspend): Deleted.
2848         (WebKit::NetworkProcessProxy::sendCancelProcessWillSuspend): Deleted.
2849         * UIProcess/Network/NetworkProcessProxy.h:
2850         * UIProcess/ProcessThrottler.cpp:
2851         (WebKit::ProcessThrottler::updateAssertion):
2852         * UIProcess/ProcessThrottlerClient.h:
2853         * UIProcess/WebProcessProxy.cpp:
2854         (WebKit::WebProcess::actualPrepareToSuspend): Formerly named prepareToSuspend.
2855         (WebKit::WebProcessProxy::sendPrepareToSuspend):
2856         (WebKit::WebProcessProxy::sendCancelPrepareToSuspend):
2857         (WebKit::WebProcessProxy::sendProcessWillSuspend): Deleted.
2858         (WebKit::WebProcessProxy::sendCancelProcessWillSuspend): Deleted.
2859         * UIProcess/WebProcessProxy.h:
2860         * WebProcess/WebProcess.cpp:
2861         (WebKit::WebProcess::prepareToSuspend):
2862         (WebKit::WebProcess::cancelPrepareToSuspend):
2863         (WebKit::WebProcess::processWillSuspend): Deleted.
2864         (WebKit::WebProcess::cancelProcessWillSuspend): Deleted.
2865         * WebProcess/WebProcess.h:
2866         * WebProcess/WebProcess.messages.in:
2867
2868 2015-05-13  Anders Carlsson  <andersca@apple.com>
2869
2870         Don't create a per-pool data store when using the modern API
2871         https://bugs.webkit.org/show_bug.cgi?id=144963
2872         rdar://problem/20331756
2873
2874         Reviewed by Tim Horton.
2875
2876         * UIProcess/API/APIProcessPoolConfiguration.cpp:
2877         (API::ProcessPoolConfiguration::createWithLegacyOptions):
2878         (API::ProcessPoolConfiguration::copy):
2879         * UIProcess/API/APIProcessPoolConfiguration.h:
2880         Keep track of whether the process pool should have a data store.
2881
2882         * UIProcess/API/C/WKContext.cpp:
2883         (WKContextGetWebsiteDataStore):
2884         * UIProcess/WebKeyValueStorageManager.cpp:
2885         (WebKit::WebKeyValueStorageManager::getKeyValueStorageOrigins):
2886         (WebKit::WebKeyValueStorageManager::getStorageDetailsByOrigin):
2887         (WebKit::WebKeyValueStorageManager::deleteEntriesForOrigin):
2888         (WebKit::WebKeyValueStorageManager::deleteAllEntries):
2889         Update now that WebProcessPool::dataStore() no longer returns a reference.
2890
2891         * UIProcess/WebProcessPool.cpp:
2892         (WebKit::WebProcessPool::WebProcessPool):
2893         Only create a data store if the configuration states that we should.
2894
2895         * UIProcess/WebProcessPool.h:
2896         Change dataStore() to return a pointer instead of a reference.
2897
2898 2015-05-13  Alexey Proskuryakov  <ap@apple.com>
2899
2900         [Mac] Sandbox violation reading SubmitDiagInfo.domains
2901         https://bugs.webkit.org/show_bug.cgi?id=144962
2902         rdar://problem/20719330
2903
2904         Reviewed by Darin Adler.
2905
2906         * WebProcess/com.apple.WebProcess.sb.in:
2907
2908 2015-05-13  Beth Dakin  <bdakin@apple.com>
2909
2910         Speculative build fix.
2911
2912         * UIProcess/API/Cocoa/_WKOverlayScrollbarStyle.h:
2913
2914 2015-05-13  Michael Catanzaro  <mcatanzaro@igalia.com>
2915
2916         [GTK][CMake] Extra include directory when libnotify is present but disabled
2917         https://bugs.webkit.org/show_bug.cgi?id=144941
2918
2919         Reviewed by Martin Robinson.
2920
2921         Add LIBNOTIFY_INCLUDE_DIRS to WebKit2_INCLUDE_DIRECTORIES only if USE_LIBNOTIFY is true,
2922         rather than checking LIBNOTIFY_FOUND.
2923
2924         * PlatformGTK.cmake:
2925
2926 2015-05-13  Beth Dakin  <bdakin@apple.com>
2927
2928         Need SPI to set the overlay scroll bar style
2929         https://bugs.webkit.org/show_bug.cgi?id=144928
2930         -and corresponding-
2931         rdar://problem/20143614
2932
2933         Reviewed by Anders Carlsson.
2934
2935         Make scrollbarOverlayStyle a part of the creation parameters. 
2936         * Shared/WebPageCreationParameters.cpp:
2937         (WebKit::WebPageCreationParameters::encode):
2938         (WebKit::WebPageCreationParameters::decode):
2939         * Shared/WebPageCreationParameters.h:
2940
2941         New SPI.
2942         * UIProcess/API/Cocoa/WKViewPrivate.h:
2943         * UIProcess/API/Cocoa/_WKOverlayScrollbarStyle.h: Added.
2944         * UIProcess/API/mac/WKView.mm:
2945         (-[WKView _setOverlayScrollbarStyle:]):
2946         (-[WKView _overlayScrollbarStyle]):
2947
2948         Store m_scrollbarOverlayStyle on WebPageProxy, and set it to the WebProcess.
2949         * UIProcess/WebPageProxy.cpp:
2950         (WebKit::WebPageProxy::WebPageProxy):
2951         (WebKit::WebPageProxy::creationParameters):
2952         (WebKit::WebPageProxy::setOverlayScrollbarStyle):
2953         * UIProcess/WebPageProxy.h:
2954         (WebKit::WebPageProxy::overlayScrollbarStyle):
2955         * WebKit2.xcodeproj/project.pbxproj:
2956
2957         Return WebPage’s scrollbarOverlayStyle().
2958         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2959         (WebKit::WebChromeClient::preferredScrollbarOverlayStyle):
2960         * WebProcess/WebCoreSupport/WebChromeClient.h:
2961
2962         Cache the scrollbarOverlayStyle() here for the WebProcess. 
2963         * WebProcess/WebPage/WebPage.cpp:
2964         (WebKit::WebPage::WebPage):
2965         (WebKit::WebPage::setScrollbarOverlayStyle):
2966         * WebProcess/WebPage/WebPage.h:
2967         (WebKit::WebPage::scrollbarOverlayStyle):
2968         * WebProcess/WebPage/WebPage.messages.in:
2969
2970 2015-05-13  Anders Carlsson  <andersca@apple.com>
2971
2972         Rename some StorageManager functions to indicate that they work on local storage entries
2973         https://bugs.webkit.org/show_bug.cgi?id=144958
2974         First part of rdar://problem/10690447.
2975
2976         Reviewed by Beth Dakin.
2977
2978         * UIProcess/Storage/StorageManager.cpp:
2979         (WebKit::StorageManager::getLocalStorageOrigins):
2980         (WebKit::StorageManager::getLocalStorageDetailsByOrigin):
2981         (WebKit::StorageManager::deleteLocalStorageEntriesForOrigin):
2982         (WebKit::StorageManager::deleteAllLocalStorageEntries):
2983         (WebKit::StorageManager::deleteLocalStorageEntriesForOrigins):
2984         (WebKit::StorageManager::getOrigins): Deleted.
2985         (WebKit::StorageManager::getStorageDetailsByOrigin): Deleted.
2986         (WebKit::StorageManager::deleteEntriesForOrigin): Deleted.
2987         (WebKit::StorageManager::deleteAllEntries): Deleted.
2988         (WebKit::StorageManager::deleteEntriesForOrigins): Deleted.
2989         * UIProcess/Storage/StorageManager.h:
2990         * UIProcess/WebKeyValueStorageManager.cpp:
2991         (WebKit::WebKeyValueStorageManager::getKeyValueStorageOrigins):
2992         (WebKit::WebKeyValueStorageManager::getStorageDetailsByOrigin):
2993         (WebKit::WebKeyValueStorageManager::deleteEntriesForOrigin):
2994         (WebKit::WebKeyValueStorageManager::deleteAllEntries):
2995         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2996         (WebKit::WebsiteDataStore::fetchData):
2997         (WebKit::WebsiteDataStore::removeData):
2998
2999 2015-05-13  Joseph Pecoraro  <pecoraro@apple.com>
3000
3001         Crash under WebKit::WebInspectorProxy::attachAvailabilityChanged sometimes opening new page
3002         https://bugs.webkit.org/show_bug.cgi?id=144957
3003
3004         Reviewed by Simon Fraser.
3005
3006         * UIProcess/WebInspectorProxy.cpp:
3007         (WebKit::WebInspectorProxy::attachAvailabilityChanged):
3008
3009 2015-05-13  Joseph Pecoraro  <pecoraro@apple.com>
3010
3011         Pass String as reference in more places
3012         https://bugs.webkit.org/show_bug.cgi?id=144769
3013
3014         Reviewed by Daniel Bates.
3015
3016         * WebProcess/WebPage/WebInspectorUI.cpp:
3017         (WebKit::WebInspectorUI::showMainResourceForFrame):
3018         * WebProcess/WebPage/WebInspectorUI.h:
3019
3020 2015-05-13  Timothy Horton  <timothy_horton@apple.com>
3021
3022         View scale changes are temporarily lost after restoring a page from the page cache
3023         https://bugs.webkit.org/show_bug.cgi?id=144934
3024
3025         Reviewed by Brady Eidson.
3026
3027         * WebProcess/WebPage/WebPage.cpp:
3028         (WebKit::WebPage::WebPage):
3029         (WebKit::WebPage::scalePage):
3030         (WebKit::WebPage::scalePageInViewCoordinates):
3031         (WebKit::WebPage::pageScaleFactor):
3032         (WebKit::WebPage::viewScaleFactor):
3033         (WebKit::WebPage::scaleView):
3034         * WebProcess/WebPage/WebPage.h:
3035         (WebKit::WebPage::viewScaleFactor): Deleted.
3036         Get rid of m_viewScaleFactor, instead using Page::viewScaleFactor.
3037
3038 2015-05-13  Sungmann Cho  <sungmann.cho@navercorp.com>
3039
3040         Minor cleanups to PluginProxy.cpp.
3041         https://bugs.webkit.org/show_bug.cgi?id=144948
3042
3043         Reviewed by Gyuyoung Kim.
3044
3045         1. Remove unnecessary #include.
3046         2. Remove unnecessary return statement from PluginProxy::paint().
3047
3048         No new tests, no behavior change.
3049
3050         * WebProcess/Plugins/PluginProxy.cpp:
3051         (WebKit::PluginProxy::paint):
3052
3053 2015-05-13  Daegyu Lee  <daegyu.lee@navercorp.com>
3054
3055         REGRESSION(r176631): [EFL] Fullscreen feature doesn't work correctly on MiniBrowser
3056         https://bugs.webkit.org/show_bug.cgi?id=144906
3057
3058         Reviewed by Gyuyoung Kim.
3059
3060         * UIProcess/CoordinatedGraphics/PageViewportController.cpp:
3061         (WebKit::PageViewportController::updateMinimumScaleToFit): Recover the r176631 condition to
3062         call applyScaleAfterRenderingContents function to apply correct scale.
3063
3064 2015-05-12  Dan Bernstein  <mitz@apple.com>
3065
3066         In Safari, Debug > Get Bytecode Profile crashes the Web Content process
3067         https://bugs.webkit.org/show_bug.cgi?id=144944
3068
3069         Reviewed by Darin Adler.
3070
3071         * WebProcess/WebPage/WebPage.cpp:
3072         (WebKit::WebPage::getBytecodeProfile): Don’t assert that m_perBytecodeProfiler isn’t null,
3073         because it is when the profiler is disabled, which is the default. In that case, return
3074         after sending back the empty string, rather than continuing to dereference a null pointer.
3075
3076 2015-05-12  Jon Honeycutt  <jhoneycutt@apple.com>
3077
3078         Crash when using <input type=file>
3079
3080         <https://bugs.webkit.org/show_bug.cgi?id=144939>
3081         <rdar://problem/20172315>
3082
3083         Reviewed by Andy Estes.
3084
3085         * UIProcess/ios/forms/WKFileUploadPanel.mm:
3086         Use a RefPtr to hold the WebOpenPanelResultListenerProxy, because the
3087         WKFileUploadPanel can outlive it.
3088
3089 2015-05-12  Simon Fraser  <simon.fraser@apple.com>
3090
3091         Turn antialiased font dilation off by default
3092         https://bugs.webkit.org/show_bug.cgi?id=144940
3093         rdar://problem/20923031
3094
3095         Reviewed by Sam Weinig.
3096
3097         Turn antialised font dilation off by default.
3098
3099         * Shared/WebPreferencesDefinitions.h:
3100         * UIProcess/API/C/WKPreferencesRefPrivate.h:
3101
3102 2015-05-12  Daniel Bates  <dabates@apple.com>
3103
3104         Make {Network, Web}ProcessProxy inherit from ProcessThrottleClient privately
3105         https://bugs.webkit.org/show_bug.cgi?id=144886
3106
3107         Reviewed by Darin Adler.
3108
3109         {Network, Web}ProcessProxy are implemented in terms of ProcessThrottleClient, an
3110         interface that defines the callbacks that ProcessThrottler makes to a client. We
3111         do not want to allow arbitrary callers to make use of the interface ProcessThrottleClient.
3112         So, we should use private inheritance to represent the relationship between
3113         {Network, Web}ProcessProxy and ProcessThrottleClient instead of public inheritance.
3114
3115         Additionally make ProcessThrottler a instance variable of {Network, Web}ProcessProxy instead
3116         of holding a smart pointer to a ProcessThrottler instance because we always want to
3117         have a ProcessThrottler for each instance of {Network, Web}ProcessProxy.
3118
3119         * UIProcess/Network/NetworkProcessProxy.cpp:
3120         (WebKit::NetworkProcessProxy::NetworkProcessProxy): Update code to work now that m_throttler
3121         is an instance of ProcessThrottler instead of a smart pointer to a ProcessThrottler instance.
3122         (WebKit::NetworkProcessProxy::didFinishLaunching): Update code to access functions of
3123         m_throttler by reference instead of by pointer.
3124         (WebKit::NetworkProcessProxy::didCancelProcessSuspension): Ditto.
3125         (WebKit::NetworkProcessProxy::processReadyToSuspend): Ditto.
3126         (WebKit::NetworkProcessProxy::setIsHoldingLockedFiles): Ditto.
3127         * UIProcess/Network/NetworkProcessProxy.h: Inherit from ProcessThrottleClient privately.
3128         (WebKit::NetworkProcessProxy::throttler): Update code to work now that m_throttler is an
3129         instance of ProcessThrottler instead of a smart pointer to a ProcessThrottler instance.
3130         * UIProcess/ProcessThrottler.cpp:
3131         (WebKit::ProcessThrottler::ProcessThrottler): Update code to work now that m_process is
3132         a lvalue reference instead of a pointer.
3133         (WebKit::ProcessThrottler::updateAssertion): Ditto.
3134         (WebKit::ProcessThrottler::assertionWillExpireImminently): Ditto.
3135         * UIProcess/ProcessThrottler.h: Ditto.
3136         * UIProcess/WebProcessProxy.cpp:
3137         (WebKit::WebProcessProxy::WebProcessProxy): Update code to work now that m_throttler is an
3138         instance of ProcessThrottler instead of a smart pointer to a ProcessThrottler instance. 
3139         (WebKit::WebProcessProxy::didFinishLaunching): Update code to access functions of
3140         m_throttler by reference instead of by pointer.
3141         (WebKit::WebProcessProxy::processReadyToSuspend): Ditto.
3142         (WebKit::WebProcessProxy::didCancelProcessSuspension): Ditto.
3143         (WebKit::WebProcessProxy::setIsHoldingLockedFiles): Ditto.
3144         * UIProcess/WebProcessProxy.h: Inherit from ProcessThrottleClient privately.
3145         (WebKit::WebProcessProxy::throttler): Update code to work now that m_throttler is an
3146         instance of ProcessThrottler instead of a smart pointer to a ProcessThrottler instance.
3147
3148 2015-05-12  Anders Carlsson  <andersca@apple.com>
3149
3150         Production builds should link against the shims directly
3151         https://bugs.webkit.org/show_bug.cgi?id=144922
3152         rdar://problem/19708579
3153
3154         Reviewed by Dan Bernstein.
3155
3156         * Configurations/NetworkService.xcconfig:
3157         Point to an Info.plist that has DYLD_INSERT_LIBRARIES set on 10.10 and earlier.
3158         Link directly against SecItemShim.dylib where possible.
3159
3160         * Configurations/PluginProcessShim.xcconfig:
3161         Set the install name and install path.
3162
3163         * Configurations/PluginService.32.xcconfig:
3164         Point to an Info.plist that has DYLD_INSERT_LIBRARIES set on 10.10 and earlier.
3165         Link directly against PluginProcessShim.dylib where possible.
3166
3167         * Configurations/PluginService.64.xcconfig:
3168         Point to an Info.plist that has DYLD_INSERT_LIBRARIES set on 10.10 and earlier.
3169         Link directly against PluginProcessShim.dylib where possible.
3170
3171         * Configurations/SecItemShim.xcconfig:
3172         Set the install name and install path.
3173
3174         * Configurations/WebContentService.xcconfig:
3175         Point to an Info.plist that has DYLD_INSERT_LIBRARIES set on 10.10 and earlier.
3176         Link directly against WebProcessShim.dylib where possible.
3177
3178         * Configurations/WebProcessShim.xcconfig:
3179         Set the install name and install path.
3180
3181         * NetworkProcess/EntryPoint/mac/XPCService/NetworkService/Info-OSX-10.9-10.10.plist: Copied from Source/WebKit2/NetworkProcess/EntryPoint/mac/XPCService/NetworkService/Info-OSX.plist.
3182         * NetworkProcess/EntryPoint/mac/XPCService/NetworkService/Info-OSX.plist:
3183         Add an Info.plist for 10.9 and 10.10 and remove DYLD_INSERT_LIBRARIES from the non-legacy plist.
3184
3185         * 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.
3186         * PluginProcess/EntryPoint/mac/XPCService/PluginService.32-64.Info.plist:
3187         Add an Info.plist for 10.9 and 10.10 and remove DYLD_INSERT_LIBRARIES from the non-legacy plist.
3188
3189         * WebKit2.xcodeproj/project.pbxproj:
3190         Add new files.
3191
3192         * WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-OSX-10.9-10.10.plist: Copied from Source/WebKit2/WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-OSX.plist.
3193         * WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-OSX.plist:
3194         Add an Info.plist for 10.9 and 10.10 and remove DYLD_INSERT_LIBRARIES from the non-legacy plist.
3195
3196 2015-05-12  Alexey Proskuryakov  <ap@apple.com>
3197
3198         Undo a mistaken part of r184211.
3199
3200         * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::cookieStorageDirectory):
3201         * UIProcess/WebProcessPool.h:
3202         cookieStorageDirectory() is used on iOS, so bring it back.
3203
3204 2015-05-08  Alexey Proskuryakov  <ap@apple.com>
3205
3206         [Mac] Share cookie storage between UI process and secondary processes
3207         https://bugs.webkit.org/show_bug.cgi?id=144820
3208         rdar://problem/20572830
3209
3210         Reviewed by Darin Adler.
3211
3212         Pass a cookie storage descriptor that includes file path as well as other data that
3213         CFNetwork needs to use the same cookies storage as in another process (session cookies
3214         are still separate).
3215
3216         While at it, started to clean up code that passes cookie storage path. It was mostly
3217         dead and unimplemented, only used in child processes when USE(SECCOMP_FILTERS) was enabled.
3218
3219         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
3220         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
3221         * Shared/Network/NetworkProcessCreationParameters.cpp:
3222         (WebKit::NetworkProcessCreationParameters::encode):
3223         (WebKit::NetworkProcessCreationParameters::decode):
3224         * Shared/Network/NetworkProcessCreationParameters.h:
3225         * Shared/WebProcessCreationParameters.cpp:
3226         (WebKit::WebProcessCreationParameters::encode):
3227         (WebKit::WebProcessCreationParameters::decode):
3228         * Shared/WebProcessCreationParameters.h:
3229         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
3230         (WebKit::WebProcessPool::platformInitializeWebProcess):
3231         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
3232         (WebKit::WebProcessPool::platformDefaultCookieStorageDirectory): Deleted.
3233         * UIProcess/WebProcessPool.cpp:
3234         (WebKit::WebProcessPool::ensureNetworkProcess):
3235         (WebKit::WebProcessPool::createNewWebProcess):
3236         (WebKit::WebProcessPool::cookieStorageDirectory):
3237         * UIProcess/WebProcessPool.h:
3238         * UIProcess/efl/WebProcessPoolEfl.cpp:
3239         (WebKit::WebProcessPool::platformDefaultCookieStorageDirectory): Deleted.
3240         * UIProcess/gtk/WebProcessPoolGtk.cpp:
3241         (WebKit::WebProcessPool::platformDefaultCookieStorageDirectory): Deleted.
3242         * WebProcess/cocoa/WebProcessCocoa.mm:
3243         (WebKit::WebProcess::platformInitializeWebProcess):
3244
3245 2015-05-12  Chris Dumez  <cdumez@apple.com>
3246
3247         [WK2] Log using diagnostic logging how far back in history we navigate
3248         https://bugs.webkit.org/show_bug.cgi?id=144919
3249         <rdar://problem/20920043>
3250
3251         Reviewed by Gavin Barraclough.
3252
3253         Log using diagnostic logging how far back in history we navigate.
3254         When a back navigation or a backward indexed navigation occurs, we
3255         log the delta: (HistoryListSize - 1) - NewHistoryItemIndex.
3256
3257         * UIProcess/WebBackForwardList.cpp:
3258         (WebKit::WebBackForwardList::goToItem):
3259
3260 2015-05-11  Sam Weinig  <sam@webkit.org>
3261
3262         ChildProcess should take an os_activity
3263         https://bugs.webkit.org/show_bug.cgi?id=141781
3264
3265         Reviewed by Ryosuke Niwa.
3266
3267         * DatabaseProcess/EntryPoint/mac/XPCService/DatabaseServiceEntryPoint.mm:
3268         (DatabaseServiceInitializer):
3269         * NetworkProcess/EntryPoint/mac/XPCService/NetworkServiceEntryPoint.mm:
3270         (NetworkServiceInitializer):
3271         * PluginProcess/EntryPoint/mac/XPCService/PluginServiceEntryPoint.mm:
3272         (PluginServiceInitializer):
3273         * WebProcess/EntryPoint/mac/XPCService/WebContentServiceEntryPoint.mm:
3274         (WebContentServiceInitializer):
3275         Start an os_activity in the initializer for each XPC service.
3276
3277         * config.h:
3278         Add HAVE_OS_ACTIVITY where available.
3279
3280 2015-05-12  Carlos Garcia Campos  <cgarcia@igalia.com>
3281
3282         Unreviewed. Fix GTK+ debug build after r184197.
3283
3284         * UIProcess/gtk/RedirectedXCompositeWindow.cpp: Add missing include.
3285
3286 2015-05-08  Carlos Garcia Campos  <cgarcia@igalia.com>
3287
3288         [X11] Add XUniquePtr and XUniqueResource to automatically free X resources
3289         https://bugs.webkit.org/show_bug.cgi?id=144521
3290
3291         Reviewed by Darin Adler.
3292
3293         Use XUniquePtr and XUniqueResource to free X resources.
3294
3295         * PlatformEfl.cmake: Add Source/WebCore/platform/graphics/x11 dir
3296         to the include dir list.
3297         * PlatformGTK.cmake: Ditto.
3298         * UIProcess/cairo/BackingStoreCairo.cpp:
3299         (WebKit::BackingStore::createBackend): Do not pass the display to
3300         the BackingStoreBackendCairoX11 constructor.
3301         * UIProcess/gtk/RedirectedXCompositeWindow.cpp:
3302         (WebKit::RedirectedXCompositeWindow::RedirectedXCompositeWindow):
3303         (WebKit::RedirectedXCompositeWindow::~RedirectedXCompositeWindow):
3304         (WebKit::RedirectedXCompositeWindow::resize):
3305         (WebKit::RedirectedXCompositeWindow::cleanupPixmapAndPixmapSurface):
3306         (WebKit::RedirectedXCompositeWindow::surface):
3307         * UIProcess/gtk/RedirectedXCompositeWindow.h:
3308         (WebKit::RedirectedXCompositeWindow::windowID):
3309         * WebProcess/Plugins/Netscape/NetscapePlugin.h:
3310         * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:
3311         (WebKit::NetscapePlugin::platformPostInitializeWindowless):
3312         (WebKit::NetscapePlugin::platformDestroy):
3313         (WebKit::NetscapePlugin::platformGeometryDidChange):
3314         (WebKit::NetscapePlugin::platformPaint):
3315
3316 2015-05-11  Dan Bernstein  <mitz@apple.com>
3317
3318         WebKit2 part of <rdar://problem/20878075> Trying to navigate to an invalid URL loads about:blank, but -[WKWebView URL] returns the invalid URL
3319
3320         Reviewed by Alexey Proskuryakov.
3321
3322         * UIProcess/WebPageProxy.cpp:
3323         (WebKit::WebPageProxy::didChangeProvisionalURLForFrame): Added. Update internal state the
3324         same way we update it for server redirects, but don’t make client callbacks. Clients
3325         observing the URL property will see it change.
3326         * UIProcess/WebPageProxy.h:
3327
3328         * UIProcess/WebPageProxy.messages.in: Added DidChangeProvisionalURLForFrame.
3329
3330         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3331         (WebKit::WebFrameLoaderClient::dispatchDidChangeProvisionalURL): Override this new
3332         FrameLoaderClient function to send a DidChangeProvisionalURLForFrame message to the UI
3333         process.
3334         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
3335
3336 2015-05-11  Dan Bernstein  <mitz@apple.com>
3337
3338         <rdar://problem/19773721> [iOS] Find on page feels like it zooms in too much
3339         https://bugs.webkit.org/show_bug.cgi?id=144891
3340
3341         Reviewed by Darin Adler.
3342
3343         Sometimes, Find on Page’s constant 1.6 scale factor is too much. Smart magnification is
3344         designed to choose a scale factor that is just right.
3345
3346         * UIProcess/ios/SmartMagnificationController.h:
3347         * UIProcess/ios/SmartMagnificationController.messages.in: Added Magnify message.
3348         * UIProcess/ios/SmartMagnificationController.mm:
3349         (WebKit::SmartMagnificationController::magnify): Added. Handle the new message using
3350         -[WKContentView _soomToRect:withOrigin:fitEntireRect:minimumScale:maximumScale:minimumScrollDistance:].
3351         * WebProcess/WebPage/ios/FindControllerIOS.mm:
3352         (WebKit::FindController::updateFindIndicator): Instead of zooming to the selection rect,
3353         get the surrounding render rect (the area we would target for a double-tap at the beginning
3354         of the selection), and tell the magnification controller to target it. Use the center of the
3355         start of the selection as the origin.
3356
3357 2015-05-11  Brent Fulgham  <bfulgham@apple.com>
3358
3359         Scroll snap logic should be triggered when resizing the WebView
3360         https://bugs.webkit.org/show_bug.cgi?id=142590
3361         <rdar://problem/20125088>
3362
3363         Reviewed by Simon Fraser.
3364
3365         * UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm:
3366         (RemoteScrollingCoordinatorProxy::closestSnapOffsetForMainFrameScrolling): Modify use of 'closestSnapOffset' to satisfy the additional
3367         argument I added. This is currently not used for anything on iOS.
3368         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm: Ditto.
3369
3370 2015-05-11  Andreas Kling  <akling@apple.com>
3371
3372         Force a rebuild of JSNPObject.cpp on bots.
3373
3374         * WebProcess/Plugins/Netscape/JSNPObject.cpp:
3375         (WebKit::JSNPObject::callMethod):
3376
3377 2015-05-11  Anders Carlsson  <andersca@apple.com>
3378
3379         Simplify shim path computation
3380         https://bugs.webkit.org/show_bug.cgi?id=144884
3381         Part of rdar://problem/19708579.
3382
3383         Reviewed by Sam Weinig.
3384
3385         Factor the code that computes the shim path out into a separate function. Also make this mac only
3386         since we don't have any shims on iOS.
3387
3388         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
3389         (WebKit::computeProcessShimPath):
3390         (WebKit::addDYLDEnvironmentAdditions):
3391
3392 2015-05-11  Myles C. Maxfield  <mmaxfield@apple.com>
3393
3394         Unreviewed build fix
3395
3396         Unreviewed.
3397
3398         * UIProcess/API/APIUserContentExtensionStore.cpp:
3399         (API::compiledToFile):
3400
3401 2015-05-11  Alex Christensen  <achristensen@webkit.org>
3402
3403         [Content Extensions] Support domain-specific rules and exceptions.
3404         https://bugs.webkit.org/show_bug.cgi?id=144833
3405
3406         Reviewed by Darin Adler.
3407
3408         * Shared/WebCompiledContentExtension.cpp:
3409         (WebKit::WebCompiledContentExtension::filtersWithoutDomainsBytecode):
3410         (WebKit::WebCompiledContentExtension::filtersWithoutDomainsBytecodeLength):
3411         (WebKit::WebCompiledContentExtension::filtersWithDomainsBytecode):
3412         (WebKit::WebCompiledContentExtension::filtersWithDomainsBytecodeLength):
3413         (WebKit::WebCompiledContentExtension::domainFiltersBytecode):
3414         (WebKit::WebCompiledContentExtension::domainFiltersBytecodeLength):
3415         (WebKit::WebCompiledContentExtension::bytecode): Deleted.
3416         (WebKit::WebCompiledContentExtension::bytecodeLength): Deleted.
3417         * Shared/WebCompiledContentExtension.h:
3418         * Shared/WebCompiledContentExtensionData.cpp:
3419         (WebKit::WebCompiledContentExtensionData::encode):
3420         (WebKit::WebCompiledContentExtensionData::decode):
3421         * Shared/WebCompiledContentExtensionData.h:
3422         (WebKit::WebCompiledContentExtensionData::WebCompiledContentExtensionData):
3423         * UIProcess/API/APIUserContentExtensionStore.cpp:
3424         (API::ContentExtensionMetaData::fileSize):
3425         (API::encodeContentExtensionMetaData):
3426         (API::decodeContentExtensionMetaData):
3427         (API::compiledToFile):
3428         (API::createExtension):
3429         Keep track of 3 different types of bytecode to be able to handle domain-specific rules.
3430
3431 2015-05-11  Tim Horton  <timothy_horton@apple.com>
3432
3433         Page overlay action context override should indicate the source of the request
3434         https://bugs.webkit.org/show_bug.cgi?id=144832
3435         <rdar://problem/20562594>
3436
3437         Reviewed by Darin Adler.
3438
3439         * WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:
3440         * WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.h:
3441         * WebProcess/WebPage/WebPageOverlay.cpp:
3442         (WebKit::WebPageOverlay::actionContextForResultAtPoint):
3443         * WebProcess/WebPage/WebPageOverlay.h:
3444         (WebKit::WebPageOverlay::Client::actionContextForResultAtPoint):
3445         * WebProcess/WebPage/mac/WebPageMac.mm:
3446         (WebKit::WebPage::performActionMenuHitTestAtLocation):
3447         Add a parameter to WKBundlePageOverlayActionContextForResultAtPoint so that
3448         clients can tell whether the requested action context should be targetted
3449         at an action menu or immediate action.
3450
3451 2015-05-11  Daniel Bates  <dabates@apple.com>
3452
3453         [iOS] Close all open databases in expiration handler of process assertion
3454         https://bugs.webkit.org/show_bug.cgi?id=144661
3455         <rdar://problem/20845052>
3456
3457         Reviewed by Darin Adler.
3458
3459         For WebKit2, close all open databases when the process assertion expiration
3460         handler is called.
3461
3462         When the process assertion expiration handler is called we dispatch a synchronous
3463         message called ProcessWillSuspendImminently to the {Web, Network} processes to inform
3464         them that they will be suspended imminently. The {Web, Network} process will always
3465         service this message regardless if they were waiting for another message. In the
3466         WebProcess, we will close all open databases among other tasks upon receiving this
3467         message. In the NetworkProcess, we will purge some data from memory.
3468
3469         * NetworkProcess/NetworkProcess.cpp:
3470         (WebKit::NetworkProcess::didReceiveSyncMessage): Modified to call NetworkProcess::didReceiveSyncNetworkProcessMessage()
3471         to process the synchronous ProcessWillSuspendImminently message.
3472         (WebKit::NetworkProcess::processWillSuspendImminently): Added; free some memory.
3473         * NetworkProcess/NetworkProcess.h:
3474         * NetworkProcess/NetworkProcess.messages.in: Added synchronous message ProcessWillSuspendImminently.
3475         * Shared/ChildProcessProxy.h:
3476         (WebKit::ChildProcessProxy::sendSync): Added parameter sendSyncFlags so that we can send
3477         a sync message with flag IPC::InterruptWaitingIfSyncMessageArrives to cause the {Web, Network}Process
3478         to process the message regardless of whether it is waiting for another message.
3479         * UIProcess/Network/NetworkProcessProxy.cpp:
3480         (WebKit::NetworkProcessProxy::sendProcessWillSuspendImminently): Added. Sends the message
3481         ProcessWillSuspendImminently to the NetworkProcess.
3482         * UIProcess/Network/NetworkProcessProxy.h:
3483         * UIProcess/ProcessAssertion.cpp:
3484         (WebKit::ProcessAndUIAssertion::setClient): Added.
3485         * UIProcess/ProcessAssertion.h: Added abstract class ProcessAssertionClient.
3486         (WebKit::ProcessAssertionClient::~ProcessAssertionClient): Added.
3487         (WebKit::ProcessAssertion::setClient): Added.
3488         (WebKit::ProcessAssertion::client): Added.
3489         * UIProcess/ProcessThrottler.cpp:
3490         (WebKit::ProcessThrottler::didConnectToProcess):
3491         (WebKit::ProcessThrottler::assertionWillExpireImminently): Added; implements the ProcessAssertionClient
3492         interface. Notify the process throttler clients that the assertion is near expiration.
3493         * UIProcess/ProcessThrottler.h:
3494         * UIProcess/ProcessThrottlerClient.h: Added 
3495         * UIProcess/WebProcessProxy.cpp:
3496         (WebKit::WebProcessProxy::sendProcessWillSuspendImminently): Added. Sends the message
3497         ProcessWillSuspendImminently to the WebProcess.
3498         * UIProcess/WebProcessProxy.h:
3499         * UIProcess/ios/ProcessAssertionIOS.mm:
3500         (-[WKProcessAssertionBackgroundTaskManager addClient:]): Added.
3501         (-[WKProcessAssertionBackgroundTaskManager removeClient:]): Added.
3502         (-[WKProcessAssertionBackgroundTaskManager _updateBackgroundTask]): Modified expiration handler
3503         to notify ProcessAssertionClient clients that the assertion is near expiration.
3504         (WebKit::ProcessAssertion::~ProcessAssertion): Remove the client on destruction.
3505         (WebKit::ProcessAndUIAssertion::setClient): Added.
3506         * WebProcess/WebCoreSupport/WebDatabaseManager.cpp:
3507         (WebKit::WebDatabaseManager::closeAllDatabases): Added; turns around and calls DatabaseManager::closeAllDatabases().
3508         * WebProcess/WebCoreSupport/WebDatabaseManager.h:
3509         * WebProcess/WebProcess.cpp:
3510         (WebKit::WebProcess::didReceiveSyncMessage): Call WebProcess::didReceiveSyncWebProcessMessage() to process
3511         the synchronous ProcessWillSuspendImminently message. Removed logging for an unhandled synchronous message
3512         since WebProcess::didReceiveSyncWebProcessMessage() will ASSERT_NOT_REACHED() for such a message.
3513         (WebKit::WebProcess::prepareToSuspend): Extracted code from WebProcess::processWillSuspend() so that it can
3514         be used from both WebProcess::processWillSuspend() and WebProcess::processWillSuspendImminently(). And modified
3515         it to conditionally dispatch a ProcessReadyToSuspend message to the WebProcessProxy. We only want to dispatch
3516         such a message as part of a coordinated suspension by the ProcessThrottler. That is, we do not want to dispatch
3517         the ProcessReadyToSuspend message when the background assertion is near expiration (i.e. WebProcess::processWillSuspendImminently()
3518         is called).
3519         (WebKit::WebProcess::processWillSuspendImminently): Added. Suspend all open databases among other tasks.
3520         (WebKit::WebProcess::processWillSuspend): Implemented in terms of WebProcess::prepareToSuspend().
3521         (WebKit::WebProcess::processSuspensionCleanupTimerFired): Modified to conditionally dispatch a ProcessReadyToSuspend
3522         message to the WebProcessProxy.
3523         (WebKit::WebProcess::processDidResume): Stop the suspension cleanup timer, which may be active if the WebProcess
3524         did not mark all its graphics layers as volatile before process suspension.
3525         * WebProcess/WebProcess.h:
3526         * WebProcess/WebProcess.messages.in: Added synchronous message ProcessWillSuspendImminently.
3527
3528 2015-05-10  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
3529
3530         Use Ref instead of PassRefPtr in WebCore/page
3531         https://bugs.webkit.org/show_bug.cgi?id=144841
3532
3533         Reviewed by Darin Adler.
3534
3535         To kill PassRefPtr, this patch replaces PassRefPtr with Ref or RefPtr
3536         in WebCore/page.
3537
3538         (WebKit::WebUserContentController::WebUserContentController):
3539         * UIProcess/WebPageProxy.cpp:
3540         (WebKit::WebPageProxy::setTextIndicator):
3541         * UIProcess/mac/PageClientImpl.mm:
3542         (WebKit::PageClientImpl::didPerformDictionaryLookup):
3543         * WebProcess/UserContent/WebUserContentController.cpp:
3544         (WebKit::WebUserContentController::WebUserContentController):
3545
3546 2015-05-10  Philip Chimento  <philip.chimento@gmail.com>
3547
3548         [GTK][SOUP] Web and Network processes don't know how to get memory size on OSX
3549         https://bugs.webkit.org/show_bug.cgi?id=144554
3550
3551         Reviewed by Darin Adler.
3552
3553         * NetworkProcess/soup/NetworkProcessSoup.cpp:
3554         (WebKit::NetworkProcess::platformSetCacheModel): Use WTF::ramSize()
3555         instead of local function. Also use WTF::MB instead of dividing by
3556         1024 * 1024.
3557         (WebKit::getMemorySize): Deleted.
3558         * WebProcess/soup/WebProcessSoup.cpp:
3559         (WebKit::WebProcess::platformSetCacheModel): Ditto.
3560         (WebKit::getMemorySize): Deleted.
3561
3562 2015-05-10  Yongjun Zhang  <yongjun_zhang@apple.com>
3563
3564         Use preview view controller from WebKitSystemInterface.
3565         https://bugs.webkit.org/show_bug.cgi?id=144836
3566
3567         Add a property _allowsLinkPreview to WKWebView so that we can turn on/off preview at runtime. Also,
3568         for client that doesn't provide preview view controller, use the default view controller prepared
3569         by WebKitSystemInterface.
3570
3571         Reviewed by Dan Bernstein.
3572
3573         * UIProcess/API/Cocoa/WKWebView.mm:
3574         (-[WKWebView initWithFrame:configuration:]):
3575         (-[WKWebView _allowsLinkPreview]):
3576         (-[WKWebView _setAllowsLinkPreview:]):
3577         * UIProcess/API/Cocoa/WKWebViewPrivate.h: Add _allowsLinkPreview property
3578         * UIProcess/ios/WKContentView.mm:
3579         (-[WKContentView willMoveToWindow:]):
3580         * UIProcess/ios/WKContentViewInteraction.h:
3581         * UIProcess/ios/WKContentViewInteraction.mm:
3582         (-[WKContentView _registerPreviewInWindow:]):
3583         (-[WKContentView _unregisterPreviewInWindow:]):
3584         (-[WKContentView previewViewControllerForPosition:inSourceView:]): : For client that doesn't provide
3585             preview delegate, use preview view controller in WebKitSystemInterface.
3586         (-[WKContentView commitPreviewViewController:]):
3587
3588 2015-05-10  Darin Adler  <darin@apple.com>
3589
3590         Fix internal Apple builds on Mavericks.
3591
3592         * UIProcess/API/mac/WKView.mm:
3593         (-[WKView _dismissContentRelativeChildWindows]): Added missing conditionals around
3594         some code that is for OS X 10.10 or newer only. There were similar conditionals around
3595         other nearby code in this file, and around other uses of the same method in other files,
3596         so matched the style.
3597
3598 2015-05-10  Dan Bernstein  <mitz@apple.com>
3599
3600         iOS internal build fix.
3601
3602         * Platform/mac/MenuUtilities.mm:
3603
3604 2015-05-10  Sungmann Cho  <sungmann.cho@navercorp.com>
3605
3606         Remove unnecessary semicolons.
3607         https://bugs.webkit.org/show_bug.cgi?id=144844
3608
3609         Reviewed by Darin Adler.
3610
3611         No new tests, no behavior change.
3612
3613         * Shared/Downloads/mac/DownloadMac.mm:
3614         (-[WKDownloadAsDelegate download:shouldDecodeSourceDataOfMIMEType:]):
3615         * UIProcess/WebProcessProxy.cpp:
3616         (WebKit::WebProcessProxy::transformHandlesToObjects):
3617         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
3618         (WebKit::RemoteLayerTreeDrawingAreaProxy::indicatorLocation):
3619         * WebProcess/WebPage/WebBackForwardListProxy.cpp:
3620         (WebKit::idToHistoryItemMap):
3621
3622 2015-05-10  Darin Adler  <darin@apple.com>
3623
3624         Fix build.
3625
3626         * Platform/mac/MenuUtilities.mm: Added includes that were somehow omitted in what
3627         I committed before.
3628
3629 2015-05-10  Darin Adler  <darin@apple.com>
3630
3631         [Cocoa] Don't soft link DataDetectorsCore
3632         https://bugs.webkit.org/show_bug.cgi?id=144837
3633
3634         Reviewed by Dan Bernstein.
3635
3636         * Platform/mac/MenuUtilities.mm: Use DataDetectorsSPI.h instead of doing it here.
3637
3638         * WebProcess/WebPage/mac/WebPageMac.mm: Removed unneeded include of unused header,
3639         DataDetectorsSPI.h.
3640
3641 2015-05-09  Dan Bernstein  <mitz@apple.com>
3642
3643         Deployment-target __NSi_ and __NSd_ definitions in WKFoundation.h are redundant
3644         https://bugs.webkit.org/show_bug.cgi?id=144831
3645
3646         Reviewed by Sam Weinig.
3647
3648         Reverted r182846 and r182904.
3649
3650         * Shared/API/Cocoa/WKFoundation.h:
3651         * WebKit2.xcodeproj/project.pbxproj:
3652
3653 2015-05-09  Yoav Weiss  <yoav@yoav.ws>
3654
3655         Remove the PICTURE_SIZES build flag
3656         https://bugs.webkit.org/show_bug.cgi?id=144679
3657
3658         Reviewed by Benjamin Poulain.
3659
3660         Removed the PICTURE_SIZES build time flag.
3661
3662         * Configurations/FeatureDefines.xcconfig:
3663
3664 2015-05-08  Beth Dakin  <bdakin@apple.com>
3665
3666         Shuffle touch-related code to keep the internal builds working
3667         https://bugs.webkit.org/show_bug.cgi?id=144812
3668
3669         Reviewed by Benjamin Poulain.
3670
3671         * Shared/NativeWebTouchEvent.h:
3672         * Shared/WebEvent.h:
3673         * Shared/WebEventConversion.cpp:
3674         * Shared/ios/NativeWebTouchEventIOS.mm:
3675         (WebKit::NativeWebTouchEvent::extractWebTouchPoint):
3676         (WebKit::extractWebTouchPoint): Deleted.
3677         * Shared/ios/WebPlatformTouchPointIOS.cpp:
3678
3679 2015-05-08  Dan Bernstein  <mitz@apple.com>
3680
3681         <rdar://problem/20757196> NSInternalInconsistencyException raised in -[NSString encodeWithCoder:] beneath createEncodedObject when using WKRemoteObjectEncoder for Safari AutoFill
3682         https://bugs.webkit.org/show_bug.cgi?id=144818
3683
3684         Reviewed by Anders Carlsson.
3685
3686         Allow NSString instances that contain unpaired surrogates to be encoded by
3687         WKRemoteObjectCoder by encoding them directly rather than using
3688         -[NSString encodeWithCoder:].
3689
3690         * Shared/API/Cocoa/WKRemoteObjectCoder.mm:
3691         (encodeString): Added. Sets an API::String as the object to encode.
3692         (encodeObject): Changed to use encodeString for NSString instances.
3693         (decodeString): Added. Gets an API::String from the dictionary and returns it as an
3694         NSString.
3695         (decodeObject): Changed to use decodeString for NSString instances.
3696
3697 2015-05-08  Timothy Horton  <timothy_horton@apple.com>
3698
3699         Fix the build.
3700
3701         * Platform/mac/LayerHostingContext.mm:
3702         (WebKit::LayerHostingContext::createFencePort):
3703
3704 2015-05-08  Timothy Horton  <timothy_horton@apple.com>
3705
3706         Periodically repaint during resize while using the DynamicSizeWithMinimumViewSize layout strategy
3707         https://bugs.webkit.org/show_bug.cgi?id=144816
3708
3709         Reviewed by Simon Fraser.
3710
3711         * UIProcess/mac/WKViewLayoutStrategy.mm:
3712         (-[WKViewDynamicSizeWithMinimumViewSizeLayoutStrategy initWithPage:view:mode:]):
3713         (-[WKViewDynamicSizeWithMinimumViewSizeLayoutStrategy _updateTransientScale:]):
3714         (-[WKViewDynamicSizeWithMinimumViewSizeLayoutStrategy updateLayout]):
3715         Factor out _updateTransientScale from updateLayout.
3716         Keep track of the last viewScaleFactor that we know is being displayed
3717         (_lastCommittedViewScale) and use that for computing the transient scale,
3718         so that we can recompute the transient scale while the UI process's notion
3719         of the actual view scale might have moved ahead of what the Web process has
3720         painted.
3721
3722 2015-05-08  Timothy Horton  <timothy_horton@apple.com>
3723
3724         Fix the build.
3725
3726         * UIProcess/WebPageProxy.cpp:
3727
3728 2015-05-08  Timothy Horton  <timothy_horton@apple.com>
3729
3730         Fix the build.
3731
3732         * Platform/mac/LayerHostingContext.mm:
3733         (WebKit::LayerHostingContext::createFencePort):
3734
3735 2015-05-08  Timothy Horton  <timothy_horton@apple.com>
3736
3737         Fix the build.
3738
3739         * Platform/mac/LayerHostingContext.mm:
3740         (WebKit::LayerHostingContext::createFencePort):
3741
3742 2015-05-08  Timothy Horton  <timothy_horton@apple.com>
3743
3744         Flip the direction of the fence in scaleViewAndUpdateGeometryFenced
3745         https://bugs.webkit.org/show_bug.cgi?id=144810
3746
3747         Reviewed by Simon Fraser.
3748
3749         Send the fence from the Web process to the UI process, instead of vice versa.
3750         This means that we won't keep the UI process CAContext blocked for the whole
3751         time that the Web process is doing layout/painting/etc. Instead, we'll start
3752         blocking the Web process CAContext immediately after flushing and before committing,
3753         and send the fence to the UI process to be applied immediately. This minimizes
3754         the amount of time in both processes spent blocked on the fence.
3755
3756         * Platform/mac/LayerHostingContext.h:
3757         * Platform/mac/LayerHostingContext.mm:
3758         (WebKit::LayerHostingContext::createFencePort):
3759         Add createFencePort, which creates a MachSendRight wrapping a CA fence port.
3760         Note that you must setFencePort() with this port if you want the LayerHostingContext's
3761         CAContext to block on it!
3762
3763         * UIProcess/WebPageProxy.cpp:
3764         (WebKit::WebPageProxy::scaleViewAndUpdateGeometryFenced):
3765         (WebKit::WebPageProxy::machSendRightCallback):
3766         * UIProcess/WebPageProxy.h:
3767         * UIProcess/WebPageProxy.messages.in:
3768         Create a callback and send it to the Web process along with scaleViewAndUpdateGeometryFenced.
3769
3770         * UIProcess/mac/WKViewLayoutStrategy.mm:
3771         (-[WKViewDynamicSizeWithMinimumViewSizeLayoutStrategy updateLayout]):
3772         When called back, install the fence port in our CAContext; when the commit goes through,
3773         remove the transient scale as we did previously.
3774
3775         * WebProcess/WebPage/DrawingArea.h:
3776         (WebKit::DrawingArea::replyWithFenceAfterNextFlush):
3777         (WebKit::DrawingArea::updateGeometry): Deleted.
3778         * WebProcess/WebPage/WebPage.cpp:
3779         (WebKit::WebPage::scaleViewAndUpdateGeometryFenced):
3780         * WebProcess/WebPage/WebPage.h:
3781         * WebProcess/WebPage/WebPage.messages.in:
3782         Instead of installing a fence created in the UI process, tell the DrawingArea
3783         to create one and reply to the UI process with it after the next flush.
3784
3785         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
3786         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
3787         (WebKit::TiledCoreAnimationDrawingArea::flushLayers):
3788         (WebKit::TiledCoreAnimationDrawingArea::replyWithFenceAfterNextFlush):
3789         After flushing, before committing, create a fence and reply to any
3790         callbacks that requested fences, and install it in our context.
3791
3792 2015-05-08  Michael Catanzaro  <mcatanzaro@igalia.com>, Martin Robinson <mrobinson@igalia.com>
3793
3794         [GTK] Checks for DEVELOPMENT_BUILD are all wrong
3795         https://bugs.webkit.org/show_bug.cgi?id=144746
3796
3797         Reviewed by Carlos Garcia Campos.
3798
3799         Use ENABLE(DEVELOPER_MODE) rather than DEVELOPMENT_BUILD.
3800
3801         * Shared/gtk/ProcessExecutablePathGtk.cpp:
3802         (WebKit::findWebKitProcess):
3803         * UIProcess/API/gtk/WebKitWebContext.cpp:
3804         (injectedBundleDirectory):
3805         * UIProcess/gtk/TextCheckerGtk.cpp:
3806         (WebKit::enchantTextChecker):
3807
3808 2015-05-08  Anders Carlsson  <andersca@apple.com>
3809
3810         Fix ProcessLauncher port leak
3811         https://bugs.webkit.org/show_bug.cgi?id=144807
3812         rdar://problem/20593291
3813
3814         Reviewed by Sam Weinig.
3815
3816         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
3817         (WebKit::connectToService):
3818         xpc_dictionary_set_mach_send increments the send right count so make sure to
3819         balance it with a call to mach_port_deallocate.
3820
3821 2015-05-08  Beth Dakin  <bdakin@apple.com>
3822
3823         Fix performance tests after r183954
3824         https://bugs.webkit.org/show_bug.cgi?id=144805
3825
3826         Reviewed by Alexey Proskuryakov.
3827
3828         Web* is traditionally a WK1 prefix, so use the WK2 prefix instead in WK2 so that 
3829         we don’t have two classes with the same name in the two projects.
3830         * UIProcess/mac/WKImmediateActionController.mm:
3831         (-[WKImmediateActionController _defaultAnimationController]):
3832
3833 2015-05-08  Carlos Garcia Campos  <cgarcia@igalia.com>
3834
3835         [GTK] Expose allowFileAccessFromFileURLs setting to WebKit2 GTK+ API
3836         https://bugs.webkit.org/show_bug.cgi?id=144748
3837
3838         Reviewed by Sergio Villar Senin.
3839
3840         This is needed by local applications loaded as a file URI that do XMLHttpRequests.
3841
3842         * UIProcess/API/gtk/WebKitSettings.cpp:
3843         (webKitSettingsSetProperty):
3844         (webKitSettingsGetProperty):
3845         (webkit_settings_class_init):
3846         (webkit_settings_get_allow_file_access_from_file_urls):
3847         (webkit_settings_set_allow_file_access_from_file_urls):
3848         * UIProcess/API/gtk/WebKitSettings.h:
3849         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
3850         * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml:
3851
3852 2015-05-08  Andreas Kling  <akling@apple.com>
3853
3854         Optimize serialization of quoted JSON strings.
3855         <https://webkit.org/b/144754>
3856
3857         Reviewed by Darin Adler.
3858
3859         * NetworkProcess/cache/NetworkCacheEntry.cpp:
3860         (WebKit::NetworkCache::Entry::asJSON): Use the new StringBuilder API.
3861
3862 2015-05-08  Commit Queue  <commit-queue@webkit.org>
3863
3864         Unreviewed, rolling out r183945.
3865         https://bugs.webkit.org/show_bug.cgi?id=144789
3866
3867         "It broke all the GTK+ tests" (Requested by KaL on #webkit).
3868
3869         Reverted changeset:
3870
3871         "[GTK] Checks for DEVELOPMENT_BUILD are all wrong"
3872         https://bugs.webkit.org/show_bug.cgi?id=144746
3873         http://trac.webkit.org/changeset/183945
3874
3875 2015-05-07  Conrad Shultz  <conrad_shultz@apple.com>
3876
3877         Don't register for Lookup notifications until needed
3878         https://bugs.webkit.org/show_bug.cgi?id=144783
3879
3880         Reviewed by Tim Horton.
3881
3882         * UIProcess/API/mac/WKView.mm:
3883         Add a WKViewData ivar to track whether we've already registered for popover notifications.
3884         (-[WKView _prepareForDictionaryLookup]):
3885         Added; moved notification registration from -[WKView initWithFrame:processPool:configuration:webView:.
3886         (-[WKView initWithFrame:processPool:configuration:webView:]):
3887         Move notification registration to -_prepareForDictionaryLookup.
3888
3889         * UIProcess/API/mac/WKViewInternal.h:
3890         Expose -_prepareForDictionaryLookup.
3891
3892         * UIProcess/mac/PageClientImpl.mm:
3893         (WebKit::PageClientImpl::didPerformDictionaryLookup):
3894         Send -[WKView _prepareForDictionaryLookup].
3895
3896         * UIProcess/mac/WKImmediateActionController.mm:
3897         (-[WKImmediateActionController _animationControllerForText]):
3898         Ditto.
3899
3900 2015-05-07  Commit Queue  <commit-queue@webkit.org>
3901
3902         Unreviewed, rolling out r183961.
3903         https://bugs.webkit.org/show_bug.cgi?id=144784
3904
3905         Broke js/dom/JSON-stringify.html (Requested by kling on
3906         #webkit).
3907
3908         Reverted changeset:
3909
3910         "Optimize serialization of quoted JSON strings."
3911         https://bugs.webkit.org/show_bug.cgi?id=144754
3912         http://trac.webkit.org/changeset/183961
3913
3914 2015-05-07  Anders Carlsson  <andersca@apple.com>
3915
3916         Build fixes.
3917
3918         * UIProcess/API/mac/WKView.mm:
3919         (-[WKView initWithFrame:processPool:configuration:webView:]):
3920         Use the regular init method.
3921
3922         * UIProcess/mac/WKSharingServicePickerDelegate.mm:
3923         (-[WKSharingServicePickerDelegate sharingService:didShareItems:]):
3924         * WebProcess/WebPage/mac/WebPageMac.mm:
3925         (WebKit::WebPage::handleSelectionServiceClick):
3926         Pass empty dictionaries instead of nil.
3927
3928 2015-05-07  Chris Dumez  <cdumez@apple.com>
3929
3930         ASSERTION when pasting text into the WebInspector console
3931         https://bugs.webkit.org/show_bug.cgi?id=144774
3932
3933         Reviewed by Ryosuke Niwa.
3934
3935         Fix assertion in didChangeSelection() meant to check that calling
3936         editorState() does not cause a synchronous layout. The assertion
3937         was not correct as it was relying on FrameView::needsLayout() and
3938         we would hit it if calling editorState() would schedule a layout.
3939         Instead, the new assertion relies on FrameView::layoutCount(),
3940         which is more accurate.
3941
3942         * WebProcess/WebPage/WebPage.cpp:
3943         (WebKit::WebPage::didChangeSelection):
3944
3945 2015-05-07  Andreas Kling  <akling@apple.com>
3946
3947         Optimize serialization of quoted JSON strings.
3948         <https://webkit.org/b/144754>
3949
3950         Reviewed by Darin Adler.
3951
3952         * NetworkProcess/cache/NetworkCacheEntry.cpp:
3953         (WebKit::NetworkCache::Entry::asJSON): Use the new StringBuilder API.
3954
3955 2015-05-07  Martin Robinson  <mrobinson@igalia.com>
3956
3957         Followup fixes to r183936
3958
3959         I neglected to include a few review comments when I landed the patch.
3960
3961         * UIProcess/gtk/TextCheckerGtk.cpp:
3962         (WebKit::checkerState): Remove double semicolons.
3963         (WebKit::updateStateForAllProcessPools): Use range-based-for loop here and
3964         give the function a better name.
3965         (WebKit::TextChecker::setContinuousSpellCheckingEnabled): Use new function name
3966         (WebKit::TextChecker::setGrammarCheckingEnabled):Use new function name
3967         (WebKit::TextChecker::ignoreWord): Fix unused parameter warning.
3968         (WebKit::updateStateForAllContexts): Deleted.
3969
3970 2015-05-07  Michael Catanzaro  <mcatanzaro@igalia.com>
3971
3972         [GTK] Checks for DEVELOPMENT_BUILD are all wrong
3973         https://bugs.webkit.org/show_bug.cgi?id=144746
3974
3975         Reviewed by Martin Robinson.
3976
3977         Use DEVELOPER_MODE rather than DEVELOPMENT_BUILD.
3978
3979         * Shared/gtk/ProcessExecutablePathGtk.cpp:
3980         (WebKit::findWebKitProcess):
3981         * UIProcess/API/gtk/WebKitWebContext.cpp:
3982         (injectedBundleDirectory):
3983         * UIProcess/gtk/TextCheckerGtk.cpp:
3984         (WebKit::enchantTextChecker):
3985
3986 2015-05-06  Dean Jackson  <dino@apple.com>
3987
3988         Handle backdrop views that have to tile
3989         https://bugs.webkit.org/show_bug.cgi?id=142317
3990         <rdar://problem/20049088>
3991
3992         Reviewed by Simon Fraser.
3993
3994         Take 2 - this was rolled out because Mavericks was crashing.
3995
3996         Add some better logging for custom appearance.
3997
3998         * Shared/mac/RemoteLayerTreeTransaction.mm:
3999         (WebKit::RemoteLayerTreeTextStream::operator<<):
4000
4001 2015-05-07  Sungmann Cho  <sungmann.cho@navercorp.com>
4002
4003         Add PLUGIN_ARCHITECTURE(X11) around m_frameRectInWindowCoordinates in NetscapePlugin.
4004         https://bugs.webkit.org/show_bug.cgi?id=144490
4005
4006         Reviewed by Darin Adler.
4007
4008         m_frameRectInWindowCoordinates in NetscapePlugin is currently being used only for
4009         the windowed plugins, and the windowed plugins are only supported on X11. So we can
4010         guard it with PLUGIN_ARCHITECTURE(X11).
4011
4012         No new tests, no behavior change.
4013
4014         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
4015         (WebKit::NetscapePlugin::geometryDidChange):
4016         * WebProcess/Plugins/Netscape/NetscapePlugin.h:
4017
4018 2015-05-05  Myles C. Maxfield  <mmaxfield@apple.com>
4019
4020         Revert "Introducing the Platform Abstraction Layer (PAL)"
4021         https://bugs.webkit.org/show_bug.cgi?id=144751
4022
4023         Unreviewed.
4024
4025         PAL should be a new target inside WebCore, rather than a top-level folder.
4026
4027         * Configurations/FeatureDefines.xcconfig: Updated
4028
4029 2015-05-07  Jer Noble  <jer.noble@apple.com>
4030
4031         [WK2][Fullscreen] Fullscreen video does not enter low-power mode.
4032         https://bugs.webkit.org/show_bug.cgi?id=144744
4033
4034         Reviewed by Darin Adler.
4035
4036         One of the requirements of entering low-power compositing mode is that no masking layers
4037         are present in any of the ancestors of the fullscreen video layer. So once our fullscreen
4038         transition animation completes, remove the mask layer entirely from our clipping layer.
4039         This means it needs to be re-created and added when entering fullscreen, rather than just
4040         at initialization time.
4041
4042         * UIProcess/mac/WKFullScreenWindowController.mm:
4043         (-[WKFullScreenWindowController initWithWindow:webView:]):
4044         (-[WKFullScreenWindowController finishedEnterFullScreenAnimation:]):
4045         (-[WKFullScreenWindowController _startEnterFullScreenAnimationWithDuration:]):
4046
4047 2015-05-07  Martin Robinson  <mrobinson@igalia.com>
4048
4049         [GTK] All spell checking layout tests fail
4050         https://bugs.webkit.org/show_bug.cgi?id=144648
4051
4052         Reviewed by Carlos Garcia Campos.
4053
4054         Simplify and complete the GTK+ spell-checking implementation. Instead of using
4055         the EFL/GTK+ only WKTextChecker interface, directly implement Enchant spell-checking
4056         in TextCheckerGtk. The per-context spell checking API is an illusion, since all
4057         WKTextChecker implementations will adjust the same singleton. This can be a first step
4058         toward removing it entirely.
4059
4060         Also complete the implementation of the TextChecker interface by duplicating the EFL code,
4061         which reuses other methods in the same class. Eventually this duplication will collapse,
4062         once GTK+ and EFL can share an Enchant implementation.
4063
4064         * PlatformGTK.cmake:
4065         * UIProcess/API/gtk/WebKitPrivate.h:
4066         * UIProcess/API/gtk/WebKitTextChecker.cpp: Removed.
4067         * UIProcess/API/gtk/WebKitTextChecker.h: Removed.
4068         * UIProcess/API/gtk/WebKitWebContext.cpp: Remove WebTextChecker usage and
4069         replace it with calls directly to the TextChecker singleton via static methods.
4070         * UIProcess/TextChecker.h:
4071         * UIProcess/gtk/TextCheckerGtk.cpp: Move the WebTextChecker enchant implementation
4072         here&n