2011-02-23 Anders Carlsson <andersca@apple.com>
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2011-02-23  Anders Carlsson  <andersca@apple.com>
2
3         Reviewed by Dan Bernstein.
4
5         Web Inspector toolbar looks bad in WebKit2
6         https://bugs.webkit.org/show_bug.cgi?id=55076
7         <rdar://problem/8866258>
8
9         * UIProcess/API/mac/WKView.mm:
10         (-[WKView mouseDownCanMoveWindow]):
11         Return NO from mouseDownCanMoveWindow to prevent drags in the (now transparent) inspector WKView
12         from dragging the window around.
13
14         * UIProcess/mac/WebInspectorProxyMac.mm:
15         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
16         Call [WKView setDrawsBackground:NO].
17
18 2011-02-23  Sam Weinig  <sam@webkit.org>
19
20         Reviewed by Anders Carlsson.
21
22         Remove WKPageForceRepaintWithInvalidation and instead make WKPageForceRepaint
23         always dirty the entire page.
24
25         * Shared/ForceRepaintFlags.h: Removed.
26         * UIProcess/API/C/WKPage.cpp:
27         (WKPageForceRepaint):
28         * UIProcess/API/C/WKPage.h:
29         * UIProcess/WebPageProxy.cpp:
30         (WebKit::WebPageProxy::forceRepaint):
31         * UIProcess/WebPageProxy.h:
32         * WebKit2.pro:
33         * WebKit2.xcodeproj/project.pbxproj:
34         * WebProcess/WebPage/DrawingAreaImpl.cpp:
35         (WebKit::DrawingAreaImpl::forceRepaint):
36         * WebProcess/WebPage/WebPage.cpp:
37         (WebKit::WebPage::forceRepaint):
38         * WebProcess/WebPage/WebPage.h:
39         * WebProcess/WebPage/WebPage.messages.in:
40         * win/WebKit2.vcproj:
41
42 2011-02-23  Anders Carlsson  <andersca@apple.com>
43
44         Reviewed by Sam Weinig.
45
46         Race condition when creating and destroying pages quickly
47         https://bugs.webkit.org/show_bug.cgi?id=55061
48         <rdar://problem/8708435>
49
50         When the last page in a web process is closed, the web process would
51         previously terminate, even if the UI process had created a new page
52         (the CreateNewPage message just wouldn't have reached the web process yet).
53
54         Fix this by adding a ShouldTerminate message that the web process sends when it's
55         about to terminate. If the UI process has any pending pages, downloads etc. it will
56         prevent the web process from terminating. Otherwise, it will immmediately disconnect
57         the WebPageProxy so that creating a page after that will launch a new web process.
58
59         * UIProcess/Plugins/WebPluginSiteDataManager.cpp:
60         (WebKit::WebPluginSiteDataManager::shouldTerminate):
61         * UIProcess/Plugins/WebPluginSiteDataManager.h:
62         * UIProcess/WebContext.cpp:
63         (WebKit::WebContext::shouldTerminate):
64         (WebKit::WebContext::disconnectProcess):
65         * UIProcess/WebContext.h:
66         * UIProcess/WebProcessProxy.cpp:
67         (WebKit::WebProcessProxy::disconnect):
68         (WebKit::WebProcessProxy::didReceiveSyncMessage):
69         (WebKit::WebProcessProxy::didClose):
70         (WebKit::WebProcessProxy::shouldTerminate):
71         * UIProcess/WebProcessProxy.h:
72         * UIProcess/WebProcessProxy.messages.in:
73         * WebProcess/WebProcess.cpp:
74         (WebKit::WebProcess::terminateIfPossible):
75
76 2011-02-23  Mike Thole  <mthole@apple.com>
77
78         Reviewed by Darin Adler.
79
80         WKBundleNavigationAction.h should be exposed as a public header
81         https://bugs.webkit.org/show_bug.cgi?id=55059
82
83         * WebKit2.xcodeproj/project.pbxproj:
84         Changed WKBundleNavigationAction.h from 'project' to 'public'.
85
86 2011-02-23  Siddharth Mathur  <siddharth.mathur@nokia.com>
87
88         Reviewed by Laszlo Gombos.
89
90         [Qt] Make sure Symbian binary UIDs are unique
91
92         * WebProcess.pro: Resolve the UID collision with QtTestBrowser.pro
93         by changing the UID.
94
95 2011-02-23  Siddharth Mathur  <siddharth.mathur@nokia.com>
96
97         Reviewed by Laszlo Gombos.
98
99         [Qt] Fix the Symbian build after r79334
100         https://bugs.webkit.org/show_bug.cgi?id=55044
101
102         * WebKit2.pri: Copy the rules from JavaScriptCore.pri for
103         defineTest().
104
105         Remove addWebKit2LibWholeArchive as it is no longer needed.
106
107 2011-02-23  Alejandro G. Castro  <alex@igalia.com>
108
109         Unreviewed, fixed GTK WebKit2 compilation after r79366.
110
111         * GNUmakefile.am:
112
113 2011-02-23  Patrick Gansterer  <paroga@webkit.org>
114
115         Reviewed by Darin Adler.
116
117         Rename PLATFORM(CF) to USE(CF)
118         https://bugs.webkit.org/show_bug.cgi?id=53540
119
120         * UIProcess/WebBackForwardList.h:
121         * UIProcess/WebPageProxy.cpp:
122         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
123         (WebKit::formatLocalizedString):
124
125 2011-02-23  Benjamin Poulain  <benjamin.poulain@nokia.com>
126
127         Reviewed by Andreas Kling.
128
129         [Qt] [WK2] When the context menu is empty, we should still send the signal QWKPage::showContextMenu()
130         https://bugs.webkit.org/show_bug.cgi?id=54996
131
132         Send the signal QWKPage::showContextMenu() with an empty menu even if the content menu generated
133         is empty/contain only disabled elements.
134
135         * UIProcess/API/qt/qgraphicswkview.cpp:
136         (QGraphicsWKView::showContextMenu):
137         * UIProcess/qt/WebContextMenuProxyQt.cpp:
138         (WebKit::WebContextMenuProxyQt::showContextMenu):
139
140 2011-02-22  Dan Bernstein  <mitz@apple.com>
141
142         LLVM Compiler build fix.
143
144         * Scripts/webkit2/messages.py:
145         * WebProcess/ApplicationCache/WebApplicationCacheManager.h:
146
147 2011-02-22  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
148
149         Reviewed by Alexey Proskuryakov.
150
151         Drop the language tag part from the User Agent string
152         https://bugs.webkit.org/show_bug.cgi?id=54560
153
154         * UIProcess/gtk/WebPageProxyGtk.cpp:
155         (WebKit::WebPageProxy::standardUserAgent):
156
157         * UIProcess/mac/WebPageProxyMac.mm:
158         (WebKit::WebPageProxy::standardUserAgent):
159
160         * UIProcess/qt/WebPageProxyQt.cpp:
161         (WebKit::WebPageProxy::standardUserAgent):
162
163         * UIProcess/win/WebPageProxyWin.cpp:
164         (WebKit::WebPageProxy::standardUserAgent): Drop the language tag
165         part and fix style.
166
167 2011-02-22  Sam Weinig  <sam@webkit.org>
168
169         Reviewed by Anders Carlsson.
170
171         Add WebKit2 API to force a repaint with an invalidation
172         https://bugs.webkit.org/show_bug.cgi?id=55015
173
174         * Shared/ForceRepaintFlags.h: Added.
175         * UIProcess/API/C/WKPage.cpp:
176         (WKPageForceRepaint):
177         (WKPageForceRepaintWithInvalidation):
178         * UIProcess/API/C/WKPage.h:
179         Add WKPageForceRepaintWithInvalidation which does the same thing WKPageForceRepaint
180         but also calls setNeedsDisplay on the entire bounds of the page.
181
182         * UIProcess/WebPageProxy.cpp:
183         (WebKit::WebPageProxy::forceRepaint):
184         * UIProcess/WebPageProxy.h:
185         * WebProcess/WebPage/WebPage.cpp:
186         (WebKit::WebPage::forceRepaint):
187         * WebProcess/WebPage/WebPage.h:
188         * WebProcess/WebPage/WebPage.messages.in:
189         Pipe the flag down to the WebProcess.
190
191         * WebKit2.pro:
192         * WebKit2.xcodeproj/project.pbxproj:
193         * win/WebKit2.vcproj:
194         Add ForceRepaintFlags.h.
195
196 2011-02-22  Simon Fraser  <simon.fraser@apple.com>
197
198         Reviewed by Dan Bernstein.
199
200         <rdar://problem/9039670>
201         
202         Make sure that we set the accelerateDrawing property on the LayerTreeHosts's
203         non-composited content layer if the preference is set.
204
205         * WebProcess/WebPage/mac/LayerTreeHostMac.mm:
206         (WebKit::LayerTreeHostMac::LayerTreeHostMac):
207
208 2011-02-22  Brady Eidson  <beidson@apple.com>
209
210         Fix it Windows-style.
211
212         * WebProcess/WebProcess.cpp:
213         (WebKit::WebProcess::getSitesWithPluginData):
214         (WebKit::WebProcess::clearPluginSiteData):
215
216 2011-02-22  Anders Carlsson  <andersca@apple.com>
217
218         Reviewed by Dan Bernstein.
219
220         Rename WebProcess::shutdownIfPossible to WebProcess::terminateIfPossible
221         https://bugs.webkit.org/show_bug.cgi?id=55008
222
223         * WebProcess/Downloads/DownloadManager.cpp:
224         (WebKit::DownloadManager::downloadFinished):
225         * WebProcess/WebProcess.cpp:
226         (WebKit::WebProcess::removeWebPage):
227         (WebKit::WebProcess::terminateIfPossible):
228         (WebKit::WebProcess::getSitesWithPluginData):
229         * WebProcess/WebProcess.h:
230         * WebProcess/gtk/WebProcessGtk.cpp:
231         (WebKit::WebProcess::platformTerminate):
232         * WebProcess/mac/WebProcessMac.mm:
233         (WebKit::WebProcess::platformTerminate):
234         * WebProcess/qt/WebProcessQt.cpp:
235         (WebKit::WebProcess::platformTerminate):
236         * WebProcess/win/WebProcessWin.cpp:
237         (WebKit::WebProcess::platformTerminate):
238
239 2011-02-22  Brady Eidson  <beidson@apple.com>
240
241         Windows build-fix attempt.
242
243         * win/WebKit2Generated.make:
244
245 2011-02-22  Csaba Osztrogon√°c  <ossy@webkit.org>
246
247         Unreviewed.
248
249         <rdar://problem/8762042> and  https://bugs.webkit.org/show_bug.cgi?id=54514
250         API to view and delete Application Cache data by origin.
251
252         [Qt][WK2] Buildfix after r79364.
253
254         * DerivedSources.pro:
255         * WebKit2.pri:
256
257 2011-02-22  Brady Eidson  <beidson@apple.com>
258
259         Reviewed by Anders Carlsson and looked over by Brian Weinstein.
260
261         <rdar://problem/8762042> and https://bugs.webkit.org/show_bug.cgi?id=54514
262         API to view and delete Application Cache data by origin.
263
264         I couldn't help myself - I also re-alphabetized WebResourceCacheManager in many places where
265         it's sorting was wrong due to a last minute name change.
266
267         Project file changes:
268         * GNUmakefile.am:
269         * win/WebKit2.vcproj:
270         * win/WebKit2Common.vsprops:
271         * win/WebKit2Generated.make:
272         * WebKit2.pro:
273         * WebKit2.xcodeproj/project.pbxproj:
274
275         WK2 build-system and API paperwork:
276         * DerivedSources.make:
277         * Platform/CoreIPC/MessageID.h:
278         * Shared/API/c/WKBase.h:
279         * Shared/APIObject.h:
280         * UIProcess/API/C/WKAPICast.h:
281
282         Add a helper to perform an ArrayCallback with a Vector of SecurityOriginDatas:
283         * Shared/SecurityOriginData.cpp:
284         (WebKit::performAPICallbackWithSecurityOriginDataVector):
285         * Shared/SecurityOriginData.h:
286         * UIProcess/WebResourceCacheManagerProxy.cpp:
287         (WebKit::WebResourceCacheManagerProxy::didGetCacheOrigins): Use performAPICallbackWithSecurityOriginDataVector here.
288
289         Add an ApplicationCacheManagerProxy to the context and invalidate it at the appropriate times:
290         * UIProcess/WebContext.cpp:
291         (WebKit::WebContext::WebContext):
292         (WebKit::WebContext::~WebContext):
293         (WebKit::WebContext::processDidClose):
294         (WebKit::WebContext::didReceiveMessage): Route messages to the right proxy.
295         * UIProcess/WebContext.h:
296         (WebKit::WebContext::applicationCacheManagerProxy):
297         (WebKit::WebContext::resourceCacheManagerProxy):
298
299         Add API to get the ApplicationCacheManager for a context:
300         * UIProcess/API/C/WKContext.cpp:
301         (WKContextGetApplicationCacheManager):
302         (WKContextGetResourceCacheManager):
303         * UIProcess/API/C/WKContext.h:
304
305         Route messages to the right place:
306         * UIProcess/WebProcessProxy.cpp:
307         (WebKit::WebProcessProxy::didReceiveMessage):
308         * WebProcess/WebProcess.cpp:
309         (WebKit::WebProcess::didReceiveMessage):
310
311         Add the API object, which wraps to WebApplicationCacheManagerProxy:
312         * UIProcess/API/C/WKApplicationCacheManager.cpp: Added.
313         (WKApplicationCacheManagerGetTypeID):
314         (WKApplicationCacheManagerGetApplicationCacheOrigins):
315         (WKApplicationCacheManagerDeleteEntriesForOrigin):
316         (WKApplicationCacheManagerDeleteAllEntries):
317         * UIProcess/API/C/WKApplicationCacheManager.h: Added.
318
319         The UIProcess implementation of the manager to send messages to the WebProcess and pipe a callback back up to the client:
320         * UIProcess/WebApplicationCacheManagerProxy.cpp: Added.
321         (WebKit::WebApplicationCacheManagerProxy::create):
322         (WebKit::WebApplicationCacheManagerProxy::WebApplicationCacheManagerProxy):
323         (WebKit::WebApplicationCacheManagerProxy::~WebApplicationCacheManagerProxy):
324         (WebKit::WebApplicationCacheManagerProxy::invalidate):
325         (WebKit::WebApplicationCacheManagerProxy::didReceiveMessage):
326         (WebKit::WebApplicationCacheManagerProxy::getApplicationCacheOrigins):
327         (WebKit::WebApplicationCacheManagerProxy::didGetApplicationCacheOrigins): Use performAPICallbackWithSecurityOriginDataVector here.
328         (WebKit::WebApplicationCacheManagerProxy::deleteEntriesForOrigin):
329         (WebKit::WebApplicationCacheManagerProxy::deleteAllEntries):
330         * UIProcess/WebApplicationCacheManagerProxy.h: Added.
331         (WebKit::WebApplicationCacheManagerProxy::clearContext):
332         (WebKit::WebApplicationCacheManagerProxy::type):
333         * UIProcess/WebApplicationCacheManagerProxy.messages.in: Added.
334
335         The WebProcess implementation to response to UIProcess messages and actually do the dirty-work in WebCore:
336         * WebProcess/ApplicationCache: Added.
337         * WebProcess/ApplicationCache/WebApplicationCacheManager.cpp: Added.
338         (WebKit::WebApplicationCacheManager::shared):
339         (WebKit::WebApplicationCacheManager::WebApplicationCacheManager):
340         (WebKit::WebApplicationCacheManager::didReceiveMessage):
341         (WebKit::WebApplicationCacheManager::getApplicationCacheOrigins):
342         (WebKit::WebApplicationCacheManager::deleteEntriesForOrigin):
343         (WebKit::WebApplicationCacheManager::deleteAllEntries):
344         * WebProcess/ApplicationCache/WebApplicationCacheManager.h: Added.
345         * WebProcess/ApplicationCache/WebApplicationCacheManager.messages.in: Added.
346
347 2011-02-22  Anders Carlsson  <andersca@apple.com>
348
349         Reviewed by Sam Weinig.
350
351         Get rid of WebProcessManager
352         https://bugs.webkit.org/show_bug.cgi?id=55001
353
354         WebProcessManager had become a stupid map of WebContext > WebProcess relations,
355         which isn't really useful since the WebContext already knows about its process.
356
357         * Shared/WebURLRequest.cpp:
358         * UIProcess/API/mac/WKView.mm:
359         * UIProcess/WebContext.cpp:
360         (WebKit::WebContext::~WebContext):
361         (WebKit::WebContext::ensureWebProcess):
362         (WebKit::WebContext::processDidFinishLaunching):
363         * UIProcess/WebProcessManager.cpp: Removed.
364         * UIProcess/WebProcessManager.h: Removed.
365         * UIProcess/WebProcessProxy.cpp:
366         (WebKit::WebProcessProxy::didClose):
367         * WebKit2.pro:
368         * WebKit2.xcodeproj/project.pbxproj:
369         * win/WebKit2.vcproj:
370
371 2011-02-22  Anders Carlsson  <andersca@apple.com>
372
373         Reviewed by Darin Adler.
374
375         Get rid of WebProcessManager::getAllWebProcessContexts
376         https://bugs.webkit.org/show_bug.cgi?id=55000
377
378         * Shared/WebURLRequest.cpp:
379         (WebKit::WebURLRequest::setDefaultTimeoutInterval):
380         Call WebContext::allContexts instead.
381
382         * UIProcess/WebContext.cpp:
383         * UIProcess/WebContext.h:
384         Add a vector of WebContext objects. Update it when creating and destroying contexts.
385
386         * UIProcess/WebProcessManager.cpp:
387         * UIProcess/WebProcessManager.h:
388         Remove WebProcessManager::getAllWebProcessContexts.
389
390 2011-02-22  Sam Weinig  <sam@webkit.org>
391
392         Reviewed by Anders Carlsson.
393
394         Re-add early bail out in dispatchDecidePolicyForNavigationAction with prevents
395         a crash running fast/loader/empty-embed-src-attribute.html. This matches a 
396         bail out in the default policy delegate in WebKit1.
397
398         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
399         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
400
401 2011-02-22  Anders Carlsson  <andersca@apple.com>
402
403         Reviewed by Dan Bernstein.
404
405         Grammar correction from Spelling & Grammar window doesn't work
406         https://bugs.webkit.org/show_bug.cgi?id=54982
407         <rdar://problem/8940918>
408
409         * UIProcess/API/mac/WKView.mm:
410         (-[WKView isGrammarCheckingEnabled]):
411         (-[WKView setGrammarCheckingEnabled:]):
412         Call down to the text checker.
413
414         * UIProcess/TextChecker.h:
415         Add updateSpellingUIWithGrammarString.
416
417         * UIProcess/WebPageProxy.cpp:
418         (WebKit::WebPageProxy::updateSpellingUIWithGrammarString):
419         Call TextChecker::updateSpellingUIWithGrammarString.
420
421         * UIProcess/WebPageProxy.messages.in:
422         Add UpdateSpellingUIWithGrammarString message.
423
424         * UIProcess/gtk/TextCheckerGtk.cpp:
425         (WebKit::TextChecker::updateSpellingUIWithGrammarString):
426         * UIProcess/qt/TextCheckerQt.cpp:
427         (WebKit::TextChecker::updateSpellingUIWithGrammarString):
428         * UIProcess/win/TextCheckerWin.cpp:
429         (WebKit::TextChecker::updateSpellingUIWithGrammarString):
430         Add stubs.
431
432         * UIProcess/mac/TextCheckerMac.mm:
433         (WebKit::TextChecker::updateSpellingUIWithGrammarString):
434         Update the spelling panel.
435
436         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
437         (WebKit::WebEditorClient::updateSpellingUIWithGrammarString):
438         Send an UpdateSpellingUIWithGrammarString message to the UI process.
439
440 2011-02-22  Balazs Kelemen  <kbalazs@webkit.org>
441
442         Reviewed by Anders Carlsson.
443
444         notImplemented() should behave identical in WebCore and WebKit2
445         https://bugs.webkit.org/show_bug.cgi?id=54449
446
447         Use NotImplemented.h from WebCore. Initialize logging channels.
448         Remove the WebKit2 concept of notImplemented().
449
450         * Platform/gtk/SharedMemoryGtk.cpp:
451         * Platform/gtk/WorkQueueGtk.cpp:
452         * Platform/qt/WorkQueueQt.cpp:
453         * Platform/win/WorkQueueWin.cpp:
454         * Shared/NotImplemented.h: Removed.
455         * Shared/Plugins/NPIdentifierData.cpp:
456         * Shared/Plugins/NPRemoteObjectMap.cpp:
457         * Shared/Plugins/NPVariantData.cpp:
458         * Shared/cairo/ShareableBitmapCairo.cpp:
459         * Shared/gtk/ShareableBitmapGtk.cpp:
460         * Shared/gtk/WebCoreArgumentCodersGtk.cpp:
461         * Shared/qt/WebCoreArgumentCodersQt.cpp:
462         * Shared/win/LayerTreeContextWin.cpp:
463         * UIProcess/API/mac/PageClientImpl.mm:
464         * UIProcess/API/qt/qwkpage.cpp:
465         * UIProcess/Launcher/gtk/ThreadLauncherGtk.cpp:
466         * UIProcess/Launcher/qt/ProcessLauncherQt.cpp:
467         * UIProcess/Plugins/gtk/PluginInfoStoreGtk.cpp:
468         * UIProcess/WebContext.cpp:
469         (WebKit::WebContext::WebContext):
470         * UIProcess/WebInspectorProxy.cpp:
471         * UIProcess/gtk/TextCheckerGtk.cpp:
472         * UIProcess/gtk/WebInspectorGtk.cpp:
473         * UIProcess/gtk/WebPreferencesGtk.cpp:
474         * UIProcess/qt/TextCheckerQt.cpp:
475         * UIProcess/qt/WebInspectorProxyQt.cpp:
476         * UIProcess/win/TextCheckerWin.cpp:
477         * UIProcess/win/WebContextMenuProxyWin.cpp:
478         * WebKit2.pro:
479         * WebKit2.xcodeproj/project.pbxproj:
480         * WebProcess/Downloads/cf/DownloadCFNet.cpp:
481         * WebProcess/Downloads/curl/DownloadCurl.cpp:
482         * WebProcess/Downloads/mac/DownloadMac.mm:
483         * WebProcess/Downloads/qt/DownloadQt.cpp:
484         * WebProcess/InjectedBundle/gtk/InjectedBundleGtk.cpp:
485         * WebProcess/Plugins/Netscape/JSNPMethod.cpp:
486         * WebProcess/Plugins/Netscape/NPJSObject.cpp:
487         * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp:
488         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
489         * WebProcess/Plugins/Netscape/gtk/NetscapePluginGtk.cpp:
490         * WebProcess/Plugins/Netscape/qt/NetscapePluginQt.cpp:
491         * WebProcess/Plugins/Netscape/win/NetscapePluginWin.cpp:
492         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
493         * WebProcess/WebCoreSupport/WebContextMenuClient.cpp:
494         * WebProcess/WebCoreSupport/WebDragClient.cpp:
495         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
496         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
497         * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
498         * WebProcess/WebCoreSupport/WebInspectorFrontendClient.cpp:
499         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
500         * WebProcess/WebCoreSupport/gtk/WebContextMenuClientGtk.cpp:
501         * WebProcess/WebCoreSupport/gtk/WebPopupMenuGtk.cpp:
502         * WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm:
503         * WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
504         * WebProcess/WebCoreSupport/qt/WebContextMenuClientQt.cpp:
505         * WebProcess/WebPage/gtk/WebInspectorGtk.cpp:
506         * WebProcess/WebPage/qt/WebInspectorQt.cpp:
507         * WebProcess/WebProcess.cpp:
508         (WebKit::WebProcess::WebProcess):
509         * WebProcess/gtk/WebProcessGtk.cpp:
510         * config.h:
511         * win/WebKit2.vcproj:
512
513 2011-02-22  Brian Weinstein  <bweinstein@apple.com>
514
515         Rubber-stamped by Brady Eidson.
516
517         Invalidate the WebResourceCacheManagerProxy in WebContext::processDidClose.
518
519         * UIProcess/WebContext.cpp:
520         (WebKit::WebContext::processDidClose):
521
522 2011-02-21  Adam Roben  <aroben@apple.com>
523
524         Make DrawingAreaProxyImpl keep track of the most recent state ID it sent to the web process
525
526         This will be useful for sending repeated messages for the same state ID to the web process.
527         We don't do this currently, but will need to if we're asked to paint after we've thrown away
528         our backing store to save memory.
529
530         Fixes <http://webkit.org/b/54916> DrawingAreaProxyImpl should keep track of the state ID it
531         last sent to the web process
532
533         Reviewed by Anders Carlsson.
534
535         * UIProcess/DrawingAreaProxyImpl.cpp:
536         (WebKit::DrawingAreaProxyImpl::DrawingAreaProxyImpl): Initialize m_requestedStateID, and
537         reordered member initialization to match the new declaration order.
538         (WebKit::DrawingAreaProxyImpl::didUpdateState): Added an assertion that the stateID we got
539         from the web process is no newer than the most recent one we requested.
540         (WebKit::DrawingAreaProxyImpl::sendUpdateState): Changed to increment and send
541         m_requestedStateID instead of a new global stateID.
542
543         * UIProcess/DrawingAreaProxyImpl.h: Added m_requestedStateID, and moved the state IDs before
544         other data members. Also beefed the comment explaining m_currentStateID.
545
546 2011-02-22  Andras Becsi  <abecsi@webkit.org>
547
548         Reviewed by Laszlo Gombos.
549
550         [Qt] Redesign the build system
551         https://bugs.webkit.org/show_bug.cgi?id=51339
552
553         Part 2.
554
555         Build WebCore as a static library, compile the WebKit API and WebKit2 API
556         in a final step and link to WebKit2, WebCore and JSC libraries to fix
557         linking issues resulting from stripped away symbols.
558
559         * WebKit2.pri: Add include paths.
560         * WebKit2.pro: Move include paths to WebKit2.pri and move
561         the API source to WebKit/qt/QtWebKit.pro
562
563 2011-02-22  Benjamin Poulain  <benjamin.poulain@nokia.com>
564
565         Reviewed by Kenneth Rohde Christiansen.
566
567         [Qt] [WK2] Improve the memory handling of the context menu for WebKit 2
568         https://bugs.webkit.org/show_bug.cgi?id=54902
569
570         Refactor the context menu handling of Qt to make it simpler to manage memory.
571
572         WebContextMenuProxyQt uses smart pointer for all the references to menu so
573         there is no need to delete it explicitely.
574
575         Passing the QMenu from QWKPage to the client of the signal now uses a QSharedPointer so
576         the client can choose to handle the memory, but there is no leak if it does not.
577
578         * UIProcess/API/qt/qgraphicswkview.cpp:
579         (QGraphicsWKView::QGraphicsWKView):
580         (QGraphicsWKView::showContextMenu):
581         * UIProcess/API/qt/qgraphicswkview.h:
582         * UIProcess/API/qt/qwkpage.h:
583         * UIProcess/qt/WebContextMenuProxyQt.cpp:
584         (WebKit::WebContextMenuProxyQt::showContextMenu):
585         (WebKit::WebContextMenuProxyQt::createContextMenu):
586         * UIProcess/qt/WebContextMenuProxyQt.h:
587
588 2011-02-22  Philippe Normand  <pnormand@igalia.com>
589
590         Reviewed by Xan Lopez.
591
592         [GTK] make distcheck fails
593         https://bugs.webkit.org/show_bug.cgi?id=54943
594
595         Removed reference to NotImplemented.h which was removed.
596
597         * GNUmakefile.am:
598
599 2011-02-22  Kimmo Kinnunen  <kimmo.t.kinnunen@nokia.com>
600
601         Reviewed by Kenneth Rohde Christiansen.
602
603         [Qt] QtWebProcess should be installed with 'make install'
604         https://bugs.webkit.org/show_bug.cgi?id=44100
605
606         Follow the standard in other project files and allow install
607         location to be changed with INSTALL_BINS variable.
608
609         * WebProcess.pro: Install QtWebProcess.
610
611 2011-02-22  Sheriff Bot  <webkit.review.bot@gmail.com>
612
613         Unreviewed, rolling out r79296.
614         http://trac.webkit.org/changeset/79296
615         https://bugs.webkit.org/show_bug.cgi?id=54941
616
617         Breaks compilation on SnowLeapard Intel Release (Requested by
618         kbalazs_ on #webkit).
619
620         * Platform/gtk/SharedMemoryGtk.cpp:
621         * Platform/gtk/WorkQueueGtk.cpp:
622         * Platform/qt/WorkQueueQt.cpp:
623         * Platform/win/WorkQueueWin.cpp:
624         * Shared/NotImplemented.h: Copied from Source/WebKit2/WebProcess/InjectedBundle/gtk/InjectedBundleGtk.cpp.
625         * Shared/Plugins/NPIdentifierData.cpp:
626         * Shared/Plugins/NPRemoteObjectMap.cpp:
627         * Shared/Plugins/NPVariantData.cpp:
628         * Shared/cairo/ShareableBitmapCairo.cpp:
629         * Shared/gtk/ShareableBitmapGtk.cpp:
630         * Shared/gtk/WebCoreArgumentCodersGtk.cpp:
631         * Shared/qt/WebCoreArgumentCodersQt.cpp:
632         * Shared/win/LayerTreeContextWin.cpp:
633         * UIProcess/API/mac/PageClientImpl.mm:
634         * UIProcess/API/qt/qwkpage.cpp:
635         * UIProcess/Launcher/gtk/ThreadLauncherGtk.cpp:
636         * UIProcess/Launcher/qt/ProcessLauncherQt.cpp:
637         * UIProcess/Plugins/gtk/PluginInfoStoreGtk.cpp:
638         * UIProcess/WebContext.cpp:
639         (WebKit::WebContext::WebContext):
640         * UIProcess/WebInspectorProxy.cpp:
641         * UIProcess/gtk/TextCheckerGtk.cpp:
642         * UIProcess/gtk/WebInspectorGtk.cpp:
643         * UIProcess/gtk/WebPreferencesGtk.cpp:
644         * UIProcess/qt/TextCheckerQt.cpp:
645         * UIProcess/qt/WebInspectorProxyQt.cpp:
646         * UIProcess/win/TextCheckerWin.cpp:
647         * UIProcess/win/WebContextMenuProxyWin.cpp:
648         * WebKit2.pro:
649         * WebKit2.xcodeproj/project.pbxproj:
650         * WebProcess/Downloads/cf/DownloadCFNet.cpp:
651         * WebProcess/Downloads/curl/DownloadCurl.cpp:
652         * WebProcess/Downloads/mac/DownloadMac.mm:
653         * WebProcess/Downloads/qt/DownloadQt.cpp:
654         * WebProcess/InjectedBundle/gtk/InjectedBundleGtk.cpp:
655         * WebProcess/Plugins/Netscape/JSNPMethod.cpp:
656         * WebProcess/Plugins/Netscape/NPJSObject.cpp:
657         * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp:
658         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
659         * WebProcess/Plugins/Netscape/gtk/NetscapePluginGtk.cpp:
660         * WebProcess/Plugins/Netscape/qt/NetscapePluginQt.cpp:
661         * WebProcess/Plugins/Netscape/win/NetscapePluginWin.cpp:
662         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
663         * WebProcess/WebCoreSupport/WebContextMenuClient.cpp:
664         * WebProcess/WebCoreSupport/WebDragClient.cpp:
665         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
666         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
667         * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
668         * WebProcess/WebCoreSupport/WebInspectorFrontendClient.cpp:
669         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
670         * WebProcess/WebCoreSupport/gtk/WebContextMenuClientGtk.cpp:
671         * WebProcess/WebCoreSupport/gtk/WebPopupMenuGtk.cpp:
672         * WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm:
673         * WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
674         * WebProcess/WebCoreSupport/qt/WebContextMenuClientQt.cpp:
675         * WebProcess/WebPage/gtk/WebInspectorGtk.cpp:
676         * WebProcess/WebPage/qt/WebInspectorQt.cpp:
677         * WebProcess/WebProcess.cpp:
678         (WebKit::WebProcess::WebProcess):
679         * WebProcess/gtk/WebProcessGtk.cpp:
680         * config.h:
681         * win/WebKit2.vcproj:
682
683 2011-02-16  Balazs Kelemen  <kbalazs@webkit.org>
684
685         Reviewed by Anders Carlsson.
686
687         notImplemented() should behave identical in WebCore and WebKit2
688         https://bugs.webkit.org/show_bug.cgi?id=54449
689
690         Use NotImplemented.h from WebCore. Initialize logging channels.
691         Remove the WebKit2 concept of notImplemented().
692
693         * Platform/gtk/SharedMemoryGtk.cpp:
694         * Platform/gtk/WorkQueueGtk.cpp:
695         * Platform/qt/WorkQueueQt.cpp:
696         * Platform/win/WorkQueueWin.cpp:
697         * Shared/NotImplemented.h: Removed.
698         * Shared/Plugins/NPIdentifierData.cpp:
699         * Shared/Plugins/NPRemoteObjectMap.cpp:
700         * Shared/Plugins/NPVariantData.cpp:
701         * Shared/cairo/ShareableBitmapCairo.cpp:
702         * Shared/gtk/ShareableBitmapGtk.cpp:
703         * Shared/gtk/WebCoreArgumentCodersGtk.cpp:
704         * Shared/qt/WebCoreArgumentCodersQt.cpp:
705         * Shared/win/LayerTreeContextWin.cpp:
706         * UIProcess/API/qt/qwkpage.cpp:
707         * UIProcess/Launcher/gtk/ThreadLauncherGtk.cpp:
708         * UIProcess/Launcher/qt/ProcessLauncherQt.cpp:
709         * UIProcess/Plugins/gtk/PluginInfoStoreGtk.cpp:
710         * UIProcess/WebContext.cpp:
711         (WebKit::WebContext::WebContext):
712         * UIProcess/WebInspectorProxy.cpp:
713         * UIProcess/gtk/TextCheckerGtk.cpp:
714         * UIProcess/gtk/WebInspectorGtk.cpp:
715         * UIProcess/gtk/WebPreferencesGtk.cpp:
716         * UIProcess/qt/TextCheckerQt.cpp:
717         * UIProcess/qt/WebInspectorProxyQt.cpp:
718         * UIProcess/win/TextCheckerWin.cpp:
719         * UIProcess/win/WebContextMenuProxyWin.cpp:
720         * WebKit2.pro:
721         * WebProcess/Downloads/cf/DownloadCFNet.cpp:
722         * WebProcess/Downloads/curl/DownloadCurl.cpp:
723         * WebProcess/Downloads/mac/DownloadMac.mm:
724         * WebProcess/Downloads/qt/DownloadQt.cpp:
725         * WebProcess/InjectedBundle/gtk/InjectedBundleGtk.cpp:
726         * WebProcess/Plugins/Netscape/JSNPMethod.cpp:
727         * WebProcess/Plugins/Netscape/NPJSObject.cpp:
728         * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp:
729         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
730         * WebProcess/Plugins/Netscape/gtk/NetscapePluginGtk.cpp:
731         * WebProcess/Plugins/Netscape/qt/NetscapePluginQt.cpp:
732         * WebProcess/Plugins/Netscape/win/NetscapePluginWin.cpp:
733         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
734         * WebProcess/WebCoreSupport/WebContextMenuClient.cpp:
735         * WebProcess/WebCoreSupport/WebDragClient.cpp:
736         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
737         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
738         * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
739         * WebProcess/WebCoreSupport/WebInspectorFrontendClient.cpp:
740         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
741         * WebProcess/WebCoreSupport/gtk/WebContextMenuClientGtk.cpp:
742         * WebProcess/WebCoreSupport/gtk/WebPopupMenuGtk.cpp:
743         * WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm:
744         * WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
745         * WebProcess/WebCoreSupport/qt/WebContextMenuClientQt.cpp:
746         * WebProcess/WebPage/gtk/WebInspectorGtk.cpp:
747         * WebProcess/WebPage/qt/WebInspectorQt.cpp:
748         * WebProcess/WebProcess.cpp:
749         (WebKit::WebProcess::WebProcess):
750         * WebProcess/gtk/WebProcessGtk.cpp:
751
752 2011-02-21  Timothy Hatcher  <timothy@apple.com>
753
754         Set and update the window title for the Web Inspector in WebKit2.
755
756         https://webkit.org/b/50945
757         rdar://problem/8762410
758
759         Reviewed by Adam Roben.
760
761         * UIProcess/WebInspectorProxy.cpp:
762         (WebKit::WebInspectorProxy::inspectedURLChanged): Added. Call platformInspectedURLChanged.
763         * UIProcess/WebInspectorProxy.h:
764         * UIProcess/WebInspectorProxy.messages.in: Added InspectedURLChanged.
765         * UIProcess/mac/WebInspectorProxyMac.mm:
766         (WebKit::WebInspectorProxy::platformInspectedURLChanged): Added. Set the window title.
767         * UIProcess/win/WebInspectorProxyWin.cpp:
768         (WebKit::WebInspectorProxy::platformInspectedURLChanged): Added. Set the window title.
769         * UIProcess/gtk/WebInspectorGtk.cpp:
770         (WebKit::WebInspectorProxy::platformInspectedURLChanged): Added. Not implemented.
771         * UIProcess/qt/WebInspectorProxyQt.cpp:
772         (WebKit::WebInspectorProxy::platformInspectedURLChanged): Added. Not implemented.
773         * WebProcess/WebCoreSupport/WebInspectorFrontendClient.cpp:
774         (WebKit::WebInspectorFrontendClient::inspectedURLChanged): Call WebInspector::inspectedURLChanged.
775         * WebProcess/WebPage/WebInspector.cpp:
776         (WebKit::WebInspector::inspectedURLChanged): Added. Send the InspectedURLChanged message.
777         * WebProcess/WebPage/WebInspector.h:
778
779 2011-02-21  Sam Weinig  <sam@webkit.org>
780
781         Reviewed by Anders Carlsson.
782
783         Can't paste from 3rd party text editor into WebKit2 window.
784         <rdar://problem/8978624>
785
786         * WebProcess/com.apple.WebProcess.sb:
787
788 2011-02-21  Anders Carlsson  <andersca@apple.com>
789
790         Reviewed by Dan Bernstein.
791
792         Initialize DrawingAreaProxy::m_size
793         https://bugs.webkit.org/show_bug.cgi?id=54913
794
795         This was removed in r76962 since it caused flashes when switching drawing areas due to
796         entering and exiting composited mode, but since we no longer switch drawing areas we can
797         put it back.
798
799         * UIProcess/DrawingAreaProxy.cpp:
800         (WebKit::DrawingAreaProxy::DrawingAreaProxy):
801
802 2011-02-21  Adam Roben  <aroben@apple.com>
803
804         Add some assertions about the state IDs we receive from the web process
805
806         Rubber-stamped by Anders Carlsson.
807
808         * UIProcess/DrawingAreaProxyImpl.cpp:
809         (WebKit::DrawingAreaProxyImpl::update):
810         (WebKit::DrawingAreaProxyImpl::enterAcceleratedCompositingMode):
811         (WebKit::DrawingAreaProxyImpl::exitAcceleratedCompositingMode):
812         Assert that the state ID the web process sent us is no newer than our own state ID.
813
814 2011-02-21  Adam Roben  <aroben@apple.com>
815
816         Rename DrawingArea[Proxy]Impl's "sequence number" concept to "state ID".
817
818         As explained in r79251, DrawingAreaProxyImpl has some state that, when it changes, causes
819         all operations performed before that state change to become invalid. Currently, this state
820         consists of a single piece of data: the view's size. Eventually it will encompass more data
821         (e.g., the backing store we're drawing into; when we start throwing away the backing store
822         to save memory, our state will have changed, and any operations that were intended for the
823         old backing store will have become invalid). r79251 effectively transformed
824         DrawingArea[Proxy]Impl's "sequence number," which incremented every time DrawingAreaImpl
825         sent DrawingAreaProxyImpl a message, to a "state ID," which only increments when the view's
826         size changes.
827
828         This patch is just a set of simple renames to reflect the transformation that r79251
829         effected. It should not introduce any changes in behavior. The renames are:
830           - Messages::DrawingArea::SetSize -> UpdateState
831           - Messages::DrawingAreaProxy::DidSetSize -> DidUpdateState
832           - DrawingAreaProxyImpl::m_lastDidSetSizeSequenceNumber -> m_currentStateID
833           - DrawingAreaProxyImpl::m_isWaitingForDidSetSize -> m_isWaitingForDidUpdateState
834           - DrawingAreaProxyImpl::waitForAndDispatchDidSetSize -> waitForAndDispatchDidUpdateState
835           - DrawingAreaImpl::m_inSetSize -> m_inUpdateState
836           - generateSequenceNumber -> generateStateID
837           - sequenceNumber -> stateID
838
839         Fixes <http://webkit.org/b/54911> DrawingArea[Proxy]Impl's "sequence number" concept should
840         be renamed to "state ID"
841
842         Reviewed by Anders Carlsson.
843
844         * UIProcess/DrawingAreaProxy.h:
845         * UIProcess/DrawingAreaProxy.messages.in:
846         * UIProcess/DrawingAreaProxyImpl.cpp:
847         * UIProcess/DrawingAreaProxyImpl.h:
848         * WebProcess/WebPage/DrawingArea.h:
849         * WebProcess/WebPage/DrawingArea.messages.in:
850         * WebProcess/WebPage/DrawingAreaImpl.cpp:
851         * WebProcess/WebPage/DrawingAreaImpl.h:
852         Performed the renames described above.
853
854 2011-02-21  Alexey Proskuryakov  <ap@apple.com>
855
856         Reviewed by Adam Roben.
857
858         REGRESSION (WebKit2): HTTP requests time out after 60 seconds
859         https://bugs.webkit.org/show_bug.cgi?id=54755
860         <rdar://problem/9006592>
861
862         * Shared/API/c/WKURLRequest.cpp:
863         (WKURLRequestSetDefaultTimeoutInterval):
864         * Shared/API/c/WKURLRequest.h:
865         Added an API to set a default timeout interval for requests created from URLs. The API
866         affects both the UI process and requests created internally by the Web process. Requests
867         created from NSURLRequest or CFURLRequest take timeout from those.
868
869         * Shared/WebURLRequest.cpp: (WebKit::WebURLRequest::setDefaultTimeoutInterval):
870         * Shared/WebURLRequest.h:
871         Pipe the default timeout interval from WKURLRequest down to actual implementation. Since
872         WebURLRequest is currently implemented with WebCore::ResourceRequest, it automatically respects
873         NSURLRequest default timeout interval.
874
875         * UIProcess/WebProcessManager.cpp: (WebKit::WebProcessManager::getAllWebProcessContexts):
876         * UIProcess/WebProcessManager.h:
877         Added a way to enumerate all contexts running in separate processes.
878
879         * Shared/WebProcessCreationParameters.cpp:
880         (WebKit::WebProcessCreationParameters::WebProcessCreationParameters):
881         (WebKit::WebProcessCreationParameters::encode):
882         (WebKit::WebProcessCreationParameters::decode):
883         * Shared/WebProcessCreationParameters.h:
884         (WebKit::WebContext::ensureWebProcess):
885         (WebKit::WebContext::setDefaultRequestTimeoutInterval):
886         * UIProcess/WebContext.h:
887         * WebProcess/WebProcess.cpp:
888         (WebKit::WebProcess::initializeWebProcess):
889         (WebKit::WebProcess::setDefaultRequestTimeoutInterval):
890         * WebProcess/WebProcess.h:
891         * WebProcess/WebProcess.messages.in:
892         Use UI process default timeout interval in separate process contexts, too.
893
894 2011-02-18  Brian Weinstein  <bweinstein@apple.com>
895
896         Reviewed by Adam Roben.
897
898         WebResourceCacheManager should be responsible for managing the CFURLCache as well
899         as the WebCore memory cache.
900         https://bugs.webkit.org/show_bug.cgi?id=54886
901         Part of <rdar://problem/8971738>
902
903         * WebProcess/ResourceCache/WebResourceCacheManager.cpp:
904         (WebKit::WebResourceCacheManager::getCacheOrigins): Call through to cFURLCacheHostNames, and add
905             create SecurityOrigin's for them and add them to the set of SecurityOrigins with cache.
906         (WebKit::WebResourceCacheManager::clearCacheForOrigin): Call through to clear the CFURLCache for
907             the origin's hostname.
908         * WebProcess/ResourceCache/WebResourceCacheManager.h:
909
910         * WebProcess/ResourceCache/cf: Added.
911         * WebProcess/ResourceCache/cf/WebResourceCacheManagerCFNet.cpp: Added.
912         (WebKit::WebResourceCacheManager::cfURLCacheHostNames): Call through to WebKitSystemInterface.
913         (WebKit::WebResourceCacheManager::clearCFURLCacheForHostNames): Ditto.
914
915         * win/WebKit2.vcproj: Added new file.
916         * WebKit2.xcodeproj/project.pbxproj: Ditto.
917
918 2011-02-21  Adam Roben  <aroben@apple.com>
919
920         Move control of the sequence number from DrawingAreaImpl to DrawingAreaProxyImpl
921
922         DrawingAreaProxyImpl has some state that, when it changes, causes all operations performed
923         before that state change to become invalid. When painting, we need to have performed at
924         least one Update for the most recent state; otherwise, we'll be painting old/incorrect bits
925         into the view.
926
927         Currently, this state consists of a single piece of data: the view's size. Whenever the
928         state (i.e., size) changes, we tell the web process via the SetSize message, and the web
929         process lets us know that it has updated to match the new state (i.e., size) via the
930         DidSetSize message.
931
932         When it's time to paint, if we're waiting for the web process to update to match our current
933         state (i.e., size), we block for a little while hoping to receive a DidSetSize message so
934         that we can paint up-to-date bits into the window. This can cause us to receive messages
935         out-of-order; the DidSetSize message will be processed immediately, and any messages that
936         were sent before the DidSetSize message will be processed later. Since the messages from
937         before the DidSetSize message correspond to an old state (i.e., size), they are no longer
938         useful (e.g., they contain bits of the page that are drawn at the wrong size/location), so
939         we discard them.
940
941         The way we identify and discard these messages is by keeping track of a sequence number.
942         Currently, DrawingAreaImpl sends a monotonically-increasing sequence number to
943         DrawingAreaProxyImpl with every message. Whenever DrawingAreaProxyImpl receives a DidSetSize
944         message, it records the sequence number that came along with it. If we then later receive
945         any messages that have a lower sequence number, we know they correspond to an old state
946         (i.e., size) and can discard them.
947
948         This patch moves control of the sequence number to DrawingAreaProxyImpl.
949         DrawingAreaProxyImpl now sends a monotonically-increasing sequence number in the SetSize
950         message. DrawingAreaImpl records this sequence number when it receives the SetSize message,
951         and sends it back to DrawingAreaProxyImpl in every message. Otherwise the logic is the same
952         as before.
953
954         This should cause no changes in behavior, but will allow DrawingAreaProxyImpl to request a
955         full backing store update (by incrementing the sequence number) at times other than when the
956         view's size changes (e.g., after it has thrown away its backing store in order to save
957         memory).
958
959         Fixes <http://webkit.org/b/54907> DrawingAreaProxyImpl should tell DrawingAreaImpl what
960         sequence number to use
961
962         Reviewed by Anders Carlsson.
963
964         * UIProcess/DrawingAreaProxyImpl.cpp:
965         (WebKit::generateSequenceNumber): Moved here from DrawingAreaImpl.cpp.
966         (WebKit::DrawingAreaProxyImpl::sendSetSize): Changed to pass a new sequence number in the
967         SetSize message.
968         (WebKit::DrawingAreaProxyImpl::waitForAndDispatchDidSetSize): Added a FIXME about a
969         potential improvement.
970
971         * WebProcess/WebPage/DrawingArea.h:
972         (WebKit::DrawingArea::setSize): Updated to match the message's new parameters.
973
974         * WebProcess/WebPage/DrawingArea.messages.in: Added a sequenceNumber parameter to SetSize.
975
976         * WebProcess/WebPage/DrawingAreaImpl.cpp:
977         (WebKit::DrawingAreaImpl::DrawingAreaImpl): Initialize m_sequenceNumber.
978         (WebKit::DrawingAreaImpl::setSize): Record the new sequence number from the UI process.
979
980         (WebKit::DrawingAreaImpl::layerHostDidFlushLayers):
981         (WebKit::DrawingAreaImpl::exitAcceleratedCompositingMode):
982         (WebKit::DrawingAreaImpl::display):
983         Send m_sequenceNumber, instead of a new sequence number, back to the UI process.
984
985         * WebProcess/WebPage/DrawingAreaImpl.h: Added m_sequenceNumber, updated setSize function to
986         match the base class.
987
988 2011-02-21  Gavin Barraclough  <barraclough@apple.com>
989
990         Reviewed by Sam Weinig.
991
992         Bug 54894 - Make inheritance structure described by ClassInfo match C++ class hierarchy.
993
994         The ClassInfo objects describe an inheritance hierarchy, with each ClassInfo instance
995         containing a pointer to its parent class. These links should reflect the inheritance
996         hierarchy of C++ classes below JSObject. For the large part it does, but in some cases
997         entries in the C++ hierarchy are skipped over. This presently likely doesn't matter,
998         since intervening C++ classes may not have ClassInfo - but would be a potential bug
999         were ClassInfo were to be added.
1000
1001         * WebProcess/Plugins/Netscape/JSNPObject.cpp:
1002
1003 2011-02-21  Balazs Kelemen  <kbalazs@webkit.org>
1004
1005         Reviewed by Kenneth Rohde Christiansen.
1006
1007         [Qt] Implement WorkQueue::sheduleWorkAfterDelay
1008         https://bugs.webkit.org/show_bug.cgi?id=54878
1009
1010         * Platform/qt/WorkQueueQt.cpp:
1011         (WorkQueue::scheduleWorkAfterDelay):
1012
1013 2011-02-20  Alejandro G. Castro  <alex@igalia.com>
1014
1015         Reviewed by Martin Robinson.
1016
1017         [GTK] Add WebResourceCacheDataManager to the compilation after r78848
1018         https://bugs.webkit.org/show_bug.cgi?id=54732
1019
1020         Added resource cache manager API to GTK+ compilation after r78848.
1021
1022         * GNUmakefile.am:
1023
1024 2011-02-20  Sam Weinig  <sam@webkit.org>
1025
1026         Reviewed by Dan Bernstein.
1027
1028         Crash in WebProcess at com.apple.WebCore: WebCore::Page::goToItem + 46
1029         <rdar://problem/8942726>
1030
1031         * WebProcess/WebPage/WebPage.cpp:
1032         (WebKit::WebPage::goForward):
1033         (WebKit::WebPage::goBack):
1034         (WebKit::WebPage::goToBackForwardItem):
1035         Defend agains null HistoryItems.
1036
1037 2011-02-20  Anders Carlsson  <andersca@apple.com>
1038
1039         Reviewed by Maciej Stachowiak.
1040
1041         Crash when a plug-in requests a javascript: url that destroys the plug-in
1042         https://bugs.webkit.org/show_bug.cgi?id=54837
1043         <rdar://problem/9005475>
1044
1045         * WebProcess/Plugins/PluginProxy.cpp:
1046         (WebKit::PluginProxy::destroy):
1047         Null out m_pluginController.
1048
1049         * WebProcess/Plugins/PluginView.cpp:
1050         (WebKit::PluginView::performJavaScriptURLRequest):
1051         Don't access the frame through m_pluginElement since it will be nulled out
1052         when the plug-in is destroyed.
1053
1054 2011-02-20  Anders Carlsson  <andersca@apple.com>
1055
1056         Reviewed by Sam Weinig.
1057
1058         Fix another crash when a plug-in is destroyed when evaluating JavaScript
1059         https://bugs.webkit.org/show_bug.cgi?id=54834
1060         <rdar://problem/9005475>
1061
1062         This contains three separate fixes:
1063
1064         - In unprotectPluginFromDestruction we can't just destroy the plug-in once
1065           the count reaches zero, because the plug-in might still have code executing
1066           on the stack. To fix this we use a zero-delay timer to defer destruction
1067           of the plug-in.
1068
1069         - Trying to get the NPObject for the window using NPN_GetValue would return
1070           NPERR_NO_ERROR, even if the returned NPObject was null. Fix this to return
1071           NPERR_GENERIC_ERROR instead.
1072
1073         - Protect the plug-in from destruction anytime an NPAPI call that sends a 
1074           synchronous IPC message is made.
1075
1076         * PluginProcess/PluginControllerProxy.cpp:
1077         (WebKit::PluginControllerProxy::PluginControllerProxy):
1078         (WebKit::PluginControllerProxy::destroy):
1079         (WebKit::PluginControllerProxy::unprotectPluginFromDestruction):
1080         * PluginProcess/PluginControllerProxy.h:
1081         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
1082         (WebKit::PluginDestructionProtector::PluginDestructionProtector):
1083         (WebKit::NPN_GetValue):
1084         (WebKit::NPN_Evaluate):
1085         (WebKit::NPN_GetProperty):
1086         (WebKit::NPN_SetProperty):
1087         (WebKit::NPN_RemoveProperty):
1088         (WebKit::NPN_HasProperty):
1089         (WebKit::NPN_HasMethod):
1090         (WebKit::NPN_Enumerate):
1091         (WebKit::NPN_Construct):
1092         (WebKit::NPN_GetValueForURL):
1093         (WebKit::NPN_SetValueForURL):
1094
1095 2011-02-19  Sam Weinig  <sam@webkit.org>
1096
1097         Reviewed by Anders Carlsson.
1098
1099         Add phase in addition to momentumPhase to platform wheel events
1100         Part of <rdar://problem/8945362>
1101
1102         Rename existing phase to momentumPhase.
1103
1104         * Shared/WebEvent.h:
1105         (WebKit::WebWheelEvent::momentumPhase):
1106         * Shared/WebEventConversion.cpp:
1107         (WebKit::WebKit2PlatformWheelEvent::WebKit2PlatformWheelEvent):
1108         * Shared/WebWheelEvent.cpp:
1109         (WebKit::WebWheelEvent::WebWheelEvent):
1110         (WebKit::WebWheelEvent::encode):
1111         (WebKit::WebWheelEvent::decode):
1112         * Shared/mac/WebEventFactory.mm:
1113         (WebKit::phaseForEvent):
1114         (WebKit::momentumPhaseForEvent):
1115         (WebKit::WebEventFactory::createWebWheelEvent):
1116
1117 2011-02-19  Anders Carlsson  <andersca@apple.com>
1118
1119         Reviewed by Dan Bernstein.
1120
1121         Crash when trying to take a snapshot of an uninitialized plug-in
1122         https://bugs.webkit.org/show_bug.cgi?id=54812
1123
1124         * WebProcess/Plugins/PluginView.cpp:
1125         (WebKit::PluginView::notifyWidget):
1126         Don't try to create a snapshot of the plug-in if it hasn't been initialized.
1127
1128 2011-02-18  Gavin Barraclough  <barraclough@apple.com>
1129
1130         Reviewed by Sam Weinig.
1131
1132         Bug 54786 - Devirtualize JSCell::classInfo()
1133
1134         Instead of making a virtual function call, add a pointer to the ClassInfo
1135         onto Structure.
1136
1137         This removes a virtual function call, and paves the way towards removing all
1138         the createStructure methods, and StructureFlags/AnonymousSlotCount properties
1139         (these should be able to move onto ClassInfo).
1140
1141         Calls to Structure::create must now pass a pointer to the ClassInfo for the
1142         structure. All objects now have a ClassInfo pointer, non-object cell types
1143         still do not.
1144
1145         Changes are most mechanical, involving three steps:
1146             * Remove virtual classInfo() methods.
1147             * Add &s_info parameter to calls to Structure::create.
1148             * Rename ClassInfo static members on classes from 'info' to 's_info',
1149               for consistency.
1150
1151         * WebProcess/Plugins/Netscape/JSNPMethod.cpp:
1152         (WebKit::JSNPMethod::JSNPMethod):
1153         * WebProcess/Plugins/Netscape/JSNPMethod.h:
1154         (WebKit::JSNPMethod::createStructure):
1155         * WebProcess/Plugins/Netscape/JSNPObject.cpp:
1156         (WebKit::JSNPObject::JSNPObject):
1157         * WebProcess/Plugins/Netscape/JSNPObject.h:
1158         (WebKit::JSNPObject::createStructure):
1159
1160 2011-02-19  Sam Weinig  <sam@webkit.org>
1161
1162         Reviewed by Anders Carlsson.
1163
1164         Rename performLookupAtCurrentMouseLocation to performDictionaryLookupAtCurrentMouseLocation
1165
1166         * UIProcess/API/mac/WKView.mm:
1167         (-[WKView performDictionaryLookupAtCurrentMouseLocation]):
1168         * UIProcess/API/mac/WKViewPrivate.h:
1169
1170 2011-02-19  Charlie Reis  <creis@chromium.org>
1171
1172         Reviewed by Mihai Parparita.
1173
1174         Ensure loading has stopped in HistoryController::goToItem
1175         https://bugs.webkit.org/show_bug.cgi?id=54517
1176
1177         Add a FrameLoaderClient callback for whether to stop loading before goToItem.
1178
1179         Test: http/tests/navigation/forward-to-fragment-fires-onload.html
1180
1181         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1182         (WebFrameLoaderClient::shouldStopLoadingForHistoryItem): Added.
1183         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
1184
1185 2011-02-18  Sam Weinig  <sam@webkit.org>
1186
1187         Reviewed by Adele Peterson.
1188
1189         Real fix for <rdar://problem/9025723> CrashTracer: [USER] 
1190         1 crash in WebProcess at com.apple.WebKit2: 
1191         WebKit::WebPage::didChangeScrollOffsetForMainFrame + 31
1192
1193         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1194         (WebKit::WebFrameLoaderClient::didChangeScrollOffset):
1195         Add null check for the FrameView. This function can be called when the
1196         FrameView is being torn down during a transition to a new FrameView.
1197
1198         * WebProcess/WebPage/WebPage.cpp:
1199         (WebKit::WebPage::didChangeScrollOffsetForMainFrame):
1200         Revert last attempt.
1201
1202 2011-02-18  Anders Carlsson  <andersca@apple.com>
1203
1204         Reviewed by Sam Weinig.
1205
1206         Hang trying to load nytimes.com with Flash installed
1207         <rdar://problem/9018113> 
1208
1209         * Platform/CoreIPC/Connection.cpp:
1210         (CoreIPC::Connection::sendSyncMessage):
1211         Call beginWaitForSyncReply() before sending the message. Otherwise, in some cases we could
1212         have gotten back a synchronous request before calling beginWaitForSyncReply(), and then we wouldn't
1213         process it correctly. (Which would lead to the hang).
1214
1215 2011-02-18  Simon Fraser  <simon.fraser@apple.com>
1216
1217         Reviewed by Kevin Decker.
1218
1219         <rdar://problem/9021296> Some plug-ins are the wrong size after zooming
1220         
1221         Use the same frame/bounds adjustment that we use for NSView-based
1222         plugins in WebKit2, which allows plug-ins and their snapshots to
1223         render with the correct size after scaling.
1224
1225         * WebProcess/Plugins/PluginView.cpp:
1226         (WebKit::PluginView::setBoundsSize):
1227         (WebKit::PluginView::viewGeometryDidChange):
1228         (WebKit::PluginView::clipRectInWindowCoordinates):
1229         * WebProcess/Plugins/PluginView.h:
1230
1231 2011-02-18  Beth Dakin  <bdakin@apple.com>
1232
1233         Rubber-stamped by Adele Peterson.
1234
1235         Fix for <rdar://problem/9025723> CrashTracer: [USER] 
1236         1 crash in WebProcess at com.apple.WebKit2: 
1237         WebKit::WebPage::didChangeScrollOffsetForMainFrame + 31
1238
1239         Simple null-check.
1240         * WebProcess/WebPage/WebPage.cpp:
1241         (WebKit::WebPage::didChangeScrollOffsetForMainFrame):
1242
1243 2011-02-18  Viatcheslav Ostapenko  <ostapenko.viatcheslav@nokia.com>
1244
1245         Reviewed by Kenneth Rohde Christiansen.
1246
1247         Tiled backing store area is too big.
1248         Error in area calculcation causes size of backing store
1249         up to 8 times bigger than viewport with default multipliers.
1250         https://bugs.webkit.org/show_bug.cgi?id=54587
1251
1252         * UIProcess/TiledDrawingAreaProxy.cpp:
1253         (WebKit::TiledDrawingAreaProxy::calculateKeepRect):
1254         (WebKit::TiledDrawingAreaProxy::calculateCoverRect):
1255
1256 2011-02-18  John Sullivan  <sullivan@apple.com>
1257
1258         Reviewed by Maciej Stachowiak.
1259
1260         <rdar://problem/9026169>
1261         https://bugs.webkit.org/show_bug.cgi?id=54780
1262         pendingAPIRequestURL isn't updated for WKPageGoToBackForwardListItem
1263
1264         * UIProcess/WebPageProxy.cpp:
1265         (WebKit::WebPageProxy::goToBackForwardItem):
1266         Update the pending API URL.
1267
1268 2011-02-18  Anders Carlsson  <andersca@apple.com>
1269
1270         Reviewed by Sam Weinig.
1271
1272         Accelerated content fades in when using a layer backed WKView
1273         <rdar://problem/9021586>
1274
1275         * UIProcess/API/mac/WKView.mm:
1276         (-[WKView _enterAcceleratedCompositingMode:]):
1277         Make a new nested CATransaction and disable animations when adding the layer 
1278         hosting subview. This avoids an implicit fade animation that would otherwise occur.
1279
1280 2011-02-18  Simon Fraser  <simon.fraser@apple.com>
1281
1282         Reviewed by Dan Bernstein.
1283
1284         Plugin snapshot location is wrong for subframes
1285         https://bugs.webkit.org/show_bug.cgi?id=54776
1286         
1287         Only change the CTM to the way that the plugin expects it
1288         when painting the plugin, not when drawing the snapshot.
1289         This fixes the snapshot location when painting flattened
1290         frames.
1291
1292         * WebProcess/Plugins/PluginView.cpp:
1293         (WebKit::PluginView::paint):
1294
1295 2011-02-18  Anders Carlsson  <andersca@apple.com>
1296
1297         Reviewed by Simon Fraser.
1298
1299         Implement NetscapePlugin::pluginComplexTextInputIdentifier
1300         https://bugs.webkit.org/show_bug.cgi?id=54770
1301
1302         * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
1303         (WebKit::NetscapePlugin::pluginComplexTextInputIdentifier):
1304
1305 2011-02-18  Sam Weinig  <sam@webkit.org>
1306
1307         Reviewed by Maciej Stachowiak.
1308
1309         Add the ability to ask the WKPage if the main frame is pinned
1310         to the right or left hand side.
1311         Part of <rdar://problem/9017043>.
1312
1313         * UIProcess/API/C/WKPage.cpp:
1314         (WKPageIsPinnedToLeftSide):
1315         (WKPageIsPinnedToRightSide):
1316         * UIProcess/API/C/WKPage.h:
1317         Add new API calls.
1318
1319         * UIProcess/WebPageProxy.cpp:
1320         (WebKit::WebPageProxy::WebPageProxy):
1321         (WebKit::WebPageProxy::close):
1322         (WebKit::WebPageProxy::processDidCrash):
1323         (WebKit::WebPageProxy::didChangeScrollOffsetPinningForMainFrame):
1324         * UIProcess/WebPageProxy.h:
1325         (WebKit::WebPageProxy::isPinnedToLeftSide):
1326         (WebKit::WebPageProxy::isPinnedToRightSide):
1327         Initialize, reset and update the pinned state.
1328
1329         * UIProcess/WebPageProxy.messages.in:
1330         Add message to update the pinned state.
1331
1332         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1333         (WebKit::WebFrameLoaderClient::didChangeScrollOffset):
1334         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
1335         * WebProcess/WebPage/WebPage.cpp:
1336         (WebKit::WebPage::WebPage):
1337         (WebKit::WebPage::didChangeScrollOffsetForMainFrame):
1338         * WebProcess/WebPage/WebPage.h:
1339         Cache the pinned state, and only update the UIProcess when it
1340         changes.
1341
1342 2011-02-18  Anders Carlsson  <andersca@apple.com>
1343
1344         Reviewed by Simon Fraser.
1345
1346         Fix assertion in SharedMemory::create when trying to snapshot 0x0 plug-in
1347         https://bugs.webkit.org/show_bug.cgi?id=54768
1348
1349         * PluginProcess/PluginControllerProxy.cpp:
1350         (WebKit::PluginControllerProxy::snapshot):
1351         Don't try to create a handle from a null ShareableBitmap.
1352
1353         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
1354         (WebKit::NetscapePlugin::snapshot):
1355         Check for a zero sized plug-in before trying to create a snapshot.
1356
1357 2011-02-18  Anders Carlsson  <andersca@apple.com>
1358
1359         Reviewed by Simon Fraser.
1360
1361         WKView flashes when entering/exiting compositing mode
1362         https://bugs.webkit.org/show_bug.cgi?id=54695
1363         <rdar://problem/9011554>
1364
1365         * UIProcess/API/mac/WKView.mm:
1366         (-[WKView _exitAcceleratedCompositingMode]):
1367         Remove the layer hosting view before clearing out its layer, otherwise we can get
1368         white flashes when exiting accelerated compositing mode.
1369
1370         * WebProcess/WebPage/DrawingAreaImpl.cpp:
1371         When entering accelerated compositing mode, we want to defer sending the message
1372         until we've actually committed the layer tree and pushed all changes over to the
1373         UI process.
1374
1375         (WebKit::DrawingAreaImpl::layerHostDidFlushLayers):
1376         Tell the layer tree host to force a repaint. This will ensure that all layer tree
1377         changes are pushed over to the UI process. When that is done, send the new layer tree
1378         context over to the UI process.
1379
1380         (WebKit::DrawingAreaImpl::setRootCompositingLayer):
1381         When exiting compositing mode in response to a didSetSize, we want to exit accelerated 
1382         compositing mode right away to avoid flashes. This is safe since we've laid out the page
1383         already so we won't end up reentering setRootCompositingLayer.
1384
1385         (WebKit::DrawingAreaImpl::enterAcceleratedCompositingMode):
1386         Tell the layer tree host to notify us when the next layer tree flush happened, so we can
1387         let the UI process know. If we're entering accelerated compositing mode in response to a
1388         SetSize message, the new layer tree context will be passed in the DidSetSize message.
1389
1390         * WebProcess/WebPage/DrawingAreaImpl.h:
1391         Add layerHostDidFlushLayers.
1392
1393         * WebProcess/WebPage/LayerTreeHost.h:
1394         Add setShouldNotifyAfterNextScheduledLayerFlush.
1395
1396         * WebProcess/WebPage/mac/LayerTreeHostMac.h:
1397         Add a m_notifyAfterScheduledLayerFlush flag.
1398
1399         * WebProcess/WebPage/mac/LayerTreeHostMac.mm:
1400         (WebKit::LayerTreeHostMac::LayerTreeHostMac):
1401         Initialize m_notifyAfterScheduledLayerFlush to false.
1402
1403         (WebKit::LayerTreeHostMac::setShouldNotifyAfterNextScheduledLayerFlush):
1404         Set m_notifyAfterScheduledLayerFlush to true.
1405
1406         (WebKit::LayerTreeHostMac::flushPendingLayerChangesRunLoopObserverCallback):
1407         If m_notifyAfterScheduledLayerFlush is true, call DrawingAreaImpl::layerHostDidFlushLayers.
1408
1409 2011-02-18  Alexey Proskuryakov  <ap@apple.com>
1410
1411         Reviewed by Adele Peterson.
1412
1413         REGRESSION (WebKit2): Wrong frame printed on tivofaq.com
1414         https://bugs.webkit.org/show_bug.cgi?id=54677
1415         <rdar://problem/8994133>
1416
1417         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1418         (WebKit::area): Use visible frame bounds.
1419         (WebKit::findLargestFrameInFrameSet): Added a comment explaining what we're up to here.
1420         WebKit2 shouldn't be making policy decisions for the client, but it gets dangerously close
1421         to that. We used to expose the same as WK1 API though.
1422
1423 2011-02-18  Balazs Kelemen  <kbalazs@webkit.org>
1424
1425         Unreviwed.
1426
1427         Remove CleanupHandler since we do not use it anymore.
1428
1429         * Shared/qt/CleanupHandler.cpp: Removed.
1430         * Shared/qt/CleanupHandler.h: Removed.
1431
1432 2011-02-18  Alejandro G. Castro  <alex@igalia.com>
1433
1434         Fix GTK build by fixing signature of platformPaint(), required after r78956.
1435
1436         * WebProcess/Plugins/Netscape/gtk/NetscapePluginGtk.cpp:
1437         (WebKit::NetscapePlugin::platformPaint):
1438
1439 2011-02-17  Dan Bernstein  <mitz@apple.com>
1440
1441         LLVM Compiler build fix.
1442
1443         * UIProcess/WebResourceCacheManagerProxy.h:
1444         * WebProcess/ResourceCache/WebResourceCacheManager.h:
1445
1446 2011-02-17  Simon Fraser  <simon.fraser@apple.com>
1447
1448         Fix Windows and Qt builds by fixing signature of platformPaint().
1449
1450         * WebProcess/Plugins/Netscape/qt/NetscapePluginQt.cpp:
1451         (WebKit::NetscapePlugin::platformPaint):
1452         * WebProcess/Plugins/Netscape/win/NetscapePluginWin.cpp:
1453         (WebKit::NetscapePlugin::platformPaint):
1454
1455 2011-02-17  Simon Fraser  <simon.fraser@apple.com>
1456
1457         Reviewed by Sam Weinig.
1458
1459         WebKit2 snapshots don't show plug-ins
1460         https://bugs.webkit.org/show_bug.cgi?id=54716
1461         
1462         Fix WebKit2 plug-ins to do a software paint for
1463         snapshotting.
1464
1465         * PluginProcess/PluginControllerProxy.h:
1466         * PluginProcess/PluginControllerProxy.cpp:
1467         (WebKit::PluginControllerProxy::snapshot): Respond to the snapshot
1468         message by getting a sharable bitmap from the plugin, and returning
1469         a handle to it in the reply.
1470
1471         * PluginProcess/PluginControllerProxy.messages.in: Add the snapshot
1472         message.
1473         
1474         * Shared/Plugins/PluginQuirks.h:
1475         * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
1476         (WebKit::NetscapePluginModule::determineQuirks): Add a quirk for the
1477         ability to be snapshotted, which we only set for Flash at the moment.
1478         
1479         * WebProcess/Plugins/Netscape/NetscapePlugin.h:
1480         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
1481         (WebKit::NetscapePlugin::snapshot): Create a shareable bitmap, and
1482         paint into it.
1483         (WebKit::NetscapePlugin::supportsSnapshotting): Test the quirk.
1484
1485         * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
1486         (WebKit::NetscapePlugin::platformPaint): Allow the paint to happen
1487         if we're snapshotting, even when using the CoreAnimation drawing
1488         model.
1489         
1490         * WebProcess/Plugins/Plugin.h: New snapshot method.
1491         
1492         * WebProcess/Plugins/PluginProxy.h:
1493         * WebProcess/Plugins/PluginProxy.cpp:
1494         (WebKit::PluginProxy::snapshot): Send a sync message to the plugin process,
1495         asking for a snapshot in a shareble bitmap.
1496         
1497         * WebProcess/Plugins/PluginView.h:
1498         * WebProcess/Plugins/PluginView.cpp:
1499         (WebKit::PluginView::paint): Use the snapshot if we have one, to avoid
1500         calling into the plugin to draw, which may run script.
1501         
1502         (WebKit::PluginView::notifyWidget): Generate the snapshot before
1503         a flattening paint, and throw it away after.
1504
1505 2011-02-17  Jessie Berlin  <jberlin@apple.com>
1506
1507         Reviewed by Adam Roben.
1508
1509         WebKit2: The CFNetwork Cache should be shared between the UI Process and the Web Process on
1510         Windows.
1511         https://bugs.webkit.org/show_bug.cgi?id=54683
1512
1513         * Shared/WebProcessCreationParameters.cpp:
1514         (WebKit::WebProcessCreationParameters::encode):
1515         (WebKit::WebProcessCreationParameters::decode):
1516         * Shared/WebProcessCreationParameters.h:
1517  
1518         * UIProcess/win/WebContextWin.cpp:
1519         (WebKit::WebContext::platformInitializeWebProcess):
1520         Make sure to remove the ending slash, as CFNetwork does not recognize the directory with
1521         that slash.
1522
1523         * WebProcess/win/WebProcessWin.cpp:
1524         (WebKit::WebProcess::platformInitializeWebProcess):
1525         Create a cache using the path, disk capacity, and memory capacity and set it as default.
1526
1527 2011-02-17  Anders Carlsson  <andersca@apple.com>
1528
1529         Reviewed by Sam Weinig.
1530
1531         Web and/or plug-in process crashes when NPN_Evaluate destroys the plug-in
1532         https://bugs.webkit.org/show_bug.cgi?id=54686
1533         <rdar://problem/9013384>
1534
1535         This patch fixes two bugs with a plug-in calling NPN_Evaluate to destroy itself:
1536
1537         - The PluginProxy object would be destroyed in the middle of PluginProxy::evaluate.
1538           This would cause the web process to crash.
1539
1540         - The PluginControllerProxy would call NPP_Destroy while the plug-in was busy running
1541           code. This would cause the plug-in process to crash.
1542
1543         To fix this, we add protectPluginFromDestruction/unprotectPluginFromDestruction to
1544         PluginControllerProxy and use it to defer calling destroy() in the plug-in process,
1545         and defer actually destroying the plug-in in the web process.
1546
1547         https://bugs.webkit.org/show_bug.cgi?id=54171 tracks adding a test for this.
1548
1549         * PluginProcess/PluginControllerProxy.cpp:
1550         (WebKit::PluginControllerProxy::PluginControllerProxy):
1551         (WebKit::PluginControllerProxy::destroy):
1552         (WebKit::PluginControllerProxy::evaluate):
1553         (WebKit::PluginControllerProxy::protectPluginFromDestruction):
1554         (WebKit::PluginControllerProxy::unprotectPluginFromDestruction):
1555         * PluginProcess/PluginControllerProxy.h:
1556         (WebKit::PluginControllerProxy::asPluginController):
1557         * PluginProcess/WebProcessConnection.cpp:
1558         (WebKit::WebProcessConnection::destroyPluginControllerProxy):
1559         (WebKit::WebProcessConnection::didReceiveMessage):
1560         (WebKit::WebProcessConnection::didReceiveSyncMessage):
1561         * PluginProcess/WebProcessConnection.h:
1562         (WebKit::WebProcessConnection::connection):
1563         * WebProcess/Plugins/PluginController.h:
1564         (WebKit::PluginController::PluginDestructionProtector::PluginDestructionProtector):
1565         (WebKit::PluginController::PluginDestructionProtector::~PluginDestructionProtector):
1566         * WebProcess/Plugins/PluginProxy.cpp:
1567         (WebKit::PluginProxy::evaluate):
1568         * WebProcess/Plugins/PluginView.cpp:
1569         (WebKit::PluginView::protectPluginFromDestruction):
1570         (WebKit::PluginView::unprotectPluginFromDestruction):
1571         * WebProcess/Plugins/PluginView.h:
1572
1573 2011-02-17  Sam Weinig  <sam@webkit.org>
1574
1575         Build fix.
1576
1577         * WebProcess/WebPage/mac/WebPageMac.mm:
1578         (WebKit::WebPage::performDictionaryLookupAtLocation):
1579
1580 2011-02-17  Sam Weinig  <sam@webkit.org>
1581
1582         Reviewed by Maciej Stachowiak.
1583
1584         WebKit2: Support Dictionary popup
1585         <rdar://problem/7660670>
1586
1587         * Shared/TextInfo.cpp: Added.
1588         (WebKit::TextInfo::encode):
1589         (WebKit::TextInfo::decode):
1590         * Shared/TextInfo.h: Added.
1591         (WebKit::TextInfo::TextInfo):
1592         Add class to represent the location and style of a run of text.
1593
1594         * UIProcess/PageClient.h:
1595         * UIProcess/API/mac/PageClientImpl.h:
1596         * UIProcess/API/mac/PageClientImpl.mm:
1597         (WebKit::PageClientImpl::didPerformDictionaryLookup):
1598         Invoke the dictionary popup.
1599
1600         * UIProcess/API/mac/WKView.mm:
1601         (-[WKView performLookupAtCurrentMouseLocation]):
1602         Tell the WebProcess to get get the text under the mouse and cause
1603         the dictionary popup to appear.
1604
1605         * UIProcess/API/mac/WKViewPrivate.h:
1606         Add performLookupAtCurrentMouseLocation.
1607
1608         * UIProcess/WebPageProxy.cpp:
1609         (WebKit::WebPageProxy::performDictionaryLookupAtLocation):
1610         (WebKit::WebPageProxy::didPerformDictionaryLookup):
1611         * UIProcess/WebPageProxy.h:
1612         * UIProcess/WebPageProxy.messages.in:
1613         * WebProcess/WebPage/WebPage.cpp:
1614         * WebProcess/WebPage/WebPage.h:
1615         * WebProcess/WebPage/WebPage.messages.in:
1616         Pipe messages through.
1617
1618         * WebProcess/WebPage/mac/WebPageMac.mm:
1619         (WebKit::characterRangeAtPoint): Fix to return PassRefPtr
1620         and not potentially stale pointers.
1621
1622         (WebKit::WebPage::characterIndexForPoint):
1623         Change to use a RefPtr.
1624
1625         (WebKit::WebPage::performDictionaryLookupAtLocation):
1626         Add simple heuristic to get the word at the current point (or the current selection
1627         if it is at that point) and grab the style of the word to send the UIProcess.
1628
1629         * WebKit2.pro:
1630         * WebKit2.xcodeproj/project.pbxproj:
1631         * win/WebKit2.vcproj:
1632         Add new files.
1633
1634 2011-02-17  Brian Weinstein  <bweinstein@apple.com>
1635
1636         Qt build fix.
1637
1638         * WebKit2.pro: Update after renaming of MemoryCache to ResourceCache.
1639
1640 2011-02-17  Brian Weinstein  <bweinstein@apple.com>
1641
1642         Mac build fix.
1643
1644         * WebKit2.xcodeproj/project.pbxproj: Use relative to group instead of absolute paths. Not everyone's home
1645             directory is /Users/brian_weinstein.
1646
1647 2011-02-16  Brian Weinstein  <bweinstein@apple.com>
1648
1649         Reviewed by Brady Eidson.
1650
1651         WebKit2: Need a way to manage the WebCore Cache
1652         https://bugs.webkit.org/show_bug.cgi?id=54501
1653         
1654         Implement a WebKit2 API to manage the WebCore memory cache. This API exposes three functions:
1655         
1656         1) A method to get a list of all security origins that have entries in the WebCore memory cache.
1657         2) A method to remove all entries in the WebCore memory cache from a SecurityOrigin.
1658         3) A method to remove all entries from the WebCore memory cache.
1659
1660         * Platform/CoreIPC/MessageID.h: Add two new MessageClasses.
1661         * Shared/API/c/WKBase.h:
1662         * Shared/APIObject.h: Add a CacheManager type.
1663         * Shared/WebSecurityOrigin.h: Typedef WKCacheManagerRef.
1664         (WebKit::WebSecurityOrigin::createFromString): Creates a WebCore::SecurityOrigin using 
1665             SecurityOrigin::createFromString.
1666         (WebKit::WebSecurityOrigin::toString): Calls through to SecurityOrigin::toString.
1667         * UIProcess/API/C/WKAPICast.h:
1668
1669         * UIProcess/API/C/WKCacheManager.cpp: Added.
1670         (WKCacheManagerGetTypeID): Returns the WebResourceCacheManagerProxy type.
1671         (WKCacheManagerGetCacheOrigins): Calls through to WebResourceCacheManagerProxy::getCacheOrigins.
1672         (callGetCacheOriginsBlockBlockAndDispose):
1673         (WKCacheManagerGetCacheOrigins_b):
1674         (WKCacheManagerDeleteCacheForOrigin): Calls through to WebResourceCacheManagerProxy::deleteCacheForOrigin.
1675         (WKCacheManagerDeleteAllCache): Calls through to WebResourceCacheManagerProxy::deleteAllCache.
1676         * UIProcess/API/C/WKCacheManager.h: Added.
1677
1678         * UIProcess/API/C/WKContext.cpp:
1679         (WKContextGetCacheManager): Calls to get the WebResourceCacheManagerProxy.
1680         * UIProcess/API/C/WKContext.h:
1681
1682         * UIProcess/WebResourceCacheManagerProxy.cpp: Added.
1683         (WebKit::WebResourceCacheManagerProxy::create): Calls through to the constructor.
1684         (WebKit::WebResourceCacheManagerProxy::WebResourceCacheManagerProxy): Initialize the m_webContext variable.
1685         (WebKit::WebResourceCacheManagerProxy::~WebResourceCacheManagerProxy):
1686         (WebKit::WebResourceCacheManagerProxy::invalidate): Invalidate the callback map.
1687         (WebKit::WebResourceCacheManagerProxy::getCacheOrigins): Call through to the web process to get the cache
1688             origins.
1689         (WebKit::WebResourceCacheManagerProxy::didGetCacheOrigins): Call the callback.
1690         (WebKit::WebResourceCacheManagerProxy::deleteCacheForOrigin): Call through to the web process to delete cache
1691             for the given origin. 
1692         (WebKit::WebResourceCacheManagerProxy::deleteAllCache): Call through to the web process to delete all of the cache.
1693         * UIProcess/WebResourceCacheManagerProxy.h: Added.
1694         (WebKit::WebResourceCacheManagerProxy::clearContext):
1695         (WebKit::WebResourceCacheManagerProxy::type):
1696         * UIProcess/WebResourceCacheManagerProxy.messages.in: Added.
1697
1698         * UIProcess/WebContext.cpp:
1699         (WebKit::WebContext::WebContext): Initialize new member variable.
1700         (WebKit::WebContext::~WebContext):  Invalidates new member variable.
1701         (WebKit::WebContext::didReceiveMessage): Passes cache messages to the cache manager.
1702         * UIProcess/WebContext.h:
1703         (WebKit::WebContext::cacheManagerProxy):
1704         * UIProcess/WebProcessProxy.cpp:
1705         (WebKit::WebProcessProxy::didReceiveMessage): Add a new message class.
1706
1707         * WebProcess/ResourceCache/WebResourceCacheManager.cpp: Added.
1708         (WebKit::WebResourceCacheManager::shared):
1709         (WebKit::WebResourceCacheManager::WebResourceCacheManager):
1710         (WebKit::WebResourceCacheManager::~WebResourceCacheManager):
1711         (WebKit::WebResourceCacheManager::didReceiveMessage): Calls through to didReceiveWebResourceCacheManagerMessage.
1712         (WebKit::WebResourceCacheManager::getCacheOrigins): Gets a list of origins with cache entries from the memory
1713             cache, and puts them into a vector to send to the UI process.
1714         (WebKit::WebResourceCacheManager::deleteCacheForOrigin): Calls through to ResourceCache to delete all cache entries
1715             from a given origin.
1716         (WebKit::WebResourceCacheManager::deleteAllCache):
1717         * WebProcess/ResourceCache/WebResourceCacheManager.h: Added.
1718         * WebProcess/ResourceCache/WebResourceCacheManager.messages.in: Added.
1719
1720         * WebProcess/WebProcess.cpp:
1721         (WebKit::WebProcess::didReceiveMessage):
1722         (WebKit::WebProcess::clearResourceCaches): Tell the memory cache to evict its resources. This was done on WebKit1, 
1723             but not WebKit2.
1724         * WebProcess/WebProcess.h:
1725         
1726         * WebKit2.xcodeproj/project.pbxproj: Added new files.
1727         * win/WebKit2.vcproj: Ditto.
1728         * win/WebKit2Common.vsprops: Added new include directory.
1729         * win/WebKit2Generated.make: Added new header.
1730
1731 2011-02-16  David Hyatt  <hyatt@apple.com>
1732
1733         Reviewed by Dan Bernstein.
1734
1735         https://bugs.webkit.org/show_bug.cgi?id=54244
1736         
1737         Convert the line box tree to floating point and eliminate font rounding hacks.  This patch removes all of the rounding
1738         hacks from the Font code and makes sure all Font APIs involving width measurement and width offsets use floats.
1739         
1740         The line box tree's x, y and logicalWidth members have all been converted to floats and all of the line box APIs have
1741         been changed as well.
1742         
1743         In terms of pixel adjustments, overflow is using an enclosing model (so it will be enclosingIntRect of a line box's x/y/width/height).
1744         
1745         Background and border painting is using a rounding model, so borders and backgrounds will round to the nearest pixel when painting.
1746         
1747         Replaced elements still snap to integer positions on lines, and they use a rounding model as well, although their underlying line boxes
1748         still have a precise floating point position.
1749
1750         Justification will now allow subpixel positioning to occur as well.  Platforms that don't support subpixel positioning should already
1751         be rounding justification spacing in their font code.
1752
1753         Many layout test results change on Mac, since rounding hacks were used there and are now gone.
1754
1755         * WebProcess/WebCoreSupport/win/WebPopupMenuWin.cpp:
1756         (WebKit::WebPopupMenu::setUpPlatformData):
1757
1758 2011-02-10  Luiz Agostini  <luiz.agostini@openbossa.org>
1759
1760         Reviewed by Adam Roben.
1761
1762         HTML5 <details> and <summary>: localized text
1763         https://bugs.webkit.org/show_bug.cgi?id=54260
1764
1765         The method defaultDetailsSummaryText was added to LocalizationStrategy class. It is used to
1766         provide the default label to be used by a <details> tag that has no <summary> child.
1767
1768         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
1769         (WebKit::WebPlatformStrategies::defaultDetailsSummaryText):
1770         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
1771
1772 2011-02-17  Adam Roben  <aroben@apple.com>
1773
1774         Make sure layout is up-to-date before rendering the layer tree in DrawingAreaImpl
1775
1776         Fixes <http://webkit.org/b/54646> <rdar://problem/9016889> Assertion failure in
1777         FrameView::paintContents when calling WKPageForceRepaint on a page that uses accelerated
1778         compositing
1779
1780         Reviewed by Anders Carlsson.
1781
1782         * WebProcess/WebPage/DrawingAreaImpl.cpp:
1783         (WebKit::DrawingAreaImpl::forceRepaint): Lay out before we do anything else.
1784
1785 2011-02-17  Alejandro G. Castro  <alex@igalia.com>
1786
1787         Reviewed by Martin Robinson.
1788
1789         [GTK] Add WKPluginSiteDataManager.cpp compilation after r78647
1790         https://bugs.webkit.org/show_bug.cgi?id=54564
1791
1792         * GNUmakefile.am: Added files to compilation.
1793         * Shared/Plugins/Netscape/NetscapePluginModule.h: used
1794         npruntime_internal.h in the include to avoid problems with X
1795         types.
1796         * WebProcess/WebProcess.cpp:
1797         (WebKit::WebProcess::setAlwaysUsesComplexTextCodePath): fixed
1798         ambiguous reference to Font caused by the X headers required by
1799         the plugins.
1800
1801 2011-02-16  Matthew Delaney  <mdelaney@apple.com>
1802
1803         Reviewed by Simon Fraser.
1804
1805         Allow acceleratesDrawing for WebKit2
1806         https://bugs.webkit.org/show_bug.cgi?id=54511
1807
1808         Plumb through preference for accelerated drawing.
1809         
1810         If accelerated drawing is enabled, keep the DrawingAreaImpl in
1811         accelerated compositing mode.
1812
1813         * Shared/WebPreferencesStore.h:
1814         * UIProcess/API/C/WKPreferences.cpp:
1815         (WKPreferencesSetAcceleratedDrawingEnabled):
1816         (WKPreferencesGetAcceleratedDrawingEnabled):
1817         * UIProcess/API/C/WKPreferencesPrivate.h:
1818         * WebProcess/WebPage/DrawingAreaImpl.cpp:
1819         (WebKit::DrawingAreaImpl::DrawingAreaImpl):
1820         (WebKit::DrawingAreaImpl::setRootCompositingLayer):
1821         (WebKit::DrawingAreaImpl::exitAcceleratedCompositingMode):
1822         * WebProcess/WebPage/DrawingAreaImpl.h:
1823         * WebProcess/WebPage/WebPage.cpp:
1824         (WebKit::WebPage::updatePreferences):
1825
1826 2011-02-16  Yael Aharon  <yael.aharon@nokia.com>
1827
1828         Reviewed by Andreas Kling.
1829
1830         [Qt] White screen is displayed when tiled backing store is enabled in MiniBrowser.
1831         https://bugs.webkit.org/show_bug.cgi?id=54583
1832
1833         Make sure to invalidate all the tiles, including the last one.
1834
1835         * UIProcess/TiledDrawingAreaProxy.cpp:
1836         (WebKit::TiledDrawingAreaProxy::invalidate):
1837
1838 2011-02-16  Yael Aharon  <yael.aharon@nokia.com>
1839
1840         Reviewed by Andreas Kling.
1841
1842         [Qt] Tiles are not created for webkit2 after r77286.
1843         https://bugs.webkit.org/show_bug.cgi?id=54577
1844
1845         When using the default tile size of 1024x1024, only one tile is created.
1846         Make sure to create this tile by undoing what seems to be a typo in r77286.
1847
1848         * UIProcess/TiledDrawingAreaProxy.cpp:
1849         (WebKit::TiledDrawingAreaProxy::paint):
1850         (WebKit::TiledDrawingAreaProxy::createTiles):
1851
1852 == Rolled over to ChangeLog-2011-02-16 ==