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