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