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