2010-10-05 Sheriff Bot <webkit.review.bot@gmail.com>
[WebKit-https.git] / WebKit2 / ChangeLog
1 2010-10-05  Sheriff Bot  <webkit.review.bot@gmail.com>
2
3         Unreviewed, rolling out r69103.
4         http://trac.webkit.org/changeset/69103
5         https://bugs.webkit.org/show_bug.cgi?id=47177
6
7         Breaking Windows and Mac build. (Requested by lca on #webkit).
8
9         * UIProcess/API/C/WKNativeEvent.h:
10         * UIProcess/API/qt/qwkpage.cpp:
11         * UIProcess/API/qt/qwkpage.h:
12         * WebKit2.pri:
13
14 2010-10-05  Luiz Agostini  <luiz.agostini@openbossa.org>
15
16         Reviewed by Antti Koivisto.
17
18         [Qt] Webkit2 MacOS build fix
19         https://bugs.webkit.org/show_bug.cgi?id=47167
20
21         Qt WebKit2 MacOS build fix.
22
23         * UIProcess/API/C/WKNativeEvent.h:
24         * UIProcess/API/qt/qwkpage.cpp:
25         * UIProcess/API/qt/qwkpage.h:
26         * WebKit2.pri:
27
28 2010-10-04  Mark Rowe  <mrowe@apple.com>
29
30         Reviewed by Sam Weinig.
31
32         Fix the build when sandboxing is enabled.
33
34         * UIProcess/WebContext.cpp:
35         (WebKit::WebContext::ensureWebProcess):
36         * UIProcess/WebProcessProxy.cpp:
37
38 2010-10-04  Andras Becsi  <abecsi@webkit.org>
39
40         Reviewed Csaba Osztrogonác.
41
42         [Qt] Build fix after r69037.
43         Also remove dummy setUpAcceleratedCompositing() from the source file,
44         since it has been removed from the header.
45
46         * UIProcess/WebProcessProxy.cpp:
47
48 2010-10-04  Andras Becsi  <abecsi@webkit.org>
49
50         Rubber-stamped by Csaba Osztrogonác.
51
52         [Qt] Fix the WebKit2 build after r69029.
53
54         * DerivedSources.pro:
55
56 2010-10-04  Sam Weinig  <sam@webkit.org>
57
58         Reviewed by Anders Carlsson.
59
60         Change WebProcess initialization to be done with an
61         auxiliary struct.
62
63         * Platform/CoreIPC/mac/MachPort.h:
64         * Shared/WebProcessCreationParameters.cpp: Added.
65         (WebKit::WebProcessCreationParameters::WebProcessCreationParameters):
66         (WebKit::WebProcessCreationParameters::encode):
67         (WebKit::WebProcessCreationParameters::decode):
68         * Shared/WebProcessCreationParameters.h: Added.
69         * UIProcess/WebContext.cpp:
70         (WebKit::WebContext::ensureWebProcess):
71         * UIProcess/WebContext.h:
72         * UIProcess/WebProcessProxy.cpp:
73         (WebKit::WebProcessProxy::WebProcessProxy):
74         * UIProcess/WebProcessProxy.h:
75         * UIProcess/mac/WebContextMac.mm:
76         (WebKit::WebContext::platformInitializeWebProcess):
77         * UIProcess/mac/WebProcessProxyMac.mm: Removed.
78         * UIProcess/qt/WebContextQt.cpp:
79         (WebKit::WebContext::applicationCacheDirectory):
80         (WebKit::WebContext::platformInitializeWebProcess):
81         * UIProcess/win/WebContextWin.cpp:
82         (WebKit::WebContext::platformInitializeWebProcess):
83         * WebKit2.pro:
84         * WebKit2.xcodeproj/project.pbxproj:
85         * WebProcess/WebProcess.cpp:
86         (WebKit::WebProcess::initializeWebProcess):
87         * WebProcess/WebProcess.h:
88         * WebProcess/WebProcess.messages.in:
89         * win/WebKit2.vcproj:
90
91 2010-10-04  Brent Fulgham  <bfulgham@webkit.org>
92
93         Unreviewed build fixes after r68260 and r68686.
94
95         * Platform/CoreIPC/DataReference.h: Add include directive for
96         <inttypes.h>, needed for WinCairo build.
97         * Shared/win/PlatformCertificateInfo.cpp:
98         (WebKit::PlatformCertificateInfo::PlatformCertificateInfo):
99         Conditionalize logic specific to WebKitSystemInterface and
100         add a stub implementation for WinCairo.
101
102 2010-10-04  Sam Weinig  <sam@webkit.org>
103
104         Reviewed by Adam Roben.
105
106         Generate messages sent to the WebProcess class.
107         https://bugs.webkit.org/show_bug.cgi?id=47097
108
109         * DerivedSources.make:
110         Add new file to generate and new directory to search.
111
112         * Scripts/webkit2/messages.py:
113         (forward_declarations_and_headers): Special case class templates.
114         (headers_for_type): Special case Vector.
115         * Scripts/webkit2/messages_unittest.py:
116         Make this script work for passing a templated type.
117
118         * Shared/CoreIPCSupport/WebProcessMessageKinds.h: Removed.
119
120         * UIProcess/VisitedLinkProvider.cpp:
121         (WebKit::VisitedLinkProvider::pendingVisitedLinksTimerFired):
122         * UIProcess/WebContext.cpp:
123         (WebKit::WebContext::initializeHistoryClient):
124         (WebKit::WebContext::ensureWebProcess):
125         (WebKit::WebContext::registerURLSchemeAsEmptyDocument):
126         (WebKit::WebContext::setCacheModel):
127         * UIProcess/WebPageProxy.cpp:
128         (WebKit::WebPageProxy::initializeWebPage):
129         (WebKit::WebPageProxy::reinitializeWebPage):
130         * UIProcess/WebProcessProxy.cpp:
131         (WebKit::WebProcessProxy::WebProcessProxy): Always pass both
132         the bundle path and a key, even if the key is null, which it will be for
133         all non-mac builds for now.
134         * UIProcess/mac/WebProcessProxyMac.mm:
135         (WebKit::WebProcessProxy::setUpAcceleratedCompositing):
136         * UIProcess/win/WebContextWin.cpp:
137         (WebKit::WebContext::setShouldPaintNativeControls):
138         (WebKit::WebContext::platformSetUpWebProcess):
139         Use the new syntax for sending the messages.
140
141         * WebProcess/WebProcess.cpp:
142         (WebKit::WebProcess::setShouldTrackVisitedLinks):
143         (WebKit::WebProcess::setCacheModel):
144         (WebKit::WebProcess::setupAcceleratedCompositingPort):
145         (WebKit::WebProcess::setShouldPaintNativeControls):
146         (WebKit::WebProcess::didReceiveMessage):
147         * WebProcess/WebProcess.h:
148         Convert to using generated didReceiveWebProcessMessage.
149
150         * WebProcess/WebProcess.messages.in: Added.
151
152         * WebKit2.pro:
153         * WebKit2.xcodeproj/project.pbxproj:
154         * win/WebKit2.vcproj:
155         Update projects.
156
157 2010-10-04  Sam Weinig  <sam@webkit.org>
158
159         Fix the Mac build.
160
161         * WebProcess/mac/WebProcessMac.mm:
162
163 2010-10-04  Sam Weinig  <sam@webkit.org>
164
165         Reviewed by Anders Carlsson.
166
167         Add ability to set the CacheModel in Webkit2
168         https://bugs.webkit.org/show_bug.cgi?id=47066
169
170         Add WKContext function to set the cache model for the context.
171
172         * Shared/CacheModel.h: Added.
173         * Shared/CoreIPCSupport/WebProcessMessageKinds.h:
174         * UIProcess/API/C/WKAPICast.h:
175         (WebKit::toCacheModel):
176         (WebKit::toRef):
177         * UIProcess/API/C/WKContext.cpp:
178         (WKContextSetCacheModel):
179         (WKContextGetCacheModel):
180         * UIProcess/API/C/WKContext.h:
181         * UIProcess/WebContext.cpp:
182         (WebKit::WebContext::WebContext):
183         (WebKit::WebContext::ensureWebProcess):
184         (WebKit::WebContext::setCacheModel):
185         * UIProcess/WebContext.h:
186         (WebKit::WebContext::cacheModel):
187         * WebKit2.pro:
188         * WebKit2.xcodeproj/project.pbxproj:
189         * WebProcess/WebProcess.cpp:
190         (WebKit::WebProcess::WebProcess):
191         (WebKit::WebProcess::setCacheModel):
192         (WebKit::WebProcess::didReceiveMessage):
193         * WebProcess/WebProcess.h:
194         * WebProcess/mac/WebProcessMac.mm: Added.
195         (WebKit::memorySize):
196         (WebKit::volumeFreeSize):
197         (WebKit::WebProcess::platformSetCacheModel):
198         * WebProcess/qt/WebProcessQt.cpp: Added.
199         (WebKit::WebProcess::platformSetCacheModel):
200         * WebProcess/win/WebProcessWin.cpp: Added.
201         (WebKit::WebProcess::platformSetCacheModel):
202         * win/WebKit2.vcproj:
203
204 2010-10-03  Anders Carlsson  <andersca@apple.com>
205
206         Reviewed by Sam Weinig.
207
208         Implement newly added Plugin/PluginController member functions for out of process plug-ins
209         https://bugs.webkit.org/show_bug.cgi?id=47065
210         <rdar://problem/8507194>
211
212         * Platform/CoreIPC/Arguments.h:
213         Add typedefs.
214
215         * Platform/CoreIPC/HandleMessage.h:
216         (CoreIPC::handleMessage):
217         Add new handleMessage overload.
218
219         * PluginProcess/PluginControllerProxy.cpp:
220         (WebKit::PluginControllerProxy::create):
221         Add an isPrivateBrowsingEnabled boolean.
222         
223         (WebKit::PluginControllerProxy::PluginControllerProxy):
224         Add an isPrivateBrowsingEnabled boolean.
225
226         (WebKit::PluginControllerProxy::proxiesForURL):
227         (WebKit::PluginControllerProxy::cookiesForURL):
228         (WebKit::PluginControllerProxy::setCookiesForURL):
229         Send messages to the web process.
230
231         (WebKit::PluginControllerProxy::isPrivateBrowsingEnabled):
232         Return whether private browsing is enabled or not.
233
234         (WebKit::PluginControllerProxy::handleKeyboardEvent):
235         Call Plugin::handleKeyboardEvent.
236
237         (WebKit::PluginControllerProxy::privateBrowsingStateChanged):
238         Call Plugin::privateBrowsingStateChanged.
239
240         * PluginProcess/PluginControllerProxy.messages.in:
241         Add new messages.
242
243         * PluginProcess/WebProcessConnection.cpp:
244         (WebKit::WebProcessConnection::createPlugin):
245         Pass the isPrivateBrowsingEnabled flag.
246
247         * PluginProcess/WebProcessConnection.h:
248         * PluginProcess/WebProcessConnection.messages.in:
249         Update CreatePlugin message parameters.
250
251         * WebProcess/Plugins/PluginProcessConnection.cpp:
252         (WebKit::PluginProcessConnection::didReceiveMessage):
253         (WebKit::PluginProcessConnection::didReceiveSyncMessage):
254         It's OK for a plug-in to not get a sync message.
255
256         * WebProcess/Plugins/PluginProcessConnection.h:
257         * WebProcess/Plugins/PluginProxy.cpp:
258         (WebKit::PluginProxy::handleKeyboardEvent):
259         (WebKit::PluginProxy::privateBrowsingStateChanged):
260         Send messages.
261
262         (WebKit::PluginProxy::proxiesForURL):
263         (WebKit::PluginProxy::cookiesForURL):
264         (WebKit::PluginProxy::setCookiesForURL):
265         Call the plug-in controller.
266
267         * WebProcess/Plugins/PluginProxy.messages.in:
268         Add new messages.
269
270 2010-10-03  Anders Carlsson  <andersca@apple.com>
271
272         Reviewed by Sam Weinig.
273
274         Send keyboard events to plug-ins
275         https://bugs.webkit.org/show_bug.cgi?id=47064
276         <rdar://problem/8507148>
277
278         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
279         (WebKit::NetscapePlugin::handleKeyboardEvent):
280         Call platformHandleKeyboardEvent.
281
282         * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
283         (WebKit::modifierFlags):
284         Return the modifier flags given a WebKeyboardEvent.
285
286         (WebKit::initializeKeyboardEvent):
287         Initialize an NPCocoaEvent from a WebKeyboardEvent.
288
289         (WebKit::NetscapePlugin::platformHandleKeyboardEvent):
290         Initialize the event and dispatch it using NPP_HandleEvent.
291
292         * WebProcess/Plugins/Netscape/qt/NetscapePluginQt.cpp:
293         (WebKit::NetscapePlugin::platformHandleKeyboardEvent):
294         Add stub.
295
296         * WebProcess/Plugins/Netscape/win/NetscapePluginWin.cpp:
297         (WebKit::NetscapePlugin::platformHandleKeyboardEvent):
298         Add stub.
299         
300         * WebProcess/Plugins/Plugin.h:
301         Add handleKeyboardEvent.
302
303         * WebProcess/Plugins/PluginView.cpp:
304         (WebKit::PluginView::handleEvent):
305         Call Plugin::handleKeyboardEvent if we see a keydown or keyup event.
306
307 2010-10-01  Mark Rowe  <mrowe@apple.com>
308
309         Build fix.
310
311         Clear the executable bit from a number of source files.
312
313         * WebProcess/WebCoreSupport/win/WebFrameNetworkingContext.h:
314
315 2010-10-01  Anders Carlsson  <andersca@apple.com>
316
317         Reviewed by Sam Weinig.
318
319         Plug-ins should have access to the private browsing state.
320         https://bugs.webkit.org/show_bug.cgi?id=47031
321         <rdar://problem/8505405>
322     
323         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
324         (WebKit::NPN_GetValue):
325         Handle NPNVprivateModeBool.
326
327         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
328         (WebKit::NetscapePlugin::isPrivateBrowsingEnabled):
329         Call PluginController::isPrivateBrowsingEnabled.
330
331         (WebKit::NetscapePlugin::NPP_SetValue):
332         Add NPP_SetValue wrapper.
333
334         (WebKit::NetscapePlugin::privateBrowsingStateChanged):
335         Call NPP_SetValue with the updated state.
336
337         * WebProcess/Plugins/Plugin.h:
338         Add privateBrowsingStateChanged pure virtual member function.
339
340         * WebProcess/Plugins/PluginController.h:
341         Add isPrivateBrowsingEnabled pure virtual member function.
342
343         * WebProcess/Plugins/PluginView.cpp:
344         (WebKit::PluginView::privateBrowsingStateChanged):
345         Call Plugin::privateBrowsingStateChanged.
346
347 2010-10-01  Sam Weinig  <sam@webkit.org>
348
349         Reviewed by Anders Carlsson.
350
351         Add SPI to convert a WKStringRef to a JSStringRef and vice-versa.
352
353         API Test: WebKit2/WKStringJSString
354
355         * Shared/API/c/WKString.cpp:
356         (WKStringCreateWithJSString):
357         (WKStringCopyJSString):
358         * Shared/API/c/WKStringPrivate.h: Added.
359         * Shared/WebString.h:
360         (WebKit::WebString::create):
361         (WebKit::WebString::createJSString):
362         * WebKit2.pro:
363         * WebKit2.xcodeproj/project.pbxproj:
364         * win/WebKit2.vcproj:
365         * win/WebKit2Generated.make:
366
367 2010-10-01  Anders Carlsson  <andersca@apple.com>
368
369         Reviewed by Sam Weinig.
370
371         Implement proxiesForURL, cookiesForURL and setCookiesForURL
372         https://bugs.webkit.org/show_bug.cgi?id=47029
373
374         * WebProcess/Plugins/PluginView.cpp:
375         (WebKit::PluginView::proxiesForURL):
376         (WebKit::PluginView::cookiesForURL):
377         (WebKit::PluginView::setCookiesForURL):
378
379 2010-10-01  Sam Weinig  <sam@webkit.org>
380
381         Reviewed by Kenneth Rohde Christiansen.
382
383         Add additional WKString API
384         https://bugs.webkit.org/show_bug.cgi?id=46958
385
386         API Test: WebKit2/WKString
387
388         * Shared/API/c/WKString.cpp:
389         (WKStringCreateWithUTF8CString):
390         (WKStringGetMaximumUTF8CStringSize):
391         (WKStringGetUTF8CString):
392         (WKStringIsEqual):
393         (WKStringIsEqualToUTF8CString):
394         * Shared/API/c/WKString.h:
395         * Shared/WebString.h:
396         (WebKit::WebString::createFromUTF8String):
397         (WebKit::WebString::maximumUTF8CStringSize):
398         (WebKit::WebString::getUTF8CString):
399         (WebKit::WebString::equal):
400         (WebKit::WebString::equalToUTF8String):
401
402 2010-10-01  Anders Carlsson  <andersca@apple.com>
403
404         Reviewed by Dan Bernstein.
405
406         Implement NPN_GetValueForURL/NPN_SetValueForURL and stub out PluginController functions
407         https://bugs.webkit.org/show_bug.cgi?id=46992
408
409         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
410         (WebKit::copyCString):
411         Helper function for allocating a string using NPN_MemAlloc.
412
413         (WebKit::NPN_GetValueForURL):
414         Ask the plug-in for either the proxy or the cookies given an URL.
415
416         (WebKit::NPN_SetValueForURL):
417         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
418         Tell the plug-in to set the cookies for the given URL.
419
420         (WebKit::NetscapePlugin::proxiesForURL):
421         (WebKit::NetscapePlugin::cookiesForURL):
422         (WebKit::NetscapePlugin::setCookiesForURL):
423         Call the corresponding PluginController functions.
424
425         * WebProcess/Plugins/PluginController.h:
426         Add new pure virtual member functions.
427
428         * WebProcess/Plugins/PluginView.cpp:
429         (WebKit::PluginView::proxiesForURL):
430         (WebKit::PluginView::cookiesForURL):
431         (WebKit::PluginView::setCookiesForURL):
432         Add stubbed out implementations of the new PluginController functions.
433
434         * WebProcess/Plugins/PluginView.h:
435
436 2010-10-01  Adam Roben  <aroben@apple.com>
437
438         Implement NPN_GetValue(NPNVnetscapeWindow)
439
440         Fixes <http://webkit.org/b/46726> <rdar://problem/8486319>
441         Right-clicking on windowless Flash plugin in WebKit2 makes a context
442         menu appear in the bottom-right corner of the screen
443
444         Test: platform/win/plugins/get-value-netscape-window.html
445
446         Reviewed by Anders Carlsson.
447
448         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
449         (WebKit::NPN_GetValue): Added case for NPNVnetscapeWindow that calls
450         through to NetscapePlugin::containingWindow.
451
452         * WebProcess/Plugins/Netscape/NetscapePlugin.h: Added containingWindow
453         on Windows.
454
455         * WebProcess/Plugins/Netscape/win/NetscapePluginWin.cpp:
456         (WebKit::NetscapePlugin::containingWindow): Added. Calls through to
457         the PluginController.
458         (WebKit::NetscapePlugin::platformPostInitialize): Changed to use
459         containingWindow.
460
461 2010-09-30  Simon Fraser  <simon.fraser@apple.com>
462
463         Reviewed by Darin Adler.
464
465         Background doesn't draw when entering accelerated compositing
466         https://bugs.webkit.org/show_bug.cgi?id=45848
467         
468         LayerBackedDrawingArea::setSize() is normally called in response
469         to a message from the UI process, so this can come some time after
470         LayerBackedDrawingArea creation. Depending on the timing, we could
471         end up being at size 0x0 for the first invalidate and paint, resulting
472         in missing content.
473         
474         The fix is to size the backing layer on creation, using the WebView's size.
475         
476         Also changed various calls to syncCompositingStateForThisLayerOnly()
477         to do lazy updates via scheduleCompositingLayerSync().
478         
479         Also add the fix for https://bugs.webkit.org/show_bug.cgi?id=46226 (r68028)
480         to the WebKit2 code, in scheduleUpdateLayoutRunLoopObserver().
481
482         * WebProcess/WebPage/LayerBackedDrawingArea.cpp:
483         (WebKit::LayerBackedDrawingArea::LayerBackedDrawingArea):
484         (WebKit::LayerBackedDrawingArea::setNeedsDisplay):
485         (WebKit::LayerBackedDrawingArea::setSize):
486         * WebProcess/WebPage/mac/LayerBackedDrawingAreaMac.mm:
487         (WebKit::LayerBackedDrawingArea::platformInit):
488         (WebKit::LayerBackedDrawingArea::attachCompositingContext):
489         (WebKit::LayerBackedDrawingArea::detachCompositingContext):
490         (WebKit::LayerBackedDrawingArea::setRootCompositingLayer):
491         (WebKit::LayerBackedDrawingArea::syncCompositingLayers):
492         (WebKit::LayerBackedDrawingArea::scheduleUpdateLayoutRunLoopObserver):
493
494 2010-09-29  Jon Honeycutt  <jhoneycutt@apple.com>
495
496         WebKit2 on Windows should use Windows fonts for the various standard
497         font families
498         https://bugs.webkit.org/show_bug.cgi?id=43499
499         <rdar://problem/8272758>
500
501         Reviewed by Adam Roben.
502
503         * Shared/WebPreferencesStore.cpp:
504         (WebKit::WebPreferencesStore::WebPreferencesStore):
505         Use Windows fonts on Windows.
506
507 2010-09-30  Brady Eidson  <beidson@apple.com>
508
509         Reviewed by Sam Weinig.
510
511         https://bugs.webkit.org/show_bug.cgi?id=46774 - Add WKStringIsEqual API
512
513         * Shared/API/c/WKString.cpp:
514         (WKStringIsEqual):
515         * Shared/API/c/WKString.h:
516
517 2010-09-30  Anders Carlsson  <andersca@apple.com>
518
519         Reviewed by Adam Roben.
520
521         Forward declare structs with 'struct' in the message headers
522         https://bugs.webkit.org/show_bug.cgi?id=46925
523         <rdar://problem/8497940>
524
525         * Scripts/webkit2/messages.py:
526         (struct_or_class): New function which given a type and a namespace returns the correct
527         forward declaration syntax (struct or class).
528
529         * Scripts/webkit2/messages_unittest.py:
530         Update expected results.
531
532 2010-09-30  Kenneth Rohde Christiansen  <kenneth@webkit.org>
533
534         Reviewed by Antti Koivisto.
535
536         Original patch by Zalan Bujtas.
537
538         The m_readBuffer might be smaller than the incoming message size and
539         thus result in memory corruption. Do a similar fix as the win port,
540         resizing the m_readBuffer to have room for the message.
541
542         * Platform/CoreIPC/qt/ConnectionQt.cpp:
543         (CoreIPC::Connection::readyReadHandler):
544
545 2010-09-29  Anders Carlsson  <andersca@apple.com>
546
547         Reviewed by Simon Fraser.
548
549         Calling Connection::send/sendSync from Connection::Client::didClose should always fail
550         https://bugs.webkit.org/show_bug.cgi?id=46859
551         <rdar://problem/8212583>
552
553         * Platform/CoreIPC/Connection.cpp:
554         (CoreIPC::Connection::dispatchConnectionDidClose):
555
556 2010-09-29  Simon Fraser  <simon.fraser@apple.com>
557
558         Reviewed by Anders Carlsson.
559
560         Assertion then crash closing WebKit2 window with accelerated compositing in
561         https://bugs.webkit.org/show_bug.cgi?id=46857
562         
563         Fix two issues when closing a WebKit2 window using accelerated
564         compositing.
565         
566         The first is that the response to the sync DidChangeAcceleratedCompositing message
567         sent by changeAcceleratedCompositingMode() may be empty, because the corresponding
568         page may have been destroyed already in the UI process. In that case newDrawingAreaInfo
569         is not filled in, so we get a DrawingArea::Type of None. Don't attempt to make a new
570         drawing area in that case.
571         
572         We then have to null-check the drawing area in WebPage::didReceiveMessage(),
573         in the case where the UI process is calling back with a SuspendPainting message,
574         before our page has gone away.
575         
576         * WebProcess/WebPage/WebPage.cpp:
577         (WebKit::WebPage::changeAcceleratedCompositingMode):
578         (WebKit::WebPage::didReceiveMessage):
579
580 2010-09-29  Anders Carlsson  <andersca@apple.com>
581
582         Reviewed by Sam Weinig.
583
584         Implement more of PluginProxy and PLuginControllerProxy.
585
586         * Platform/CoreIPC/ArgumentDecoder.cpp:
587         (CoreIPC::ArgumentDecoder::decodeBytes):
588         * Platform/CoreIPC/ArgumentDecoder.h:
589         Add new overload that takes a DataReference. Wrap the debug function in #ifndef NDEBUG.
590
591         * Platform/CoreIPC/ArgumentEncoder.cpp:
592         * Platform/CoreIPC/ArgumentEncoder.h:
593         Wrap the debug function in #ifndef NDEBUG.
594
595         * Platform/CoreIPC/Arguments.h:
596         Add new typedefs.
597         
598         * Platform/CoreIPC/DataReference.cpp:
599         * Platform/CoreIPC/DataReference.h:
600         Add a DataReference class.
601     
602         * Platform/CoreIPC/HandleMessage.h:
603         (CoreIPC::handleMessage):
604         Add new overload.
605
606         * PluginProcess/PluginControllerProxy.cpp:
607         (WebKit::PluginControllerProxy::didEvaluateJavaScript):
608         (WebKit::PluginControllerProxy::streamDidReceiveResponse):
609         (WebKit::PluginControllerProxy::streamDidReceiveData):
610         (WebKit::PluginControllerProxy::streamDidFinishLoading):
611         (WebKit::PluginControllerProxy::streamDidFail):
612         call Plugin member functions.
613
614         * PluginProcess/PluginControllerProxy.messages.in:
615         Add new messages.
616         
617         * WebKit2.pro:
618         * WebKit2.xcodeproj/project.pbxproj:
619         * win/WebKit2.vcproj:
620         Add DataReference.cpp and DataReference.h
621
622         * WebProcess/Plugins/PluginProxy.cpp:
623         (WebKit::PluginProxy::didEvaluateJavaScript):
624         (WebKit::PluginProxy::streamDidReceiveResponse):
625         (WebKit::PluginProxy::streamDidReceiveData):
626         (WebKit::PluginProxy::streamDidFinishLoading):
627         (WebKit::PluginProxy::streamDidFail):
628         Send messages.
629
630 2010-09-29  Anders Carlsson  <andersca@apple.com>
631
632         Update expected results.
633
634         * Scripts/webkit2/messages_unittest.py:
635
636 2010-09-29  Anders Carlsson  <andersca@apple.com>
637
638         Reviewed by Sam Weinig.
639
640         Implement LoadURL
641         https://bugs.webkit.org/show_bug.cgi?id=46826
642
643         * Platform/CoreIPC/ArgumentCoders.h:
644         Move String argument coder here from WebCoreArgumentCoders.h. Add
645         argument coder for AtomicString.
646
647         * Platform/CoreIPC/Arguments.h:
648         Add typedefs for Arguments7.
649
650         * Platform/CoreIPC/HandleMessage.h:
651         (CoreIPC::handleMessage):
652         Add handleMessage overload that takes 7 parameters.
653
654         * PluginProcess/PluginControllerProxy.cpp:
655         (WebKit::PluginControllerProxy::loadURL):
656         Send the LoadURL message.
657
658         * Scripts/webkit2/messages.py:
659         (parse_parameter_string): Use rsplit in case the type name contains spaces.
660         (argument_coder_headers_for_type): Special case Vector.
661         
662         * Scripts/webkit2/messages_unittest.py:
663         Update results.
664
665         * Shared/WebCoreArgumentCoders.h:
666         Add argument coder for HTTPHeaderMap.
667
668         * WebProcess/Plugins/PluginProxy.cpp:
669         (WebKit::PluginProxy::loadURL):
670         Ask the plug-in controller to load the URL.
671
672         * WebProcess/Plugins/PluginProxy.messages.in:
673         Add LoadURL message.
674
675 2010-09-29  Anders Carlsson  <andersca@apple.com>
676
677         Reviewed by Sam Weinig.
678
679         Handle getting the user agent in the plug-in process
680         https://bugs.webkit.org/show_bug.cgi?id=46819
681
682         * Platform/CoreIPC/HandleMessage.h:
683         (CoreIPC::handleMessage):
684         Add new handleMessage overload.
685
686         * PluginProcess/PluginControllerProxy.cpp:
687         (WebKit::PluginControllerProxy::create):
688         (WebKit::PluginControllerProxy::PluginControllerProxy):
689         Pass the user agent to the plug-in controller proxy.
690
691         (WebKit::PluginControllerProxy::userAgent):
692         Return the user agent.
693
694         * PluginProcess/WebProcessConnection.cpp:
695         (WebKit::WebProcessConnection::createPlugin):
696         Pass the user agent when creating the plug-in controller proxy.
697
698         * PluginProcess/WebProcessConnection.messages.in:
699         Add userAgent.
700
701         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
702         (WebKit::NetscapePlugin::userAgent):
703         * WebProcess/Plugins/PluginController.h:
704         Remove the URL parameter to userAgent.
705
706         * WebProcess/Plugins/PluginProxy.cpp:
707         (WebKit::PluginProxy::initialize):
708         Pass the user agent to WebProcessConnection::CreatePlugin.
709
710         * WebProcess/Plugins/PluginView.cpp:
711         (WebKit::PluginView::userAgent):
712         Remove url parameter.
713
714 2010-09-29  Anders Carlsson  <andersca@apple.com>
715
716         Reviewed by Sam Weinig.
717
718         Implement more PluginProxy member functions
719         https://bugs.webkit.org/show_bug.cgi?id=46815
720
721         * Platform/CoreIPC/HandleMessage.h:
722         (CoreIPC::handleMessage):
723         * PluginProcess/PluginControllerProxy.cpp:
724         (WebKit::PluginControllerProxy::handleMouseEvent):
725         (WebKit::PluginControllerProxy::handleWheelEvent):
726         (WebKit::PluginControllerProxy::handleMouseEnterEvent):
727         (WebKit::PluginControllerProxy::handleMouseLeaveEvent):
728         (WebKit::PluginControllerProxy::setFocus):
729         (WebKit::PluginControllerProxy::windowFocusChanged):
730         (WebKit::PluginControllerProxy::windowFrameChanged):
731         (WebKit::PluginControllerProxy::windowVisibilityChanged):
732         Call the appropriate Plugin member functions.
733
734         * PluginProcess/PluginControllerProxy.messages.in:
735         Add new messages.
736
737         * PluginProcess/WebProcessConnection.cpp:
738         (WebKit::WebProcessConnection::didReceiveMessage):
739         It's OK to get a message for a plug-in controller proxy that has gone away.
740
741         (WebKit::WebProcessConnection::didReceiveSyncMessage):
742         Forward the message to the PluginControllerProxy handler.
743
744         * WebProcess/Plugins/PluginProxy.cpp:
745         (WebKit::PluginProxy::handleMouseEvent):
746         (WebKit::PluginProxy::handleWheelEvent):
747         (WebKit::PluginProxy::handleMouseEnterEvent):
748         (WebKit::PluginProxy::handleMouseLeaveEvent):
749         (WebKit::PluginProxy::setFocus):
750         (WebKit::PluginProxy::windowFocusChanged):
751         (WebKit::PluginProxy::windowFrameChanged):
752         (WebKit::PluginProxy::windowVisibilityChanged):
753         Send messages to the plug-in process.
754         
755         (WebKit::PluginProxy::controller):
756         Return the plug-in controller.
757
758 2010-09-29  Adam Roben  <aroben@apple.com>
759
760         Look for WebKit.dll (not WebKit_debug.dll) when launching the web
761         process in Debug builds
762
763         Fixes <http://webkit.org/b/46809> <rdar://problem/8491809> REGRESSION
764         (r67979): All tests crashing on Windows WebKit2 test bot
765
766         Reviewed by Sam Weinig.
767
768         * UIProcess/Launcher/win/ProcessLauncherWin.cpp: WebKit_debug.dll is
769         only used in Debug_All builds (but WebKit2WebProcess_debug.exe is used
770         in all non-Debug_Internal debug-style builds).
771
772 2010-09-28  Anders Carlsson  <andersca@apple.com>
773
774         Reviewed by Sam Weinig.
775
776         Paint the plug-in backing store into the WebProcess backing store
777         https://bugs.webkit.org/show_bug.cgi?id=46768
778
779         * DerivedSources.make:
780         Add PluginProxy.
781         
782         * Platform/CoreIPC/MessageID.h:
783         Add PluginProxy message class.
784
785         * PluginProcess/PluginControllerProxy.cpp:
786         (WebKit::PluginControllerProxy::paint):
787         Let the web process know that we've painted.
788
789         * WebKit2.xcodeproj/project.pbxproj:
790         Add new files.
791
792         * WebProcess/Plugins/PluginProcessConnection.cpp:
793         (WebKit::PluginProcessConnection::didReceiveMessage):
794         Pass the message on to a plug-in proxy.
795
796         * WebProcess/Plugins/PluginProxy.cpp:
797         (WebKit::PluginProxy::paint):
798         Paint our backing store into the graphics context.
799
800         (WebKit::PluginProxy::controller):
801         Add notImplemented().
802
803         (WebKit::PluginProxy::update):
804         Blit the plug-in backing store into the local backing store and tell the plug-in
805         controller that we want to repaint.
806
807         * WebProcess/Plugins/PluginProxy.messages.in: Added.
808
809 2010-09-28  Jenn Braithwaite  <jennb@chromium.org>
810
811         Reviewed by Dmitry Titov.
812
813         Added oldPage param to FrameLoaderClient::didTransferChildFrameToNewDocument.
814         https://bugs.webkit.org/show_bug.cgi?id=46663
815
816         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
817         (WebKit::WebFrameLoaderClient::didTransferChildFrameToNewDocument):
818         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
819
820 2010-09-28  Anders Carlsson  <andersca@apple.com>
821
822         Reviewed by Sam Weinig.
823
824         Begin hooking up painting in the plug-in process
825         https://bugs.webkit.org/show_bug.cgi?id=46766
826
827         * DerivedSources.make:
828         Add PluginControllerProxy.
829     
830         * Platform/CoreIPC/MessageID.h:
831         Add a MessageClassPluginControllerProxy message class.
832
833         * PluginProcess/PluginControllerProxy.cpp:
834         (WebKit::PluginControllerProxy::PluginControllerProxy):
835         Initialize the paint timer.
836
837         (WebKit::PluginControllerProxy::paint):
838         Create a graphics context referencing our backing store and paint into it.
839
840         (WebKit::PluginControllerProxy::invalidate):
841         Update the dirty rect and start the paint timer if necessary.
842
843         (WebKit::PluginControllerProxy::geometryDidChange):
844         If we're passed a new backing store handle, reinitialize the backing store.
845
846         * PluginProcess/PluginControllerProxy.messages.in: Added.
847         * PluginProcess/WebProcessConnection.cpp:
848         (WebKit::WebProcessConnection::didReceiveMessage):
849         If the message has a destination ID, forward it to the plug-in controller proxy.
850
851         * Scripts/webkit2/messages.py:
852         Always include WebCoreArgumentCoders.h if the type is in the WebCore namespace.
853
854         * WebKit2.xcodeproj/project.pbxproj:
855         Add new files.
856
857         * WebProcess/Plugins/PluginProxy.cpp:
858         (WebKit::PluginProxy::geometryDidChange):
859         Update the size of the backing store. Create a new plug-in backing store if needed and send
860         it over to the plug-in process.
861         
862 2010-09-28  Anders Carlsson  <andersca@apple.com>
863
864         Reviewed by Sam Weinig.
865
866         ASSERT when launching the plugin process
867         https://bugs.webkit.org/show_bug.cgi?id=46754
868         <rdar://problem/8484570>
869
870         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
871         (WebKit::ProcessLauncher::launchProcess):
872         Don't assert if we fail to launch the process. Instead, set the connection identifier
873         and process ID to null and deallocate the port we created.
874
875         * UIProcess/Plugins/PluginProcessProxy.cpp:
876         (WebKit::PluginProcessProxy::pluginProcessCrashedOrFailedToLaunch):
877         Move all code from didClose here.
878
879         (WebKit::PluginProcessProxy::didClose):
880         Call pluginProcessCrashedOrFailedToLaunch.
881
882         (WebKit::PluginProcessProxy::didFinishLaunching):
883         If we failed to launch, call pluginProcessCrashedOrFailedToLaunch.
884
885 2010-09-28  Anders Carlsson  <andersca@apple.com>
886
887         Reviewed by Sam Weinig.
888
889         Differentiate waitForSyncReply from waitForReply
890         https://bugs.webkit.org/show_bug.cgi?id=46752
891
892         Since waitForSyncReply is going to need to dispatch incoming sync messages while
893         waiting for the correct reply, we need to add a new waitForSyncReply function that
894         can do this.
895
896         * Platform/CoreIPC/Connection.cpp:
897         (CoreIPC::Connection::sendSyncMessage):
898         Push the pending sync reply information on the m_pendingSyncReplies stack,
899         send the message, wait for a reply and pop the information off the stack.
900
901         (CoreIPC::Connection::waitForSyncReply):
902         Block while waiting for a reply to the sync message with the given ID.
903         
904         (CoreIPC::Connection::processIncomingMessage):
905         If the incoming message is a sync reply, set the didReceiveReply flag and the replyDecoder
906         members in the pending sync reply and signal the client thread to wakeup.
907
908         * Platform/CoreIPC/Connection.h:
909         Add a stack of PendingSyncReply structs.
910
911 2010-09-28  Sam Weinig  <sam@webkit.org>
912
913         Reviewed by Darin Adler and Dave Hyatt.
914
915         Vertical scroll bar on apple.com is too short with WebKit2
916         <rdar://problem/8379230>
917         https://bugs.webkit.org/show_bug.cgi?id=46739
918
919         This gets us most of the way to having correct scroll corner behavior. We should
920         follow this up by moving to painting the window re-sizer in WebCore.
921
922         * UIProcess/API/mac/WKView.mm:
923         (-[WKView _ownsWindowGrowBox]):
924         (-[WKView _updateGrowBoxForWindowFrameChange]): Calculate whether we should
925         be taking the scroll corner into account when laying out scrollbars.
926         * UIProcess/WebPageProxy.cpp:
927         (WebKit::WebPageProxy::setWindowResizerSize):
928         * UIProcess/WebPageProxy.h:
929         * WebProcess/WebPage/WebPage.cpp:
930         (WebKit::WebPage::setWindowResizerSize):
931         (WebKit::WebPage::windowResizerRect): This now returns IntRect() for
932         non-mac platforms (or any platform that never sends a setWindowResizerSize
933         message).
934         * WebProcess/WebPage/WebPage.h:
935         * WebProcess/WebPage/WebPage.messages.in:
936
937 2010-09-28  Adam Roben  <aroben@apple.com>
938
939         Tell the UI client when a key event is not handled
940
941         When the web process receives an event, it sends a
942         WebPageProxyMessage::DidReceiveEvent message back to the UI process.
943         That message is now sent after handling the event, and includes a
944         boolean signifying whether or not the event was actually handled.
945
946         Every time WebPageProxy receives a key event, it adds it to a queue.
947         When it receives a WebPageProxyMessage::DidReceiveEvent for a key
948         event, the event is removed from the queue. If the event was not
949         handled, we tell the UI client.
950
951         Fixes <http://webkit.org/b/46660> <rdar://problem/8483465> Need API to
952         tell a WebKit2 client application that a key event was not handled
953
954         Reviewed by Kenneth Rohde Christiansen and Sam Weinig.
955
956         * Shared/NativeWebKeyboardEvent.h: Added. This class wraps a
957         WebKeyboardEvent and the native event that was used to construct it.
958         (WebKit::NativeWebKeyboardEvent::nativeEvent): Simple getter.
959
960         * Shared/WebEvent.h: Made isKeyboardEventType public for
961         WebPageProxy's benefit.
962
963         * Shared/mac/NativeWebKeyboardEventMac.mm: Added.
964         (WebKit::NativeWebKeyboardEvent::NativeWebKeyboardEvent):
965         * Shared/qt/NativeWebKeyboardEventQt.cpp: Added.
966         (WebKit::NativeWebKeyboardEvent::NativeWebKeyboardEvent):
967         * Shared/win/NativeWebKeyboardEventWin.cpp: Added.
968         (WebKit::NativeWebKeyboardEvent::NativeWebKeyboardEvent):
969         The constructor creates a WebKeyboardEvent and stores the native
970         event.
971
972         * UIProcess/API/C/WKNativeEvent.h: Added.
973
974         * UIProcess/API/C/WKPage.h: Added WKPageDidNotHandleKeyEventCallback
975         and WKPageUIClient::didNotHandleKeyEvent.
976
977         * UIProcess/API/mac/WKView.mm:
978         (-[WKView keyUp:]):
979         (-[WKView keyDown:]):
980         * UIProcess/win/WebView.cpp:
981         (WebKit::WebView::onKeyEvent):
982         * UIProcess/API/qt/qwkpage.cpp:
983         (QWKPagePrivate::keyPressEvent):
984         (QWKPagePrivate::keyReleaseEvent):
985         Changed to use NativeWebKeyboardEvent.
986
987         (QWKPage::QWKPage): Updated for addition of didNotHandleKeyEvent.
988
989         * UIProcess/WebPageProxy.cpp:
990         (WebKit::WebPageProxy::handleKeyboardEvent): Changed to take a
991         NativeWebKeyboardEvent and to add it to m_keyEventQueue.
992         (WebKit::WebPageProxy::didReceiveMessage): Changed to expect a boolean
993         parameter in WebPageProxyMessage::DidReceiveEvent.
994         (WebKit::WebPageProxy::didReceiveEvent): Added a boolean "handled"
995         parameter. If the event was a keyboard event, we remove it from
996         m_keyEventQueue, and if it wasn't handled by WebCore, we tell the UI
997         client.
998
999         * UIProcess/WebPageProxy.h: Added m_keyEventQueue.
1000
1001         * UIProcess/WebUIClient.cpp:
1002         (WebKit::WebUIClient::didNotHandleKeyEvent):
1003         * UIProcess/WebUIClient.h:
1004         Added. Just calls through to the WKPageUIClient.
1005
1006         * WebProcess/WebPage/WebPage.cpp:
1007         (WebKit::handleMouseEvent):
1008         (WebKit::WebPage::mouseEvent):
1009         (WebKit::handleWheelEvent):
1010         (WebKit::WebPage::wheelEvent):
1011         (WebKit::handleKeyEvent):
1012         (WebKit::WebPage::keyEvent):
1013         (WebKit::handleTouchEvent):
1014         (WebKit::WebPage::touchEvent):
1015         Moved code from the *Event functions into new helper handle*Event
1016         functions, and changed to pass a boolean to
1017         WebPageProxyMessage::DidReceiveEvent signaling whether the event was
1018         handled or not.
1019
1020         * WebKit2.pro:
1021         * WebKit2.xcodeproj/project.pbxproj:
1022         * win/WebKit2.vcproj:
1023         * win/WebKit2Generated.make:
1024         Added WKNativeEvent.h and NativeWebKeyboardEvent.
1025
1026 2010-09-28  Anders Carlsson  <andersca@apple.com>
1027
1028         Reviewed by Adam Roben.
1029
1030         Implement PluginProxy::destroy
1031         https://bugs.webkit.org/show_bug.cgi?id=46737
1032
1033         * Platform/CoreIPC/HandleMessage.h:
1034         (CoreIPC::handleMessage):
1035         Add overload for a sync message with one in parameter and no out parameters.
1036
1037         * PluginProcess/WebProcessConnection.cpp:
1038         (WebKit::WebProcessConnection::destroyPluginControllerProxy):
1039         Rename this to avoid conflicts with the destroyPlugin message handler.
1040
1041         (WebKit::WebProcessConnection::destroyPlugin):
1042         Call destroyPluginControllerProxy.
1043
1044         * PluginProcess/WebProcessConnection.messages.in:
1045         Add DestroyPlugin message.
1046
1047         * WebProcess/Plugins/PluginProcessConnection.cpp:
1048         (WebKit::PluginProcessConnection::didClose):
1049         
1050         * WebProcess/Plugins/PluginProxy.cpp:
1051         (WebKit::PluginProxy::PluginProxy):
1052         (WebKit::PluginProxy::~PluginProxy):
1053         Don't add and/the plug-in proxy from the map in the constructor/destructor. Instead,
1054         do it in initialize/destroy, since otherwise we could be calling pluginProcessCrashed on a
1055         PluginController that had already been freed.
1056
1057         (WebKit::PluginProxy::initialize):
1058         (WebKit::PluginProxy::destroy):
1059         send the DestroyPlugin message.
1060
1061 2010-09-28  Anders Carlsson  <andersca@apple.com>
1062
1063         Reviewed by Adam Roben.
1064
1065         Improve plug-in process lifecycle handling
1066         https://bugs.webkit.org/show_bug.cgi?id=46734
1067
1068         * PluginProcess/WebProcessConnection.cpp:
1069         (WebKit::WebProcessConnection::destroyPlugin):
1070         Destroy and delete the plug-in.
1071
1072         (WebKit::WebProcessConnection::didClose):
1073         Our web process crashed, go through and delete all plug-in instances.
1074
1075         * UIProcess/Plugins/PluginProcessProxy.cpp:
1076         (WebKit::PluginProcessProxy::didClose):
1077         The plug-in process crashed. Go through all pending replies and send them so the
1078         web processes won't be blocked waiting for a reply.
1079
1080         (WebKit::PluginProcessProxy::didCreateWebProcessConnection):
1081         We need to remove the pending reply connection once we've sent the reply.
1082
1083         * WebProcess/Plugins/PluginProcessConnection.cpp:
1084         (WebKit::PluginProcessConnection::didClose):
1085         The plug-in process crashed. Iterate over all proxies and let them know that the plug-in
1086         process has crashed.
1087
1088         * WebProcess/Plugins/PluginProxy.cpp:
1089         (WebKit::PluginProxy::pluginProcessCrashed):
1090         Tell our controller that the plug-in process crashed.
1091
1092         (WebKit::PluginProxy::destroy):
1093         Null out the controller.
1094
1095 2010-09-28  Anders Carlsson  <andersca@apple.com>
1096
1097         Reviewed by Adam Roben.
1098
1099         Implement PluginControllerProxy::initialize and have it create a plug-in
1100         https://bugs.webkit.org/show_bug.cgi?id=46731
1101
1102         * PluginProcess/PluginControllerProxy.cpp:
1103         (WebKit::PluginControllerProxy::initialize):
1104         Create the plug-in and try to initialize it.
1105
1106         (WebKit::PluginControllerProxy::destroy):
1107         Destroy the plug-in.
1108
1109         * PluginProcess/WebProcessConnection.cpp:
1110         (WebKit::WebProcessConnection::addPluginControllerProxy):
1111         Add the given plug-in controller proxy to the map and assume ownership of it.
1112
1113         (WebKit::WebProcessConnection::removePluginControllerProxy):
1114         Remove the given plug-in controller proxy from the map and delete it.
1115
1116         (WebKit::WebProcessConnection::createPlugin):
1117         Create a plug-in controller proxy and try to initialize it.
1118
1119 2010-09-28  Anders Carlsson  <andersca@apple.com>
1120
1121         Reviewed by Adam Roben.
1122
1123         Add PluginControllerProxy class
1124         https://bugs.webkit.org/show_bug.cgi?id=46728
1125
1126         * PluginProcess/PluginControllerProxy.cpp: Added.
1127         * PluginProcess/PluginControllerProxy.h: Added.
1128         Add stubbed out PluginControllerProxy class.
1129         
1130         * PluginProcess/WebProcessConnection.cpp:
1131         (WebKit::WebProcessConnection::~WebProcessConnection):
1132         Assert that we don't have any live plug-in controller proxies.
1133
1134         (WebKit::WebProcessConnection::addPluginControllerProxy):
1135         Add the plug-in controller proxy to the map.
1136                 
1137         (WebKit::WebProcessConnection::removePluginControllerProxy):
1138         Remove the plug-in controller proxy from the map. If the last plug-in controller
1139         proxy went away, invalidate the connection.
1140         
1141         * WebKit2.xcodeproj/project.pbxproj:
1142         Add files.
1143
1144 2010-09-28  Adam Roben  <aroben@apple.com>
1145
1146         Don't call NPP_SetWindow until the plugin's HWND has been
1147         sized/positioned
1148
1149         Test: platform/win/plugins/window-geometry-initialized-before-set-window.html
1150
1151         Reviewed by Anders Carlsson.
1152
1153         Fixes <http://webkit.org/b/46716> <rdar://problem/8482014> Full-page
1154         Adobe Reader does not paint until window is resized
1155
1156         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
1157         (WebKit::NetscapePlugin::geometryDidChange): Call NPP_SetWindow after
1158         updating the platform (HWND) geometry.
1159
1160 2010-09-28  Anders Carlsson  <andersca@apple.com>
1161
1162         Out of process plug-ins shouldn't be turned on just yet...
1163
1164         * WebKit2Prefix.h:
1165
1166 2010-09-28  Andras Becsi  <abecsi@webkit.org>
1167
1168         Reviewed by Kenneth Rohde Christiansen.
1169
1170         [Qt] ProcessLauncherHelper should not leave stray socket files in /tmp.
1171         https://bugs.webkit.org/show_bug.cgi?id=46722
1172
1173         * UIProcess/Launcher/qt/ProcessLauncherQt.cpp:
1174         (WebKit::ProcessLauncherHelper::~ProcessLauncherHelper): close the socket.
1175         (WebKit::ProcessLauncherHelper::ProcessLauncherHelper): delete the helper on exit.
1176
1177 2010-09-28  Benjamin Poulain  <benjamin.poulain@nokia.com>
1178
1179         Reviewed by Andreas Kling.
1180
1181         [Qt] Remove support for Qt 4.5
1182         https://bugs.webkit.org/show_bug.cgi?id=46718
1183
1184         Remove the code for versions of Qt prior to 4.6.
1185
1186         * UIProcess/API/qt/qgraphicswkview.cpp:
1187         (QGraphicsWKView::event):
1188         * UIProcess/API/qt/qwkpage.cpp:
1189         * UIProcess/API/qt/qwkpage_p.h:
1190
1191 2010-09-28  Andras Becsi  <abecsi@webkit.org>
1192
1193         Reviewed by Csaba Osztrogonác.
1194
1195         [Qt] Fix generation of WebPageMessages.h and WebPageMessageReceiver.cpp
1196         to avoid rebuilding them every time.
1197
1198         * DerivedSources.pro: add target to extra compilers.
1199
1200 2010-09-27  Brady Eidson  <beidson@apple.com>
1201
1202         Reviewed by Sam Weinig.
1203
1204         https://bugs.webkit.org/show_bug.cgi?id=46688 - Add an API to get the WKBackForwardItem at an arbitrary index.
1205
1206         * UIProcess/API/C/WKBackForwardList.cpp:
1207         (WKBackForwardListGetItemAtIndex):
1208         * UIProcess/API/C/WKBackForwardList.h:
1209
1210 2010-09-27  Anders Carlsson  <andersca@apple.com>
1211
1212         Turns out people other than me might want to build this thing.
1213
1214         * WebKit2.xcodeproj/project.pbxproj:
1215
1216 2010-09-27  Darin Adler  <darin@apple.com>
1217
1218         * Scripts/webkit2: Added property svn:ignore.
1219
1220 2010-09-27  Anders Carlsson  <andersca@apple.com>
1221
1222         Reviewed by Sam Weinig.
1223
1224         * Platform/CoreIPC/Connection.h:
1225         (CoreIPC::Connection::sendSync):
1226         Add new sendSync overload that takes a message struct.
1227
1228         * PluginProcess/WebProcessConnection.cpp:
1229         (WebKit::WebProcessConnection::didReceiveSyncMessage):
1230         Call didReceiveSyncWebProcessConnectionMessage.
1231         
1232         * WebProcess/Plugins/PluginProcessConnection.cpp:
1233         (WebKit::PluginProcessConnection::addPluginProxy):
1234         Add the plug-in proxy to the map.
1235
1236         (WebKit::PluginProcessConnection::removePluginProxy):
1237         Remove the plug-in proxy from the map. If the map is empty, disconnect from the
1238         plug-in process.
1239
1240         * WebProcess/Plugins/PluginProxy.cpp:
1241         (WebKit::generatePluginInstanceID):
1242         Generate a unique plug-in instance ID.
1243
1244         (WebKit::PluginProxy::PluginProxy):
1245         Add the plug-in proxy to the map.
1246         
1247         (WebKit::PluginProxy::~PluginProxy):
1248         Remove the plug-in proxy from the map.
1249
1250         (WebKit::PluginProxy::initialize):
1251         Ask the plug-in process to create a plug-in.
1252
1253 2010-09-27  Sam Weinig  <sam@webkit.org>
1254
1255         Reviewed by Anders Carlsson.
1256
1257         Add remaining event handlers to WKView.
1258
1259         Also fixes <rdar://problem/8467058>
1260         Does not get decidePolicyForNavigationAction callback when middle clicking a link
1261
1262         - Adds otherButton and rightButton NSResponder event handlers to WKView.
1263         - Renames WebPageProxy event handlers to use the handle prefix.
1264         - Uses a macro to reduce duplicate code for WKView event handlers.
1265         - Add view parameter to WebEventFactory::createWebKeyboardEvent on the mac
1266           for uniformity.
1267
1268         * Shared/mac/WebEventFactory.h:
1269         * Shared/mac/WebEventFactory.mm:
1270         (WebKit::WebEventFactory::createWebKeyboardEvent):
1271         * UIProcess/API/mac/WKView.mm:
1272         * UIProcess/API/qt/qwkpage.cpp:
1273         (QWKPagePrivate::keyPressEvent):
1274         (QWKPagePrivate::keyReleaseEvent):
1275         (QWKPagePrivate::mouseMoveEvent):
1276         (QWKPagePrivate::mousePressEvent):
1277         (QWKPagePrivate::mouseReleaseEvent):
1278         (QWKPagePrivate::mouseDoubleClickEvent):
1279         (QWKPagePrivate::wheelEvent):
1280         (QWKPagePrivate::touchEvent):
1281         * UIProcess/WebPageProxy.cpp:
1282         (WebKit::WebPageProxy::handleMouseEvent):
1283         (WebKit::WebPageProxy::handleWheelEvent):
1284         (WebKit::WebPageProxy::handleKeyboardEvent):
1285         (WebKit::WebPageProxy::handleTouchEvent):
1286         * UIProcess/WebPageProxy.h:
1287         * UIProcess/win/WebView.cpp:
1288         (WebKit::WebView::onMouseEvent):
1289         (WebKit::WebView::onWheelEvent):
1290         (WebKit::WebView::onKeyEvent):
1291
1292 2010-09-27  Ivan Krstić  <ike@apple.com>
1293
1294         Reviewed by Mark Rowe.
1295
1296         <rdar://problem/8348990> / <http://webkit.org/b/46633> Make it possible to disable sandboxing of
1297         web process via runtime flag.
1298
1299         Enable sandboxing of the web process only if the DisableSandbox user default is not set for the
1300         web process.
1301
1302         * WebProcess/mac/WebProcessMainMac.mm:
1303         (WebKit::WebProcessMain):
1304
1305 2010-09-27  Anders Carlsson  <andersca@apple.com>
1306
1307         Reviewed by Adam Roben.
1308
1309         Add WebProcessConnection CreatePlugin message
1310         https://bugs.webkit.org/show_bug.cgi?id=46668
1311
1312         * DerivedSources.make:
1313         Add WebProcessConnection.
1314
1315         * Platform/CoreIPC/HandleMessage.h:
1316         Add handleMessage overload for a sync message with two input parameters
1317         and one output parameter.
1318
1319         (CoreIPC::handleMessage):
1320         * Platform/CoreIPC/MessageID.h:
1321         Add MessageClassWebProcessConnection.
1322
1323         * PluginProcess/WebProcessConnection.cpp:
1324         (WebKit::WebProcessConnection::createPlugin):
1325         Add stub.
1326
1327         * PluginProcess/WebProcessConnection.messages.in: Added.
1328         * Scripts/webkit2/messages.py:
1329         Include headers directly for types that we believe are nested structs.
1330
1331         * Scripts/webkit2/messages_unittest.py:
1332         Update expected results.
1333
1334         * WebKit2.xcodeproj/project.pbxproj:
1335         Add new files.
1336
1337 2010-09-27  Anders Carlsson  <andersca@apple.com>
1338
1339         Reviewed by Adam Roben.
1340
1341         Add support for autogenerating synchronous message handlers
1342         https://bugs.webkit.org/show_bug.cgi?id=46654
1343
1344         * Scripts/webkit2/messages.py:
1345         (reply_type): Renamed from reply_base_class.
1346         (delayed_reply_type): Renamed from delayed_reply_base_class.
1347         (message_to_struct_declaration): Add a Reply type typedef.
1348         (async_case_statement): Rename from case_statement.
1349         (generate_message_handler): Generate a sync message handler as well.
1350
1351         * Scripts/webkit2/messages_unittest.py:
1352         Update expected results.
1353
1354 2010-09-27  Andras Becsi  <abecsi@webkit.org>
1355
1356         Reviewed by Csaba Osztrogonác.
1357
1358         [Qt] Make generate-forwarding-headers.pl aware of moved headers
1359         https://bugs.webkit.org/show_bug.cgi?id=46621
1360
1361         * generate-forwarding-headers.pl:
1362
1363 2010-09-27  Sam Weinig  <sam@webkit.org>
1364
1365         Reviewed by Anders Carlsson.
1366
1367         The mouseDidMoveOverElement callback in the injected bundle should include modifier info
1368         https://bugs.webkit.org/show_bug.cgi?id=46629
1369
1370         - Moves event related API enums to WKEvent.h which can be shared between
1371           both the bundle and the main API.
1372
1373         * Shared/API/c/WKEvent.h: Added.
1374         * Shared/API/c/WKSharedAPICast.h:
1375         (WebKit::toRef):
1376         * UIProcess/API/C/WKAPICast.h:
1377         * UIProcess/API/C/WKPage.h:
1378         * WebKit2.xcodeproj/project.pbxproj:
1379         * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
1380         * WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp:
1381         (WebKit::InjectedBundlePageUIClient::mouseDidMoveOverElement):
1382         * WebProcess/InjectedBundle/InjectedBundlePageUIClient.h:
1383         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1384         (WebKit::WebChromeClient::mouseDidMoveOverElement):
1385         * win/WebKit2.vcproj:
1386         * win/WebKit2Generated.make:
1387
1388 2010-09-27  Adam Roben  <aroben@apple.com>
1389
1390         Give mouse wheel events the right coordinates on Windows
1391
1392         Fixes <http://webkit.org/b/46625> <rdar://problem/8481161> Placing
1393         mouse cursor inside a scrollable area and scrolling the mouse wheel
1394         generally doesn't scroll the area
1395
1396         Reviewed by Sam Weinig.
1397
1398         * Shared/win/WebEventFactory.cpp:
1399         (WebKit::point): Renamed from positionForEvent. The old name implied
1400         that all events used the same relative origin, which is untrue.
1401         (WebKit::WebEventFactory::createWebMouseEvent): Changed to use point
1402         and ::ClientToScreen explicitly rather than relying on
1403         positionForEvent/globalPositionForEvent.
1404         (WebKit::WebEventFactory::createWebWheelEvent): Changed to use point
1405         and ::ScreenToClient. The old code was assuming that wheel event
1406         points are relative to the client area, but they are in fact relative
1407         to the screen.
1408
1409 2010-09-27  Sam Weinig  <sam@webkit.org>
1410
1411         Reviewed by Adam Roben.
1412
1413         Opening links in a new window asserts while decoding decidePolicyForNewWindowAction.
1414         <rdar://problem/8479445>
1415         https://bugs.webkit.org/show_bug.cgi?id=46623
1416
1417         * UIProcess/WebPageProxy.cpp:
1418         (WebKit::WebPageProxy::didReceiveMessage): Fix the order of decoding to
1419         match the order of encoding. (Swapping url and mouseButton).
1420
1421 2010-09-27  Adam Roben  <aroben@apple.com>
1422
1423         Stop leaking the web process's process handle on Windows
1424
1425         Fixes <http://webkit.org/b/46133> <rdar://problem/8455343>
1426
1427         Reviewed by Anders Carlsson.
1428
1429         * UIProcess/Launcher/ProcessLauncher.cpp:
1430         (WebKit::ProcessLauncher::invalidate): Call platformInvalidate.
1431
1432         * UIProcess/Launcher/ProcessLauncher.h: Added platformInvalidate.
1433
1434         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
1435         (WebKit::ProcessLauncher::platformInvalidate):
1436         * UIProcess/Launcher/qt/ProcessLauncherQt.cpp:
1437         (WebKit::ProcessLauncher::platformInvalidate):
1438         Stubbed out.
1439
1440         * UIProcess/Launcher/win/ProcessLauncherWin.cpp:
1441         (WebKit::ProcessLauncher::platformInvalidate): Close the process
1442         handle like MSDN says we should.
1443
1444 2010-09-27  Adam Roben  <aroben@apple.com>
1445
1446         Don't double-free CERT_CONTEXTs when copying PlatformCertificateInfos
1447         on Windows
1448
1449         Fixes <http://webkit.org/b/46536> <rdar://problem/8477292> REGRESSION
1450         (r68260): Crash in PlatformCertificateInfo::~PlatformCertificateInfo
1451         when navigating away from Gmail
1452
1453         Reviewed by Sam Weinig.
1454
1455         * Shared/win/PlatformCertificateInfo.cpp:
1456         (WebKit::PlatformCertificateInfo::PlatformCertificateInfo):
1457         (WebKit::PlatformCertificateInfo::operator=):
1458         * Shared/win/PlatformCertificateInfo.h:
1459         Added a copy constructor and assigment operator to handle correctly
1460         reffing/dereffing the CERT_CONTEXTs when copying a
1461         PlatformCertificateInfo.
1462
1463 2010-09-26  Sam Weinig  <sam@webkit.org>
1464
1465         Reviewed by Simon Fraser.
1466
1467         MiniBrowser crashes when opening main menu item
1468         https://bugs.webkit.org/show_bug.cgi?id=46588
1469
1470         * UIProcess/API/mac/PageClientImpl.mm:
1471         (WebKit::PageClientImpl::setEditCommandState): Don't allow default
1472         String -> NSString conversion to take place, and use the increasingly
1473         misnamed nsStringFromWebCoreString instead.
1474
1475 2010-09-26  Sam Weinig  <sam@webkit.org>
1476
1477         Another windows build fix windows attempt.
1478
1479         * win/WebKit2Common.vsprops:
1480
1481 2010-09-26  Sam Weinig  <sam@webkit.org>
1482
1483         Another windows build fix windows attempt.
1484
1485         * win/WebKit2Generated.make:
1486
1487 2010-09-26  Sam Weinig  <sam@webkit.org>
1488
1489         Attempt to fix windows build.
1490
1491         * win/WebKit2Common.vsprops:
1492
1493 2010-09-26  Sam Weinig  <sam@webkit.org>
1494
1495         Attempt to fix Qt build.
1496
1497         * WebKit2.pro:
1498
1499 2010-09-26  Sam Weinig  <sam@webkit.org>
1500
1501         Reviewed by Anders Carlsson.
1502
1503         Move shared WebKit2 API (used by both bundle and main API) to WebKit2/Shared/API
1504         https://bugs.webkit.org/show_bug.cgi?id=46587
1505
1506         - Moves shared types (WKArrayRef, WKDictionaryRef, etc) to Shared/API/c.
1507         - Removes WKBundleBase.h and moves all opaque type declarations to WKBase.h (which
1508           moves to Shared/API/c).
1509         - Adds WKSharedAPICast.h which includes shared API casting logic and is included
1510           by both WKAPICast.h and WKBundleAPICast.h now. Moved to using macros for API 
1511           mappings to reduce verbosity.
1512         - Move windows c API files from UIProcess/API/win to UIProcess/API/C/win.
1513
1514         * Shared/API: Added.
1515         * Shared/API/c: Added.
1516         * Shared/API/c/WKArray.cpp: Copied from UIProcess/API/C/WKArray.cpp.
1517         * Shared/API/c/WKArray.h: Copied from UIProcess/API/C/WKArray.h.
1518         * Shared/API/c/WKBase.h: Copied from UIProcess/API/C/WKBase.h.
1519         * Shared/API/c/WKCertificateInfo.cpp: Copied from UIProcess/API/C/WKCertificateInfo.cpp.
1520         * Shared/API/c/WKCertificateInfo.h: Copied from UIProcess/API/C/WKCertificateInfo.h.
1521         * Shared/API/c/WKData.cpp: Copied from UIProcess/API/C/WKData.cpp.
1522         * Shared/API/c/WKData.h: Copied from UIProcess/API/C/WKData.h.
1523         * Shared/API/c/WKDictionary.cpp: Copied from UIProcess/API/C/WKDictionary.cpp.
1524         * Shared/API/c/WKDictionary.h: Copied from UIProcess/API/C/WKDictionary.h.
1525         * Shared/API/c/WKError.cpp: Copied from UIProcess/API/C/WKError.cpp.
1526         * Shared/API/c/WKError.h: Copied from UIProcess/API/C/WKError.h.
1527         * Shared/API/c/WKMutableArray.cpp: Copied from UIProcess/API/C/WKMutableArray.cpp.
1528         * Shared/API/c/WKMutableArray.h: Copied from UIProcess/API/C/WKMutableArray.h.
1529         * Shared/API/c/WKMutableDictionary.cpp: Copied from UIProcess/API/C/WKMutableDictionary.cpp.
1530         * Shared/API/c/WKMutableDictionary.h: Copied from UIProcess/API/C/WKMutableDictionary.h.
1531         * Shared/API/c/WKNumber.cpp: Copied from UIProcess/API/C/WKNumber.cpp.
1532         * Shared/API/c/WKNumber.h: Copied from UIProcess/API/C/WKNumber.h.
1533         * Shared/API/c/WKSerializedScriptValue.cpp: Copied from UIProcess/API/C/WKSerializedScriptValue.cpp.
1534         * Shared/API/c/WKSerializedScriptValue.h: Copied from UIProcess/API/C/WKSerializedScriptValue.h.
1535         * Shared/API/c/WKSharedAPICast.h: Copied from UIProcess/API/C/WKAPICast.h.
1536         * Shared/API/c/WKString.cpp: Copied from UIProcess/API/C/WKString.cpp.
1537         * Shared/API/c/WKString.h: Copied from UIProcess/API/C/WKString.h.
1538         * Shared/API/c/WKType.cpp: Copied from UIProcess/API/C/WKType.cpp.
1539         * Shared/API/c/WKType.h: Copied from UIProcess/API/C/WKType.h.
1540         * Shared/API/c/WKURL.cpp: Copied from UIProcess/API/C/WKURL.cpp.
1541         * Shared/API/c/WKURL.h: Copied from UIProcess/API/C/WKURL.h.
1542         * Shared/API/c/WKURLRequest.cpp: Copied from UIProcess/API/C/WKURLRequest.cpp.
1543         * Shared/API/c/WKURLRequest.h: Copied from UIProcess/API/C/WKURLRequest.h.
1544         * Shared/API/c/WKURLResponse.cpp: Copied from UIProcess/API/C/WKURLResponse.cpp.
1545         * Shared/API/c/WKURLResponse.h: Copied from UIProcess/API/C/WKURLResponse.h.
1546         * Shared/API/c/cf: Copied from UIProcess/API/C/cf.
1547         * Shared/API/c/mac: Copied from UIProcess/API/C/mac.
1548         * Shared/API/c/win: Added.
1549         * Shared/API/c/win/WKBaseWin.h: Copied from UIProcess/API/win/WKBaseWin.h.
1550         * Shared/API/c/win/WKCertificateInfoWin.cpp: Copied from UIProcess/API/C/win/WKCertificateInfoWin.cpp.
1551         * Shared/API/c/win/WKCertificateInfoWin.h: Copied from UIProcess/API/C/win/WKCertificateInfoWin.h.
1552         * UIProcess/API/C/WKAPICast.h: Replaced.
1553         * UIProcess/API/C/WKArray.cpp: Removed.
1554         * UIProcess/API/C/WKArray.h: Removed.
1555         * UIProcess/API/C/WKBase.h: Removed.
1556         * UIProcess/API/C/WKCertificateInfo.cpp: Removed.
1557         * UIProcess/API/C/WKCertificateInfo.h: Removed.
1558         * UIProcess/API/C/WKData.cpp: Removed.
1559         * UIProcess/API/C/WKData.h: Removed.
1560         * UIProcess/API/C/WKDictionary.cpp: Removed.
1561         * UIProcess/API/C/WKDictionary.h: Removed.
1562         * UIProcess/API/C/WKError.cpp: Removed.
1563         * UIProcess/API/C/WKError.h: Removed.
1564         * UIProcess/API/C/WKMutableArray.cpp: Removed.
1565         * UIProcess/API/C/WKMutableArray.h: Removed.
1566         * UIProcess/API/C/WKMutableDictionary.cpp: Removed.
1567         * UIProcess/API/C/WKMutableDictionary.h: Removed.
1568         * UIProcess/API/C/WKNumber.cpp: Removed.
1569         * UIProcess/API/C/WKNumber.h: Removed.
1570         * UIProcess/API/C/WKSerializedScriptValue.cpp: Removed.
1571         * UIProcess/API/C/WKSerializedScriptValue.h: Removed.
1572         * UIProcess/API/C/WKString.cpp: Removed.
1573         * UIProcess/API/C/WKString.h: Removed.
1574         * UIProcess/API/C/WKType.cpp: Removed.
1575         * UIProcess/API/C/WKType.h: Removed.
1576         * UIProcess/API/C/WKURL.cpp: Removed.
1577         * UIProcess/API/C/WKURL.h: Removed.
1578         * UIProcess/API/C/WKURLRequest.cpp: Removed.
1579         * UIProcess/API/C/WKURLRequest.h: Removed.
1580         * UIProcess/API/C/WKURLResponse.cpp: Removed.
1581         * UIProcess/API/C/WKURLResponse.h: Removed.
1582         * UIProcess/API/C/cf: Removed.
1583         * UIProcess/API/C/cf/WKStringCF.cpp: Removed.
1584         * UIProcess/API/C/cf/WKStringCF.h: Removed.
1585         * UIProcess/API/C/cf/WKURLCF.cpp: Removed.
1586         * UIProcess/API/C/cf/WKURLCF.h: Removed.
1587         * UIProcess/API/C/cf/WKURLRequestCF.cpp: Removed.
1588         * UIProcess/API/C/cf/WKURLRequestCF.h: Removed.
1589         * UIProcess/API/C/cf/WKURLResponseCF.cpp: Removed.
1590         * UIProcess/API/C/cf/WKURLResponseCF.h: Removed.
1591         * UIProcess/API/C/mac: Removed.
1592         * UIProcess/API/C/mac/WKCertificateInfoMac.h: Removed.
1593         * UIProcess/API/C/mac/WKCertificateInfoMac.mm: Removed.
1594         * UIProcess/API/C/mac/WKURLRequestNS.h: Removed.
1595         * UIProcess/API/C/mac/WKURLRequestNS.mm: Removed.
1596         * UIProcess/API/C/mac/WKURLResponseNS.h: Removed.
1597         * UIProcess/API/C/mac/WKURLResponseNS.mm: Removed.
1598         * UIProcess/API/C/win/WKAPICastWin.h: Copied from UIProcess/API/win/WKAPICastWin.h.
1599         * UIProcess/API/C/win/WKBaseWin.h: Copied from UIProcess/API/win/WKBaseWin.h.
1600         * UIProcess/API/C/win/WKCertificateInfoWin.cpp: Removed.
1601         * UIProcess/API/C/win/WKCertificateInfoWin.h: Removed.
1602         * UIProcess/API/C/win/WKView.cpp: Copied from UIProcess/API/win/WKView.cpp.
1603         * UIProcess/API/C/win/WKView.h: Copied from UIProcess/API/win/WKView.h.
1604         * UIProcess/API/win: Removed.
1605         * UIProcess/API/win/WKAPICastWin.h: Removed.
1606         * UIProcess/API/win/WKBaseWin.h: Removed.
1607         * UIProcess/API/win/WKView.cpp: Removed.
1608         * UIProcess/API/win/WKView.h: Removed.
1609         * WebKit2.pro:
1610         * WebKit2.xcodeproj/project.pbxproj:
1611         * WebProcess/InjectedBundle/API/c/WKBundle.h:
1612         * WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
1613         * WebProcess/InjectedBundle/API/c/WKBundleBase.h: Removed.
1614         * WebProcess/InjectedBundle/API/c/WKBundleFrame.h:
1615         * WebProcess/InjectedBundle/API/c/WKBundleFramePrivate.h:
1616         * WebProcess/InjectedBundle/API/c/WKBundleHitTestResult.h:
1617         * WebProcess/InjectedBundle/API/c/WKBundleInitialize.h:
1618         * WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.h:
1619         * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
1620         * WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h:
1621         * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
1622         * WebProcess/InjectedBundle/API/c/WKBundleRangeHandle.h:
1623         * WebProcess/InjectedBundle/API/c/WKBundleScriptWorld.h:
1624         * win/WebKit2.vcproj:
1625         * win/WebKit2Generated.make:
1626
1627 2010-09-26  Anders Carlsson  <andersca@apple.com>
1628
1629         Fix non-Mac builds.
1630
1631         * Platform/SharedMemory.h:
1632         * Platform/mac/SharedMemoryMac.cpp:
1633         (WebKit::SharedMemory::Handle::isNull):
1634
1635 2010-09-26  Anders Carlsson  <andersca@apple.com>
1636
1637         Reviewed by Sam Weinig.
1638
1639         Add PluginProxy class
1640         https://bugs.webkit.org/show_bug.cgi?id=46586
1641
1642         * WebKit2.xcodeproj/project.pbxproj:
1643         Add files.
1644
1645         * WebProcess/Plugins/PluginProxy.cpp: Added.
1646         * WebProcess/Plugins/PluginProxy.h: Added.
1647
1648         * WebProcess/WebPage/WebPage.cpp:
1649         (WebKit::WebPage::createPlugin):
1650         Create a PluginProxy wrapper.
1651
1652 2010-09-26  Anders Carlsson  <andersca@apple.com>
1653
1654         Reviewed by Sam Weinig.
1655
1656         Make it possible to encode null SharedMemory::Handle objects
1657         https://bugs.webkit.org/show_bug.cgi?id=46585
1658
1659         * Platform/SharedMemory.h:
1660         (WebKit::SharedMemory::Handle::isNull):
1661         Add isNull.
1662
1663         * Platform/mac/SharedMemoryMac.cpp:
1664         (WebKit::SharedMemory::Handle::encode):
1665         Remove asserts.
1666
1667         (WebKit::SharedMemory::create):
1668         Bail if we see a null handle. Also work around a kernel bug where
1669         mach_vm_map fails if the given address to map is already mapped, even if
1670         VM_FLAG_ANYWHERE is set.
1671
1672 2010-09-26  Anders Carlsson  <andersca@apple.com>
1673
1674         Reviewed by Sam Weinig.
1675
1676         Add BackingStore class
1677         https://bugs.webkit.org/show_bug.cgi?id=46584
1678
1679         * Shared/BackingStore.cpp: Added.
1680         (WebKit::BackingStore::create):
1681         Create a backing store backed by fastMalloc memory.
1682
1683         (WebKit::BackingStore::createSharable):
1684         Create a backing store backed by shared memory.
1685
1686         (WebKit::BackingStore::createHandle):
1687         Create a handle that can be sent over the wire.
1688
1689         (WebKit::BackingStore::resize):
1690         Resize the backing store memory.
1691
1692         (WebKit::BackingStore::data):
1693         Return the backing store data.
1694
1695         * Shared/mac/BackingStoreMac.mm: Added.
1696         (WebKit::BackingStore::createGraphicsContext):
1697         Create a graphics context that will paint into the backing store.
1698
1699         (WebKit::BackingStore::paint):
1700         Paint the backing store in a graphics context.
1701
1702         * WebKit2.xcodeproj/project.pbxproj:
1703         Add files.
1704
1705 2010-09-26  Anders Carlsson  <andersca@apple.com>
1706
1707         Reviewed by Sam Weinig.
1708
1709         Establish a connection between the plug-in process and the web process
1710         https://bugs.webkit.org/show_bug.cgi?id=46583
1711
1712         * PluginProcess/PluginProcess.cpp:
1713         (WebKit::PluginProcess::didReceiveMessage):
1714         Call the auto-generated didReceivePluginProcessMessage.
1715
1716         * PluginProcess/PluginProcess.h:
1717         Add didReceivePluginProcessMessage declaration.
1718
1719         * PluginProcess/PluginProcess.messages.in:
1720         Add new "CreateWebProcessConnection" message.
1721
1722         * PluginProcess/WebProcessConnection.cpp:
1723         (WebKit::WebProcessConnection::didReceiveMessage):
1724         (WebKit::WebProcessConnection::didReceiveSyncMessage):
1725         (WebKit::WebProcessConnection::didClose):
1726         (WebKit::WebProcessConnection::didReceiveInvalidMessage):
1727         Add stubbed out member functions.
1728
1729         * UIProcess/Plugins/PluginProcessManager.cpp:
1730         (WebKit::PluginProcessManager::getPluginProcessConnection):
1731         Ask the plug-in process proxy to create a connection.
1732
1733         * UIProcess/Plugins/PluginProcessProxy.cpp:
1734         (WebKit::PluginProcessProxy::createWebProcessConnection):
1735         Add the WebProcessProxy and the reply encoder to the queue of pending replies.
1736         If the process is still launching, keep track of how many pending requests we have, otherwise
1737         just send the request.
1738
1739         (WebKit::PluginProcessProxy::didReceiveMessage):
1740         Call the auto-generated didReceivePluginProcessMessage.
1741
1742         (WebKit::PluginProcessProxy::didFinishLaunching):
1743         Send all pending connection requests.
1744
1745         (WebKit::PluginProcessProxy::didCreateWebProcessConnection):
1746         Get the first pending reply and send it with the mach port.
1747
1748         * WebKit2.xcodeproj/project.pbxproj:
1749         Actually compile PluginProcessMessageReceiver.
1750
1751         * WebProcess/Plugins/PluginProcessConnection.cpp:
1752         (WebKit::PluginProcessConnection::PluginProcessConnection):
1753         Create a CoreIPC connection.
1754
1755         (WebKit::PluginProcessConnection::didReceiveMessage):
1756         (WebKit::PluginProcessConnection::didClose):
1757         (WebKit::PluginProcessConnection::didReceiveInvalidMessage):
1758         Add stubbed out member functions.
1759
1760         * WebProcess/WebPage/WebPage.cpp:
1761         (WebKit::WebPage::createPlugin):
1762         Ask the plug-in process connection manager for a connection.
1763
1764 2010-09-26  Anders Carlsson  <andersca@apple.com>
1765
1766         Reviewed by Sam Weinig.
1767
1768         Generated message handlers should include argument coder headers for some types
1769         https://bugs.webkit.org/show_bug.cgi?id=46582
1770
1771         * Scripts/webkit2/messages.py:
1772         When determining which headers to use when generating a message handler, consider the
1773         argument coder headers.
1774
1775         * Scripts/webkit2/messages_unittest.py:
1776         Update test result.
1777
1778 2010-09-24  Sam Weinig  <sam@webkit.org>
1779
1780         Fix release build.
1781
1782         * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
1783
1784 2010-09-24  Enrica Casucci  <enrica@apple.com>
1785
1786         One more build fix.
1787
1788         * UIProcess/API/qt/qwkpage.cpp:
1789         (QWKPagePrivate::setEditCommandState):
1790
1791 2010-09-24  Sam Weinig  <sam@webkit.org>
1792
1793         Reviewed by Darin Adler.
1794
1795         Implement WebKit2 callback equivalent to -[WebUIDelegate mouseDidMoveOverElement:modifierFlags:]
1796         <rdar://problem/8359279>
1797         https://bugs.webkit.org/show_bug.cgi?id=46546
1798
1799         - Adds new WKBundleHitTestResultRef object to represent a content under a cursor.
1800         - Adds new Bundle and UI level mouseDidMoveOverElement UIClient callbacks, with
1801           pass through userData to communicate context up to the UIProcess
1802
1803         * Shared/APIObject.h:
1804         * Shared/CoreIPCSupport/WebPageProxyMessageKinds.h:
1805         * UIProcess/API/C/WKPage.h:
1806         * UIProcess/API/qt/qwkpage.cpp:
1807         (QWKPage::QWKPage):
1808         * UIProcess/WebPageProxy.cpp:
1809         (WebKit::WebPageProxy::didReceiveMessage):
1810         (WebKit::WebPageProxy::mouseDidMoveOverElement):
1811         * UIProcess/WebPageProxy.h:
1812         * UIProcess/WebUIClient.cpp:
1813         (WebKit::WebUIClient::mouseDidMoveOverElement):
1814         * UIProcess/WebUIClient.h:
1815         * WebKit2.pro:
1816         * WebKit2.xcodeproj/project.pbxproj:
1817         * WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
1818         * WebProcess/InjectedBundle/API/c/WKBundleBase.h:
1819         * WebProcess/InjectedBundle/API/c/WKBundleHitTestResult.cpp: Added.
1820         (WKBundleHitTestResultGetTypeID):
1821         (WKBundleHitTestResultGetNodeHandle):
1822         (WKBundleHitTestResultGetFrame):
1823         (WKBundleHitTestResultCopyAbsoluteLinkURL):
1824         * WebProcess/InjectedBundle/API/c/WKBundleHitTestResult.h: Added.
1825         * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
1826         * WebProcess/InjectedBundle/InjectedBundleHitTestResult.cpp: Added.
1827         (WebKit::InjectedBundleHitTestResult::create):
1828         (WebKit::InjectedBundleHitTestResult::nodeHandle):
1829         (WebKit::InjectedBundleHitTestResult::webFrame):
1830         (WebKit::InjectedBundleHitTestResult::absoluteLinkURL):
1831         * WebProcess/InjectedBundle/InjectedBundleHitTestResult.h: Added.
1832         (WebKit::InjectedBundleHitTestResult::coreHitTestResult):
1833         (WebKit::InjectedBundleHitTestResult::InjectedBundleHitTestResult):
1834         (WebKit::InjectedBundleHitTestResult::type):
1835         * WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp:
1836         (WebKit::InjectedBundlePageUIClient::mouseDidMoveOverElement):
1837         * WebProcess/InjectedBundle/InjectedBundlePageUIClient.h:
1838         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1839         (WebKit::WebChromeClient::mouseDidMoveOverElement):
1840         * win/WebKit2.vcproj:
1841
1842 2010-09-24  Enrica Casucci  <enrica@apple.com>
1843
1844         Build fix.
1845
1846         * UIProcess/API/qt/qwkpage_p.h:
1847         * UIProcess/win/WebView.cpp:
1848         (WebKit::WebView::setEditCommandState):
1849         * UIProcess/win/WebView.h:
1850
1851 2010-09-24  Enrica Casucci  <enrica@apple.com>
1852
1853         Reviewed by Darin Adler.
1854
1855         Maui: Pasteboard support (42317)
1856         <rdar://problem/7660537>
1857         https://bugs.webkit.org/show_bug.cgi?id=42317
1858         
1859         This is the final piece of the pasteboard support for WebKit2.
1860         The menu validation has been hooked up for Mac. The validation is
1861         performed asynchronously and the menu entries updated while the menu
1862         is visible. I've created a generic mechanism to call editing commands
1863         that will make it easy to add new commands we will support in the future.
1864         The commands supported now are copy, cut, paste, pasteAsPlainText, delete
1865         and selectAll.
1866
1867         * Shared/CoreIPCSupport/WebPageProxyMessageKinds.h: Added DidValidateMenuItem.
1868         * UIProcess/API/mac/PageClientImpl.h: Added setEditCommandState.
1869         * UIProcess/API/mac/PageClientImpl.mm: Added setEditCommandState implementation.
1870         (WebKit::PageClientImpl::setEditCommandState): Added.
1871         * UIProcess/API/mac/WKView.mm:
1872         (WebCore::MenuItemInfo::MenuItemInfo):
1873         (-[WKView initWithFrame:pageNamespaceRef:]):
1874         (createSelectorExceptionMap): Added.
1875         (commandNameForSelector): Added.
1876         (-[WKView validateUserInterfaceItem:]): Added implementation.
1877         (-[WKView _setUserInterfaceItemState:enabled:state:]): Added.
1878         * UIProcess/API/mac/WKViewInternal.h:
1879         * UIProcess/PageClient.h:
1880         * UIProcess/WebPageProxy.cpp:
1881         (WebKit::WebPageProxy::validateMenuItem):
1882         (WebKit::WebPageProxy::executeEditCommand):
1883         (WebKit::WebPageProxy::didReceiveMessage): Now processing also
1884         DidValidateMenuItem.
1885         * UIProcess/WebPageProxy.h:
1886         * WebProcess/WebPage/WebPage.cpp:
1887         (WebKit::WebPage::executeEditingCommand): Fixed.
1888         (WebKit::WebPage::isEditingCommandEnabled): Fixed.
1889         (WebKit::WebPage::validateMenuItem): Added.
1890         (WebKit::WebPage::executeEditCommand): Added.
1891         * WebProcess/WebPage/WebPage.h: Removed cut, copy, paste, selectAll.
1892         Added validateMenuItem and executeEditCommand.
1893         * WebProcess/WebPage/WebPage.messages.in: Added new messages.
1894         * UIProcess/API/qt/qwkpage.cpp:
1895         (WebKit::QWKPage::setEditCommandState): Added.
1896         * UIProcess/API/qt/qwkpage_p.h: Added 
1897         
1898
1899 2010-09-24  Anders Carlsson  <andersca@apple.com>
1900
1901         Build fix.
1902
1903         * WebKit2.xcodeproj/project.pbxproj:
1904
1905 2010-09-24  Adam Roben  <aroben@apple.com>
1906
1907         Give windowed Netscape plugins their own window
1908
1909         The plugin window is a child of the WebView's window. The WebView's
1910         window is in the UI process, and the plugin's window is in the web
1911         process (though someday it will be in the plugin process), but Windows
1912         mostly handles this just fine. Right now we move the plugin's window
1913         in the web process, but we need to do it at paint time in the UI
1914         process instead so that the plugin windows will stay in sync with the
1915         web page's contents. There are also a whole bunch of plugin quirks
1916         that WebKit1 supports that we don't support yet, but that's a task for
1917         another day.
1918
1919         Fixes <http://webkit.org/b/44428> Get basic in-process windowed
1920         plugins working in WebKit2 on Windows
1921
1922         Reviewed by Anders Carlsson.
1923
1924         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
1925         (WebKit::NetscapePlugin::destroy):
1926         (WebKit::NetscapePlugin::geometryDidChange):
1927         Call the new platform-specific functions.
1928
1929         * WebProcess/Plugins/Netscape/NetscapePlugin.h: Added
1930         platformDestroy/platformGeometryDidChange, and an m_window member on
1931         Windows to hold our window.
1932
1933         * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
1934         (WebKit::NetscapePlugin::platformDestroy):
1935         (WebKit::NetscapePlugin::platformGeometryDidChange):
1936         * WebProcess/Plugins/Netscape/qt/NetscapePluginQt.cpp:
1937         (WebKit::NetscapePlugin::platformDestroy):
1938         (WebKit::NetscapePlugin::platformGeometryDidChange):
1939         Stubbed these out.
1940
1941         * WebProcess/Plugins/Netscape/win/NetscapePluginWin.cpp:
1942         (WebKit::registerPluginView): Added. The code came from
1943         WebCore's PluginViewWin.cpp, though I changed it to add one to
1944         COLOR_WINDOW, since that's what MSDN says we should do.
1945         (WebKit::NetscapePlugin::platformPostInitialize): If we're windowed,
1946         create a window for the plugin and make it a child of the WebView's
1947         window. If we're not windowed, just set m_window to 0.
1948         (WebKit::NetscapePlugin::platformDestroy): Destroy our window if we
1949         have one and it hasn't been destroyed already.
1950         (WebKit::NetscapePlugin::platformGeometryDidChange): Update our
1951         window's size and position.
1952
1953         * WebProcess/Plugins/PluginController.h:
1954         * WebProcess/Plugins/PluginView.cpp:
1955         (WebKit::PluginView::nativeParentWindow):
1956         * WebProcess/Plugins/PluginView.h:
1957         Added nativeParentWindow on Windows to return the WebView's window.
1958
1959 2010-09-24  Adam Roben  <aroben@apple.com>
1960
1961         Pass the WebView's HWND over to the web process
1962
1963         The HWND is packaged up in the WebPageCreationParameters and stored in
1964         the WebPage. It will eventually be used by windowed plugins.
1965
1966         Fixes <http://webkit.org/b/46512> WebPage needs access to its
1967         corresponding HWND from the UI process
1968
1969         Reviewed by Anders Carlsson.
1970
1971         * Shared/WebPageCreationParameters.cpp:
1972         (WebKit::WebPageCreationParameters::encode):
1973         (WebKit::WebPageCreationParameters::decode):
1974         Encode and decode the HWND as a uint64_t.
1975
1976         * Shared/WebPageCreationParameters.h: Added a nativeWindow member to
1977         store the HWND.
1978
1979         * UIProcess/PageClient.h: Added a nativeWindow function on Windows.
1980
1981         * UIProcess/WebPageProxy.cpp:
1982         (WebKit::WebPageProxy::creationParameters): Store the HWND from the
1983         page client in the struct to be sent to the web process.
1984
1985         * UIProcess/win/WebView.cpp:
1986         (WebKit::WebView::WebView): Moved the call to initializeWebPage after
1987         we've created our window so that our window will be ready when
1988         WebPageProxy asks for it to send it to the web process.
1989         (WebKit::WebView::nativeWindow): Added. Just returns our window.
1990
1991         * UIProcess/win/WebView.h: Added nativeWindow.
1992
1993         * WebProcess/WebPage/WebPage.cpp:
1994         (WebKit::WebPage::WebPage): Store the HWND in the new m_nativeWindow
1995         member.
1996
1997         * WebProcess/WebPage/WebPage.h:
1998         (WebKit::WebPage::nativeWindow): Added this simple getter.
1999
2000 2010-09-24  Adam Roben  <aroben@apple.com>
2001
2002         Add WebPageProxy::creationParameters
2003
2004         Fixes <http://webkit.org/b/46510> WebPageProxy has a bunch of
2005         duplicated WebPageCreationParameters code
2006
2007         Reviewed by Anders Carlsson.
2008
2009         * UIProcess/WebPageProxy.cpp:
2010         (WebKit::WebPageProxy::initializeWebPage):
2011         (WebKit::WebPageProxy::reinitializeWebPage):
2012         (WebKit::WebPageProxy::didReceiveSyncMessage):
2013         Use creationParameters.
2014
2015         (WebKit::WebPageProxy::creationParameters):
2016         * UIProcess/WebPageProxy.h:
2017         Added creationParameters.
2018
2019 2010-09-24  Adam Roben  <aroben@apple.com>
2020
2021         Make WebPage::create take a WebPageCreationParameter struct
2022
2023         It only makes sense, after all.
2024
2025         Fixes <http://webkit.org/b/46502>.
2026
2027         Reviewed by Anders Carlsson.
2028
2029         * WebProcess/WebPage/WebPage.cpp:
2030         (WebKit::WebPage::create):
2031         (WebKit::WebPage::WebPage):
2032         * WebProcess/WebPage/WebPage.h:
2033         Changed to take a WebPageCreationParameters struct.
2034
2035         * WebProcess/WebProcess.cpp:
2036         (WebKit::WebProcess::createWebPage): Changed to pass a
2037         WebPageCreationParameters struct.
2038
2039 2010-09-24  Kenneth Rohde Christiansen  <kenneth.christiansen@openbossa.org>
2040
2041         Reviewed by Andreas Kling.
2042
2043         Expose all WebKit2 C API preferences via the Qt API.
2044
2045         Also rename a wrongly named C method (was using Web instead of WK).
2046
2047         * UIProcess/API/C/WKPreferences.cpp:
2048         (WKPreferencesCopyStandardFontFamily):
2049         * UIProcess/API/C/WKPreferences.h:
2050         * UIProcess/API/qt/qwkpreferences.cpp:
2051         (QWKPreferences::setFontFamily):
2052         (QWKPreferences::fontFamily):
2053         (QWKPreferences::testAttribute):
2054         (QWKPreferences::setAttribute):
2055         * UIProcess/API/qt/qwkpreferences.h:
2056
2057 2010-09-24  Anders Carlsson  <andersca@apple.com>
2058
2059         Reviewed by Adam Roben.
2060
2061         Fill in more of PluginProcess
2062         https://bugs.webkit.org/show_bug.cgi?id=46534
2063
2064         * DerivedSources.make:
2065         Add PluginProcessProxy.
2066
2067         * Platform/CoreIPC/MessageID.h:
2068         Add a MessageClassPluginProcessProxy message class.
2069
2070         * PluginProcess/PluginProcess.cpp:
2071         (WebKit::PluginProcess::PluginProcess):
2072         Initialize the shutdown timer.
2073
2074         (WebKit::PluginProcess::initializeConnection):
2075         Rename this to initializeConnection to avoid conflicts in the CoreIPC message handler.
2076
2077         (WebKit::PluginProcess::removeWebProcessConnection):
2078         Remove the given web process connection from our vector.
2079
2080         (WebKit::PluginProcess::initialize):
2081         Create the plug-in module.
2082
2083         (WebKit::PluginProcess::createWebProcessConnection):
2084         Create a connection handle and send it to the UI process.
2085
2086         (WebKit::PluginProcess::shutdownTimerFired):
2087         Quit.
2088
2089         * PluginProcess/mac/PluginProcessMainMac.mm:
2090         (WebKit::PluginProcessMain):
2091         Call initializeConnection.
2092
2093         * Scripts/webkit2/messages.py:
2094         Add CoreIPC::MachPort as a special case.
2095
2096         * Scripts/webkit2/messages_unittest.py:
2097         Add test case.
2098
2099         * UIProcess/Plugins/PluginProcessProxy.cpp:
2100         (WebKit::PluginProcessProxy::didCreateWebProcessConnection):
2101         Add empty function.
2102
2103         * UIProcess/Plugins/PluginProcessProxy.messages.in: Added.
2104         * WebKit2.xcodeproj/project.pbxproj:
2105         Add PluginProcessProxy.messages.in.
2106
2107         * WebKit2Prefix.h:
2108         Add an ENABLE_PLUGIN_PROCESS #define which is 0 for now.
2109
2110 2010-09-24  Anders Carlsson  <andersca@apple.com>
2111
2112         Reviewed by Adam Roben.
2113
2114         messages_unittest.py should compare the generated results against expected results
2115         https://bugs.webkit.org/show_bug.cgi?id=46490
2116
2117         * Scripts/webkit2/messages_unittest.py:
2118
2119 2010-09-24  Kenneth Rohde Christiansen  <kenneth.christiansen@openbossa.org>
2120
2121         Reviewed by Antonio Gomes.
2122
2123         Make it possible to get the page preferences for Qt WebKit2 port.
2124
2125         * UIProcess/API/qt/qwkpage.cpp:
2126         (QWKPagePrivate::QWKPagePrivate):
2127         (QWKPage::preferences):
2128         * UIProcess/API/qt/qwkpage.h:
2129         * UIProcess/API/qt/qwkpage_p.h:
2130         * UIProcess/API/qt/qwkpreferences.cpp:
2131         (QWKPreferencesPrivate::createPreferences):
2132         (QWKPreferencesPrivate::createSharedPreferences):
2133         (QWKPreferences::sharedPreferences):
2134         (QWKPreferences::QWKPreferences):
2135         * UIProcess/API/qt/qwkpreferences.h:
2136
2137 2010-09-24  Kenneth Rohde Christiansen  <kenneth.christiansen@openbossa.org>
2138
2139         Reviewed by Sam Weinig.
2140
2141         Add WebKit2 C API for setting/getting frame flattening and plugin settings.
2142         http://webkit.org/b/46477
2143
2144         NOTE: The plugin setting was partly done but there was no C API.
2145
2146         * Shared/WebPreferencesStore.cpp:
2147         (WebKit::WebPreferencesStore::WebPreferencesStore):
2148         (WebKit::WebPreferencesStore::encode):
2149         (WebKit::WebPreferencesStore::decode):
2150         * Shared/WebPreferencesStore.h:
2151         * UIProcess/API/C/WKPreferences.cpp:
2152         (WKPreferencesSetFrameFlatteningEnabled):
2153         (WKPreferencesGetFrameFlatteningEnabled):
2154         (WKPreferencesSetPluginsEnabled):
2155         (WKPreferencesGetPluginsEnabled):
2156         * UIProcess/API/C/WKPreferences.h:
2157         * UIProcess/WebPreferences.cpp:
2158         (WebKit::WebPreferences::setFrameFlatteningEnabled):
2159         (WebKit::WebPreferences::frameFlatteningEnabled):
2160         (WebKit::WebPreferences::setPluginsEnabled):
2161         (WebKit::WebPreferences::pluginsEnabled):
2162         * UIProcess/WebPreferences.h:
2163         * WebProcess/WebPage/WebPage.cpp:
2164         (WebKit::WebPage::WebPage):
2165         (WebKit::WebPage::preferencesDidChange):
2166
2167 2010-09-24  Adam Roben  <aroben@apple.com>
2168
2169         Add WebPageCreationParameters
2170
2171         This struct is used in any messages that end up creating a WebPage.
2172         Using a struct instead of individual parameters will make it easier to
2173         add platform-specific data, such as an HWND on Windows.
2174
2175         Fixes <http://webkit.org/b/46470> Pass parameters for creating a
2176         WebPage in a single struct
2177
2178         Reviewed by Anders Carlsson.
2179
2180         * Shared/WebPageCreationParameters.cpp: Added.
2181         (WebKit::WebPageCreationParameters::encode):
2182         (WebKit::WebPageCreationParameters::decode):
2183         Simple encode/decode functions.
2184
2185         * Shared/WebPageCreationParameters.h: Added.
2186
2187         * UIProcess/WebPageProxy.cpp:
2188         (WebKit::WebPageProxy::initializeWebPage):
2189         (WebKit::WebPageProxy::reinitializeWebPage):
2190         (WebKit::WebPageProxy::didReceiveSyncMessage):
2191         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2192         (WebKit::WebChromeClient::createWindow):
2193         * WebProcess/WebProcess.cpp:
2194         (WebKit::WebProcess::createWebPage):
2195         (WebKit::WebProcess::didReceiveMessage):
2196         * WebProcess/WebProcess.h:
2197         Changed to use WebPageCreationParameters instead of passing the
2198         values individually.
2199
2200         * WebKit2.pro:
2201         * WebKit2.xcodeproj/project.pbxproj:
2202         * win/WebKit2.vcproj:
2203         Added WebPageCreationParameters.
2204
2205 2010-09-24  Adam Roben  <aroben@apple.com>
2206
2207         Stop pretending that we know how to encode a DrawingArea and just
2208         encode the DrawingAreaInfo directly
2209
2210         DrawingAreaBase and friends were trying to hide the fact that they
2211         were just encoding/decoding a DrawingAreaInfo behind the scenes, but
2212         everyone knew what was going on and it was getting embarassing.
2213
2214         Fixes <http://webkit.org/b/46469> Code to encode/decode a
2215         DrawingAreaInfo is confusing
2216
2217         Reviewed by Anders Carlsson.
2218
2219         * Shared/DrawingAreaBase.cpp: Removed.
2220         * Shared/DrawingAreaBase.h: Removed encode/decode.
2221         * UIProcess/ChunkedUpdateDrawingAreaProxy.h: Removed encode override.
2222
2223         * UIProcess/WebPageProxy.cpp:
2224         (WebKit::WebPageProxy::initializeWebPage):
2225         (WebKit::WebPageProxy::reinitializeWebPage):
2226         (WebKit::WebPageProxy::didReceiveSyncMessage):
2227         Changed to encode the DrawingAreaInfo directly.
2228
2229         * WebKit2.pro:
2230         * WebKit2.xcodeproj/project.pbxproj:
2231         * win/WebKit2.vcproj:
2232         Removed DrawingAreaBase.cpp.
2233
2234 2010-09-24  Adam Roben  <aroben@apple.com>
2235
2236         Expose a whole DrawingAreaInfo instead of its constituent parts from
2237         DrawingAreaBase
2238
2239         This is just a step toward cleaning up how drawing areas are
2240         encoded/ecoded.
2241
2242         Fixes <http://webkit.org/b/46468> DrawingAreaInfo should be used in
2243         more places
2244
2245         Reviewed by Anders Carlsson.
2246
2247         * Shared/DrawingAreaBase.cpp:
2248         (WebKit::DrawingAreaBase::encode): Changed to use info().
2249
2250         * Shared/DrawingAreaBase.h:
2251         (WebKit::DrawingAreaBase::info): Added. Replaces type() and id().
2252         (WebKit::DrawingAreaBase::DrawingAreaBase): Changed to store a
2253         DrawingAreaInfo instead of storing its constituent parts.
2254
2255         * UIProcess/API/mac/WKView.mm:
2256         * UIProcess/ChunkedUpdateDrawingAreaProxy.cpp:
2257         * UIProcess/LayerBackedDrawingAreaProxy.cpp:
2258         * WebProcess/WebPage/ChunkedUpdateDrawingArea.cpp:
2259         * WebProcess/WebPage/LayerBackedDrawingArea.cpp:
2260         * WebProcess/WebPage/WebPage.cpp:
2261         Updated to use info().
2262
2263 2010-09-24  Anders Carlsson  <andersca@apple.com>
2264
2265         Reviewed by Sam Weinig.
2266
2267         Add WebProcessConnection class
2268         https://bugs.webkit.org/show_bug.cgi?id=46478
2269
2270         * PluginProcess/WebProcessConnection.cpp: Added.
2271         * PluginProcess/WebProcessConnection.h: Added.
2272         Add stubbed out WebProcessConnection class.
2273
2274         * WebKit2.xcodeproj/project.pbxproj:
2275         Add files.
2276
2277 2010-09-24  Anders Carlsson  <andersca@apple.com>
2278
2279         Reviewed by Sam Weinig.
2280
2281         Add PluginProcess class
2282         https://bugs.webkit.org/show_bug.cgi?id=46476
2283
2284         * PluginProcess/PluginProcess.cpp: Added.
2285         * PluginProcess/PluginProcess.h: Added.
2286         Add stubbed out PluginProcess class.
2287
2288         * PluginProcess/mac/PluginProcessMainMac.mm:
2289         (WebKit::PluginProcessMain):
2290         Initialize the plug-in process.
2291
2292         * WebKit2.xcodeproj/project.pbxproj:
2293         Add files.
2294
2295         * WebProcess/Plugins/PluginProcessConnection.h:
2296         Add a comment about which connection this is.
2297
2298 2010-09-24  Sam Weinig  <sam@webkit.org>
2299
2300         Fix windows build.
2301
2302         * Shared/win/PlatformCertificateInfo.cpp:
2303         (WebKit::PlatformCertificateInfo::PlatformCertificateInfo):
2304
2305 2010-09-23  Sam Weinig  <sam@webkit.org>
2306
2307         Reviewed by Adam Roben.
2308
2309         Add Windows implementation of PlatformCertificateInfo
2310         Part of <rdar://problem/8350189>
2311         https://bugs.webkit.org/show_bug.cgi?id=46450
2312
2313         * Shared/win/PlatformCertificateInfo.cpp: Added.
2314         (WebKit::PlatformCertificateInfo::PlatformCertificateInfo):
2315         (WebKit::PlatformCertificateInfo::~PlatformCertificateInfo):
2316         (WebKit::PlatformCertificateInfo::encode):
2317         (WebKit::PlatformCertificateInfo::decode):
2318         (WebKit::organizationNameForCertificate):
2319         * Shared/win/PlatformCertificateInfo.h:
2320         (WebKit::PlatformCertificateInfo::certificateContext):
2321         * UIProcess/API/C/win/WKCertificateInfoWin.cpp: Added.
2322         (WKCertificateInfoGetCertificateContext):
2323         * UIProcess/API/C/win/WKCertificateInfoWin.h: Added.
2324         * win/WebKit2.vcproj:
2325         * win/WebKit2Generated.make:
2326
2327 2010-09-23  Kenneth Rohde Christiansen  <kenneth.christiansen@openbossa.org>
2328
2329         Reviewed by Sam Weinig.
2330
2331         Add WebKit2 C API for setting the font families.
2332         https://bugs.webkit.org/show_bug.cgi?id=46408
2333
2334         * UIProcess/API/C/WKPreferences.cpp:
2335         (WKPreferencesSetStandardFontFamily):
2336         (WebPreferencesCopyStandardFontFamily):
2337         (WKPreferencesSetFixedFontFamily):
2338         (WKPreferencesCopyFixedFontFamily):
2339         (WKPreferencesSetSerifFontFamily):
2340         (WKPreferencesCopySerifFontFamily):
2341         (WKPreferencesSetSansSerifFontFamily):
2342         (WKPreferencesCopySansSerifFontFamily):
2343         (WKPreferencesSetCursiveFontFamily):
2344         (WKPreferencesCopyCursiveFontFamily):
2345         (WKPreferencesSetFantasyFontFamily):
2346         (WKPreferencesCopyFantasyFontFamily):
2347         * UIProcess/API/C/WKPreferences.h:
2348         * UIProcess/WebPreferences.cpp:
2349         (WebKit::WebPreferences::setStandardFontFamily):
2350         (WebKit::WebPreferences::standardFontFamily):
2351         (WebKit::WebPreferences::setFixedFontFamily):
2352         (WebKit::WebPreferences::fixedFontFamily):
2353         (WebKit::WebPreferences::setSerifFontFamily):
2354         (WebKit::WebPreferences::serifFontFamily):
2355         (WebKit::WebPreferences::setSansSerifFontFamily):
2356         (WebKit::WebPreferences::sansSerifFontFamily):
2357         (WebKit::WebPreferences::setCursiveFontFamily):
2358         (WebKit::WebPreferences::cursiveFontFamily):
2359         (WebKit::WebPreferences::setFantasyFontFamily):
2360         (WebKit::WebPreferences::fantasyFontFamily):
2361         * UIProcess/WebPreferences.h:
2362         * WebProcess/WebPage/WebPage.cpp:
2363         (WebKit::WebPage::preferencesDidChange):
2364
2365 2010-09-23  Csaba Osztrogonác  <ossy@webkit.org>
2366
2367         Unreviewed buildfix after r68220 on WebKit2.
2368
2369         WebKit2 API: Need way to know when a frame is removed from the hierarchy
2370         https://bugs.webkit.org/show_bug.cgi?id=46432
2371
2372         [Qt] qt_wk_didRemoveFrameFromHierarchy needs to be implemented
2373
2374         * UIProcess/API/qt/ClientImpl.cpp:
2375         (qt_wk_didRemoveFrameFromHierarchy):
2376         * UIProcess/API/qt/ClientImpl.h:
2377         * UIProcess/API/qt/qwkpage.cpp:
2378         (QWKPage::QWKPage):
2379
2380 2010-09-23  Sam Weinig  <sam@webkit.org>
2381
2382         Reviewed by Anders Carlsson.
2383
2384         WebKit2 API: Need way to know when a frame is removed from the hierarchy
2385         <rdar://problem/8414062>
2386         https://bugs.webkit.org/show_bug.cgi?id=46432
2387
2388         * Shared/CoreIPCSupport/WebPageProxyMessageKinds.h:
2389         * UIProcess/API/C/WKPage.h:
2390         * UIProcess/WebLoaderClient.cpp:
2391         (WebKit::WebLoaderClient::didRemoveFrameFromHierarchy):
2392         * UIProcess/WebLoaderClient.h:
2393         * UIProcess/WebPageProxy.cpp:
2394         (WebKit::WebPageProxy::didReceiveMessage):
2395         (WebKit::WebPageProxy::didRemoveFrameFromHierarchy):
2396         * UIProcess/WebPageProxy.h:
2397         * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
2398         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp:
2399         (WebKit::InjectedBundlePageLoaderClient::didRemoveFrameFromHierarchy):
2400         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h:
2401         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2402         (WebKit::WebFrameLoaderClient::detachedFromParent2):
2403         (WebKit::WebFrameLoaderClient::didTransferChildFrameToNewDocument):
2404
2405 2010-09-23  Anders Carlsson  <andersca@apple.com>
2406
2407         Reviewed by Sam Weinig.
2408
2409         Add PluginProcessConnection and PluginProcessConnectionManager
2410         https://bugs.webkit.org/show_bug.cgi?id=46425
2411
2412         * WebKit2.xcodeproj/project.pbxproj:
2413         Add files.
2414
2415         * WebProcess/Plugins/PluginProcessConnection.cpp:
2416         Add empty file for now.
2417         
2418         * WebProcess/Plugins/PluginProcessConnection.h:
2419         Add header.
2420
2421         * WebProcess/Plugins/PluginProcessConnectionManager.cpp: Added.
2422         (WebKit::PluginProcessConnectionManager::getPluginProcessConnection):
2423         Check for an existing plug-in process connection. If we don't have one, ask the 
2424         UI process to create one.
2425         
2426         (WebKit::PluginProcessConnectionManager::removePluginProcessConnection):
2427         Remove the connection from our global vector.
2428
2429 2010-09-23  Adam Roben  <aroben@apple.com>
2430
2431         Remove the DrawingAreaProxy parameter to
2432         WebPagProxy::initializeWebPage
2433
2434         Callers are now required to set the drawing area via
2435         WebPageProxy::setDrawingArea before calling initializeWebPage. This
2436         will allow us to delay calling initializeWebPage on Windows until
2437         after we've created the WebView's HWND, which in turn will allow us to
2438         send the HWND over to the web process when the page is created. (The
2439         drawing area must be set before creating the HWND so that its size can
2440         be updated, etc., as the window is created.)
2441
2442         Fixes <http://webkit.org/b/46409> DrawingAreaProxy parameter to
2443         initializeWebPage is unnecessary, and causes problems on Windows
2444
2445         Reviewed by Anders Carlsson.
2446
2447         * UIProcess/API/mac/WKView.mm:
2448         (-[WKView initWithFrame:pageNamespaceRef:]):
2449         * UIProcess/API/qt/qwkpage.cpp:
2450         (QWKPagePrivate::init):
2451         * UIProcess/win/WebView.cpp:
2452         (WebKit::WebView::WebView):
2453         Added explicit calls to setDrawingArea.
2454
2455         * UIProcess/WebPageProxy.cpp:
2456         (WebKit::WebPageProxy::initializeWebPage):
2457         * UIProcess/WebPageProxy.h:
2458         Removed the DrawingAreaProxy parameter and a stray puts(), and added
2459         an assertion.
2460
2461 2010-09-23  Anders Carlsson  <andersca@apple.com>
2462
2463         Reviewed by Darin Adler.
2464
2465         Implement handlers for the GetPluginProcessConnection message
2466         https://bugs.webkit.org/show_bug.cgi?id=46415
2467
2468         * Shared/CoreIPCSupport/WebProcessProxyMessageKinds.h:
2469         Add GetPluginProcessConnection message kind
2470
2471         * UIProcess/Plugins/PluginProcessManager.cpp:
2472         (WebKit::PluginProcessManager::PluginProcessManager):
2473         Add missing constructor.
2474
2475         * UIProcess/WebProcessProxy.cpp:
2476         (WebKit::WebProcessProxy::getPluginProcessConnection):
2477         Ask the plug-in process manager for a connection.
2478         
2479         (WebKit::WebProcessProxy::didReceiveSyncMessage):
2480         Call getPluginProcessConnection.
2481
2482         * UIProcess/WebProcessProxy.h:
2483         * WebProcess/WebPage/WebPage.cpp:
2484         (WebKit::WebPage::createPlugin):
2485         Send the GetPluginProcessConnection message.
2486
2487 2010-09-23  Matthew Delaney  <mdelaney@apple.com>
2488
2489         Reviewed by Simon Fraser.
2490
2491         Reduce minimum DOMTimer interval
2492         https://bugs.webkit.org/show_bug.cgi?id=45362
2493
2494         * WebProcess/WebPage/WebPage.cpp:
2495         Updating set interval call to use Settings' static version.
2496
2497 2010-09-23  Adam Roben  <aroben@apple.com>
2498
2499         Try to fix the Windows build
2500
2501         * win/WebKit2Common.vsprops: Add WebKit2/PluginProcess to the include
2502         path.
2503
2504 2010-09-23  Anders Carlsson  <andersca@apple.com>
2505
2506         Reviewed by Sam Weinig.
2507
2508         Add PluginProcessMain files
2509         https://bugs.webkit.org/show_bug.cgi?id=46379
2510
2511         * PluginProcess/PluginProcessMain.h: Added.
2512         * PluginProcess/mac/PluginProcessMainMac.mm: Added.
2513         
2514         * WebKit2.xcodeproj/project.pbxproj:
2515         Add PluginProcessMain files. Remove PluginProcess.messages.in from the target so it
2516         won't be installed in the WebKit2.framework bundle.
2517
2518         * WebProcess/WebKitMain.cpp:
2519         (WebKitMain):
2520         Call PluginProcessMain if the process type is ProcessLauncher::PluginProcess.
2521
2522 2010-09-23  Anders Carlsson  <andersca@apple.com>
2523
2524         Reviewed by Sam Weinig.
2525
2526         Add PluginProcessProxy class
2527         https://bugs.webkit.org/show_bug.cgi?id=46377
2528
2529         * DerivedSources.make:
2530         Add PluginProcess.
2531
2532         * Platform/CoreIPC/Connection.h:
2533         (CoreIPC::Connection::send):
2534         Add send overload that takes a message.
2535
2536         * Platform/CoreIPC/MessageID.h:
2537         Add MessageClassPluginProcess message kind.
2538
2539         * PluginProcess/PluginProcess.messages.in: Added.
2540         Add PluginProcess messages.
2541
2542         * UIProcess/Plugins/PluginInfoStore.cpp:
2543         (WebKit::PluginInfoStore::infoForPluginWithPath):
2544         * UIProcess/Plugins/PluginInfoStore.h:
2545         New function that returns the plug-in info for a plug-in with the given path.
2546
2547         * UIProcess/Plugins/PluginProcessManager.cpp:
2548         (WebKit::PluginProcessManager::getPluginProcessConnection):
2549         Look for an existing plug-in process proxy.
2550
2551         * UIProcess/Plugins/PluginProcessProxy.cpp: Added.
2552         (WebKit::PluginProcessProxy::create):
2553         Launch the process.
2554
2555         (WebKit::PluginProcessProxy::didReceiveMessage):
2556         (WebKit::PluginProcessProxy::didReceiveInvalidMessage):
2557         Add stubbed out functions.
2558
2559         (WebKit::PluginProcessProxy::didClose):
2560         Delete the plug-in process proxy.
2561         
2562         (WebKit::PluginProcessProxy::didFinishLaunching):
2563         Open a connection to the plug-in process proxy.
2564
2565         * UIProcess/Plugins/PluginProcessProxy.h: Added.
2566         (WebKit::PluginProcessProxy::pluginInfo):
2567         Return the plug-in info.
2568
2569         * UIProcess/WebProcessProxy.h:
2570         (WebKit::WebProcessProxy::context):
2571         Add a context getter.
2572
2573         * WebKit2.xcodeproj/project.pbxproj:
2574         Add new files.
2575
2576 2010-09-23  Jessie Berlin  <jberlin@apple.com>
2577
2578         Reviewed by Sam Weinig.
2579
2580         Expose the BundlePage on the BundleFrame in the API.
2581         https://bugs.webkit.org/show_bug.cgi?id=46366
2582
2583         * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
2584         (WKBundleFrameGetPage):
2585         * WebProcess/InjectedBundle/API/c/WKBundleFrame.h:
2586
2587 2010-09-23  Kenneth Rohde Christiansen  <kenneth.christiansen@openbossa.org>
2588
2589         Reviewed by Andreas Kling.
2590
2591         Add a preference class for Qt for WebKit2.
2592
2593         * UIProcess/API/qt/qwkpreferences.cpp: Added.
2594         (QWKPreferences::globalPreferences):
2595         (QWKPreferences::QWKPreferences):
2596         (QWKPreferences::~QWKPreferences):
2597         (QWKPreferences::testAttribute):
2598         (QWKPreferences::setAttribute):
2599         * UIProcess/API/qt/qwkpreferences.h: Added.
2600         * WebKit2.pro:
2601
2602 2010-09-23  Anders Carlsson  <andersca@apple.com>
2603
2604         Reviewed by Adam Roben.
2605
2606         It should be possible to conditionally define an entire group of messages
2607         https://bugs.webkit.org/show_bug.cgi?id=46368
2608
2609         * Scripts/webkit2/messages.py:
2610         Check for a condition when parsing the "messages -> " string and set it as the
2611         message receiver condition.
2612
2613         * Scripts/webkit2/messages_unittest.py:
2614         Add test.
2615
2616 2010-09-23  Anders Carlsson  <andersca@apple.com>
2617
2618         Reviewed by Adam Roben.
2619
2620         Message autogeneration script should parse sync message syntax
2621         https://bugs.webkit.org/show_bug.cgi?id=46359
2622
2623         * Scripts/webkit2/messages.py:
2624         (MessageReceiver.parse): Expand the regular expression to handle sync messages.
2625         (function_parameter_type): Use a const reference for all parameters except the known builtins.
2626         (base_class): Returns the base class for a sync message reply struct.
2627         (delayed_base_class): Returns the base class for a delayed sync message reply struct.
2628         
2629         * Scripts/webkit2/messages_unittest.py:
2630         Add unit tests for various sync messages.
2631
2632 2010-09-22  Andras Becsi  <abecsi@webkit.org>
2633
2634         Unreviewed build fix after r68079.
2635
2636         [Qt] Also generate WebPage's message-receiving code and message types
2637         for the Qt port of WebKit2.
2638
2639         * DerivedSources.pro:
2640         * WebKit2.pro:
2641
2642 2010-09-22  Anders Carlsson  <andersca@apple.com>
2643
2644         Reviewed by Adam Roben.
2645
2646         Stub out a PluginProcessManager class
2647         https://bugs.webkit.org/show_bug.cgi?id=46305
2648
2649         * UIProcess/Plugins/PluginProcessManager.cpp: Added.
2650         (WebKit::PluginProcessManager::shared):
2651         (WebKit::PluginProcessManager::getPluginProcessConnection):
2652         (WebKit::PluginProcessManager::removePluginProcessProxy):
2653         * UIProcess/Plugins/PluginProcessManager.h: Added.
2654         * WebKit2.xcodeproj/project.pbxproj:
2655
2656 2010-09-22  Kenneth Rohde Christiansen  <kenneth@webkit.org>
2657
2658         Reviewed by Antonio Gomes.
2659
2660         Add a ViewportConfiguration class for the Qt WebKit2 API, which
2661         currently calculated a fallback viewport configuration.
2662
2663         * UIProcess/API/qt/qwkpage.cpp:
2664         (QWKPage::ViewportConfiguration::ViewportConfiguration):
2665         (QWKPage::ViewportConfiguration::~ViewportConfiguration):
2666         (QWKPage::ViewportConfiguration::operator=):
2667         (QWKPage::viewportConfigurationForSize):
2668         * UIProcess/API/qt/qwkpage.h:
2669         * UIProcess/API/qt/qwkpage_p.h:
2670         (QtViewportConfigurationPrivate::QtViewportConfigurationPrivate):
2671
2672 2010-09-22  Adam Roben  <aroben@apple.com>
2673
2674         Windows build fix
2675
2676         * WebProcess/WebKitMain.cpp:
2677         (WebKitMain): Fix typo
2678
2679 2010-09-22  Adam Roben  <aroben@apple.com>
2680
2681         Autogenerate WebPage's message-receiving code and message types
2682
2683         This patch encompasses several changes that allow message types and
2684         receiving code to be generated by a script, and add some type-safety
2685         as a bonus. Messages are now represented by structs instead of an ID +
2686         ArgumentCoder. The struct contains the arguments and the ID together,
2687         and has a constructor that enforces the use of correct types.
2688         Correspondingly, a new overload of WebProcessProxy::send that takes a
2689         message struct (instead of a message ID and separate arguments) has
2690         been added. Eventually all callers should use this overload and the
2691         old one can be removed.
2692
2693         This patch only touches WebPage's messages. We should transition other
2694         message receivers over to this new system eventually.
2695
2696         Fixes <http://webkit.org/b/43636> <rdar://problem/8282462> Add a
2697         type-safe IPC mechanism to WebKit2
2698
2699         Reviewed by Anders Carlsson.
2700
2701         * DerivedSources.make: Added. Calls generate-message-receiver.py and
2702         generate-messages-header.py for each message receiver it knows about
2703         (just WebPage for now).
2704
2705         * Platform/CoreIPC/Arguments.h: Added First/Second/ThirdArgumentType
2706         typedefs for use in handleMessage.
2707
2708         * Platform/CoreIPC/HandleMessage.h: Added.
2709         (CoreIPC::handleMessage): This overloaded function template decodes
2710         arguments and passes them along to the specified function.
2711
2712         * Scripts/generate-message-receiver.py: Added.
2713         * Scripts/generate-messages-header.py: Added.
2714         These scripts just wrap functionality in messages.py.
2715
2716         * Scripts/webkit2/__init__.py: Added. This just exists so that Python
2717         will treat this directory as a package.
2718
2719         * Scripts/webkit2/messages.py: Added. Contains the code to parse
2720         messages files and generate .cpp/.h files from them.
2721         (MessageReceiver.__init__): This class represents a single receiver of
2722         messages.
2723         (MessageReceiver.iterparameters): Returns a generator that can be used
2724         to iterate over all the parameters of all the messages of this
2725         receiver.
2726         (MessageReceiver.parse): Reads a messages file from a file-like object
2727         and parses it into a MessageReceiver object.
2728         (Message.__init__): This class represents a single message.
2729         (Message.id): Returns the ID name for this message.
2730         (Parameter.__init__): This class represents a single parameter for a
2731         message.
2732         (messages_header_filename): Returns the name of the header that
2733         defines the messages for a given receiver.
2734         (surround_in_condition): Surrounds the given string in #if/#endif if
2735         there is an associated condition.
2736         (messages_to_kind_enum): Returns a string that defines the Kind enum
2737         for these messages.
2738         (function_parameter_type): Returns the type that should be used when
2739         passing a value of the given type as a parameter to a function.
2740         (base_class): Returns the base class for a message struct.
2741         (message_to_struct_declaration): Returns a string that declares the
2742         struct for this message.
2743         (forward_declarations_for_namespace): Returns a string that contains
2744         forward-declarations for a set of types in a given namespace.
2745         (forward_declarations): Returns a string that contains all the
2746         forward-declarations needed in order to declare all the message
2747         structs for this receiver.
2748         (generate_header_file): Returns a string containing the messages
2749         header file for this receiver.
2750         (handler_function): Returns the name of the function that handles a
2751         given message for a given receiver.
2752         (case_statement): Returns a string containing a case statement for
2753         handling the given message.
2754         (header_for_type): Returns the header needed to define a given type,
2755         enclosed in quotes or angle brackets as needed.
2756         (generate_message_handler): Returns a string containing the contents
2757         of a .cpp file that defines a didReceive*Message function.
2758
2759         * Scripts/webkit2/messages_unittest.py: Added. Contains tests for
2760         messages.py.
2761
2762         * Shared/CoreIPCSupport/WebPageMessageKinds.h: Removed. This has been
2763         replaced by a generated WebPageMessages.h header.
2764
2765         * UIProcess/WebEditCommandProxy.cpp:
2766         * UIProcess/WebPageProxy.cpp:
2767         Updated to use the new message structs and WebProcessProxy::send
2768         overload.
2769
2770         * UIProcess/WebProcessProxy.h:
2771         (WebKit::WebProcessProxy::send): Added this new overload that takes a
2772         message struct.
2773
2774         * WebKit2.xcodeproj/project.pbxproj: Added a Derived Sources shell
2775         script target that invokes DerivedSources.make. Added "Derived
2776         Sources" and "Scripts" groups that contain the various new files.
2777
2778         * WebProcess/WebPage/WebPage.cpp:
2779         (WebKit::WebPage::didReceivePolicyDecision):
2780         (WebKit::WebPage::getSourceForFrame):
2781         Changed these functions to take the raw IPC types and do the necessary
2782         translation themselves. This keeps the generated code from need to
2783         know how to perform the translation.
2784
2785         (WebKit::WebPage::didReceiveMessage): Replaced handling of WebPage
2786         messages with a call to didReceiveWebPageMessage, whose implementation
2787         is generated by the scripts.
2788
2789         * WebProcess/WebPage/WebPage.h: Added didReceiveWebPageMessage.
2790
2791         * WebProcess/WebPage/WebPage.messages.in: Added. This file declares
2792         all of the messages that WebPage receives, roughly grouped by
2793         functionality.
2794
2795         * win/WebKit2.vcproj: Added "Derived Sources" and "Scripts" filters
2796         that contain the various new files. Let VS resort some other files.
2797
2798         * win/WebKit2Common.vsprops: Added
2799         $(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources to the include
2800         path so that the generated messages header can be found.
2801
2802         * win/WebKit2.make: Copy the generated source files to $(DSTROOT).
2803
2804         * win/WebKit2Generated.make: Added a call to build-generated-files.sh.
2805
2806         * win/WebKit2Generated.vcproj: Added build-generated-files.sh.
2807
2808         * win/build-generated-files.sh: Added. Invokes DerivedSources.make.
2809
2810 2010-09-22  Anders Carlsson  <andersca@apple.com>
2811
2812         Reviewed by Darin Adler.
2813
2814         Enhance ProcessLauncher to be able to launch plug-in processes
2815         https://bugs.webkit.org/show_bug.cgi?id=46295
2816
2817         * UIProcess/Launcher/ProcessLauncher.cpp:
2818         (WebKit::ProcessLauncher::ProcessLauncher):
2819         Make the ProcessLauncher constructor take a LaunchOptions struct.
2820
2821         (WebKit::ProcessLauncher::processTypeAsString):
2822         Given a process type, return its string representation.
2823
2824         (WebKit::ProcessLauncher::getProcessTypeFromString):
2825         And vice versa.
2826
2827         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
2828         (WebKit::ProcessLauncher::launchProcess):
2829         Rename "mode" to "type" and pass the type as a string based on the LaunchOptions struct.
2830         Also, set the launch architecture from the LaunchOptions struct.
2831
2832         * UIProcess/Launcher/win/ProcessLauncherWin.cpp:
2833         (WebKit::ProcessLauncher::launchProcess):
2834         Rename "mode" to "type."
2835
2836         * UIProcess/WebProcessProxy.cpp:
2837         (WebKit::WebProcessProxy::connect):
2838         Initialize a LaunchOptions struct.
2839
2840         * WebProcess/WebKitMain.cpp:
2841         (WebKitMain):
2842         Factor code that can be shared between the mac and windows WebKitMain code out into a
2843         WebKitMain overload that takes a CommandLine.
2844
2845         * WebProcess/WebProcessMain.h:
2846         * WebProcess/mac/WebProcessMainMac.mm:
2847         (WebKit::WebProcessMain):
2848         * WebProcess/win/WebProcessMainWin.cpp:
2849         (WebKit::WebProcessMain):
2850         Change WebProcessMain to take a const CommandLine reference instead of a pointer.
2851
2852 2010-09-22  Anders Carlsson  <andersca@apple.com>
2853
2854         Reviewed by Adam Roben.
2855
2856         Rename GetPluginHostConnection to GetPluginPath
2857         https://bugs.webkit.org/show_bug.cgi?id=46292
2858
2859         Rename GetPluginHostConnection to GetPluginPath since this message will always get the
2860         plug-in path. We'll add another message to actually get the connection.
2861
2862         * Shared/CoreIPCSupport/WebProcessProxyMessageKinds.h:
2863         * UIProcess/WebProcessProxy.cpp:
2864         (WebKit::WebProcessProxy::getPluginPath):
2865         (WebKit::WebProcessProxy::didReceiveMessage):
2866         (WebKit::WebProcessProxy::didReceiveSyncMessage):
2867         * UIProcess/WebProcessProxy.h:
2868         * WebProcess/WebPage/WebPage.cpp:
2869         (WebKit::WebPage::createPlugin):
2870
2871 2010-09-22  Anders Carlsson  <andersca@apple.com>
2872
2873         Reviewed by Adam Roben.
2874
2875         Move plug-in creation to WebPage::createPlugin
2876         https://bugs.webkit.org/show_bug.cgi?id=46289
2877
2878         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2879         (WebKit::WebFrameLoaderClient::createPlugin):
2880         Call WebPage::createPlugin.
2881
2882         * WebProcess/WebPage/WebPage.cpp:
2883         (WebKit::WebPage::createPlugin):
2884         Create the plug-in.
2885
2886 2010-09-22  Anders Carlsson  <andersca@apple.com>
2887
2888         Reviewed by Darin Adler.
2889
2890         Random plug-in cleanups
2891         https://bugs.webkit.org/show_bug.cgi?id=46279
2892
2893         * WebProcess/Plugins/Plugin.cpp:
2894         (WebKit::Plugin::Parameters::encode):
2895         (WebKit::Plugin::Parameters::decode):
2896         Add CoreIPC coding support for the Plugin::Parameters struct.
2897
2898         * WebProcess/Plugins/PluginController.h:
2899         Add pluginProcessCrashed pure virtual member function.
2900
2901         * WebProcess/Plugins/PluginView.cpp:
2902         (WebKit::PluginView::handleEvent):
2903         handleEvent can be called when m_plugin is null.
2904
2905         (WebKit::PluginView::pluginProcessCrashed):
2906         Ask the renderer to show the crashed plug-in indicator.
2907         
2908 2010-09-22  Anders Carlsson  <andersca@apple.com>
2909
2910         Reviewed by John Sullivan.
2911
2912         Don't listen for some window notifications on all windows
2913         https://bugs.webkit.org/show_bug.cgi?id=46277
2914
2915         Only listen for NSWindowDidBecomeKeyNotification and NSWindowDidResignKeyNotification notifications
2916         on all windows; this matches old WebKit and fixes a crash where we would send notifications to views whose
2917         underlying pages were invalid.
2918
2919         * UIProcess/API/mac/WKView.mm:
2920         (-[WKView addWindowObserversForWindow:]):
2921         (-[WKView removeWindowObservers]):
2922
2923 2010-09-22  Anders Carlsson  <andersca@apple.com>
2924
2925         Reviewed by Adam Roben.
2926
2927         Crash when running plug-in layout tests
2928         https://bugs.webkit.org/show_bug.cgi?id=46269
2929
2930         Store the web page directly in the PluginView class, instead of getting it from the frame
2931         of the plug-in element; this fixes two crashes, one where the plug-in element had been deallocated
2932         before the plug-in view, and another where the plug-in element's document did not have a frame.
2933
2934         This also makes things more robust since we're asserting in the WebPage destructor that no plug-ins have
2935         an outstanding reference to it.
2936         
2937         * WebProcess/Plugins/PluginView.cpp:
2938         (WebKit::webPage):
2939         (WebKit::PluginView::PluginView):
2940         (WebKit::PluginView::~PluginView):
2941         (WebKit::PluginView::initializePlugin):
2942         * WebProcess/Plugins/PluginView.h:
2943
2944 2010-09-22  Anders Carlsson  <andersca@apple.com>
2945
2946         Reviewed by Adam Roben.
2947
2948         Change a bunch of Vector<char> to Vector<uint8_t> to better indicate that we're
2949         dealing with raw bytes.
2950
2951         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
2952         (WebKit::parsePostBuffer):
2953         (WebKit::NPN_GetURL):
2954         (WebKit::NPN_PostURL):
2955         (WebKit::NPN_GetURLNotify):
2956         (WebKit::NPN_PostURLNotify):
2957         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
2958         (WebKit::NetscapePlugin::loadURL):
2959         (WebKit::NetscapePlugin::initialize):
2960         * WebProcess/Plugins/Netscape/NetscapePlugin.h:
2961         * WebProcess/Plugins/Netscape/NetscapePluginStream.cpp:
2962         (WebKit::NetscapePluginStream::deliverData):
2963         (WebKit::NetscapePluginStream::deliverDataToPlugin):
2964         * WebProcess/Plugins/Netscape/NetscapePluginStream.h:
2965         * WebProcess/Plugins/PluginController.h:
2966         * WebProcess/Plugins/PluginView.cpp:
2967         (WebKit::PluginView::loadURL):
2968         * WebProcess/Plugins/PluginView.h:
2969
2970 2010-09-22  Anders Carlsson  <andersca@apple.com>
2971
2972         Reviewed by Adam Roben.
2973
2974         Assertion fails in [WKView _updateWindowFrame] when closing a WebKit2 window
2975         https://bugs.webkit.org/show_bug.cgi?id=46264
2976         <rdar://problem/8463534>
2977
2978         * UIProcess/API/mac/WKView.mm:
2979         (-[WKView viewDidMoveToWindow]):
2980         Only update window visibility and frame when we're moving to a window.
2981
2982 2010-09-22  Balazs Kelemen  <kb@inf.u-szeged.hu>
2983
2984         Reviewed by Kenneth Rohde Christiansen.
2985
2986         [Qt] PluginStrategy implementation is broken
2987         https://bugs.webkit.org/show_bug.cgi?id=46078
2988
2989         * UIProcess/API/qt/qwkpage.cpp:
2990         (QWKPagePrivate::QWKPagePrivate):
2991         Initialize the WebPlatformStrategies at the UI side as well because
2992         we are using the LocalizationStrategy in the UI process.
2993         Added a FIXME since this should be fixed in the future.
2994
2995 2010-09-22  Balazs Kelemen  <kb@inf.u-szeged.hu>
2996
2997         Reviewed by Kenneth Rohde Christiansen.
2998
2999         PluginStrategy should satisfy the needs of Qt
3000         https://bugs.webkit.org/show_bug.cgi?id=45857
3001         No new functionality so no new tests.
3002
3003         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
3004         (WebKit::WebPlatformStrategies::getPluginInfo):
3005         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
3006
3007 2010-09-21  Steve Falkenburg  <sfalken@apple.com>
3008
3009         Rubber stamped by Simon Fraser.
3010
3011         Add DirectX SDK include path.
3012
3013         * win/WebKit2DirectX.vsprops:
3014
3015 2010-09-21  Anders Carlsson  <andersca@apple.com>
3016
3017         Reviewed by Dan Bernstein.
3018
3019         Forward window focus changes to the plug-in
3020         https://bugs.webkit.org/show_bug.cgi?id=46227
3021
3022         * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
3023         (WebKit::NetscapePlugin::windowFocusChanged):
3024         Send the NPCocoaEventWindowFocusChanged event.
3025
3026         (WebKit::NetscapePlugin::windowFrameChanged):
3027         (WebKit::NetscapePlugin::windowVisibilityChanged):
3028         Add stubs.
3029
3030         * WebProcess/Plugins/Plugin.h:
3031         Add windowFocusChanged, windowFrameChanged and windowVisibilityChanged.
3032
3033         * WebProcess/Plugins/PluginView.cpp:
3034         (WebKit::PluginView::webPage):
3035         Make webPage a member function instead.
3036
3037         (WebKit::PluginView::setWindowIsFocused):
3038         Call the plug-in member function.
3039
3040         (WebKit::PluginView::initializePlugin):
3041         When the plug-in has been initialized, update its window frame, window visibility 
3042         and window focus states.
3043
3044         (WebKit::PluginView::setParent):
3045         Move viewGeometryDidChange to initializePlugin.
3046         
3047         * WebProcess/Plugins/PluginView.h:
3048         * WebProcess/WebPage/WebPage.cpp:
3049         (WebKit::WebPage::setActive):
3050         Tell all plug-in views about the new window focus state.
3051
3052         (WebKit::WebPage::windowIsFocused):
3053         Return whether the window is focused or not.
3054
3055         * WebProcess/WebPage/WebPage.h:
3056         (WebKit::WebPage::windowIsVisible):
3057         (WebKit::WebPage::windowFrame):
3058         Add getters.
3059
3060 2010-09-21  Anders Carlsson  <andersca@apple.com>
3061
3062         Reviewed by John Sullivan.
3063
3064         Handle booleans in injected bundle messages
3065         https://bugs.webkit.org/show_bug.cgi?id=46213
3066
3067         * Shared/UserMessageCoders.h:
3068         (WebKit::UserMessageEncoder::baseEncode):
3069         (WebKit::UserMessageDecoder::baseDecode):
3070
3071 2010-09-21  Brian Weinstein  <bweinstein@apple.com>
3072
3073         Reviewed by Adam Roben.
3074
3075         WebKit2 should look for WebKit2WebProcess.exe next to WebKit.dll
3076         https://bugs.webkit.org/show_bug.cgi?id=46209
3077         <rdar://problem/8445639>
3078         
3079         Find WebKit2WebProcess.exe by getting the full path to WebKit.dll, and then
3080         removing the last path component and replacing it with WebKit2WebProcess.exe.
3081
3082         * UIProcess/Launcher/win/ProcessLauncherWin.cpp:
3083         (WebKit::ProcessLauncher::launchProcess):
3084
3085 2010-09-21  Anders Carlsson  <andersca@apple.com>
3086
3087         Reviewed by Adam Roben.
3088
3089         Send window visibility and window frame change sizes to the plug-in
3090         https://bugs.webkit.org/show_bug.cgi?id=46202
3091
3092         * Shared/CoreIPCSupport/WebPageMessageKinds.h:
3093         * UIProcess/API/mac/WKView.mm:
3094         (-[WKView _updateWindowVisibility]):
3095         Call WebPageProxy::setWindowIsVisible.
3096
3097         (-[WKView addWindowObserversForWindow:]):
3098         Add additional observers.
3099
3100         (-[WKView removeWindowObservers]):
3101         Remove observers.
3102
3103         (-[WKView _updateWindowFrame]):
3104         Call WebPageProxy::setWindowFrame.
3105
3106         (-[WKView viewDidMoveToWindow]):
3107         Update the window visibility and the web frame.
3108
3109         (-[WKView _windowDidMiniaturize:]):
3110         (-[WKView _windowDidDeminiaturize:]):
3111         Update the window visibility.
3112
3113         (-[WKView _windowFrameDidChange:]):
3114         Update the window frame.
3115
3116         * UIProcess/WebPageProxy.cpp:
3117         (WebKit::WebPageProxy::setWindowIsVisible):
3118         (WebKit::WebPageProxy::setWindowFrame):
3119         Send messages along to the web process.
3120
3121         * WebProcess/Plugins/PluginView.cpp:
3122         (WebKit::PluginView::PluginView):
3123         Register the plug-in view.
3124
3125         (WebKit::PluginView::~PluginView):
3126         Unregister the plug-in view.
3127
3128         (WebKit::PluginView::setWindowIsVisible):
3129         (WebKit::PluginView::setWindowFrame):
3130         Add empty stubs.
3131
3132         * WebProcess/WebPage/WebPage.cpp:
3133         (WebKit::WebPage::WebPage):
3134         Initialize m_windowIsVisible.
3135
3136         (WebKit::WebPage::~WebPage):
3137         Assert that all plug-in views have been removed.
3138
3139         (WebKit::WebPage::setWindowIsVisible):
3140         Notify all plug-ins about the window visibility change.
3141         
3142         (WebKit::WebPage::setWindowFrame):
3143         Notify all plug-ins about the window frame change.
3144         
3145         (WebKit::WebPage::didReceiveMessage):
3146         Handle setWindowIsVisible and setWindowFrame.
3147
3148 2010-09-21  Anders Carlsson  <andersca@apple.com>
3149
3150         Reviewed by Mark Rowe.
3151
3152         * Configurations/WebKit2.xcconfig:
3153         Add a note about keeping the path in MainMac.cpp in sync with the install path.
3154
3155         * mac/MainMac.cpp:
3156         (main):
3157         Use the correct framework path.
3158
3159 2010-09-21  Anders Carlsson  <andersca@apple.com>
3160
3161         Fix build.
3162
3163         * mac/MainMac.cpp:
3164         (closeUnusedFileDescriptors):
3165         Move this out into a separate function.
3166
3167         (main):
3168         Don't use the soft linking macros, they were bringing in WTFReportAssertionFailure.
3169
3170 2010-09-20  Anders Carlsson  <andersca@apple.com>
3171
3172         Reviewed by Dan Bernstein.
3173
3174         Zombie WebProcesses are left around
3175         https://bugs.webkit.org/show_bug.cgi?id=46148
3176         <rdar://problem/8455898>
3177
3178         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
3179         (WebKit::setupTerminationNotificationHandler):
3180         Register a dispatch handler that calls waitpid when the child process exits. This prevents zombies from
3181         staying around after the child process has quit.
3182
3183         (WebKit::ProcessLauncher::launchProcess):
3184         Pass POSIX_SPAWN_START_SUSPENDED to posix_spawn to avoid race conditions when setting up the termination
3185         notification handler. When the handler is set up we send the SIGCONT signal to the child process.
3186         
3187         * mac/MainMac.cpp:
3188         (main):
3189         Loop through all file descriptors except for stdin, stdout and stderr and close them.
3190
3191         * WebKit2.xcodeproj/project.pbxproj:
3192         Soft-link the Web process with WebKit2. We do this so we can ensure that we won't accidentally close any
3193         file descriptors opened by initialization code that would have been called before main().
3194
3195 2010-09-21  Andras Becsi  <abecsi@inf.u-szeged.hu>
3196
3197         Reviewed by Csaba Osztrogonác.
3198
3199         [Qt] QtWebProcess should clean up shared memory map files on close
3200         https://bugs.webkit.org/show_bug.cgi?id=45984
3201
3202         Relocate MappedMemory struct code to it's own header and implement
3203         a singleton pool class (MappedMemoryPool) which tracks shared memory
3204         to be able to clean up map files from disk if RunLoop stops.
3205
3206         * Shared/qt/MappedMemory.h: Added.
3207         (WebKit::MappedMemory::markUsed):
3208         (WebKit::MappedMemory::markFree):
3209         (WebKit::MappedMemory::isFree):
3210         * Shared/qt/MappedMemoryPool.cpp: Added.
3211         (WebKit::MappedMemoryPool::MappedMemoryPool):
3212         (WebKit::MappedMemoryPool::instance):
3213         (WebKit::MappedMemoryPool::size):
3214         (WebKit::MappedMemoryPool::at):
3215         (WebKit::MappedMemoryPool::append):
3216         (WebKit::MappedMemoryPool::cleanUp):
3217         * Shared/qt/UpdateChunk.cpp:
3218         (WebKit::mapMemory):
3219         (WebKit::mapFile):
3220         * Shared/qt/UpdateChunk.h:
3221         * WebKit2.pro:
3222
3223 2010-09-20  Philippe Normand  <pnormand@igalia.com>
3224
3225         Reviewed by Eric Carlson.
3226
3227         [GTK] enhanced context menu for media elements
3228         https://bugs.webkit.org/show_bug.cgi?id=45021
3229
3230         New localized strings for the media element context-menu.
3231
3232         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
3233         (WebKit::WebPlatformStrategies::contextMenuItemTagOpenVideoInNewWindow):
3234         (WebKit::WebPlatformStrategies::contextMenuItemTagOpenAudioInNewWindow):
3235         (WebKit::WebPlatformStrategies::contextMenuItemTagCopyVideoLinkToClipboard):
3236         (WebKit::WebPlatformStrategies::contextMenuItemTagCopyAudioLinkToClipboard):
3237         (WebKit::WebPlatformStrategies::contextMenuItemTagToggleMediaControls):
3238         (WebKit::WebPlatformStrategies::contextMenuItemTagToggleMediaLoop):
3239         (WebKit::WebPlatformStrategies::contextMenuItemTagEnterVideoFullscreen):
3240         (WebKit::WebPlatformStrategies::contextMenuItemTagMediaPlay):
3241         (WebKit::WebPlatformStrategies::contextMenuItemTagMediaPause):
3242         (WebKit::WebPlatformStrategies::contextMenuItemTagMediaMute):
3243         (WebKit::WebPlatformStrategies::contextMenuItemTagMediaUnMute):
3244         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
3245
3246 2010-09-20  Anders Carlsson  <andersca@apple.com>
3247
3248         Reviewed by Adam Roben.
3249
3250         Add a way to delay sending replies to sync requests
3251         https://bugs.webkit.org/show_bug.cgi?id=46117
3252
3253         Change the didReceiveSyncMessage client message to return a SyncReplyMode. If the SyncReplyMode is 
3254         AutomaticReply, the reply will be sent when the didReceiveSyncMessage function returns. However, if it is
3255         ManualReply, then the client is handed ownership of the reply ArgumentEncoder and can choose to send it 
3256         at a later time using Connection::sendSyncReply.
3257
3258         * Platform/CoreIPC/Connection.cpp:
3259         (CoreIPC::Connection::sendSyncReply):
3260         Send the message as a sync reply.
3261
3262         (CoreIPC::Connection::dispatchMessages):
3263         Check the return value of didReceiveSyncMessage. If it is AutomaticReply, immediately send the reply.
3264
3265         * Platform/CoreIPC/Connection.h:
3266         (CoreIPC::Connection::MessageReceiver::didReceiveSyncMessage):
3267         Change return type.
3268
3269         * UIProcess/WebProcessProxy.cpp:
3270         (WebKit::WebProcessProxy::didReceiveSyncMessage):
3271         * UIProcess/WebProcessProxy.h:
3272         Update for changed return type.
3273
3274 2010-09-20  Anders Carlsson  <andersca@apple.com>
3275
3276         Reviewed by Adam Roben.
3277
3278         Don't use bufferIsLargeEnoughToContain for Vectors with variable sized elements
3279         https://bugs.webkit.org/show_bug.cgi?id=46109
3280
3281         Add a new VectorArgumentCoder class template, with specializations based on whether the
3282         element is fixed size or not. Then update the ArgumentEncoder<Vector<T>> specialization to choose the
3283         right VectorArgumentCoder specialization. To determine this, we use the "IsArithmetic" type trait, 
3284         which holds true for all integer types and all floating point types. 
3285         
3286         * Platform/CoreIPC/ArgumentCoders.h:
3287
3288 2010-09-20  Enrica Casucci  <enrica@apple.com>
3289
3290         Reviewed by Sam Weinig.
3291
3292         Pasteboard doesn't work in WebKit2.
3293         https://bugs.webkit.org/show_bug.cgi?id=42317
3294         <rdar://problem/7660537>
3295
3296         Adding support for RTF, RTFD and NSUrl formats on the Mac.
3297         Still missing the selective enabling of the menu entries.
3298
3299         * WebKit2.xcodeproj/project.pbxproj: Added WebEditorClientMac.mm.
3300         * WebProcess/WebCoreSupport/WebEditorClient.cpp: Removed Mac only methods
3301         that are now in WebEditorClientMac.mm
3302         * WebProcess/WebCoreSupport/WebEditorClient.h: Fixed style and changed parameter
3303         type in documentFragmentFromAttributedString to be a Vector of RefPtr.
3304         * WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm: Added.
3305         All the following methods have been moved from WebEditorClient.cpp.
3306         (WebKit::WebEditorClient::userVisibleString): Added implementation.
3307         (WebKit::createExcludedElementsForAttributedStringConversion): Added.
3308         (WebKit::WebEditorClient::documentFragmentFromAttributedString): Added implementation.
3309         (WebKit::WebEditorClient::setInsertionPasteboard):
3310         (WebKit::WebEditorClient::pasteboardTypesForSelection):
3311         (WebKit::WebEditorClient::uppercaseWord):
3312         (WebKit::WebEditorClient::lowercaseWord):
3313         (WebKit::WebEditorClient::capitalizeWord):
3314         (WebKit::WebEditorClient::showSubstitutionsPanel):
3315         (WebKit::WebEditorClient::substitutionsPanelIsShowing):
3316         (WebKit::WebEditorClient::toggleSmartInsertDelete):
3317         (WebKit::WebEditorClient::isAutomaticQuoteSubstitutionEnabled):
3318         (WebKit::WebEditorClient::toggleAutomaticQuoteSubstitution):
3319         (WebKit::WebEditorClient::isAutomaticLinkDetectionEnabled):
3320         (WebKit::WebEditorClient::toggleAutomaticLinkDetection):
3321         (WebKit::WebEditorClient::isAutomaticDashSubstitutionEnabled):
3322         (WebKit::WebEditorClient::toggleAutomaticDashSubstitution):
3323         (WebKit::WebEditorClient::isAutomaticTextReplacementEnabled):
3324         (WebKit::WebEditorClient::toggleAutomaticTextReplacement):
3325         (WebKit::WebEditorClient::isAutomaticSpellingCorrectionEnabled):
3326         (WebKit::WebEditorClient::toggleAutomaticSpellingCorrection):
3327         (WebKit::WebEditorClient::checkTextOfParagraph):
3328         (WebKit::WebEditorClient::showCorrectionPanel):
3329         (WebKit::WebEditorClient::dismissCorrectionPanel):
3330         (WebKit::WebEditorClient::isShowingCorrectionPanel):
3331
3332 2010-09-20  Andy Estes  <aestes@apple.com>
3333
3334         Reviewed by Darin Adler.
3335
3336         Fix a style issue and add a FIXME to make the AppleConnect plug-in
3337         workaround dependent on site-specific quirks being enabled, which
3338         WebKit2 does not yet support in its WebPreferences implementation.
3339         https://bugs.webkit.org/show_bug.cgi?id=45960
3340
3341         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3342         (WebKit::WebFrameLoaderClient::createPlugin):
3343
3344 2010-09-20  Sam Weinig  <sam@webkit.org>
3345
3346         Reviewed by Adam Roben.
3347
3348         Add WebKit2 API to load a string as plain text
3349         https://bugs.webkit.org/show_bug.cgi?id=46091
3350
3351         * Shared/CoreIPCSupport/WebPageMessageKinds.h:
3352         * UIProcess/API/C/WKPage.cpp:
3353         (WKPageLoadPlainTextString):
3354         * UIProcess/API/C/WKPage.h:
3355         * UIProcess/WebPageProxy.cpp:
3356         (WebKit::WebPageProxy::loadPlainTextString):
3357         * UIProcess/WebPageProxy.h:
3358         * WebProcess/WebPage/WebPage.cpp:
3359         (WebKit::WebPage::loadData):
3360         (WebKit::WebPage::loadHTMLString):
3361         (WebKit::WebPage::loadPlainTextString):
3362         (WebKit::WebPage::didReceiveMessage):
3363         * WebProcess/WebPage/WebPage.h:
3364
3365 2010-09-19  Sam Weinig  <sam@webkit.org>
3366
3367         Fix windows build.
3368
3369         * UIProcess/API/C/WKPage.h:
3370
3371 2010-09-19  Sam Weinig  <sam@webkit.org>
3372
3373         Attempt to fix Qt build.
3374
3375         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
3376         (WebKit::WebEditorClient::doTextFieldCommandFromEvent):
3377
3378 2010-09-19  Sam Weinig  <sam@webkit.org>
3379
3380         Reviewed by Anders Carlsson.
3381
3382         Add WebKit2 equivalent of the WebFormDelegate's doCommandBySelector
3383         <rdar://problem/8377088>
3384         https://bugs.webkit.org/show_bug.cgi?id=46073
3385
3386         Add bundle client to match the behavior of:
3387           - (BOOL)textField:(DOMHTMLInputElement *)element doCommandBySelector:(SEL)commandSelector inFrame:(WebFrame *)frame;
3388
3389         * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
3390         * WebProcess/InjectedBundle/InjectedBundlePageFormClient.cpp:
3391         (WebKit::InjectedBundlePageFormClient::shouldPerformActionInTextField):
3392         * WebProcess/InjectedBundle/InjectedBundlePageFormClient.h:
3393         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
3394         (WebKit::getActionTypeForKeyEvent):
3395         (WebKit::WebEditorClient::doTextFieldCommandFromEvent):
3396         (WebKit::WebEditorClient::textWillBeDeletedInTextField):
3397
3398 2010-09-19  Sam Weinig  <sam@webkit.org>
3399
3400         Reviewed by Anders Carlsson.
3401
3402         WebKit2 decidePolicyForNavigationAction should include mouse button information
3403         <rdar://problem/8413165>
3404         https://bugs.webkit.org/show_bug.cgi?id=46060
3405
3406         * UIProcess/API/C/WKAPICast.h:
3407         (WebKit::toRef):
3408         * UIProcess/API/C/WKPage.h:
3409         * UIProcess/WebPageProxy.cpp:
3410         (WebKit::WebPageProxy::didReceiveMessage):
3411         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
3412         (WebKit::WebPageProxy::decidePolicyForNewWindowAction):
3413         * UIProcess/WebPageProxy.h:
3414         * UIProcess/WebPolicyClient.cpp:
3415         (WebKit::WebPolicyClient::decidePolicyForNavigationAction):
3416         (WebKit::WebPolicyClient::decidePolicyForNewWindowAction):
3417         * UIProcess/WebPolicyClient.h:
3418         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3419         (WebKit::findMouseEvent):
3420         (WebKit::mouseButtonForNavigationAction):
3421         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction):
3422         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
3423
3424 2010-09-19  Csaba Osztrogonác  <ossy@webkit.org>
3425
3426         [Qt] Unreviewed buildfix after r67813.
3427
3428         Replace WKBundleRangeRef with WKBundleRangeHandleRef.
3429         https://bugs.webkit.org/show_bug.cgi?id=46054
3430
3431         * DerivedSources.pro: Add WebCore/generated/JSRange.h to WEBCORE_GENERATED_HEADERS_FOR_WEBKIT2
3432
3433 2010-09-19  Csaba Osztrogonác  <ossy@webkit.org>
3434
3435         [Qt] Unreviewed buildfix after r67802.
3436
3437         WebKit2: Improve/unify the PageLoadClient interfaces.
3438         https://bugs.webkit.org/show_bug.cgi?id=46043
3439
3440         * UIProcess/API/qt/ClientImpl.h:
3441
3442 2010-09-19  Sam Weinig  <sam@webkit.org>
3443
3444         Reviewed by Anders Carlsson.
3445
3446         Replace WKBundleRangeRef with WKBundleRangeHandleRef.
3447         https://bugs.webkit.org/show_bug.cgi?id=46054
3448
3449         The new one acts like WKBundleNodeHandleRef and allows for getting a
3450         wrapper in a specific world for the handle.
3451
3452         * Shared/APIObject.h:
3453         * WebKit2.pro:
3454         * WebKit2.xcodeproj/project.pbxproj:
3455         * WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
3456         * WebProcess/InjectedBundle/API/c/WKBundleBase.h:
3457         * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
3458         (WKBundleFrameGetJavaScriptWrapperForRangeForWorld):
3459         * WebProcess/InjectedBundle/API/c/WKBundleFrame.h:
3460         * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
3461         * WebProcess/InjectedBundle/API/c/WKBundleRange.cpp: Removed.
3462         * WebProcess/InjectedBundle/API/c/WKBundleRange.h: Removed.
3463         * WebProcess/InjectedBundle/API/c/WKBundleRangeHandle.cpp: Added.
3464         (WKBundleRangeHandleGetTypeID):
3465         * WebProcess/InjectedBundle/API/c/WKBundleRangeHandle.h: Added.
3466         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
3467         (WebKit::InjectedBundleNodeHandle::getOrCreate):
3468         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h:
3469         * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp: Added.
3470         (WebKit::domHandleCache):
3471         (WebKit::InjectedBundleRangeHandle::getOrCreate):
3472         (WebKit::InjectedBundleRangeHandle::create):
3473         (WebKit::InjectedBundleRangeHandle::InjectedBundleRangeHandle):
3474         (WebKit::InjectedBundleRangeHandle::~InjectedBundleRangeHandle):
3475         (WebKit::InjectedBundleRangeHandle::coreRange):
3476         * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.h: Added.
3477         (WebKit::InjectedBundleRangeHandle::type):
3478         * WebProcess/InjectedBundle/InjectedBundlePageEditorClient.cpp:
3479         (WebKit::InjectedBundlePageEditorClient::shouldBeginEditing):
3480         (WebKit::InjectedBundlePageEditorClient::shouldEndEditing):
3481         (WebKit::InjectedBundlePageEditorClient::shouldInsertNode):
3482         (WebKit::InjectedBundlePageEditorClient::shouldInsertText):
3483         (WebKit::InjectedBundlePageEditorClient::shouldDeleteRange):
3484         (WebKit::InjectedBundlePageEditorClient::shouldChangeSelectedRange):
3485         (WebKit::InjectedBundlePageEditorClient::shouldApplyStyle):
3486         * WebProcess/WebPage/WebFrame.cpp:
3487         (WebKit::WebFrame::jsWrapperForWorld):
3488         * WebProcess/WebPage/WebFrame.h:
3489         * win/WebKit2.vcproj:
3490         * win/WebKit2Generated.make:
3491
3492 2010-09-18  Sam Weinig  <sam@webkit.org>
3493
3494         Reviewed by Dan Bernstein.
3495
3496         Improve/unify the PageLoadClient interfaces.
3497         https://bugs.webkit.org/show_bug.cgi?id=46043
3498
3499         - Ensure that all the PageLoadClient functions (that are load related)
3500           have bundle API equivalents (this meant adding didFirstLayoutForFrame
3501           and didFirstVisuallyNonEmptyLayoutForFrame to the BundlePageLoadClient).
3502         - Add a userData out parameters to all the now paired BundlePageLoadClient
3503           functions, and a matching userData parameter to the PageLoadClient ones.
3504
3505         * UIProcess/API/C/WKPage.h:
3506         * UIProcess/API/qt/ClientImpl.cpp:
3507         (qt_wk_didStartProvisionalLoadForFrame):
3508         (qt_wk_didReceiveServerRedirectForProvisionalLoadForFrame):
3509         (qt_wk_didFailProvisionalLoadWithErrorForFrame):
3510         (qt_wk_didCommitLoadForFrame):
3511         (qt_wk_didFinishDocumentLoadForFrame):
3512         (qt_wk_didFinishLoadForFrame):
3513         (qt_wk_didFailLoadWithErrorForFrame):
3514         (qt_wk_didReceiveTitleForFrame):
3515         (qt_wk_didFirstLayoutForFrame):
3516         (qt_wk_didFirstVisuallyNonEmptyLayoutForFrame):
3517         * UIProcess/WebLoaderClient.cpp:
3518         (WebKit::WebLoaderClient::didStartProvisionalLoadForFrame):
3519         (WebKit::WebLoaderClient::didReceiveServerRedirectForProvisionalLoadForFrame):
3520         (WebKit::WebLoaderClient::didFailProvisionalLoadWithErrorForFrame):
3521         (WebKit::WebLoaderClient::didCommitLoadForFrame):
3522         (WebKit::WebLoaderClient::didFinishDocumentLoadForFrame):
3523         (WebKit::WebLoaderClient::didFinishLoadForFrame):
3524         (WebKit::WebLoaderClient::didFailLoadWithErrorForFrame):
3525         (WebKit::WebLoaderClient::didReceiveTitleForFrame):
3526         (WebKit::WebLoaderClient::didFirstLayoutForFrame):
3527         (WebKit::WebLoaderClient::didFirstVisuallyNonEmptyLayoutForFrame):
3528         (WebKit::WebLoaderClient::didStartProgress):
3529         (WebKit::WebLoaderClient::didChangeProgress):
3530         (WebKit::WebLoaderClient::didFinishProgress):
3531         (WebKit::WebLoaderClient::didBecomeUnresponsive):
3532         (WebKit::WebLoaderClient::didBecomeResponsive):
3533         (WebKit::WebLoaderClient::processDidExit):
3534         (WebKit::WebLoaderClient::didChangeBackForwardList):
3535         * UIProcess/WebLoaderClient.h:
3536         * UIProcess/WebPageProxy.cpp:
3537         (WebKit::WebPageProxy::didReceiveMessage):
3538         (WebKit::WebPageProxy::didStartProvisionalLoadForFrame):
3539         (WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame):
3540         (WebKit::WebPageProxy::didFailProvisionalLoadForFrame):
3541         (WebKit::WebPageProxy::didCommitLoadForFrame):
3542         (WebKit::WebPageProxy::didFinishDocumentLoadForFrame):
3543         (WebKit::WebPageProxy::didFinishLoadForFrame):
3544         (WebKit::WebPageProxy::didFailLoadForFrame):
3545         (WebKit::WebPageProxy::didReceiveTitleForFrame):
3546         (WebKit::WebPageProxy::didFirstLayoutForFrame):
3547         (WebKit::WebPageProxy::didFirstVisuallyNonEmptyLayoutForFrame):
3548         * UIProcess/WebPageProxy.h:
3549         * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
3550         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp:
3551         (WebKit::InjectedBundlePageLoaderClient::didStartProvisionalLoadForFrame):
3552         (WebKit::InjectedBundlePageLoaderClient::didReceiveServerRedirectForProvisionalLoadForFrame):
3553         (WebKit::InjectedBundlePageLoaderClient::didFailProvisionalLoadWithErrorForFrame):
3554         (WebKit::InjectedBundlePageLoaderClient::didCommitLoadForFrame):
3555         (WebKit::InjectedBundlePageLoaderClient::didFinishDocumentLoadForFrame):
3556         (WebKit::InjectedBundlePageLoaderClient::didFinishLoadForFrame):
3557         (WebKit::InjectedBundlePageLoaderClient::didFailLoadWithErrorForFrame):
3558         (WebKit::InjectedBundlePageLoaderClient::didReceiveTitleForFrame):
3559         (WebKit::InjectedBundlePageLoaderClient::didFirstLayoutForFrame):
3560         (WebKit::InjectedBundlePageLoaderClient::didFirstVisuallyNonEmptyLayoutForFrame):
3561         (WebKit::InjectedBundlePageLoaderClient::didClearWindowObjectForFrame):
3562         (WebKit::InjectedBundlePageLoaderClient::didCancelClientRedirectForFrame):
3563         (WebKit::InjectedBundlePageLoaderClient::willPerformClientRedirectForFrame):
3564         (WebKit::InjectedBundlePageLoaderClient::didChangeLocationWithinPageForFrame):
3565         (WebKit::InjectedBundlePageLoaderClient::didHandleOnloadEventsForFrame):
3566         (WebKit::InjectedBundlePageLoaderClient::didDisplayInsecureContentForFrame):
3567         (WebKit::InjectedBundlePageLoaderClient::didRunInsecureContentForFrame):
3568         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h:
3569         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3570         (WebKit::WebFrameLoaderClient::dispatchDidReceiveServerRedirectForProvisionalLoad):
3571         (WebKit::WebFrameLoaderClient::dispatchDidStartProvisionalLoad):
3572         (WebKit::WebFrameLoaderClient::dispatchDidReceiveTitle):
3573         (WebKit::WebFrameLoaderClient::dispatchDidCommitLoad):
3574         (WebKit::WebFrameLoaderClient::dispatchDidFailProvisionalLoad):
3575         (WebKit::WebFrameLoaderClient::dispatchDidFailLoad):
3576         (WebKit::WebFrameLoaderClient::dispatchDidFinishDocumentLoad):
3577         (WebKit::WebFrameLoaderClient::dispatchDidFinishLoad):
3578         (WebKit::WebFrameLoaderClient::dispatchDidFirstLayout):
3579         (WebKit::WebFrameLoaderClient::dispatchDidFirstVisuallyNonEmptyLayout):
3580
3581 2010-09-18  Ademar de Souza Reis Jr  <ademar.reis@openbossa.org>
3582
3583         Reviewed by Kenneth Rohde Christiansen.
3584
3585         Enable Platform Strategies on Qt
3586
3587         [Qt] Turn on PLATFORM_STRATEGIES
3588         https://bugs.webkit.org/show_bug.cgi?id=45831
3589
3590         * WebKit2.pro: Added Added WebPlatformStrategies.{cpp,h}
3591
3592 2010-09-17  Sam Weinig  <sam@webkit.org>
3593
3594         Reviewed by Jon Honeycutt.
3595
3596         Need a way to load data (as plain text) in a WKPage
3597         <rdar://problem/8424239>
3598
3599         * Shared/CoreIPCSupport/WebPageMessageKinds.h:
3600         * UIProcess/API/C/WKPage.cpp:
3601         (WKPageLoadHTMLString):
3602         * UIProcess/API/C/WKPage.h:
3603         * UIProcess/WebPageProxy.cpp:
3604         (WebKit::WebPageProxy::loadHTMLString):
3605         * UIProcess/WebPageProxy.h:
3606         * WebProcess/WebPage/WebPage.cpp:
3607         (WebKit::WebPage::loadHTMLString):
3608         (WebKit::WebPage::didReceiveMessage):
3609         * WebProcess/WebPage/WebPage.h:
3610
3611 2010-09-17  Sam Weinig  <sam@webkit.org>
3612
3613         Rubber-stamped by Anders Carlsson.
3614
3615         Replace all uses of WTF::String and WTF::AtomicString with
3616         String and AtomicString.
3617
3618         * Platform/Module.h:
3619         * Shared/CommandLine.h:
3620         (WebKit::CommandLine::operator[]):
3621         * Shared/WebCoreArgumentCoders.h:
3622         * Shared/WebEvent.h:
3623         (WebKit::WebKeyboardEvent::WebKeyboardEvent):
3624         (WebKit::WebKeyboardEvent::text):
3625         (WebKit::WebKeyboardEvent::unmodifiedText):
3626         (WebKit::WebKeyboardEvent::keyIdentifier):
3627         (WebKit::WebKeyboardEvent::decode):
3628         * Shared/WebNavigationDataStore.h:
3629         * Shared/WebPreferencesStore.h:
3630         * Shared/WebString.h:
3631         (WebKit::WebString::create):
3632         (WebKit::WebString::string):
3633         (WebKit::WebString::WebString):
3634         * Shared/WebURL.h:
3635         (WebKit::WebURL::create):
3636         (WebKit::WebURL::string):
3637         (WebKit::WebURL::WebURL):
<