c3d06e46c95ca255b3069c5540d699e3c872a3eb
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2014-01-31  Anders Carlsson  <andersca@apple.com>
2
3         Add webView:didFailNavigation:withError: delegate method
4         https://bugs.webkit.org/show_bug.cgi?id=128022
5
6         Reviewed by Darin Adler.
7
8         * UIProcess/API/APILoaderClient.h:
9         (API::LoaderClient::didFailLoadWithErrorForFrame):
10         * UIProcess/API/C/WKPage.cpp:
11         (WKPageSetPageLoaderClient):
12         * UIProcess/API/Cocoa/WKNavigationDelegate.h:
13         * UIProcess/Cocoa/NavigationState.h:
14         * UIProcess/Cocoa/NavigationState.mm:
15         (WebKit::NavigationState::setNavigationDelegate):
16         (WebKit::NavigationState::LoaderClient::didFailLoadWithErrorForFrame):
17         * UIProcess/WebPageProxy.cpp:
18         (WebKit::WebPageProxy::didFailLoadForFrame):
19         * UIProcess/WebPageProxy.h:
20         * UIProcess/WebPageProxy.messages.in:
21         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
22         (WebKit::WebFrameLoaderClient::dispatchDidFailLoad):
23
24 2014-01-31  Brady Eidson  <beidson@apple.com>
25
26         IDB: Handle "nextunique" and "prevunique" cursors, and handle "advance()" correctly
27         https://bugs.webkit.org/show_bug.cgi?id=128040
28
29         Reviewed by Jer Noble.
30
31         * DatabaseProcess/IndexedDB/sqlite/SQLiteIDBCursor.cpp:
32         (WebKit::SQLiteIDBCursor::advance): Entry point for advancing by a number of steps,
33           calls either advanceUnique or advanceOnce the appropriate number of times.
34         (WebKit::SQLiteIDBCursor::advanceUnique): Call advanceOnce until the key has changed.
35         (WebKit::SQLiteIDBCursor::advanceOnce):
36         * DatabaseProcess/IndexedDB/sqlite/SQLiteIDBCursor.h:
37
38 2014-01-31  Brady Eidson  <beidson@apple.com>
39
40         IDB: Index cursors use wrong deserialization for the retrieved value
41         https://bugs.webkit.org/show_bug.cgi?id=128035
42
43         Reviewed by Dan Bernstein.
44
45         Most of this is updating everything related to the cursor operation callbacks 
46         to support returning an IDBKey value in addition to a SharedBuffer value.
47
48         * DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.cpp:
49         (WebKit::DatabaseProcessIDBConnection::openCursor):
50         (WebKit::DatabaseProcessIDBConnection::cursorAdvance):
51         (WebKit::DatabaseProcessIDBConnection::cursorIterate):
52
53         * DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:
54         (WebKit::UniqueIDBDatabase::openCursor):
55         (WebKit::UniqueIDBDatabase::cursorAdvance):
56         (WebKit::UniqueIDBDatabase::cursorIterate):
57         (WebKit::UniqueIDBDatabase::openCursorInBackingStore):
58         (WebKit::UniqueIDBDatabase::didOpenCursorInBackingStore):
59         (WebKit::UniqueIDBDatabase::advanceCursorInBackingStore):
60         (WebKit::UniqueIDBDatabase::didAdvanceCursorInBackingStore):
61         (WebKit::UniqueIDBDatabase::iterateCursorInBackingStore):
62         (WebKit::UniqueIDBDatabase::didIterateCursorInBackingStore):
63         * DatabaseProcess/IndexedDB/UniqueIDBDatabase.h:
64
65         * DatabaseProcess/IndexedDB/UniqueIDBDatabaseBackingStore.h:
66         * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp:
67         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::openCursor):
68         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::advanceCursor):
69         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::iterateCursor):
70         * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.h:
71
72         * DatabaseProcess/IndexedDB/sqlite/SQLiteIDBCursor.cpp:
73         (WebKit::SQLiteIDBCursor::advance):
74         * DatabaseProcess/IndexedDB/sqlite/SQLiteIDBCursor.h:
75         (WebKit::SQLiteIDBCursor::currentValueBuffer):
76         (WebKit::SQLiteIDBCursor::currentValueKey):
77
78         * WebProcess/Databases/IndexedDB/WebIDBServerConnection.cpp:
79         (WebKit::WebIDBServerConnection::didOpenCursor):
80         (WebKit::WebIDBServerConnection::didAdvanceCursor):
81         (WebKit::WebIDBServerConnection::didIterateCursor):
82         (WebKit::WebIDBServerConnection::openCursor):
83         (WebKit::WebIDBServerConnection::cursorAdvance):
84         (WebKit::WebIDBServerConnection::cursorIterate):
85         * WebProcess/Databases/IndexedDB/WebIDBServerConnection.h:
86         * WebProcess/Databases/IndexedDB/WebIDBServerConnection.messages.in:
87
88 2014-01-31  Ryosuke Niwa  <rniwa@webkit.org>
89
90         Remove inline member functions of FrameSelection that access m_selection
91         https://bugs.webkit.org/show_bug.cgi?id=127986
92
93         Reviewed by Enrica Casucci.
94
95         * WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp:
96         (WebKit::collapseSelection):
97         * WebProcess/WebPage/WebPage.cpp:
98         (WebKit::WebPage::editorState):
99         (WebKit::WebPage::confirmComposition):
100         (WebKit::WebPage::setComposition):
101         * WebProcess/WebPage/ios/WebPageIOS.mm:
102         (WebKit::WebPage::setComposition):
103         (WebKit::WebPage::updateSelectionWithTouches):
104         * WebProcess/WebPage/mac/WebPageMac.mm:
105         (WebKit::WebPage::setComposition):
106         (WebKit::WebPage::getAttributedSubstringFromRange):
107
108 2014-01-31  Simon Fraser  <simon.fraser@apple.com>
109
110         Pass the viewport rect and scroll origin independently into the scrolling tree, and make things floats
111         https://bugs.webkit.org/show_bug.cgi?id=128032
112
113         Reviewed by Tim Horton.
114
115         Pass the viewport rect and scroll offset independently into the ScrollingTree
116         via the ScrollingStateScrollingNode, since on iOS the scroll offset doesn't
117         always correspond to the viewport rect.
118         
119         Make the viewport rect and the scroll origin be float-based, since on
120         Retina screens and with zooming these can both be non-integral.
121
122         * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp:
123         (ArgumentCoder<ScrollingStateScrollingNode>::encode):
124         (ArgumentCoder<ScrollingStateScrollingNode>::decode):
125         * UIProcess/Scrolling/RemoteScrollingTree.cpp:
126         (WebKit::RemoteScrollingTree::scrollingTreeNodeDidScroll):
127         * UIProcess/Scrolling/RemoteScrollingTree.h:
128
129 2014-01-31  Tim Horton  <timothy_horton@apple.com>
130
131         WebKit2 View Gestures: Crash when pinch-zooming on a page that is just a frameset
132         https://bugs.webkit.org/show_bug.cgi?id=127591
133         <rdar://problem/15898349>
134
135         Reviewed by Simon Fraser.
136
137         When we have no shadow layer, we crash in TiledCoreAnimationDrawingArea::adjustTransientZoom.
138         Fix this null deref; also, we always want a shadow layer, even if the page cannot be scrolled,
139         because it can be revealed by pinching out.
140
141         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
142         (WebKit::TiledCoreAnimationDrawingArea::adjustTransientZoom):
143         (WebKit::TiledCoreAnimationDrawingArea::commitTransientZoom):
144         (WebKit::TiledCoreAnimationDrawingArea::applyTransientZoomToPage):
145
146 2014-01-31  Oliver Hunt  <oliver@apple.com>
147
148         Rollout r163195 and related patches
149
150         * CMakeLists.txt:
151
152 2014-01-31  Tim Horton  <timothy_horton@apple.com>
153
154         [wk2] PlatformCALayerRemoteCustom doesn't work on iOS
155         https://bugs.webkit.org/show_bug.cgi?id=128025
156         <rdar://problem/15950271>
157
158         Reviewed by Simon Fraser.
159
160         * Platform/mac/LayerHostingContext.h:
161         * Platform/mac/LayerHostingContext.mm:
162         (WebKit::LayerHostingContext::createForPort):
163         (WebKit::LayerHostingContext::createForExternalHostingProcess):
164         Use the new macro name (in a lot of places).
165         Rename LayerHostingContext::createForWindowServer() to createForExternalHostingProcess().
166         Don't use WKCAContextMakeRemoteForWindowServer on iOS, just use the CAContext
167         SPI directly. We don't want our CAContext to be hit tested because it's purely
168         presentational.
169
170         * UIProcess/API/ios/PageClientImplIOS.h:
171         iOS always hosts layers in an external process.
172
173         * PluginProcess/mac/PluginControllerProxyMac.mm:
174         (WebKit::PluginControllerProxy::updateLayerHostingContext):
175         * Shared/LayerTreeContext.h:
176         * UIProcess/API/mac/PageClientImpl.mm:
177         (WebKit::PageClientImpl::viewLayerHostingMode):
178         * UIProcess/PageClient.h:
179         (WebKit::PageClient::viewLayerHostingMode):
180         * UIProcess/WebPageProxy.cpp:
181         (WebKit::WebPageProxy::WebPageProxy):
182         (WebKit::WebPageProxy::viewStateDidChange):
183         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
184         (WebKit::NetscapePlugin::NetscapePlugin):
185         * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
186         (WebKit::NetscapePlugin::compositingRenderServerPort):
187         * WebProcess/Plugins/PluginView.cpp:
188         (WebKit::PluginView::setLayerHostingMode):
189         * WebProcess/WebPage/WebPage.cpp:
190         (WebKit::WebPage::reinitializeWebPage):
191         * WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.mm:
192         (PlatformCALayerRemoteCustom::PlatformCALayerRemoteCustom):
193         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
194         (WebKit::TiledCoreAnimationDrawingArea::updateLayerHostingContext):
195         Use enum class for LayerHostingMode and rename the members to InProcess and OutOfProcess.
196
197 2014-01-31  Martin Hock  <mhock@apple.com>
198
199         Add session support to WebPlatformStrategies
200         https://bugs.webkit.org/show_bug.cgi?id=127926
201
202         Reviewed by Alexey Proskuryakov.
203
204         * NetworkProcess/mac/RemoteNetworkingContext.mm:
205         (WebKit::RemoteNetworkingContext::ensurePrivateBrowsingSession):
206         * Shared/SessionTracker.cpp:
207         (WebKit::storageSessionToID):
208         (WebKit::SessionTracker::session):
209         (WebKit::SessionTracker::sessionID):
210         (WebKit::SessionTracker::setSession):
211         (WebKit::SessionTracker::destroySession):
212         * Shared/SessionTracker.h:
213         * UIProcess/WebPageProxy.cpp:
214         (WebKit::WebPageProxy::setSession):
215         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
216         (WebKit::WebPlatformStrategies::cookiesForDOM):
217         (WebKit::WebPlatformStrategies::setCookiesFromDOM):
218         (WebKit::WebPlatformStrategies::cookiesEnabled):
219         (WebKit::WebPlatformStrategies::cookieRequestHeaderFieldValue):
220         (WebKit::WebPlatformStrategies::getRawCookies):
221         (WebKit::WebPlatformStrategies::deleteCookie):
222         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
223         (WebKit::WebFrameNetworkingContext::ensurePrivateBrowsingSession):
224         * WebProcess/WebPage/WebPage.cpp:
225         (WebKit::WebPage::setSessionID): Ensure the storage session exists.
226         * WebProcess/WebPage/WebPage.h:
227
228 2014-01-31  Alexey Proskuryakov  <ap@apple.com>
229
230         Expose creation and modification times for LocalStorage
231         https://bugs.webkit.org/show_bug.cgi?id=128018
232
233         Reviewed by Anders Carlsson.
234
235         * UIProcess/API/C/WKKeyValueStorageManager.cpp:
236         (WKKeyValueStorageManagerGetOriginKey):
237         (WKKeyValueStorageManagerGetCreationTimeKey):
238         (WKKeyValueStorageManagerGetModificationTimeKey):
239         (WKKeyValueStorageManagerGetStorageDetailsByOrigin):
240         * UIProcess/API/C/WKKeyValueStorageManager.h:
241         * UIProcess/Storage/LocalStorageDatabaseTracker.cpp:
242         (WebKit::LocalStorageDatabaseTracker::origins):
243         (WebKit::LocalStorageDatabaseTracker::details):
244         * UIProcess/Storage/LocalStorageDatabaseTracker.h:
245         * UIProcess/Storage/StorageManager.cpp:
246         (WebKit::StorageManager::getStorageDetailsByOrigin):
247         (WebKit::StorageManager::getStorageDetailsByOriginInternal):
248         * UIProcess/Storage/StorageManager.h:
249         * UIProcess/WebKeyValueStorageManager.cpp:
250         (WebKit::WebKeyValueStorageManager::originKey):
251         (WebKit::WebKeyValueStorageManager::creationTimeKey):
252         (WebKit::WebKeyValueStorageManager::modificationTimeKey):
253         (WebKit::didGetKeyValueStorageOrigins):
254         (WebKit::didGetStorageDetailsByOrigin):
255         (WebKit::WebKeyValueStorageManager::getStorageDetailsByOrigin):
256         * UIProcess/WebKeyValueStorageManager.h:
257         * WebKit2.xcodeproj/project.pbxproj:
258
259 2014-01-31  Anders Carlsson  <andersca@apple.com>
260
261         Add webView:didReceiveServerRedirectForProvisionalNavigation:
262         https://bugs.webkit.org/show_bug.cgi?id=128016
263
264         Reviewed by Dan Bernstein.
265
266         * UIProcess/API/APILoaderClient.h:
267         (API::LoaderClient::didReceiveServerRedirectForProvisionalLoadForFrame):
268         * UIProcess/API/C/WKPage.cpp:
269         (WKPageSetPageLoaderClient):
270         * UIProcess/API/Cocoa/WKNavigationDelegate.h:
271         * UIProcess/Cocoa/NavigationState.h:
272         * UIProcess/Cocoa/NavigationState.mm:
273         (WebKit::NavigationState::setNavigationDelegate):
274         (WebKit::NavigationState::LoaderClient::didReceiveServerRedirectForProvisionalLoadForFrame):
275         * UIProcess/WebPageProxy.cpp:
276         (WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame):
277         * UIProcess/WebPageProxy.h:
278         * UIProcess/WebPageProxy.messages.in:
279         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
280         (WebKit::WebFrameLoaderClient::dispatchDidReceiveServerRedirectForProvisionalLoad):
281         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction):
282         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
283
284 2014-01-31  Brady Eidson  <beidson@apple.com>
285
286         IDB: Index cursor preliminary support
287         https://bugs.webkit.org/show_bug.cgi?id=127869
288
289         Reviewed by Sam Weinig.
290
291         This gets index cursors running and - for some situations - returning results.
292
293         Bug 127870 will make them fully functional.
294
295         * DatabaseProcess/IndexedDB/sqlite/SQLiteIDBCursor.cpp:
296         (WebKit::getIndexStatement): Using the key and sorting parameters, find the appropriate SQL
297           statement to run an index cursor.
298         (WebKit::getObjectStoreStatement): Same, but for object store cursors.
299         (WebKit::SQLiteIDBCursor::establishStatement): Depending on the type of cursor, choose the
300           correct SQL query and id to use.
301         (WebKit::SQLiteIDBCursor::createSQLiteStatement): With the passed in SQL and id, handle both
302           index and object store cursors.
303         * DatabaseProcess/IndexedDB/sqlite/SQLiteIDBCursor.h:
304
305 2014-01-29  Oliver Hunt  <oliver@apple.com>
306
307         Make it possible to implement JS builtins in JS
308         https://bugs.webkit.org/show_bug.cgi?id=127887
309
310         Reviewed by Michael Saboff.
311
312         CMake updates
313
314         * CMakeLists.txt:
315
316 2014-01-31  Tim Horton  <timothy_horton@apple.com>
317
318         WebKit2 View Gestures (Swipe): Crashes swiping around a Google Docs spreadsheet
319         https://bugs.webkit.org/show_bug.cgi?id=128013
320         <rdar://problem/15959481>
321
322         Reviewed by Anders Carlsson.
323
324         * UIProcess/mac/ViewGestureController.mm:
325         (WebKit::ViewGestureController::wheelEventWasNotHandledByWebCore):
326         We should never (currently) start a swipe from a non-begin-phase wheel event.
327         We already check this in handleScrollWheelEvent, but can still get
328         non-begin-phase events in wheelEventWasNotHandled.
329
330         We only start "pending" swipes with Begin events, so we should never make them
331         non-pending with anything but a Begin event (we'll get it when it bubbles back up,
332         unhandled, from WebCore). In addition, AppKit throws an exception when we try
333         to start a swipe from end-phase events.
334
335 2014-01-31  Brady Eidson  <beidson@apple.com>
336
337         IDB: openCursor() needs to prime the cursor with first position values
338         https://bugs.webkit.org/show_bug.cgi?id=128008
339
340         Reviewed by Alexey Proskuryakov.
341
342         Change openCursor() messaging to pass back the initial keys/values
343         * WebProcess/Databases/IndexedDB/WebIDBServerConnection.cpp:
344         (WebKit::WebIDBServerConnection::didOpenCursor):
345         (WebKit::WebIDBServerConnection::openCursor):
346         * WebProcess/Databases/IndexedDB/WebIDBServerConnection.h:
347         * WebProcess/Databases/IndexedDB/WebIDBServerConnection.messages.in:
348
349         * DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.cpp:
350         (WebKit::DatabaseProcessIDBConnection::openCursor):
351
352         * DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:
353         (WebKit::UniqueIDBDatabase::openCursor):
354         (WebKit::UniqueIDBDatabase::cursorAdvance): Const and reference updates.
355         (WebKit::UniqueIDBDatabase::cursorIterate): Ditto.
356         (WebKit::UniqueIDBDatabase::openCursorInBackingStore):
357         (WebKit::UniqueIDBDatabase::didOpenCursorInBackingStore):
358         * DatabaseProcess/IndexedDB/UniqueIDBDatabase.h:
359
360         * DatabaseProcess/IndexedDB/UniqueIDBDatabaseBackingStore.h:
361         * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp:
362         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::openCursor):
363         * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.h:
364
365         * DatabaseProcess/IndexedDB/sqlite/SQLiteIDBCursor.cpp:
366         (WebKit::SQLiteIDBCursor::maybeCreate): After creating the cursor, advance(1) it.
367
368         * Shared/AsyncTask.h:
369         (WebKit::createAsyncTask):
370
371 2014-01-31  Beth Dakin  <bdakin@apple.com>
372
373         Sideways 'wobble' when scrolling with trackpad on Mavericks
374         https://bugs.webkit.org/show_bug.cgi?id=127521
375         -and corresponding-
376         <rdar://problem/14137306>
377
378         Reviewed by Simon Fraser.
379
380         Start using WebCore::WheelEventDeltaTracker to filter events.
381         * WebProcess/WebPage/EventDispatcher.cpp:
382         (WebKit::EventDispatcher::EventDispatcher):
383         (WebKit::EventDispatcher::wheelEvent):
384         * WebProcess/WebPage/EventDispatcher.h:
385
386 2014-01-31  Zan Dobersek  <zdobersek@igalia.com>
387
388         Fix the forward declaration of RawPluginMetaData in NetscapePluginModule.h
389         https://bugs.webkit.org/show_bug.cgi?id=127992
390
391         Reviewed by Martin Robinson.
392
393         * Shared/Plugins/Netscape/NetscapePluginModule.h: RawPluginMetaData is a struct, so it should
394         be declared as such. The current forward declaration is throwing a warning when using Clang.
395
396 2014-01-31  Anders Carlsson  <andersca@apple.com>
397
398         REGRESSION: WebKit2.PageLoadBasic API test is failing
399         https://bugs.webkit.org/show_bug.cgi?id=127892
400
401         Reviewed by Dan Bernstein.
402
403         On Mountain Lion, URLs returned by -[NSBundle URLForResource:withExtension:subdirectory] include
404         localhost as the hostname, but WebCore::URL normalizes those URLs and removes the host name.
405         
406         Because of this, URLs created by WKURLCreateWithCFURL won't be equal to urls passed through 
407         the WebCore::URL constructor. Change WKURLIsEqual to compare the normalized URLs.
408
409         * Shared/API/c/WKURL.cpp:
410         (WKURLIsEqual):
411         * Shared/APIURL.h:
412         (API::URL::equals):
413         (API::URL::url):
414
415 2014-01-31  Brady Eidson  <beidson@apple.com>
416
417         IDB: When deleting object stores/indexes, also delete associated records
418         https://bugs.webkit.org/show_bug.cgi?id=127872
419
420         Reviewed by Anders Carlsson.
421
422         This was mostly done via other patches, but clearObjectStore was the last remaining case:
423         * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp:
424         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::clearObjectStore): Also delete Index records.
425
426 2014-01-31  Brady Eidson  <beidson@apple.com>
427
428         IDB: Index writing
429         <rdar://problem/15899973> and https://bugs.webkit.org/show_bug.cgi?id=127868
430
431         Reviewed by Anders Carlsson.
432
433         * DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:
434         (WebKit::UniqueIDBDatabase::putRecordInBackingStore): Handle writing index records, as well.
435
436         * DatabaseProcess/IndexedDB/UniqueIDBDatabaseBackingStore.h:
437         * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp:
438         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::createAndPopulateInitialMetadata): Create a table
439           for index records
440         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::extractExistingMetadata): Extract IDBIndexMetadata
441         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::deleteObjectStore):
442         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::deleteIndex):
443         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::putIndexRecord): Store in the IndexRecords table.
444         * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.h:
445
446 2014-01-30  Jinwoo Song  <jinwoo7.song@samsung.com>
447
448         [EFL][WK2] Unreviewed EFL WebKit2 build fix after r163116.
449         https://bugs.webkit.org/show_bug.cgi?id=127985
450
451         Unreviewed EFL WebKit2 build fix.
452
453         * UIProcess/CoordinatedGraphics/WebView.cpp:
454         (WebKit::WebView::processDidExit):
455         * UIProcess/CoordinatedGraphics/WebView.h:
456
457 2014-01-30  Simon Fraser  <simon.fraser@apple.com>
458
459         Fix iOS WK2 build after r163156.
460
461         Need to convert to IntSizes.
462
463         * WebProcess/WebPage/ios/WebPageIOS.mm:
464         (WebKit::WebPage::tapHighlightAtPosition):
465
466 2014-01-30  Martin Robinson  <mrobinson@igalia.com>
467
468         [GTK] [CMake] Add support for building against GTK+ 2
469         https://bugs.webkit.org/show_bug.cgi?id=127959
470
471         Reviewed by Anders Carlsson.
472
473         * PlatformGTK.cmake: Use the new API version variable and don't use GTK3 directly.
474
475 2014-01-30  Commit Queue  <commit-queue@webkit.org>
476
477         Unreviewed, rolling out r163125.
478         http://trac.webkit.org/changeset/163125
479         https://bugs.webkit.org/show_bug.cgi?id=127980
480
481         caused 9 layout tests to assert and crash (Requested by estes
482         on #webkit).
483
484         * NetworkProcess/mac/RemoteNetworkingContext.mm:
485         (WebKit::RemoteNetworkingContext::ensurePrivateBrowsingSession):
486         * Shared/SessionTracker.cpp:
487         (WebKit::SessionTracker::session):
488         (WebKit::SessionTracker::setSession):
489         (WebKit::SessionTracker::destroySession):
490         * Shared/SessionTracker.h:
491         * UIProcess/WebPageProxy.cpp:
492         (WebKit::WebPageProxy::setSession):
493         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
494         (WebKit::legacySessionID):
495         (WebKit::WebPlatformStrategies::cookiesForDOM):
496         (WebKit::WebPlatformStrategies::setCookiesFromDOM):
497         (WebKit::WebPlatformStrategies::cookiesEnabled):
498         (WebKit::WebPlatformStrategies::cookieRequestHeaderFieldValue):
499         (WebKit::WebPlatformStrategies::getRawCookies):
500         (WebKit::WebPlatformStrategies::deleteCookie):
501         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
502         (WebKit::WebFrameNetworkingContext::ensurePrivateBrowsingSession):
503         * WebProcess/WebPage/WebPage.cpp:
504         * WebProcess/WebPage/WebPage.h:
505         (WebKit::WebPage::setSessionID):
506
507 2014-01-30  Anders Carlsson  <andersca@apple.com>
508
509         Add webView:didFinishLoadingNavigation: delegate method
510         https://bugs.webkit.org/show_bug.cgi?id=127976
511
512         Reviewed by Dan Bernstein.
513
514         * UIProcess/API/APILoaderClient.h:
515         (API::LoaderClient::didFinishLoadForFrame):
516         * UIProcess/API/C/WKPage.cpp:
517         (WKPageSetPageLoaderClient):
518         * UIProcess/API/Cocoa/WKNavigationDelegate.h:
519         * UIProcess/Cocoa/NavigationState.h:
520         * UIProcess/Cocoa/NavigationState.mm:
521         (WebKit::NavigationState::setNavigationDelegate):
522         (WebKit::NavigationState::LoaderClient::didStartProvisionalLoadForFrame):
523         (WebKit::NavigationState::LoaderClient::didFailProvisionalLoadWithErrorForFrame):
524         (WebKit::NavigationState::LoaderClient::didCommitLoadForFrame):
525         (WebKit::NavigationState::LoaderClient::didFinishLoadForFrame):
526         * UIProcess/WebPageProxy.cpp:
527         (WebKit::WebPageProxy::didFinishLoadForFrame):
528         * UIProcess/WebPageProxy.h:
529         * UIProcess/WebPageProxy.messages.in:
530         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
531         (WebKit::WebFrameLoaderClient::dispatchDidFinishLoad):
532
533 2014-01-30  Tim Horton  <timothy_horton@apple.com>
534
535         Crashes after 163116 in [WKView takeViewSnapshot]
536         https://bugs.webkit.org/show_bug.cgi?id=127973
537
538         Reviewed by Alexey Proskuryakov.
539
540         * UIProcess/API/mac/WKView.mm:
541         (-[WKView _takeViewSnapshot]):
542         Make the ViewGestureController before using it, if we need one.
543
544 2014-01-30  Anders Carlsson  <andersca@apple.com>
545
546         Add a webView:didCommitNavigation: delegate method
547         https://bugs.webkit.org/show_bug.cgi?id=127972
548
549         Reviewed by Dan Bernstein.
550
551         * UIProcess/API/APILoaderClient.h:
552         (API::LoaderClient::didCommitLoadForFrame):
553         * UIProcess/API/C/WKPage.cpp:
554         (WKPageSetPageLoaderClient):
555         * UIProcess/API/Cocoa/WKNavigationDelegate.h:
556         * UIProcess/Cocoa/NavigationState.h:
557         * UIProcess/Cocoa/NavigationState.mm:
558         (WebKit::NavigationState::setNavigationDelegate):
559         (WebKit::NavigationState::LoaderClient::didCommitLoadForFrame):
560         * UIProcess/WebPageProxy.cpp:
561         (WebKit::WebPageProxy::didCommitLoadForFrame):
562         * UIProcess/WebPageProxy.h:
563         * UIProcess/WebPageProxy.messages.in:
564         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
565         (WebKit::WebFrameLoaderClient::dispatchDidCommitLoad):
566
567 2014-01-30  Anders Carlsson  <andersca@apple.com>
568
569         Add a webView:didFailProvisionalNavigation:withError: delegate method
570         https://bugs.webkit.org/show_bug.cgi?id=127968
571
572         Reviewed by Dan Bernstein.
573
574         * UIProcess/API/APILoaderClient.h:
575         (API::LoaderClient::didFailProvisionalLoadWithErrorForFrame):
576         * UIProcess/API/C/WKPage.cpp:
577         (WKPageSetPageLoaderClient):
578         * UIProcess/API/Cocoa/WKNavigationDelegate.h:
579         * UIProcess/Cocoa/NavigationState.h:
580         * UIProcess/Cocoa/NavigationState.mm:
581         (WebKit::NavigationState::setNavigationDelegate):
582         (WebKit::NavigationState::LoaderClient::didFailProvisionalLoadWithErrorForFrame):
583         * UIProcess/WebPageProxy.cpp:
584         (WebKit::WebPageProxy::didFailProvisionalLoadForFrame):
585         * UIProcess/WebPageProxy.h:
586         * UIProcess/WebPageProxy.messages.in:
587         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
588         (WebKit::WebFrameLoaderClient::dispatchDidFailProvisionalLoad):
589
590 2014-01-30  Anders Carlsson  <andersca@apple.com>
591
592         Add a webView:didStartProvisionalNavigation: delegate method
593         https://bugs.webkit.org/show_bug.cgi?id=127965
594
595         Reviewed by Dan Bernstein.
596
597         * UIProcess/API/APILoaderClient.h:
598         (API::LoaderClient::didStartProvisionalLoadForFrame):
599         * UIProcess/API/C/WKPage.cpp:
600         (WKPageSetPageLoaderClient):
601         * UIProcess/API/Cocoa/WKNavigationDelegate.h:
602         * UIProcess/API/Cocoa/WKWebView.mm:
603         (-[WKWebView initWithFrame:configuration:]):
604         * UIProcess/Cocoa/NavigationState.h:
605         * UIProcess/Cocoa/NavigationState.mm:
606         (WebKit::NavigationState::createLoaderClient):
607         (WebKit::NavigationState::createPolicyClient):
608         (WebKit::NavigationState::setNavigationDelegate):
609         (WebKit::NavigationState::LoaderClient::LoaderClient):
610         (WebKit::NavigationState::LoaderClient::~LoaderClient):
611         (WebKit::NavigationState::LoaderClient::didStartProvisionalLoadForFrame):
612         * UIProcess/WebPageProxy.cpp:
613         (WebKit::WebPageProxy::didStartProvisionalLoadForFrame):
614         * UIProcess/WebPageProxy.h:
615         * UIProcess/WebPageProxy.messages.in:
616         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
617         (WebKit::WebFrameLoaderClient::dispatchDidStartProvisionalLoad):
618
619 2014-01-30  Brady Eidson  <beidson@apple.com>
620
621         IDB: Implement IDBObjectStore.count()
622         https://bugs.webkit.org/show_bug.cgi?id=127888
623
624         Reviewed by Tim Horton.
625
626         Now count() actually works.
627
628         Forward the count() request to the backing store”
629         * DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:
630         (WebKit::UniqueIDBDatabase::countInBackingStore):
631
632         Using a cursor, get a count:
633         * DatabaseProcess/IndexedDB/UniqueIDBDatabaseBackingStore.h:
634         * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp:
635         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::count):
636         * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.h:
637
638         Give a direct accessor to allow the backing store to close a cursor it opened
639         for its own use:
640         * DatabaseProcess/IndexedDB/sqlite/SQLiteIDBTransaction.cpp:
641         (WebKit::SQLiteIDBTransaction::closeCursor):
642         * DatabaseProcess/IndexedDB/sqlite/SQLiteIDBTransaction.h:
643
644         * WebProcess/Databases/IndexedDB/WebIDBServerConnection.cpp:
645         (WebKit::WebIDBServerConnection::didCount): Update the logging to show the count.
646
647 2014-01-30  Anders Carlsson  <andersca@apple.com>
648
649         Implement NavigationState::PolicyClient::decidePolicyForNewWindowAction
650         https://bugs.webkit.org/show_bug.cgi?id=127962
651
652         Reviewed by Andreas Kling.
653
654         Have decidePolicyForNewWindowAction call decidePolicyForNavigationAction with a null destination frame.
655
656         * UIProcess/Cocoa/NavigationState.h:
657         * UIProcess/Cocoa/NavigationState.mm:
658         (WebKit::NavigationState::PolicyClient::decidePolicyForNavigationAction):
659         (WebKit::NavigationState::PolicyClient::decidePolicyForNewWindowAction):
660
661 2014-01-30  Martin Hock  <mhock@apple.com>
662
663         Add session support to WebPlatformStrategies
664         https://bugs.webkit.org/show_bug.cgi?id=127926
665
666         Reviewed by Alexey Proskuryakov.
667
668         * NetworkProcess/mac/RemoteNetworkingContext.mm:
669         (WebKit::RemoteNetworkingContext::ensurePrivateBrowsingSession):
670         * Shared/SessionTracker.cpp:
671         (WebKit::storageSessionToID):
672         (WebKit::SessionTracker::session):
673         (WebKit::SessionTracker::sessionID):
674         (WebKit::SessionTracker::setSession):
675         (WebKit::SessionTracker::destroySession):
676         * Shared/SessionTracker.h:
677         * UIProcess/WebPageProxy.cpp:
678         (WebKit::WebPageProxy::setSession):
679         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
680         (WebKit::WebPlatformStrategies::cookiesForDOM):
681         (WebKit::WebPlatformStrategies::setCookiesFromDOM):
682         (WebKit::WebPlatformStrategies::cookiesEnabled):
683         (WebKit::WebPlatformStrategies::cookieRequestHeaderFieldValue):
684         (WebKit::WebPlatformStrategies::getRawCookies):
685         (WebKit::WebPlatformStrategies::deleteCookie):
686         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
687         (WebKit::WebFrameNetworkingContext::ensurePrivateBrowsingSession):
688         * WebProcess/WebPage/WebPage.cpp:
689         (WebKit::WebPage::setSessionID): Ensure the storage session exists.
690         * WebProcess/WebPage/WebPage.h:
691
692 2014-01-30  Brady Eidson  <beidson@apple.com>
693
694         IDB: ObjectStore cursor iterate() support
695         <rdar://problem/15941914> and https://bugs.webkit.org/show_bug.cgi?id=127867
696
697         Reviewed by Tim Horton.
698
699         * DatabaseProcess/IndexedDB/sqlite/SQLiteIDBCursor.cpp:
700         (WebKit::SQLiteIDBCursor::iterate): Implement iterate() using advance()
701
702 2014-01-30  Anders Carlsson  <andersca@apple.com>
703
704         decidePolicyForNewWindowAction should take a NavigationActionData object
705         https://bugs.webkit.org/show_bug.cgi?id=127952
706
707         Reviewed by Dan Bernstein.
708
709         * UIProcess/API/APIPolicyClient.h:
710         (API::PolicyClient::decidePolicyForNewWindowAction):
711         * UIProcess/API/C/WKPage.cpp:
712         (WKPageSetPagePolicyClient):
713         * UIProcess/WebPageProxy.cpp:
714         (WebKit::WebPageProxy::decidePolicyForNewWindowAction):
715
716 2014-01-27  Jeffrey Pfau  <jpfau@apple.com>
717
718         Add a method for schemes to be registered as supporting cache partitioning
719         https://bugs.webkit.org/show_bug.cgi?id=127739
720
721         Reviewed by Darin Adler.
722
723         Pipe information about cache partitioned scheme through WebKit2.
724
725         * Shared/WebProcessCreationParameters.cpp:
726         (WebKit::WebProcessCreationParameters::encode):
727         (WebKit::WebProcessCreationParameters::decode):
728         * Shared/WebProcessCreationParameters.h:
729         * UIProcess/API/C/WKContext.cpp:
730         (WKContextRegisterURLSchemeAsCachePartitioned):
731         * UIProcess/API/C/WKContextPrivate.h:
732         * UIProcess/WebContext.cpp:
733         (WebKit::WebContext::createNewWebProcess):
734         (WebKit::WebContext::registerURLSchemeAsCachePartitioned):
735         * UIProcess/WebContext.h:
736         * WebProcess/WebProcess.cpp:
737         (WebKit::WebProcess::initializeWebProcess):
738         (WebKit::WebProcess::registerURLSchemeAsCachePartitioned):
739         * WebProcess/WebProcess.h:
740         * WebProcess/WebProcess.messages.in:
741
742 2014-01-30  Tim Horton  <timothy_horton@apple.com>
743
744         Lots of API test assertion failures after r163093
745         https://bugs.webkit.org/show_bug.cgi?id=127948
746
747         Reviewed by Alexey Proskuryakov.
748
749         * UIProcess/API/ios/PageClientImplIOS.mm:
750         (WebKit::PageClientImpl::processDidExit):
751         * UIProcess/API/ios/WKContentView.mm:
752         (-[WKContentView _processDidExit]):
753         * UIProcess/API/ios/WKContentViewInternal.h:
754         * UIProcess/API/mac/PageClientImpl.h:
755         * UIProcess/API/mac/PageClientImpl.mm:
756         (WebKit::PageClientImpl::processDidExit):
757         * UIProcess/API/mac/WKView.mm:
758         (-[WKView _processDidExit]):
759         * UIProcess/PageClient.h:
760         * UIProcess/WebPageProxy.cpp:
761         (WebKit::WebPageProxy::processDidCrash):
762         (WebKit::WebPageProxy::resetStateAfterProcessExited):
763         * UIProcess/API/mac/WKViewInternal.h:
764         Rename _processDidCrash to _processDidExit, since it containes cleanup we
765         should do in both cases. Also, call it whenever a process terminates instead
766         of just upon a crash. Also clear the ViewGestureController, because its
767         state doesn't make sense between WebProcesses.
768
769         (-[WKView _setCustomSwipeViews:]):
770         Don't make a ViewGestureController if we don't have one and would be
771         only creating one to set an empty list of custom swipe views.
772
773 2014-01-30  Brady Eidson  <beidson@apple.com>
774
775         IDB: ObjectStore cursor advance() support
776         <rdar://problem/15779645> and https://bugs.webkit.org/show_bug.cgi?id=127866
777
778         Reviewed by Sam Weinig.
779
780         Plumb calls through to the backing store:
781         * DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:
782         (WebKit::UniqueIDBDatabase::openCursorInBackingStore):
783         (WebKit::UniqueIDBDatabase::advanceCursorInBackingStore):
784         (WebKit::UniqueIDBDatabase::iterateCursorInBackingStore):
785
786         * DatabaseProcess/IndexedDB/UniqueIDBDatabaseBackingStore.h:
787         * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp:
788         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::createAndPopulateInitialMetadata): Update schema
789           for Records table.
790         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::getOrEstablishMetadata):
791         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::establishTransaction):
792         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::resetTransaction):
793         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::putRecord):
794         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::openCursor): Create a SQLiteIDBCursor object.
795         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::advanceCursor): Call through to that object.
796         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::iterateCursor): Ditto.
797         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::idbKeyCollate): Renamed for clarity.
798         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::unregisterCursor): Cleanup open cursors.
799         * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.h:
800
801         * DatabaseProcess/IndexedDB/sqlite/SQLiteIDBCursor.cpp: Added.
802         (WebKit::SQLiteIDBCursor::maybeCreate):
803         (WebKit::SQLiteIDBCursor::SQLiteIDBCursor):
804         (WebKit::SQLiteIDBCursor::establishStatement):
805         (WebKit::SQLiteIDBCursor::createIndexCursorStatement): Stubbed for now.
806         (WebKit::SQLiteIDBCursor::createObjectStoreCursorStatement): Create the appropriate query for
807           the passed in IDBKeyRange.
808         (WebKit::SQLiteIDBCursor::advance): Step through that query.
809         (WebKit::SQLiteIDBCursor::iterate): Stubbed for now.
810         * DatabaseProcess/IndexedDB/sqlite/SQLiteIDBCursor.h: Added.
811         (WebKit::SQLiteIDBCursor::identifier):
812         (WebKit::SQLiteIDBCursor::transaction):
813         (WebKit::SQLiteIDBCursor::currentKey):
814         (WebKit::SQLiteIDBCursor::currentPrimaryKey):
815         (WebKit::SQLiteIDBCursor::currentValue):
816
817         Add infrastructure for a SQLiteIDBTransaction to keep track of (and clean up) its open cursors:
818         * DatabaseProcess/IndexedDB/sqlite/SQLiteIDBTransaction.cpp:
819         (WebKit::SQLiteIDBTransaction::SQLiteIDBTransaction):
820         (WebKit::SQLiteIDBTransaction::~SQLiteIDBTransaction):
821         (WebKit::SQLiteIDBTransaction::reset):
822         (WebKit::SQLiteIDBTransaction::openCursor):
823         (WebKit::SQLiteIDBTransaction::clearCursors):
824         * DatabaseProcess/IndexedDB/sqlite/SQLiteIDBTransaction.h:
825         (WebKit::SQLiteIDBTransaction::create):
826         (WebKit::SQLiteIDBTransaction::sqliteTransaction):
827
828         Add accessors for the two fields:
829         * DatabaseProcess/IndexedDB/IDBIdentifier.h:
830         (WebKit::IDBIdentifier::connection):
831         (WebKit::IDBIdentifier::id):
832
833         * WebKit2.xcodeproj/project.pbxproj:
834
835 2014-01-30  Anders Carlsson  <andersca@apple.com>
836
837         Implement policy response delegate handling
838         https://bugs.webkit.org/show_bug.cgi?id=127945
839
840         Reviewed by Dan Bernstein.
841
842         * UIProcess/API/APIPolicyClient.h:
843         (API::PolicyClient::decidePolicyForResponse):
844         * UIProcess/API/C/WKPage.cpp:
845         (WKPageSetPagePolicyClient):
846         * UIProcess/API/Cocoa/WKNavigationDelegate.h:
847         (NS_ENUM):
848         * UIProcess/Cocoa/NavigationState.h:
849         * UIProcess/Cocoa/NavigationState.mm:
850         (WebKit::NavigationState::setNavigationDelegate):
851         (WebKit::NavigationState::PolicyClient::decidePolicyForNavigationAction):
852         (WebKit::NavigationState::PolicyClient::decidePolicyForResponse):
853         * UIProcess/WebPageProxy.cpp:
854         (WebKit::WebPageProxy::decidePolicyForResponse):
855
856 2014-01-29  Dean Jackson  <dino@apple.com>
857
858         Allow the OpenGL Profiler to get through the sandbox
859         https://bugs.webkit.org/show_bug.cgi?id=127877
860         <rdar://problem/14817250>
861         <rdar://problem/14271180>
862
863         Reviewed by Alexey Proskuryakov.
864
865         Open up the sandbox for WebProcess and PluginProcess so
866         that OpenGL.framework can create a mach port for communication
867         with the OpenGL Profiler.
868
869         * Resources/PlugInSandboxProfiles/com.apple.WebKit.plugin-common.sb:
870         * WebProcess/com.apple.WebProcess.sb.in:
871
872 2014-01-30  Anders Carlsson  <andersca@apple.com>
873
874         Begin fleshing out the navigation delegate
875         https://bugs.webkit.org/show_bug.cgi?id=127939
876
877         Reviewed by Dan Bernstein.
878
879         * UIProcess/API/APIPolicyClient.h:
880         (API::PolicyClient::decidePolicyForNavigationAction):
881         Pass the listener as a RefPtr.
882
883         * UIProcess/API/C/WKPage.cpp:
884         (WKPageSetPagePolicyClient):
885         Update for API::PolicyClient changes.
886
887         * UIProcess/API/Cocoa/WKNavigationDelegate.h:
888         Add new delegate.
889
890         * UIProcess/API/Cocoa/WKWebView.mm:
891         (-[WKWebView initWithFrame:configuration:]):
892         Set a policy client on the page.
893
894         * UIProcess/Cocoa/NavigationState.h:
895         Add a new PolicyClient class.
896
897         * UIProcess/Cocoa/NavigationState.mm:
898         (WebKit::NavigationState::NavigationState):
899         Initialize m_navigationDelegateMethods.
900
901         (WebKit::NavigationState::navigationDelegate):
902         m_delegate was renamed to m_navigationDelegate.
903
904         (WebKit::NavigationState::setNavigationDelegate):
905         Update m_navigationDelegateMethods.webViewDecidePolicyForNavigationActionDecisionHandler.
906         
907         (WebKit::NavigationState::createPolicyClient):
908         New helper function for creating a new policy client.
909
910         (WebKit::NavigationState::PolicyClient::decidePolicyForNavigationAction):
911         Call the navigation delegate method.
912
913         * UIProcess/WebPageProxy.cpp:
914         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
915         Use std::move to hand off the listener to the client.
916
917 2014-01-30  Jeremy Jones  <jeremyj@apple.com>
918
919         Crash in RemoteLayerBackingStore::encode when m_frontBuffer is nullptr.
920         https://bugs.webkit.org/show_bug.cgi?id=127756
921
922         Reviewed by Jer Noble.
923
924         Don't encode RemoteLayerBackingStore when it has no front buffer.
925
926         * Shared/mac/RemoteLayerBackingStore.h:
927         (WebKit::RemoteLayerBackingStore::hasFrontBuffer):
928         * Shared/mac/RemoteLayerTreeTransaction.mm:
929         (WebKit::RemoteLayerTreeTransaction::LayerProperties::encode):
930         (WebKit::RemoteLayerTreeTransaction::LayerProperties::decode):
931
932 2014-01-30  Mark Rowe  <mrowe@apple.com>
933
934         Host plug-ins in XPC services
935         <https://webkit.org/b/127897> / <rdar://problem/13675955>
936
937         We disabled use of XPC services for plug-ins back in r143829 as the per-architecture services
938         were not being built for the appropriate architectures. Fixing that allows us to reenable them.
939
940         Reviewed by Anders Carlsson.
941
942         * Configurations/PluginService.32.xcconfig: Use VALID_ARCHS to restrict the service
943         to building for i386-only in production builds. Non-production builds allow building
944         for all standard architectures to ensure that Xcode will be able to build this target.
945         The exact architecture used isn't a concern for non-production builds since we'll use
946         the development version of the service anyway.
947         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
948         (WebKit::shouldUseXPC): Remove the workaround that disables use of the XPC services.
949
950 2014-01-30  Anders Carlsson  <andersca@apple.com>
951
952         Add WKNavigationDelegate class
953         https://bugs.webkit.org/show_bug.cgi?id=127927
954
955         Reviewed by Dan Bernstein.
956
957         * UIProcess/API/Cocoa/WKNavigationDelegate.h: Copied from Source/WebKit2/UIProcess/Cocoa/NavigationState.h.
958         * UIProcess/API/Cocoa/WKWebView.h:
959         * UIProcess/API/Cocoa/WKWebView.mm:
960         (-[WKWebView navigationDelegate]):
961         (-[WKWebView setNavigationDelegate:]):
962         * UIProcess/Cocoa/NavigationState.h:
963         * UIProcess/Cocoa/NavigationState.mm:
964         (WebKit::NavigationState::navigationDelegate):
965         (WebKit::NavigationState::setNavigationDelegate):
966         * WebKit2.xcodeproj/project.pbxproj:
967
968 2014-01-30  Tim Horton  <timothy_horton@apple.com>
969
970         WebKit2 View Gestures (Swipe): Provide a way for clients to provide views to swipe
971         https://bugs.webkit.org/show_bug.cgi?id=127891
972         <rdar://problem/15931413>
973
974         Reviewed by Anders Carlsson.
975
976         * UIProcess/API/Cocoa/WKViewPrivate.h: Add the SPI.
977
978         * UIProcess/API/ios/PageClientImplIOS.h:
979         * UIProcess/API/ios/PageClientImplIOS.mm:
980         (WebKit::PageClientImpl::clearCustomSwipeViews):
981         * UIProcess/API/mac/PageClientImpl.h:
982         * UIProcess/API/mac/PageClientImpl.mm:
983         (WebKit::PageClientImpl::clearCustomSwipeViews):
984         * UIProcess/PageClient.h:
985         Plumb clearCustomSwipeViews() so that WebPageProxy can clear
986         ViewGestureController's list of custom views when the current
987         back-forward item changes.
988
989         * UIProcess/API/mac/WKView.mm:
990         (-[WKView _takeViewSnapshot]):
991         If we have custom swipe views, use the union of their bounds as the snapshot region.
992
993         (-[WKView _setCustomSwipeViews:]):
994         Forward along to ViewGestureController.
995
996         * UIProcess/WebPageProxy.cpp:
997         (WebKit::WebPageProxy::didChangeBackForwardList):
998         When the current back forward list item changes, clear the custom swipe views.
999
1000         * UIProcess/mac/ViewGestureController.h:
1001         (WebKit::ViewGestureController::setCustomSwipeViews):
1002         (WebKit::ViewGestureController::customSwipeViews):
1003         * UIProcess/mac/ViewGestureController.mm:
1004         (WebKit::ViewGestureController::windowRelativeBoundsForCustomSwipeViews):
1005         Compute the union of the custom swipe view bounds in the window's coordinate space.
1006
1007         (WebKit::ViewGestureController::beginSwipeGesture):
1008         Store the layers we'll be swiping as the "live" layers in m_currentSwipeLiveLayers.
1009         Don't set a shadow (yet) if we have custom swipe views, because it's not clear where to put it.
1010
1011         (WebKit::ViewGestureController::handleSwipeGesture):
1012         Compute the swipe distance ('width') based on the union of the custom views bounds if needed.
1013         Update the transform of all of the live layers. We use transform instead of position now
1014         so that clients can set the position (having an identity transform is one of the SPI caveats).
1015
1016         (WebKit::ViewGestureController::removeSwipeSnapshot):
1017         Reset the transform on all of the live layers.
1018         Clear the list of live layers.
1019
1020 2014-01-30  Brady Eidson  <beidson@apple.com>
1021
1022         IDB: Add no-op plumbing for deleteDatabase and deleteRange
1023         https://bugs.webkit.org/show_bug.cgi?id=127912
1024
1025         Reviewed by Alexey Proskuryakov.
1026
1027         Forward the calls to the DatabaseProcess, and handle completion from the DatabaseProcess:
1028         * WebProcess/Databases/IndexedDB/WebIDBServerConnection.cpp:
1029         (WebKit::WebIDBServerConnection::deleteDatabase):
1030         (WebKit::WebIDBServerConnection::didDeleteDatabase):
1031         (WebKit::WebIDBServerConnection::deleteRange):
1032         (WebKit::WebIDBServerConnection::didDeleteRange):
1033         * WebProcess/Databases/IndexedDB/WebIDBServerConnection.h:
1034         * WebProcess/Databases/IndexedDB/WebIDBServerConnection.messages.in:
1035
1036         Stub out deleteDatabase, and forward deleteRange to the appropriate UniqueIDBDatabase:
1037         * DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.cpp:
1038         (WebKit::DatabaseProcessIDBConnection::deleteDatabase):
1039         (WebKit::DatabaseProcessIDBConnection::deleteRange):
1040         * DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.h:
1041         * DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.messages.in:
1042
1043         Forward the request to the backing store thread, and handle the response from that thread:
1044         * DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:
1045         (WebKit::UniqueIDBDatabase::deleteRange):
1046         (WebKit::UniqueIDBDatabase::deleteRangeInBackingStore):
1047         (WebKit::UniqueIDBDatabase::didDeleteRangeInBackingStore):
1048         * DatabaseProcess/IndexedDB/UniqueIDBDatabase.h:
1049
1050 2014-01-30  Antti Koivisto  <antti@apple.com>
1051
1052         WebPage::determinePrimarySnapshottedPlugIn is slow
1053         https://bugs.webkit.org/show_bug.cgi?id=127905
1054
1055         Reviewed by Anders Carlsson.
1056         
1057         PLT before:
1058         132.0ms  0.8% 0,0   WebKit::WebPage::determinePrimarySnapshottedPlugIn()
1059         130.0ms  0.8% 0,0    WebCore::RenderView::hitTest(WebCore::HitTestRequest const&, WebCore::HitTestResult&)
1060         
1061         After:
1062         7.0ms    0.0% 0,0   WebKit::WebPage::determinePrimarySnapshottedPlugIn()
1063         3.0ms    0.0% 0,0    WebCore::RenderView::hitTest(WebCore::HitTestRequest const&, WebCore::HitTestResult&)
1064
1065         * WebProcess/WebPage/WebPage.cpp:
1066         (WebKit::WebPage::determinePrimarySnapshottedPlugIn):
1067         
1068             Instead of shotgunning the page with hit tests, do a DOM crawl for plugins
1069             and hit test the centers.
1070
1071 2014-01-30  Andrei Bucur  <abucur@adobe.com>
1072
1073         Remove the ACCELERATED_COMPOSITING flag
1074         https://bugs.webkit.org/show_bug.cgi?id=127833
1075
1076         Reviewed by Antti Koivisto.
1077
1078         Remove the USE(ACCELERATED_COMPOSITING) conditionals from the code base and make AC
1079         mandatory.
1080
1081         * PluginProcess/PluginControllerProxy.cpp:
1082         (WebKit::PluginControllerProxy::PluginControllerProxy):
1083         * PluginProcess/PluginCreationParameters.cpp:
1084         (WebKit::PluginCreationParameters::PluginCreationParameters):
1085         (WebKit::PluginCreationParameters::encode):
1086         (WebKit::PluginCreationParameters::decode):
1087         * PluginProcess/PluginCreationParameters.h:
1088         * PluginProcess/PluginProcess.h:
1089         * Shared/WebRenderLayer.cpp:
1090         (WebKit::WebRenderLayer::WebRenderLayer):
1091         * Shared/mac/RemoteLayerBackingStore.h:
1092         * Shared/mac/RemoteLayerBackingStore.mm:
1093         (RemoteLayerBackingStore::enumerateRectsBeingDrawn):
1094         * UIProcess/API/efl/EvasGLContext.cpp:
1095         * UIProcess/API/efl/EvasGLContext.h:
1096         * UIProcess/API/efl/EvasGLSurface.cpp:
1097         * UIProcess/API/efl/EvasGLSurface.h:
1098         * UIProcess/API/efl/EwkView.cpp:
1099         (EwkView::EwkView):
1100         (EwkView::displayTimerFired):
1101         (EwkView::createGLSurface):
1102         (EwkView::handleEvasObjectCalculate):
1103         (EwkView::handleEvasObjectShow):
1104         (EwkView::takeSnapshot):
1105         * UIProcess/API/efl/EwkView.h:
1106         * UIProcess/API/efl/SnapshotImageGL.cpp:
1107         (getImageSurfaceFromFrameBuffer):
1108         * UIProcess/API/efl/SnapshotImageGL.h:
1109         * UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestBase.cpp:
1110         (EWK2UnitTest::EWK2UnitTestBase::SetUp):
1111         * UIProcess/API/gtk/PageClientImpl.cpp:
1112         (WebKit::PageClientImpl::updateAcceleratedCompositingMode):
1113         * UIProcess/API/gtk/PageClientImpl.h:
1114         * UIProcess/API/ios/PageClientImplIOS.h:
1115         * UIProcess/API/ios/PageClientImplIOS.mm:
1116         (WebKit::PageClientImpl::acceleratedCompositingRootLayer):
1117         * UIProcess/CoordinatedGraphics/CoordinatedDrawingAreaProxy.cpp:
1118         (WebKit::CoordinatedDrawingAreaProxy::~CoordinatedDrawingAreaProxy):
1119         (WebKit::CoordinatedDrawingAreaProxy::visibilityDidChange):
1120         (WebKit::CoordinatedDrawingAreaProxy::didUpdateBackingStoreState):
1121         (WebKit::CoordinatedDrawingAreaProxy::enterAcceleratedCompositingMode):
1122         (WebKit::CoordinatedDrawingAreaProxy::exitAcceleratedCompositingMode):
1123         (WebKit::CoordinatedDrawingAreaProxy::updateAcceleratedCompositingMode):
1124         (WebKit::CoordinatedDrawingAreaProxy::sendUpdateBackingStoreState):
1125         (WebKit::CoordinatedDrawingAreaProxy::waitForAndDispatchDidUpdateBackingStoreState):
1126         * UIProcess/CoordinatedGraphics/CoordinatedDrawingAreaProxy.h:
1127         * UIProcess/CoordinatedGraphics/PageViewportController.cpp:
1128         * UIProcess/CoordinatedGraphics/PageViewportController.h:
1129         * UIProcess/CoordinatedGraphics/WebView.cpp:
1130         (WebKit::WebView::setVisible):
1131         * UIProcess/DrawingAreaProxy.h:
1132         * UIProcess/DrawingAreaProxy.messages.in:
1133         * UIProcess/DrawingAreaProxyImpl.cpp:
1134         (WebKit::DrawingAreaProxyImpl::~DrawingAreaProxyImpl):
1135         (WebKit::DrawingAreaProxyImpl::didUpdateBackingStoreState):
1136         (WebKit::DrawingAreaProxyImpl::enterAcceleratedCompositingMode):
1137         (WebKit::DrawingAreaProxyImpl::exitAcceleratedCompositingMode):
1138         (WebKit::DrawingAreaProxyImpl::updateAcceleratedCompositingMode):
1139         (WebKit::DrawingAreaProxyImpl::sendUpdateBackingStoreState):
1140         (WebKit::DrawingAreaProxyImpl::waitForAndDispatchDidUpdateBackingStoreState):
1141         * UIProcess/DrawingAreaProxyImpl.h:
1142         * UIProcess/PageClient.h:
1143         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
1144         (WebKit::PluginProcessProxy::platformInitializePluginProcess):
1145         * UIProcess/WebPageProxy.cpp:
1146         (WebKit::WebPageProxy::updateAcceleratedCompositingMode):
1147         * UIProcess/WebPageProxy.h:
1148         * UIProcess/efl/PageLoadClientEfl.cpp:
1149         (WebKit::PageLoadClientEfl::didCommitLoadForFrame):
1150         * UIProcess/efl/PageViewportControllerClientEfl.cpp:
1151         * UIProcess/efl/ViewClientEfl.cpp:
1152         (WebKit::ViewClientEfl::didChangeContentsSize):
1153         (WebKit::ViewClientEfl::didChangeContentsPosition):
1154         (WebKit::ViewClientEfl::didRenderFrame):
1155         (WebKit::ViewClientEfl::didCompletePageTransition):
1156         (WebKit::ViewClientEfl::didChangeViewportAttributes):
1157         * UIProcess/mac/WebContextMac.mm:
1158         (WebKit::WebContext::platformInitializeWebProcess):
1159         * WebProcess/FullScreen/WebFullScreenManager.cpp:
1160         (WebKit::screenRectOfContents):
1161         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
1162         (WebKit::NetscapePlugin::isAcceleratedCompositingEnabled):
1163         * WebProcess/Plugins/PluginController.h:
1164         * WebProcess/Plugins/PluginProxy.cpp:
1165         (WebKit::PluginProxy::initialize):
1166         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1167         (WebKit::WebChromeClient::layerTreeStateIsFrozen):
1168         * WebProcess/WebCoreSupport/WebChromeClient.h:
1169         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.cpp:
1170         (WebKit::CoordinatedDrawingArea::layerHostDidFlushLayers):
1171         (WebKit::CoordinatedDrawingArea::scheduleCompositingLayerFlush):
1172         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.h:
1173         * WebProcess/WebPage/DrawingArea.h:
1174         * WebProcess/WebPage/DrawingAreaImpl.cpp:
1175         (WebKit::DrawingAreaImpl::layerHostDidFlushLayers):
1176         (WebKit::DrawingAreaImpl::scheduleCompositingLayerFlush):
1177         (WebKit::DrawingAreaImpl::exitAcceleratedCompositingMode):
1178         * WebProcess/WebPage/DrawingAreaImpl.h:
1179         * WebProcess/WebPage/WebPage.cpp:
1180         (WebKit::WebPage::exitAcceleratedCompositingMode):
1181         (WebKit::WebPage::mainFrameDidLayout):
1182         (WebKit::WebPage::didReceiveMessage):
1183         * WebProcess/WebPage/WebPage.h:
1184         * WebProcess/WebPage/mac/GraphicsLayerCARemote.cpp:
1185         * WebProcess/WebPage/mac/GraphicsLayerCARemote.h:
1186         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
1187         (PlatformCALayerRemote::hostingContextID):
1188         * WebProcess/WebPage/mac/PlatformCALayerRemote.h:
1189         * WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.h:
1190         * WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.mm:
1191         (PlatformCALayerRemoteCustom::hostingContextID):
1192         * WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.cpp:
1193         (PlatformCALayerRemoteTiledBacking::setBorderColor):
1194         * WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.h:
1195         * WebProcess/WebProcess.cpp:
1196         (WebKit::WebProcess::WebProcess):
1197         * WebProcess/WebProcess.h:
1198
1199 2014-01-30  Brady Eidson  <beidson@apple.com>
1200
1201         IDB: Key generator support
1202         https://bugs.webkit.org/show_bug.cgi?id=127871
1203
1204         Reviewed by Tim Horton.
1205
1206         * DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:
1207         (WebKit::UniqueIDBDatabase::putRecordInBackingStore): Update for storing/retrieving integers instead of IDBKeys.
1208         * DatabaseProcess/IndexedDB/UniqueIDBDatabaseBackingStore.h:
1209
1210         * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp:
1211         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::createAndPopulateInitialMetadata): Create a keygen table.
1212         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::createObjectStore): Put a record in the keygen table for
1213           this object store if necessary.
1214         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::deleteObjectStore): Delete the entry in the keygen table.
1215         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::generateKeyNumber): Pull the current number from the table.
1216         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::updateKeyGeneratorNumber): Update the number in the table.
1217         * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.h:
1218
1219         * WebProcess/Databases/IndexedDB/WebIDBServerConnection.cpp:
1220         (WebKit::WebIDBServerConnection::put): Null keys are acceptable for autoIncrement object stores.
1221
1222 2014-01-30  Brady Eidson  <beidson@apple.com>
1223
1224         IDB: Implement IDBObjectStore.count()
1225         https://bugs.webkit.org/show_bug.cgi?id=127888
1226
1227         Reviewed by Tim Horton.
1228
1229         Forward request to the DatabaseProcess, and handle its completion:
1230         * WebProcess/Databases/IndexedDB/WebIDBServerConnection.cpp:
1231         (WebKit::WebIDBServerConnection::count):
1232         (WebKit::WebIDBServerConnection::didCount):
1233         * WebProcess/Databases/IndexedDB/WebIDBServerConnection.h:
1234         * WebProcess/Databases/IndexedDB/WebIDBServerConnection.messages.in:
1235
1236         Pass request along to the appropriate UniqueIDBDatabase:
1237         * DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.cpp:
1238         (WebKit::DatabaseProcessIDBConnection::count):
1239         * DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.h:
1240         * DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.messages.in:
1241
1242         Pass request to backing store thread, then pass it back to the WebProcess:
1243         * DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:
1244         (WebKit::UniqueIDBDatabase::count):
1245         (WebKit::UniqueIDBDatabase::countInBackingStore):
1246         (WebKit::UniqueIDBDatabase::didCountInBackingStore):
1247         * DatabaseProcess/IndexedDB/UniqueIDBDatabase.h:
1248
1249         * Shared/AsyncTask.h:
1250         (WebKit::createAsyncTask):
1251
1252 2014-01-29  Carlos Garcia Campos  <cgarcia@igalia.com>
1253
1254         Unreviewed. Fix the GTK+ build after r163037.
1255
1256         * UIProcess/API/gtk/WebKitWebView.cpp:
1257         (webkit_web_view_load_uri):
1258         (webkit_web_view_load_request):
1259
1260 2014-01-29  Csaba Osztrogonác  <ossy@webkit.org>
1261
1262         Remove ENABLE(JAVASCRIPT_DEBUGGER) leftovers
1263         https://bugs.webkit.org/show_bug.cgi?id=127845
1264
1265         Reviewed by Joseph Pecoraro.
1266
1267         * Configurations/FeatureDefines.xcconfig:
1268
1269 2014-01-29  Dan Bernstein  <mitz@apple.com>
1270
1271         Moved linking against common frameworks and a library from the .xcconfig file into the target.
1272
1273         Reviewed by Tim Horton.
1274
1275         * Configurations/WebKit2.xcconfig:
1276         * WebKit2.xcodeproj/project.pbxproj:
1277
1278 2014-01-29  Anders Carlsson  <andersca@apple.com>
1279
1280         Fix 32-bit build.
1281
1282         * UIProcess/Cocoa/NavigationState.h:
1283         * UIProcess/Cocoa/NavigationState.mm:
1284
1285 2014-01-29  Anders Carlsson  <andersca@apple.com>
1286
1287         Add a NavigationState object to keep track of the navigations for a given page
1288         https://bugs.webkit.org/show_bug.cgi?id=127884
1289
1290         Reviewed by Sam Weinig.
1291
1292         * UIProcess/API/Cocoa/WKNavigation.mm:
1293         (-[WKNavigation request]):
1294         (-[WKNavigation setRequest:]):
1295         * UIProcess/API/Cocoa/WKNavigationInternal.h:
1296         * UIProcess/API/Cocoa/WKWebView.mm:
1297         (-[WKWebView initWithFrame:configuration:]):
1298         (-[WKWebView loadRequest:]):
1299         * UIProcess/Cocoa/NavigationState.h: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKNavigation.mm.
1300         * UIProcess/Cocoa/NavigationState.mm: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKNavigation.mm.
1301         (WebKit::NavigationState::NavigationState):
1302         (WebKit::NavigationState::~NavigationState):
1303         (WebKit::NavigationState::createLoadRequestNavigation):
1304         * UIProcess/WebPageProxy.cpp:
1305         (WebKit::WebPageProxy::loadRequest):
1306         * UIProcess/WebPageProxy.h:
1307         * WebKit2.xcodeproj/project.pbxproj:
1308
1309 2014-01-29  Gavin Barraclough  <barraclough@apple.com>
1310
1311         Add IsVisibleOrOccluded to ViewState
1312         https://bugs.webkit.org/show_bug.cgi?id=127875
1313
1314         Reviewed by Anders Carlsson.
1315
1316         When the WKView associated with a plugin becomes occluded
1317         we tell the plugin it is no longer visible. This is a problem
1318         if the plugin is being occluded by its own fullscreen window.
1319
1320         Instead, consider plugins to be visible any time they are in
1321         a visible window – i.e. when they are visible or occluded.
1322
1323         * UIProcess/API/mac/PageClientImpl.h:
1324         * UIProcess/API/mac/PageClientImpl.mm:
1325         (WebKit::PageClientImpl::isViewVisibleOrOccluded):
1326         * UIProcess/PageClient.h:
1327         (WebKit::PageClient::isViewVisibleOrOccluded):
1328             - added isViewVisibleOrOccluded.
1329         * UIProcess/WebPageProxy.cpp:
1330         (WebKit::WebPageProxy::updateViewState):
1331             - update IsVisibleOrOccluded.
1332         (WebKit::WebPageProxy::viewStateDidChange):
1333             - when updating IsVisible also update IsVisibleOrOccluded.
1334         * WebProcess/Plugins/PluginView.cpp:
1335         (WebKit::PluginView::platformViewStateDidChange):
1336             - use isVisibleOrOccluded to determine plugin visibility.
1337         * WebProcess/WebPage/WebPage.h:
1338         (WebKit::WebPage::isVisibleOrOccluded):
1339             - accessor.
1340
1341 2014-01-29  Anders Carlsson  <andersca@apple.com>
1342
1343         Pass navigation IDs along to LoadRequest and Reload
1344         https://bugs.webkit.org/show_bug.cgi?id=127883
1345
1346         Reviewed by Sam Weinig.
1347
1348         * UIProcess/WebPageProxy.cpp:
1349         (WebKit::WebPageProxy::WebPageProxy):
1350         (WebKit::WebPageProxy::loadRequest):
1351         (WebKit::WebPageProxy::loadFile):
1352         (WebKit::WebPageProxy::reload):
1353         (WebKit::WebPageProxy::generateNavigationID):
1354         * UIProcess/WebPageProxy.h:
1355         * WebProcess/WebPage/WebDocumentLoader.cpp:
1356         (WebKit::WebDocumentLoader::setNavigationID):
1357         * WebProcess/WebPage/WebPage.cpp:
1358         (WebKit::WebPage::WebPage):
1359         (WebKit::WebPage::loadRequest):
1360         (WebKit::WebPage::reload):
1361         (WebKit::WebPage::createDocumentLoader):
1362         * WebProcess/WebPage/WebPage.h:
1363         * WebProcess/WebPage/WebPage.messages.in:
1364
1365 2014-01-29  Anders Carlsson  <andersca@apple.com>
1366
1367         -[WKWebView loadRequest:] should return a WKNavigation
1368         https://bugs.webkit.org/show_bug.cgi?id=127873
1369
1370         Reviewed by Dan Bernstein.
1371
1372         For now this just returns a dummy navigation.
1373
1374         * UIProcess/API/Cocoa/WKNavigation.h:
1375         * UIProcess/API/Cocoa/WKNavigation.mm:
1376         (-[WKNavigation initWithRequest:]):
1377         (-[WKNavigation request]):
1378         * UIProcess/API/Cocoa/WKNavigationInternal.h: Added.
1379         * UIProcess/API/Cocoa/WKWebView.h:
1380         * UIProcess/API/Cocoa/WKWebView.mm:
1381         (-[WKWebView loadRequest:]):
1382         * WebKit2.xcodeproj/project.pbxproj:
1383
1384 2014-01-29  Anders Carlsson  <andersca@apple.com>
1385
1386         
1387
1388         * UIProcess/API/C/WKPage.cpp:
1389         (WKPageLoadURL):
1390         Don't use the resource request constructor that takes a String.
1391
1392 2014-01-29  Brady Eidson  <beidson@apple.com>
1393
1394         IDB: Fully implement IDBKeyData encoding/decoding
1395         https://bugs.webkit.org/show_bug.cgi?id=127863
1396
1397         Rubberstamped by Alexey Proskuryakov.
1398
1399         Handle invalid buffers, and pass IDBKeyData decoding along:
1400         * DatabaseProcess/IndexedDB/IDBSerialization.cpp:
1401         (WebKit::deserializeIDBKeyPath):
1402         (WebKit::serializeIDBKeyData):
1403         (WebKit::deserializeIDBKeyData):
1404         * DatabaseProcess/IndexedDB/IDBSerialization.h:
1405
1406         Implement decodeBool and decodeDouble:
1407         * Shared/cf/KeyedDecoder.cpp:
1408         (WebKit::KeyedDecoder::decodeBool):
1409         (WebKit::KeyedDecoder::decodeDouble):
1410         * Shared/cf/KeyedDecoder.h:
1411
1412 2014-01-29  Tim Horton  <timothy_horton@apple.com>
1413
1414         WebKit2 View Gestures (Swipe): Update rubberBandsAt{Left,Right} when WebKit swipe is enabled
1415         https://bugs.webkit.org/show_bug.cgi?id=127855
1416         <rdar://problem/15933878>
1417
1418         Reviewed by Anders Carlsson.
1419
1420         * UIProcess/API/mac/WKView.mm:
1421         (-[WKView setAllowsBackForwardNavigationGestures:]):
1422         Enable implicit control of rubberbanding when using WebKit2's swipe implementation.
1423
1424         * UIProcess/WebPageProxy.cpp:
1425         (WebKit::WebPageProxy::WebPageProxy):
1426         (WebKit::WebPageProxy::sendWheelEvent):
1427         * UIProcess/WebPageProxy.h:
1428         (WebKit::WebPageProxy::setShouldUseImplicitRubberBandControl):
1429         (WebKit::WebPageProxy::shouldUseImplicitRubberBandControl):
1430         Rename away from "legacy" name, since we're using it on purpose now.
1431
1432         * UIProcess/mac/WebPageProxyMac.mm:
1433         (WebKit::expectsLegacyImplicitRubberBandControl):
1434         (WebKit::WebPageProxy::platformInitialize):
1435         Since NSVersionOfLinkTimeLibrary doesn't work for applications that
1436         don't link directly against the library (like Safari), let's explicitly
1437         check if Safari is expecting the legacy behavior, otherwise using
1438         the linked version of WebKit2, but using the new behavior if we can't
1439         determine the linked version of WebKit2 and are not Safari.
1440
1441 2014-01-29  Anders Carlsson  <andersca@apple.com>
1442
1443         Make WKWebView limp along on OS X
1444         https://bugs.webkit.org/show_bug.cgi?id=127857
1445
1446         Reviewed by Tim Horton.
1447
1448         On Mac, create a WKView and add it as a subview of the WKWebVew so we'll actually get something
1449         on screen when creating a WKWebView.
1450
1451         * UIProcess/API/Cocoa/WKWebView.mm:
1452         (-[WKWebView initWithFrame:configuration:]):
1453         Create a WKView.
1454
1455         (-[WKWebView resizeSubviewsWithOldSize:]):
1456         Resize the WKView.
1457
1458         * UIProcess/API/mac/WKView.mm:
1459         (-[WKView initWithFrame:configuration:]):
1460         Add new initializer.
1461
1462         * UIProcess/API/mac/WKViewInternal.h:
1463         Use a class extension for internal methods and add the new initializer.
1464
1465 2014-01-29  Brady Eidson  <beidson@apple.com>
1466
1467         IDB: Opening an existing database is broken
1468         https://bugs.webkit.org/show_bug.cgi?id=127851
1469
1470         Reviewed by Tim Hatcher.
1471
1472         * DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:
1473         (WebKit::UniqueIDBDatabase::getOrEstablishIDBDatabaseMetadata): Save the request to get metadata
1474           to the set before posting the task to the thread.
1475         * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp:
1476         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::extractExistingMetadata): Actually save the retrieved
1477           object store metadata to the database metadata.
1478
1479 2014-01-29  Anders Carlsson  <andersca@apple.com>
1480
1481         Consolidate page loading functions
1482         https://bugs.webkit.org/show_bug.cgi?id=127847
1483
1484         Reviewed by Tim Horton.
1485
1486         Get rid of the loadURL functions (and the LoadURL message), rename
1487         loadURLRequest to loadRequest and change it to take a ResourceRequest instead
1488         of an API::URLRequest.
1489
1490         * UIProcess/API/C/WKPage.cpp:
1491         (WKPageLoadURL):
1492         (WKPageLoadURLWithUserData):
1493         (WKPageLoadURLRequest):
1494         (WKPageLoadURLRequestWithUserData):
1495         * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
1496         (-[WKBrowsingContextController loadRequest:userData:]):
1497         * UIProcess/API/Cocoa/WKWebView.mm:
1498         (-[WKWebView loadRequest:]):
1499         * UIProcess/WebInspectorProxy.cpp:
1500         (WebKit::decidePolicyForNavigationAction):
1501         (WebKit::WebInspectorProxy::createInspectorPage):
1502         * UIProcess/WebPageProxy.cpp:
1503         (WebKit::WebPageProxy::loadRequest):
1504         (WebKit::WebPageProxy::loadFile):
1505         * UIProcess/WebPageProxy.h:
1506         * UIProcess/cf/WebPageProxyCF.cpp:
1507         (WebKit::WebPageProxy::restoreFromSessionStateData):
1508         * WebProcess/WebPage/WebPage.cpp:
1509         (WebKit::WebPage::loadRequest):
1510         * WebProcess/WebPage/WebPage.h:
1511         * WebProcess/WebPage/WebPage.messages.in:
1512
1513 2014-01-29  Martin Robinson  <mrobinson@igalia.com>
1514
1515         [GTK] [CMake] Fix the build after r162835
1516         https://bugs.webkit.org/show_bug.cgi?id=127753
1517
1518         Reviewed by Gustavo Noronha Silva.
1519
1520         * CMakeLists.txt: Add support for using the prefix header (GCC / clang only for now)
1521         when WebKit2_USE_PREFIX_HEADER is set to true.
1522         * PlatformGTK.cmake: Set WebKit2_USE_PREFIX_HEADER support and no longer process some message.in files.
1523         * WebKit2Prefix.h: Add support for the CMake GTK+ build.
1524
1525 2014-01-29  Csaba Osztrogonác  <ossy@webkit.org>
1526
1527         Remove ENABLE(JAVASCRIPT_DEBUGGER) guards
1528         https://bugs.webkit.org/show_bug.cgi?id=127840
1529
1530         Reviewed by Mark Lam.
1531
1532         * WebProcess/WebPage/WebInspector.cpp:
1533         (WebKit::WebInspector::startJavaScriptDebugging):
1534         (WebKit::WebInspector::stopJavaScriptDebugging):
1535         (WebKit::WebInspector::setJavaScriptProfilingEnabled):
1536         (WebKit::WebInspector::startJavaScriptProfiling):
1537         (WebKit::WebInspector::stopJavaScriptProfiling):
1538
1539 2014-01-29  Brady Eidson  <beidson@apple.com>
1540
1541         IDB: Serialize IDBKeyDatas to disk, not IDBKeys
1542         https://bugs.webkit.org/show_bug.cgi?id=127829
1543
1544         Reviewed by Tim Horton.
1545
1546         Serialize IDBKeyDatas, not IDBKeys.
1547
1548         * DatabaseProcess/IndexedDB/IDBSerialization.cpp:
1549         (WebKit::deserializeIDBKeyPath):
1550         (WebKit::serializeIDBKeyData):
1551         * DatabaseProcess/IndexedDB/IDBSerialization.h:
1552
1553         * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp:
1554         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::extractExistingMetadata):
1555         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::putRecord):
1556         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::getKeyRecordFromObjectStore):
1557         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::getKeyRangeRecordFromObjectStore):
1558
1559 2014-01-29  Carlos Garcia Campos  <cgarcia@igalia.com>
1560
1561         Unreviewed. Fix GTK+ build after r162981.
1562
1563         * GNUmakefile.list.am: Add WebProcess/WebPage/WebDocumentLoader to
1564         the compilation.
1565
1566 2014-01-29  Carlos Garcia Campos  <cgarcia@igalia.com>
1567
1568         Unreviewed. Actually fix the GTK+ build after r162967.
1569
1570         * UIProcess/API/gtk/WebKitWebView.cpp:
1571         (webkit_web_view_can_go_back):
1572         (webkit_web_view_can_go_forward):
1573
1574 2014-01-28  Zan Dobersek  <zdobersek@igalia.com>
1575
1576         Unreviewed followup to r163006. That change incorrectly modified
1577         webkit_web_view_go_forward when webkit_web_view_can_go_forward needed fixing.
1578
1579         * UIProcess/API/gtk/WebKitWebView.cpp:
1580         (webkit_web_view_go_forward):
1581         (webkit_web_view_can_go_forward):
1582
1583 2014-01-28  Zan Dobersek  <zdobersek@igalia.com>
1584
1585         Unreviewed GTK build fix after r162967.
1586
1587         * UIProcess/API/gtk/WebKitWebView.cpp:
1588         (webkit_web_view_can_go_back):
1589         (webkit_web_view_go_forward):
1590
1591 2014-01-28  Tim Horton  <timothy_horton@apple.com>
1592
1593         Crashes in ViewGestureController::wheelEventWasNotHandledByWebCore
1594         https://bugs.webkit.org/show_bug.cgi?id=127828
1595         <rdar://problem/15932902>
1596
1597         Reviewed by Dan Bernstein.
1598
1599         * UIProcess/API/mac/WKView.mm:
1600         (-[WKView _wheelEventWasNotHandledByWebCore:]):
1601         Null check. ViewGestureController only needs unhandled wheel events after it has been created.
1602
1603 2014-01-28  Tim Horton  <timothy_horton@apple.com>
1604
1605         Fix the Mountain Lion build if you have private headers.
1606
1607         * UIProcess/mac/ViewGestureController.mm:
1608         (WebKit::ViewGestureController::beginSwipeGesture):
1609
1610 2014-01-28  Ian Henderson  <ianh@apple.com>
1611
1612         [iOS] UI process crashes whenever web process crashes
1613         https://bugs.webkit.org/show_bug.cgi?id=127826
1614
1615         Reviewed by Tim Horton.
1616
1617         * UIProcess/API/ios/WKContentView.mm:
1618         (-[WKContentView _updateFixedPositionRect]): Null-check the drawing
1619         area before calling size() on it.
1620
1621 2014-01-28  Ian Henderson  <ianh@apple.com>
1622
1623         WKRemoteObjectCoder should support more argument types
1624         https://bugs.webkit.org/show_bug.cgi?id=127824
1625
1626         Reviewed by Anders Carlsson.
1627
1628         * Shared/API/Cocoa/WKRemoteObjectCoder.mm:
1629         (encodeInvocation): Support encoding char values.
1630         (decodeInvocationArguments): Support decoding char values.
1631
1632 2014-01-28  Ryuan Choi  <ryuan.choi@samsung.com>
1633
1634         Unreviewed build fix on the cmake based port after r162981
1635
1636         One more build fix.
1637
1638         * CMakeLists.txt: Added WebDocumentLoader.cpp
1639
1640 2014-01-28  Ryuan Choi  <ryuan.choi@samsung.com>
1641
1642         Unreviewed build fix on the EFL build after r162984
1643
1644         r162984 added wheelEventWasNotHandledByWebCore which is guarded to PLATFORM(MAC).
1645
1646         * UIProcess/WebPageProxy.cpp:
1647         (WebKit::WebPageProxy::didReceiveEvent):
1648
1649 2014-01-28  Anders Carlsson  <andersca@apple.com>
1650
1651         Fix a thinko.
1652
1653         * UIProcess/WebPageProxy.cpp:
1654         (WebKit::WebPageProxy::goBack):
1655         Remove early return if isValid() is true.
1656
1657 2014-01-28  Anders Carlsson  <andersca@apple.com>
1658
1659         WebPage should be in charge of creating document loaders
1660         https://bugs.webkit.org/show_bug.cgi?id=127818
1661
1662         Reviewed by Dan Bernstein.
1663
1664         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1665         (WebKit::WebFrameLoaderClient::createDocumentLoader):
1666         * WebProcess/WebPage/WebPage.cpp:
1667         (WebKit::WebPage::createDocumentLoader):
1668         * WebProcess/WebPage/WebPage.h:
1669
1670 2014-01-28  Carlos Alberto Lopez Perez  <clopez@igalia.com>
1671
1672         Unreviewed GTK build fix after r162951.
1673         https://bugs.webkit.org/show_bug.cgi?id=127815
1674
1675         * GNUmakefile.list.am: Adding missing build targets.
1676
1677 2014-01-28  Tim Horton  <timothy_horton@apple.com>
1678
1679         WebKit2 View Gestures (Swipe): Give WebCore the first crack at scroll events if it needs it
1680         https://bugs.webkit.org/show_bug.cgi?id=127396
1681
1682         Reviewed by Anders Carlsson.
1683
1684         * UIProcess/API/ios/PageClientImplIOS.h:
1685         * UIProcess/API/ios/PageClientImplIOS.mm:
1686         (WebKit::PageClientImpl::wheelEventWasNotHandledByWebCore):
1687         * UIProcess/API/mac/PageClientImpl.h:
1688         * UIProcess/API/mac/PageClientImpl.mm:
1689         (WebKit::PageClientImpl::wheelEventWasNotHandledByWebCore):
1690         * UIProcess/API/mac/WKView.mm:
1691         (-[WKView _wheelEventWasNotHandledByWebCore:]):
1692         * UIProcess/API/mac/WKViewInternal.h:
1693         * UIProcess/PageClient.h:
1694         * UIProcess/WebPageProxy.cpp:
1695         (WebKit::WebPageProxy::didReceiveEvent):
1696         In addition to informing the page client about un-handled wheel events,
1697         inform the ViewGestureController, in a roundabout way.
1698
1699         * UIProcess/mac/ViewGestureController.h:
1700         Add and use SwipeDirection enum instead of 'bool willSwipeLeft'.
1701
1702         * UIProcess/mac/ViewGestureController.mm:
1703         (WebKit::ViewGestureController::ViewGestureController):
1704         (WebKit::ViewGestureController::handleScrollWheelEvent):
1705         If we get a Begin scroll wheel event, any previously deferred
1706         swipes are invalid.
1707
1708         If the page has subframes or wheel handlers, defer starting the
1709         swipe until we get a wheelEventWasNotHandledByWebCore back from the WebProcess.
1710
1711         (WebKit::ViewGestureController::wheelEventWasNotHandledByWebCore):
1712         Start the swipe if the WebProcess didn't eat the event.
1713
1714         (WebKit::ViewGestureController::trackSwipeGesture):
1715         (WebKit::ViewGestureController::beginSwipeGesture):
1716         (WebKit::ViewGestureController::handleSwipeGesture):
1717         Use SwipeDirection.
1718
1719 2014-01-28  Anders Carlsson  <andersca@apple.com>
1720
1721         Fix build.
1722
1723         * WebProcess/WebPage/WebFrame.cpp:
1724
1725 2014-01-28  Anders Carlsson  <andersca@apple.com>
1726
1727         Add WebDocumentLoader, a WebCore::DocumentLoader subclass
1728         https://bugs.webkit.org/show_bug.cgi?id=127817
1729
1730         Reviewed by Tim Horton.
1731
1732         We need a place to store navigation IDs, and since they are per document loader, putting them
1733         in a DocumentLoader subclass seems like a good idea.
1734
1735         * WebKit2.xcodeproj/project.pbxproj:
1736         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1737         (WebKit::WebFrameLoaderClient::createDocumentLoader):
1738         * WebProcess/WebPage/WebDocumentLoader.cpp: Added.
1739         (WebKit::WebDocumentLoader::WebDocumentLoader):
1740         (WebKit::WebDocumentLoader::setNavigationID):
1741         * WebProcess/WebPage/WebDocumentLoader.h: Added.
1742         (WebKit::WebDocumentLoader::create):
1743         (WebKit::WebDocumentLoader::navigationID):
1744
1745 2014-01-28  Anders Carlsson  <andersca@apple.com>
1746
1747         Simplify WebFrame::isMainFrame
1748         https://bugs.webkit.org/show_bug.cgi?id=127812
1749
1750         Reviewed by Sam Weinig.
1751
1752         * WebProcess/WebPage/WebFrame.cpp:
1753         (WebKit::WebFrame::isMainFrame):
1754
1755 2014-01-28  Andy Estes  <aestes@apple.com>
1756
1757         [iOS] Set INSTALL_PATH_ACTUAL when building WebKit2 for the iOS Simulator
1758         https://bugs.webkit.org/show_bug.cgi?id=127811
1759
1760         Reviewed by Dan Bernstein.
1761
1762         * Configurations/WebKit2.xcconfig:
1763
1764 2014-01-28  Jinwoo Song  <jinwoo7.song@samsung.com>
1765
1766         Unreviewed EFL WebKit2 build fix.
1767
1768         * CMakeLists.txt: Added Shared/NavigationActionData.cpp
1769
1770 2014-01-28  Anders Carlsson  <andersca@apple.com>
1771
1772         Remove WebPageProxy::canGoBack and WebPageProxy::canGoForward
1773         https://bugs.webkit.org/show_bug.cgi?id=127803
1774
1775         Reviewed by Andreas Kling.
1776
1777         * UIProcess/API/C/WKPage.cpp:
1778         (WKPageCanGoForward):
1779         (WKPageCanGoBack):
1780         * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
1781         (-[WKBrowsingContextController canGoForward]):
1782         (-[WKBrowsingContextController canGoBack]):
1783         * UIProcess/WebPageProxy.cpp:
1784         (WebKit::WebPageProxy::goForward):
1785         (WebKit::WebPageProxy::goBack):
1786         (WebKit::WebPageProxy::sendWheelEvent):
1787         * UIProcess/WebPageProxy.h:
1788
1789 2014-01-28  Anders Carlsson  <andersca@apple.com>
1790
1791         API::PolicyClient::decidePolicyForNavigationAction should take a NavigationActionData object
1792         https://bugs.webkit.org/show_bug.cgi?id=127798
1793
1794         Reviewed by Tim Horton.
1795
1796         * UIProcess/API/APIPolicyClient.h:
1797         (API::PolicyClient::decidePolicyForNavigationAction):
1798         * UIProcess/API/C/WKPage.cpp:
1799         (WKPageSetPagePolicyClient):
1800         * UIProcess/WebPageProxy.cpp:
1801         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
1802
1803 2014-01-28  Anders Carlsson  <andersca@apple.com>
1804
1805         Add an empty WKNavigation class
1806         https://bugs.webkit.org/show_bug.cgi?id=127796
1807
1808         Reviewed by Tim Horton.
1809
1810         * UIProcess/API/Cocoa/WKNavigation.h: Added.
1811         * UIProcess/API/Cocoa/WKNavigation.mm: Added.
1812         * WebKit2.xcodeproj/project.pbxproj:
1813
1814 2014-01-28  Anders Carlsson  <andersca@apple.com>
1815
1816         Add a NavigationActionData object for easy storage of navigation action data
1817         https://bugs.webkit.org/show_bug.cgi?id=127787
1818
1819         Reviewed by Tim Horton.
1820
1821         * Scripts/webkit2/messages.py:
1822         (struct_or_class):
1823         * Shared/NavigationActionData.cpp: Added.
1824         (WebKit::NavigationActionData::NavigationActionData):
1825         (WebKit::NavigationActionData::encode):
1826         (WebKit::NavigationActionData::decode):
1827         * Shared/NavigationActionData.h: Added.
1828         * UIProcess/WebPageProxy.cpp:
1829         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
1830         (WebKit::WebPageProxy::decidePolicyForNewWindowAction):
1831         * UIProcess/WebPageProxy.h:
1832         * UIProcess/WebPageProxy.messages.in:
1833         * WebKit2.xcodeproj/project.pbxproj:
1834         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1835         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction):
1836         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
1837
1838 2014-01-28  Tim Horton  <timothy_horton@apple.com>
1839
1840         Fix the Mountain Lion build.
1841
1842         * UIProcess/mac/ViewGestureController.mm:
1843         (WebKit::ViewGestureController::beginSwipeGesture):
1844         (WebKit::ViewGestureController::removeSwipeSnapshot):
1845         * UIProcess/mac/ViewSnapshotStore.mm:
1846         (WebKit::ViewSnapshotStore::recordSnapshot):
1847
1848 2014-01-28  Tim Horton  <timothy_horton@apple.com>
1849
1850         Fix the iOS build.
1851
1852         * UIProcess/WebPageProxy.cpp:
1853         (WebKit::WebPageProxy::recordNavigationSnapshot):
1854         * UIProcess/mac/ViewSnapshotStore.h:
1855         * UIProcess/mac/ViewSnapshotStore.mm:
1856
1857 2014-01-28  Brady Eidson  <beidson@apple.com>
1858
1859         Remove unneeded “WebCore::” prefixing in two .cpp files.
1860
1861         Rubberstamped by Alexey Proskuryakov.
1862
1863         * DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:
1864         * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp:
1865
1866 2014-01-28  Tim Horton  <timothy_horton@apple.com>
1867
1868         WebKit2 View Gestures (Swipe): Snapshots should be purgeable
1869         https://bugs.webkit.org/show_bug.cgi?id=127390
1870         <rdar://problem/15876775>
1871
1872         Reviewed by Anders Carlsson.
1873
1874         Make snapshots be purgeable, and implement a straightforward
1875         (if perhaps expensive, for now) cache eviction strategy to limit the
1876         number of snapshots to 20.
1877
1878         * UIProcess/mac/ViewGestureController.mm:
1879         (WebKit::ViewGestureController::beginSwipeGesture):
1880         When beginning a gesture, attempt to make the retrieved snapshot
1881         non-volatile. If it was purged while volatile, we won't use it, but if it
1882         is still valid, we'll go ahead and use it as the swipe layer's contents.
1883
1884         (WebKit::ViewGestureController::removeSwipeSnapshot):
1885         When removing the swipe snapshot, make it volatile once again.
1886
1887         * UIProcess/mac/ViewSnapshotStore.h:
1888         Store a creation time along with the image.
1889         Store and return IOSurfaces instead of CGImages.
1890         Store snapshots and render tree sizes separately, so that we can
1891         throw away snapshots but keep the render tree sizes indefinitely.
1892
1893         * UIProcess/mac/ViewSnapshotStore.mm:
1894         (WebKit::ViewSnapshotStore::pruneSnapshots):
1895         Cap the number of snapshots we'll ever have live at 20.
1896         Enforce this cap by first trying to remove snapshots farthest
1897         from the current back-forward list's current item, falling back
1898         to removing the least recently created snapshot if there are no
1899         snapshots owned by the current back-forward list.
1900
1901         (WebKit::createIOSurfaceFromImage):
1902         Build an IOSurface from the CGImage snapshot we took, for ease of
1903         use of its purgeability API.
1904
1905         (WebKit::ViewSnapshotStore::recordSnapshot):
1906         Bail from taking the snapshot if the image is empty; this can happen
1907         if the view is out of the window when the snapshot is taken.
1908
1909         Mark snapshots as purgeable as soon as they go into the cache.
1910
1911         (WebKit::ViewSnapshotStore::snapshotAndRenderTreeSize):
1912         Return the target render tree size even if there is no snapshot image.
1913         Take care not to look up an empty UUID.
1914
1915 2014-01-27  Alexey Proskuryakov  <ap@apple.com>
1916
1917         Expose SQL database creation and modification times
1918         https://bugs.webkit.org/show_bug.cgi?id=127728
1919
1920         Reviewed by Brady Eidson.
1921
1922         * Shared/WebCoreArgumentCoders.cpp:
1923         (IPC::ArgumentCoder<DatabaseDetails>::encode):
1924         (IPC::ArgumentCoder<DatabaseDetails>::decode):
1925         Encode and decode new DatabaseDetails member variables.
1926
1927         * UIProcess/API/C/WKDatabaseManager.cpp:
1928         (WKDatabaseManagerGetDatabaseDetailsCreationTimeKey):
1929         (WKDatabaseManagerGetDatabaseDetailsModificationTimeKey):
1930         * UIProcess/API/C/WKDatabaseManager.h:
1931         Added new keys for database details.
1932
1933         * UIProcess/WebDatabaseManagerProxy.cpp:
1934         (WebKit::WebDatabaseManagerProxy::databaseDetailsCreationTimeKey):
1935         (WebKit::WebDatabaseManagerProxy::databaseDetailsModificationTimeKey):
1936         (WebKit::WebDatabaseManagerProxy::didGetDatabasesByOrigin):
1937         * UIProcess/WebDatabaseManagerProxy.h:
1938         Set the new keys if times are valid.
1939
1940 2014-01-28  Tim Horton  <timothy_horton@apple.com>
1941
1942         WebKit2 View Gestures (Swipe): Use CGSCaptureWindowsContentsToRect for now
1943         https://bugs.webkit.org/show_bug.cgi?id=127768
1944         <rdar://problem/15923662>
1945
1946         Reviewed by Simon Fraser.
1947
1948         * UIProcess/API/mac/WKView.mm:
1949         (-[WKView _takeViewSnapshot]):
1950         Until <rdar://problem/15709646> is resolved, we'll use
1951         CGSCaptureWindowsContentsToRect instead of CGWindowListCreateImage.
1952
1953 2014-01-28  Mark Rowe  <mrowe@apple.com>
1954
1955         <https://webkit.org/b/127767> Disable some deprecation warnings to fix the build.
1956
1957         Reviewed by Ryosuke Niwa.
1958
1959         * UIProcess/API/mac/WKView.mm:
1960         (-[WKView _updateWindowAndViewFrames]):
1961         * WebProcess/WebPage/mac/WKAccessibilityWebPageObject.mm:
1962
1963 2014-01-28  Adrian Perez de Castro  <aperez@igalia.com>
1964
1965         [GTK] Add API to allow setting the process model in WebKitWebContext
1966         https://bugs.webkit.org/show_bug.cgi?id=125463
1967
1968         Reviewed by Carlos Garcia Campos.
1969
1970         Implements accessors in WebKitWebContext for the process model.
1971         The default behavior is unchanged, and a single web process is
1972         used. Using WEBKIT_PROCESS_MODEL_ONE_SECONDARY_PROCESS_PER_WEB_VIEW
1973         as the process model will make use one web process for each
1974         WebKitWebView. This also enables the network process. Setting
1975         the process model must be done as early as possible, before the
1976         very first web process is spawned.
1977
1978         * UIProcess/API/gtk/WebKitWebContext.cpp:
1979         Add accessors in the API to get/set the process model.
1980         (webkit_web_context_set_process_model):
1981         (webkit_web_context_get_process_model):
1982         * UIProcess/API/gtk/WebKitWebContext.h:
1983         Define the WebKitProcessModel enum.
1984         * UIProcess/API/gtk/docs/webkit2gtk-sections.txt:
1985         Add new public API bits to the documentation.
1986
1987 2014-01-27  Carlos Garcia Campos  <cgarcia@igalia.com>
1988
1989         [GTK] Make webkit_uri_scheme_request_get_web_view() work with CustomProtocols
1990         https://bugs.webkit.org/show_bug.cgi?id=127614
1991
1992         Reviewed by Gustavo Noronha Silva.
1993
1994         * NetworkProcess/RemoteNetworkingContext.h: Remove
1995         initiatingPageID() method.
1996         * NetworkProcess/soup/RemoteNetworkingContextSoup.cpp: Ditto.
1997         * Shared/Network/CustomProtocols/soup/CustomProtocolManagerImpl.cpp:
1998         (WebKit::CustomProtocolManagerImpl::send): Create the request with
1999         the ResourceRequest constructor that receives a SoupRequest.
2000         * Shared/soup/WebCoreArgumentCodersSoup.cpp:
2001         (IPC::ArgumentCoder<ResourceRequest>::encodePlatformData): Encode initiatingPageID.
2002         (IPC::ArgumentCoder<ResourceRequest>::decodePlatformData): Decode initiatingPageID.
2003         * UIProcess/API/gtk/WebKitURISchemeRequest.cpp:
2004         (webkitURISchemeRequestCreate): Remove initiatingPageID parameter
2005         and get it from the given ResourceRequest.
2006         * UIProcess/API/gtk/WebKitURISchemeRequestPrivate.h:
2007         * UIProcess/API/gtk/WebKitWebContext.cpp:
2008         (webkitWebContextStartLoadingCustomProtocol): Update to
2009         webkitURISchemeRequestCreate API change.
2010         * WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp:
2011         (willSendRequestForFrame): Set the initiatingPageID to the ResourceRequest.
2012         * WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.cpp:
2013         (WebKit::WebFrameNetworkingContext::WebFrameNetworkingContext):
2014         Remove initiatingPageID() method.
2015         * WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.h:
2016         * WebProcess/soup/WebSoupRequestManager.cpp:
2017         (WebKit::WebSoupRequestManager::send): Get the initiatingPageID
2018         from the SoupRequest using the ResourceRequest API.
2019
2020 2014-01-27  Roger Fong  <roger_fong@apple.com>
2021
2022         WebGLLoadPolicy::WebGLAsk is an unnecessary value.
2023         https://bugs.webkit.org/show_bug.cgi?id=127755
2024
2025         Reviewed by Anders Carlsson.
2026
2027         * UIProcess/API/C/WKAPICast.h:
2028         (WebKit::toWebGLLoadPolicy):
2029         * UIProcess/API/C/WKPageLoaderClient.h:
2030
2031 2014-01-27  Brady Eidson  <beidson@apple.com>
2032
2033         IDB: Cursor support - Messaging, IPC, Threading plumbing
2034         https://bugs.webkit.org/show_bug.cgi?id=127736
2035
2036         Reviewed by Sam Weinig.
2037
2038         Pipe three cursor-related calls to the DatabaseProcess, and handle messages
2039         from the database process when it is done handling them:
2040         * WebProcess/Databases/IndexedDB/WebIDBServerConnection.cpp:
2041         (WebKit::WebIDBServerConnection::didOpenCursor):
2042         (WebKit::WebIDBServerConnection::didAdvanceCursor):
2043         (WebKit::WebIDBServerConnection::didIterateCursor):
2044         (WebKit::WebIDBServerConnection::openCursor):
2045         (WebKit::WebIDBServerConnection::cursorAdvance):
2046         (WebKit::WebIDBServerConnection::cursorIterate):
2047         * WebProcess/Databases/IndexedDB/WebIDBServerConnection.h:
2048         * WebProcess/Databases/IndexedDB/WebIDBServerConnection.messages.in:
2049
2050         Pipe the calls through to the appropriate UniqueIDBDatabase:
2051         * DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.cpp:
2052         (WebKit::DatabaseProcessIDBConnection::openCursor):
2053         (WebKit::DatabaseProcessIDBConnection::cursorAdvance):
2054         (WebKit::DatabaseProcessIDBConnection::cursorIterate):
2055         * DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.h:
2056         * DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.messages.in:
2057
2058         Pass the calls to the backing store thread, then message back to the WebProcess
2059         when the requests are complete.
2060         * DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:
2061         (WebKit::UniqueIDBDatabase::openCursor):
2062         (WebKit::UniqueIDBDatabase::cursorAdvance):
2063         (WebKit::UniqueIDBDatabase::cursorIterate):
2064         (WebKit::UniqueIDBDatabase::openCursorInBackingStore):
2065         (WebKit::UniqueIDBDatabase::didOpenCursorInBackingStore):
2066         (WebKit::UniqueIDBDatabase::advanceCursorInBackingStore):
2067         (WebKit::UniqueIDBDatabase::didAdvanceCursorInBackingStore):
2068         (WebKit::UniqueIDBDatabase::iterateCursorInBackingStore):
2069         (WebKit::UniqueIDBDatabase::didIterateCursorInBackingStore):
2070         * DatabaseProcess/IndexedDB/UniqueIDBDatabase.h:
2071
2072         * Shared/WebCrossThreadCopier.cpp:
2073         (WebCore::Vector<char>>::copy):
2074         * Shared/WebCrossThreadCopier.h:
2075
2076 2014-01-27  Joseph Pecoraro  <pecoraro@apple.com>
2077
2078         WebKit2: Enable -Wimplicit-fallthrough and add FALLTHROUGH annotation where needed
2079         https://bugs.webkit.org/show_bug.cgi?id=127665
2080
2081         Reviewed by Anders Carlsson.
2082
2083         * Shared/UserData.cpp:
2084         (WebKit::UserData::encode):
2085         These look like they should not have fallen through!
2086
2087         * Configurations/Base.xcconfig:
2088         * Shared/mac/ObjCObjectGraphCoders.mm:
2089         (WebKit::InjectedBundleObjCObjectGraphEncoderImpl::encode):
2090
2091 2014-01-27  Andy Estes  <aestes@apple.com>
2092
2093         [WebKit2] Add SPI to disable the WebCore memory cache
2094         https://bugs.webkit.org/show_bug.cgi?id=127747
2095
2096         Reviewed by Tim Horton.
2097
2098         * Shared/WebProcessCreationParameters.cpp:
2099         (WebKit::WebProcessCreationParameters::WebProcessCreationParameters):
2100         Initialized memoryCacheDisabled to false.
2101         (WebKit::WebProcessCreationParameters::encode):
2102         Encoded memoryCacheDisabled.
2103         (WebKit::WebProcessCreationParameters::decode):
2104         Decoded memoryCacheDisabled.
2105         * Shared/WebProcessCreationParameters.h:
2106         * UIProcess/API/C/WKContext.cpp:
2107         (WKContextSetMemoryCacheDisabled):
2108         Called WebContext::setMemoryCacheDisabled().
2109         * UIProcess/API/C/WKContextPrivate.h: Declared new SPI.
2110         * UIProcess/WebContext.cpp:
2111         (WebKit::WebContext::WebContext): Initialized m_memoryCacheDisabled to false.
2112         (WebKit::WebContext::createNewWebProcess):
2113         Set WebProcessCreationParameters::memoryCacheDisabled to m_memoryCacheDisabled.
2114         (WebKit::WebContext::setMemoryCacheDisabled): Set m_memoryCacheDisabled
2115         and sent new value to all existing processes.
2116         * UIProcess/WebContext.h:
2117         * WebProcess/WebProcess.cpp:
2118         (WebKit::WebProcess::initializeWebProcess):
2119         Called WebProcess::setMemoryCacheDisabled().
2120         (WebKit::WebProcess::setMemoryCacheDisabled):
2121         Called MemoryCache::setDisabled() if the disabled state changed.
2122         * WebProcess/WebProcess.h:
2123         * WebProcess/WebProcess.messages.in:
2124
2125 2014-01-27  Anders Carlsson  <andersca@apple.com>
2126
2127         Add -[WKWebView loadRequest:] API
2128         https://bugs.webkit.org/show_bug.cgi?id=127727
2129
2130         Reviewed by Dan Bernstein.
2131
2132         * UIProcess/API/Cocoa/WKWebView.h:
2133         * UIProcess/API/Cocoa/WKWebView.mm:
2134         (-[WKWebView initWithFrame:configuration:]):
2135         (-[WKWebView loadRequest:]):
2136
2137 2014-01-27  Brady Eidson  <beidson@apple.com>
2138
2139         IDB: Rename "IDBTransactionIdentifier" to be more general purpose (take 2)
2140         https://bugs.webkit.org/show_bug.cgi?id=127717
2141
2142         Reviewed by Tim Horton.
2143
2144         Update all related variable names since the type no longer contains the relevant info.
2145
2146         * DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:
2147         * DatabaseProcess/IndexedDB/UniqueIDBDatabase.h:
2148         * DatabaseProcess/IndexedDB/UniqueIDBDatabaseBackingStore.h:
2149         * DatabaseProcess/IndexedDB/sqlite/SQLiteIDBTransaction.cpp:
2150         * DatabaseProcess/IndexedDB/sqlite/SQLiteIDBTransaction.h:
2151         * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp:
2152         * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.h:
2153         * Shared/WebCrossThreadCopier.cpp:
2154
2155 2014-01-27  Anders Carlsson  <andersca@apple.com>
2156
2157         Copy relevant code from the iOS version of WKView to WKWebView
2158         https://bugs.webkit.org/show_bug.cgi?id=127721
2159
2160         Reviewed by Dan Bernstein.
2161
2162         * UIProcess/API/Cocoa/WKWebView.mm:
2163         (-[WKWebView initWithFrame:configuration:]):
2164         (-[WKWebView setFrame:]):
2165         (-[WKWebView setBounds:]):
2166         (-[WKWebView scrollView]):
2167         (-[WKWebView browsingContextController]):
2168         (-[WKWebView contentView:contentsSizeDidChange:]):
2169         (-[WKWebView contentViewDidCommitLoadForMainFrame:]):
2170         (-[WKWebView contentViewDidReceiveMobileDocType:]):
2171         (-[WKWebView contentView:didChangeViewportArgumentsSize:initialScale:minimumScale:maximumScale:allowsUserScaling:]):
2172         (-[WKWebView viewportHandlerDidChangeScales:]):
2173         (-[WKWebView viewportHandler:didChangeViewportSize:]):
2174         (-[WKWebView viewForZoomingInScrollView:]):
2175         (-[WKWebView scrollViewWillBeginZooming:withView:]):
2176         (-[WKWebView _didFinishScroll]):
2177         (-[WKWebView scrollViewDidEndDragging:willDecelerate:]):
2178         (-[WKWebView scrollViewDidEndDecelerating:]):
2179         (-[WKWebView scrollViewDidScrollToTop:]):
2180         (-[WKWebView scrollViewDidScroll:]):
2181         (-[WKWebView scrollViewDidEndZooming:withView:atScale:]):
2182         (-[WKWebView _frameOrBoundsChanged]):
2183         (-[WKWebView _setDocumentScale:]):
2184
2185 2014-01-27  Tim Horton  <timothy_horton@apple.com>
2186
2187         Revert the parts of r162629 that add a new pluginLoadPolicy and the context menu item.
2188
2189         We're leaving the parts that make us use PDFPlugin instead of showing the blocked
2190         plugin indicator intact, though.
2191
2192         * UIProcess/API/APILoaderClient.h:
2193         (API::LoaderClient::pluginLoadPolicy):
2194         * UIProcess/API/C/WKPage.cpp:
2195         (WKPageSetPageLoaderClient):
2196         * UIProcess/API/C/WKPageLoaderClient.h:
2197         * UIProcess/WebPageProxy.cpp:
2198         (WebKit::WebPageProxy::findPlugin):
2199         * UIProcess/WebPageProxy.h:
2200         * UIProcess/WebPageProxy.messages.in:
2201         * WebProcess/Plugins/PDF/PDFPlugin.h:
2202         * WebProcess/Plugins/PDF/PDFPlugin.mm:
2203         (WebKit::PDFPlugin::PDFPlugin):
2204         (WebKit::PDFPlugin::handleContextMenuEvent):
2205         * WebProcess/WebPage/WebPage.cpp:
2206         (WebKit::WebPage::createPlugin):
2207         (WebKit::WebPage::canPluginHandleResponse):
2208
2209 2014-01-27  Anders Carlsson  <andersca@apple.com>
2210
2211         Add a WKContentView initializer that takes a WKWebViewConfiguration
2212         https://bugs.webkit.org/show_bug.cgi?id=127718
2213
2214         Reviewed by Tim Horton.
2215
2216         This initializer will be used by WKWebView.
2217
2218         * UIProcess/API/ios/WKContentView.h:
2219         * UIProcess/API/ios/WKContentView.mm:
2220         (-[WKContentView initWithFrame:configuration:]):
2221
2222 2014-01-27  Andy Estes  <aestes@apple.com>
2223
2224         Scrub WebKit API headers of WTF macros
2225         https://bugs.webkit.org/show_bug.cgi?id=127706
2226
2227         Reviewed by David Kilzer.
2228
2229         * Configurations/FeatureDefines.xcconfig: Added ENABLE_INSPECTOR.
2230
2231 2014-01-27  Tim Horton  <timothy_horton@apple.com>
2232
2233         Crashes in RemoteScrollingCoordinatorProxy::rootScrollingNodeID
2234
2235         Reviewed by Simon Fraser.
2236
2237         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp:
2238         (WebKit::RemoteScrollingCoordinatorProxy::rootScrollingNodeID):
2239         Null-check the root scrolling node, in case something scrolls before
2240         we've made the first remote layer/scrolling tree commit.
2241
2242 2014-01-27  Brady Eidson  <beidson@apple.com>
2243
2244         IDB: Rename "IDBTransactionIdentifier" to be more general purpose
2245         https://bugs.webkit.org/show_bug.cgi?id=127717
2246
2247         Reviewed by Tim Horton.
2248
2249         Global rename of IDBTransactionIdentifier to IDBIdentifier.
2250
2251         * DatabaseProcess/IndexedDB/IDBIdentifier.h: Renamed from Source/WebKit2/DatabaseProcess/IndexedDB/IDBTransactionIdentifier.h.
2252
2253         * DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.cpp:
2254
2255         * DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:
2256         * DatabaseProcess/IndexedDB/UniqueIDBDatabase.h:
2257
2258         * DatabaseProcess/IndexedDB/sqlite/SQLiteIDBTransaction.cpp:
2259         * DatabaseProcess/IndexedDB/sqlite/SQLiteIDBTransaction.h:
2260
2261         * DatabaseProcess/IndexedDB/UniqueIDBDatabaseBackingStore.h:
2262         * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp:
2263         * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.h:
2264
2265         * Shared/WebCrossThreadCopier.cpp:
2266         * Shared/WebCrossThreadCopier.h:
2267
2268         * WebKit2.xcodeproj/project.pbxproj:
2269
2270 2014-01-27  Anders Carlsson  <andersca@apple.com>
2271
2272         Move underlying C++ objects to class extensions
2273         https://bugs.webkit.org/show_bug.cgi?id=127716
2274
2275         Reviewed by Tim Horton.
2276
2277         This allows us to get at the internals without calling any Obj-C methods.
2278
2279         * UIProcess/API/Cocoa/WKProcessClass.mm:
2280         * UIProcess/API/Cocoa/WKProcessClassInternal.h:
2281         * UIProcess/API/ios/WKContentView.mm:
2282         * UIProcess/API/ios/WKContentViewInternal.h:
2283
2284 2014-01-27  Anders Carlsson  <andersca@apple.com>
2285
2286         Implement the _injectedBundleURL property
2287         https://bugs.webkit.org/show_bug.cgi?id=127714
2288
2289         Reviewed by Tim Horton.
2290
2291         Properties declared in class categories need to be implemented. Do this
2292         for the _injectedBundleURL property.
2293
2294         * UIProcess/API/Cocoa/WKProcessClassConfiguration.mm:
2295         (-[WKProcessClassConfiguration _injectedBundleURL]):
2296         (-[WKProcessClassConfiguration _setInjectedBundleURL:]):
2297
2298 2014-01-27  Brady Eidson  <beidson@apple.com>
2299
2300         IDB: LevelDB backing store shouldn't know about IDBCursor or IDBCallbacks
2301         https://bugs.webkit.org/show_bug.cgi?id=127708
2302
2303         Reviewed by Tim Horton.
2304
2305         Update to new callback signatures:
2306         * WebProcess/Databases/IndexedDB/WebIDBServerConnection.cpp:
2307         (WebKit::WebIDBServerConnection::cursorAdvance):
2308         (WebKit::WebIDBServerConnection::cursorIterate):
2309         * WebProcess/Databases/IndexedDB/WebIDBServerConnection.h:
2310
2311 2014-01-27  Anders Carlsson  <andersca@apple.com>
2312
2313         Tweak the WKWebView and WKWebViewConfiguration headers
2314         https://bugs.webkit.org/show_bug.cgi?id=127705
2315
2316         Reviewed by Dan Bernstein.
2317
2318         Add WK_API_CLASS to WKWebView and make WKWebView.h and WKWebViewConfiguration.h public.
2319
2320         * UIProcess/API/Cocoa/WKWebView.h:
2321         * WebKit2.xcodeproj/project.pbxproj:
2322
2323 2014-01-27  Brady Eidson  <beidson@apple.com>
2324
2325         IDB: Remove unused concept of "cursor prefetch"
2326         https://bugs.webkit.org/show_bug.cgi?id=127700
2327
2328         Reviewed by Tim Horton.
2329
2330         * WebProcess/Databases/IndexedDB/WebIDBServerConnection.cpp:
2331         * WebProcess/Databases/IndexedDB/WebIDBServerConnection.h:
2332
2333 2014-01-27  Tim Horton  <timothy_horton@apple.com>
2334
2335         Fix the build on case-sensitive filesystems
2336
2337         * WebProcess/WebPage/ViewGestureGeometryCollector.h:
2338
2339 2014-01-27  Brady Eidson  <beidson@apple.com>
2340
2341         IDB: Refactor out the last of the operation callbacks that are called by the LevelDB backing store
2342         https://bugs.webkit.org/show_bug.cgi?id=127592
2343
2344         Reviewed by Tim Horton.
2345
2346         Update the WebIDBServerConnection to the new callback signatures:
2347         * WebProcess/Databases/IndexedDB/WebIDBServerConnection.cpp:
2348         (WebKit::WebIDBServerConnection::openCursor):
2349         (WebKit::WebIDBServerConnection::count):
2350         * WebProcess/Databases/IndexedDB/WebIDBServerConnection.h:
2351
2352 2014-01-27  Tim Horton  <timothy_horton@apple.com>
2353
2354         WebKit2 View Gestures: Fluid back-forward swipe
2355         https://bugs.webkit.org/show_bug.cgi?id=127363
2356
2357         Reviewed by Anders Carlsson.
2358
2359         Add support for a "back-forward swipe", which allows fluid swiping between
2360         items in the back-forward list. Currently disabled by default.
2361
2362         * Shared/WebPreferencesStore.h:
2363         * UIProcess/API/C/WKPreferences.cpp:
2364         (WKPreferencesSetViewGestureDebuggingEnabled):
2365         (WKPreferencesGetViewGestureDebuggingEnabled):
2366         * UIProcess/API/C/WKPreferencesPrivate.h:
2367         Add a ViewGestureDebuggingEnabled preference, which currently causes snapshots to be blurred.
2368         Additional view gesture debugging features could come in the future.
2369
2370         * UIProcess/API/Cocoa/WKViewPrivate.h:
2371         * UIProcess/API/mac/WKView.mm:
2372         (-[WKView _ensureGestureController]):
2373         (-[WKView scrollWheel:]):
2374         If back-forward navigation gestures are enabled, intercept scrollWheel events
2375         on the WKView and let the ViewGestureController take the first crack at them.
2376
2377         (-[WKView setAllowsBackForwardNavigationGestures:]):
2378         (-[WKView allowsBackForwardNavigationGestures]):
2379         * UIProcess/API/mac/WKViewInternal.h:
2380         Add allowsBackForwardNavigationGesture property, which enables the gesture.
2381
2382         * UIProcess/mac/ViewGestureController.h:
2383         Add swipe-related methods, which will be described below.
2384
2385         Add an enum for the swipe transition style. Currently only Overlap is accessible,
2386         but in the future one could see having API to choose the style.
2387         'Overlap' has the outgoing page swipe out to the right (when swiping right)
2388         or the incoming page swipe in from the right (when swiping left).
2389         'Push' has the pages push each other along in sync, as if all the pages in the
2390         back-forward list were oriented from left to right.
2391
2392         * UIProcess/mac/ViewGestureController.messages.in:
2393         * UIProcess/mac/ViewGestureController.mm: Renamed from Source/WebKit2/UIProcess/mac/ViewGestureController.cpp.
2394         Use some CAFilter SPI to blur the snapshot if ViewGestureDebuggingEnabled is on.
2395
2396         (WebKit::ViewGestureController::ViewGestureController):
2397         (WebKit::ViewGestureController::~ViewGestureController):
2398         (WebKit::ViewGestureController::endMagnificationGesture):
2399         Move m_activeGestureType clearing to each end* function instead of one global place,
2400         so that each gesture can handle when it ends separately.
2401
2402         (WebKit::ViewGestureController::handleScrollWheelEvent):
2403         If we receive a scroll wheel event which is appropriate for starting a
2404         fluid swipe, in a direction where the main frame is pinned to the appropriate
2405         edge of the view, start tracking a swipe.
2406
2407         This should eventually have some hysterisis to avoid stealing scrolls that
2408         venture into the wrong direction, but for now it starts tracking immediately.
2409
2410         Forward events from the tracking loop to {begin, handle, end}SwipeGesture.
2411
2412         (WebKit::ViewGestureController::beginSwipeGesture):
2413         Create a layer with the destination page's snapshot, and set it up.
2414
2415         (WebKit::ViewGestureController::handleSwipeGesture):
2416         Appropriately adjust the position of the root layer and snapshot layer,
2417         given the transition style and swipe direction.
2418
2419         (WebKit::ViewGestureController::endSwipeGesture):
2420         When the gesture ends, do the navigation, and tell the WebProcess to
2421         inform us when the render tree hits half the size it was when the
2422         snapshot was taken (when that happens, we will remove the snapshot
2423         and the gesture will be truly complete). Also, start a watchdog timer
2424         in case the render tree never hits that size, after which we will
2425         also remove the snapshot.
2426
2427         (WebKit::ViewGestureController::didHitRenderTreeSizeThreshold):
2428         (WebKit::ViewGestureController::swipeSnapshotWatchdogTimerFired):
2429         (WebKit::ViewGestureController::removeSwipeSnapshot):
2430         Tear down the swipe snapshot layer, and mark our current gesture as complete.
2431
2432         (WebKit::ViewGestureController::endActiveGesture):
2433         Simplify endActiveGesture; it only has work to do for a pinch-zoom gesture,
2434         as those are the only gestures where the user is directly in control of when they end.
2435
2436         * WebProcess/WebPage/ViewGestureGeometryCollector.cpp:
2437         (WebKit::ViewGestureGeometryCollector::ViewGestureGeometryCollector):
2438         (WebKit::ViewGestureGeometryCollector::mainFrameDidLayout):
2439         (WebKit::ViewGestureGeometryCollector::renderTreeSizeNotificationTimerFired):
2440         * WebProcess/WebPage/ViewGestureGeometryCollector.h:
2441         (WebKit::ViewGestureGeometryCollector::setRenderTreeSizeNotificationThreshold):
2442         * WebProcess/WebPage/ViewGestureGeometryCollector.messages.in:
2443         ViewGestureController pushes a render-tree size threshold to the WebProcess;
2444         ViewGestureGeometryCollector (whose name is now more unfortunate than before)
2445         monitors render-tree size changes and informs ViewGestureController when
2446         it reaches that threshold via the 'DidHitRenderTreeSizeThreshold' message.
2447
2448         * UIProcess/API/Cocoa/WKViewPrivate.h:
2449         * UIProcess/API/ios/PageClientImplIOS.h:
2450         * UIProcess/API/ios/PageClientImplIOS.mm:
2451         (WebKit::PageClientImpl::acceleratedCompositingRootLayer):
2452         * UIProcess/API/mac/PageClientImpl.h:
2453         * UIProcess/API/mac/PageClientImpl.mm:
2454         (WebKit::PageClientImpl::acceleratedCompositingRootLayer):
2455         * UIProcess/API/mac/WKView.mm:
2456         (-[WKView _acceleratedCompositingModeRootLayer]):
2457         * UIProcess/API/mac/WKViewInternal.h:
2458         * UIProcess/PageClient.h:
2459         * UIProcess/WebPageProxy.h:
2460         * UIProcess/mac/WebPageProxyMac.mm:
2461         (WebKit::WebPageProxy::acceleratedCompositingRootLayer):
2462         Add a getter for the accelerated compositing root layer.
2463
2464         * UIProcess/mac/ViewSnapshotStore.mm:
2465         (WebKit::ViewSnapshotStore::snapshotAndRenderTreeSize):
2466         Don't extract the CGImageRef from a RetainPtr just to put it back in one.
2467
2468 2014-01-27  Carlos Garcia Campos  <cgarcia@igalia.com>
2469
2470         [GTK] Implement custom URI schemes with CustomProtocols
2471         https://bugs.webkit.org/show_bug.cgi?id=127091
2472
2473         Reviewed by Gustavo Noronha Silva.
2474
2475         The old classes are no longer built for GTK+ and should be removed once
2476         other ports using soup backend switch to custom protocols implementation.
2477
2478         * GNUmakefile.am: Remove include path.
2479         * GNUmakefile.list.am: Remove files from compilation.
2480         * PlatformGTK.cmake: Ditto.
2481         * UIProcess/API/gtk/WebKitPrivate.h:
2482         * UIProcess/API/gtk/WebKitRequestManagerClient.cpp:
2483         (startLoading):
2484         (stopLoading):
2485         (attachRequestManagerClientToContext):
2486         * UIProcess/API/gtk/WebKitURISchemeRequest.cpp:
2487         (webkitURISchemeRequestCreate):
2488         (webkit_uri_scheme_request_get_web_view):
2489         (webkitURISchemeRequestReadCallback):
2490         (webkit_uri_scheme_request_finish):
2491         (webkit_uri_scheme_request_finish_error):
2492         * UIProcess/API/gtk/WebKitURISchemeRequestPrivate.h:
2493         * UIProcess/API/gtk/WebKitWebContext.cpp:
2494         (createDefaultWebContext):
2495         (webkit_web_context_register_uri_scheme):
2496         (webkitWebContextGetRequestManager):
2497         (webkitWebContextStartLoadingCustomProtocol):
2498         (webkitWebContextStopLoadingCustomProtocol):
2499         (webkitWebContextDidFinishLoadingCustomProtocol):
2500         * UIProcess/API/gtk/WebKitWebContextPrivate.h:
2501         * UIProcess/gtk/WebContextGtk.cpp:
2502         (WebKit::WebContext::platformInitializeWebProcess):
2503         * WebKit2Prefix.h: Enable CustomProtocols unconditionally for the
2504         GTK+ port.
2505
2506 2014-01-27  Carlos Garcia Campos  <cgarcia@igalia.com>
2507
2508         [SOUP] WebProcess sometimes crashes when a download is cancelled
2509         https://bugs.webkit.org/show_bug.cgi?id=127650
2510
2511         Reviewed by Martin Robinson.
2512
2513         The problem is that when the download is cancelled, the download
2514         manager removes the download from the map and it's deleted. The
2515         Download destructor calls platformInvalidate() that cancels the
2516         resource handle if there's still one. We set to nullptr the
2517         ResourceHandle when the download is cancelled to avoid cancelling
2518         it twice, but it's done after calling Download::didCancel(). It
2519         should be done before, because at that moment, when the download
2520         is deleted, the resource handle pointer is still valid.
2521
2522         * Shared/Downloads/soup/DownloadSoup.cpp:
2523         (WebKit::Download::cancel):
2524
2525 2014-01-25  Sam Weinig  <sam@webkit.org>
2526
2527         Remove unused support for DRAGGABLE_REGION
2528         https://bugs.webkit.org/show_bug.cgi?id=127642
2529
2530         Reviewed by Simon Fraser.
2531
2532         * Configurations/FeatureDefines.xcconfig:
2533
2534 2014-01-25  Anders Carlsson  <andersca@apple.com>
2535
2536         Remove an unused FrameLoaderClient function
2537         https://bugs.webkit.org/show_bug.cgi?id=127628
2538
2539         Reviewed by Andreas Kling.
2540
2541         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2542         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
2543
2544 2014-01-25  Anders Carlsson  <andersca@apple.com>
2545
2546         Remove atomicIncrement/atomicDecrement
2547         https://bugs.webkit.org/show_bug.cgi?id=127625
2548
2549         Reviewed by Andreas Kling.
2550
2551         Replace atomicIncrement/atomicDecrement with std::atomic.
2552
2553         * Platform/IPC/Connection.cpp:
2554         (IPC::Connection::createSyncMessageEncoder):
2555         * Shared/mac/SecItemShim.cpp:
2556         (WebKit::generateSecItemRequestID):
2557         * UIProcess/StatisticsRequest.cpp:
2558         (WebKit::StatisticsRequest::addOutstandingRequest):
2559
2560 2014-01-25  Anders Carlsson  <andersca@apple.com>
2561
2562         Modernize HashTable threading code
2563         https://bugs.webkit.org/show_bug.cgi?id=127621
2564
2565         Reviewed by Darin Adler.
2566
2567         Explicitly include headers that used to be brought in by HashTable.h
2568
2569         * Shared/BlockingResponseMap.h:
2570
2571 2014-01-25  Zan Dobersek  <zdobersek@igalia.com>
2572
2573         [GTK] Remove null check for WebPopupMenuProxy::Client in WebPopupMenuProxyGtk::showPopupMenu
2574         https://bugs.webkit.org/show_bug.cgi?id=107036
2575
2576         Reviewed by Andreas Kling.
2577
2578         * UIProcess/gtk/WebPopupMenuProxyGtk.cpp:
2579         (WebKit::WebPopupMenuProxyGtk::showPopupMenu): Don't perform an early return
2580         if the client is not available - it always should be. The client is set to null
2581         only when the proxy is invalidated. This happens immediately after this function
2582         returns, either with the popup being forced to close or being closed by the user
2583         with possibly an item being chosen. Rather than the early return, use an ASSERT.
2584
2585 2014-01-24  Tim Horton  <timothy_horton@apple.com>
2586
2587         WebKit2 View Gestures (Smart Zoom): Can't double-tap zoom-out on the body
2588         https://bugs.webkit.org/show_bug.cgi?id=127602
2589
2590         Reviewed by Anders Carlsson.
2591
2592         * UIProcess/mac/ViewGestureController.h:
2593         * UIProcess/mac/ViewGestureController.mm:
2594         (WebKit::ViewGestureController::ViewGestureController):
2595         (WebKit::ViewGestureController::didCollectGeometryForSmartMagnificationGesture):
2596         Use an explicit boolean instead of the emptiness of the renderRect() to determine
2597         whether or not the user has already smart-zoomed. renderRect() can be 0x0
2598         if our hit-test hits the body element.
2599
2600 2014-01-24  Jinwoo Song  <jinwoo7.song@samsung.com>
2601
2602         Fix EFL WebKit2 build.
2603
2604         * WebProcess/WebPage/efl/WebPageEfl.cpp:
2605         (WebKit::WebPage::performDefaultBehaviorForKeyEvent):
2606
2607 2014-01-24  Anders Carlsson  <andersca@apple.com>
2608
2609         Fix GTK+ WebKit2 build.
2610
2611         * WebProcess/WebPage/gtk/WebPageGtk.cpp:
2612         (WebKit::WebPage::performDefaultBehaviorForKeyEvent):
2613
2614 2014-01-24  Simon Fraser  <simon.fraser@apple.com>
2615
2616         Start using the RemoteScrollingCoordinatorProxy on iOS
2617         https://bugs.webkit.org/show_bug.cgi?id=127598
2618
2619         Reviewed by Tim Horton.
2620
2621         Add a scrollPositionChangedViaDelegatedScrolling() function to
2622         ScrollingTree, allowing the ScrollingTree to be informed about
2623         external sources of scrolling.
2624         
2625         Call it from -[WKContentView didScrollTo:] for the root node.
2626
2627         * UIProcess/API/ios/WKContentView.mm:
2628         (-[WKContentView didScrollTo:]):
2629         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp:
2630         (WebKit::RemoteScrollingCoordinatorProxy::rootScrollingNodeID):
2631         (WebKit::RemoteScrollingCoordinatorProxy::scrollPositionChangedViaDelegatedScrolling):
2632         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h:
2633
2634 2014-01-24  Anders Carlsson  <andersca@apple.com>
2635
2636         Try to fix the GTK+ build.
2637
2638         * GNUmakefile.list.am:
2639
2640 2014-01-24  Anders Carlsson  <andersca@apple.com>
2641
2642         Remove back/forward list related functions from Page
2643         https://bugs.webkit.org/show_bug.cgi?id=127596
2644
2645         Reviewed by Andreas Kling.
2646
2647         * WebProcess/WebPage/mac/WebPageMac.mm:
2648         (WebKit::WebPage::performNonEditingBehaviorForSelector):
2649
2650 2014-01-24  Jinwoo Song  <jinwoo7.song@samsung.com>
2651
2652         Unreviewed build fix attemp on the EFL after r162728.
2653
2654         * CMakeLists.txt: Removed WebLoaderClient.cpp
2655
2656 2014-01-24  Simon Fraser  <simon.fraser@apple.com>
2657
2658         Prepare scrolling tree to handle > 1 scrolling node
2659         https://bugs.webkit.org/show_bug.cgi?id=127590
2660
2661         Reviewed by Tim Horton.
2662         
2663         Clean up the code path called after the ScrollingTree has scrolled a node,
2664         to prepare for multiple scrolling nodes.
2665         
2666         Change "updateMainFrameScrollPosition" terminology to "updateScrollPositionAfterAsyncScroll",
2667         and pass along the ScrollingNodeID that scrolled.
2668
2669         * UIProcess/Scrolling/RemoteScrollingTree.cpp:
2670         (WebKit::RemoteScrollingTree::scrollingTreeNodeDidScroll):
2671         * UIProcess/Scrolling/RemoteScrollingTree.h:
2672         * WebProcess/Scrolling/RemoteScrollingCoordinator.mm:
2673         (WebKit::RemoteScrollingCoordinator::scrollPositionChangedForNode):
2674
2675 2014-01-24  Simon Fraser  <simon.fraser@apple.com>
2676
2677         #ifdef out handleWheelEventPhase for iOS
2678         https://bugs.webkit.org/show_bug.cgi?id=127583
2679
2680         Reviewed by Tim Horton.
2681
2682         handleWheelEventPhase() doesn't make any sense for iOS, which
2683         has no wheel events.
2684
2685         * UIProcess/Scrolling/RemoteScrollingTree.cpp:
2686         * UIProcess/Scrolling/RemoteScrollingTree.h:
2687
2688 2014-01-24  Simon Fraser  <simon.fraser@apple.com>
2689
2690         Push a custom fixed position rect down to the WebProcess in iOS WK2
2691         https://bugs.webkit.org/show_bug.cgi?id=127573
2692
2693         Reviewed by Tim Horton.
2694         
2695         Make it possible for WKContentView to specify a custom rect
2696         used to layout fixed position elements on iOS.
2697         
2698         This is computed in WKContentView, and pushed down
2699         through the RemoteLayerTreeDrawingArea, and eventually
2700         pushed onto FrameView.
2701
2702         * UIProcess/API/ios/WKContentView.mm:
2703         (-[WKContentView fixedPositionRectFromExposedRect:scale:]):
2704         (-[WKContentView _updateFixedPositionRect]):
2705         (-[WKContentView didFinishScrollTo:]):
2706         (-[WKContentView didZoomToScale:]):
2707         * UIProcess/DrawingAreaProxy.cpp:
2708         (WebKit::DrawingAreaProxy::setCustomFixedPositionRect):
2709         * UIProcess/DrawingAreaProxy.h:
2710         * WebProcess/WebPage/DrawingArea.h:
2711         * WebProcess/WebPage/DrawingArea.messages.in:
2712         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
2713         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
2714         (WebKit::RemoteLayerTreeDrawingArea::setCustomFixedPositionRect):
2715
2716 2014-01-24  Anders Carlsson  <andersca@apple.com>
2717
2718         Get rid of WebLoaderClient
2719         https://bugs.webkit.org/show_bug.cgi?id=127587
2720
2721         Reviewed by Andreas Kling.
2722
2723         Move WebLoaderClient into WKPage.cpp.
2724
2725         * UIProcess/API/C/WKPage.cpp:
2726         (WKPageSetPageLoaderClient):
2727         * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
2728         (-[WKBrowsingContextController setLoadDelegate:]):
2729         * UIProcess/WebLoaderClient.cpp: Removed.
2730         * UIProcess/WebLoaderClient.h: Removed.
2731         * UIProcess/WebPageProxy.h:
2732         * WebKit2.xcodeproj/project.pbxproj:
2733
2734 2014-01-24  Brady Eidson  <beidson@apple.com>
2735
2736         IDB: Support createIndex/deleteIndex
2737         <rdar://problem/15779642> and https://bugs.webkit.org/show_bug.cgi?id=127585
2738
2739         Reviewed by Tim Horton.
2740
2741         * DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:
2742         (WebKit::UniqueIDBDatabase::createIndex):
2743         (WebKit::UniqueIDBDatabase::deleteIndex):
2744         (WebKit::UniqueIDBDatabase::createIndexInBackingStore):
2745         (WebKit::UniqueIDBDatabase::deleteIndexInBackingStore):
2746
2747         * DatabaseProcess/IndexedDB/UniqueIDBDatabaseBackingStore.h:
2748         * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp:
2749         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::deleteObjectStore): Also drop all associated indexes.
2750         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::createIndex):
2751         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::deleteIndex):
2752         * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.h:
2753
2754 2014-01-24  Víctor Manuel Jáquez Leal  <vjaquez@igalia.com>
2755
2756         [GTK] youtube HTML5 videos in fullscreen, after <Esc>, can't go fullscreen again
2757         https://bugs.webkit.org/show_bug.cgi?id=127064
2758
2759         When pressing <Esc> or <f> at full screen, the WebView shall emit the
2760         event webkitfullscreenchange, but wk2gtk does not emit it. This is
2761         because the WebView manages directly the exit of the full screen.
2762
2763         With this patch the WebView calls requestExitFullScreen to the full
2764         screen manager, instead of managing directly the exit of the full
2765         screen, and the event webkitfullscreenchange will be dispatched
2766         correctly.
2767
2768         Reviewed by Martin Robinson.
2769
2770         No tests are included because there is a bug in WKTR that prevents the
2771         execution of a test for this patch. See
2772         https://bugs.webkit.org/show_bug.cgi?id=127348
2773
2774         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
2775         (webkitWebViewBaseKeyPressEvent): Call
2776         webkitWebViewBaseRequestExitFullScreen.
2777         (webkitWebViewBaseRequestExitFullScreen): Added.
2778         * UIProcess/API/gtk/WebKitWebViewBasePrivate.h: Ditto.
2779
2780 2014-01-24  Tim Horton  <timothy_horton@apple.com>
2781
2782         iOS build fix after r162710.
2783
2784         This is why these sorts of comments are bad.
2785
2786         * UIProcess/WebPageProxy.cpp:
2787
2788 2014-01-24  Anders Carlsson  <andersca@apple.com>
2789
2790         Use a side table to map WebPageProxy objects to WKBrowsingContextController objects
2791         https://bugs.webkit.org/show_bug.cgi?id=127577
2792
2793         Reviewed by Tim Horton.
2794
2795         * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
2796         (browsingContextControllerMap):
2797         (-[WKBrowsingContextController dealloc]):
2798         (-[WKBrowsingContextController _initWithPageRef:]):
2799         (+[WKBrowsingContextController _browsingContextControllerForPageRef:]):
2800         * UIProcess/API/Cocoa/WKBrowsingContextControllerInternal.h:
2801         * UIProcess/WebPageProxy.h:
2802
2803 2014-01-24  Tim Horton  <timothy_horton@apple.com>
2804
2805         iOS build fix after r162710.
2806
2807         * UIProcess/API/ios/PageClientImplIOS.h:
2808         * UIProcess/API/ios/PageClientImplIOS.mm:
2809         (WebKit::PageClientImpl::takeViewSnapshot):
2810
2811 2014-01-24  Enrique Ocaña González  <eocanha@igalia.com>
2812
2813         [GTK] Put cache files in XDG_CACHE_HOME
2814         https://bugs.webkit.org/show_bug.cgi?id=123458
2815
2816         Reviewed by Martin Robinson.
2817
2818         * UIProcess/gtk/WebContextGtk.cpp:
2819         (WebKit::WebContext::platformDefaultIconDatabasePath):
2820
2821 2014-01-24  Tim Horton  <timothy_horton@apple.com>
2822
2823         WebKit2 View Gestures (Swipe): Add a simple cache of view snapshots
2824         https://bugs.webkit.org/show_bug.cgi?id=127438
2825
2826         Reviewed by Sam Weinig.
2827
2828         Add a cache of bitmap snapshots of the WKView, taken via OS X's window server
2829         snapshotting mechanism. For now, we store all snapshots; refinements to the
2830         caching strategy (or really having one at all) will come in future patches.
2831
2832         Snapshots are stored in a side map, with a UUID that allows references
2833         to be stored inside WebBackForwardListItem (and serialized along with
2834         the back-forward list when it is copied).
2835
2836         * Shared/WebBackForwardListItem.h:
2837         (WebKit::WebBackForwardListItem::setSnapshotUUID):
2838         (WebKit::WebBackForwardListItem::snapshotUUID):
2839         * UIProcess/cf/WebBackForwardListCF.cpp:
2840         (WebKit::WebBackForwardList::createCFDictionaryRepresentation):
2841         (WebKit::extractBackForwardListEntriesFromArray):
2842         Store and serialize a UUID along with each back-forward list item which
2843         identifies that item's view snapshot in the ViewSnapshotStore.
2844
2845         * UIProcess/cf/WebPageProxyCF.cpp:
2846         Bump the session state data version, as we changed the WebBackForwardList format.
2847
2848         * UIProcess/API/Cocoa/WKViewPrivate.h:
2849         * UIProcess/API/mac/PageClientImpl.h:
2850         * UIProcess/API/mac/PageClientImpl.mm:
2851         (WebKit::PageClientImpl::takeViewSnapshot):
2852
2853         * UIProcess/API/mac/WKView.mm:
2854         (-[WKView _takeViewSnapshot]):
2855         Add _takeViewSnapshot IPI, which is used by ViewSnapshotStore via the PageClient
2856         to take a snapshot of the view.
2857
2858         (-[WKView saveBackForwardSnapshotForCurrentItem]):
2859         Add saveBackForwardSnapshotForCurrentItem SPI, which clients could potentially
2860         use when they know they're about to manipulate the view hierarchy in such a way
2861         that they want the current back-forward item's snapshot to be up to date.
2862
2863         * UIProcess/API/mac/WKViewInternal.h:
2864         * UIProcess/PageClient.h:
2865         * UIProcess/WebPageProxy.cpp:
2866         (WebKit::WebPageProxy::WebPageProxy):
2867         (WebKit::WebPageProxy::recordNavigationSnapshot):
2868         (WebKit::WebPageProxy::goForward):
2869         (WebKit::WebPageProxy::goBack):
2870         (WebKit::WebPageProxy::goToBackForwardItem):
2871         (WebKit::WebPageProxy::didStartProvisionalLoadForFrame):
2872         Update the current back-forward item's snapshot immediately before navigating.
2873
2874         * UIProcess/WebPageProxy.h:
2875         (WebKit::WebPageProxy::shouldRecordNavigationSnapshots):
2876         (WebKit::WebPageProxy::setShouldRecordNavigationSnapshots):
2877         Expose the ability to enable taking view snapshots on every navigation.
2878         This is off by default, so we won't be taking any snapshots yet.
2879
2880         * UIProcess/mac/ViewSnapshotStore.h: Added.
2881         (WebKit::ViewSnapshotStore::disableSnapshotting):
2882         (WebKit::ViewSnapshotStore::enableSnapshotting):
2883         * UIProcess/mac/ViewSnapshotStore.mm: Added.
2884         (WebKit::ViewSnapshotStore::ViewSnapshotStore):
2885         (WebKit::ViewSnapshotStore::~ViewSnapshotStore):
2886         (WebKit::ViewSnapshotStore::shared):
2887         (WebKit::ViewSnapshotStore::recordSnapshot):
2888         (WebKit::ViewSnapshotStore::snapshotAndRenderTreeSize):
2889         * UIProcess/mac/WebPageProxyMac.mm:
2890         (WebKit::WebPageProxy::takeViewSnapshot):
2891         * WebKit2.xcodeproj/project.pbxproj:
2892
2893 2014-01-24  Brady Eidson  <beidson@apple.com>
2894
2895         IDB: support createIndex/deleteIndex messaging
2896         https://bugs.webkit.org/show_bug.cgi?id=127546
2897
2898         Reviewed by Tim Horton.
2899
2900         Message create/delete requests over to the DatabaseProcess, and listen to its replies:
2901         * WebProcess/Databases/IndexedDB/WebIDBServerConnection.cpp:
2902         (WebKit::WebIDBServerConnection::createIndex):
2903         (WebKit::WebIDBServerConnection::didCreateIndex):
2904         (WebKit::WebIDBServerConnection::deleteIndex):
2905         (WebKit::WebIDBServerConnection::didDeleteIndex):
2906         * WebProcess/Databases/IndexedDB/WebIDBServerConnection.h:
2907         * WebProcess/Databases/IndexedDB/WebIDBServerConnection.messages.in:
2908
2909         Pass create/delete requests to the appropriate unique IDB database:
2910         * DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.cpp:
2911         (WebKit::DatabaseProcessIDBConnection::createIndex):
2912         (WebKit::DatabaseProcessIDBConnection::deleteIndex):
2913         * DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.h:
2914         * DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.messages.in:
2915
2916         Message the create/delete request to the database thread for the backing store to handle:
2917         * DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:
2918         (WebKit::UniqueIDBDatabase::didCreateIndex):
2919         (WebKit::UniqueIDBDatabase::didDeleteIndex):
2920         (WebKit::UniqueIDBDatabase::createIndex):
2921         (WebKit::UniqueIDBDatabase::deleteIndex):
2922         (WebKit::UniqueIDBDatabase::createIndexInBackingStore):
2923         (WebKit::UniqueIDBDatabase::deleteIndexInBackingStore):
2924         * DatabaseProcess/IndexedDB/UniqueIDBDatabase.h:
2925
2926         * Scripts/webkit2/messages.py:
2927         (struct_or_class):
2928
2929 2014-01-24  Csaba Osztrogonác  <ossy@webkit.org>
2930
2931         [EFL][WK2] Debug buildfix
2932         https://bugs.webkit.org/show_bug.cgi?id=127496
2933
2934         Reviewed by Gyuyoung Kim.
2935
2936         * Shared/SessionTracker.cpp:
2937
2938 2014-01-23  Brady Eidson  <beidson@apple.com>
2939
2940         IDB: Support IDBObjectStore.clear()
2941         https://bugs.webkit.org/show_bug.cgi?id=127541
2942
2943         Reviewed by Anders Carlsson.
2944
2945         Make the WebProcess call out to the DatabaseProcess with a clear request, and handle the
2946         response from the DatabaseProcess:
2947         * WebProcess/Databases/IndexedDB/WebIDBServerConnection.cpp:
2948         (WebKit::WebIDBServerConnection::clearObjectStore):
2949         (WebKit::WebIDBServerConnection::didClearObjectStore):
2950         * WebProcess/Databases/IndexedDB/WebIDBServerConnection.h:
2951         * WebProcess/Databases/IndexedDB/WebIDBServerConnection.messages.in:
2952
2953         Pass the clear request to the appropriate UniqueIDBDatabase:
2954         * DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.cpp:
2955         (WebKit::DatabaseProcessIDBConnection::clearObjectStore):
2956         * DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.h:
2957         * DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.messages.in:
2958
2959         Pass the clear request to the backing store:
2960         * DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:
2961         (WebKit::UniqueIDBDatabase::didClearObjectStore):
2962         (WebKit::UniqueIDBDatabase::clearObjectStore):
2963         (WebKit::UniqueIDBDatabase::clearObjectStoreInBackingStore):
2964         * DatabaseProcess/IndexedDB/UniqueIDBDatabase.h:
2965
2966         Actually drop the records in the database:
2967         * DatabaseProcess/IndexedDB/UniqueIDBDatabaseBackingStore.h:
2968         * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp:
2969         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::clearObjectStore):
2970         * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.h:
2971
2972 2014-01-23  Anders Carlsson  <andersca@apple.com>
2973
2974         Fix crash when opening the inspector
2975         https://bugs.webkit.org/show_bug.cgi?id=127542
2976         <rdar://problem/15899544>
2977
2978         Reviewed by Joseph Pecoraro.
2979
2980         Create default clients so we won't crash if they're never set.
2981
2982         * UIProcess/WebPageProxy.cpp:
2983         (WebKit::WebPageProxy::WebPageProxy):
2984
2985 2014-01-23  Ryuan Choi  <ryuan.choi@samsung.com>
2986
2987         Unreviewed build fix attemp on the EFL and GTK build after r162678
2988
2989         * CMakeLists.txt: Removed WebPolicyClient.cpp
2990         * GNUmakefile.list.am: Removed WebPolicyClient.cpp and WebPolicyClient.h
2991
2992 2014-01-23  Yongjun Zhang  <yongjun_zhang@apple.com>
2993
2994         Support NSInteger argument type for encoding/decoding invocations.
2995         https://bugs.webkit.org/show_bug.cgi?id=127522
2996
2997         Reviewed by Dan Bernstein.
2998
2999         Add support for NSInteger argument type ('q') for remote invocations.
3000
3001         * Shared/API/Cocoa/WKRemoteObjectCoder.mm:
3002         (encodeInvocation):
3003         (decodeInvocationArguments):
3004
3005 2014-01-23  Brady Eidson  <beidson@apple.com>
3006
3007         IDB: Implement SQLite backing store 'get' support
3008         https://bugs.webkit.org/show_bug.cgi?id=127502
3009
3010         Reviewed by Tim Horton.
3011
3012         This makes get of a single IDBKey work, and lays the groundwork for getting an IDBKeyRange.
3013
3014         * DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:
3015         (WebKit::UniqueIDBDatabase::getRecordFromBackingStore):
3016         * DatabaseProcess/IndexedDB/UniqueIDBDatabaseBackingStore.h:
3017
3018         * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp:
3019         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::createAndPopulateInitialMetadata): Add custom collation
3020           to the Records table.
3021         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::getOrEstablishMetadata): Install the custom collator.
3022         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::getKeyRecordFromObjectStore):
3023         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::getKeyRangeRecordFromObjectStore):
3024         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::collate): Collation function to be filled in later.
3025         * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.h:
3026
3027 2014-01-23  Jon Honeycutt  <jhoneycutt@apple.com>
3028
3029         Assertion failure in WebCore::PseudoElement::didRecalcStyle()
3030         <https://bugs.webkit.org/show_bug.cgi?id=126761>
3031         <rdar://problem/15793540>
3032
3033         Reviewed by Andy Estes.
3034
3035         * WebProcess/WebPage/ios/WebPageIOS.mm:
3036         (WebKit::WebPage::getPositionInformation):
3037         Check isRenderImage() rather than isImage() before casting to
3038         RenderImage.
3039
3040 2014-01-23  Anders Carlsson  <andersca@apple.com>
3041
3042         Move policy client into WKPage.cpp and get rid of WebPolicyClient files
3043         https://bugs.webkit.org/show_bug.cgi?id=127536
3044
3045         Reviewed by Tim Horton.
3046
3047         * UIProcess/API/C/WKPage.cpp:
3048         (WKPageSetPagePolicyClient):
3049         * UIProcess/WebPolicyClient.cpp: Removed.
3050         * UIProcess/WebPolicyClient.h: Removed.
3051         * WebKit2.xcodeproj/project.pbxproj:
3052
3053 2014-01-23  Joseph Pecoraro  <pecoraro@apple.com>
3054
3055         Web Inspector: Remove recompileAllJSFunctions timer in ScriptDebugServer
3056         https://bugs.webkit.org/show_bug.cgi?id=127409
3057
3058         Reviewed by Geoffrey Garen.
3059
3060         * WebProcess/WebCoreSupport/WebInspectorFrontendClient.cpp:
3061         (WebKit::WebInspectorFrontendClient::closeWindow):
3062         * WebProcess/WebPage/WebInspector.cpp:
3063         (WebKit::WebInspector::remoteFrontendDisconnected):
3064         Include InspectorDisconnectReason.
3065
3066 2014-01-23  Anders Carlsson  <andersca@apple.com>
3067
3068         Only WKPage should know about WebPolicyClient
3069         https://bugs.webkit.org/show_bug.cgi?id=127535
3070
3071         Reviewed by Andreas Kling.
3072
3073         * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
3074         (setUpPagePolicyClient):
3075         (-[WKBrowsingContextController setPolicyDelegate:]):
3076         * UIProcess/WebInspectorProxy.cpp:
3077         (WebKit::WebInspectorProxy::createInspectorPage):
3078
3079 2014-01-23  Anders Carlsson  <andersca@apple.com>
3080
3081         Simplify API::LoaderClient management
3082         https://bugs.webkit.org/show_bug.cgi?id=127531
3083
3084         Reviewed by Tim Horton.
3085
3086         Add default implementations to API::LoaderClient and change WebPageProxy::setLoaderClient to
3087         always create a policy client, even if the loader client set is null. That way we don't have to null
3088         check the loader client everywhere.
3089
3090         * UIProcess/API/APILoaderClient.h:
3091         (API::LoaderClient::didStartProvisionalLoadForFrame):
3092         (API::LoaderClient::didReceiveServerRedirectForProvisionalLoadForFrame):
3093         (API::LoaderClient::didFailProvisionalLoadWithErrorForFrame):
3094         (API::LoaderClient::didCommitLoadForFrame):
3095         (API::LoaderClient::didFinishDocumentLoadForFrame):
3096         (API::LoaderClient::didFinishLoadForFrame):
3097         (API::LoaderClient::didFailLoadWithErrorForFrame):
3098         (API::LoaderClient::didSameDocumentNavigationForFrame):
3099         (API::LoaderClient::didReceiveTitleForFrame):
3100         (API::LoaderClient::didFirstLayoutForFrame):
3101         (API::LoaderClient::didFirstVisuallyNonEmptyLayoutForFrame):
3102         (API::LoaderClient::didRemoveFrameFromHierarchy):
3103         (API::LoaderClient::didDisplayInsecureContentForFrame):
3104         (API::LoaderClient::didRunInsecureContentForFrame):
3105         (API::LoaderClient::didDetectXSSForFrame):
3106         (API::LoaderClient::didLayout):
3107         (API::LoaderClient::canAuthenticateAgainstProtectionSpaceInFrame):
3108         (API::LoaderClient::didReceiveAuthenticationChallengeInFrame):
3109         (API::LoaderClient::didStartProgress):
3110         (API::LoaderClient::didChangeProgress):
3111         (API::LoaderClient::didFinishProgress):
3112         (API::LoaderClient::processDidBecomeUnresponsive):
3113         (API::LoaderClient::interactionOccurredWhileProcessUnresponsive):
3114         (API::LoaderClient::processDidBecomeResponsive):
3115         (API::LoaderClient::processDidCrash):
3116         (API::LoaderClient::didChangeBackForwardList):
3117         (API::LoaderClient::willGoToBackForwardListItem):
3118         (API::LoaderClient::pluginLoadPolicy):
3119         (API::LoaderClient::didFailToInitializePlugin):
3120         (API::LoaderClient::didBlockInsecurePluginVersion):
3121         (API::LoaderClient::webGLLoadPolicy):
3122         * UIProcess/WebPageProxy.cpp:
3123         (WebKit::WebPageProxy::setLoaderClient):
3124         (WebKit::WebPageProxy::didChangeBackForwardList):
3125         (WebKit::WebPageProxy::willGoToBackForwardListItem):
3126         (WebKit::WebPageProxy::findPlugin):
3127         (WebKit::WebPageProxy::didStartProgress):
3128         (WebKit::WebPageProxy::didChangeProgress):
3129         (WebKit::WebPageProxy::didFinishProgress):
3130         (WebKit::WebPageProxy::didStartProvisionalLoadForFrame):
3131         (WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame):
3132         (WebKit::WebPageProxy::didFailProvisionalLoadForFrame):
3133         (WebKit::WebPageProxy::didCommitLoadForFrame):
3134         (WebKit::WebPageProxy::didFinishDocumentLoadForFrame):
3135         (WebKit::WebPageProxy::didFinishLoadForFrame):
3136         (WebKit::WebPageProxy::didFailLoadForFrame):
3137         (WebKit::WebPageProxy::didSameDocumentNavigationForFrame):
3138         (WebKit::WebPageProxy::didReceiveTitleForFrame):
3139         (WebKit::WebPageProxy::didFirstLayoutForFrame):
3140         (WebKit::WebPageProxy::didFirstVisuallyNonEmptyLayoutForFrame):
3141         (WebKit::WebPageProxy::didLayout):
3142         (WebKit::WebPageProxy::didRemoveFrameFromHierarchy):
3143         (WebKit::WebPageProxy::didDisplayInsecureContentForFrame):
3144         (WebKit::WebPageProxy::didRunInsecureContentForFrame):
3145         (WebKit::WebPageProxy::didDetectXSSForFrame):
3146         (WebKit::WebPageProxy::webGLPolicyForURL):
3147         (WebKit::WebPageProxy::processDidBecomeUnresponsive):
3148         (WebKit::WebPageProxy::interactionOccurredWhileProcessUnresponsive):
3149         (WebKit::WebPageProxy::processDidBecomeResponsive):
3150         (WebKit::WebPageProxy::processDidCrash):
3151         (WebKit::WebPageProxy::canAuthenticateAgainstProtectionSpaceInFrame):
3152         (WebKit::WebPageProxy::didReceiveAuthenticationChallengeProxy):
3153         (WebKit::WebPageProxy::didFailToInitializePlugin):
3154         (WebKit::WebPageProxy::didBlockInsecurePluginVersion):
3155
3156 2014-01-23  Anders Carlsson  <andersca@apple.com>
3157
3158         Simplify API::PolicyClient management
3159         https://bugs.webkit.org/show_bug.cgi?id=127529
3160
3161         Reviewed by Tim Horton.
3162
3163         Add default implementations to API::PolicyClient and change WebPageProxy::setPolicyClient to
3164         always create a policy client, even if the policy object set is null. That way we don't have to null
3165         check the policy client everywhere.
3166
3167         * UIProcess/API/APIPolicyClient.h:
3168         (API::PolicyClient::decidePolicyForNavigationAction):
3169         (API::PolicyClient::decidePolicyForNewWindowAction):
3170         (API::PolicyClient::decidePolicyForResponse):
3171         (API::PolicyClient::unableToImplementPolicy):
3172         * UIProcess/WebPageProxy.cpp:
3173         (WebKit::WebPageProxy::setPolicyClient):
3174         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
3175         (WebKit::WebPageProxy::decidePolicyForNewWindowAction):
3176         (WebKit::WebPageProxy::decidePolicyForResponse):
3177         (WebKit::WebPageProxy::unableToImplementPolicy):
3178
3179 2014-01-23  Simon Fraser  <simon.fraser@apple.com>
3180
3181         Fix GTK.
3182
3183         * WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp:
3184         (webkitWebPageDidReceiveMessage):
3185
3186 2014-01-23  Anders Carlsson  <andersca@apple.com>
3187
3188         Add an APILoaderClient base class
3189         https://bugs.webkit.org/show_bug.cgi?id=127527
3190
3191         Reviewed by Tim Horton.
3192
3193         * UIProcess/API/APILoaderClient.h: Added.
3194         (API::LoaderClient::~LoaderClient):
3195         * UIProcess/API/C/WKPage.cpp:
3196         (WKPageSetPageLoaderClient):
3197         * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
3198         (setUpPageLoaderClient):
3199         (-[WKBrowsingContextController setLoadDelegate:]):
3200         (+[WKBrowsingContextController _browsingContextControllerForPageRef:]):
3201         * UIProcess/WebLoaderClient.cpp:
3202         (WebKit::WebLoaderClient::WebLoaderClient):
3203         * UIProcess/WebLoaderClient.h:
3204         * UIProcess/WebPageProxy.cpp:
3205         (WebKit::WebPageProxy::setLoaderClient):
3206         (WebKit::WebPageProxy::close):
3207         (WebKit::WebPageProxy::didChangeBackForwardList):
3208         (WebKit::WebPageProxy::willGoToBackForwardListItem):
3209         (WebKit::WebPageProxy::findPlugin):
3210         (WebKit::WebPageProxy::didStartProgress):
3211         (WebKit::WebPageProxy::didChangeProgress):
3212         (WebKit::WebPageProxy::didFinishProgress):
3213         (WebKit::WebPageProxy::didStartProvisionalLoadForFrame):
3214         (WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame):
3215         (WebKit::WebPageProxy::didFailProvisionalLoadForFrame):
3216         (WebKit::WebPageProxy::didCommitLoadForFrame):
3217         (WebKit::WebPageProxy::didFinishDocumentLoadForFrame):
3218         (WebKit::WebPageProxy::didFinishLoadForFrame):
3219         (WebKit::WebPageProxy::didFailLoadForFrame):
3220         (WebKit::WebPageProxy::didSameDocumentNavigationForFrame):
3221         (WebKit::WebPageProxy::didReceiveTitleForFrame):
3222         (WebKit::WebPageProxy::didFirstLayoutForFrame):
3223         (WebKit::WebPageProxy::didFirstVisuallyNonEmptyLayoutForFrame):
3224         (WebKit::WebPageProxy::didLayout):
3225         (WebKit::WebPageProxy::didRemoveFrameFromHierarchy):
3226         (WebKit::WebPageProxy::didDisplayInsecureContentForFrame):
3227         (WebKit::WebPageProxy::didRunInsecureContentForFrame):
3228         (WebKit::WebPageProxy::didDetectXSSForFrame):
3229         (WebKit::WebPageProxy::webGLPolicyForURL):
3230         (WebKit::WebPageProxy::processDidBecomeUnresponsive):
3231         (WebKit::WebPageProxy::interactionOccurredWhileProcessUnresponsive):
3232         (WebKit::WebPageProxy::processDidBecomeResponsive):
3233         (WebKit::WebPageProxy::processDidCrash):
3234         (WebKit::WebPageProxy::canAuthenticateAgainstProtectionSpaceInFrame):
3235         (WebKit::WebPageProxy::didReceiveAuthenticationChallengeProxy):
3236         (WebKit::WebPageProxy::didFailToInitializePlugin):
3237         (WebKit::WebPageProxy::didBlockInsecurePluginVersion):
3238         * UIProcess/WebPageProxy.h:
3239         (WebKit::WebPageProxy::loaderClient):
3240         * WebKit2.xcodeproj/project.pbxproj:
3241
3242 2014-01-23  Ryuan Choi  <ryuan.choi@samsung.com>
3243
3244         Build break after r162650
3245         https://bugs.webkit.org/show_bug.cgi?id=127525
3246
3247         Reviewed by Anders Carlsson.
3248
3249         WKPreferences.h was renamed to WKPreferencesRef.
3250
3251         * UIProcess/API/C/WKPreferences.cpp:
3252
3253 2014-01-23  Anders Carlsson  <andersca@apple.com>
3254
3255         Fix a refactoring bug that crept in and is causing the inspector to crash.
3256
3257         * UIProcess/WebPolicyClient.cpp:
3258         (WebKit::WebPolicyClient::decidePolicyForResponse):
3259
3260 2014-01-23  Simon Fraser  <simon.fraser@apple.com>
3261
3262         Make visibleContentRect() return actualVisibleContentRect() on iOS most of the time
3263         https://bugs.webkit.org/show_bug.cgi?id=127456
3264         
3265         Reviewed by Antti Koivisto.
3266         
3267         On iOS, visibleContentRect() returns the entire document rect for historical
3268         reasons, and actualVisibleContentRect() returns what visibleContentRect()
3269         returns on other platforms.
3270         
3271         In addition, actualVisibleContentRect() was returning an empty rect in WK2.
3272         
3273         Reduce the confusion of #ifdefs by making visibleContentRect() behave like
3274         actualVisibleContentRect() by default on iOS. Where it needs the old behavior,
3275         an optional parameter, LegacyIOSDocumentVisibleRect, provides this.
3276         
3277         Achieve this by having the virtual ScrollableArea::visibleContentRectInternal(),
3278         which is called by non-virtual visibleContentRect() and visibleContentRectIncludingScrollbars().
3279         
3280         Similarly clean up visibleHeight/visibleWidth functions by having visibleSize() be virtual,
3281         with non-virtual visibleHeight() and visibleWidth().
3282         
3283         ScrollableArea subclasses override visibleContentRectInternal() and visibleSize() where necessary.
3284         
3285         Mechanically change all the call sites of actualVisibleContentRect() to
3286         use visibleContentRect(), and the call sites of visibleContentRect()
3287         to visibleContentRect(..., LegacyIOSDocumentVisibleRect), adding comments
3288         where this may not be appropriate.
3289         
3290         Change callers of visibleContentRect(IncludeScrollbars...) to visibleContentRectIncludingScrollbars().
3291         
3292         Also add actualScrollPosition(), and clean up some actualScroll* call sites.
3293         
3294         No behavior change.
3295
3296         * WebProcess/Plugins/PDF/PDFPlugin.h:
3297         * WebProcess/WebPage/ViewGestureGeometryCollector.cpp:
3298         (WebKit::ViewGestureGeometryCollector::collectGeometryForMagnificationGesture):
3299         (WebKit::ViewGestureGeometryCollector::collectGeometryForSmartMagnificationGesture):
3300         * WebProcess/WebPage/WebFrame.cpp:
3301         (WebKit::WebFrame::visibleContentBounds):
3302         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
3303         (WebKit::TiledCoreAnimationDrawingArea::commitTransientZoom):
3304         (WebKit::TiledCoreAnimationDrawingArea::applyTransientZoomToPage):
3305
3306 2014-01-23  Tim Horton  <timothy_horton@apple.com>
3307
3308         [wk2] Page Overlays: Add API to clear the page overlay (and get rid of its backing store)
3309         https://bugs.webkit.org/show_bug.cgi?id=127518
3310
3311         Reviewed by Anders Carlsson.
3312
3313         Add WKBundlePageOverlayClear, to allow clients of the page overlay API to
3314         manually clear the page overlay's backing store, for memory, power, and performance gains.
3315
3316         * WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:
3317         (WKBundlePageOverlayClear):
3318         * WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.h:
3319         * WebProcess/WebPage/DrawingArea.h:
3320         (WebKit::DrawingArea::clearPageOverlay):
3321         * WebProcess/WebPage/PageOverlay.cpp:
3322         (WebKit::PageOverlay::clear):
3323         * WebProcess/WebPage/PageOverlay.h:
3324         Add WKBundlePageOverlayClear and plumb it through PageOverlay to the DrawingArea.
3325
3326         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
3327         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
3328         (WebKit::RemoteLayerTreeDrawingArea::clearPageOverlay):
3329         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
3330         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
3331         (WebKit::TiledCoreAnimationDrawingArea::clearPageOverlay):
3332         Set the layer to drawsContent=false and give it 0x0 size, effectively
3333         removing its backing store.
3334
3335 2014-01-23  Anders Carlsson  <andersca@apple.com>
3336
3337         Explicitly link XPC services with AppKit
3338         https://bugs.webkit.org/show_bug.cgi?id=127520
3339         <rdar://problem/15759718>
3340
3341         Reviewed by Mark Rowe.
3342
3343         Explicitly link XPC services that use the _NSApplicationMain run loop type with AppKit.
3344
3345         * Configurations/PluginService.32.xcconfig:
3346         * Configurations/PluginService.64.xcconfig:
3347         * Configurations/PluginService.Development.xcconfig:
3348         * Configurations/WebContentService.Development.xcconfig:
3349         * Configurations/WebContentService.xcconfig:
3350
3351 2014-01-23  Anders Carlsson  <andersca@apple.com>
3352
3353         Fix build again.
3354
3355         * UIProcess/API/mac/WKView.mm:
3356         (-[WKView _windowDidChangeBackingProperties:]):
3357
3358 2014-01-23  Anders Carlsson  <andersca@apple.com>
3359
3360         Another 32-bit build fix.
3361
3362         * UIProcess/API/mac/WKView.mm:
3363         (-[WKView _windowDidChangeBackingProperties:]):
3364
3365 2014-01-23  Anders Carlsson  <andersca@apple.com>
3366
3367         Clean up WKView.mm a little
3368         https://bugs.webkit.org/show_bug.cgi?id=127517
3369
3370         Reviewed by Tim Horton.
3371
3372         Remove an unused ivar and migrate to API constants that were added in Lion.
3373
3374         * UIProcess/API/mac/WKView.mm:
3375         (-[WKView setFrameSize:]):
3376         (-[WKView addWindowObserversForWindow:]):
3377         (-[WKView removeWindowObservers]):
3378         (-[WKView viewDidMoveToWindow]):
3379         (-[WKView _windowDidMiniaturize:]):
3380         (-[WKView _windowDidResize:]):
3381         (-[WKView _windowDidChangeBackingProperties:]):
3382
3383 2014-01-23  Anders Carlsson  <andersca@apple.com>
3384
3385         Try to fix the 32-bit build.
3386
3387         * UIProcess/API/Cocoa/WKPreferences.mm:
3388
3389 2014-01-23  Anders Carlsson  <andersca@apple.com>
3390
3391         Remove an unneeded synchronous back/forward message
3392         https://bugs.webkit.org/show_bug.cgi?id=127516
3393
3394         Reviewed by Tim Horton.
3395
3396         * UIProcess/WebLoaderClient.cpp:
3397         * UIProcess/WebLoaderClient.h:
3398         * UIProcess/WebPageProxy.cpp:
3399         (WebKit::WebPageProxy::initializeLoaderClient):
3400         * UIProcess/WebPageProxy.h:
3401         * UIProcess/WebPageProxy.messages.in:
3402         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3403         (WebKit::WebFrameLoaderClient::shouldGoToHistoryItem):
3404         * WebProcess/WebPage/WebPage.cpp:
3405         (WebKit::WebPage::WebPage):
3406         * WebProcess/WebPage/WebPage.h:
3407         * WebProcess/WebPage/WebPage.messages.in:
3408
3409 2014-01-23  Anders Carlsson  <andersca@apple.com>
3410
3411         Rename WKPreferences.h to WKPreferencesRef.h and add a stubbed out WKPreferences class
3412         https://bugs.webkit.org/show_bug.cgi?id=127512
3413
3414         Reviewed by Dan Bernstein.
3415
3416         * UIProcess/API/C/WKAPICast.h:
3417         * UIProcess/API/C/WKPreferencesRef.h: Renamed from Source/WebKit2/UIProcess/API/C/WKPreferences.h.
3418         * UIProcess/API/C/WebKit2_C.h:
3419         * UIProcess/API/Cocoa/WKPreferences.h: Added.
3420         * UIProcess/API/Cocoa/WKPreferences.mm: Added.
3421         * WebKit2.xcodeproj/project.pbxproj:
3422
3423 2014-01-23  Max Vujovic  <mvujovic@adobe.com>
3424
3425         Remove CSS Custom Filters code and tests
3426         https://bugs.webkit.org/show_bug.cgi?id=127382
3427
3428         Reviewed by Simon Fraser.
3429
3430         * CMakeLists.txt:
3431         * Configurations/FeatureDefines.xcconfig:
3432         * Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp:
3433         (IPC::ArgumentCoder<WebCore::FilterOperations>::encode):
3434         (IPC::ArgumentCoder<WebCore::FilterOperations>::decode):
3435         (IPC::ArgumentCoder<CoordinatedGraphicsState>::encode):
3436         (IPC::ArgumentCoder<CoordinatedGraphicsState>::decode):
3437         * Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.h:
3438         * Shared/CoordinatedGraphics/WebCustomFilterProgramProxy.cpp: Removed.
3439         * Shared/CoordinatedGraphics/WebCustomFilterProgramProxy.h: Removed.
3440         * Shared/WebCoreArgumentCoders.cpp:
3441         (IPC::encodeFilterOperation):
3442         (IPC::decodeFilterOperation):
3443         * Shared/WebPreferencesStore.h:
3444         * Shared/mac/RemoteLayerTreeTransaction.mm:
3445         (WebKit::RemoteLayerTreeTextStream::operator<<):
3446         * UIProcess/API/C/WKPreferences.cpp:
3447         * UIProcess/API/C/WKPreferencesPrivate.h:
3448         * WebProcess/InjectedBundle/InjectedBundle.cpp:
3449         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
3450         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
3451         (WebKit::CoordinatedLayerTreeHost::~CoordinatedLayerTreeHost):
3452         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
3453         * WebProcess/WebPage/WebPage.cpp:
3454         (WebKit::WebPage::updatePreferences):
3455         * mac/WebKit2.order:
3456
3457 2014-01-23  Anders Carlsson  <andersca@apple.com>
3458
3459         Add API::PolicyClient base class
3460         https://bugs.webkit.org/show_bug.cgi?id=127509
3461
3462         Reviewed by Tim Horton.
3463
3464         * UIProcess/API/APIPolicyClient.h: Copied from Source/WebKit2/UIProcess/WebPolicyClient.h.
3465         (API::PolicyClient::~PolicyClient):
3466         * UIProcess/API/C/WKPage.cpp:
3467         (WKPageSetPagePolicyClient):
3468         * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
3469         (setUpPagePolicyClient):
3470         (-[WKBrowsingContextController setPolicyDelegate:]):
3471         * UIProcess/WebInspectorProxy.cpp:
3472         (WebKit::WebInspectorProxy::createInspectorPage):
3473         * UIProcess/WebPageProxy.cpp:
3474         (WebKit::WebPageProxy::setPolicyClient):
3475         (WebKit::WebPageProxy::close):
3476         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
3477         (WebKit::WebPageProxy::decidePolicyForNewWindowAction):
3478         (WebKit::WebPageProxy::decidePolicyForResponse):
3479         (WebKit::WebPageProxy::unableToImplementPolicy):
3480         * UIProcess/WebPageProxy.h:
3481         * UIProcess/WebPolicyClient.cpp:
3482         (WebKit::WebPolicyClient::WebPolicyClient):
3483         (WebKit::WebPolicyClient::decidePolicyForNavigationAction):
3484         (WebKit::WebPolicyClient::decidePolicyForNewWindowAction):
3485         (WebKit::WebPolicyClient::decidePolicyForResponse):
3486         * UIProcess/WebPolicyClient.h:
3487         * WebKit2.xcodeproj/project.pbxproj:
3488
3489 2014-01-23  Anders Carlsson  <andersca@apple.com>
3490
3491         Add init methods that create default configurations
3492         https://bugs.webkit.org/show_bug.cgi?id=127503
3493
3494         Reviewed by Dan Bernstein.
3495
3496         * UIProcess/API/Cocoa/WKProcessClass.mm:
3497         (-[WKProcessClass init]):
3498         * UIProcess/API/Cocoa/WKWebView.mm:
3499         (-[WKWebView initWithFrame:]):
3500
3501 2014-01-23  Brady Eidson  <beidson@apple.com>
3502
3503         IDB: Implement cross-thread and IPC plumbing for 'get' support
3504         https://bugs.webkit.org/show_bug.cgi?id=127501
3505
3506         Reviewed by Anders Carlsson.
3507
3508         Make the WebProcess call out to the DatabaseProcess with a get request, and handle the
3509         response from the DatabaseProcess:
3510         * WebProcess/Databases/IndexedDB/WebIDBServerConnection.cpp:
3511         (WebKit::WebIDBServerConnection::get):
3512         (WebKit::WebIDBServerConnection::didGetRecord):
3513         * WebProcess/Databases/IndexedDB/WebIDBServerConnection.h:
3514         * WebProcess/Databases/IndexedDB/WebIDBServerConnection.messages.in:
3515
3516         Get the request from the WebProcess and forward it to the appropriate unique IDB database:
3517         * DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.cpp:
3518         (WebKit::DatabaseProcessIDBConnection::getRecord):
3519         * DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.h:
3520         * DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.messages.in:
3521
3522         Forward the request to the database thread, and response to the result from that thread:
3523         * DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:
3524         (WebKit::UniqueIDBDatabase::getRecord):
3525         (WebKit::UniqueIDBDatabase::getRecordFromBackingStore):
3526         (WebKit::UniqueIDBDatabase::didGetRecordFromBackingStore):
3527         * DatabaseProcess/IndexedDB/UniqueIDBDatabase.h:
3528
3529         IPC and asynchronous request infrastructure:
3530         * Scripts/webkit2/messages.py:
3531         (struct_or_class):
3532
3533         * Shared/AsyncTask.h:
3534         (WebKit::createAsyncTask):
3535
3536         * Shared/WebCoreArgumentCoders.cpp:
3537         (IPC::ArgumentCoder<IDBGetResult>::encode):
3538         (IPC::ArgumentCoder<IDBGetResult>::decode):
3539         (IPC::ArgumentCoder<IDBKeyRangeData>::encode):
3540         (IPC::ArgumentCoder<IDBKeyRangeData>::decode):
3541         * Shared/WebCoreArgumentCoders.h:
3542
3543 2014-01-23  Tim Horton  <timothy_horton@apple.com>
3544
3545         PDFPlugin: Use PDFPlugin even if there's an external plugin installed, if it's blocked
3546         https://bugs.webkit.org/show_bug.cgi?id=127415
3547         <rdar://problem/12482452>
3548
3549         Reviewed by Sam Weinig.
3550
3551         Allow use of PDFPlugin even if an external plugin is installed but blocked.
3552         If an external plugin is installed and not blocked, we will continue to use that.
3553
3554         Inject a context menu item into the PDFPlugin context menu that allows the client
3555         to unblock the plugin and reload the page (via the same mechanism that the
3556         unavailable plugin button uses).
3557
3558         * UIProcess/API/C/WKPageLoaderClient.h:
3559         * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
3560         (setUpPageLoaderClient):
3561         * UIProcess/WebLoaderClient.cpp:
3562         (WebKit::WebLoaderClient::pluginLoadPolicy):
3563         * UIProcess/WebLoaderClient.h:
3564         * UIProcess/WebPageProxy.cpp:
3565         (WebKit::WebPageProxy::findPlugin):
3566         * UIProcess/WebPageProxy.h:
3567         * UIProcess/WebPageProxy.messages.in:
3568         Add a new PluginLoadPolicy callback for the V4 client with
3569         yet another string out-argument, to allow clients to customize the string
3570         that will appear in the PDFPlugin context menu when it is used in place
3571         of a blocked plugin.
3572
3573         * WebProcess/Plugins/PDF/PDFPlugin.h:
3574         Add setUsedInPlaceOfBlockedPlugin(), which determines whether or not
3575         we should include an item in the PDFPlugin context menu that acts identically
3576         to the unavailable plugin button, allowing the client to potentially unblock
3577         the plugin.
3578
3579         * WebProcess/Plugins/PDF/PDFPlugin.mm:
3580         (-[WKPDFPluginContextMenuTarget initWithPDFPlugin:WebKit::]):
3581         (-[WKPDFPluginContextMenuTarget useBlockedPlugin:]):
3582         Added WKPDFPluginContextMenuTarget, which is the Objective-C object that the
3583         aforementioned context menu item targets.
3584
3585         (WebKit::PDFPlugin::PDFPlugin):
3586         By default, we won't show the extra context menu item.
3587
3588         (WebKit::PDFPlugin::handleContextMenuEvent):
3589         If we were used in place of a blocked plugin, inject our additional context
3590         menu item into the menu. If we were handed a custom string via setUsedInPlaceOfBlockedPlugin,
3591         use that. Otherwise, use the generic string from WebCore's localized strings.
3592
3593         (WebKit::PDFPlugin::openWithPlugin):
3594         Pretend that the user clicked the unavailable plugin button when they click
3595         the injected context menu item.
3596
3597         (WebKit::PDFPlugin::setUsedInPlaceOfBlockedPlugin):
3598
3599         * WebProcess/WebPage/WebPage.cpp:
3600         (WebKit::WebPage::createPlugin):
3601         If we end up with a blocked plugin, but could have used PDFPlugin to display
3602         the content, do so instead of showing the unavailable plugin indicator.
3603
3604         Pass PDFPlugin the custom context menu item title acquired from the client.
3605
3606         (WebKit::WebPage::canPluginHandleResponse):
3607
3608 2014-01-23  Tim Horton  <timothy_horton@apple.com>
3609
3610         [iOS] [WK2] WKContentView has a black background
3611         https://bugs.webkit.org/show_bug.cgi?id=127471
3612         <rdar://problem/12287363>
3613
3614         Reviewed by Sam Weinig.
3615
3616         * UIProcess/API/ios/WKContentView.mm:
3617         (-[WKContentView _commonInitializationWithContextRef:pageGroupRef:relatedToPage:]):
3618         Instead of giving it a (black!) background to make hit-testing work, use CALayer SPI
3619         to tell CA that the whole layer should be treated as opaque when it comes to hit-testing.
3620
3621 2014-01-22  Carlos Garcia Campos  <cgarcia@igalia.com>
3622
3623         [GLIB] Use GUniquePtr instead of GOwnPtr
3624         https://bugs.webkit.org/show_bug.cgi?id=127431
3625
3626         Reviewed by Martin Robinson.
3627
3628         GUniquePtr is a template alias of std::unique_ptr with a custom
3629         deleter that replaces GOwnPtr. GOwnPtr is still used for the cases
3630         where the output pointer is needed, but it will also be replaced soon.
3631
3632         * Shared/Downloads/soup/DownloadSoup.cpp:
3633         (WebKit::DownloadClient::didReceiveResponse):
3634         * Shared/NativeWebKeyboardEvent.h:
3635         * Shared/NativeWebMouseEvent.h:
3636         * Shared/NativeWebWheelEvent.h:
3637         * Shared/gtk/ArgumentCodersGtk.cpp:
3638         (IPC::encodeGKeyFile):
3639         (IPC::decodeGKeyFile):
3640         (IPC::encode):
3641         (IPC::decode):
3642         * UIProcess/API/gtk/WebKitContextMenuItem.cpp:
3643         (webkitContextMenuItemSetSubMenuFromGtkMenu):
3644         * UIProcess/API/gtk/WebKitDownload.cpp:
3645         (webkitDownloadDecideDestination):
3646         (webkitDownloadNotifyProgress):
3647         (webkitDownloadFailed):
3648         * UIProcess/API/gtk/WebKitFileChooserRequest.cpp:
3649         (webkit_file_chooser_request_select_files):
3650         * UIProcess/API/gtk/WebKitInjectedBundleClient.cpp:
3651         (didReceiveWebViewMessageFromInjectedBundle):
3652         (getInjectedBundleInitializationUserData):
3653         * UIProcess/API/gtk/WebKitLoaderClient.cpp:
3654         (didFailProvisionalLoadWithErrorForFrame):
3655         (didFailLoadWithErrorForFrame):
3656         * UIProcess/API/gtk/WebKitPrintOperation.cpp:
3657         (drawPagesForPrintingCompleted):
3658         * UIProcess/API/gtk/WebKitURIRequest.cpp:
3659         (webkit_uri_request_get_http_headers):
3660         * UIProcess/API/gtk/WebKitURISchemeRequest.cpp:
3661         (webkit_uri_scheme_request_get_scheme):
3662         (webkit_uri_scheme_request_get_path):
3663         * UIProcess/API/gtk/WebKitWebContext.cpp:
3664         (injectedBundleFilename):
3665         (webkit_web_context_set_favicon_database_directory):
3666         * UIProcess/API/gtk/WebKitWebView.cpp:
3667         (webkitWebViewLoadFail):
3668         (webkitWebViewCreateJavaScriptDialog):
3669         (fileChooserDialogResponseCallback):
3670         (webkitWebViewLoadChanged):
3671         (webkitWebViewLoadFailedWithTLSErrors):
3672         (webkitWebViewPopulateContextMenu):
3673         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
3674         (webkitWebViewBaseButtonPressEvent):
3675         (webkitWebViewBaseStartDrag):
3676         * UIProcess/InspectorServer/gtk/WebInspectorServerGtk.cpp:
3677         (WebKit::WebInspectorServer::platformResourceForPath):
3678         * UIProcess/InspectorServer/soup/WebSocketServerSoup.cpp:
3679         (WebKit::connectionCallback):
3680         * UIProcess/Launcher/gtk/ProcessLauncherGtk.cpp:
3681         (WebKit::ProcessLauncher::launchProcess):
3682         * UIProcess/gtk/WebContextGtk.cpp:
3683         (WebKit::WebContext::platformDefaultApplicationCacheDirectory):
3684         (WebKit::WebContext::platformDefaultDatabaseDirectory):
3685         (WebKit::WebContext::platformDefaultIconDatabasePath):
3686         (WebKit::WebContext::platformDefaultLocalStorageDirectory):
3687         (WebKit::WebContext::platformDefaultDiskCacheDirectory):
3688         * UIProcess/gtk/WebContextMenuProxyGtk.cpp:
3689         (WebKit::contextMenuItemVisibilityChanged):
3690         * UIProcess/gtk/WebInspectorProxyGtk.cpp:
3691         (WebKit::WebInspectorProxy::platformInspectedURLChanged):
3692         * UIProcess/gtk/WebPopupMenuProxyGtk.cpp:
3693         (WebKit::WebPopupMenuProxyGtk::createGtkActionForMenuItem):
3694         * WebProcess/WebPage/gtk/WebInspectorGtk.cpp:
3695         * WebProcess/WebPage/gtk/WebPageGtk.cpp:
3696         (WebKit::WebPage::platformInitialize):
3697         * WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp:
3698         * WebProcess/gtk/WebProcessMainGtk.cpp:
3699         * WebProcess/soup/WebSoupRequestManager.cpp:
3700         (WebKit::WebSoupRequestManager::send):
3701
3702 2014-01-22  Simon Fraser  <simon.fraser@apple.com>
3703
3704         Surround fixedVisibleContentRect code with USE(TILED_BACKING_STORE)
3705         https://bugs.webkit.org/show_bug.cgi?id=127461
3706
3707         Reviewed by Andreas Kling.
3708         
3709         The "fixedVisibleContentRect" code path is only used by platforms
3710         which enabled TILED_BACKING_STORE, so to reduce confusion, surround
3711         this code with #if USE(TILED_BACKING_STORE).
3712
3713         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3714         (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage):
3715
3716 2014-01-22  Benjamin Poulain  <bpoulain@apple.com>
3717
3718         Add a minimalistic SPI to control the layout size outside of WKView
3719         https://bugs.webkit.org/show_bug.cgi?id=127403
3720
3721         Reviewed by Sam Weinig.
3722
3723         The API lets a client of WKView force the layout size. Once the size
3724         is set this way, default update is disabled and the client needs to
3725         update the size systematically as needed. This is done to avoid double
3726         layout or flickering.
3727
3728         * UIProcess/API/Cocoa/WKViewPrivate.h:
3729         * UIProcess/API/ios/WKViewIOS.mm:
3730         (-[WKView _frameOrBoundsChanged]):
3731         (-[WKView overrideMinimumLayoutSize:]):
3732
3733 2014-01-22  Jinwoo Song  <jinwoo7.song@samsung.com>
3734
3735         [EFL][WK2] defaultTextEncodingName should be stored as a member variable of EwkSettings
3736         https://bugs.webkit.org/show_bug.cgi?id=127420
3737
3738         Reviewed by Gyuyoung Kim.
3739
3740         As the defaultTextEncodingName is returned as a local WKEinaSharedString variable, 
3741         the stringshared data is de-refed by eina_stringshare_del().
3742         To maintain the reference counter, the defaultTextEncodingName should be stored 
3743         as a member variable of EwkSettings class.
3744
3745         * UIProcess/API/efl/ewk_settings.cpp:
3746         (ewk_settings_encoding_detector_enabled_get): Reordering.
3747         (ewk_settings_default_text_encoding_name_set):
3748         (ewk_settings_default_text_encoding_name_get):
3749         (EwkSettings::setDefaultTextEncodingName):
3750         (EwkSettings::defaultTextEncodingName):
3751         * UIProcess/API/efl/ewk_settings_private.h:
3752         (EwkSettings::EwkSettings): Add m_defaultTextEncodingName and setter/getter methods.
3753
3754 2014-01-22  Enrica Casucci  <enrica@apple.com>
3755
3756         Support WebSelections in WK2 on iOS.
3757         https://bugs.webkit.org/show_bug.cgi?id=127015
3758         <rdar://problem/15211964>
3759
3760         Reviewed by Benjamin Poulain.
3761
3762         This change adds support for text only (non block mode)
3763         selections in non editable content.
3764         The main changes consist in hooking up the new gesture type
3765         and touches to handle selection creation and interaction.
3766         It also includes changes to the way first responder is handled
3767         which includes the implementation of the isEditable method
3768         to allow iOS to know when to show the keyboard.
3769
3770         * Shared/ios/WKGestureTypes.h:
3771         * UIProcess/API/ios/WKInteractionView.mm:
3772         (-[WKInteractionView isEditable]):
3773         (-[WKInteractionView canBecomeFirstResponder]):
3774         (-[WKInteractionView webSelectionRects]):
3775         (-[WKInteractionView _highlightLongPressRecognized:]):
3776         (-[WKInteractionView _singleTapRecognized:]):
3777         (-[WKInteractionView inputAccessoryView]):
3778         (-[WKInteractionView canPerformAction:withSender:]):
3779         (-[WKInteractionView _showDictionary:]):
3780         (toWKGestureType):
3781         (toUIWKGestureType):
3782         (selectionChangedWithGesture):
3783         (selectionChangedWithTouch):
3784         (-[WKInteractionView selectedTextRange]):
3785         (-[WKInteractionView webSelectionAssistant]):
3786         (-[WKInteractionView _startAssistingNode]):
3787         (-[WKInteractionView _stopAssistingNode]):
3788         (-[WKInteractionView _selectionChanged]):
3789         * WebProcess/WebPage/ios/WebPageIOS.mm:
3790         (WebKit::WebPage::selectWithGesture):
3791         (WebKit::WebPage::updateSelectionWithTouches):
3792
3793 2014-01-22  Anders Carlsson  <andersca@apple.com>
3794
3795         WKBrowsingContextController should not be an API wrapper around WebPageProxy
3796         https://bugs.webkit.org/show_bug.cgi?id=127454
3797
3798         Reviewed by Dan Bernstein.
3799
3800         * Shared/Cocoa/APIObject.mm:
3801         (API::Object::newObject):
3802         * Shared/mac/ObjCObjectGraphCoders.mm:
3803         (WebKit::WebContextObjCObjectGraphDecoderImpl::decode):
3804         * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
3805         (-[WKBrowsingContextController _initWithPageRef:]):
3806         (+[WKBrowsingContextController _browsingContextControllerForPageRef:]):
3807         * UIProcess/API/Cocoa/WKBrowsingContextControllerInternal.h:
3808         * UIProcess/API/Cocoa/WKProcessGroup.mm:
3809         (didNavigateWithNavigationData):
3810         (didPerformClientRedirect):
3811         (didPerformServerRedirect):
3812         (didUpdateHistoryTitle):
3813         * UIProcess/API/ios/WKContentView.mm:
3814         (-[WKContentView browsingContextController]):
3815         * UIProcess/API/mac/WKView.mm:
3816         (-[WKView browsingContextController]):
3817         * UIProcess/ios/WebPageProxyIOS.mm:
3818         (WebKit::WebPageProxy::platformInitialize):
3819         * UIProcess/mac/WebPageProxyMac.mm:
3820         (WebKit::WebPageProxy::platformInitialize):
3821
3822 2014-01-22  Myles C. Maxfield  <mmaxfield@apple.com>
3823
3824         Remove CSS3_TEXT_DECORATION define
3825         https://bugs.webkit.org/show_bug.cgi?id=127333
3826
3827         Reviewed by Simon Fraser.
3828
3829         This is required for unprefixing the text-decoration-* CSS properties.
3830
3831         * Configurations/FeatureDefines.xcconfig:
3832
3833 2014-01-22  Gavin Barraclough  <barraclough@apple.com>
3834
3835         Debug mechanism to override process QoS on Mac
3836         https://bugs.webkit.org/show_bug.cgi?id=127455
3837
3838         Reviewed by Anders Carlsson.
3839
3840         * NetworkProcess/NetworkProcess.messages.in:
3841             - added message.
3842         * PluginProcess/PluginProcess.messages.in:
3843             - added message.
3844         * Shared/ChildProcess.h:
3845         * Shared/mac/ChildProcessMac.mm:
3846         (WebKit::ChildProcess::setQOS):
3847             - Added implementation of new message.
3848         * UIProcess/Plugins/PluginProcessProxy.cpp:
3849         (WebKit::PluginProcessProxy::didFinishLaunching):
3850             - SetQOS for the PluginProcess.
3851         * UIProcess/Plugins/PluginProcessProxy.h:
3852         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
3853         (WebKit::pluginProcessLatencyQOS):
3854         (WebKit::pluginProcessThroughputQOS):
3855             - read NSUserDefaults.
3856         * UIProcess/WebContext.cpp:
3857         (WebKit::WebContext::ensureNetworkProcess):
3858             - SetQOS for the NetworkProcess.
3859         (WebKit::WebContext::createNewWebProcess):
3860             - SetQOS for the WebProcess.
3861         * UIProcess/WebContext.h:
3862         * UIProcess/mac/WebContextMac.mm:
3863         (WebKit::networkProcessLatencyQOS):
3864         (WebKit::networkProcessThroughputQOS):
3865         (WebKit::webProcessLatencyQOS):
3866         (WebKit::webProcessThroughputQOS):
3867             - read NSUserDefaults.
3868         * WebProcess/WebProcess.messages.in:
3869             - added message.
3870
3871 2014-01-22  David Farler  <dfarler@apple.com>
3872
3873         ASAN builds are broken - missing flags
3874         https://bugs.webkit.org/show_bug.cgi?id=127231
3875
3876         Reviewed by Andy Estes.
3877
3878         Add missing $(ASAN_OTHER_LDFLAGS).
3879         * Configurations/PluginProcessShim.xcconfig:
3880         * Configurations/SecItemShim.xcconfig:
3881         * Configurations/WebKit2.xcconfig:
3882         * Configurations/WebProcessShim.xcconfig:
3883
3884 2014-01-22  Brady Eidson  <beidson@apple.com>
3885
3886         The IDB backing store get() method shouldn't call IDB callbacks directly
3887         https://bugs.webkit.org/show_bug.cgi?id=127453
3888         
3889         Reviewed by Beth Dakin.
3890
3891         * WebProcess/Databases/IndexedDB/WebIDBServerConnection.cpp:
3892         (WebKit::WebIDBServerConnection::get):
3893         * WebProcess/Databases/IndexedDB/WebIDBServerConnection.h:
3894
3895 2014-01-22  Martin Hock  <mhock@apple.com>
3896
3897         Enable Session API.
3898         https://bugs.webkit.org/show_bug.cgi?id=127255
3899
3900         Reviewed by Alexey Proskuryakov.
3901
3902         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
3903         (WebKit::storageSession):
3904         * NetworkProcess/NetworkResourceLoader.cpp:
3905         (WebKit::NetworkResourceLoader::NetworkResourceLoader):
3906         (WebKit::NetworkResourceLoader::start):
3907         * NetworkProcess/NetworkResourceLoader.h:
3908         * NetworkProcess/RemoteNetworkingContext.h:
3909         * NetworkProcess/mac/RemoteNetworkingContext.mm:
3910         (WebKit::RemoteNetworkingContext::storageSession):
3911         (WebKit::RemoteNetworkingContext::ensurePrivateBrowsingSession):
3912         * Shared/Network/NetworkResourceLoadParameters.cpp:
3913         (WebKit::NetworkResourceLoadParameters::NetworkResourceLoadParameters):
3914         (WebKit::NetworkResourceLoadParameters::encode):
3915         (WebKit::NetworkResourceLoadParameters::decode):
3916         * Shared/Network/NetworkResourceLoadParameters.h:
3917         * Shared/SessionTracker.cpp:
3918         (WebKit::staticSessionMap):
3919         (WebKit::SessionTracker::sessionMap):
3920         (WebKit::SessionTracker::session):
3921         (WebKit::SessionTracker::setSession):
3922         (WebKit::SessionTracker::destroySession):
3923         * Shared/SessionTracker.h:
3924         * UIProcess/API/C/WKPage.cpp:
3925         (WKPageSetSession):
3926         * UIProcess/API/C/WKPage.h:
3927         * UIProcess/API/C/WKSessionRef.cpp:
3928         (WKSessionCreate):
3929         * UIProcess/API/C/WKSessionRef.h:
3930         * UIProcess/WebPageProxy.cpp:
3931         (WebKit::WebPageProxy::WebPageProxy):
3932         (WebKit::WebPageProxy::setSession):
3933         * UIProcess/WebPageProxy.h:
3934         * WebProcess/Network/WebResourceLoadScheduler.cpp:
3935         (WebKit::WebResourceLoadScheduler::scheduleLoad):
3936         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
3937         (WebKit::WebPlatformStrategies::loadResourceSynchronously):
3938         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
3939         (WebKit::WebFrameNetworkingContext::ensurePrivateBrowsingSession):
3940         (WebKit::WebFrameNetworkingContext::setCookieAcceptPolicyForAllContexts):
3941         (WebKit::WebFrameNetworkingContext::storageSession):
3942         * WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.cpp:
3943         (WebKit::WebFrameNetworkingContext::ensurePrivateBrowsingSession):
3944         * WebProcess/WebPage/WebFrame.cpp:
3945         (WebKit::WebFrame::startDownload):
3946         * WebProcess/WebPage/WebPage.cpp:
3947         (WebKit::WebPage::WebPage):
3948         (WebKit::WebPage::sessionID):
3949         (WebKit::WebPage::updatePreferences):
3950         * WebProcess/WebPage/WebPage.h:
3951         (WebKit::WebPage::setSessionID):
3952         * WebProcess/WebPage/WebPage.messages.in:
3953
3954 2014-01-21  Brady Eidson  <beidson@apple.com>
3955
3956         IDB: "Put" support
3957         <rdar://problem/15779643> and https://bugs.webkit.org/show_bug.cgi?id=127401
3958
3959         Reviewed by Alexey Proskuryakov.
3960
3961         Ship putRecord requests over to the DatabaseProcess, and listen for completion from the DatabaseProcess:
3962         * WebProcess/Databases/IndexedDB/WebIDBServerConnection.cpp:
3963         (WebKit::WebIDBServerConnection::put):
3964         (WebKit::WebIDBServerConnection::didPutRecord):
3965         * WebProcess/Databases/IndexedDB/WebIDBServerConnection.h:
3966         * WebProcess/Databases/IndexedDB/WebIDBServerConnection.messages.in:
3967
3968         Pass off the putRecord request to the Unique IDBDatabase:
3969         * DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.cpp:
3970         (WebKit::DatabaseProcessIDBConnection::putRecord):
3971         * DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.h:
3972         * DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.messages.in:
3973
3974         Pass off the putRecord request to the backing store:
3975         * DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:
3976         (WebKit::UniqueIDBDatabase::putRecord):
3977         (WebKit::UniqueIDBDatabase::putRecordInBackingStore):
3978         (WebKit::UniqueIDBDatabase::didPutRecordInBackingStore):
3979         * DatabaseProcess/IndexedDB/UniqueIDBDatabase.h:
3980
3981         Add backing store methods related to putRecord, though only one is critical right now:
3982         * DatabaseProcess/IndexedDB/UniqueIDBDatabaseBackingStore.h:
3983         * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp:
3984         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::createAndPopulateInitialMetadata):
3985         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::generateKey):
3986         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::keyExistsInObjectStore):
3987         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::putRecord):
3988         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::updateKeyGenerator):
3989         * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.h:
3990
3991         Add the IDBKeyData type to IPC:
3992         * Scripts/webkit2/messages.py:
3993         (struct_or_class):
3994
3995         * Shared/WebCoreArgumentCoders.cpp:
3996         (IPC::ArgumentCoder<IDBKeyData>::encode):
3997         (IPC::ArgumentCoder<IDBKeyData>::decode):
3998         * Shared/WebCoreArgumentCoders.h:
3999
4000         * DatabaseProcess/IndexedDB/IDBSerialization.cpp:
4001         (WebKit::serializeIDBKey):
4002         * DatabaseProcess/IndexedDB/IDBSerialization.h:
4003
4004         Implement more cross-thread copying:
4005         * Shared/WebCrossThreadCopier.cpp:
4006         (WebCore::Vector<uint8_t>>::copy):
4007         (WebCore::Vector<Vector<IDBKeyData>>>::copy):
4008         (WebCore::ASCIILiteral>::copy):
4009         * Shared/WebCrossThreadCopier.h:
4010
4011         Implement more numbers of generic AsyncTask templates:
4012         * Shared/AsyncTask.h:
4013         (WebKit::createAsyncTask):
4014
4015 2014-01-22  Anders Carlsson  <andersca@apple.com>
4016
4017         WKProcessClass should create a WebContext
4018         https://bugs.webkit.org/show_bug.cgi?id=127449
4019         <rdar://problem/15885582>
4020
4021         Reviewed by Dan Bernstein.
4022
4023         * Shared/Cocoa/APIObject.mm:
4024         (API::Object::newObject):
4025         * UIProcess/API/Cocoa/WKBrowsingContextController.h:
4026         * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
4027         * UIProcess/API/Cocoa/WKProcessClass.mm:
4028         (-[WKProcessClass initWithConfiguration:]):
4029         (-[WKProcessClass dealloc]):
4030         (-[WKProcessClass API::]):
4031         * UIProcess/API/Cocoa/WKProcessClassInternal.h: Renamed from Source/WebKit2/UIProcess/API/Cocoa/WKProcessGroupInternal.h.
4032         (WebKit::wrapper):
4033         * UIProcess/API/Cocoa/WKProcessGroup.mm:
4034         (-[WKProcessGroup initWithInjectedBundleURL:]):
4035         * UIProcess/API/ios/WKContentView.mm:
4036         (-[WKContentView _decidePolicyForGeolocationRequestFromOrigin:frame:request:]):
4037         * WebKit2.xcodeproj/project.pbxproj:
4038
4039 2014-01-22  Tim Horton  <timothy_horton@apple.com>
4040
4041         Crashes in DrawingAreaProxy::setExposedRect (null DrawingAreaProxy)
4042         https://bugs.webkit.org/show_bug.cgi?id=127445
4043
4044         Reviewed by Anders Carlsson.
4045
4046         * UIProcess/API/ios/WKContentView.mm:
4047         (-[WKContentView _updateViewExposedRect]):
4048         * UIProcess/API/mac/WKView.mm:
4049         (-[WKView _updateViewExposedRect]):
4050         Null-check.
4051
4052 2014-01-22  Anders Carlsson  <andersca@apple.com>
4053
4054         Add WKWebView class
4055         https://bugs.webkit.org/show_bug.cgi?id=127444
4056         <rdar://problem/15884418>
4057
4058         Reviewed by Dan Bernstein.
4059
4060         * UIProcess/API/Cocoa/WKWebView.h: Added.
4061         * UIProcess/API/Cocoa/WKWebView.mm: Added.
4062         (-[WKWebView initWithFrame:configuration:]):
4063         (-[WKWebView configuration]):
4064         * WebKit2.xcodeproj/project.pbxproj:
4065
4066 2014-01-22  Anders Carlsson  <andersca@apple.com>
4067
4068         Fix 32-bit build.
4069
4070         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
4071
4072 2014-01-22  Tim Horton  <timothy_horton@apple.com>
4073
4074         [wk2] Scroll pinning state is wrong until the first scroll event
4075         https://bugs.webkit.org/show_bug.cgi?id=127437
4076
4077         Reviewed by Simon Fraser.
4078
4079         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
4080         (WebKit::WebFrameLoaderClient::didChangeScrollOffset):
4081         * WebProcess/WebPage/WebPage.cpp:
4082         (WebKit::WebPage::updateMainFrameScrollOffsetPinning):
4083         (WebKit::WebPage::didCommitLoad):
4084         * WebProcess/WebPage/WebPage.h:
4085         Rename WebPage::didChangeScrollOffsetForMainFrame to
4086         updateMainFrameScrollOffsetPinning, which better describes what it
4087         actually does. Call it when a load is committed, so that we have valid
4088         pinning state before the first scroll event comes in.
4089
4090 2014-01-22  Anders Carlsson  <andersca@apple.com>
4091
4092         Add WKWebViewConfiguration class
4093         https://bugs.webkit.org/show_bug.cgi?id=127436
4094         <rdar://problem/15882923>
4095
4096         Reviewed by Tim Horton.
4097
4098         * UIProcess/API/Cocoa/WKWebViewConfiguration.h: Added.
4099         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: Added.
4100         (-[WKWebViewConfiguration copyWithZone:]):
4101         * WebKit2.xcodeproj/project.pbxproj:
4102
4103 2014-01-22  Alice Barraclough  <alice.liu@apple.com>
4104
4105         [WK2] add cocoa API for private browsing setting
4106         https://bugs.webkit.org/show_bug.cgi?id=127391
4107
4108         Reviewed by Sam Weinig.
4109
4110         * UIProcess/API/Cocoa/WKBrowsingContextGroup.h:
4111         * UIProcess/API/Cocoa/WKBrowsingContextGroup.mm:
4112         (-[WKBrowsingContextGroup privateBrowsingEnabled]):
4113         (-[WKBrowsingContextGroup setPrivateBrowsingEnabled:]):
4114         Adding some API for the private Browsing setting. Reaches through
4115         to the WKPageGroup's preferences.
4116
4117 2014-01-22  Anders Carlsson  <andersca@apple.com>
4118
4119         Add WKProcessClass class
4120         https://bugs.webkit.org/show_bug.cgi?id=127433
4121         <rdar://problem/15882582>