Source/WebCore:
[WebKit-https.git] / Source / WebKit2 / ChangeLog-2011-02-16
1 2011-02-16  Anders Carlsson  <andersca@apple.com>
2
3         Reviewed by Adam Roben.
4
5         Always disable the responsiveness timer when showing a popup menu
6         https://bugs.webkit.org/show_bug.cgi?id=54578
7         <rdar://problem/9009170>
8
9         * UIProcess/WebPageProxy.cpp:
10         (WebKit::WebPageProxy::showPopupMenu):
11
12 2011-02-16  Anders Carlsson  <andersca@apple.com>
13
14         Reviewed by Adam Roben.
15
16         Assertion failure in DrawingAreaImpl::display when calling WKPageForceRepaint on a page that uses accelerated compositing
17         https://bugs.webkit.org/show_bug.cgi?id=54575
18         <rdar://problem/8979594>
19
20         * WebProcess/WebPage/DrawingAreaImpl.cpp:
21         (WebKit::DrawingAreaImpl::forceRepaint):
22         If there is a layer tree host, ask it to force a repaint instead.
23
24         * WebProcess/WebPage/LayerTreeHost.h:
25         * WebProcess/WebPage/mac/LayerTreeHostMac.h:
26         * WebProcess/WebPage/mac/LayerTreeHostMac.mm:
27         (WebKit::LayerTreeHostMac::forceRepaint):
28         Flush any layer changes, then flush and synchronize the current CA transaction.
29
30 2011-02-16  Alexey Proskuryakov  <ap@apple.com>
31
32         Reviewed by Anders Carlsson.
33
34         https://bugs.webkit.org/show_bug.cgi?id=54572
35         REGRESSION (WebKit2): Print Backgrounds checkbox has no effect for DOM initiated printing
36
37         * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::preferencesDidChange): Preferences need
38         to be propagated to Web process during synchronous printing.
39
40 2011-02-15  Anders Carlsson  <andersca@apple.com>
41
42         Reviewed by Sam Weinig.
43
44         WebPluginSiteDataManager should work with plug-in process
45         https://bugs.webkit.org/show_bug.cgi?id=54523
46         <rdar://problem/8689312>
47
48         * PluginProcess/PluginProcess.cpp:
49         (WebKit::PluginProcess::removeWebProcessConnection):
50         Call startShutdownTimerIfNecessary().
51
52         (WebKit::PluginProcess::getSitesWithData):
53         Ask the plug-in module for the sites with data and send them back
54         in a PluginProcessProxy::DidGetSitesWithData message.
55
56         (WebKit::PluginProcess::clearSiteData):
57         Clear site data and send back a DidClearSiteData message.
58
59         (WebKit::PluginProcess::startShutdownTimerIfNecessary):
60         Factor code out from removeWebProcessConnection.
61
62         * PluginProcess/PluginProcess.messages.in:
63         Add new messages.
64
65         * UIProcess/Plugins/PluginInfoStore.cpp:
66         (WebKit::PluginInfoStore::plugins):
67         New function for getting all plug-ins.
68
69         * UIProcess/Plugins/PluginProcessManager.cpp:
70         (WebKit::PluginProcessManager::getPluginProcessConnection):
71         Call getOrCreatePluginProcess.
72
73         (WebKit::PluginProcessManager::getSitesWithData):
74         Get a plug-in process proxy and call getSitesWithData.
75
76         (WebKit::PluginProcessManager::clearSiteData):
77         Get a plug-in process proxy and call clearSiteData.
78
79         (WebKit::PluginProcessManager::getOrCreatePluginProcess):
80         Factor code to create a plug-in process out into a separate function.
81
82         * UIProcess/Plugins/PluginProcessProxy.cpp:
83         (WebKit::PluginProcessProxy::getSitesWithData):
84         (WebKit::PluginProcessProxy::clearSiteData):
85         Update the pending reply struct. If the process is still launching,
86         enqueue the request. Otherwise, just send the message.
87
88         (WebKit::PluginProcessProxy::pluginProcessCrashedOrFailedToLaunch):
89         Make sure that pending replies are sent out.
90
91         (WebKit::PluginProcessProxy::didFinishLaunching):
92         Send our pending requests.
93
94         (WebKit::PluginProcessProxy::didGetSitesWithData):
95         (WebKit::PluginProcessProxy::didClearSiteData):
96         Call down to the plug-in site data manager.
97
98         * UIProcess/Plugins/PluginProcessProxy.messages.in:
99         Add DidGetSitesWithData and DidClearSiteData messages.
100
101         * UIProcess/Plugins/WebPluginSiteDataManager.cpp:
102         (WebKit::WebPluginSiteDataManager::GetSitesWithDataState::GetSitesWithDataState):
103         Initialize the state.
104
105         (WebKit::WebPluginSiteDataManager::GetSitesWithDataState::getSitesWithDataForNextPlugin):
106         If the plug-in queue is empty, call didGetSitesWithDataForAllPlugins. Otherwise, ask
107         the plug-in process manager to get sites for the next plug-in.
108
109         (WebKit::WebPluginSiteDataManager::GetSitesWithDataState::didGetSitesWithDataForSinglePlugin):
110         Update the sites set and get sites for the next plug-in.
111
112         (WebKit::WebPluginSiteDataManager::ClearSiteDataState::ClearSiteDataState):
113         Initialize the state.
114
115         (WebKit::WebPluginSiteDataManager::ClearSiteDataState::clearSiteDataForNextPlugin):
116         If the plug-in queue is empty, call didClearSiteDataForAllPlugins. Otherwise, ask
117         the plug-in process manager to get sites for the next plug-in.
118         
119         (WebKit::WebPluginSiteDataManager::ClearSiteDataState::didClearSiteDataForSinglePlugin):
120         Update the sites set and ask the next plug-in to clear site data.
121
122         (WebKit::WebPluginSiteDataManager::~WebPluginSiteDataManager):
123         Assert that all maps are empty.
124
125         (WebKit::WebPluginSiteDataManager::invalidate):
126         Delete and clear the pending state maps.
127
128         (WebKit::WebPluginSiteDataManager::getSitesWithData):
129         In the ENABLE(PLUGIN_PROCESS) case, allocate a new GetSitesWithDataState object and
130         tell it to get sites for the next plug-in. Otherwise, make sure that the web process
131         is alive before sending a GetSitesWithPluginData message.
132         
133         (WebKit::WebPluginSiteDataManager::clearSiteData):
134         In the ENABLE(PLUGIN_PROCESS) case, allocate a new ClearSiteDataState object and
135         tell it to get sites for the next plug-in. Otherwise, make sure that the web process
136         is alive before sending a ClearPluginSiteData message.
137         
138         (WebKit::WebPluginSiteDataManager::didGetSitesWithDataForSinglePlugin):
139         Call down to the GetSitesWithDataState object.
140
141         (WebKit::WebPluginSiteDataManager::didGetSitesWithDataForAllPlugins):
142         Free the GetSitesWithDataState object and invoke the callback.
143
144         (WebKit::WebPluginSiteDataManager::didClearSiteDataForSinglePlugin):
145         Call down to the GetSitesWithDataState object.
146         
147         (WebKit::WebPluginSiteDataManager::didClearSiteDataForAllPlugins):
148         Free the GetSitesWithDataState object and invoke the callback.
149
150         * UIProcess/WebContext.cpp:
151         (WebKit::WebContext::processDidClose):
152         Don't invalidate the plug-in site data manager if we're using a plug-in process.
153
154         * WebProcess/WebProcess.cpp:
155         (WebKit::WebProcess::getSitesWithPluginData):
156         (WebKit::WebProcess::clearPluginSiteData):
157         Call shutdownIfPossible().
158
159 2011-02-15  Jon Honeycutt  <jhoneycutt@apple.com>
160
161         Copy over new WebKit 2 header.
162
163         Rubber-stamped by Alice Liu.
164
165         * win/WebKit2Generated.make:
166
167 2011-02-15  Anders Carlsson  <andersca@apple.com>
168
169         Reviewed by Darin Adler.
170
171         Implement WKPluginSiteDataManagerClearSiteData
172         https://bugs.webkit.org/show_bug.cgi?id=54512
173         <rdar://problem/8689312>
174
175         * UIProcess/API/C/WKPluginSiteDataManager.cpp:
176         (WKPluginSiteDataManagerGetTypeID):
177         Implement this.
178
179         (toNPClearSiteDataFlags):
180         Convert WKClearSiteDataFlags to NPP_ClearSiteData flags.
181         
182         (WKPluginSiteDataManagerClearSiteData):
183         (WKPluginSiteDataManagerClearAllSiteData):
184         Call through to WebPluginSiteDataManager::clearSiteData.
185
186         * UIProcess/API/C/WKPluginSiteDataManager.h:
187         Change the clear functions to take a completion callback.
188
189         * UIProcess/Plugins/WebPluginSiteDataManager.cpp:
190         (WebKit::WebPluginSiteDataManager::clearSiteData):
191         Ask the plug-in info store for all plug-in paths and send a
192         ClearPluginSiteData message to the web process.
193         
194         (WebKit::WebPluginSiteDataManager::didClearSiteData):
195         call the callback.
196
197         * UIProcess/WebContext.cpp:
198         (WebKit::WebContext::didClearPluginSiteData):
199         Call through to the plug-in site data manager.
200
201         * UIProcess/WebContext.messages.in:
202         Add ClearPluginSiteData message.
203
204         * WebProcess/WebProcess.cpp:
205         (WebKit::WebProcess::clearPluginSiteData):
206         Iterate over all the plug-in paths, creating plug-in modules and calling
207         clearSiteData for each one.
208
209         * WebProcess/WebProcess.h:
210         * WebProcess/WebProcess.messages.in:
211         Add DidClearPluginSiteData message.
212
213 2011-02-15  Anders Carlsson  <andersca@apple.com>
214
215         Reviewed by Jon Honeycutt.
216
217         Implement WKPluginSiteDataManagerGetSitesWithData
218         https://bugs.webkit.org/show_bug.cgi?id=54510
219         <rdar://problem/8689312>
220
221         * UIProcess/API/C/WKContext.cpp:
222         (WKContextGetPluginSiteDataManager):
223         Call WebContext::pluginSiteDataManager.
224         
225         * UIProcess/API/C/WKPluginSiteDataManager.cpp:
226         (WKPluginSiteDataManagerGetSitesWithData):
227         Call WebPluginSiteDataManager::getSitesWithData.
228
229         * UIProcess/Plugins/PluginInfoStore.cpp:
230         (WebKit::PluginInfoStore::getPluginPaths):
231         * UIProcess/Plugins/PluginInfoStore.h:
232         Populate the paths argument with the paths of all plug-ins.
233         
234         * UIProcess/Plugins/WebPluginSiteDataManager.cpp: Added.
235         (WebKit::WebPluginSiteDataManager::invalidate):
236         Invalidate the callbacks map.
237
238         (WebKit::WebPluginSiteDataManager::getSitesWithData):
239         Ask the plug-in info store for all plug-in paths and send a
240         GetSitesWithPluginData message to the web process.
241
242         (WebKit::WebPluginSiteDataManager::didGetSitesWithPluginData):
243         Call the callback.
244
245         * UIProcess/Plugins/WebPluginSiteDataManager.h: Added.
246         (WebKit::WebPluginSiteDataManager::clearContext):
247         Clear the context.
248
249         * UIProcess/WebContext.cpp:
250         (WebKit::WebContext::WebContext):
251         Initialize m_pluginSiteDataManager.
252
253         (WebKit::WebContext::~WebContext):
254         Invalidate the plug-in site data manager and clear its context.
255
256         (WebKit::WebContext::processDidClose):
257         Invalidate the plug-in site data manager.
258         
259         (WebKit::WebContext::didGetSitesWithPluginData):
260         Call through to the plug-in site data manager.
261
262         * UIProcess/WebContext.h:
263         * UIProcess/WebContext.messages.in:
264         Add GetSitesWithPluginData message.
265
266         * WebKit2.pro:
267         * WebKit2.xcodeproj/project.pbxproj:
268         * win/WebKit2.vcproj:
269         Add new files.
270
271         * WebProcess/WebProcess.cpp:
272         (WebKit::WebProcess::getSitesWithPluginData):
273         Iterate over all plug-in paths and get the sites from all plug-ins.
274
275         * WebProcess/WebProcess.h:
276         * WebProcess/WebProcess.messages.in:
277         Add DidGetSitesWithPluginData.
278
279 2011-02-15  Anders Carlsson  <andersca@apple.com>
280
281         Fix Qt build.
282
283         * WebKit2.pro:
284
285 2011-02-15  Anders Carlsson  <andersca@apple.com>
286
287         Fix Windows build.
288
289         * win/WebKit2.vcproj:
290
291 2011-02-14  Oliver Hunt  <oliver@apple.com>
292
293         Reviewed by Gavin Barraclough and Geoff Garen.
294
295         Refactor handles and weak pointers to become nicer and more automatic
296         https://bugs.webkit.org/show_bug.cgi?id=54415
297
298         Update code to new Global<> API, and refactor to get global data to
299         necessary points.
300
301         * WebProcess/Plugins/Netscape/NPJSObject.cpp:
302         (WebKit::NPJSObject::create):
303         (WebKit::NPJSObject::NPJSObject):
304         (WebKit::NPJSObject::initialize):
305         (WebKit::NPJSObject::invokeDefault):
306         (WebKit::NPJSObject::construct):
307         (WebKit::NPJSObject::invoke):
308         * WebProcess/Plugins/Netscape/NPJSObject.h:
309         * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp:
310         (WebKit::NPRuntimeObjectMap::getOrCreateNPObject):
311         (WebKit::NPRuntimeObjectMap::convertJSValueToNPVariant):
312         (WebKit::NPRuntimeObjectMap::evaluate):
313         * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.h:
314         * WebProcess/Plugins/PluginView.cpp:
315         (WebKit::PluginView::windowScriptNPObject):
316         (WebKit::PluginView::pluginElementNPObject):
317
318 2011-02-15  Anders Carlsson  <andersca@apple.com>
319
320         Reviewed by Jon Honeycutt.
321
322         Add stubbed out WKPluginSiteDataManagerRef API
323         https://bugs.webkit.org/show_bug.cgi?id=54504
324
325         * Shared/API/c/WKBase.h:
326         * Shared/APIObject.h:
327         * UIProcess/API/C/WKAPICast.h:
328         * UIProcess/API/C/WKContext.cpp:
329         (WKContextGetPluginSiteDataManager):
330         * UIProcess/API/C/WKContext.h:
331         * UIProcess/API/C/WKPluginSiteDataManager.cpp: Added.
332         (WKPluginSiteDataManagerGetTypeID):
333         (WKPluginSiteDataManagerGetSitesWithData):
334         (WKPluginSiteDataManagerClearSiteData):
335         (WKPluginSiteDataManagerClearAllSiteData):
336         * UIProcess/API/C/WKPluginSiteDataManager.h: Added.
337         * WebKit2.pro:
338         * WebKit2.xcodeproj/project.pbxproj:
339         * win/WebKit2.vcproj:
340
341 2011-02-15  Jia Pu  <jpu@apple.com>
342
343         Reviewed by Darin Adler.
344
345         Autocorrection should respect undo.
346         https://bugs.webkit.org/show_bug.cgi?id=52221
347         <rdar://problem/8663399>
348
349         Please see WebCore/ChangeLog for detailed description.
350
351         * WebProcess/WebCoreSupport/WebEditorClient.h: Updated for the new function declared in EditorClient.
352
353         * WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
354         (WebKit::WebEditorClient::recordAutocorrectionResponse): Ditto.
355
356         * WebProcess/WebPage/WebPage.cpp:
357         (WebKit::WebPage::replaceSelectionWithText): Adopted new signature of ReplaceSelectionCommand::create().
358
359 2011-02-15  Jessie Berlin  <jberlin@apple.com>
360
361         Reviewed by Darin Adler.
362
363         WebKit2: Use the Database directory location specified in NSUserDefaults.
364         https://bugs.webkit.org/show_bug.cgi?id=54496
365
366         * UIProcess/mac/WebContextMac.mm:
367         (WebKit::WebContext::platformDefaultDatabaseDirectory):
368         Use the same logic as WebKit1's WebDatabaseManager::databasesDirectoryPath.
369
370 2011-02-15  Simon Fraser  <simon.fraser@apple.com>
371
372         Reviewed by Anders Carlsson, Darin Adler.
373
374         Layers stick around in DrawingAreaImpl until we switch out of compositing
375         https://bugs.webkit.org/show_bug.cgi?id=54498
376         
377         When leaving compositing mode soon, remove all the child layers
378         of the nonCompositedContent layer right away, so they don't stick
379         around.
380
381         * WebProcess/WebPage/DrawingAreaImpl.cpp:
382         (WebKit::DrawingAreaImpl::setRootCompositingLayer):
383         * WebProcess/WebPage/mac/LayerTreeHostMac.mm:
384         (WebKit::LayerTreeHostMac::setRootCompositingLayer):
385
386 2011-02-15  Kenneth Russell  <kbr@google.com>
387
388         Reviewed by Darin Fisher.
389
390         Allow controlling minimum DOMTimer interval on a per-page basis
391         https://bugs.webkit.org/show_bug.cgi?id=54312
392
393         * WebProcess/WebPage/WebPage.cpp:
394         (WebKit::WebPage::WebPage):
395
396 2011-02-15  Anders Carlsson  <andersca@apple.com>
397
398         Reviewed by Sam Weinig.
399
400         Add sitesWithData and clearSiteData to NetscapePluginModule
401         https://bugs.webkit.org/show_bug.cgi?id=54492
402
403         * Shared/Plugins/Netscape/NetscapePluginModule.cpp:
404         (WebKit::NetscapePluginModule::NetscapePluginModule):
405         (WebKit::NetscapePluginModule::pluginCreated):
406         (WebKit::NetscapePluginModule::pluginDestroyed):
407         (WebKit::NetscapePluginModule::sitesWithData):
408         (WebKit::NetscapePluginModule::clearSiteData):
409         (WebKit::NetscapePluginModule::tryGetSitesWithData):
410         (WebKit::NetscapePluginModule::tryClearSiteData):
411         (WebKit::NetscapePluginModule::incrementLoadCount):
412         (WebKit::NetscapePluginModule::decrementLoadCount):
413         * Shared/Plugins/Netscape/NetscapePluginModule.h:
414
415 2011-02-15  Sam Weinig  <sam@webkit.org>
416
417         Fix windows build.
418
419         * Shared/win/WebCoreArgumentCodersWin.cpp:
420         (CoreIPC::encodeResourceRequest):
421
422 2011-02-15  Alexey Proskuryakov  <ap@apple.com>
423
424         Reviewed by Darin Adler.
425
426         https://bugs.webkit.org/show_bug.cgi?id=54480
427         <rdar://problem/8975229> REGRESSION (WebKit2): A web page remains unresponsive for a long
428         time after printing
429
430         Nothing was painted until moving the mouse over browser chrome, deactivating the window,
431         or taking some other drastic measure like that.
432
433         * UIProcess/API/mac/PageClientImpl.mm: (WebKit::PageClientImpl::setAutodisplay):
434         Call -[NSView displayIfNeeded] after enabling autodisplay. For some reason, this makes
435         WebCore push updates again.
436
437 2011-02-15  Sam Weinig  <sam@webkit.org>
438
439         Reviewed by Darin Adler.
440
441         Crash loading fast/loader/empty-embed-src-attribute.html
442         <rdar://problem/9005541>
443         https://bugs.webkit.org/show_bug.cgi?id=54483
444
445         Add the ability to encode/decode and empty ResourceRequest.
446
447         * Shared/mac/WebCoreArgumentCodersMac.mm:
448         (CoreIPC::encodeResourceRequest):
449         (CoreIPC::decodeResourceRequest):
450         (CoreIPC::decodeResourceResponse): Add missing false check for the
451         decode step.
452         * Shared/win/WebCoreArgumentCodersWin.cpp:
453         (CoreIPC::encodeResourceRequest):
454         (CoreIPC::decodeResourceRequest):
455         (CoreIPC::decodeResourceResponse): Add missing false check for the
456         decode step.
457
458 2011-02-15  Andreas Kling  <kling@webkit.org>
459
460         Unreviewed Qt build fix after r78588.
461
462         * UIProcess/API/qt/qwkpage.cpp:
463         (QWKPage::QWKPage): Add WKPageLoaderClient::shouldGoToHistoryItem.
464
465 2011-02-15  Enrica Casucci  <enrica@apple.com>
466
467         Reviewed by Darin Adler.
468
469         Stop using deprecated API to flip the dragImage.
470         <rdar://problem/8930897>
471         https://bugs.webkit.org/show_bug.cgi?id=54477
472         
473         NSImage setFlipped is a deprecated API. We replace it with
474         drawInRect:fromRect:operation:fraction:respectFlipped:hints.
475         
476         * UIProcess/API/mac/PageClientImpl.mm:
477         (WebKit::PageClientImpl::setDragImage): Removed call to setFlipped.
478         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
479         (WebKit::WebDragClient::startDrag): The image is now drawn with
480         drawInRect:fromRect:operation:fraction:respectFlipped:hints.
481
482 2011-02-15  Brady Eidson  <beidson@apple.com>
483
484         Reviewed by Darin Adler.
485
486         <rdar://problem/9002047> and https://bugs.webkit.org/show_bug.cgi?id=54426
487         WebFrameLoaderClient::shouldGoToHistoryItem needs implementation
488
489         Expose HistoryItem -> ItemID mapping for the message:
490         * WebProcess/WebPage/WebBackForwardListProxy.cpp:
491         (WebKit::WebBackForwardListProxy::idForItem):
492         * WebProcess/WebPage/WebBackForwardListProxy.h:
493
494         Sync message to the UIProcess for the answer:
495         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
496         (WebKit::WebFrameLoaderClient::shouldGoToHistoryItem):
497
498         Call out to the WebLoaderClient for the answer:
499         * UIProcess/WebPageProxy.cpp:
500         (WebKit::WebPageProxy::shouldGoToBackForwardListItem):
501         * UIProcess/WebPageProxy.h:
502         * UIProcess/WebPageProxy.messages.in:
503
504         Call out to the client application for the answer:
505         * UIProcess/WebLoaderClient.cpp:
506         (WebKit::WebLoaderClient::shouldGoToBackForwardListItem):
507         * UIProcess/WebLoaderClient.h:
508
509         Add API for the client application to listen for this:
510         * UIProcess/API/C/WKPage.h:
511
512 2011-02-15  Sam Weinig  <sam@webkit.org>
513
514         Reviewed by Anders Carlsson.
515
516         Fix Anders typo. false -> 0.
517
518         * Platform/mac/SharedMemoryMac.cpp:
519         (WebKit::SharedMemory::create):
520
521 2011-02-15  Andras Becsi  <abecsi@webkit.org>
522
523         Reviewed by NOBODY Csaba Osztrogonác.
524
525         [Qt] Redesign the build system
526         https://bugs.webkit.org/show_bug.cgi?id=51339
527
528         Part 1.
529
530         Introduce CodeGenerators.pri and add common includepaths to WebCore.pri,
531         thus unnecessary duplications can be removed from project files.
532
533         * WebKit2.pro: Simplify and deduplicate includepaths.
534
535 2011-01-26  MORITA Hajime  <morrita@google.com>
536
537         Reviewed by Ryosuke Niwa.
538
539         Refactoring: Extract TextCheckerClient from EditorClient
540         https://bugs.webkit.org/show_bug.cgi?id=53213
541
542         * Shared/WebCoreArgumentCoders.h:
543         * UIProcess/TextChecker.h:
544         * WebProcess/WebCoreSupport/WebEditorClient.h:
545         (WebKit::WebEditorClient::textChecker):
546         * Scripts/webkit2/messages.py: Re-arranged the include file
547
548 2011-02-07  Ryosuke Niwa  <rniwa@webkit.org>
549
550         Reviewed by Adam Barth.
551
552         Add EditorClient callbacks to override isDOMPasteAllowed and javaScriptCanAccessClipboard
553         https://bugs.webkit.org/show_bug.cgi?id=52417
554
555         Added two callback functions, canCopyCut and canPaste to EditorClient. They are currently
556         not implemented.
557
558         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
559         (WebKit::WebEditorClient::canCopyCut): Added.
560         (WebKit::WebEditorClient::canPaste): Added.
561         * WebProcess/WebCoreSupport/WebEditorClient.h:
562
563 2011-02-14  Anders Carlsson  <andersca@apple.com>
564
565         Reviewed by Dan Bernstein.
566
567         Add WKPageSetMemoryCacheClientCallsEnabled API
568         https://bugs.webkit.org/show_bug.cgi?id=54422
569
570         * UIProcess/API/C/WKPage.cpp:
571         (WKPageSetMemoryCacheClientCallsEnabled):
572         * UIProcess/API/C/WKPage.h:
573         * UIProcess/WebPageProxy.cpp:
574         (WebKit::WebPageProxy::setMemoryCacheClientCallsEnabled):
575         * UIProcess/WebPageProxy.h:
576         * WebProcess/WebPage/WebPage.cpp:
577         (WebKit::WebPage::setMemoryCacheMessagesEnabled):
578         * WebProcess/WebPage/WebPage.h:
579         * WebProcess/WebPage/WebPage.messages.in:
580
581 2011-02-14  Sam Weinig  <sam@webkit.org>
582
583         Reviewed by Anders Carlsson.
584
585         WebKit2: View not updated completely when coming back from a cached back/forward navigation
586         <rdar://problem/8787264>
587         https://bugs.webkit.org/show_bug.cgi?id=54419
588
589         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
590         (WebKit::WebFrameLoaderClient::restoreViewState): Invalidate the entire page
591         when completing a restore from the back/forward cache.
592
593 2011-02-14  Anders Carlsson  <andersca@apple.com>
594
595         Reviewed by Dan Bernstein.
596
597         Shared memory should be made shared immediately
598         https://bugs.webkit.org/show_bug.cgi?id=54413
599         <rdar://problem/8972153>
600
601         Under some circumstances, mach_make_memory_entry_64 may only return parts of a
602         memory allocation. Work around this by creating a mach port representing the shared memory
603         right away. Also, hand out this mach port in createHandle when using the default memory protection.
604
605         * Platform/SharedMemory.h:
606         * Platform/mac/SharedMemoryMac.cpp:
607         (WebKit::SharedMemory::create):
608         (WebKit::SharedMemory::~SharedMemory):
609         (WebKit::SharedMemory::createHandle):
610
611 2011-02-14  Adam Roben  <aroben@apple.com>
612
613         React to accelerated compositing changes and allocation failures in DrawingAreaImpl::display
614
615         Fixes <http://webkit.org/b/54398> DrawingAreaImpl::display handles error cases poorly.
616
617         Reviewed by Darin Adler and Anders Carlsson.
618
619         * WebProcess/WebPage/DrawingAreaImpl.cpp:
620         (WebKit::DrawingAreaImpl::display): Bail out if the layout we perform puts us into
621         accelerated compositing mode. Moved the layout earlier in this function so we can bail
622         before doing other work that would be unnecessary in this case. Moved the allocation of the
623         ShareableBitmap earlier so we will leave our state (e.g., dirty region) intact even if the
624         allocation fails.
625
626 2011-02-14  Adam Roben  <aroben@apple.com>
627
628         Add a way to flash backing store and view updates
629
630         The new WKPageSetDebugPaintFlags SPI can be used to control whether backing store and/or
631         view updates are flashed. A blueish color is used for view updates, and a purpleish color is
632         used for backing store updates. The flashing currently only works on Windows.
633
634         Fixes <http://webkit.org/b/54303>.
635
636         Reviewed by Anders Carlsson.
637
638         * UIProcess/API/C/WKPage.cpp:
639         (WKPageSetDebugPaintFlags):
640         (WKPageGetDebugPaintFlags):
641         * UIProcess/API/C/WKPagePrivate.h:
642         Added. These call through to WebPageProxy.
643
644         * UIProcess/API/mac/PageClientImpl.h:
645         * UIProcess/API/mac/PageClientImpl.mm:
646         (WebKit::PageClientImpl::flashBackingStoreUpdates):
647         * UIProcess/API/qt/qwkpage.cpp:
648         (QWKPagePrivate::flashBackingStoreUpdates):
649         * UIProcess/API/qt/qwkpage_p.h:
650         Stubbed out new PageClient functions.
651
652         * UIProcess/DrawingAreaProxyImpl.cpp:
653         (WebKit::DrawingAreaProxyImpl::incorporateUpdate): Tell the WebPageProxy to flash the
654         backing store updates we're performing.
655
656         * UIProcess/PageClient.h: Added flashBackingStoreUpdates.
657
658         * UIProcess/WebPageProxy.cpp:
659         (WebKit::WebPageProxy::flashBackingStoreUpdates): Call through to the PageClient.
660         (WebKit::WebPageProxy::viewUpdatesFlashColor): Return the blueish color used for view
661         updates.
662         (WebKit::WebPageProxy::backingStoreUpdatesFlashColor): Return the purpleish color used for
663         backing store updates.
664
665         * UIProcess/WebPageProxy.h:
666         (WebKit::WebPageProxy::setDebugPaintFlags):
667         (WebKit::WebPageProxy::debugPaintFlags):
668         Added these simple accessors.
669
670         * UIProcess/win/WebView.cpp:
671         (WebKit::flashRects):
672         (WebKit::createBrush):
673         New helper functions.
674
675         (WebKit::WebView::onPaintEvent): Flash the dirty region if requested.
676         (WebKit::WebView::flashBackingStoreUpdates): Added. Calls through to flashRects.
677
678         * UIProcess/win/WebView.h: Added flashBackingStoreUpdates.
679
680         * win/WebKit2Generated.make: Export WKPagePrivate.h so clients can use it.
681
682 2011-02-14  Adam Roben  <aroben@apple.com>
683
684         Add some .messages.in and script files to WebKit2 projects
685
686         This is just for convenience. It doesn't affect the build.
687
688         * win/WebKit2.vcproj: Also let VS resort some files.
689         * win/WebKit2Generated.vcproj:
690
691 2011-02-14  Balazs Kelemen  <kbalazs@webkit.org>
692
693         Reviewed by Csaba Osztrogonác.
694
695         [Qt] Need implementation of ResourceRequest and ResourceResponse serialization
696         https://bugs.webkit.org/show_bug.cgi?id=54339
697
698         Add dummy implementation with FIXME and let the core go with it for now.
699         * Shared/qt/WebCoreArgumentCodersQt.cpp:
700         (CoreIPC::decodeResourceRequest):
701         (CoreIPC::decodeResourceResponse):
702
703 2011-02-13  Anders Carlsson  <andersca@apple.com>
704
705         Reviewed by Maciej Stachowiak.
706
707         Speculative fix for
708
709         <rdar://problem/8995361>
710         CrashTracer: [USER] 47 crashes in WebProcess at com.apple.WebKit2: WebKit::WebPage::layoutIfNeeded + 4
711
712         * WebProcess/WebPage/DrawingAreaImpl.cpp:
713         (WebKit::DrawingAreaImpl::~DrawingAreaImpl):
714         Invalidate the layer tree host.
715
716 2011-02-13  Anders Carlsson  <andersca@apple.com>
717
718         Reviewed by Dan Bernstein.
719
720         The plug-in process heap should be executable by default
721         https://bugs.webkit.org/show_bug.cgi?id=54364
722         <rdar://problem/8990563>
723
724         * UIProcess/Launcher/ProcessLauncher.h:
725         Add executableHeap flag.
726         
727         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
728         (WebKit::ProcessLauncher::launchProcess):
729         Set the right posix_spawn flag if executableHeap is true.
730
731         * UIProcess/Plugins/PluginProcessProxy.cpp:
732         (WebKit::PluginProcessProxy::PluginProcessProxy):
733         Initialize executableHeap to true.
734
735         * UIProcess/WebProcessProxy.cpp:
736         (WebKit::WebProcessProxy::connect):
737         Initialize executableHeap to false.
738
739 2011-02-13  Anders Carlsson  <andersca@apple.com>
740
741         Reviewed by Sam Weinig.
742
743         Messages waited on are never dispatched
744         https://bugs.webkit.org/show_bug.cgi?id=54362
745         <rdar://problem/8995051>
746
747         * Platform/CoreIPC/Connection.cpp:
748         (CoreIPC::Connection::processIncomingMessage):
749         Get the argument encoder from the incoming message.
750
751 2011-02-13  Jeremy Moskovich  <jeremy@chromium.org>
752
753         Reviewed by Adam Barth.
754
755         Add a compile-time option to completely disable WebArchive support.
756         https://bugs.webkit.org/show_bug.cgi?id=52712
757
758         Add an ENABLE(WEB_ARCHIVE) compile-time setting and use it for all WebArchive code.
759
760         * WebProcess/WebPage/WebPage.cpp:
761         (WebKit::WebPage::updatePreferences):
762
763 2011-02-13  Alexey Proskuryakov  <ap@apple.com>
764
765         Reviewed by Dan Bernstein.
766
767         https://bugs.webkit.org/show_bug.cgi?id=54348
768         Crash when printing a document with no pages
769
770         * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::drawPagesToPDF): Don't fail on a fake
771         page that computePagesForPrinting() added to a pageless document.
772
773 2011-02-13  Chris Fleizach  <cfleizach@apple.com>
774
775         Reviewed and landed by Sam Weinig.
776
777         AX: Update WK2 usage of remote accessibility api
778         https://bugs.webkit.org/show_bug.cgi?id=54220
779
780         Rename some of the remote accessibility methods to be more accurate.
781         Make sure to unregister the AccessibilityWebPageObject on dealloc.
782         Send the window remote token along with the WKView remote token.
783
784         * UIProcess/API/mac/PageClientImpl.h:
785         * UIProcess/API/mac/PageClientImpl.mm:
786         (WebKit::PageClientImpl::accessibilityWebProcessTokenReceived):
787         * UIProcess/API/mac/WKView.mm:
788         (-[WKView _updateRemoteAccessibilityRegistration:]):
789         (-[WKView initWithFrame:contextRef:pageGroupRef:]):
790         (-[WKView viewDidMoveToWindow]):
791         (-[WKView _processDidCrash]):
792         (-[WKView _pageClosed]):
793         (-[WKView _setAccessibilityWebProcessToken:]):
794         * UIProcess/API/mac/WKViewInternal.h:
795         * UIProcess/PageClient.h:
796         * UIProcess/WebPageProxy.cpp:
797         (WebKit::WebPageProxy::registerWebProcessAccessibilityToken):
798         (WebKit::WebPageProxy::registerUIProcessAccessibilityTokens):
799         * UIProcess/WebPageProxy.h:
800         * UIProcess/WebPageProxy.messages.in:
801         * WebProcess/WebPage/WebPage.h:
802         * WebProcess/WebPage/WebPage.messages.in:
803         * WebProcess/WebPage/mac/AccessibilityWebPageObject.mm:
804         (-[AccessibilityWebPageObject dealloc]):
805         * WebProcess/WebPage/mac/WebPageMac.mm:
806         (WebKit::WebPage::platformInitialize):
807         (WebKit::WebPage::registerUIProcessAccessibilityTokens):
808
809 2011-02-11  Alexey Proskuryakov  <ap@apple.com>
810
811         Reviewed by Anders Carlsson.
812
813         https://bugs.webkit.org/show_bug.cgi?id=54335
814         <rdar://problem/8895141> Make window.print() work with WebKit2
815
816         * Platform/CoreIPC/Connection.h: Corrected a typo in FIXME comment.
817
818         * UIProcess/ChunkedUpdateDrawingAreaProxy.cpp:
819         (WebKit::ChunkedUpdateDrawingAreaProxy::setPageIsVisible):
820         (WebKit::ChunkedUpdateDrawingAreaProxy::update):
821         (WebKit::ChunkedUpdateDrawingAreaProxy::sendSetSize):
822         * UIProcess/TiledDrawingAreaProxy.cpp:
823         (WebKit::TiledDrawingAreaProxy::sizeDidChange):
824         (WebKit::TiledDrawingAreaProxy::setPageIsVisible):
825         (WebKit::TiledDrawingAreaProxy::takeSnapshot):
826         (WebKit::TiledDrawingAreaProxy::removeTile):
827         * UIProcess/LayerBackedDrawingAreaProxy.cpp:
828         (WebKit::LayerBackedDrawingAreaProxy::sizeDidChange):
829         (WebKit::LayerBackedDrawingAreaProxy::setPageIsVisible):
830         (WebKit::LayerBackedDrawingAreaProxy::update):
831         * UIProcess/WebContext.cpp:
832         (WebKit::WebContext::ensureWebProcess):
833         (WebKit::WebContext::postMessageToInjectedBundle):
834         Updated for send() -> deprecatedSend() rename.
835
836         * UIProcess/WebPageProxy.h:
837         * UIProcess/WebPageProxy.cpp:
838         (WebKit::WebPageProxy::WebPageProxy): Added a flag that's true while serving window.print().
839         (WebKit::WebPageProxy::printFrame): Set and unset m_isPerformingDOMPrintOperation.
840         (WebKit::WebPageProxy::beginPrinting): Force message processing in web process when serving
841         window.print().
842         (WebKit::WebPageProxy::endPrinting): Ditto.
843         (WebKit::WebPageProxy::computePagesForPrinting): Ditto.
844         (WebKit::WebPageProxy::drawRectToPDF): Ditto.
845         (WebKit::WebPageProxy::drawPagesToPDF): Ditto.
846
847         * UIProcess/WebProcessProxy.cpp:
848         (WebKit::WebProcessProxy::~WebProcessProxy):
849         (WebKit::WebProcessProxy::sendMessage):
850         (WebKit::WebProcessProxy::didFinishLaunching):
851         When waiting for a web process to launch, store message flags, too. This is not practically
852         important for DispatchMessageEvenWhenWaitingForSyncReply, but it's easier to store flags
853         than to remember about this pitfall.
854
855         * UIProcess/WebProcessProxy.h:
856         (WebKit::WebProcessProxy::send): Added a flags argument, matching Connection::send().
857         (WebKit::WebProcessProxy::deprecatedSend): Renamed one of send() overloads, because it was
858         conflicting with the other one after adding a flags argument. This matches a change previously
859         made to CoreIPC::Connection.
860
861 2011-02-12  Chris Marrin  <cmarrin@apple.com>
862
863         Reviewed by Dan Bernstein.
864
865         Crash in RenderLayerCompositor::updateCompositingLayers when loading some sites
866         https://bugs.webkit.org/show_bug.cgi?id=54345
867
868         Some sites flip between composited and non-comosited state while loading. When the timing is
869         right, when we flip out of compositing we will need to do a display while tossing all the
870         compositing layers. This causes us to reenter RenderLayerCompositor::computeCompositingRequirements()
871         while we are in the middle of tossing layers, which leads to a crash.
872
873         The solution is to defer the logic of exiting compositing mode until the DrawingArea is finished
874         doing its display, using a timer.
875
876         * WebProcess/WebPage/DrawingAreaImpl.cpp:
877         (WebKit::DrawingAreaImpl::DrawingAreaImpl):
878         (WebKit::DrawingAreaImpl::setRootCompositingLayer):
879         (WebKit::DrawingAreaImpl::enterAcceleratedCompositingMode):
880         (WebKit::DrawingAreaImpl::exitAcceleratedCompositingMode):
881         (WebKit::DrawingAreaImpl::exitAcceleratedCompositingModeSoon):
882         * WebProcess/WebPage/DrawingAreaImpl.h:
883
884 2011-02-12  Kevin Decker  <kdecker@apple.com>
885
886         Reviewed by Dan Bernstein.
887
888         Follow up fix to:
889         https://bugs.webkit.org/show_bug.cgi?id=54341 - optionally scale snapshots in document view coordinates
890
891         * WebProcess/WebPage/WebPage.cpp:
892         (WebKit::WebPage::scaledSnapshotInDocumentCoordinates): Fixed the order of the scale and translate.
893
894 2011-02-12  Kevin Decker  <kdecker@apple.com>
895
896         Reviewed by Dan Bernstein.
897
898         https://bugs.webkit.org/show_bug.cgi?id=54341 - optionally scale snapshots in document view coordinates
899         <rdar://problem/8990069>
900         
901         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
902         (WKBundlePageCreateScaledSnapshotInDocumentCoordinates): Added.
903         * WebProcess/InjectedBundle/API/c/WKBundlePage.h: Added above new function.
904         * WebProcess/WebPage/WebPage.cpp:
905         (WebKit::WebPage::scaledSnapshotInDocumentCoordinates): Added.
906         (WebKit::WebPage::snapshotInDocumentCoordinates): Call scaledSnapshotInDocumentCoordinates with a scale of 1.
907         * WebProcess/WebPage/WebPage.h: Added scaledSnapshotInDocumentCoordinates().
908
909 2011-02-11  Anders Carlsson  <andersca@apple.com>
910
911         Reviewed by Maciej Stachowiak.
912
913         Can’t open local files on reload or navigation from the back/forward cache
914         https://bugs.webkit.org/show_bug.cgi?id=54332
915         <rdar://problem/8903076>
916
917         * UIProcess/WebInspectorProxy.cpp:
918         (WebKit::WebInspectorProxy::isInspectorPage):
919         * UIProcess/WebInspectorProxy.h:
920         Check whether the given page is a web inspector page.
921
922         * UIProcess/WebPageProxy.cpp:
923         (WebKit::WebPageProxy::initializeSandboxExtensionHandle):
924         If this is a web inspector page, we don't want to make a sandbox extension.
925
926         (WebKit::WebPageProxy::reattachToWebProcessWithItem):
927         (WebKit::WebPageProxy::goForward):
928         (WebKit::WebPageProxy::goBack):
929         (WebKit::WebPageProxy::goToBackForwardItem):
930         Pass a sandbox extension along when sending the message.
931
932         * UIProcess/WebPageProxy.h:
933         Make initializeSandboxExtensionHandle a member function.
934
935         * UIProcess/cf/WebPageProxyCF.cpp:
936         (WebKit::WebPageProxy::restoreFromSessionStateData):
937         Pass a sandbox extension along.
938
939         * WebProcess/WebPage/WebPage.cpp:
940         (WebKit::WebPage::goForward):
941         (WebKit::WebPage::goBack):
942         (WebKit::WebPage::goToBackForwardItem):
943         Hand the sandbox extension to the sandbox extension tracker.
944
945         (WebKit::WebPage::restoreSessionAndNavigateToCurrentItem):
946         Pass the sandbox extension to goToBackForwardItem.
947
948         (WebKit::shouldReuseCommittedSandboxExtension):
949         New function that checks whether a committed sandbox extension should be re-used. We
950         do this for page reloads, as well as regular page navigations when both the committed
951         and provisional documents have file URLs.
952
953         (WebKit::WebPage::SandboxExtensionTracker::didStartProvisionalLoad):
954         Reuse the committed sandbox extension if necessary.
955
956         * WebProcess/WebPage/WebPage.h:
957         * WebProcess/WebPage/WebPage.messages.in:
958
959 2011-02-11  Anders Carlsson  <andersca@apple.com>
960
961         Fix Snow Leopard build.
962
963         * PluginProcess/PluginProcess.cpp:
964         (WebKit::PluginProcess::didFailToSendSyncMessage):
965         * WebProcess/WebProcess.cpp:
966         (WebKit::WebProcess::didFailToSendSyncMessage):
967
968 2011-02-11  Yael Aharon  <yael.aharon@nokia.com>
969
970         Unreviewed Qt webkit2 build fix after r78392.
971
972         * WebProcess/WebProcess.h:
973
974 2011-02-11  Anders Carlsson  <andersca@apple.com>
975
976         Reviewed by Sam Weinig.
977
978         WebProcess hung communicating with the plug-in process
979         https://bugs.webkit.org/show_bug.cgi?id=54328
980         <rdar://problem/8854075>
981
982         * UIProcess/Plugins/PluginProcessProxy.cpp:
983         (WebKit::PluginProcessProxy::createWebProcessConnection):
984         Add the DispatchMessageEvenWhenWaitingForSyncReply message send flag when sending the
985         PluginProcess::CreateWebProcessConnection message, since the plug-in process can be busy waiting
986         for a sync reply from the web process.
987
988 2011-02-11  Anders Carlsson  <andersca@apple.com>
989
990         Reviewed by Sam Weinig.
991
992         Incoming synchronous messages should always be processed regardless of connection waiting for a reply
993         https://bugs.webkit.org/show_bug.cgi?id=54326
994
995         * Platform/CoreIPC/Connection.cpp:
996         (CoreIPC::Connection::SyncMessageState::getOrCreate):
997         Assert that the map has a non-null SyncMessageState object.
998
999         (CoreIPC::Connection::SyncMessageState::SyncMessageState):
1000         Initialize m_waitForSyncReplyCount.
1001
1002         (CoreIPC::Connection::SyncMessageState::beginWaitForSyncReply):
1003         Increment m_waitForSyncReplyCount.
1004
1005         (CoreIPC::Connection::SyncMessageState::endWaitForSyncReply):
1006         Decrement m_waitForSyncReplyCount. If it's 0, enqueue any incoming sync messages.
1007
1008         (CoreIPC::Connection::SyncMessageState::processIncomingMessage):
1009         If this is a message that needs to be dispatched, add it to the queue and wake up the client run loop.
1010
1011         (CoreIPC::Connection::SyncMessageState::dispatchMessages):
1012         Go through the queue of incoming messages and dispatch them.
1013
1014         (CoreIPC::Connection::sendSyncMessage):
1015         call beginWaitForSyncReply/endWaitForSyncReply.
1016
1017         (CoreIPC::Connection::waitForSyncReply):
1018         Dispatch messages.
1019
1020         (CoreIPC::Connection::processIncomingMessage):
1021         Call SyncMessageState::processIncomingMessage.
1022
1023         (CoreIPC::Connection::enqueueIncomingMessage):
1024         Add helper function for enqueuing an incoming message.
1025
1026         * Platform/CoreIPC/Connection.h:
1027         (CoreIPC::Connection::Message::destinationID):
1028
1029 2011-02-11  Sam Weinig  <sam@webkit.org>
1030
1031         Reviewed by Maciej Stachowiak.
1032
1033         WebKit2: Going to Ars Technica crashes WebProcess in WebCore::ResourceRequestBase::url() const + 9
1034         <rdar://problem/8978832>
1035
1036         Speculative fix for crash accessing a bad ResourceRequest in policy
1037         client code. Remove early returns from dispatchDecidePolicyForMIMEType 
1038         and dispatchDecidePolicyForNavigationAction that are not present in the WebKit1
1039         equivalent code. This should be safe, now that the IPC calls are synchronous.
1040
1041         Also removes some invalid assertions in WebFrameProxy that were getting hit. It is okay
1042         for the url to empty.
1043
1044         * UIProcess/WebFrameProxy.cpp:
1045         (WebKit::WebFrameProxy::didReceiveServerRedirectForProvisionalLoad):
1046         (WebKit::WebFrameProxy::didFailProvisionalLoad):
1047         (WebKit::WebFrameProxy::didFailLoad):
1048         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1049         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForMIMEType):
1050         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
1051
1052 2011-02-11  Alexey Proskuryakov  <ap@apple.com>
1053
1054         Reviewed by Darin Adler and Anders Carlsson.
1055
1056         https://bugs.webkit.org/show_bug.cgi?id=53593
1057         <rdar://problem/8948380> Crash beneath HistoryController::recursiveSetProvisionalItem in web
1058         process (preceded by assertion failure) if UI process exits while 
1059         Messages::WebPage::RestoreSessionAndNavigateToCurrentItem is being handled
1060
1061         Can't test exiting the UI process.
1062
1063         * Platform/CoreIPC/Connection.cpp: (CoreIPC::Connection::sendSyncMessage):
1064         * Platform/CoreIPC/Connection.h: (CoreIPC::Connection::Client::didFailToSendSyncMessage):
1065         Notify connection client when the connection fails to send a sync message.
1066
1067         * WebProcess/WebProcess.cpp: (WebKit::WebProcess::didFailToSendSyncMessage):
1068         * WebProcess/WebProcess.h:
1069         Quit the web process immediately if it tried to send a sync message to a dead UI process.
1070         It never needs to continue and handle an unexpected null "reply".
1071
1072         * PluginProcess/PluginProcess.cpp: (WebKit::PluginProcess::didFailToSendSyncMessage):
1073         * PluginProcess/PluginProcess.h:
1074         Ditto. There is no need for a plug-in to keep running even briefly if it couldn't get a
1075         reply to a sync message.
1076
1077 2011-02-11  Anders Carlsson  <andersca@apple.com>
1078
1079         Reviewed by Sam Weinig.
1080
1081         Add a way to send async messages that can't get out of order with sync ones
1082         https://bugs.webkit.org/show_bug.cgi?id=54319
1083         <rdar://problem/8894844>
1084
1085         * Platform/CoreIPC/Connection.cpp:
1086         (CoreIPC::Connection::sendMessage):
1087         sendMessage now takes a messageSendFlags. Update the messageID if the
1088         messageSendFlags contain DispatchMessageEvenWhenWaitingForSyncReply.
1089
1090         (CoreIPC::Connection::waitForSyncReply):
1091         Process asynchronous messages as well.
1092
1093         (CoreIPC::Connection::processIncomingMessage):
1094         Check if a message should be dispatched even when we're waiting for a
1095         synchronous reply.
1096
1097         * Platform/CoreIPC/Connection.h:
1098         (CoreIPC::Connection::send):
1099         Send now takes a messageSendFlags parameter.
1100
1101         * Platform/CoreIPC/MessageID.h:
1102         (CoreIPC::MessageID::messageIDWithAddedFlags):
1103         Return a new MessageID object with the given flags added.
1104
1105         (CoreIPC::MessageID::shouldDispatchMessageWhenWaitingForSyncReply):
1106         Add getter.
1107
1108 2011-02-11  Sam Weinig  <sam@webkit.org>
1109
1110         Reviewed by Anders Carlsson.
1111
1112         Crash with dynamic popup menu use
1113         <rdar://problem/8716952>
1114
1115         Invalidate popup menus when forcing them closed, since they might still be
1116         in their tracking loop.
1117
1118         * UIProcess/WebPageProxy.cpp:
1119         (WebKit::WebPageProxy::showPopupMenu):
1120         (WebKit::WebPageProxy::hidePopupMenu):
1121         * UIProcess/WebPopupMenuProxy.h:
1122         (WebKit::WebPopupMenuProxy::invalidate):
1123         * UIProcess/mac/WebPopupMenuProxyMac.mm:
1124         (WebKit::WebPopupMenuProxyMac::showPopupMenu):
1125         * UIProcess/win/WebPopupMenuProxyWin.cpp:
1126         (WebKit::WebPopupMenuProxyWin::showPopupMenu):
1127         (WebKit::WebPopupMenuProxyWin::setFocusedIndex):
1128
1129 2011-02-11  Anders Carlsson  <andersca@apple.com>
1130
1131         Reviewed by Adam Roben.
1132
1133         Actually initialize m_syncMessageState.
1134
1135         * Platform/CoreIPC/Connection.cpp:
1136         (CoreIPC::Connection::Connection):
1137
1138 2011-02-11  Anders Carlsson  <andersca@apple.com>
1139
1140         Reviewed by Adam Roben.
1141
1142         Move the binary semaphore into SyncMessageState
1143         https://bugs.webkit.org/show_bug.cgi?id=54311
1144
1145         With this change, all connections that belong to the same run loop will use same binary semaphore.
1146         This is in preparation for making any connection be able to wakeup the client run loop.
1147
1148         * Platform/CoreIPC/Connection.cpp:
1149         (CoreIPC::Connection::SyncMessageState::wakeUpClientRunLoop):
1150         (CoreIPC::Connection::SyncMessageState::wait):
1151         (CoreIPC::Connection::waitForSyncReply):
1152         (CoreIPC::Connection::processIncomingMessage):
1153         (CoreIPC::Connection::connectionDidClose):
1154         * Platform/CoreIPC/Connection.h:
1155
1156 2011-02-11  Anders Carlsson  <andersca@apple.com>
1157
1158         Reviewed by Adam Roben.
1159
1160         Add a SyncMessageState class to CoreIPC::Connection
1161         https://bugs.webkit.org/show_bug.cgi?id=54309
1162
1163         SyncMessageState objects are shared between all connections scheduled on
1164         a given run loop. It will be used to keep track of state when waiting
1165         for replies for a synchronous message.
1166
1167         * Platform/CoreIPC/Connection.cpp:
1168         (CoreIPC::Connection::SyncMessageState::syncMessageStateMap):
1169         (CoreIPC::Connection::SyncMessageState::syncMessageStateMapMutex):
1170         Add a global RunLoop -> SyncMessageState map and a mutex for locking.
1171
1172         (CoreIPC::Connection::SyncMessageState::getOrCreate):
1173         Look in the map for an existing SyncMessageState object and create a new
1174         one if none is found.
1175
1176         (CoreIPC::Connection::SyncMessageState::SyncMessageState):
1177         Initialize m_runLoop.
1178
1179         (CoreIPC::Connection::SyncMessageState::~SyncMessageState):
1180         Remove the object from the map.
1181
1182 2011-02-11  Enrica Casucci  <enrica@apple.com>
1183
1184         Reviewed by Darin Adler.
1185
1186         crashes in WebProcess at WebCore::Range::startPosition const + 16
1187         https://bugs.webkit.org/show_bug.cgi?id=54294
1188         <rdar://problem/8982710>
1189         
1190         I don't have a repro case for this bugs, but the side-by-side
1191         comparison of the IME support implementation in WebKit and WebKi2
1192         shows a missing null check on a Range that could very well explain
1193         this crash.
1194         I tried running platform/mac/editing/input tests with a version of WebKit
1195         without the null check and I can reproduce a crash with the same signature.
1196         These tests are not yet enabled for WebKit2.
1197
1198         * WebProcess/WebPage/mac/WebPageMac.mm:
1199         (WebKit::WebPage::firstRectForCharacterRange):
1200
1201 2011-02-11  Jeff Miller  <jeffm@apple.com>
1202
1203         Reviewed by Steve Falkenburg.
1204
1205         Eliminate /DELAYLOAD:msimg32.dll ignored warning when building WebKit project
1206         https://bugs.webkit.org/show_bug.cgi?id=54296
1207
1208         * win/WebKit2Common.vsprops: Remove msimg32.dll from the list of DelayLoadDLLs.
1209
1210 2011-02-11  Chandra Vallala  <chandra.vallala@motorola.com> and Alejandro G. Castro  <alex@igalia.com>
1211
1212         Reviewed by Martin Robinson.
1213
1214         [GTK] Implement UpdateChunk, ChunkedUpdateDrawingArea/Proxy
1215         classes for WebKit2
1216         https://bugs.webkit.org/show_bug.cgi?id=54080
1217
1218         * GNUmakefile.am:
1219         * Shared/gtk/UpdateChunk.cpp: Added.
1220         (WebKit::UpdateChunk::UpdateChunk):
1221         (WebKit::UpdateChunk::~UpdateChunk):
1222         (WebKit::UpdateChunk::encode):
1223         (WebKit::UpdateChunk::decode):
1224         (WebKit::UpdateChunk::createImage):
1225         * Shared/gtk/UpdateChunk.h: Added.
1226         (WebKit::UpdateChunk::rect):
1227         (WebKit::UpdateChunk::isEmpty):
1228         (WebKit::UpdateChunk::size):
1229         * UIProcess/ChunkedUpdateDrawingAreaProxy.cpp:
1230         (WebKit::ChunkedUpdateDrawingAreaProxy::ChunkedUpdateDrawingAreaProxy):
1231         Initialize the surface.
1232         * UIProcess/ChunkedUpdateDrawingAreaProxy.h:
1233         * UIProcess/DrawingAreaProxy.h: Added cairo variables.
1234         * UIProcess/gtk/ChunkedUpdateDrawingAreaProxyGtk.cpp: Added.
1235         (WebKit::ChunkedUpdateDrawingAreaProxy::page):
1236         (WebKit::ChunkedUpdateDrawingAreaProxy::ensureBackingStore):
1237         (WebKit::ChunkedUpdateDrawingAreaProxy::invalidateBackingStore):
1238         (WebKit::ChunkedUpdateDrawingAreaProxy::platformPaint):
1239         (WebKit::ChunkedUpdateDrawingAreaProxy::drawUpdateChunkIntoBackingStore):
1240         * WebProcess/WebPage/gtk/ChunkedUpdateDrawingAreaGtk.cpp: Added.
1241         (WebKit::ChunkedUpdateDrawingArea::paintIntoUpdateChunk):
1242
1243 2011-02-10  Anders Carlsson  <andersca@apple.com>
1244
1245         Reviewed by Dan Bernstein.
1246
1247         Repro crash with Sony Google TV ad at Gizmodo
1248         https://bugs.webkit.org/show_bug.cgi?id=54150
1249         <rdar://problem/8782346>
1250
1251         Re-landing this fix, bug without the test case, since it causes hangs on the bots.
1252         https://bugs.webkit.org/show_bug.cgi?id=54171 tracks adding back the test.
1253
1254         Since PluginView::evaluate can cause the plug-in element to go away, we need to protect it.
1255
1256         * WebProcess/Plugins/PluginView.cpp:
1257         (WebKit::PluginView::~PluginView):
1258         Null out m_pluginElement here so we'll catch crashes earlier.
1259
1260         (WebKit::PluginView::evaluate):
1261         Add a plug-in protector.
1262
1263 2011-02-10  Alice Liu  <alice.liu@apple.com>
1264
1265         Reviewed by Enrica Casucci and Adele Peterson.
1266
1267         WebKit2 pages gobble up cmd-I as an editing command in some cases where it shouldn't
1268         https://bugs.webkit.org/show_bug.cgi?id=54254
1269
1270         * UIProcess/API/mac/WKView.mm:
1271         (-[WKView _handleStyleKeyEquivalent:]):
1272         Return early if we're not in an editable region.
1273
1274 2011-02-10  Andreas Kling  <kling@webkit.org>
1275
1276         Unreviewed Qt build fix.
1277
1278         waitFor() -> deprecatedWaitFor()
1279
1280         * UIProcess/TiledDrawingAreaProxy.cpp:
1281         (WebKit::TiledDrawingAreaProxy::waitUntilUpdatesComplete):
1282
1283 2011-02-10  Anders Carlsson  <andersca@apple.com>
1284
1285         Reviewed by Adam Roben.
1286
1287         Move code to dispatch an incoming message out into a new function
1288         https://bugs.webkit.org/show_bug.cgi?id=54239
1289
1290         This also fixes a leak where we wouldn't free ArgumentDecoder objects
1291         after a connection has been invalidated.
1292         
1293         * Platform/CoreIPC/Connection.cpp:
1294         (CoreIPC::Connection::dispatchMessage):
1295         (CoreIPC::Connection::dispatchMessages):
1296         * Platform/CoreIPC/Connection.h:
1297
1298 2011-02-10  Anders Carlsson  <andersca@apple.com>
1299
1300         Try again to fix the Qt build.
1301
1302         * UIProcess/TiledDrawingAreaProxy.cpp:
1303         (WebKit::TiledDrawingAreaProxy::sizeDidChange):
1304         (WebKit::TiledDrawingAreaProxy::setPageIsVisible):
1305         (WebKit::TiledDrawingAreaProxy::takeSnapshot):
1306         (WebKit::TiledDrawingAreaProxy::removeTile):
1307
1308 2011-02-10  Anders Carlsson  <andersca@apple.com>
1309
1310         Attempt to fix the Qt build.
1311
1312         * UIProcess/TiledDrawingAreaProxy.cpp:
1313         (WebKit::TiledDrawingAreaProxy::sizeDidChange):
1314         (WebKit::TiledDrawingAreaProxy::setPageIsVisible):
1315         (WebKit::TiledDrawingAreaProxy::requestTileUpdate):
1316         (WebKit::TiledDrawingAreaProxy::takeSnapshot):
1317         (WebKit::TiledDrawingAreaProxy::removeTile):
1318         * WebProcess/WebPage/TiledDrawingArea.cpp:
1319         (WebKit::TiledDrawingArea::display):
1320         (WebKit::TiledDrawingArea::setSize):
1321         (WebKit::TiledDrawingArea::updateTile):
1322         (WebKit::TiledDrawingArea::tileUpdateTimerFired):
1323         (WebKit::TiledDrawingArea::didReceiveMessage):
1324
1325 2011-02-10  Adam Roben  <aroben@apple.com>
1326
1327         Handle a null FindIndicator correctly
1328
1329         We are passed a null FindIndicator when the find indicator becomes hidden.
1330
1331         Fixes <http://webkit.org/b/54213> <rdar://problem/8983261> REGRESSION (r78198): Crash in
1332         FindIndicator::contentImage when scrolling page
1333
1334         Reviewed by Steve Falkenburg.
1335
1336         * Platform/win/SharedMemoryWin.cpp:
1337         (WebKit::SharedMemory::Handle::isNull): Implemented.
1338         (WebKit::SharedMemory::create): Bail out if the handle is null, just like Mac does.
1339         Otherwise assert that ::MapViewOfFile succeeded. This doesn't fix the bug, but should help
1340         catch other errors.
1341
1342         * UIProcess/win/WebView.cpp:
1343         (WebKit::WebView::setFindIndicator): Null-check the FindIndicator before dereferencing it.
1344         Also changed the function to store the FindIndicator in a RefPtr.
1345
1346 2011-02-10  Anders Carlsson  <andersca@apple.com>
1347
1348         Reviewed by Sam Weinig.
1349
1350         Add 'deprecated' to the deprecated CoreIPC functions
1351         https://bugs.webkit.org/show_bug.cgi?id=54223
1352
1353         * Platform/CoreIPC/Connection.cpp:
1354         (CoreIPC::Connection::sendMessage):
1355         * Platform/CoreIPC/Connection.h:
1356         (CoreIPC::Connection::send):
1357         (CoreIPC::Connection::deprecatedSendSync):
1358         (CoreIPC::Connection::deprecatedSend):
1359         (CoreIPC::Connection::deprecatedWaitFor):
1360         * Platform/CoreIPC/mac/ConnectionMac.cpp:
1361         (CoreIPC::Connection::open):
1362         * PluginProcess/PluginProcess.cpp:
1363         * UIProcess/ChunkedUpdateDrawingAreaProxy.cpp:
1364         (WebKit::ChunkedUpdateDrawingAreaProxy::paint):
1365         * UIProcess/Plugins/PluginProcessProxy.cpp:
1366         (WebKit::PluginProcessProxy::createWebProcessConnection):
1367         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1368         (WebKit::InjectedBundle::postMessage):
1369         (WebKit::InjectedBundle::postSynchronousMessage):
1370         * WebProcess/Plugins/PluginProcessConnectionManager.cpp:
1371         (WebKit::PluginProcessConnectionManager::getPluginProcessConnection):
1372         * WebProcess/WebPage/ChunkedUpdateDrawingArea.cpp:
1373         (WebKit::ChunkedUpdateDrawingArea::display):
1374         (WebKit::ChunkedUpdateDrawingArea::setSize):
1375         * WebProcess/WebPage/LayerBackedDrawingArea.cpp:
1376         (WebKit::LayerBackedDrawingArea::setSize):
1377         * WebProcess/WebPage/mac/LayerBackedDrawingAreaMac.mm:
1378         (WebKit::LayerBackedDrawingArea::attachCompositingContext):
1379
1380 2011-02-10  Sam Weinig  <sam@webkit.org>
1381
1382         Reviewed by Anders Carlsson.
1383
1384         Window resizer does not have a border when there are scrollbars in WebKit2 windows
1385         <rdar://problem/8488476>
1386         https://bugs.webkit.org/show_bug.cgi?id=54222
1387
1388         * UIProcess/API/mac/PageClientImpl.h:
1389         * UIProcess/API/mac/PageClientImpl.mm:
1390         (WebKit::PageClientImpl::didChangeScrollbarsForMainFrame):
1391         * UIProcess/API/mac/WKView.mm:
1392         (-[WKView _updateGrowBoxForWindowFrameChange]):
1393         (-[WKView _didChangeScrollbarsForMainFrame]):
1394         * UIProcess/API/mac/WKViewInternal.h:
1395         * UIProcess/API/qt/qwkpage_p.h:
1396         (QWKPagePrivate::didChangeScrollbarsForMainFrame):
1397         * UIProcess/PageClient.h:
1398         * UIProcess/WebPageProxy.cpp:
1399         (WebKit::WebPageProxy::didChangeScrollbarsForMainFrame):
1400         * UIProcess/win/WebView.cpp:
1401         (WebKit::WebView::didChangeScrollbarsForMainFrame):
1402         * UIProcess/win/WebView.h:
1403
1404 2011-02-10  Ivan Krstić  <ike@apple.com>
1405
1406         Reviewed by Adam Roben.
1407
1408         Rename remaining instances of _HOME sandbox parameter.
1409         <rdar://problem/8983428>
1410
1411         * WebProcess/com.apple.WebProcess.sb:
1412
1413 2011-02-10  Chris Fleizach  <cfleizach@apple.com>
1414
1415         Reviewed by Anders Carlsson.
1416
1417         AX: AX needs to stop using WebCoreViewFactory
1418         https://bugs.webkit.org/show_bug.cgi?id=54153
1419
1420         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
1421         (InitWebCoreSystemInterface):
1422
1423 2011-02-10  Sam Weinig  <sam@webkit.org>
1424
1425         Reviewed by Anders Carlsson.
1426
1427         Sandbox violations trying to read crypto preferences.
1428         <rdar://problem/8981151>
1429
1430         * WebProcess/com.apple.WebProcess.sb:
1431
1432 2011-02-10  Peter Varga  <pvarga@webkit.org>
1433
1434         Reviewed by Csaba Osztrogonác.
1435
1436         Remove PCRE source from trunk
1437         https://bugs.webkit.org/show_bug.cgi?id=54188
1438
1439         * WebKit2.pro:
1440
1441 2011-02-09  Adam Roben  <aroben@apple.com>
1442
1443         Turn on the new drawing area on Windows
1444
1445         Fixes <http://webkit.org/b/53805> <rdar://problem/8960666> WebKit2 on Windows should use
1446         DrawingAreaProxyImpl
1447
1448         Reviewed by Darin Adler.
1449
1450         * UIProcess/win/WebView.cpp:
1451         (WebKit::useNewDrawingArea): Return true!
1452
1453 2011-02-09  Adam Roben  <aroben@apple.com>
1454
1455         Hook up WM_PRINT to the new drawing area
1456
1457         Fixes <http://webkit.org/b/54145> <rdar://problem/8979559> WM_PRINT doesn't work with new
1458         drawing area (assertion failure in DrawingAreaProxyImpl in Debug builds)
1459
1460         Reviewed by Darin Adler.
1461
1462         * UIProcess/win/WebView.cpp:
1463         (WebKit::WebView::paint): Added. Code came from onPaintEvent.
1464
1465         (WebKit::WebView::onPaintEvent):
1466         (WebKit::WebView::onPrintClientEvent):
1467         Changed to call paint.
1468
1469         * UIProcess/win/WebView.h: Added paint. Also separated message handler functions into their
1470         own paragraph.
1471
1472 2011-02-09  Adam Roben  <aroben@apple.com>
1473
1474         Notice when the backing store goes away after DidSetSize
1475
1476         Fixes <http://webkit.org/b/54142> <rdar://problem/8979365> Crash in
1477         DrawingAreaProxyImpl::paint when WKView paints after being resized while hidden
1478
1479         Reviewed by Darin Adler.
1480
1481         * UIProcess/DrawingAreaProxyImpl.cpp:
1482         (WebKit::DrawingAreaProxyImpl::paint): Null-check m_backingStore after waiting for
1483         DidSetSize, as m_backingStore can go away when we receive that message. This is the bug fix.
1484         Also moved the accelerated compositing check inside the block where we wait for DidSetSize.
1485         If we didn't wait for DidSetSize, we already know that we're not in accelerated compositing
1486         mode (and asserted so earlier in this function).
1487
1488 2011-02-09  Adam Roben  <aroben@apple.com>
1489
1490         Decode a null SharedMemory::Handle correctly on Windows
1491
1492         Fixes <http://webkit.org/b/54141> <rdar://problem/8979195> WKView draws at wrong size,
1493         performs badly if is resized while hidden (assertion fails in
1494         BackingStore::incorporateUpdate in Debug builds)
1495
1496         Reviewed by Darin Adler.
1497
1498         * Platform/win/SharedMemoryWin.cpp:
1499         (WebKit::getDuplicatedHandle): Added. Code came from decode. The only changes were to
1500         null-check sourceHandle (this is the bug fix) and to assert when ::DuplicateHandle fails
1501         (which would have caught the bug earlier).
1502         (WebKit::SharedMemory::Handle::decode): Changed to use getDuplicatedHandle.
1503
1504 2011-02-09  Adam Roben  <aroben@apple.com>
1505
1506         Don't invalidate outside of the WebPage's bounds
1507
1508         Fixes <http://webkit.org/b/54123> <rdar://problem/8978383> Assertion failure in
1509         BackingStore::BackingStore if a new WebPage becomes active before receiving a size
1510
1511         Reviewed by Darin Adler.
1512
1513         * WebProcess/WebPage/DrawingAreaImpl.cpp:
1514         (WebKit::DrawingAreaImpl::setNeedsDisplay): Intersect the dirty rect with our bounds before
1515         doing anything else.
1516         (WebKit::DrawingAreaImpl::display): Added an assertion to help catch the bad case a little
1517         earlier.
1518
1519 2011-02-10  Eric Seidel  <eric@webkit.org>
1520
1521         Unreviewed, rolling out r78157.
1522         http://trac.webkit.org/changeset/78157
1523         https://bugs.webkit.org/show_bug.cgi?id=54150
1524
1525         Fails on a bunch of bots
1526
1527         * WebProcess/Plugins/PluginView.cpp:
1528         (WebKit::PluginView::~PluginView):
1529         (WebKit::PluginView::evaluate):
1530
1531 2011-02-09  Brian Weinstein  <bweinstein@apple.com>
1532
1533         Rubber-stamped by Sam Weinig.
1534
1535         Fix a typo in WebSecurityOrigin::protocol.
1536
1537         * Shared/WebSecurityOrigin.h:
1538         (WebKit::WebSecurityOrigin::protocol): This should return the protocol, not the domain.
1539
1540 2011-02-09  Sam Weinig  <sam@webkit.org>
1541
1542         Reviewed by Darin Adler.
1543
1544         File uploads do not work within the sandbox
1545         <rdar://problem/8950518>
1546         https://bugs.webkit.org/show_bug.cgi?id=54154
1547
1548         * UIProcess/WebPageProxy.cpp:
1549         (WebKit::WebPageProxy::didChooseFilesForOpenPanel):
1550         * WebProcess/WebPage/WebPage.cpp:
1551         (WebKit::WebPage::extendSandboxForFileFromOpenPanel):
1552         * WebProcess/WebPage/WebPage.h:
1553         * WebProcess/WebPage/WebPage.messages.in:
1554
1555 2011-02-09  Alexey Proskuryakov  <ap@apple.com>
1556
1557         Reviewed by Darin Adler.
1558
1559         https://bugs.webkit.org/show_bug.cgi?id=54148
1560         <rdar://problem/8973887> REGRESSION (WebKit2): Opening two print dialogs causes havoc
1561
1562         * UIProcess/API/mac/WKPrintingView.h: Moved _isForcingPreviewUpdate into a static variable,
1563         because dispatching a notification affects all WKPrintingViews at once.
1564         * UIProcess/API/mac/WKPrintingView.mm:
1565         (-[WKPrintingView _updatePreview]): Updated for new variable name.
1566         (-[WKPrintingView knowsPageRange:]): Don't break if the method is called twice in a row
1567         (we already had this logic when printing from separate thread, but not for preview).
1568         (-[WKPrintingView drawRect:]): Changed all LOG messages to have view object address for
1569         easier matching.
1570         (-[WKPrintingView rectForPage:]): Ditto.
1571         (-[WKPrintingView beginDocument]): Ditto.
1572         (-[WKPrintingView endDocument]): Ditto.
1573
1574 2011-02-09  Anders Carlsson  <andersca@apple.com>
1575
1576         Reviewed by Sam Weinig.
1577
1578         Repro crash with Sony Google TV ad at Gizmodo
1579         https://bugs.webkit.org/show_bug.cgi?id=54150
1580
1581         Since PluginView::evaluate can cause the plug-in element to go away, we need to protect it.
1582
1583         * WebProcess/Plugins/PluginView.cpp:
1584         (WebKit::PluginView::~PluginView):
1585         Null out m_pluginElement here so we'll catch crashes earlier.
1586
1587         (WebKit::PluginView::evaluate):
1588         Add a plug-in protector.
1589
1590 2011-02-09  Sam Weinig  <sam@webkit.org>
1591
1592         Reviewed by Maciej Stachowiak.
1593
1594         Google Maps says it has horizontal scrollbars when it doesn't
1595         <rdar://problem/8978005>
1596
1597         We were updating the main frame's scrollbar state for changes to
1598         frames other than the main frame.
1599
1600         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1601         (WebKit::WebChromeClient::contentsSizeChanged):
1602         * WebProcess/WebCoreSupport/WebChromeClient.h:
1603         (WebKit::WebChromeClient::WebChromeClient):
1604         Change to bail out early if we are not looking at the main frame. Also
1605         fix some silly typos and rename the variables to be more specific.
1606
1607 2011-02-09  Ivan Krstić  <ike@apple.com>
1608
1609         Reviewed by Sam Weinig.
1610
1611         Allow read-only access to mouse preferences from sandboxed WebProcess.
1612         <rdar://problem/8975279>
1613
1614         * WebProcess/com.apple.WebProcess.sb:
1615
1616 2011-02-09  Steve Falkenburg  <sfalken@apple.com>
1617
1618         Build fix.
1619
1620         * win/MainWin.cpp:
1621         (wWinMain):
1622
1623 2011-02-09  Amruth Raj  <amruthraj@motorola.com> and Ravi Phaneendra Kasibhatla  <ravi.kasibhatla@motorola.com>
1624
1625         Reviewed by Martin Robinson.
1626
1627         [GTK] Implement Module class for WebKit2
1628         https://bugs.webkit.org/show_bug.cgi?id=48510
1629
1630         * GNUmakefile.am:
1631         * Platform/Module.h: Added GModule handle for GTK port.
1632         * Platform/gtk/ModuleGtk.cpp: Initial code using GModule calls.
1633         (WebKit::Module::load):
1634         (WebKit::Module::unload):
1635         (WebKit::Module::platformFunctionPointer):
1636
1637 2011-02-09  Chandra Vallala  <chandra.vallala@motorola.com> and Alejandro G. Castro  <alex@igalia.com>
1638
1639         Reviewed by Martin Robinson.
1640
1641         [GTK] Implement WKBaseGtk API for Webkit2
1642         https://bugs.webkit.org/show_bug.cgi?id=54081
1643
1644         * GNUmakefile.am: Added new files to compilation.
1645         * Shared/API/c/WKBase.h: Included WKBaseGtk.h in this file.
1646         * Shared/API/c/gtk: Added.
1647         * Shared/API/c/gtk/WKBaseGtk.h: Added. Declaration of WKViewRef
1648         for GTK port.
1649         * UIProcess/API/C/WKAPICast.h: Included WKAPICastGtk.h in this
1650         file.
1651         * UIProcess/API/C/gtk: Added.
1652         * UIProcess/API/C/gtk/WKAPICastGtk.h: Added. Type definition
1653         template for WKViewRef to WebView and vice-versa.
1654         * UIProcess/API/C/gtk/WKView.cpp: Added. Implementation of WKView
1655         API interface.
1656         (WKViewCreate):
1657         (WKViewGetWindow):
1658         (WKViewGetPage):
1659         (WKURLCreateWithURL):
1660         * UIProcess/API/C/gtk/WKView.h: Added. Declaration of WKView API
1661         interface.
1662
1663 2011-02-09  Alejandro G. Castro  <alex@igalia.com>
1664
1665         Reviewed by Martin Robinson.
1666
1667         [GTK] Add WebGraphicsContext stub to the compilation
1668         https://bugs.webkit.org/show_bug.cgi?id=54078
1669
1670         * GNUmakefile.am:
1671         * Shared/API/c/gtk/WKGraphicsContextGtk.cpp: Added stub just for
1672         compilation.
1673         (WKGraphicsContextGetGtkContext):
1674         * Shared/API/c/gtk/WKGraphicsContextGtk.h: Added stub just for
1675         compilation.
1676         * Shared/WebGraphicsContext.cpp:
1677         (WebKit::WebGraphicsContext::WebGraphicsContext):
1678         * Shared/WebGraphicsContext.h:
1679         (WebKit::WebGraphicsContext::platformContext):
1680
1681 2011-02-09  Alejandro G. Castro  <alex@igalia.com>
1682
1683         Reviewed by Martin Robinson.
1684
1685         [GTK] Add geolocation support to the webkit2 compilation
1686         https://bugs.webkit.org/show_bug.cgi?id=54077
1687
1688         Add Geolocation files to the GTK compilation.
1689
1690         * GNUmakefile.am:
1691
1692 2011-02-09  Andras Becsi  <abecsi@webkit.org>
1693
1694         Reviewed by Csaba Osztrogonác.
1695
1696         [Qt][WK2] Don't generate superfluous forwarding header for config.h.
1697
1698         * Scripts/generate-forwarding-headers.pl:
1699
1700 2011-02-09  Adam Roben  <aroben@apple.com>
1701
1702         Hide the ugly details of WebView::m_window initialization from WebPageProxy, and make it
1703         less ugly
1704
1705         WebView::WebView was initially creating a hidden window, then showing it. It would tell
1706         WebPageProxy about the window while it was still hidden, and then have to inform
1707         WebPageProxy that the window had become shown. This resulted in WebPageProxy sending
1708         unnecessary messages to the web process, and confused code that assumed that the window
1709         would be in the same state after WebView's constructor exited as it was when WebPageProxy
1710         first found out about the window.
1711
1712         We now don't hide the window when creating it, which simplifies the code, and only tell
1713         WebPageProxy about the window after we're done modifying it, which fixes the bug.
1714
1715         Fixes <http://webkit.org/b/53878> <rdar://problem/8977306> Assertion failure in
1716         DrawingAreaImpl::resumePainting after window.open or when opening Web Inspector
1717
1718         Reviewed by Anders Carlsson.
1719
1720         * UIProcess/win/WebView.cpp:
1721         (WebKit::WebView::WebView): Changed ::CreateWindowEx to ::CreateWindowExW, to match other
1722         Win32 API calls in WebKit2. Pass WS_VISIBLE to ::CreateWindowExW rather than waiting until
1723         later to show the window. Added an assertion that m_isVisible matches the window's visible
1724         state. Don't even create our WebPageProxy, or tell it about our window, until we're done
1725         initializing our window, so that it doesn't get informed about our window's internal state
1726         changes that happen beneath ::CreateWindowExW.
1727         (WebKit::WebView::onSizeEvent): Null-check m_page since we can receive this message beneath
1728         ::CreateWindowExW.
1729         (WebKit::WebView::onShowWindowEvent): Ditto. Replaced one FIXME with another. Always set
1730         handled to false so that ::DefWindowProcW can do its thing. (MSDN says this is when it
1731         actually shows/hides the window, though I couldn't find any consequences of not calling
1732         ::DefWindowProcW here.)
1733
1734 2011-02-09  Pavel Feldman  <pfeldman@chromium.org>
1735
1736         Reviewed by Yury Semikhatsky.
1737
1738         Web Inspector: follow up on InspectorAgent split -
1739         removing unnecessary methods from InspectorController.
1740         https://bugs.webkit.org/show_bug.cgi?id=54093
1741
1742         * WebProcess/WebPage/WebInspector.cpp:
1743         (WebKit::WebInspector::showConsole):
1744         (WebKit::WebInspector::stopJavaScriptProfiling):
1745
1746 2011-02-09  Alejandro G. Castro  <alex@igalia.com>
1747
1748         Reviewed by Martin Robinson.
1749
1750         [GTK] Avoid WebProcessMain compilation, we are used a gtk specific main
1751         https://bugs.webkit.org/show_bug.cgi?id=54015
1752
1753         Avoided the compilation of the general WebProcessMain, and added
1754         soup initialization to WebProcessMainGtk.cpp.
1755
1756         * GNUmakefile.am:
1757         * WebProcess/gtk/WebProcessMainGtk.cpp:
1758         (WebKit::WebProcessMainGtk):
1759
1760 2011-02-08  Alejandro G. Castro  <alex@igalia.com>
1761
1762         Reviewed by Martin Robinson.
1763
1764         [GTK] Incorrect assertion in WorkQueueGtk, we need to register
1765         more than one handle
1766         https://bugs.webkit.org/show_bug.cgi?id=54014
1767
1768         Fixed assertion condition we need to register more than one
1769         handler for the same file descriptor.
1770
1771         * Platform/gtk/WorkQueueGtk.cpp:
1772         (WorkQueue::registerEventSourceHandler):
1773
1774 2011-02-08  Alejandro G. Castro  <alex@igalia.com>
1775
1776         Reviewed by Martin Robinson.
1777
1778         Fix typo in the include guards name in ChunkedUpdateDrawingAreaProxy.h
1779         https://bugs.webkit.org/show_bug.cgi?id=54013
1780
1781         * UIProcess/ChunkedUpdateDrawingAreaProxy.h:
1782
1783 2011-02-08  Alejandro G. Castro  <alex@igalia.com>
1784
1785         Reviewed by Martin Robinson.
1786
1787         [GTK] Fix after r77874, m_isConnected is initialized before the
1788         socket is opened
1789         https://bugs.webkit.org/show_bug.cgi?id=54011
1790
1791         Fixed connection breakage after r77874, we have to wait until open
1792         the socket to open the connection.
1793
1794         * Platform/CoreIPC/gtk/ConnectionGtk.cpp:
1795         (CoreIPC::Connection::platformInitialize):
1796         (CoreIPC::Connection::open):
1797
1798 2011-02-08  Alejandro G. Castro  <alex@igalia.com>
1799
1800         Reviewed by Martin Robinson.
1801
1802         [WK2] LayerTreeContext is used outside the ACCELERATED_COMPOSITING
1803         guards but not defined in DrawingAreaProxy.h
1804         https://bugs.webkit.org/show_bug.cgi?id=54009
1805
1806         Removed the guards in the forward declaration, this will fail if
1807         the class is finally used in the function, but it works for the
1808         moment.
1809
1810         * UIProcess/DrawingAreaProxy.h:
1811
1812 2011-02-08  Alejandro G. Castro  <alex@igalia.com>
1813
1814         Reviewed by Martin Robinson.
1815
1816         WebKit2 GTK Fails to Build #include nested too deeply
1817         https://bugs.webkit.org/show_bug.cgi?id=52219
1818
1819         * GNUmakefile.am: Removed the commands to create the directories
1820         for the forwarding headers, the script already does it for us.
1821         * config.h: Removed the config.h inclusion and added the
1822         autotoolsconfig.h directly, also added a condition to share the
1823         defines with QT.
1824
1825 2011-02-08  Maciej Stachowiak  <mjs@apple.com>
1826
1827         Reviewed by Mark Rowe.
1828
1829         Crash when going back/forward when back/forward list is in a bad state.
1830         https://bugs.webkit.org/show_bug.cgi?id=54059
1831         <rdar://problem/8975244>
1832         
1833         * UIProcess/WebPageProxy.cpp:
1834         (WebKit::WebPageProxy::goForward): Add a null check.
1835         (WebKit::WebPageProxy::goBack): ditto
1836
1837 2011-02-08  Anders Carlsson  <andersca@apple.com>
1838
1839         Reviewed by Beth Dakin.
1840
1841         Assertion failure !isInAcceleratedCompositingMode() in DrawingAreaProxyImpl::incorporateUpdate()
1842         https://bugs.webkit.org/show_bug.cgi?id=54046
1843         <rdar://problem/8973960>
1844
1845         DrawingAreaImpl::setRootCompositingLayer can be called with a new layer even when already
1846         in accelerated compositing mode. Similarly, it can be called with a null layer even when not
1847         in accelerated compositing mode. Make the drawing area and layer tree host handle both these cases.
1848
1849         * WebProcess/WebPage/DrawingAreaImpl.cpp:
1850         (WebKit::DrawingAreaImpl::setRootCompositingLayer):
1851         Only call enterAcceleratedCompositingMode if there is no layer tree host, otherwise
1852         just call LayerTreeHost::setRootCompositingLayer.
1853
1854         (WebKit::DrawingAreaImpl::setSize):
1855         Add an assert.
1856
1857         (WebKit::DrawingAreaImpl::enterAcceleratedCompositingMode):
1858         Assert that we don't have a layer tree host.
1859
1860         (WebKit::DrawingAreaImpl::exitAcceleratedCompositingMode):
1861         Assert that we do have a layer tree host.
1862
1863         (WebKit::DrawingAreaImpl::display):
1864         If the call to display caused the page to enter accelerated compositing mode, we don't
1865         want to send back an Update message.
1866
1867         * WebProcess/WebPage/LayerTreeHost.cpp:
1868         (WebKit::LayerTreeHost::create):
1869         * WebProcess/WebPage/LayerTreeHost.h:
1870         Create no longer takes a graphics layer.
1871
1872         * WebProcess/WebPage/mac/LayerTreeHostMac.mm:
1873         (WebKit::LayerTreeHostMac::create):
1874         (WebKit::LayerTreeHostMac::LayerTreeHostMac):
1875         Create no longer takes a graphics layer.
1876         
1877         (WebKit::LayerTreeHostMac::setRootCompositingLayer):
1878         Set the new root compositing layer.
1879
1880 2011-02-08  Adam Roben  <aroben@apple.com>
1881
1882         Implement WorkQueue::scheduleWorkAfterDelay on Windows
1883
1884         Each WorkQueue now owns its own timer queue. When scheduleWorkAfterDelay is called, we
1885         create a timer-queue timer with the given delay. When the timer fires, we schedule the work
1886         on the queue and clean up the timer.
1887
1888         Fixes <http://webkit.org/b/54040> <rdar://problem/8974230> Web process sticks around forever
1889         if it's hung when UI process goes away
1890
1891         Reviewed by Anders Carlsson.
1892
1893         * Platform/WorkQueue.h: Added timerCallback and m_timerQueue.
1894
1895         * Platform/win/WorkQueueWin.cpp:
1896         (WorkQueue::platformInitialize): Initialize m_timerQueue.
1897         (WorkQueue::platformInvalidate): Clean up m_timerQueue.
1898         (TimerContext::TimerContext): Added this helper object to hold the context needed by the
1899         timer callback.
1900         (WorkQueue::timerCallback): Added. Schedules the WorkItem on the WorkQueue and cleans up the
1901         timer.
1902         (WorkQueue::scheduleWorkAfterDelay): Create a timer-queue timer on our timer queue that will
1903         fire after the given delay. Pass a new TimerContext object to the timer callback that
1904         contains the information it needs.
1905
1906 2011-02-08  Anders Carlsson  <andersca@apple.com>
1907
1908         Reviewed by Sam Weinig.
1909
1910         Rename PluginProcess::initializeConnection to PluginProcess::initialize
1911         https://bugs.webkit.org/show_bug.cgi?id=54039
1912
1913         * PluginProcess/PluginProcess.cpp:
1914         (WebKit::PluginProcess::initialize):
1915         * PluginProcess/PluginProcess.h:
1916         * PluginProcess/mac/PluginProcessMainMac.mm:
1917         (WebKit::PluginProcessMain):
1918         * WebProcess/WebProcess.h:
1919
1920 2011-02-08  Brady Eidson  <beidson@apple.com>
1921
1922         Reviewed by Darin Adler.
1923
1924         <rdar://problem/8972913> and https://bugs.webkit.org/show_bug.cgi?id=54036
1925         didChangeBackForwardList should include some context about what changed
1926
1927         Update the implementation of this API to include the new item (if any) and removed items (if any):
1928         * UIProcess/API/C/WKPage.h:
1929         * UIProcess/WebLoaderClient.cpp:
1930         (WebKit::WebLoaderClient::didChangeBackForwardList):
1931         * UIProcess/WebLoaderClient.h:
1932         * UIProcess/WebPageProxy.cpp:
1933         (WebKit::WebPageProxy::didChangeBackForwardList):
1934         * UIProcess/WebPageProxy.h:
1935
1936         Have WebBackForwardList pass the new items and/or removed items when calling the notifier:
1937         * UIProcess/WebBackForwardList.cpp:
1938         (WebKit::WebBackForwardList::addItem):
1939         (WebKit::WebBackForwardList::goToItem):
1940         (WebKit::WebBackForwardList::clear):
1941
1942 2011-02-08  Sam Weinig  <sam@webkit.org>
1943
1944         Reviewed by Anders Carlsson.
1945
1946         Sandbox violations visiting MobileMe.
1947         <rdar://problem/8961330>
1948
1949         * WebProcess/com.apple.WebProcess.sb:
1950
1951 2011-02-08  Anders Carlsson  <andersca@apple.com>
1952
1953         Reviewed by Sam Weinig.
1954
1955         Rename PluginProcess::initialize to PluginProcess::initializePluginProcess
1956         https://bugs.webkit.org/show_bug.cgi?id=54037
1957
1958         Rename PluginProcess::initialize to PluginProcess::initializePluginProcess to better
1959         match the WebProcess initialization code, in preparation of sharing more code.
1960
1961         * PluginProcess/PluginProcess.cpp:
1962         (WebKit::PluginProcess::initializePluginProcess):
1963         * PluginProcess/PluginProcess.h:
1964         * PluginProcess/PluginProcess.messages.in:
1965         * UIProcess/Plugins/PluginProcessProxy.cpp:
1966         (WebKit::PluginProcessProxy::didFinishLaunching):
1967
1968 2011-02-08  Sam Weinig  <sam@webkit.org>
1969
1970         Reviewed by Anders Carlsson.
1971
1972         WK2: Add ability to pass context to policy delegate methods
1973         https://bugs.webkit.org/show_bug.cgi?id=54031
1974
1975         * Platform/CoreIPC/HandleMessage.h:
1976         (CoreIPC::callMemberFunction):
1977         (CoreIPC::handleMessageVariadic):
1978         * Scripts/webkit2/messages.py:
1979         Add ability to pass variadic messages to sync messages.
1980
1981         * Shared/API/c/WKBase.h:
1982         * Shared/APIObject.h:
1983         Add WKBundleNavigation type.
1984
1985         * UIProcess/API/C/WKPage.h:
1986         * UIProcess/WebPageProxy.cpp:
1987         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
1988         (WebKit::WebPageProxy::decidePolicyForNewWindowAction):
1989         (WebKit::WebPageProxy::decidePolicyForMIMEType):
1990         * UIProcess/WebPageProxy.h:
1991         * UIProcess/WebPageProxy.messages.in:
1992         * UIProcess/WebPolicyClient.cpp:
1993         (WebKit::WebPolicyClient::decidePolicyForNavigationAction):
1994         (WebKit::WebPolicyClient::decidePolicyForNewWindowAction):
1995         (WebKit::WebPolicyClient::decidePolicyForMIMEType):
1996         * UIProcess/WebPolicyClient.h:
1997         Update policy client for new data.
1998
1999         * WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
2000         * WebProcess/InjectedBundle/API/c/WKBundleNavigationAction.cpp: Added.
2001         (WKBundleNavigationActionGetTypeID):
2002         (WKBundleNavigationActionGetNavigationType):
2003         (WKBundleNavigationActionGetEventModifiers):
2004         (WKBundleNavigationActionGetEventMouseButton):
2005         (WKBundleNavigationActionCopyHitTestResult):
2006         (WKBundleNavigationActionCopyFormElement):
2007         * WebProcess/InjectedBundle/API/c/WKBundleNavigationAction.h: Added.
2008         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
2009         (WKBundlePageSetPolicyClient):
2010         * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
2011         * WebProcess/InjectedBundle/InjectedBundleNavigationAction.cpp: Added.
2012         (WebKit::mouseEventForNavigationAction):
2013         (WebKit::mouseButtonForMouseEvent):
2014         (WebKit::InjectedBundleNavigationAction::modifiersForNavigationAction):
2015         (WebKit::InjectedBundleNavigationAction::mouseButtonForNavigationAction):
2016         (WebKit::InjectedBundleNavigationAction::create):
2017         (WebKit::InjectedBundleNavigationAction::InjectedBundleNavigationAction):
2018         * WebProcess/InjectedBundle/InjectedBundleNavigationAction.h: Added.
2019         (WebKit::InjectedBundleNavigationAction::navigationType):
2020         (WebKit::InjectedBundleNavigationAction::modifiers):
2021         (WebKit::InjectedBundleNavigationAction::mouseButton):
2022         (WebKit::InjectedBundleNavigationAction::hitTestResult):
2023         (WebKit::InjectedBundleNavigationAction::formElement):
2024         (WebKit::InjectedBundleNavigationAction::type):
2025         * WebProcess/InjectedBundle/InjectedBundlePagePolicyClient.cpp: Added.
2026         (WebKit::InjectedBundlePagePolicyClient::decidePolicyForNavigationAction):
2027         (WebKit::InjectedBundlePagePolicyClient::decidePolicyForNewWindowAction):
2028         (WebKit::InjectedBundlePagePolicyClient::decidePolicyForMIMEType):
2029         * WebProcess/InjectedBundle/InjectedBundlePagePolicyClient.h: Added.
2030         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2031         (WebKit::WebChromeClient::createWindow):
2032         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2033         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForMIMEType):
2034         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction):
2035         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
2036         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
2037         * WebProcess/WebPage/WebPage.cpp:
2038         (WebKit::WebPage::initializeInjectedBundlePolicyClient):
2039         * WebProcess/WebPage/WebPage.h:
2040         (WebKit::WebPage::injectedBundlePolicyClient):
2041         Pipe the policy client through the bundle to allow setting user data.
2042
2043         * WebKit2.pro:
2044         * WebKit2.xcodeproj/project.pbxproj:
2045         * win/WebKit2.vcproj:
2046         * win/WebKit2Generated.make:
2047         Add new files.
2048
2049 2011-02-08  Anders Carlsson  <andersca@apple.com>
2050
2051         Reviewed by Sam Weinig.
2052
2053         Crash calling -setFrame:andScrollBy: in windowDidResize
2054         https://bugs.webkit.org/show_bug.cgi?id=54030
2055         <rdar://problem/8969760>
2056
2057         * Platform/mac/SharedMemoryMac.cpp:
2058         (WebKit::SharedMemory::create):
2059         Assert that size is not zero here; we never want to try to create shared memory with a zero size.
2060         
2061         * WebProcess/WebPage/DrawingAreaImpl.cpp:
2062         (WebKit::DrawingAreaImpl::setSize):
2063         Always invalidate the entire visible page when resizing.
2064
2065 2011-02-08  Adam Barth  <abarth@webkit.org>
2066
2067         Reviewed by Eric Seidel.
2068
2069         Remove orphan code from old parser
2070         https://bugs.webkit.org/show_bug.cgi?id=53984
2071
2072         * WebProcess/WebCoreSupport/WebChromeClient.cpp
2073         * WebProcess/WebCoreSupport/WebChromeClient.h
2074
2075 2011-02-08  Anders Carlsson  <andersca@apple.com>
2076
2077         Reviewed by Sam Weinig.
2078
2079         UI process crashes if web process crashes while web inspector is focused
2080         https://bugs.webkit.org/show_bug.cgi?id=53965
2081         <rdar://problem/8961633>
2082
2083         Make sure to close the web inspector web page proxy before calling platformClose, since 
2084         platformClose can cause the web page proxy to try to send messages (such as SetActive) 
2085         to the web process while it's in a bad state. 
2086
2087         The original fix, http://trac.webkit.org/changeset/77866, put the call to m_page->close() in
2088         WebInspectorProxy::didClose, which was wrong and lead to crashes. The right place to close the page
2089         is in WebInspectorProxy::invalidate.
2090
2091         * UIProcess/WebInspectorProxy.cpp:
2092         (WebKit::WebInspectorProxy::invalidate):
2093
2094 2011-02-08  Jessie Berlin  <jberlin@apple.com>
2095
2096         Reviewed by Adam Roben.
2097
2098         ASSERTION FAILURE: ASSERT_NOT_REACHED() in Connection::writeEventHandler() after the Web
2099         Process crashes.
2100         https://bugs.webkit.org/show_bug.cgi?id=54005
2101
2102         * Platform/CoreIPC/win/ConnectionWin.cpp:
2103         (CoreIPC::Connection::writeEventHandler):
2104         Handle ERROR_BROKEN_PIPE by calling connectionDidClose() and returning early.
2105
2106 2011-02-08  Adam Roben  <aroben@apple.com>
2107
2108         Handle WM_TIMER messages for stopped timers
2109
2110         Whenever we stop a timer, we call ::KillTimer to cancel any future firings of the timer. But
2111         ::KillTimer doesn't do anything about WM_TIMER messages that have already been posted to the
2112         message queue. We need to handle those, too.
2113
2114         Fixes <http://webkit.org/b/53999> Occasional assertion failures in
2115         RunLoop::TimerBase::timerFired
2116
2117         Reviewed by Darin Adler.
2118
2119         * Platform/win/RunLoopWin.cpp:
2120         (RunLoop::TimerBase::timerFired): Just bail if the timer has already been stopped.
2121
2122 2011-02-08  Adam Roben  <aroben@apple.com>
2123
2124         Don't mark a Connection as connected until open() is called on Windows
2125
2126         This matches Mac. Even though the Connection's pipe is connected before open() is called,
2127         the Connection itself isn't really connected to the pipe until then, and we won't actually
2128         read any data from before that point.
2129
2130         Fixes <http://webkit.org/b/53998> <rdar://problem/8971207> REGRESSION (r77874): Assertion
2131         failure on launch in Connection::setDidCloseOnConnectionWorkQueueCallback on Windows
2132
2133         Reviewed by Darin Adler.
2134
2135         * Platform/CoreIPC/win/ConnectionWin.cpp:
2136         (CoreIPC::Connection::platformInitialize): Moved code to set m_isConnected from here to
2137         open.
2138         (CoreIPC::Connection::platformInvalidate): Unset m_isConnected, to match Mac. (This isn't
2139         part of the bug fix, but seemed worthwhile.)
2140         (CoreIPC::Connection::open): Set m_isConnected now that we're going to listen on the pipe.
2141
2142 2011-02-08  Sheriff Bot  <webkit.review.bot@gmail.com>
2143
2144         Unreviewed, rolling out r77866.
2145         http://trac.webkit.org/changeset/77866
2146         https://bugs.webkit.org/show_bug.cgi?id=53981
2147
2148         caused all WebKit2 inspector tests to crash (Requested by
2149         othermaciej on #webkit).
2150
2151         * UIProcess/WebInspectorProxy.cpp:
2152         (WebKit::WebInspectorProxy::didClose):
2153
2154 2011-02-07  Maciej Stachowiak  <mjs@apple.com>
2155
2156         Reviewed by Dan Bernstein.
2157
2158         Add resource load client for injected bundle and move willSendRequest there
2159         https://bugs.webkit.org/show_bug.cgi?id=53972
2160
2161         * GNUmakefile.am:
2162         * WebKit2.pro:
2163         * WebKit2.xcodeproj/project.pbxproj:
2164         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
2165         (WKBundlePageSetPageLoaderClient):
2166         (WKBundlePageSetResourceLoadClient):
2167         * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
2168         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp:
2169         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h:
2170         * WebProcess/InjectedBundle/InjectedBundlePageResourceLoadClient.cpp: Added.
2171         (WebKit::InjectedBundlePageResourceLoadClient::didInitiateLoadForResource):
2172         (WebKit::InjectedBundlePageResourceLoadClient::willSendRequestForFrame):
2173         (WebKit::InjectedBundlePageResourceLoadClient::didReceiveResponseForResource):
2174         (WebKit::InjectedBundlePageResourceLoadClient::didReceiveContentLengthForResource):
2175         (WebKit::InjectedBundlePageResourceLoadClient::didFinishLoadForResource):
2176         (WebKit::InjectedBundlePageResourceLoadClient::didFailLoadForResource):
2177         * WebProcess/InjectedBundle/InjectedBundlePageResourceLoadClient.h: Added.
2178         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2179         (WebKit::WebFrameLoaderClient::assignIdentifierToInitialRequest):
2180         (WebKit::WebFrameLoaderClient::dispatchWillSendRequest):
2181         (WebKit::WebFrameLoaderClient::dispatchDidReceiveResponse):
2182         (WebKit::WebFrameLoaderClient::dispatchDidReceiveContentLength):
2183         (WebKit::WebFrameLoaderClient::dispatchDidFinishLoading):
2184         (WebKit::WebFrameLoaderClient::dispatchDidFailLoading):
2185         * WebProcess/WebPage/WebPage.cpp:
2186         (WebKit::WebPage::initializeInjectedBundleResourceLoadClient):
2187         * WebProcess/WebPage/WebPage.h:
2188         (WebKit::WebPage::injectedBundleResourceLoadClient):
2189         * win/WebKit2.vcproj:
2190
2191 2011-02-07  Mark Rowe  <mrowe@apple.com>
2192
2193         Fix the 32-bit build.
2194
2195         * UIProcess/cf/WebBackForwardListCF.cpp:
2196         (WebKit::WebBackForwardList::restoreFromCFDictionaryRepresentation): Add some casts
2197         to prevent warnings about mixing signed and unsigned comparisons.
2198
2199 2011-02-07  Qi Zhang  <qi.2.zhang@nokia.com>
2200
2201         Reviewed by Andreas Kling.
2202
2203         [Qt] enum QWebPage::WebAction doesn't have value QWebPage::CopyImageUrl
2204         https://bugs.webkit.org/show_bug.cgi?id=52974
2205
2206         Add ContextMenuItemTagCopyImageUrlToClipboard into standard action but Qt platform specific.
2207
2208         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
2209         (WebKit::WebPlatformStrategies::contextMenuItemTagCopyImageUrlToClipboard):
2210         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
2211
2212 2011-02-07  Enrica Casucci  <enrica@apple.com>
2213
2214         Reviewed by Sam Weinig.
2215
2216         Fixing a build break on Mac caused by http://trac.webkit.org/changeset/77874
2217         
2218         Removed unused static function.
2219         
2220         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
2221
2222 2011-02-07  Anders Carlsson  <andersca@apple.com>
2223
2224         Reviewed by Sam Weinig.
2225
2226         <rdar://problem/8969888> 
2227         The WebProcess should set LSFileQuarantineEnabled to true
2228
2229         * WebProcess/Info.plist:
2230
2231 2011-02-07  Anders Carlsson  <andersca@apple.com>
2232
2233         Reviewed by Sam Weinig.
2234
2235         Crash in web process after the connection had been closed
2236         https://bugs.webkit.org/show_bug.cgi?id=51115
2237         <rdar://problem/8964255>
2238
2239         Remove didCloseOnConnectionWorkQueue from Connection::Client and add
2240         Connection::setDidCloseOnConnectionWorkQueueCallback which takes a static
2241         function, eliminating the race condition in connectionDidClose where m_client could be
2242         nulled out in the client thread right before we try to dereference it.
2243
2244         * Platform/CoreIPC/Connection.cpp:
2245         (CoreIPC::Connection::Connection):
2246         Initialize m_didCloseOnConnectionWorkQueueCallback.
2247
2248         (CoreIPC::Connection::setDidCloseOnConnectionWorkQueueCallback):
2249         Update m_didCloseOnConnectionWorkQueueCallback.
2250
2251         (CoreIPC::Connection::connectionDidClose):
2252         Call m_didCloseOnConnectionWorkQueueCallback.
2253
2254         * Platform/WorkQueue.h:
2255         Make WorkQueue noncopyable.
2256
2257         * PluginProcess/PluginProcess.cpp:
2258         (WebKit::PluginProcess::initializeConnection):
2259         Call setDidCloseOnConnectionWorkQueueCallback.
2260
2261         * Shared/ChildProcess.cpp:
2262         (WebKit::ChildProcess::didCloseOnConnectionWorkQueue):
2263         * Shared/ChildProcess.h:
2264         didCloseOnConnectionWorkQueue is now a static member function.
2265
2266         * WebProcess/WebProcess.cpp:
2267         (WebKit::WebProcess::initialize):
2268         Call setDidCloseOnConnectionWorkQueueCallback.
2269
2270 2011-02-07  Enrica Casucci  <enrica@apple.com>
2271
2272         Reviewed Adam Roben and Darin Adler.
2273
2274         WebKit2: drag and drop support on Windows.
2275         https://bugs.webkit.org/show_bug.cgi?id=52775
2276         <rdar://problem/8514409>
2277         
2278         This patch contains the remaining work to support
2279         a WebKit window as drag source on Windows.
2280         I've added the code to generate the image for dragging a link as
2281         well as the steps necessary to package the HBITMAP into a SharedMemory
2282         object and send it over to the UI process where DoDragDrop is performed.
2283
2284         * UIProcess/WebPageProxy.cpp:
2285         (WebKit::WebPageProxy::setDragImage):
2286         (WebKit::WebPageProxy::startDragDrop):
2287         * UIProcess/WebPageProxy.h:
2288         * UIProcess/WebPageProxy.messages.in:
2289         * WebProcess/WebCoreSupport/WebDragClient.cpp:
2290         (WebKit::WebDragClient::startDrag): Made startDrag for
2291         platforms other than Windows and Mac.
2292         * WebProcess/WebCoreSupport/WebDragClient.h:
2293         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
2294         (WebKit::WebDragClient::startDrag):
2295         * WebProcess/WebCoreSupport/win/WebDragClientWin.cpp: Added.
2296         (WebKit::draggingSourceOperationMaskToDragCursors):
2297         (WebKit::WebDragClient::startDrag):
2298         * WebProcess/WebCoreSupport/win/WebDragSource.cpp: Added.
2299         This object implements the IDropSource interface.
2300         (WebDragSource::createInstance):
2301         (WebDragSource::WebDragSource):
2302         (WebDragSource::QueryInterface):
2303         (WebDragSource::AddRef):
2304         (WebDragSource::Release):
2305         (WebDragSource::QueryContinueDrag):
2306         (WebDragSource::GiveFeedback):
2307         * WebProcess/WebCoreSupport/win/WebDragSource.h: Added.
2308         * win/WebKit2.vcproj:
2309
2310 2011-02-07  Anders Carlsson  <andersca@apple.com>
2311
2312         Reviewed by Sam Weinig.
2313
2314         UI process crashes if web process crashes while web inspector is focused
2315         https://bugs.webkit.org/show_bug.cgi?id=53965
2316         <rdar://problem/8961633>
2317
2318         Make sure to close the web inspector web page proxy before calling platformClose, since
2319         platformClose can cause the web page proxy to try to send messages (such as SetActive)
2320         to the web process while it's in a bad state.
2321
2322         * UIProcess/WebInspectorProxy.cpp:
2323         (WebKit::WebInspectorProxy::didClose):
2324
2325 2011-02-07  Anders Carlsson  <andersca@apple.com>
2326
2327         Reviewed by Darin Adler.
2328
2329         Find bouncy is missing content on pages with framesets
2330         https://bugs.webkit.org/show_bug.cgi?id=53958
2331         <rdar://problem/8904447>
2332
2333         Fix paint rect computation; FrameView::paint expects the paint rect to be in the
2334         parent widget's coordinate system.
2335
2336         * WebProcess/WebPage/FindController.cpp:
2337         (WebKit::FindController::updateFindIndicator):
2338
2339 2011-02-07  Brady Eidson  <beidson@apple.com>
2340
2341         Reviewed by Anders Carlsson.
2342
2343         <rdar://problem/8960434> and https://bugs.webkit.org/show_bug.cgi?id=53957
2344         Crash after incorrectly restoring bogus session state.
2345
2346         In some cases we're writing an invalid session state for a back/forward list where the current entry is 0
2347         but the number of entries is also 0.
2348         In such cases the current entry should be "NoCurrentEntryIndex."
2349
2350         When we later read this state in, we set ourselves up to crash later.
2351
2352         Amusingly an ASSERT caught this, but we should've rejected it before the ASSERT fired.
2353
2354         * UIProcess/cf/WebBackForwardListCF.cpp:
2355         (WebKit::WebBackForwardList::restoreFromCFDictionaryRepresentation): Fail the restore if the "current index past the end
2356           of the list" case occurs, and speculatively bail out of the case where we have no current index but do have a list.
2357           Also remove the unhelpful ASSERT.
2358
2359 2011-02-07  Sam Weinig  <sam@webkit.org>
2360
2361         Reviewed by Anders Carlsson.
2362
2363         Add bundle API to get the background color of a frame
2364         <rdar://problem/8962670>
2365         https://bugs.webkit.org/show_bug.cgi?id=53952
2366
2367         * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
2368         (WKBundleFrameGetBodyBackgroundColor):
2369         * WebProcess/InjectedBundle/API/c/WKBundleFrame.h:
2370         Add API function.
2371
2372         * WebProcess/WebPage/WebFrame.cpp:
2373         (WebKit::WebFrame::getDocumentBackgroundColor):
2374         * WebProcess/WebPage/WebFrame.h:
2375         Call down into the document to get either the body's, or if there is no body,
2376         the root element's, background color.
2377
2378 2011-02-07  Sam Weinig  <sam@webkit.org>
2379
2380         Fix typo. vectical -> vertical.
2381
2382         * UIProcess/WebPageProxy.cpp:
2383         (WebKit::WebPageProxy::didChangeScrollbarsForMainFrame):
2384
2385 2011-02-07  Sam Weinig  <sam@webkit.org>
2386
2387         Reviewed by Anders Carlsson.
2388
2389         Inform the UIProcess when main frame scrollbars change
2390         <rdar://problem/8967496>
2391         https://bugs.webkit.org/show_bug.cgi?id=53941
2392
2393         * UIProcess/API/C/WKPage.cpp:
2394         (WKPageHasHorizontalScrollbar):
2395         (WKPageHasVerticalScrollbar):
2396         * UIProcess/API/C/WKPage.h:
2397         Add API to query whether the main frame has scrollbars.
2398
2399         * UIProcess/WebPageProxy.cpp:
2400         (WebKit::WebPageProxy::WebPageProxy):
2401         (WebKit::WebPageProxy::close):
2402         (WebKit::WebPageProxy::processDidCrash):
2403         (WebKit::WebPageProxy::didChangeScrollbarsForMainFrame):
2404         * UIProcess/WebPageProxy.h:
2405         (WebKit::WebPageProxy::hasHorizontalScrollbar):
2406         (WebKit::WebPageProxy::hasVerticalScrollbar):
2407         Store/update main frame scrollbar state.
2408
2409         * UIProcess/WebPageProxy.messages.in:
2410         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2411         (WebKit::WebChromeClient::contentsSizeChanged):
2412         * WebProcess/WebCoreSupport/WebChromeClient.h:
2413         (WebKit::WebChromeClient::WebChromeClient):
2414         Post message when main frame scrollbar state changes.
2415
2416 2011-02-07  Anders Carlsson  <andersca@apple.com>
2417
2418         Reviewed by Sam Weinig.
2419
2420         Some content is not covered by Find-on-page overlay
2421         https://bugs.webkit.org/show_bug.cgi?id=53937
2422         <rdar://problem/8711353>
2423
2424         * WebProcess/WebPage/DrawingAreaImpl.cpp:
2425         (WebKit::DrawingAreaImpl::didInstallPageOverlay):
2426         Call LayerTreeHost::didInstallPageOverlay.
2427
2428         (WebKit::DrawingAreaImpl::didUninstallPageOverlay):
2429         Call LayerTreeHost::didUninstallPageOverlay.
2430
2431         (WebKit::DrawingAreaImpl::setPageOverlayNeedsDisplay):
2432         Call LayerTreeHost::setPageOverlayNeedsDisplay.
2433
2434         * WebProcess/WebPage/FindController.cpp:
2435         (WebKit::FindController::drawRect):
2436         Remove a bogus assertion.
2437
2438         * WebProcess/WebPage/LayerTreeHost.h:
2439         Add new pure virtual member functions.
2440
2441         * WebProcess/WebPage/PageOverlay.cpp:
2442         (WebKit::PageOverlay::setNeedsDisplay):
2443         Call DrawingArea::setPageOverlayNeedsDisplay.
2444
2445         * WebProcess/WebPage/WebPage.cpp:
2446         (WebKit::WebPage::installPageOverlay):
2447         Make sure to call PageOverlay::setNeedsDisplay after the page overlay has been installed.
2448     
2449         * WebProcess/WebPage/mac/LayerTreeHostMac.mm:
2450         (WebKit::LayerTreeHostMac::LayerTreeHostMac):
2451         Create the page overlay layer if needed.
2452
2453         (WebKit::LayerTreeHostMac::setNonCompositedContentsNeedDisplay):
2454         Invalidate the page overlay layer as well.
2455
2456         (WebKit::LayerTreeHostMac::sizeDidChange):
2457         Resize the page overlay layer.
2458
2459         (WebKit::LayerTreeHostMac::didInstallPageOverlay):
2460         Create the page overlay layer.
2461
2462         (WebKit::LayerTreeHostMac::didUninstallPageOverlay):
2463         Destroy the page overlay layer.
2464
2465         (WebKit::LayerTreeHostMac::setPageOverlayNeedsDisplay):
2466         Call setNeedsDisplay on the page overlay layer.
2467
2468         (WebKit::LayerTreeHostMac::paintContents):
2469         Handle painting the page overlay layer.
2470
2471         (WebKit::LayerTreeHostMac::flushPendingLayerChanges):
2472         Flush the page overlay layer changes as well.
2473
2474         (WebKit::LayerTreeHostMac::createPageOverlayLayer):
2475         Create a layer and add it as a sublayer of the root layer.
2476
2477         (WebKit::LayerTreeHostMac::destroyPageOverlayLayer):
2478         Destroy the page overlay layer.
2479
2480 2011-02-06  Adam Roben  <aroben@apple.com>
2481
2482         Make it possible to use DrawingAreaProxyImpl on Windows
2483
2484         It can be optionally turned on by setting the WEBKIT2_USE_NEW_DRAWING_AREA environment
2485         variable. Turning it on by default is covered by <http://webkit.org/b/53805>.
2486
2487         Fixes <http://webkit.org/b/53879>.
2488
2489         Reviewed by Anders Carlsson.
2490
2491         * UIProcess/BackingStore.h: Add an m_bitmap member on Windows.
2492
2493         * UIProcess/win/BackingStoreWin.cpp:
2494         (WebKit::BitmapDC::operator HDC):
2495         (WebKit::BitmapDC::BitmapDC):
2496         (WebKit::BitmapDC::~BitmapDC):
2497         Added this helper class, which uses RAII to select a bitmap into a new memory DC.
2498         (WebKit::BackingStore::paint): Wrap our bitmap in a BitmapDC and use ::BitBlt to copy the
2499         specified rect into the destination DC.
2500         (WebKit::createBitmap): New helper function, just creates a DIB section with the specified
2501         size.
2502         (WebKit::BackingStore::incorporateUpdate): Ported from BackingStoreMac.mm. It seems like
2503         this code could be shared at some point.
2504         (WebKit::BackingStore::scroll): Wrap our bitmap in a BitmapDC and use ::ScrollDC to scroll
2505         the specified rect.
2506
2507         * UIProcess/win/WebView.cpp:
2508         (WebKit::useNewDrawingArea): Added. Returns true if the WEBKIT2_USE_NEW_DRAWING_AREA
2509         environment variable is set.
2510         (WebKit::drawPageBackground): New helper function. Code came from onPaintEvent.
2511         (WebKit::WebView::onPaintEvent): Ported from -[WKView drawRect:].
2512         (WebKit::WebView::createDrawingAreaProxy): Create a DrawingAreaProxyImpl if we're using the
2513         new drawing area.
2514
2515         (WebKit::WebView::enterAcceleratedCompositingMode):
2516         (WebKit::WebView::exitAcceleratedCompositingMode):
2517         (WebKit::WebView::pageDidEnterAcceleratedCompositing):
2518         (WebKit::WebView::pageDidLeaveAcceleratedCompositing):
2519         Added some assertions to make sure these are only called when expected. We don't expect
2520         enter/exitAcceleratedCompositingMode to be called at all right now, because accelerated
2521         compositing is turned off in WebKit2 on Windows.
2522
2523         (WebKit::WebView::switchToDrawingAreaTypeIfNecessary): Ditto, and added a case for the
2524         DrawingAreaInfo::Impl constant.
2525
2526 2011-02-07  Adam Roben  <aroben@apple.com>
2527
2528         Start compiling DrawingArea[Proxy]Impl and dependencies on Windows
2529
2530         Fixes <http://webkit.org/b/53875> WebKit2 on Windows should build DrawingArea[Proxy]Impl
2531
2532         Reviewed by Sam Weinig and Darin Adler.
2533
2534         * Platform/Region.cpp:
2535         (WebKit::Region::Shape::shapeOperation): Initialize variable to avoid a bogus "potentially
2536         uninitialized variable" warning.
2537
2538         * UIProcess/BackingStore.cpp: Removed #error for non-Mac platforms.
2539
2540         * UIProcess/BackingStore.h: Added a PlatformGraphicsContext typedef for Windows.
2541
2542         * UIProcess/DrawingAreaProxy.h:
2543         * UIProcess/DrawingAreaProxyImpl.cpp:
2544         * UIProcess/WebPageProxy.cpp:
2545         (WebKit::WebPageProxy::didReceiveMessage):
2546         Allow Windows to compile the new drawing area code.
2547
2548         * WebProcess/WebPage/DrawingArea.cpp:
2549         (WebKit::DrawingArea::create): Allow creating a DrawingAreaImpl on Windows, too.
2550
2551         * WebProcess/WebPage/DrawingArea.h:
2552         * WebProcess/WebPage/DrawingAreaImpl.cpp:
2553         * WebProcess/WebPage/LayerTreeHost.cpp:
2554         * WebProcess/WebPage/WebPage.cpp:
2555         (WebKit::WebPage::didReceiveMessage):
2556         Allow Windows to compile the new drawing area code.
2557
2558         * Shared/win/LayerTreeContextWin.cpp: Added.
2559         * UIProcess/win/BackingStoreWin.cpp: Added.
2560         Stubbed out these files.
2561
2562         * win/WebKit2.vcproj: Added new files.
2563
2564 2011-02-07  Anders Carlsson  <andersca@apple.com>
2565
2566         Reviewed by Dan Bernstein.
2567
2568         Rename some drawing area related member functions
2569         https://bugs.webkit.org/show_bug.cgi?id=53935
2570
2571         * WebProcess/WebPage/DrawingArea.h:
2572         (WebKit::DrawingArea::setPageOverlayNeedsDisplay):
2573         * WebProcess/WebPage/DrawingAreaImpl.cpp:
2574         (WebKit::DrawingAreaImpl::setNeedsDisplay):
2575         (WebKit::DrawingAreaImpl::setPageOverlayNeedsDisplay):
2576         * WebProcess/WebPage/DrawingAreaImpl.h:
2577         * WebProcess/WebPage/LayerTreeHost.h:
2578         * WebProcess/WebPage/mac/LayerTreeHostMac.h:
2579         * WebProcess/WebPage/mac/LayerTreeHostMac.mm:
2580         (WebKit::LayerTreeHostMac::setNonCompositedContentsNeedDisplay):
2581         (WebKit::LayerTreeHostMac::scrollNonCompositedContents):
2582
2583 2011-02-07  Adam Roben  <aroben@apple.com>
2584
2585         Use the right calling convention when calling WebKitMain
2586
2587         Fixes <http://webkit.org/b/53923> REGRESSION (r77678): Crash on quit in web process in
2588         wWinMain
2589
2590         Reviewed by Steve Falkenburg.
2591
2592         * win/MainWin.cpp:
2593         (wWinMain): Use __cdecl instead of WINAPI (__stdcall) when calling WebKitMain, since that is
2594         how that function is declared.
2595
2596 2011-02-07  Anders Carlsson  <andersca@apple.com>
2597
2598         Reviewed by Dan Bernstein.
2599
2600         The drawing area should be in charge of drawing the page overlay
2601         https://bugs.webkit.org/show_bug.cgi?id=53927
2602
2603         * WebProcess/WebPage/DrawingArea.h:
2604         (WebKit::DrawingArea::didInstallPageOverlay):
2605         (WebKit::DrawingArea::didUninstallPageOverlay):
2606         (WebKit::DrawingArea::setOverlayNeedsDisplay):
2607         Add empty stubs.
2608
2609         * WebProcess/WebPage/DrawingAreaImpl.cpp:
2610         (WebKit::DrawingAreaImpl::didInstallPageOverlay):
2611         Add empty function. This will eventually ask the layer tree host to
2612         create a GraphicsLayer for the page overlay.
2613
2614         (WebKit::DrawingAreaImpl::didUninstallPageOverlay):
2615         Tell the page that it needs to be repainted.
2616
2617         (WebKit::DrawingAreaImpl::setOverlayNeedsDisplay):
2618         Just call setNeedsDisplay for now.
2619
2620         (WebKit::DrawingAreaImpl::display):
2621         Paint the page overlay too.
2622
2623         * WebProcess/WebPage/DrawingAreaImpl.h:
2624         * WebProcess/WebPage/WebPage.cpp:
2625         (WebKit::WebPage::drawRect):
2626         Only call drawPageOverlay if we have an old drawing area.
2627
2628         (WebKit::WebPage::drawPageOverlay):
2629         Draw the page overlay. Code moved here from WebPage::drawRect.
2630
2631         (WebKit::WebPage::installPageOverlay):
2632         Call DrawingArea::installPageOverlay.
2633
2634         (WebKit::WebPage::uninstallPageOverlay):
2635         Call DrawingArea::uninstallPageOverlay.
2636
2637         * WebProcess/WebPage/WebPage.h:
2638         (WebKit::WebPage::hasPageOverlay):
2639         Add getter.
2640
2641 2011-02-07  Anders Carlsson  <andersca@apple.com>
2642
2643         Reviewed by Sam Weinig.
2644
2645         Add WebPage::bounds and use it
2646         https://bugs.webkit.org/show_bug.cgi?id=53926
2647
2648         * WebProcess/WebPage/ChunkedUpdateDrawingArea.cpp:
2649         (WebKit::ChunkedUpdateDrawingArea::resumePainting):
2650         * WebProcess/WebPage/DrawingAreaImpl.cpp:
2651         (WebKit::DrawingAreaImpl::resumePainting):
2652         (WebKit::DrawingAreaImpl::exitAcceleratedCompositingMode):
2653         * WebProcess/WebPage/WebPage.h:
2654         (WebKit::WebPage::bounds):
2655
2656 2011-02-07  Anders Carlsson  <andersca@apple.com>
2657
2658         Reviewed by Maciej Stachowiak.
2659
2660         Don't exclude overlay scrollers from the page overlay bounds
2661         https://bugs.webkit.org/show_bug.cgi?id=53924
2662
2663         Don't subtract the scrollbars from the page overlay bounds if
2664         overlay scrollers are enabled.
2665
2666         * WebProcess/WebPage/PageOverlay.cpp:
2667         (WebKit::PageOverlay::bounds):
2668
2669 2011-02-07  Adam Roben  <aroben@apple.com>
2670
2671         Windows build fix after r77794
2672
2673         * win/WebKit2.def: Export WebCore symbols used by WebKitTestRunner.
2674
2675 2011-02-07  Maciej Stachowiak  <mjs@apple.com>
2676
2677         Reviewed by Antti Koivisto.
2678
2679         Add WKURLRequestCopyURL API (needed for tests and also generally useful)
2680         https://bugs.webkit.org/show_bug.cgi?id=53909
2681
2682         * Shared/API/c/WKURLRequest.cpp:
2683         (WKURLRequestCopyURL):
2684         * Shared/API/c/WKURLRequest.h:
2685         * Shared/WebURLRequest.h:
2686         (WebKit::WebURLRequest::url):
2687
2688 2011-02-06  Ryosuke Niwa  <rniwa@webkit.org>
2689
2690         Unreviewed; speculative Qt build fix.
2691
2692         * WebKit2.pro:
2693
2694 2011-02-06  Ryosuke Niwa  <rniwa@webkit.org>
2695
2696         Reviewed by Darin Adler.
2697
2698         OwnArraryPtr.h uses deleteOwnedPtr but doesn’t include OwnPtrCommon.h
2699         https://bugs.webkit.org/show_bug.cgi?id=52867
2700
2701         * Shared/Plugins/Netscape/win/NetscapePluginModuleWin.cpp:
2702         (WebKit::NetscapePluginModule::getPluginInfo): Calls adoptArrayPtr.
2703
2704 2011-02-06  Benjamin Poulain  <ikipou@gmail.com>
2705
2706         Reviewed by Andreas Kling.
2707
2708         [Qt] WebKit does not build on Mac with WebKit 2
2709         https://bugs.webkit.org/show_bug.cgi?id=53380
2710
2711         * Platform/CoreIPC/qt/ConnectionQt.cpp: Use fcntl() to set close on exec so
2712         we do not rely on recent kernel.
2713         (CoreIPC::Connection::readyReadHandler):
2714         * Platform/qt/SharedMemoryQt.cpp: ditto
2715         (WebKit::SharedMemory::create):
2716         (WebKit::SharedMemory::createHandle):
2717         * UIProcess/Launcher/qt/ProcessLauncherQt.cpp: Guard prctl() since it is
2718         a Linux specific function.
2719         (WebKit::QtWebProcess::setupChildProcess):
2720         * UIProcess/DrawingAreaProxy.h: Differentiate between building on Mac
2721         and the Mac port.
2722         * UIProcess/DrawingAreaProxyImpl.cpp: ditto
2723         * UIProcess/WebPageProxy.cpp: ditto
2724         (WebKit::WebPageProxy::didReceiveMessage):
2725         * WebProcess/WebPage/DrawingArea.cpp: ditto
2726         (WebKit::DrawingArea::create):
2727         * WebProcess/WebPage/DrawingArea.h:
2728         * WebProcess/WebPage/DrawingAreaImpl.cpp: ditto
2729         * WebProcess/WebPage/WebPage.cpp: ditto
2730         (WebKit::WebPage::didReceiveMessage):
2731
2732 2011-02-05  Maciej Stachowiak  <mjs@apple.com>
2733
2734         Reviewed by Dan Bernstein.
2735
2736         REGRESSION: New drawing area is causing some WebProcess crashes in layout tests
2737         https://bugs.webkit.org/show_bug.cgi?id=53865
2738         <rdar://problem/8963148>
2739         
2740         * WebProcess/WebPage/DrawingAreaImpl.cpp:
2741         (WebKit::DrawingAreaImpl::enterAcceleratedCompositingMode): Handle the case
2742         where this is called repeatedly without exiting accelerated composting mode
2743         first.
2744         (WebKit::DrawingAreaImpl::exitAcceleratedCompositingMode): Handle the case
2745         of being called more than once.
2746
2747 2011-02-05  Anders Carlsson  <andersca@apple.com>
2748
2749         Reviewed by Darin Adler.
2750
2751         Need a way to resize and scroll the page at the same time
2752         https://bugs.webkit.org/show_bug.cgi?id=53814
2753         <rdar://problem/8498008>
2754
2755         Add -[WKView setFrame:andScrollBy:].
2756
2757         * UIProcess/API/mac/WKView.h:
2758         * UIProcess/API/mac/WKView.mm:
2759         (-[WKView setFrame:andScrollBy:]):
2760         Stash away the scroll offset and call setFrame:.
2761
2762         (-[WKView _switchToDrawingAreaTypeIfNecessary:DrawingAreaInfo::]):
2763         (-[WKView _setDrawingAreaSize:]):
2764         * UIProcess/API/qt/qwkpage.cpp:
2765         (QWKPage::setViewportSize):
2766         DrawingAreaProxy::setSize now takes a scroll offset.
2767
2768         * UIProcess/DrawingAreaProxy.cpp:
2769         (WebKit::DrawingAreaProxy::setSize):
2770         This now takes a scroll offset and stores it in m_scrollOffset.
2771
2772         * UIProcess/DrawingAreaProxy.h:
2773         * UIProcess/DrawingAreaProxyImpl.cpp:
2774         (WebKit::DrawingAreaProxyImpl::sendSetSize):
2775         Send along the scroll offset and set it back to zero.
2776
2777         * UIProcess/LayerBackedDrawingAreaProxy.cpp:
2778         (WebKit::LayerBackedDrawingAreaProxy::didSetSize):
2779         * UIProcess/TiledDrawingAreaProxy.cpp:
2780         (WebKit::TiledDrawingAreaProxy::didSetSize):
2781         * UIProcess/win/WebView.cpp:
2782         (WebKit::WebView::onSizeEvent):
2783         (WebKit::WebView::switchToDrawingAreaTypeIfNecessary):
2784         DrawingAreaProxy::setSize now takes a scroll offset.
2785         
2786         * WebProcess/WebPage/DrawingArea.h:
2787         (WebKit::DrawingArea::setSize):
2788         Add a scrollOffset parameter.
2789
2790         * WebProcess/WebPage/DrawingArea.messages.in:
2791         Add a scroll offset parameter to the SetSize message.
2792
2793         * WebProcess/WebPage/DrawingAreaImpl.cpp:
2794         (WebKit::DrawingAreaImpl::setSize):
2795         Call WebPage::scrollMainFrameIfNotAtMaxScrollPosition.
2796
2797         * WebProcess/WebPage/DrawingAreaImpl.h:
2798         * WebProcess/WebPage/WebPage.cpp:
2799         (WebKit::WebPage::scrollMainFrameIfNotAtMaxScrollPosition):
2800         Compute a scroll offset and call setScrollPosition on the main frame view.
2801
2802 2011-02-04  Brian Weinstein  <bweinstein@apple.com>
2803
2804         Reviewed by Maciej Stachowiak.
2805
2806         WebKit2: Crash when InjectedBundlePageLoaderClient::willSendRequestForFrame returns a null WKURLRequestRef
2807         https://bugs.webkit.org/show_bug.cgi?id=53829
2808         
2809         Store the result of m_client.willSendRequestForFrame in a RefPtr, and null check it before
2810         calling resourceRequest() on it.
2811
2812         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp:
2813         (WebKit::InjectedBundlePageLoaderClient::willSendRequestForFrame):
2814
2815 2011-02-04  Anders Carlsson  <andersca@apple.com>
2816
2817         Fix build.
2818
2819         * WebProcess/mac/WebProcessMac.mm:
2820
2821 2011-02-04  Anders Carlsson  <andersca@apple.com>
2822
2823         Reviewed by Mark Rowe.
2824
2825         Link opened in background tab fails to paint when activated if it completes loading before tab is selected
2826         https://bugs.webkit.org/show_bug.cgi?id=53827
2827         <rdar://problem/8962355>
2828
2829         * WebProcess/WebPage/DrawingAreaImpl.cpp:
2830         (WebKit::DrawingAreaImpl::resumePainting):
2831         Invalidate the entire page.
2832
2833 2011-02-04  Anders Carlsson  <andersca@apple.com>
2834
2835         Reviewed by Sam Weinig.
2836
2837         Fix <rdar://problem/8961227> WebKit2 does not work with symlinked home directories.
2838
2839         * WebProcess/mac/WebProcessMac.mm:
2840         (WebKit::WebProcess::platformSetCacheModel):
2841         Don't adopt an autoreleased pointer, this would lead to a crash.
2842
2843         (WebKit::appendSandboxParameterPath):
2844         (WebKit::appendSandboxParameterConfPath):
2845         (WebKit::initializeSandbox):
2846         Clean up the sandbox parameter code and make sure that realpath is called for all parameters.
2847
2848 2011-02-04  Sam Weinig  <sam@webkit.org>
2849
2850         Reviewed by Mark Rowe.
2851
2852         Sandbox violations when visiting a site using HTTP authentication
2853         <rdar://problem/8951079> 
2854
2855         * WebProcess/com.apple.WebProcess.sb:
2856
2857 2011-02-04  Alexey Proskuryakov  <ap@apple.com>
2858
2859         Reviewed by Darin Adler.
2860
2861         https://bugs.webkit.org/show_bug.cgi?id=53823
2862         Print layout sometimes seen on screen
2863
2864         <rdar://problem/8948742> REGRESSION (WebKit2) - When I print a page, I visually see it re-layout
2865         <rdar://problem/8899389> REGRESSION(WebKit2): Wrong content can appear when print dialog is up
2866
2867         * UIProcess/API/mac/PageClientImpl.mm: (WebKit::PageClientImpl::setAutodisplay): Removed a
2868         branch that didn't do anything useful.
2869
2870         * UIProcess/API/mac/WKPrintingView.h:
2871         * UIProcess/API/mac/WKPrintingView.mm:
2872         (-[WKPrintingView _suspendAutodisplay]):
2873         (-[WKPrintingView _delayedResumeAutodisplayTimerFired]):
2874         (-[WKPrintingView _delayedResumeAutodisplay]):
2875         (-[WKPrintingView knowsPageRange:]):
2876         (-[WKPrintingView beginDocument]):
2877         (-[WKPrintingView endDocument]):
2878         When page setup changes, or when going from print preview to actual printing, AppKit calls
2879         -endDocument just to begin it again. Delay resuming autodisplay until the next run loop
2880         iteration.
2881
2882         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2883         (WebKit::WebChromeClient::invalidateContentsAndWindow):
2884         (WebKit::WebChromeClient::invalidateContentsForSlowScroll):
2885         Tightened it up from other side - we should never send pixels to UI process while in
2886         printing mode. This is not 100% reliable, because relayout doesn't happen immediately,
2887         and we can still have print layout in screen mode - but it helps.
2888
2889 2011-02-04  Sam Weinig  <sam@webkit.org>
2890
2891         Reviewed by Mark Rowe.
2892
2893         Fix for <rdar://problem/8961580>.
2894         Work around for <rdar://problem/8957845>.
2895
2896         * WebProcess/com.apple.WebProcess.sb:
2897
2898 2011-02-04  Darin Adler  <darin@apple.com>
2899
2900         Reviewed by Dan Bernstein.
2901
2902         WebKit2 doesn't hide mouse pointer on keypress
2903         https://bugs.webkit.org/show_bug.cgi?id=53821
2904         rdar://problem/8630895
2905
2906         * UIProcess/PageClient.h: Renamed didNotHandleKeyEvent to
2907         doneWithKeyEvent and added a bool wasEventHandled argument.
2908         * UIProcess/WebPageProxy.cpp:
2909         (WebKit::WebPageProxy::didReceiveEvent): Changed code to call
2910         doneWithKeyEvent and call even if event was handled.
2911
2912         * UIProcess/API/mac/PageClientImpl.h: Updated for above change.
2913         * UIProcess/API/mac/PageClientImpl.mm:
2914         (WebKit::PageClientImpl::doneWithKeyEvent): Ditto. But also
2915         call [NSCursor setHiddenUntilMouseMoves:YES] when a key down
2916         event was handled. This matches what -[WebHTMLView keyDown:] does.
2917         * UIProcess/API/qt/qwkpage.cpp:
2918         (QWKPagePrivate::doneWithKeyEvent): Ditto.
2919         * UIProcess/API/qt/qwkpage_p.h: Ditto.
2920         * UIProcess/win/WebView.cpp:
2921         (WebKit::WebView::doneWithKeyEvent): Ditto.
2922         * UIProcess/win/WebView.h: Ditto.
2923
2924 2011-02-04  Steve Falkenburg  <sfalken@apple.com>
2925
2926         Reviewed by Adam Roben.
2927
2928         WebKit2 clients fail to launch on Windows if client exe is in a different directory from WebKit
2929         https://bugs.webkit.org/show_bug.cgi?id=53810
2930         <rdar://problem/8946085>
2931         
2932         If WebKit2WebProcess.exe is in a different directory from the client process, and that
2933         client process uses CreateProcess to launch WebKit2WebProcess, the DLL search path may
2934         end up excluding the directory containing WebKit. To address this, we use SetDllDirectory
2935         to explicitly include the WebKit directory in the DLL search path.
2936
2937         * win/MainWin.cpp:
2938         (wWinMain): Use SetDllDirectory and LoadLibrary to load WebKit.dll from WebKit2WebProcess.exe
2939         * win/WebKit2WebProcessCommon.vsprops: Don't link directly to WebKit. Link against shlwapi.
2940
2941 2011-02-04  Adam Roben  <aroben@apple.com>
2942
2943         Allow passing a null filter callback to WKPageCopySessionState
2944
2945         WebKit2 part of <http://webkit.org/b/53616> <rdar://problem/8949883>.
2946
2947         Reviewed by Sam Weinig.
2948
2949         * UIProcess/cf/WebBackForwardListCF.cpp:
2950         (WebKit::WebBackForwardList::createCFDictionaryRepresentation): Check if the filter is null
2951         before calling it.
2952
2953 2011-02-04  Brian Weinstein  <bweinstein@apple.com>
2954
2955         Reviewed by John Sullivan.
2956
2957         WebKit2: DidInitiateLoadForResource needs to know if the resource is being loaded by a committed or provisional frame
2958         https://bugs.webkit.org/show_bug.cgi?id=53794
2959         
2960         When we navigate from one page to another, there can be multiple subresource requests between when
2961         the new page has started its provisional load and when it has committed the load.
2962         
2963         There can be:
2964         
2965         - The main resource load of the provisional page
2966         - Synchronous XHR from the unload event of the loaded page.
2967         
2968         WebKit clients need to be able to differentiate between these loads.
2969
2970         * UIProcess/API/C/WKPage.h:
2971         * UIProcess/WebPageProxy.cpp:
2972         (WebKit::WebPageProxy::didInitiateLoadForResource): Pass whether or not the page is provisionally loading
2973             to the client.
2974         * UIProcess/WebPageProxy.h:
2975         * UIProcess/WebPageProxy.messages.in: Add a new parameter to DidInitiateLoadForResource.
2976         * UIProcess/WebResourceLoadClient.cpp:
2977         (WebKit::WebResourceLoadClient::didInitiateLoadForResource):  a new parameter to didInitiateLoadForResource.
2978         * UIProcess/WebResourceLoadClient.h:
2979         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2980         (WebKit::WebFrameLoaderClient::assignIdentifierToInitialRequest): Pass whether or not the page is currently
2981             in a provisional load (checked by seeing if the DocumentLoader matches the FrameLoader's provisionalDocumentLoader)
2982             to the UI Process.
2983
2984 2011-02-04  Anders Carlsson  <andersca@apple.com>
2985
2986         Reviewed by Mark Rowe.
2987
2988         Mac WebKit2 should use the new drawing area
2989         https://bugs.webkit.org/show_bug.cgi?id=53802
2990         <rdar://problem/7881419>
2991         <rdar://problem/7881447>
2992         <rdar://problem/8252632>
2993         <rdar://problem/8479422>
2994         <rdar://problem/8633813>
2995         <rdar://problem/8734512>
2996         <rdar://problem/8787660>
2997
2998         * UIProcess/API/mac/WKView.mm:
2999         (useNewDrawingArea):
3000         Return true. Eventually this function should be removed, but let's keep it for now so
3001         we can go back to the old drawing area if necessary.
3002
3003 2011-02-04  Maciej Stachowiak  <mjs@apple.com>
3004
3005         Reviewed by Anders Carlsson.
3006
3007         WebKit2: Crash in WebPageProxy::setPendingAPIRequestURL after web process crashed
3008         https://bugs.webkit.org/show_bug.cgi?id=53799
3009         <rdar://problem/8943956>
3010
3011         * UIProcess/WebPageProxy.cpp:
3012         (WebKit::WebPageProxy::reload):
3013
3014 2011-02-04  Anders Carlsson  <andersca@apple.com>
3015
3016         Reviewed by Maciej Stachowiak.
3017
3018         Fix a shared memory leak
3019         https://bugs.webkit.org/show_bug.cgi?id=53800
3020
3021         Move the send right representing the shared memory.
3022
3023         * Platform/mac/SharedMemoryMac.cpp:
3024         (WebKit::SharedMemory::Handle::encode):
3025
3026 2011-02-04  Brady Eidson  <beidson@apple.com>
3027
3028         Reviewed by Anders Carlsson.
3029
3030         <rdar://problem/8636239> and https://bugs.webkit.org/show_bug.cgi?id=53785
3031         WebKit2: Pages with dynamically inserted iframes can add extraneous back/forward items.
3032
3033         WebCore doesn't gracefully handle the case where the decidePolicyForNavigationAction callback
3034         does not occur synchronously. Let's make it synchronous.
3035
3036         Change WebPageProxy to handle this message reply synchronously:
3037         * UIProcess/WebPageProxy.cpp:
3038         (WebKit::WebPageProxy::WebPageProxy):
3039         (WebKit::WebPageProxy::receivedPolicyDecision):
3040         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
3041         * UIProcess/WebPageProxy.h:
3042         * UIProcess/WebPageProxy.messages.in: Make the navigation policy action message be synchronous.
3043
3044         * Platform/CoreIPC/HandleMessage.h:
3045         (CoreIPC::callMemberFunction): Add a 6-argument varient 
3046
3047         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3048         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): Send the message synchronously.
3049
3050 2011-02-04  Steve Falkenburg  <sfalken@apple.com>
3051
3052         Windows build fix.
3053         Correct prebuild build-stopping rule to allow project only rebuilds.
3054
3055         * win/WebKit2WebProcessPreBuild.cmd:
3056
3057 2011-02-04  Brian Weinstein  <bweinstein@apple.com>
3058
3059         Reviewed by Adam Roben.
3060
3061         Assertion failure in WebInspectorProxy::platformClose closing main window when inspecting a popup 
3062         window, or when running regression tests.
3063         https://bugs.webkit.org/show_bug.cgi?id=53798
3064         <rdar://problem/8814364>
3065         
3066         Only assert about the state of m_inspectorWindow and m_inspectorView if the inspector is visible.
3067         Also, only call ::DestroyWindow if the HWND is non-null, just to be safe.
3068
3069         * UIProcess/win/WebInspectorProxyWin.cpp:
3070         (WebKit::WebInspectorProxy::platformClose):
3071
3072 2011-02-04  Anders Carlsson  <andersca@apple.com>
3073
3074         Reviewed by Dan Bernstein.
3075
3076         Go out of accelerated compositing mode when the drawing area is destroyed
3077         https://bugs.webkit.org/show_bug.cgi?id=53788
3078
3079         This fixes a crash in the UI process if a web process crashes while in accelerated compositing mode.
3080
3081         * UIProcess/DrawingAreaProxyImpl.cpp:
3082         (WebKit::DrawingAreaProxyImpl::~DrawingAreaProxyImpl):
3083
3084 2011-02-03  Yury Semikhatsky  <yurys@chromium.org>
3085
3086         Reviewed by Pavel Feldman.
3087
3088         Web Inspector: remove settings related methods from InspectorClient
3089         https://bugs.webkit.org/show_bug.cgi?id=53686
3090
3091         * WebProcess/WebCoreSupport/WebInspectorFrontendClient.cpp:
3092         (WebKit::WebInspectorFrontendClient::WebInspectorFrontendClient):
3093
3094 2011-02-03  Maciej Stachowiak  <mjs@apple.com>
3095
3096         Reviewed by Dan Bernstein.
3097
3098         WebKit2: Need WebKit2 equivalent of WebResourceLoadDelegate::willSendRequest in the Bundle
3099         https://bugs.webkit.org/show_bug.cgi?id=52897
3100         <rdar://problem/8898294>
3101
3102         * Shared/API/c/WKSharedAPICast.h:
3103         (WebKit::toAPI):
3104         * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
3105         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp:
3106         (WebKit::InjectedBundlePageLoaderClient::willSendRequestForFrame):
3107         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h:
3108         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3109         (WebKit::WebFrameLoaderClient::dispatchWillSendRequest):
3110
3111 2011-02-03  Ivan Krstić  <ike@apple.com>
3112
3113         Reviewed by Maciej Stachowiak.
3114
3115         Make WebProcess pass explicit homedir parameter to the sandbox
3116         <rdar://problem/8405760>
3117         <https://webkit.org/b/53558>
3118
3119         * WebProcess/com.apple.WebProcess.sb:
3120         * WebProcess/mac/WebProcessMac.mm:
3121         (WebKit::initializeSandbox):
3122
3123 2011-02-03  James Kozianski  <koz@chromium.org>
3124
3125         Reviewed by Dimitri Glazkov.
3126
3127         Add navigator.registerProtocolHandler behind a flag.
3128         https://bugs.webkit.org/show_bug.cgi?id=52609
3129
3130         * Configurations/FeatureDefines.xcconfig:
3131
3132 2011-02-03  Adam Langley  <agl@chromium.org>
3133
3134         Reviewed by Adam Barth.
3135
3136         Plumb mixed script URL to FrameLoaderClient
3137         https://bugs.webkit.org/show_bug.cgi?id=52384
3138
3139         Regressions covered by http/tests/security/mixedContent/*
3140
3141         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3142         (WebKit::WebFrameLoaderClient::didRunInsecureContent):
3143         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
3144
3145 2011-02-03  Jon Honeycutt  <jhoneycutt@apple.com>
3146
3147         Download bundles should be moved to their final destination when they
3148         finish.
3149
3150         https://bugs.webkit.org/show_bug.cgi?id=53668
3151
3152         Reviewed by Adam Roben.
3153
3154         * WebProcess/Downloads/Download.cpp:
3155         (WebKit::Download::Download):
3156         Initialize m_allowOverwrite.
3157         (WebKit::Download::retrieveDestinationWithSuggestedFilename):
3158         Return the result of requesting the destination filename from the UI
3159         process.
3160         (WebKit::Download::decideDestinationWithSuggestedFilename):
3161         Call retrieveDestinationWithSuggestedFilename().
3162         (WebKit::Download::didFinish):
3163         Call platformDidFinish().
3164
3165         * WebProcess/Downloads/Download.h:
3166         Declare retrieveDestinationWithSuggestedFilename() and
3167         platformDidFinish(). Add a member variable to store whether the UI
3168         process would like us to overwrite existing files.
3169
3170         * WebProcess/Downloads/cf/DownloadCFNet.cpp:
3171         (WebKit::willResumeWithResponseCallback):
3172         Remove some trailing whitespace.
3173
3174         * WebProcess/Downloads/curl/DownloadCurl.cpp:
3175         (WebKit::Download::platformDidFinish):
3176         Stubbed.
3177
3178         * WebProcess/Downloads/mac/DownloadMac.mm:
3179         (WebKit::Download::platformDidFinish):
3180         Stubbed.
3181
3182         * WebProcess/Downloads/qt/DownloadQt.cpp:
3183         (WebKit::Download::platformDidFinish):
3184         Stubbed.
3185
3186         * WebProcess/Downloads/cf/win/DownloadCFNetWin.cpp:
3187         (WebKit::Download::didDecideDestination):
3188         Store whether the UI process would like us to overwrite existing files.
3189         (WebKit::Download::platformDidFinish):
3190         Try to move the bundle to the final destination. If that fails, ask the
3191         UI process for a new destination. If we receive one, try again to move
3192         the bundle. Call didCreateDestination() to report the updated path of
3193         file whether it's the bundle that we failed to move, or the new final
3194         destination.
3195
3196         This is similar to what is done by WebKit 1's CFNetwork port.
3197
3198         * win/WebKit2.vcproj:
3199         Add DownloadWin.cpp.
3200
3201 2011-02-01  Jon Honeycutt  <jhoneycutt@apple.com>
3202
3203         Small clean-up in DownloadCFNet.cpp.
3204
3205         Rubber-stamped by Mark Rowe.
3206
3207         * WebProcess/Downloads/cf/DownloadCFNet.cpp:
3208         (WebKit::Download::didDecideDestination):
3209         Moved out of the section labeled "CFURLDownload callbacks" and up near
3210         the other member functions.
3211
3212 2011-02-03  Anders Carlsson  <andersca@apple.com>
3213
3214         Reviewed by Sam Weinig.
3215
3216         Paint non-composited contents in a layer
3217         https://bugs.webkit.org/show_bug.cgi?id=53742
3218
3219         * WebProcess/WebPage/DrawingAreaImpl.cpp:
3220         (WebKit::DrawingAreaImpl::setNeedsDisplay):
3221         Call LayerTreeHost::setNonCompositedContentsNeedDisplayInRect.
3222
3223         (WebKit::DrawingAreaImpl::scroll):
3224         Call LayerTreeHost::scrollNonCompositedContents.
3225
3226         (WebKit::DrawingAreaImpl::setSize):
3227         Call LayerTreeHost::sizeDidChange.
3228
3229         * WebProcess/WebPage/LayerTreeHost.h:
3230         Add new pure virtual member functions.
3231
3232         * WebProcess/WebPage/mac/LayerTreeHostMac.mm:
3233         (WebKit::LayerTreeHostMac::LayerTreeHostMac):
3234         Create the non-composited content layer.
3235
3236         (WebKit::LayerTreeHostMac::setNonCompositedContentsNeedDisplayInRect):
3237         Call setNeedsDisplay on the GraphicsLayer.
3238
3239         (WebKit::LayerTreeHostMac::scrollNonCompositedContents):
3240         Just call setNonCompositedContentsNeedDisplayInRect.
3241
3242         (WebKit::LayerTreeHostMac::sizeDidChange):
3243         Resize the layers and flush any changes.
3244         
3245         (WebKit::LayerTreeHostMac::paintContents):
3246         Call WebPage::drawRect.
3247
3248         (WebKit::LayerTreeHostMac::flushPendingLayerChangesRunLoopObserverCallback):
3249         Lay out the web page.
3250
3251         (WebKit::LayerTreeHostMac::flushPendingLayerChanges):
3252         Call syncCompositingStateForThisLayerOnly on the non-composited content layer.
3253
3254 2011-02-03  Anders Carlsson  <andersca@apple.com>
3255
3256         Reviewed by Sam Weinig.
3257
3258         When in accelerated compositing mode, wait for DidSetSize messages
3259         https://bugs.webkit.org/show_bug.cgi?id=53736
3260
3261         Normally we wait for DidSetSize messages from ::paint, but that's never called in 
3262         accelerated compositing mode so we just do it right after sending the SetSize message.
3263
3264         * UIProcess/DrawingAreaProxyImpl.cpp:
3265         (WebKit::DrawingAreaProxyImpl::paint):
3266         Call waitForAndDispatchDidSetSize.
3267
3268         (WebKit::DrawingAreaProxyImpl::sendSetSize):
3269         Call waitForAndDispatchDidSetSize when in accelerated compositing mode.
3270
3271         (WebKit::DrawingAreaProxyImpl::waitForAndDispatchDidSetSize):
3272         New utility function which waits for and dispatches a DidSetSize message.
3273
3274         * UIProcess/DrawingAreaProxyImpl.h:
3275
3276 2011-02-03  Anders Carlsson  <andersca@apple.com>
3277
3278         Reviewed by Dan Bernstein.
3279
3280         Pass along an UpdateInfo object to the ExitAcceleratedCompositingMode message
3281         https://bugs.webkit.org/show_bug.cgi?id=53734
3282
3283         * UIProcess/DrawingAreaProxy.h:
3284         (WebKit::DrawingAreaProxy::exitAcceleratedCompositingMode):
3285         Add an UpdateInfo parameter.
3286
3287         * UIProcess/DrawingAreaProxy.messages.in:
3288         Add an UpdateInfo parameter to the ExitAcceleratedCompositingMode message.
3289
3290         * UIProcess/DrawingAreaProxyImpl.cpp:
3291         (WebKit::DrawingAreaProxyImpl::exitAcceleratedCompositingMode):
3292         Incorporate the passed in update.
3293
3294         * WebProcess/WebPage/DrawingAreaImpl.cpp:
3295         (WebKit::DrawingAreaImpl::exitAcceleratedCompositingMode):
3296         Create a new UpdateInfo object, paint into it and pass it along as a parameter
3297         to the ExitAcceleratedCompositingMode message.
3298
3299 2011-02-03  Beth Dakin  <bdakin@apple.com>
3300
3301         Reviewed by Sam Weinig.
3302
3303         Fix for <rdar://problem/8944544> Ability to animate track
3304         for WKPainter scrollers
3305
3306         * WebCoreSupport/WebSystemInterface.mm:
3307         (InitWebCoreSystemInterface):
3308
3309 2011-02-03  Anders Carlsson  <andersca@apple.com>
3310
3311         Reviewed by Dan Bernstein.
3312
3313         Change DidSetSize to take a LayerTreeContext parameter
3314         https://bugs.webkit.org/show_bug.cgi?id=53724
3315
3316         Since SetSize can cause layout to happen, we need to pass along a layer tree context to 
3317         the DidSetSize message so the UI process can enter/exit accelerated compositing mode appropriately.
3318         
3319         * Shared/LayerTreeContext.h:
3320         * Shared/mac/LayerTreeContextMac.mm:
3321         Add equality operators to LayerTreeContext.
3322
3323         * UIProcess/DrawingAreaProxy.h:
3324         (WebKit::DrawingAreaProxy::didSetSize):
3325         This now takes a LayerTreeContext parameter.
3326         
3327         * UIProcess/DrawingAreaProxy.messages.in:
3328         Add LayerTreeContext parameter.
3329
3330         * UIProcess/DrawingAreaProxyImpl.cpp:
3331         Get rid of m_isInAcceleratedCompositingMode and use the current layer context instead.
3332
3333         (WebKit::DrawingAreaProxyImpl::paint):
3334         Bail if the call to DidSetSize ended up entering accelerated compositing mode.
3335
3336         (WebKit::DrawingAreaProxyImpl::didSetSize):
3337         If the new layer tree context is different, enter/exit accelerated compositing mode accordingly.
3338
3339         (WebKit::DrawingAreaProxyImpl::enterAcceleratedCompositingMode):
3340         (WebKit::DrawingAreaProxyImpl::exitAcceleratedCompositingMode):
3341         Update the layer tree context.
3342
3343         * UIProcess/DrawingAreaProxyImpl.h:
3344         (WebKit::DrawingAreaProxyImpl::isInAcceleratedCompositingMode):
3345         Add simple getter.
3346
3347         * WebProcess/WebPage/DrawingAreaImpl.cpp:
3348         (WebKit::DrawingAreaImpl::setSize):
3349         Pass along the layer tree context.
3350
3351 2011-02-03  Anders Carlsson  <andersca@apple.com>
3352
3353         Reviewed by Dan Bernstein.
3354
3355         Get rid of LayerTreeContext::seed on Mac.
3356         Add sequence checks to enterAcceleratedCompositingMode and exitAcceleratedCompositingMode and
3357         have them call newly added overloads that don't have the checks.
3358
3359         * Shared/LayerTreeContext.h:
3360         * Shared/mac/LayerTreeContextMac.mm:
3361         (WebKit::LayerTreeContext::LayerTreeContext):
3362         (WebKit::LayerTreeContext::encode):
3363         (WebKit::LayerTreeContext::decode):
3364         * UIProcess/DrawingAreaProxyImpl.cpp:
3365         (WebKit::DrawingAreaProxyImpl::enterAcceleratedCompositingMode):
3366         (WebKit::DrawingAreaProxyImpl::exitAcceleratedCompositingMode):
3367         * UIProcess/DrawingAreaProxyImpl.h:
3368         * WebProcess/WebPage/mac/LayerTreeHostMac.mm:
3369         (WebKit::LayerTreeHostMac::LayerTreeHostMac):
3370
3371 2011-02-03  Anders Carlsson  <andersca@apple.com>
3372
3373         Reviewed by Dan Bernstein.
3374
3375         Get rid of timestamps in UpdateInfo
3376         https://bugs.webkit.org/show_bug.cgi?id=53713
3377
3378         Add a 64-bit sequence number to all DrawingAreaProxy messages, and use it to
3379         check whether Update messages should be handled or not.
3380
3381         * Shared/UpdateInfo.cpp:
3382         (WebKit::UpdateInfo::encode):
3383         (WebKit::UpdateInfo::decode):
3384         * Shared/UpdateInfo.h:
3385         (WebKit::UpdateInfo::UpdateInfo):
3386         * UIProcess/BackingStore.cpp:
3387         (WebKit::BackingStore::BackingStore):
3388         (WebKit::BackingStore::incorporateUpdate):
3389         * UIProcess/BackingStore.h:
3390         * UIProcess/DrawingAreaProxy.h:
3391         (WebKit::DrawingAreaProxy::update):
3392         (WebKit::DrawingAreaProxy::didSetSize):
3393         (WebKit::DrawingAreaProxy::enterAcceleratedCompositingMode):
3394         (WebKit::DrawingAreaProxy::exitAcceleratedCompositingMode):
3395         * UIProcess/DrawingAreaProxy.messages.in:
3396         * UIProcess/DrawingAreaProxyImpl.cpp:
3397         (WebKit::DrawingAreaProxyImpl::DrawingAreaProxyImpl):
3398         (WebKit::DrawingAreaProxyImpl::update):
3399         (WebKit::DrawingAreaProxyImpl::didSetSize):
3400         (WebKit::DrawingAreaProxyImpl::enterAcceleratedCompositingMode):
3401         (WebKit::DrawingAreaProxyImpl::exitAcceleratedCompositingMode):
3402         * UIProcess/DrawingAreaProxyImpl.h:
3403         * WebProcess/WebPage/DrawingAreaImpl.cpp:
3404         (WebKit::generateSequenceNumber):
3405         (WebKit::DrawingAreaImpl::setSize):
3406         (WebKit::DrawingAreaImpl::enterAcceleratedCompositingMode):
3407         (WebKit::DrawingAreaImpl::exitAcceleratedCompositingMode):
3408         (WebKit::DrawingAreaImpl::display):
3409
3410 2011-02-03  Anders Carlsson  <andersca@apple.com>
3411
3412         Reviewed by Darin Adler.
3413
3414         Don't send enter/exit accelerated compositing mode messages when handling setSize
3415         https://bugs.webkit.org/show_bug.cgi?id=53706
3416
3417         Don't send EnterAcceleratedCompositingMode/ExitAcceleratedCompositing mode when
3418         the mode changes happen as a result of relayout in setSize, since an updated state
3419         is going to be sent back in the DidSetSize message.
3420