f0d6dde8f155dd05ce61c8de0836b498d9da45cd
[WebKit.git] / WebKit2 / ChangeLog
1 2010-08-12  Jon Honeycutt  <jhoneycutt@apple.com>
2
3         WebKitTestRunner needs to run tests without using native controls
4         https://bugs.webkit.org/show_bug.cgi?id=43772
5
6         Reviewed by Sam Weinig.
7
8         * Shared/CoreIPCSupport/WebProcessMessageKinds.h:
9         (WebProcessMessage::):
10         Add a new message.
11
12         * UIProcess/API/C/win/WKContextPrivateWin.h: Added.
13         Declare WKContextSetShouldPaintNativeControls().
14
15         * UIProcess/API/C/win/WKContextWin.cpp: Added.
16         (WKContextSetShouldPaintNativeControls):
17         Call the WebContext's setShouldPaintNativeControls().
18
19         * UIProcess/WebContext.cpp:
20         (WebKit::WebContext::WebContext):
21         Initialize m_shouldPaintNativeControls.
22         (WebKit::WebContext::ensureWebProcess):
23         If we created a web process, call platformSetUpWebProcess().
24
25         * UIProcess/WebContext.h:
26         Declare new functions and a member to store whether we should paint
27         native controls.
28
29         * UIProcess/mac/WebContextMac.mm:
30         (WebKit::WebContext::platformSetUpWebProcess):
31         Stubbed.
32
33         * UIProcess/win/WebContextWin.cpp:
34         (WebKit::WebContext::setShouldPaintNativeControls):
35         Set m_shouldPaintNativeControls. If we have a valid web process, send a
36         SetShouldPaintNativeControls message.
37         (WebKit::WebContext::platformSetUpWebProcess):
38         Send a SetShouldPaintNativeControls message.
39
40         * WebProcess/WebProcess.cpp:
41         (WebKit::WebProcess::didReceiveMessage):
42         If this is a SetShouldPaintNativeControls message, decode the argument,
43         and call Settings::setShouldPaintNativeControls().
44
45         * win/WebKit2.vcproj:
46         Add WKContextPrivateWin.h and WKContextWin.cpp to project.
47
48         * win/WebKit2Generated.make:
49         Copy WKContextPrivateWin.h.
50
51 2010-08-11  Sam Weinig  <sam@webkit.org>
52
53         Reviewed by Gavin Barraclough.
54
55         Add SPI to stop loading from the InjectedBundle.
56
57         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
58         (WKBundlePageStopLoading):
59         * WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h:
60         * WebProcess/WebPage/WebPage.h:
61
62 2010-08-11  Sam Weinig  <sam@webkit.org>
63
64         Reviewed by Gavin Barraclough.
65
66         WKPageStopLoading always asserts
67
68         * WebProcess/WebPage/WebPage.cpp:
69         (WebKit::WebPage::didReceiveMessage): Switch break to return, break made us
70         hit the ASSERT_NOT_REACHED at the end of the function.
71
72 2010-08-11  Balazs Kelemen  <kb@inf.u-szeged.hu>
73
74         Unreviewed build fix.
75
76         [Qt] Update WebKit2 build environment, add stub implementation of SharedMemory.
77
78         * DerivedSources.pro:
79         * Platform/qt/SharedMemoryQt.cpp: Added.
80         (WebKit::SharedMemory::Handle::Handle):
81         (WebKit::SharedMemory::Handle::~Handle):
82         (WebKit::SharedMemory::Handle::encode):
83         (WebKit::SharedMemory::Handle::decode):
84         (WebKit::SharedMemory::create):
85         (WebKit::SharedMemory::~SharedMemory):
86         (WebKit::SharedMemory::createHandle):
87         (WebKit::SharedMemory::systemPageSize):
88         * WebKit2.pro:
89         * WebKit2Prefix.h:
90
91 2010-08-11  Mark Rowe  <mrowe@apple.com>
92
93         Build fix.  Update references to StringHash.h.
94
95         * Shared/CommandLine.h:
96         * UIProcess/WebContext.h:
97         * WebProcess/Plugins/Netscape/NetscapePlugin.h:
98         * WebProcess/win/WebProcessMainWin.cpp:
99
100 2010-08-10  Darin Adler  <darin@apple.com>
101
102         Reviewed by Sam Weinig.
103
104         Add leakRef and clear to all RefPtr variants
105         https://bugs.webkit.org/show_bug.cgi?id=42389
106
107         * UIProcess/API/cpp/WKRetainPtr.h: Changed all uses of "template <...>" to
108         "template<...>". Defined many of the inlined functions outside the class
109         definition, to avoid style checker warnings about multiple statements on
110         a single line and for slightly better clarity of the class definition itself.
111         Renamed releaseRef to leakRef. Added a releaseRef that calls leakRef so we
112         don't have to rename all callers at once. Added a clear function.
113
114 2010-08-10  Balazs Kelemen  <kb@inf.u-szeged.hu>
115
116         Reviewed by Antonio Gomes.
117
118         [Qt] Build WebKit2 into a static lib
119
120         https://bugs.webkit.org/show_bug.cgi?id=43621
121
122         * WebKit2.pri: Added. Defined addWebKit2Lib function that defines how to link against the static lib.
123         * WebKit2.pro:  Build specification for the WebKit2 framework.
124         * WebProcess.pro: Copied from WebKit2/WebKit2.pro. Build specification for the WebProcess binary.
125
126 2010-08-09  Sam Weinig  <sam@webkit.org>
127
128         Reviewed by Geoffrey Garen.
129
130         Add zoom support for injected bundle
131         https://bugs.webkit.org/show_bug.cgi?id=43759
132
133         Add SPI to change the zoom factor for a page.
134
135         * WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
136         (toZoomMode):
137         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
138         (WKBundlePageGetZoomFactor):
139         (WKBundlePageSetZoomFactor):
140         (WKBundlePageSetZoomMode):
141         * WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h:
142         * WebProcess/WebPage/WebPage.cpp:
143         (WebKit::WebPage::zoomFactor):
144         (WebKit::WebPage::setZoomFactor):
145         (WebKit::WebPage::setZoomMode):
146         * WebProcess/WebPage/WebPage.h:
147
148 2010-08-06  Gavin Barraclough  <barraclough@apple.com>
149
150         Rubber stamped by Sam Weinig
151
152         Bug 43594 - Add string forwards to Forward.h
153         This allows us to remove forward declarations for these classes from
154         WebCore/WebKit (a step in moving these class from WebCore:: to WTF::).
155
156         * UIProcess/PageClient.h:
157         * UIProcess/VisitedLinkProvider.h:
158         * UIProcess/WebContextInjectedBundleClient.h:
159         * UIProcess/WebFrameProxy.h:
160         * UIProcess/WebHistoryClient.h:
161         * UIProcess/WebLoaderClient.h:
162         * UIProcess/WebPolicyClient.h:
163         * UIProcess/WebProcessProxy.h:
164         * UIProcess/WebUIClient.h:
165         * UIProcess/win/WebView.h:
166         * WebProcess/InjectedBundle/InjectedBundlePageEditorClient.h:
167         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h:
168         * WebProcess/InjectedBundle/InjectedBundlePageUIClient.h:
169         * WebProcess/Plugins/NPRuntimeObjectMap.h:
170         * WebProcess/Plugins/Netscape/NetscapePluginStream.h:
171         * WebProcess/Plugins/PluginController.h:
172         * WebProcess/WebPage/WebFrame.h:
173         * WebProcess/WebPage/WebPage.h:
174         * WebProcess/WebProcess.h:
175
176 2010-08-09  Balazs Kelemen  <kb@inf.u-szeged.hu>
177
178         Reviewed by Kenneth Rohde Christiansen.
179
180         [Qt] No need for PageClientImpl
181
182         https://bugs.webkit.org/show_bug.cgi?id=43728
183
184         Remove PageClientImpl, take the implementation of WebKit::PageClient into QWKPagePrivate.
185
186         * UIProcess/API/qt/qwkpage.cpp:
187         (QWKPagePrivate::QWKPagePrivate):
188         (QWKPagePrivate::toolTipChanged):
189         * UIProcess/API/qt/qwkpage_p.h:
190         (QWKPagePrivate::pageDidEnterAcceleratedCompositing):
191         (QWKPagePrivate::pageDidLeaveAcceleratedCompositing):
192         (QWKPagePrivate::processDidExit):
193         (QWKPagePrivate::processDidRevive):
194         (QWKPagePrivate::setCursor):
195         (QWKPagePrivate::takeFocus):
196
197 2010-08-07  Sam Weinig  <sam@webkit.org>
198
199         Reviewed by Anders Carlsson.
200
201         WebKitTestRunner needs to print onunload handler information
202         <rdar://problem/8213831>
203         https://bugs.webkit.org/show_bug.cgi?id=42703
204
205         Add SPI to get the number of pending unload events.
206
207         * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
208         (WKBundleFrameGetPendingUnloadCount):
209         * WebProcess/InjectedBundle/API/c/WKBundleFramePrivate.h:
210         * WebProcess/WebPage/WebFrame.cpp:
211         (WebKit::WebFrame::pendingUnloadCount):
212         * WebProcess/WebPage/WebFrame.h:
213
214 2010-08-07  Sam Weinig  <sam@webkit.org>
215
216         Reviewed by Anders Carlsson.
217
218         Add additional loader client functions need to complete WebKitTestRunner
219         https://bugs.webkit.org/show_bug.cgi?id=43684
220
221         * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
222         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp:
223         (WebKit::InjectedBundlePageLoaderClient::didCancelClientRedirectForFrame):
224         (WebKit::InjectedBundlePageLoaderClient::willPerformClientRedirectForFrame):
225         (WebKit::InjectedBundlePageLoaderClient::didChangeLocationWithinPageForFrame):
226         (WebKit::InjectedBundlePageLoaderClient::didFinishDocumentLoadForFrame):
227         (WebKit::InjectedBundlePageLoaderClient::didHandleOnloadEventsForFrame):
228         (WebKit::InjectedBundlePageLoaderClient::didDisplayInsecureContentForFrame):
229         (WebKit::InjectedBundlePageLoaderClient::didRunInsecureContentForFrame):
230         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h:
231         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
232         (WebKit::WebFrameLoaderClient::dispatchDidHandleOnloadEvents):
233         (WebKit::WebFrameLoaderClient::dispatchDidCancelClientRedirect):
234         (WebKit::WebFrameLoaderClient::dispatchWillPerformClientRedirect):
235         (WebKit::WebFrameLoaderClient::dispatchDidChangeLocationWithinPage):
236         (WebKit::WebFrameLoaderClient::dispatchDidFinishDocumentLoad):
237         (WebKit::WebFrameLoaderClient::didDisplayInsecureContent):
238         (WebKit::WebFrameLoaderClient::didRunInsecureContent):
239
240 2010-08-07  Sam Weinig  <sam@webkit.org>
241
242         Another fix for the windows build.
243
244         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
245         (WebKit::NetscapePlugin::isAcceleratedCompositingEnabled):
246
247 2010-08-07  Sam Weinig  <sam@webkit.org>
248
249         Fix windows build.
250
251         * WebProcess/Plugins/PluginView.cpp:
252         (WebKit::PluginView::platformLayer):
253         * WebProcess/Plugins/PluginView.h:
254
255 2010-08-07  Sam Weinig  <sam@webkit.org>
256
257         Reviewed by Anders Carlsson.
258
259         WebKitTestRunner needs GCController
260         <rdar://problem/8213834>
261         https://bugs.webkit.org/show_bug.cgi?id=42701
262
263         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
264         (WKBundleGarbageCollectJavaScriptObjects):
265         (WKBundleGarbageCollectJavaScriptObjectsOnAlternateThreadForDebugging):
266         (WKBundleGetJavaScriptObjectsCount):
267         * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
268         * WebProcess/InjectedBundle/InjectedBundle.cpp:
269         (WebKit::InjectedBundle::garbageCollectJavaScriptObjects):
270         (WebKit::InjectedBundle::garbageCollectJavaScriptObjectsOnAlternateThreadForDebugging):
271         (WebKit::InjectedBundle::javaScriptObjectsCount):
272         * WebProcess/InjectedBundle/InjectedBundle.h:
273
274 2010-08-07  Anders Carlsson  <andersca@apple.com>
275
276         Reviewed by Sam Weinig.
277
278         CA drawing model support for Mac Plugins
279         https://bugs.webkit.org/show_bug.cgi?id=43678
280         <rdar://problem/7929701>
281
282         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
283         (WebKit::NPN_GetValue):
284         Handle WKNVSupportsCompositingCoreAnimationPluginsBool and 
285         NPNVsupportsCoreAnimationBool and return true if accelerated compositing is enabled.
286
287         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
288         (WebKit::NetscapePlugin::isAcceleratedCompositingEnabled):
289         Call PluginController::isAcceleratedCompositingEnabled.
290
291         * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
292         (WebKit::NetscapePlugin::platformPostInitialize):
293         If the plug-in uses the Core Animation drawing model, ask it for its layer.
294
295         (WebKit::NetscapePlugin::platformPaint):
296         Don't send draw events if the Core Animation drawing model is used.
297
298         (WebKit::NetscapePlugin::pluginLayer):
299         Return the plug-in layer.
300
301         * WebProcess/Plugins/Plugin.h:
302         Add a pluginLayer pure virtual member function.
303
304         * WebProcess/Plugins/PluginController.h:
305         Add an isAcceleratedCompositingEnabled pure virtual member function.
306
307         * WebProcess/Plugins/PluginView.cpp:
308         (WebKit::PluginView::initializePlugin):
309         If the plug-in has a layer, enter compositing mode.
310
311         (WebKit::PluginView::platformLayer):
312         Ask the plug-in for its layer.
313
314         (WebKit::PluginView::isAcceleratedCompositingEnabled):
315         Call Settings::acceleratedCompositingEnabled.
316
317         * WebProcess/Plugins/PluginView.h:
318
319 2010-08-06  Sam Weinig  <sam@webkit.org>
320
321         Reviewed by Anders Carlsson.
322
323         Delete key doesn't go Back in WebKit2
324         <rdar://problem/8272978>
325         https://bugs.webkit.org/show_bug.cgi?id=43665
326
327         - Adds support for delete key going back (mac only for now)
328         - Adds support for command-left/command right going back/forward
329         - Flesh out scrolling due to arrow keys on the mac to match old webkit.
330         - Made performDefaultBehaviorForKeyEvent platform specific and added
331           a boolean return value which will be used later to inform the UI process
332           about what events have been processed.
333
334         * Shared/CoreIPCSupport/WebPageProxyMessageKinds.h:
335         (WebPageProxyMessage::):
336         * UIProcess/API/mac/WKView.mm:
337         (-[WKView _wantsKeyDownForEvent:]):
338         * UIProcess/WebPageProxy.cpp:
339         (WebKit::WebPageProxy::didReceiveSyncMessage):
340         * WebProcess/WebPage/WebBackForwardListProxy.cpp:
341         (WebKit::WebBackForwardListProxy::backItem):
342         (WebKit::WebBackForwardListProxy::forwardItem):
343         * WebProcess/WebPage/WebPage.cpp:
344         (WebKit::WebPage::keyEvent):
345         * WebProcess/WebPage/WebPage.h:
346         * WebProcess/WebPage/mac/WebPageMac.mm:
347         (WebKit::scroll):
348         (WebKit::WebPage::performDefaultBehaviorForKeyEvent):
349         * WebProcess/WebPage/qt/WebPageQt.cpp:
350         (WebKit::scroll):
351         (WebKit::WebPage::performDefaultBehaviorForKeyEvent):
352         * WebProcess/WebPage/win/WebPageWin.cpp:
353         (WebKit::scroll):
354         (WebKit::WebPage::performDefaultBehaviorForKeyEvent):
355
356 2010-08-07  Sheriff Bot  <webkit.review.bot@gmail.com>
357
358         Unreviewed, rolling out r64904.
359         http://trac.webkit.org/changeset/64904
360         https://bugs.webkit.org/show_bug.cgi?id=43671
361
362         Broke the Qt Windows builders. (Requested by bbandix on
363         #webkit).
364
365         * WebKit2.pri: Removed.
366         * WebKit2.pro:
367         * WebProcess.pro: Removed.
368
369 2010-08-07  Balazs Kelemen  <kb@inf.u-szeged.hu>
370
371         Reviewed by Eric Seidel.
372
373         NPAPI headers should be included through npruntime_internal.h
374
375         https://bugs.webkit.org/show_bug.cgi?id=43620
376
377         * DerivedSources.pro:
378         * WebProcess/Plugins/NPJSObject.h:
379         * WebProcess/Plugins/NPRuntimeUtilities.h:
380         * WebProcess/Plugins/Netscape/NetscapePluginStream.h:
381
382 2010-08-07  Balazs Kelemen  <kb@inf.u-szeged.hu>
383
384         Reviewed by Eric Seidel.
385
386         [Qt] Build WebKit2 into a static lib
387
388         https://bugs.webkit.org/show_bug.cgi?id=43621
389
390         * WebKit2.pri: Added. Defined addWebKit2Lib function that defines how to link against the static lib.
391         * WebKit2.pro:  Build specification for the WebKit2 framework.
392         * WebProcess.pro: Copied from WebKit2/WebKit2.pro. Build specification for the WebProcess binary.
393
394 2010-08-05  Jon Honeycutt  <jhoneycutt@apple.com>
395
396         WebKitTestRunner needs to be able to set the font smoothing type
397         https://bugs.webkit.org/show_bug.cgi?id=43406
398
399         Reviewed by Adam Roben.
400
401         * Shared/FontSmoothingLevel.h: Added.
402         (WebKit::):
403
404         * Shared/WebPreferencesStore.cpp:
405         (WebKit::WebPreferencesStore::WebPreferencesStore):
406         Initialize fontSmoothingLevel.
407         (WebKit::WebPreferencesStore::swap):
408         Copy fontSmoothingLevel.
409
410         * Shared/WebPreferencesStore.h:
411         (WebKit::WebPreferencesStore::encode):
412         Encode fontSmoothingLevel.
413         (WebKit::WebPreferencesStore::decode):
414         Decode it.
415
416         * UIProcess/API/C/WKPreferencesPrivate.cpp: Added.
417         (WKPreferencesSetFontSmoothingLevel):
418         Get the font smoothing level from the WKFontSmoothingLevel, and call
419         WebPreferences::setFontSmoothingLevel().
420         (WKPreferencesGetFontSmoothingLevel):
421         Get the font smoothing level from WebPreferences, and translate it to a
422         WKFontSmoothingLevel.
423
424         * UIProcess/API/C/WKPreferencesPrivate.h: Added.
425         Declare the font smoothing levels, and declare functions to get and set
426         the level.
427
428         * UIProcess/WebPreferences.cpp:
429         (WebKit::WebPreferences::setFontSmoothingLevel):
430         Set fontSmoothingLevel and call update().
431         (WebKit::WebPreferences::fontSmoothingLevel):
432         Return the level.
433
434         * UIProcess/WebPreferences.h:
435         Declare getter and setter for fontSmoothingLevel.
436
437         * WebKit2.xcodeproj/project.pbxproj:
438         Add new files to project.
439
440         * WebProcess/WebPage/WebPage.cpp:
441         (WebKit::WebPage::preferencesDidChange):
442         Call platformPreferencesDidChange().
443
444         * WebProcess/WebPage/WebPage.h:
445         Declare platformPreferencesDidChange().
446
447         * WebProcess/WebPage/mac/WebPageMac.mm:
448         (WebKit::WebPage::platformPreferencesDidChange):
449         Stubbed.
450
451         * WebProcess/WebPage/qt/WebPageQt.cpp:
452         (WebKit::WebPage::platformPreferencesDidChange):
453         Stubbed.
454
455         * WebProcess/WebPage/win/WebPageWin.cpp:
456         (WebKit::WebPage::platformPreferencesDidChange):
457         On CG platforms, call wkSetFontSmoothingLevel(). This matches the code
458         in old WebKit's WebPreferences. Set the font rendering mode to either
459         normal (CG) or alternative (GDI) based on the font smoothing level. This
460         matches what was done in old WebKit's WebView.
461
462         * win/WebKit2.vcproj:
463         Add FontSmoothingLevel.h and WKPreferencesPrivate.{h,cpp} to project.
464
465         * win/WebKit2Generated.make:
466         Copy WKPreferencesPrivate.h.
467
468 2010-08-06  Anders Carlsson  <andersca@apple.com>
469
470         Build fixes.
471
472         * Platform/win/SharedMemoryWin.cpp:
473         (WebKit::SharedMemory::Handle::encode):
474         (WebKit::SharedMemory::Handle::decode):
475         * Shared/qt/UpdateChunk.cpp:
476         (WebKit::UpdateChunk::encode):
477         (WebKit::UpdateChunk::decode):
478         * Shared/qt/UpdateChunk.h:
479         * Shared/win/UpdateChunk.cpp:
480         (WebKit::UpdateChunk::encode):
481         (WebKit::UpdateChunk::decode):
482         * Shared/win/UpdateChunk.h:
483
484 2010-08-06  Anders Carlsson  <andersca@apple.com>
485
486         Reviewed by Sam Weinig.
487
488         Change all ArgumentEncoder and ArgumentDecoder references to pointers
489         https://bugs.webkit.org/show_bug.cgi?id=43651
490
491         * Platform/CoreIPC/ArgumentCoder.h:
492         * Platform/CoreIPC/ArgumentDecoder.h:
493         * Platform/CoreIPC/Arguments.h:
494         * Platform/CoreIPC/Attachment.cpp:
495         * Platform/CoreIPC/Attachment.h:
496         * Platform/CoreIPC/mac/MachPort.h:
497         * Platform/SharedMemory.h:
498         * Platform/mac/SharedMemoryMac.cpp:
499         * Shared/DrawingAreaBase.cpp:
500         * Shared/DrawingAreaBase.h:
501         * Shared/WebEvent.h:
502         * Shared/WebNavigationDataStore.h:
503         * Shared/WebPreferencesStore.h:
504         * Shared/mac/UpdateChunk.cpp:
505         * Shared/mac/UpdateChunk.h:
506         * UIProcess/ChunkedUpdateDrawingAreaProxy.cpp:
507         * UIProcess/ChunkedUpdateDrawingAreaProxy.h:
508         * UIProcess/DrawingAreaProxy.h:
509         * UIProcess/LayerBackedDrawingAreaProxy.cpp:
510         * UIProcess/LayerBackedDrawingAreaProxy.h:
511         * UIProcess/WebContext.cpp:
512         * UIProcess/WebContext.h:
513         * UIProcess/WebPageProxy.cpp:
514         * UIProcess/WebPageProxy.h:
515         * UIProcess/WebProcessProxy.cpp:
516         * WebProcess/InjectedBundle/InjectedBundle.cpp:
517         * WebProcess/InjectedBundle/InjectedBundle.h:
518         * WebProcess/WebPage/ChunkedUpdateDrawingArea.cpp:
519         * WebProcess/WebPage/ChunkedUpdateDrawingArea.h:
520         * WebProcess/WebPage/DrawingArea.h:
521         * WebProcess/WebPage/LayerBackedDrawingArea.cpp:
522         * WebProcess/WebPage/LayerBackedDrawingArea.h:
523         * WebProcess/WebPage/WebPage.cpp:
524         * WebProcess/WebPage/WebPage.h:
525         * WebProcess/WebProcess.cpp:
526
527 2010-08-06  Anders Carlsson  <andersca@apple.com>
528
529         Reviewed by Sam Weinig.
530
531         Don't try to allocate a vector unless we know the buffer can contain it
532         https://bugs.webkit.org/show_bug.cgi?id=43647
533
534         * Platform/CoreIPC/ArgumentCoders.h:
535         (CoreIPC::):
536         Check that the argument decoder buffer actually can hold all the vector elements.
537
538         * Platform/CoreIPC/ArgumentDecoder.cpp:
539         (CoreIPC::ArgumentDecoder::bufferIsLargeEnoughtToContain):
540         Align the current position to the given alignment, add the size and check if the position is
541         past the end of the buffer.
542
543         * Platform/CoreIPC/ArgumentDecoder.h:
544         (CoreIPC::ArgumentDecoder::bufferIsLargeEnoughtToContain):
545         Get the size and alignment and call the other bufferIsLargeEnoughtToContain overload.
546
547 2010-08-06  Anders Carlsson  <andersca@apple.com>
548
549         Reviewed by Adam Roben.
550
551         Detect invalid CoreIPC messages and call didReceiveInvalidMessage
552         https://bugs.webkit.org/show_bug.cgi?id=43643
553         <rdar://problem/7891069>
554
555         * Platform/CoreIPC/ArgumentDecoder.cpp:
556         (CoreIPC::ArgumentDecoder::alignBufferPosition):
557         If we can't correctly align the buffer position, mark the decoder as invalid.
558
559         * Platform/CoreIPC/ArgumentDecoder.h:
560         (CoreIPC::ArgumentDecoder::isInvalid):
561         Check if the argument decoder is valid.
562
563         (CoreIPC::ArgumentDecoder::markInvalid):
564         Mark the argument decoder as invalid, by setting its buffer position past its end position.
565
566         * Platform/CoreIPC/Connection.cpp:
567         (CoreIPC::Connection::dispatchMessages):
568         Check if m_client is null before dispatching messages. If an argument decoder was marked invalid, call
569         Connection::Client::didReceiveInvalidMessage.
570
571         * Platform/CoreIPC/Connection.h:
572         (CoreIPC::Connection::Message::releaseArguments):
573         Rename destroy to releaseArguments and make it return a PassOwnPtr.
574
575         * UIProcess/WebProcessProxy.cpp:
576         (WebKit::WebProcessProxy::~WebProcessProxy):
577         Call releaseArguments instead of destroy.
578
579         (WebKit::WebProcessProxy::didReceiveInvalidMessage):
580         Kill the web process and invalidate its connection.
581
582         * WebProcess/WebProcess.cpp:
583         (WebKit::WebProcess::didReceiveInvalidMessage):
584         Don't do anything, if the UI process is sending invalid messages there's not much we can do.
585
586         * WebProcess/WebProcess.h:
587
588 2010-08-06  Anders Carlsson  <andersca@apple.com>
589
590         Reviewed by Adam Roben.
591
592         Add CoreIPC::MessageReceiver class
593         https://bugs.webkit.org/show_bug.cgi?id=43637
594
595         * Platform/CoreIPC/Connection.h:
596         (CoreIPC::Connection::MessageReceiver::~MessageReceiver):
597         Add MessageReceiver class and make Client inherit from it.
598
599         (CoreIPC::Connection::MessageReceiver::didReceiveSyncMessage):
600         Change didReceiveSyncMessage from being a pure virtual member function and make it
601         assert by default instead.
602
603         * UIProcess/ChunkedUpdateDrawingAreaProxy.cpp:
604         * UIProcess/ChunkedUpdateDrawingAreaProxy.h:
605         Remove ChunkedUpdateDrawingAreaProxy::didReceiveSyncMessage.
606
607         * Shared/DrawingAreaBase.h:
608         Include "Connection.h" instead.
609
610         * UIProcess/DrawingAreaProxy.h:
611         (WebKit::DrawingAreaProxy::didReceiveSyncMessage):
612         Change didReceiveSyncMessage from being a pure virtual member function and make it
613         assert by default instead.
614
615         * WebProcess/WebProcess.cpp:
616         * WebProcess/WebProcess.h:
617         Remove didReceiveSyncMessage.
618
619 2010-08-06  Jessie Berlin  <jberlin@apple.com>
620
621         Roll out http://trac.webkit.org/changeset/64801, which broke the Safari Windows Build.
622         Unreviewed.
623
624         * UIProcess/PageClient.h:
625         * UIProcess/VisitedLinkProvider.h:
626         * UIProcess/WebContextInjectedBundleClient.h:
627         * UIProcess/WebFrameProxy.h:
628         * UIProcess/WebHistoryClient.h:
629         * UIProcess/WebLoaderClient.h:
630         * UIProcess/WebPolicyClient.h:
631         * UIProcess/WebProcessProxy.h:
632         * UIProcess/WebUIClient.h:
633         * UIProcess/win/WebView.h:
634         * WebProcess/InjectedBundle/InjectedBundlePageEditorClient.h:
635         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h:
636         * WebProcess/InjectedBundle/InjectedBundlePageUIClient.h:
637         * WebProcess/Plugins/NPRuntimeObjectMap.h:
638         * WebProcess/Plugins/Netscape/NetscapePluginStream.h:
639         * WebProcess/Plugins/PluginController.h:
640         * WebProcess/WebPage/WebFrame.h:
641         * WebProcess/WebPage/WebPage.h:
642         * WebProcess/WebProcess.h:
643
644 2010-08-05  Sam Weinig  <sam@webkit.org>
645
646         Reviewed by Anders Carlsson.
647
648         Add form client for injected bundle code
649         https://bugs.webkit.org/show_bug.cgi?id=43603
650
651         * WebKit2.xcodeproj/project.pbxproj:
652         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
653         (WKBundlePageSetFormClient):
654         * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
655         * WebProcess/InjectedBundle/InjectedBundlePageFormClient.cpp: Added.
656         (WebKit::InjectedBundlePageFormClient::InjectedBundlePageFormClient):
657         (WebKit::InjectedBundlePageFormClient::initialize):
658         (WebKit::InjectedBundlePageFormClient::textFieldDidBeginEditing):
659         (WebKit::InjectedBundlePageFormClient::textFieldDidEndEditing):
660         (WebKit::InjectedBundlePageFormClient::textDidChangeInTextField):
661         (WebKit::InjectedBundlePageFormClient::textDidChangeInTextArea):
662         * WebProcess/InjectedBundle/InjectedBundlePageFormClient.h: Added.
663         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
664         (WebKit::WebEditorClient::textFieldDidBeginEditing):
665         (WebKit::WebEditorClient::textFieldDidEndEditing):
666         (WebKit::WebEditorClient::textDidChangeInTextField):
667         (WebKit::WebEditorClient::textDidChangeInTextArea):
668         * WebProcess/WebPage/WebPage.cpp:
669         (WebKit::WebPage::initializeInjectedBundleFormClient):
670         * WebProcess/WebPage/WebPage.h:
671         (WebKit::WebPage::injectedBundleFormClient):
672         * win/WebKit2.vcproj:
673
674 2010-08-05  Sam Weinig  <sam@webkit.org>
675
676         Reviewed by Anders Carlsson.
677
678         Add ability to get a JSValueRef for a node handle and a world
679         https://bugs.webkit.org/show_bug.cgi?id=43591
680
681         - Add API to get a JSValueRef for a world, node and frame (the
682           frame is currently necessary to pick the right globalObject for
683           the node wrapper).
684         - Add API to a JSGlobalContextRef for a world and a frame.
685
686         * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
687         (WKBundleFrameGetJavaScriptContextForWorld):
688         (WKBundleFrameGetJavaScriptWrapperForNodeForWorld):
689         * WebProcess/InjectedBundle/API/c/WKBundleFrame.h:
690         * WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.h:
691         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
692         (WebKit::InjectedBundleNodeHandle::coreNode):
693         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h:
694         * WebProcess/InjectedBundle/InjectedBundleScriptWorld.cpp:
695         (WebKit::InjectedBundleScriptWorld::coreWorld):
696         * WebProcess/InjectedBundle/InjectedBundleScriptWorld.h:
697         * WebProcess/WebPage/WebFrame.cpp:
698         (WebKit::WebFrame::jsContext):
699         (WebKit::WebFrame::jsContextForWorld):
700         (WebKit::WebFrame::jsWrapperForWorld):
701         * WebProcess/WebPage/WebFrame.h:
702
703 2010-08-05  Gavin Barraclough  <barraclough@apple.com>
704
705         Rubber stamped by Sam Weinig
706
707         Bug 43594 - Add string forwards to Forward.h
708         This allows us to remove forward declarations for these classes from
709         WebCore/WebKit (a step in moving these class from WebCore:: to WTF::).
710
711         * UIProcess/PageClient.h:
712         * UIProcess/VisitedLinkProvider.h:
713         * UIProcess/WebContextInjectedBundleClient.h:
714         * UIProcess/WebFrameProxy.h:
715         * UIProcess/WebHistoryClient.h:
716         * UIProcess/WebLoaderClient.h:
717         * UIProcess/WebPolicyClient.h:
718         * UIProcess/WebProcessProxy.h:
719         * UIProcess/WebUIClient.h:
720         * UIProcess/win/WebView.h:
721         * WebProcess/InjectedBundle/InjectedBundlePageEditorClient.h:
722         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h:
723         * WebProcess/InjectedBundle/InjectedBundlePageUIClient.h:
724         * WebProcess/Plugins/NPRuntimeObjectMap.h:
725         * WebProcess/Plugins/Netscape/NetscapePluginStream.h:
726         * WebProcess/Plugins/PluginController.h:
727         * WebProcess/WebPage/WebFrame.h:
728         * WebProcess/WebPage/WebPage.h:
729         * WebProcess/WebProcess.h:
730
731 2010-08-05  Anders Carlsson  <andersca@apple.com>
732
733         Reviewed by Sam Weinig.
734
735         Use the visited link provider for visited links
736         https://bugs.webkit.org/show_bug.cgi?id=43583
737
738         * Shared/CoreIPCSupport/WebProcessMessageKinds.h:
739         (WebProcessMessage::):
740         Remove AddVisitedLink.
741
742         * Shared/CoreIPCSupport/WebProcessProxyMessageKinds.h:
743         (WebProcessProxyMessage::):
744         Remove PopulateVisitedLinks and add AddVisitedLink.
745
746         * UIProcess/WebContext.cpp:
747         (WebKit::WebContext::sharedProcessContext):
748         Initialize the main run loop before creating the context.
749         
750         (WebKit::WebContext::sharedThreadContext):
751         Ditto.
752         
753         (WebKit::WebContext::create):
754         Ditto.
755
756         (WebKit::WebContext::WebContext):
757         Initialize the visited link provider.
758
759         (WebKit::WebContext::processDidFinishLaunching):
760         Ask the visited link provider to populate visited links.
761
762         (WebKit::WebContext::addVisitedLink):
763         Ask the visited link provider to add the visited link.
764
765         * UIProcess/WebProcessProxy.cpp:
766         (WebKit::WebProcessProxy::addVisitedLink):
767         Call WebContext::addVisitedLink.
768
769         (WebKit::WebProcessProxy::didReceiveMessage):
770         Handle AddVisitedLink.
771
772         (WebKit::WebProcessProxy::didFinishLaunching):
773         Call WebContext::processdidFinishLaunching.
774
775         * UIProcess/WebProcessProxy.h:
776         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
777         (WebKit::WebChromeClient::populateVisitedLinks):
778         Don't send the WebProcessProxyMessage::PopulateVisitedLinks message.
779
780         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
781         (WebKit::WebPlatformStrategies::isLinkVisited):
782         Call WebProcess::isLinkVisited.
783         
784         (WebKit::WebPlatformStrategies::addVisitedLink):
785         Call WebProcess::addVisitedLink.
786
787         * WebProcess/WebProcess.cpp:
788         (WebKit::WebProcess::setVisitedLinkTable):
789         Create a shared memory object and tell the visited link table about it.
790
791         (WebKit::WebProcess::visitedLinkStateChanged):
792         Go through the link hashes and call Page::visitedStateChanged.
793
794         (WebKit::WebProcess::allVisitedLinkStateChanged):
795         Call Page::allVisitedStateChanged.
796
797         (WebKit::WebProcess::isLinkVisited):
798         Call VisitedLinkTable::isLinkVisited.
799
800         (WebKit::WebProcess::addVisitedLink):
801         Inform the UI process about the added link.
802
803         (WebKit::WebProcess::didReceiveMessage):
804         Handle new messages.
805
806 2010-08-05  Steve Falkenburg  <sfalken@apple.com>
807
808         Windows build fix.
809         Add missing include path.
810
811         * win/WebKit2Common.vsprops:
812
813 2010-08-05  Brady Eidson  <beidson@apple.com>
814
815         Rubberstamped by Sam Weinig.
816
817         Export WKError.h
818
819         * WebKit2.xcodeproj/project.pbxproj:
820
821 2010-08-05  Steve Falkenburg  <sfalken@apple.com>
822
823         Windows build fix.
824         Correct vcproj nesting.
825
826         * win/WebKit2.vcproj:
827
828 2010-08-05  Sam Weinig  <sam@webkit.org>
829
830         Reviewed by Gavin Barraclough.
831
832         Add script world API for injected bundles
833         https://bugs.webkit.org/show_bug.cgi?id=43577
834
835         * Shared/APIObject.h:
836         (WebKit::APIObject::):
837         * WebKit2.xcodeproj/project.pbxproj:
838         * WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
839         (WebKit::):
840         * WebProcess/InjectedBundle/API/c/WKBundleBase.h:
841         * WebProcess/InjectedBundle/API/c/WKBundleScriptWorld.cpp: Added.
842         (WKBundleScriptWorldGetTypeID):
843         (WKBundleScriptWorldCreateWorld):
844         (WKBundleScriptWorldNormalWorld):
845         (WKBundleScriptWorldRetain):
846         (WKBundleScriptWorldRelease):
847         * WebProcess/InjectedBundle/API/c/WKBundleScriptWorld.h: Added.
848         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
849         * WebProcess/InjectedBundle/InjectedBundleScriptWorld.cpp: Added.
850         (WebKit::allWorlds):
851         (WebKit::InjectedBundleScriptWorld::create):
852         (WebKit::InjectedBundleScriptWorld::getOrCreate):
853         (WebKit::InjectedBundleScriptWorld::normalWorld):
854         (WebKit::InjectedBundleScriptWorld::InjectedBundleScriptWorld):
855         (WebKit::InjectedBundleScriptWorld::~InjectedBundleScriptWorld):
856         * WebProcess/InjectedBundle/InjectedBundleScriptWorld.h: Added.
857         (WebKit::InjectedBundleScriptWorld::type):
858         * win/WebKit2.vcproj:
859         * win/WebKit2Generated.make:
860
861 2010-08-05  Sam Weinig  <sam@webkit.org>
862
863         Reviewed Anders Carlsson.
864
865         Add DOM Node wrapper class for injected bundle
866         https://bugs.webkit.org/show_bug.cgi?id=43524
867
868         - This class should not expose any DOM APIs, but just be a handle that can be used to get a JS
869           wrapper for the node in a specific world.
870
871         * Shared/APIObject.h:
872         (WebKit::APIObject::):
873         * WebKit2.xcodeproj/project.pbxproj:
874         * WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
875         (WebKit::):
876         * WebProcess/InjectedBundle/API/c/WKBundleBase.h:
877         * WebProcess/InjectedBundle/API/c/WKBundleNode.h:
878         * WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp: Added.
879         (WKBundleNodeHandleGetTypeID):
880         (WKBundleNodeHandleRetain):
881         (WKBundleNodeHandleRelease):
882         * WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.h: Added.
883         * WebProcess/InjectedBundle/DOM: Added.
884         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp: Added.
885         (WebKit::domHandleCache):
886         (WebKit::getDOMHandle):
887         (WebKit::setDOMHandle):
888         (WebKit::removeDOMHandle):
889         (WebKit::InjectedBundleNodeHandle::getOrCreate):
890         (WebKit::InjectedBundleNodeHandle::create):
891         (WebKit::InjectedBundleNodeHandle::InjectedBundleNodeHandle):
892         (WebKit::InjectedBundleNodeHandle::~InjectedBundleNodeHandle):
893         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h: Added.
894         (WebKit::InjectedBundleNodeHandle::type):
895         * win/WebKit2.vcproj:
896         * win/WebKit2Generated.make:
897
898 2010-08-05  Anders Carlsson  <andersca@apple.com>
899
900         Build fix.
901
902         * Platform/mac/SharedMemoryMac.cpp:
903
904 2010-08-05  Anders Carlsson  <andersca@apple.com>
905
906         Reviewed by Sam Weinig.
907
908         Add VisitedLinkProvider class
909         https://bugs.webkit.org/show_bug.cgi?id=43570
910
911         * Shared/CoreIPCSupport/WebProcessMessageKinds.h:
912         (WebProcessMessage::):
913         Add SetVisitedLinkTable, VisitedLinkStateChanged and AllVisitedLinkStateChanged.
914
915         * UIProcess/VisitedLinkProvider.cpp: Added.
916         (WebKit::VisitedLinkProvider::VisitedLinkProvider):
917         Initialize table.
918
919         (WebKit::VisitedLinkProvider::populateVisitedLinksIfNeeded):
920         Ask the context to populate visited links.
921
922         (WebKit::VisitedLinkProvider::addVisitedLink):
923         Add the link hash to the set of pending visited links and start the timer.
924
925         (WebKit::nextPowerOf2):
926         Add helper function.
927
928         (WebKit::tableSizeForKeyCount):
929         Given a key count, returns a table size. The table size is always a power of two, and
930         is chosen so that the table is always at least half empty.
931
932         (WebKit::VisitedLinkProvider::pendingVisitedLinksTimerFired):
933         First, check if we need to resize the hash table and allocate new shared memory for it if that is the case.
934         Then, go through the pending link hash vector and insert all the elements in the table. Finally, notify the web
935         process about visited links whose state have changed.
936
937         * WebProcess/WebProcess.cpp:
938         (WebKit::WebProcess::didReceiveMessage):
939         Add case statements.
940
941         * win/WebKit2.vcproj:
942         * WebKit2.xcodeproj/project.pbxproj:
943         Add VisitedLinkProvider.cpp and VisitedLinkProvider.h.
944
945 2010-08-05  Anders Carlsson  <andersca@apple.com>
946
947         Reviewed by Sam Weinig.
948
949         Add VisitedLinkTable class
950         https://bugs.webkit.org/show_bug.cgi?id=43566
951
952         * Shared/VisitedLinkTable.cpp: Added.
953         (WebKit::VisitedLinkTable::VisitedLinkTable):
954         (WebKit::VisitedLinkTable::~VisitedLinkTable):
955         Add out of line constructors so we won't have to include SharedMemory.h in the 
956         VisitedLinkTable.h header.
957
958         (WebKit::isPowerOf2):
959         Add helper function.
960
961         (WebKit::VisitedLinkTable::setSharedMemory):
962         Set the new shared memory and update the table size and hash.
963
964         (WebKit::doubleHash):
965         Add helper function from the WTF HashTable.
966
967         (WebKit::VisitedLinkTable::addLinkHash):
968         Add a link hash to the table.
969
970         (WebKit::VisitedLinkTable::isLinkVisited):
971         See if there is an entry for the given link hash.
972
973         * Shared/VisitedLinkTable.h: Added.
974         (WebKit::VisitedLinkTable::sharedMemory):
975         * WebKit2.xcodeproj/project.pbxproj:
976         * win/WebKit2.vcproj:
977         Add VisitedLinkTable.cpp and VisitedLinkTable.h
978
979 2010-08-04  Anders Carlsson  <andersca@apple.com>
980
981         Reviewed by Adam Roben.
982
983         Add shared memory abstraction
984         https://bugs.webkit.org/show_bug.cgi?id=43535
985         <rdar://problem/8275295>
986
987         * Platform/SharedMemory.h: Added.
988         (WebKit::SharedMemory::):
989         (WebKit::SharedMemory::size):
990         Return the size, in bytes, of the shared memory object.
991         
992         (WebKit::SharedMemory::data):
993         Return a pointer to the shared memory object.
994         
995         * Platform/mac/SharedMemoryMac.cpp: Added.
996         (WebKit::SharedMemory::Handle):
997         A shared memory handle, which can be passed in a CoreIPC Connection.
998
999         (WebKit::SharedMemory::create):
1000         Allocate the shared memory.
1001
1002         (WebKit::SharedMemory::~SharedMemory):
1003         Deallocate the shared memory.
1004
1005         (WebKit::SharedMemory::createHandle):
1006         Create a mach port and pass it to the handle.
1007
1008         (WebKit::SharedMemory::systemPageSize):
1009         Return the system page size, in bytes.
1010         
1011         * Platform/win/SharedMemoryWin.cpp: Added.
1012         Add stubbed out version.
1013
1014         * WebKit2.xcodeproj/project.pbxproj:
1015         * win/WebKit2.vcproj:
1016         Add files.
1017
1018 2010-08-05  Jian Li  <jianli@chromium.org>
1019
1020         Reviewed by David Levin.
1021
1022         Unify blob related feature defines to ENABLE(BLOB).
1023         https://bugs.webkit.org/show_bug.cgi?id=43081
1024
1025         * Configurations/FeatureDefines.xcconfig:
1026
1027 2010-08-05  Balazs Kelemen  <kb@inf.u-szeged.hu>
1028
1029         Rubber-stamped by Kenneth Rohde Christiansen.
1030
1031         [Qt] Remove redundant include paths from WebKit2.pro.
1032
1033         * WebKit2.pro:
1034
1035 2010-08-04  Adam Roben  <aroben@apple.com>
1036
1037         Teach WebKit2 how to load the TestNetscapePlugin
1038
1039         Fixes <http://webkit.org/b/43513> WebKitTestRunner on Windows fails to
1040         load TestNetscapePlugin
1041
1042         Reviewed by Jon Honeycutt.
1043
1044         * Platform/Module.cpp:
1045         (WebKit::Module::Module): Initialize m_module on Windows.
1046
1047         * Platform/Module.h: Added m_module on Windows.
1048
1049         * Platform/win/ModuleWin.cpp:
1050         (WebKit::Module::load): Implemented using ::LoadLibraryExW.
1051         (WebKit::Module::unload): Implemented using ::FreeLibrary.
1052         (WebKit::Module::platformFunctionPointer): Implemented using
1053         ::GetProcAddress.
1054
1055         * Platform/win/RunLoopWin.cpp:
1056         (RunLoop::TimerBase::timerFired): Kill the native timer before calling
1057         the fired callback. This makes all our timers non-repeating, but
1058         that's all we need currently.
1059         (RunLoop::TimerBase::start): Added an assertion to help us figure out
1060         when we need to implement repeating timers. Also fixed a typo.
1061
1062         * UIProcess/Plugins/win/PluginInfoStoreWin.cpp:
1063         (WebKit::PluginInfoStore::pluginsDirectories): Added a FIXME.
1064
1065         (WebKit::PathWalker::PathWalker):
1066         (WebKit::PathWalker::~PathWalker):
1067         (WebKit::PathWalker::isValid):
1068         (WebKit::PathWalker::data):
1069         (WebKit::PathWalker::step):
1070         Added. This class wraps the ::FindFirstFile/::FindNextFile APIs.
1071
1072         (WebKit::PluginInfoStore::pluginPathsInDirectory): Implemented by
1073         porting logic from
1074         WebCore::PluginDatabase::getPluginPathsInDirectories.
1075         (WebKit::getVersionInfo): Copied from PluginDatabaseWin.cpp.
1076         (WebKit::PluginInfoStore::getPluginInfo): Implemented by porting logic
1077         from WebCore::PluginPackage::fetchInfo.
1078         (WebKit::PluginInfoStore::shouldUsePlugin): Changed to always return
1079         true for now. Added a FIXME about implementing this for real.
1080
1081         * UIProcess/WebProcessProxy.cpp:
1082         (WebKit::WebProcessProxy::didReceiveSyncMessage):
1083         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1084         (WebKit::WebFrameLoaderClient::createPlugin):
1085         Removed PLATFORM(MAC) guards around plugin code.
1086
1087         * win/WebKit2.vcproj: Let VS sort the file.
1088
1089 2010-08-05  Antti Koivisto  <koivisto@iki.fi>
1090
1091         Reviewed by Kenneth Rohde Christiansen.
1092
1093         Use toCopiedRef for making WK objects
1094         https://bugs.webkit.org/show_bug.cgi?id=43552
1095
1096         * UIProcess/API/cpp/qt/WKStringQt.cpp:
1097         (WKStringCreateWithQString):
1098         * UIProcess/API/cpp/qt/WKURLQt.cpp:
1099         (WKURLCreateWithQUrl):
1100
1101 2010-08-04  Brady Eidson  <beidson@apple.com>
1102
1103         Reviewed by Sam Weinig.
1104
1105         Change callback APIs to include an Error object in one callback, instead of having a second callback for failure.
1106         https://bugs.webkit.org/show_bug.cgi?id=43522
1107
1108         This includes adding a WKErrorRef object which - for now - either exists or doesn't.
1109         In the future, it may contain useful information about the error.
1110         
1111         * WebKit2.xcodeproj/project.pbxproj:
1112         * win/WebKit2.vcproj:
1113         * win/WebKit2Generated.make:
1114         
1115         * Shared/APIObject.h:
1116         (WebKit::APIObject::):
1117         * UIProcess/API/C/WKAPICast.h:
1118         * UIProcess/API/C/WKBase.h:
1119         
1120         * Shared/WebError.h: Added.
1121         (WebKit::WebError::create):
1122         (WebKit::WebError::WebError):
1123         (WebKit::WebError::type):
1124         
1125         * UIProcess/API/C/WKError.cpp: Added.
1126         (WKErrorGetTypeID):
1127         * UIProcess/API/C/WKError.h: Added.
1128         
1129         * UIProcess/API/C/WKPage.cpp:
1130         (WKPageRunJavaScriptInMainFrame):
1131         (callRunJavaScriptBlockAndRelease):
1132         (WKPageRunJavaScriptInMainFrame_b):
1133         (WKPageRenderTreeExternalRepresentation):
1134         (callRenderTreeExternalRepresentationBlockAndDispose):
1135         (WKPageRenderTreeExternalRepresentation_b):
1136         * UIProcess/API/C/WKPage.h:
1137         * UIProcess/API/C/WKPagePrivate.h:
1138         
1139         * UIProcess/GenericCallback.h:
1140         (WebKit::GenericCallback::create):
1141         (WebKit::GenericCallback::performCallbackWithReturnValue):
1142         (WebKit::GenericCallback::invalidate):
1143         (WebKit::GenericCallback::GenericCallback):
1144
1145 2010-08-04  Ada Chan  <adachan@apple.com>
1146
1147         Windows build fix        
1148
1149         * win/WebKit2Generated.make:
1150
1151 2010-08-04  John Sullivan  <sullivan@apple.com>
1152
1153         Build fix, rubber-stamped by Brady Eidson.
1154
1155         * WebKit2.xcodeproj/project.pbxproj:
1156         Made WKData.h a public header.
1157
1158 2010-08-04  Adam Roben  <aroben@apple.com>
1159
1160         Windows build fix
1161
1162         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
1163         (WebKit::NPN_SetValue): Removed unreachable code.
1164
1165 2010-08-04  Adam Roben  <aroben@apple.com>
1166
1167         Windows build fix
1168
1169         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
1170         (WebKit::NPN_SetValue): Added some case statements that are compiled
1171         on Windows to avoid a warning about having default but not cases.
1172
1173 2010-08-04  Adam Roben  <aroben@apple.com>
1174
1175         Windows build fix
1176
1177         * win/WebKit2.vcproj: Added NetscapeBrowserFuncs.
1178
1179 2010-08-04  Adam Roben  <aroben@apple.com>
1180
1181         Windows build fix
1182
1183         The functions in NetscapePluginModuleWin.cpp have been moved to
1184         NetscapePluginModule.cpp.
1185
1186         * WebProcess/Plugins/Netscape/win/NetscapePluginModuleWin.cpp: Removed.
1187         * win/WebKit2.vcproj: Removed NetscapePluginModuleWin.
1188
1189 2010-08-04  Adam Roben  <aroben@apple.com>
1190
1191         Move bundle-loading code from NetscapePluginModule to a new Module
1192         class
1193
1194         This allows more NetscapePluginModule code to be cross-platform.
1195
1196         Fixes <http://webkit.org/b/43497> NetscapePluginModule::try/unload
1197         should be cross-platform
1198
1199         Reviewed by Anders Carlsson.
1200
1201         * Platform/Module.cpp: Added.
1202         (WebKit::Module::Module): Store our path.
1203         (WebKit::Module::~Module): Unload our native module.
1204
1205         * Platform/Module.h: Added.
1206         (WebKit::Module::leakBundle): Does what it says.
1207         (WebKit::Module::functionPointer): Returns a pointer to the named
1208         function, with the right type.
1209
1210         * Platform/mac/ModuleMac.mm: Added.
1211         (WebKit::Module::load): Code was moved here from
1212         NetscapePluginModule::tryLoad.
1213         (WebKit::Module::unload): Just clears our bundle.
1214         (WebKit::Module::platformFunctionPointer): Code was moved here from
1215         NetscapePluginModuleMac.cpp.
1216
1217         * Platform/qt/ModuleQt.cpp: Added.
1218         (WebKit::Module::load):
1219         (WebKit::Module::unload):
1220         (WebKit::Module::platformFunctionPointer):
1221         * Platform/win/ModuleWin.cpp: Added.
1222         (WebKit::Module::load):
1223         (WebKit::Module::unload):
1224         (WebKit::Module::platformFunctionPointer):
1225         Just stubbed out these functions.
1226
1227         * WebKit2.xcodeproj/project.pbxproj: Added Module.
1228
1229         * WebProcess/Plugins/Netscape/NetscapePluginModule.cpp:
1230         (WebKit::NetscapePluginModule::tryLoad):
1231         (WebKit::NetscapePluginModule::unload):
1232         Moved here from NetscapePluginModuleMac.cpp. Now uses the
1233         cross-platform m_module member.
1234
1235         * WebProcess/Plugins/Netscape/NetscapePluginModule.h: Replaced
1236         m_bundle with m_module.
1237
1238         * WebProcess/Plugins/Netscape/mac/NetscapePluginModuleMac.cpp: Removed.
1239
1240         * win/WebKit2.vcproj: Added Module.
1241
1242 2010-08-04  Brady Eidson  <beidson@apple.com>
1243
1244         Reviewed by Sam Weinig.
1245
1246         Lay the groundwork for saving/restoring page session state to WK2
1247         https://bugs.webkit.org/show_bug.cgi?id=43495
1248
1249         * WebKit2.xcodeproj/project.pbxproj:
1250         * win/WebKit2.vcproj:
1251
1252         * Shared/APIObject.h:
1253         (WebKit::APIObject::):
1254         * UIProcess/API/C/WKAPICast.h:
1255         * UIProcess/API/C/WKBase.h:
1256         
1257         Arbitrary byte buffer:
1258         * Shared/WebData.h: Added.
1259         (WebKit::WebData::create):
1260         (WebKit::WebData::bytes):
1261         (WebKit::WebData::size):
1262         (WebKit::WebData::WebData):
1263         (WebKit::WebData::type):
1264         
1265         API facing object to act as a byte buffer:
1266         * UIProcess/API/C/WKData.cpp: Added.
1267         (WKDataGetTypeID):
1268         (WKDataCreate):
1269         (WKDataGetBytes):
1270         (WKDataGetSize):
1271         (WKDataRetain):
1272         (WKDataRelease):
1273         * UIProcess/API/C/WKData.h: Added.
1274
1275         API for saving/restoring state:
1276         * UIProcess/API/C/WKPage.cpp:
1277         (WKPageCopySessionState):
1278         (WKPageRestoreFromSessionState):
1279         * UIProcess/API/C/WKPage.h:
1280
1281         These will be filled in later:
1282         * UIProcess/WebPageProxy.cpp:
1283         (WebKit::WebPageProxy::sessionState):
1284         (WebKit::WebPageProxy::restoreFromSessionState):
1285         * UIProcess/WebPageProxy.h:
1286
1287
1288 2010-08-04  Sam Weinig  <sam@webkit.org>
1289
1290         Reviewed by Anders Carlsson.
1291
1292         Set correct default minimumFontSize.
1293
1294         * Shared/WebPreferencesStore.cpp:
1295         (WebKit::WebPreferencesStore::WebPreferencesStore):
1296
1297 2010-08-03  Adam Roben  <aroben@apple.com>
1298
1299         Turn on PLATFORM_STRATEGIES on Windows
1300
1301         Fixes <http://webkit.org/b/43431>.
1302
1303         Reviewed by Anders Carlsson.
1304
1305         * win/WebKit2.vcproj: Added WebPlatformStrategies. Also let VS reorder
1306         this file as it saw fit.
1307
1308 2010-08-03  Balazs Kelemen  <kb@inf.u-szeged.hu>
1309
1310         Reviewed by Kenneth Rohde Christiansen.
1311
1312         [Qt] Close the WebProcess
1313
1314         https://bugs.webkit.org/show_bug.cgi?id=41690
1315
1316         * Platform/CoreIPC/qt/ConnectionQt.cpp:
1317         (CoreIPC::Connection::open): Registered connectionDidClose to be called when the client disconnected.
1318         * Platform/qt/RunLoopQt.cpp:
1319         (RunLoop::stop): Implemented by calling QCoreApplication::exit.
1320
1321 2010-08-03  Jon Honeycutt  <jhoneycutt@apple.com>
1322
1323         WebKitTestRunner needs to activate the Mac font ascent hack
1324         https://bugs.webkit.org/show_bug.cgi?id=43404
1325
1326         Reviewed by Darin Adler.
1327
1328         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
1329         (WKBundleActivateMacFontAscentHack):
1330         Get the InjectedBundle, and calls its activateMacFontAscentHack().
1331
1332         * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
1333         Declare WKBundleActivateMacFontAscentHack().
1334
1335         * WebProcess/InjectedBundle/InjectedBundle.h:
1336         Declare activateMacFontAscentHack().
1337
1338         * WebProcess/InjectedBundle/mac/InjectedBundleMac.cpp:
1339         (WebKit::InjectedBundle::activateMacFontAscentHack):
1340         Stubbed.
1341
1342         * WebProcess/InjectedBundle/qt/InjectedBundleQt.cpp:
1343         (WebKit::InjectedBundle::activateMacFontAscentHack):
1344         Stubbed.
1345
1346         * WebProcess/InjectedBundle/win/InjectedBundleWin.cpp:
1347         (WebKit::InjectedBundle::activateMacFontAscentHack):
1348         Activate the ascent hack.
1349
1350 2010-08-03  Simon Fraser  <simon.fraser@apple.com>
1351
1352         Fix typo in typo fix.
1353
1354         * Shared/DrawingAreaBase.h:
1355         (WebKit::DrawingAreaBase::DrawingAreaInfo::DrawingAreaInfo):
1356         (WebKit::DrawingAreaBase::DrawingAreaBase):
1357
1358 2010-08-03  Simon Fraser  <simon.fraser@apple.com>
1359
1360         Fix typo in previous commit.
1361
1362         * Shared/DrawingAreaBase.h:
1363         (WebKit::DrawingAreaBase::DrawingAreaInfo::DrawingAreaInfo):
1364         (WebKit::DrawingAreaBase::DrawingAreaBase):
1365
1366 2010-08-03  Simon Fraser  <simon.fraser@apple.com>
1367
1368         Reviewed by Anders Carlsson.
1369
1370         Compositing iframe layout test crashes in WebKit2
1371         https://bugs.webkit.org/show_bug.cgi?id=42860
1372         
1373         Fix assertion caused by a DrawingArea handling a message that was targetted at an older DrawingArea
1374         that it has replaced.
1375         
1376         This was done by assigning a unique ID to each DrawingAreaProxy that gets created, and passing
1377         this ID, along with the type, to the WebProcess via an encoded DrawingAreaInfo. Each message
1378         also includes this ID. Messages with an ID that doesn't match that of the current DrawingArea are ignored.
1379         
1380         Refactored some common code and data into a DrawingAreaBase class which is shared, and adding
1381         encode/decode of DrawingAreaInfo.
1382
1383         * Shared/DrawingAreaBase.cpp: Added.
1384         (WebKit::DrawingAreaBase::encode):
1385         (WebKit::DrawingAreaBase::decode):
1386         * Shared/DrawingAreaBase.h: Added.
1387         (WebKit::DrawingAreaBase::):
1388         (WebKit::DrawingAreaBase::~DrawingAreaBase):
1389         (WebKit::DrawingAreaBase::type):
1390         (WebKit::DrawingAreaBase::id):
1391         (WebKit::DrawingAreaBase::DrawingAreaInfo::DrawingAreaInfo):
1392         (WebKit::DrawingAreaBase::DrawingAreaBase):
1393         (CoreIPC::):
1394         * UIProcess/ChunkedUpdateDrawingAreaProxy.cpp:
1395         (WebKit::ChunkedUpdateDrawingAreaProxy::setSize):
1396         (WebKit::ChunkedUpdateDrawingAreaProxy::setPageIsVisible):
1397         (WebKit::ChunkedUpdateDrawingAreaProxy::update):
1398         * UIProcess/DrawingAreaProxy.cpp:
1399         (WebKit::DrawingAreaProxy::DrawingAreaProxy):
1400         (WebKit::DrawingAreaProxy::nextDrawingAreaID):
1401         * UIProcess/DrawingAreaProxy.h:
1402         * UIProcess/LayerBackedDrawingAreaProxy.cpp:
1403         (WebKit::LayerBackedDrawingAreaProxy::setSize):
1404         (WebKit::LayerBackedDrawingAreaProxy::setPageIsVisible):
1405         (WebKit::LayerBackedDrawingAreaProxy::update):
1406         * UIProcess/LayerBackedDrawingAreaProxy.h:
1407         * UIProcess/WebPageProxy.cpp:
1408         (WebKit::WebPageProxy::didReceiveSyncMessage):
1409         * WebKit2.xcodeproj/project.pbxproj:
1410         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1411         (WebKit::WebChromeClient::createWindow):
1412         * WebProcess/WebPage/ChunkedUpdateDrawingArea.cpp:
1413         (WebKit::ChunkedUpdateDrawingArea::ChunkedUpdateDrawingArea):
1414         (WebKit::ChunkedUpdateDrawingArea::didReceiveMessage):
1415         * WebProcess/WebPage/ChunkedUpdateDrawingArea.h:
1416         * WebProcess/WebPage/DrawingArea.cpp:
1417         (WebKit::DrawingArea::create):
1418         (WebKit::DrawingArea::DrawingArea):
1419         * WebProcess/WebPage/DrawingArea.h:
1420         * WebProcess/WebPage/LayerBackedDrawingArea.cpp:
1421         (WebKit::LayerBackedDrawingArea::LayerBackedDrawingArea):
1422         (WebKit::LayerBackedDrawingArea::didReceiveMessage):
1423         * WebProcess/WebPage/LayerBackedDrawingArea.h:
1424         * WebProcess/WebPage/WebPage.cpp:
1425         (WebKit::WebPage::create):
1426         (WebKit::WebPage::WebPage):
1427         (WebKit::WebPage::changeAcceleratedCompositingMode):
1428         * WebProcess/WebPage/WebPage.h:
1429         * WebProcess/WebProcess.cpp:
1430         (WebKit::WebProcess::createWebPage):
1431         (WebKit::WebProcess::didReceiveMessage):
1432         * WebProcess/WebProcess.h:
1433         * win/WebKit2.vcproj:
1434
1435 2010-08-03  Alex Milowski  <alex@milowski.com>
1436
1437         Reviewed by Beth Dakin.
1438
1439         Changed the ENABLE_MATHML value to enable MathML by default.
1440
1441         * Configurations/FeatureDefines.xcconfig:
1442
1443 2010-08-03  Simon Fraser  <simon.fraser@apple.com>
1444
1445         Reviewed by Sam Weinig.
1446
1447         Compositing iframe layout test crashes in WebKit2
1448         https://bugs.webkit.org/show_bug.cgi?id=42860
1449         
1450         Part one of the fix: make DrawingArea ref-counted, so that the object
1451         can survide a swap in drawing areas inside the run loop observer callback.
1452
1453         * WebProcess/WebPage/DrawingArea.cpp:
1454         (WebKit::DrawingArea::create):
1455         * WebProcess/WebPage/DrawingArea.h:
1456         * WebProcess/WebPage/WebPage.h:
1457         * WebProcess/WebPage/mac/LayerBackedDrawingAreaMac.mm:
1458         (WebKit::LayerBackedDrawingArea::platformClear):
1459         (WebKit::LayerBackedDrawingArea::updateLayoutRunLoopObserverCallback):
1460         (WebKit::LayerBackedDrawingArea::updateLayoutRunLoopObserverFired):
1461
1462 2010-08-03  Anders Carlsson  <andersca@apple.com>
1463
1464         Reviewed by Adam Roben.
1465
1466         Frequent ASSERT_NOT_REACHED in Connection::processIncomingMessage when running regression tests
1467         https://bugs.webkit.org/show_bug.cgi?id=42926
1468         <rdar://problem/8237329>
1469
1470         Remove this assert, it's bogus. It would fire when a reply came in on the connection queue before 
1471         waitForReply was called on the client thread, but that case is already covered.
1472
1473         * Platform/CoreIPC/Connection.cpp:
1474         (CoreIPC::Connection::processIncomingMessage):
1475
1476 2010-08-03  Adam Roben  <aroben@apple.com>
1477
1478         Compile out two Mac-only localized strings on non-Mac platforms
1479
1480         Fixes <http://webkit.org/b/43433> copyImageUnknownFileLabel and
1481         AXARIAContentGroupText should only be compiled on Mac
1482
1483         Reviewed by Anders Carlsson.
1484
1485         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
1486         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
1487         Wrapped copyImageUnknownFileLabel and AXARIAContentGroupText in
1488         PLATFORM(MAC).
1489
1490 2010-08-03  Balazs Kelemen  <kb@inf.u-szeged.hu>
1491
1492         [Qt] Unreviewed typo fix in the WebKit2/DerivedSources.pro project file.
1493
1494         Use QMAKE_MKDIR as the command for directory creation.
1495
1496         * DerivedSources.pro:
1497
1498 2010-08-02  Brady Eidson  <beidson@apple.com>
1499
1500         Reviewed by Anders Carlsson.
1501
1502         Add VisitedLinkStrategy for each platform to implement
1503         https://bugs.webkit.org/show_bug.cgi?id=43393
1504
1505         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
1506         (WebKit::WebPlatformStrategies::createVisitedLinkStrategy):
1507         (WebKit::WebPlatformStrategies::isLinkVisited): Call back into PageGroup's visited links, for now.
1508         (WebKit::WebPlatformStrategies::addVisitedLink): Ditto.
1509         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
1510
1511 2010-07-27  Luiz Agostini  <luiz.agostini@openbossa.org>
1512
1513         Reviewed by Darin Fisher.
1514
1515         PopupMenu refactoring in preparation to WebKit2
1516         https://bugs.webkit.org/show_bug.cgi?id=42592
1517
1518         Classes WebPopupMenu and WebSearchPopupMenu inherit from PopupMenu and
1519         SearchPopupMenu respectively. At this point they are just empty implementations.
1520
1521         * WebProcess/WebCoreSupport/WebPopupMenu.cpp: Added.
1522         (WebKit::WebPopupMenu::WebPopupMenu):
1523         (WebKit::WebPopupMenu::~WebPopupMenu):
1524         (WebKit::WebPopupMenu::disconnectClient):
1525         (WebKit::WebPopupMenu::show):
1526         (WebKit::WebPopupMenu::hide):
1527         (WebKit::WebPopupMenu::updateFromElement):
1528         * WebProcess/WebCoreSupport/WebPopupMenu.h: Added.
1529         * WebProcess/WebCoreSupport/WebSearchPopupMenu.cpp: Added.
1530         (WebKit::WebSearchPopupMenu::WebSearchPopupMenu):
1531         (WebKit::WebSearchPopupMenu::popupMenu):
1532         (WebKit::WebSearchPopupMenu::saveRecentSearches):
1533         (WebKit::WebSearchPopupMenu::loadRecentSearches):
1534         (WebKit::WebSearchPopupMenu::enabled):
1535         * WebProcess/WebCoreSupport/WebSearchPopupMenu.h: Added.
1536
1537         As ChromeClient was made responsible for providing PopupMenu and SearchPopupMenu
1538         instances, concrete classes that inherit from ChromeClient needed to be changed to
1539         implement the new methods.
1540
1541         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1542         (WebKit::WebChromeClient::selectItemWritingDirectionIsNatural):
1543         (WebKit::WebChromeClient::createPopupMenu):
1544         (WebKit::WebChromeClient::createSearchPopupMenu):
1545         * WebProcess/WebCoreSupport/WebChromeClient.h:
1546
1547         build issues:
1548
1549         * WebKit2.xcodeproj/project.pbxproj:
1550         * win/WebKit2.vcproj:
1551
1552 2010-08-02  Anders Carlsson  <andersca@apple.com>
1553
1554         Reviewed by Sam Weinig.
1555
1556         Fix plug-in test failures and remove tests from the Skipped list
1557         https://bugs.webkit.org/show_bug.cgi?id=43389
1558
1559         * WebProcess/Plugins/JSNPMethod.cpp:
1560         JSNPMethod::s_info should specify InternalFunction::info as its parent.
1561
1562         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
1563         (WebKit::NetscapePlugin::cancelStreamLoad):
1564         Special-case the manual stream and call PluginController::cancelManualStreamLoad.
1565
1566         * WebProcess/Plugins/Netscape/NetscapePluginStream.cpp:
1567         (WebKit::NetscapePluginStream::stop):
1568         It's OK to call stop on a stream that hasn't been started. Remove assertion and return early.
1569         
1570         * WebProcess/Plugins/PluginController.h:
1571         Add cancelManualStreamLoad.
1572
1573         * WebProcess/Plugins/PluginView.cpp:
1574         (WebKit::PluginView::cancelManualStreamLoad):
1575         Tell the document loader to cancel the main resource load.
1576
1577         * WebProcess/WebPage/WebFrame.cpp:
1578         (WebKit::WebFrame::innerText):
1579         Check for a null document element.
1580
1581 2010-08-02  Anders Carlsson  <andersca@apple.com>
1582
1583         Reviewed by Sam Weinig.
1584
1585         Add support for loading manual streams
1586         https://bugs.webkit.org/show_bug.cgi?id=43380
1587
1588         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
1589         (WebKit::NetscapePlugin::NetscapePlugin):
1590         Initialize m_loadManually to false.
1591
1592         (WebKit::NetscapePlugin::removePluginStream):
1593         Special case the manual stream.
1594
1595         (WebKit::NetscapePlugin::initialize):
1596         Don't request the stream if we're already loading.
1597
1598         (WebKit::NetscapePlugin::manualStreamDidReceiveResponse):
1599         Create the manual stream and pass the response to it.
1600
1601         (WebKit::NetscapePlugin::manualStreamDidReceiveData):
1602         Pass the data to the manual stream.
1603
1604         (WebKit::NetscapePlugin::manualStreamDidFinishLoading):
1605         Call the manual stream.
1606
1607         (WebKit::NetscapePlugin::manualStreamDidFail):
1608         Ditto.
1609
1610         * WebProcess/Plugins/Plugin.h:
1611         Add pure virtual member functions for manual stream loading.
1612
1613         * WebProcess/Plugins/PluginView.cpp:
1614         (WebKit::buildHTTPHeaders):
1615         Put code in a function so both PluginView::Stream::didReceiveResponse and 
1616         manualLoadDidReceiveResponse can call it.
1617
1618         (WebKit::PluginView::Stream::didReceiveResponse):
1619         Call buildHTTPHeaders.
1620
1621         (WebKit::PluginView::Stream::didFinishLoading):
1622         Protect the plug-in when calling destroyStream.
1623
1624         (WebKit::PluginView::manualLoadDidReceiveResponse):
1625         Call Plugin::manualStreamDidReceiveResponse.
1626
1627         (WebKit::PluginView::manualLoadDidReceiveData):
1628         Call Plugin::manualStreamDidReceiveData.
1629
1630         (WebKit::PluginView::manualLoadDidFinishLoading):
1631         Call Plugin::manualStreamDidFinishLoading.
1632
1633         (WebKit::PluginView::manualLoadDidFail):
1634         Call Plugin::manualStreamDidFail.
1635
1636         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1637         (WebKit::WebFrameLoaderClient::WebFrameLoaderClient):
1638         Initialize m_hasSentResponseToPluginView to false.
1639
1640         (WebKit::WebFrameLoaderClient::setMainDocumentError):
1641         Call PluginView::manualLoadDidFail.
1642
1643         (WebKit::WebFrameLoaderClient::committedLoad):
1644         Call PluginView::manualLoadDidReceiveResponse.
1645
1646         (WebKit::WebFrameLoaderClient::finishedLoading):
1647         Call PluginView::manualLoadDidFinishLoading.
1648
1649         (WebKit::WebFrameLoaderClient::redirectDataToPlugin):
1650         Keep track of the plug-in view.
1651
1652 2010-08-02  Brady Eidson  <beidson@apple.com>
1653
1654         Reviewed by Anders Carlsson.
1655
1656         Basic WK2 visited link coloring
1657         https://bugs.webkit.org/show_bug.cgi?id=43377
1658
1659         Add simple API that allows the WK2 app to add 1 visited link at a time.
1660         For now, this just pipes each individual LinkHash down to WebCore.
1661         
1662         * Shared/CoreIPCSupport/WebProcessMessageKinds.h:
1663         (WebProcessMessage::):
1664
1665         * UIProcess/API/C/WKContext.cpp:
1666         (WKContextAddVisitedLink):
1667         * UIProcess/API/C/WKContext.h:
1668
1669         * UIProcess/WebContext.cpp:
1670         (WebKit::WebContext::addVisitedLink):
1671         * UIProcess/WebContext.h:
1672
1673         * WebProcess/WebProcess.cpp:
1674         (WebKit::WebProcess::addVisitedLinkHash):
1675         (WebKit::WebProcess::didReceiveMessage):
1676         * WebProcess/WebProcess.h:
1677
1678 2010-08-02  Darin Adler  <darin@apple.com>
1679
1680         Reviewed by Sam Weinig.
1681
1682         WebKitTestRunner needs layoutTestController.setCanOpenWindows
1683         https://bugs.webkit.org/show_bug.cgi?id=42321
1684
1685         WebKitTestRunner needs layoutTestController.setCloseRemainingWindowsWhenComplete
1686         https://bugs.webkit.org/show_bug.cgi?id=42779
1687
1688         Implemented window.close, added a function that does a similar operation on behalf
1689         of injected bundle code named WKBundlePageClose, and fixed the reference counting of
1690         the result of the createNewPage client function.
1691
1692         * UIProcess/API/cpp/WKRetainPtr.h: Added clear. Tweaked formatting. Renamed
1693         releaseRef to leakRef.
1694
1695         * UIProcess/API/mac/WKView.mm:
1696         (-[WKView _updateVisibility]): Handle the case where drawing area is 0. This
1697         came up in WebKitTestRunner and other functions handle drawing area of 0.
1698
1699         * UIProcess/WebPageProxy.cpp:
1700         (WebKit::WebPageProxy::didReceiveSyncMessage): Update now that createNewPage
1701         returns a PassRefPtr.
1702         (WebKit::WebPageProxy::createNewPage): Changed to return a PassRefPtr.
1703         * UIProcess/WebPageProxy.h: Ditto.
1704
1705         * UIProcess/WebUIClient.cpp:
1706         (WebKit::WebUIClient::createNewPage): Changed to return a PassRefPtr and adopt
1707         the WKPageRef passed from the client. This follows the "create rule".
1708         * UIProcess/WebUIClient.h: Ditto.
1709
1710         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
1711         (WKBundlePageClose): Added.
1712         * WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h: Added WKBundlePageClose
1713         and re-sorted the other functions in this file.
1714
1715         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1716         (WebKit::WebChromeClient::closeWindowSoon): Implemented this.
1717
1718         * WebProcess/WebPage/WebPage.cpp:
1719         (WebKit::WebPage::WebPage): Called setJavaScriptCanOpenWindowsAutomatically(true).
1720         I suppose we will need to revisit this later when we implement pop-up blocking.
1721         (WebKit::WebPage::tryClose): Factored out the part of this that sends a message
1722         to the other process.
1723         (WebKit::WebPage::sendClose): This is where the part that sends a message went.
1724         * WebProcess/WebPage/WebPage.h: Added sendClose, used by both closeWindowSoon
1725         and WKBundlePageClose.
1726
1727 2010-08-02  John Sullivan  <sullivan@apple.com>
1728
1729         https://bugs.webkit.org/show_bug.cgi?id=43369
1730         WebBackForwardList::forwardListAsImmutableArrayWithLimit can return partly-uninitialized array
1731         
1732         Reviewed by Ada Chan.
1733
1734         * UIProcess/WebBackForwardList.cpp:
1735         (WebKit::WebBackForwardList::forwardListAsImmutableArrayWithLimit):
1736         Use a simpler and correct expression to determine "last".
1737
1738 2010-08-02  Anders Carlsson  <andersca@apple.com>
1739
1740         Reviewed by Sam Weinig.
1741
1742         Protect the plug-in from being destroyed while in plug-in code
1743         https://bugs.webkit.org/show_bug.cgi?id=43370
1744
1745         Add a PluginProtector to NPRuntimeObjectMap and use it in JSNPObject.
1746         
1747         * WebProcess/Plugins/JSNPObject.cpp:
1748         (WebKit::JSNPObject::callMethod):
1749         (WebKit::JSNPObject::callObject):
1750         (WebKit::JSNPObject::callConstructor):
1751         (WebKit::JSNPObject::put):
1752         (WebKit::JSNPObject::getOwnPropertyNames):
1753         (WebKit::JSNPObject::propertyGetter):
1754         Add PluginProtector declarations.
1755
1756         * WebProcess/Plugins/NPRuntimeObjectMap.cpp:
1757         (WebKit::NPRuntimeObjectMap::PluginProtector::PluginProtector):
1758         Ref the plug-in view (unless it's being destroyed).
1759
1760         (WebKit::NPRuntimeObjectMap::PluginProtector::~PluginProtector):
1761         * WebProcess/Plugins/NPRuntimeObjectMap.h:
1762
1763         * WebProcess/Plugins/PluginView.cpp:
1764         (WebKit::PluginView::PluginView):
1765         Initialize m_isBeingDestroyed.
1766
1767         (WebKit::PluginView::~PluginView):
1768         Set m_isBeingDestroyed to true.
1769
1770         (WebKit::PluginView::scriptObject):
1771         Don't crash if the plug-in failed to initialize.
1772
1773         (WebKit::PluginView::evaluate):
1774         Remove comment.
1775
1776         * WebProcess/Plugins/PluginView.h:
1777         (WebKit::PluginView::isBeingDestroyed):
1778
1779 2010-08-02  Anders Carlsson  <andersca@apple.com>
1780
1781         Reviewed by Sam Weinig.
1782
1783         Cache JSNPObjects and fix bugs in the object map
1784         https://bugs.webkit.org/show_bug.cgi?id=43368
1785
1786         * WebProcess/Plugins/JSNPObject.cpp:
1787         (WebKit::JSNPObject::JSNPObject):
1788         Assert that we're not trying to wrap an NPJSObject.
1789
1790         (WebKit::JSNPObject::~JSNPObject):
1791         Tell the object map that we're gone.
1792
1793         (WebKit::JSNPObject::invalidate):
1794         Release the NPObject and null out the pointer.
1795
1796         * WebProcess/Plugins/NPJSObject.cpp:
1797         (WebKit::NPJSObject::create):
1798         Assert that we're not trying to wrap a JSNPObject.
1799
1800         * WebProcess/Plugins/NPRuntimeObjectMap.cpp:
1801         (WebKit::NPRuntimeObjectMap::getOrCreateNPObject):
1802         If we're passed a JSNPObject, just extract its NPObject.
1803
1804         (WebKit::NPRuntimeObjectMap::getOrCreateJSObject):
1805         If we're passed an NPJSObject, just extract its JSObject. Otherwise, check if we already have
1806         a JSObject for this NPObject and return it.
1807
1808         (WebKit::NPRuntimeObjectMap::jsNPObjectDestroyed):
1809         Remove the object from the map.
1810
1811         (WebKit::NPRuntimeObjectMap::convertNPVariantToJSValue):
1812         getOrCreateJSObject now checks for wrapped objects.
1813
1814         (WebKit::NPRuntimeObjectMap::convertJSValueToNPVariant):
1815         getOrCreateNPObject now checks for wrapped objects.
1816
1817         (WebKit::NPRuntimeObjectMap::invalidate):
1818         Invalidate JSNPObjects as well.
1819
1820 2010-08-02  Jeremy Orlow  <jorlow@chromium.org>
1821
1822         Speculative revert of 64425 due to Chromium instability
1823         https://bugs.webkit.org/show_bug.cgi?id=43347
1824
1825         * WebKit2.xcodeproj/project.pbxproj:
1826         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1827         * WebProcess/WebCoreSupport/WebChromeClient.h:
1828         * WebProcess/WebCoreSupport/WebPopupMenu.cpp: Removed.
1829         * WebProcess/WebCoreSupport/WebPopupMenu.h: Removed.
1830         * WebProcess/WebCoreSupport/WebSearchPopupMenu.cpp: Removed.
1831         * WebProcess/WebCoreSupport/WebSearchPopupMenu.h: Removed.
1832         * win/WebKit2.vcproj:
1833
1834 2010-08-02  Balazs Kelemen  <kb@inf.u-szeged.hu>
1835
1836         Reviewed by Simon Hausmann.
1837
1838         [Qt] Generate forwarding headers for WebKit2
1839
1840         https://bugs.webkit.org/show_bug.cgi?id=43336
1841
1842         * DerivedSources.pro: Added.
1843
1844 2010-08-01  Anders Carlsson  <andersca@apple.com>
1845
1846         Reviewed by Sam Weinig.
1847
1848         Implement NPN_SetException
1849         https://bugs.webkit.org/show_bug.cgi?id=43320
1850
1851         * WebProcess/Plugins/JSNPObject.cpp:
1852         (WebKit::JSNPObject::callConstructor):
1853         (WebKit::JSNPObject::put):
1854         (WebKit::JSNPObject::getOwnPropertyNames):
1855         (WebKit::JSNPObject::propertyGetter):
1856         Call NPRuntimeObjectMap::moveGlobalExceptionToExecState.
1857
1858         * WebProcess/Plugins/NPRuntimeObjectMap.cpp:
1859         (WebKit::globalExceptionString):
1860         Add static global.
1861
1862         (WebKit::NPRuntimeObjectMap::setGlobalException):
1863         Set the global exception string.
1864
1865         (WebKit::NPRuntimeObjectMap::moveGlobalExceptionToExecState):
1866         Create an error from the exception string.
1867
1868         * WebProcess/Plugins/NPRuntimeObjectMap.h:
1869         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
1870         (WebKit::NPN_SetException):
1871         Call NetscapePlugin::setException.
1872
1873         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
1874         (WebKit::NetscapePlugin::setException):
1875         Call NPRuntimeObjectMap::setGlobalException.
1876
1877 2010-08-01  Sam Weinig  <sam@webkit.org>
1878
1879         Roll r64446 out. It broke the test runner.
1880
1881         * UIProcess/WebContext.cpp:
1882         (WebKit::WebContext::postMessageToInjectedBundle):
1883
1884 2010-08-01  Sam Weinig  <sam@webkit.org>
1885
1886         Reviewed by Anders Carlsson.
1887
1888         Don't send user messages to the injected bundle if the process is not active
1889         https://bugs.webkit.org/show_bug.cgi?id=43317
1890
1891         * UIProcess/WebContext.cpp:
1892         (WebKit::WebContext::postMessageToInjectedBundle):
1893
1894 2010-08-01  Sam Weinig  <sam@webkit.org>
1895
1896         Reviewed by Anders Carlsson.
1897
1898         Add ability to reset frame names for WebKitTestRunner
1899         https://bugs.webkit.org/show_bug.cgi?id=43316
1900
1901         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
1902         (WKBundlePageClearMainFrameName):
1903         * WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h:
1904         * WebProcess/WebPage/WebPage.cpp:
1905         (WebKit::WebPage::clearMainFrameName):
1906         * WebProcess/WebPage/WebPage.h:
1907
1908 2010-08-01  Anders Carlsson  <andersca@apple.com>
1909
1910         Reviewed by Sam Weinig.
1911
1912         Minor NPRuntime fixes
1913         https://bugs.webkit.org/show_bug.cgi?id=43318
1914
1915         * WebProcess/Plugins/JSNPObject.h:
1916         (WebKit::JSNPObject::npObject):
1917         * WebProcess/Plugins/NPRuntimeObjectMap.cpp:
1918         (WebKit::NPRuntimeObjectMap::convertJSValueToNPVariant):
1919         If we see an JSNPObject, extract the NPObject.
1920
1921         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
1922         (WebKit::NPN_GetProperty):
1923         Don't check for whether the property exists before getting it.
1924
1925 2010-08-01  Anders Carlsson  <andersca@apple.com>
1926
1927         Reviewed by Sam Weinig.
1928
1929         Implement NPN_RemoveProperty
1930         https://bugs.webkit.org/show_bug.cgi?id=43315
1931
1932         * WebProcess/Plugins/NPJSObject.cpp:
1933         (WebKit::NPJSObject::removeProperty):
1934         Try to remove the property.
1935
1936         (WebKit::NPJSObject::npClass):
1937         Add NP_RemoveProperty.
1938
1939         (WebKit::NPJSObject::NP_RemoveProperty):
1940         Call NPJSObject::removeProperty.
1941
1942         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
1943         (WebKit::NPN_RemoveProperty):
1944         Call the NPClass::removeProperty function.
1945
1946 2010-07-31  Sam Weinig  <sam@webkit.org>
1947
1948         Reviewed by Darin Adler.
1949
1950         Crash due to calling StringImpl::createCFString() from non-main thread in plug-in code
1951         https://bugs.webkit.org/show_bug.cgi?id=43306
1952         <rdar://problem/8259687>
1953
1954         * UIProcess/Plugins/PluginInfoStore.cpp:
1955         (WebKit::PluginInfoStore::getMIMETypeForExtension):
1956         (WebKit::PluginInfoStore::findPlugin):
1957         * UIProcess/Plugins/PluginInfoStore.h:
1958         * UIProcess/Plugins/mac/PluginInfoStoreMac.mm:
1959         (WebKit::safeCreateCFString):
1960         (WebKit::PluginInfoStore::getMIMETypeForExtension):
1961         Bypass MIMETypeRegistry in the UIProcess until we can safely convert Strings
1962         to CFStringRefs.
1963
1964 2010-07-31  Sam Weinig  <sam@webkit.org>
1965
1966         Reviewed by Dan Bernstein.
1967
1968         Patch for https://bugs.webkit.org/show_bug.cgi?id=43305
1969         Add back WKBundleFrameCopyInnerText to fix ~50 test failures
1970         due to SVGElements not having the innerText function.
1971
1972         * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
1973         (WKBundleFrameCopyInnerText):
1974         * WebProcess/InjectedBundle/API/c/WKBundleFramePrivate.h:
1975         * WebProcess/WebPage/WebFrame.cpp:
1976         (WebKit::WebFrame::innerText):
1977         * WebProcess/WebPage/WebFrame.h:
1978
1979 2010-07-27  Luiz Agostini  <luiz.agostini@openbossa.org>
1980
1981         Reviewed by Darin Fisher.
1982
1983         PopupMenu refactoring in preparation to WebKit2
1984         https://bugs.webkit.org/show_bug.cgi?id=42592
1985
1986         Classes WebPopupMenu and WebSearchPopupMenu inherit from PopupMenu and
1987         SearchPopupMenu respectively. At this point they are just empty implementations.
1988
1989         * WebProcess/WebCoreSupport/WebPopupMenu.cpp: Added.
1990         (WebKit::WebPopupMenu::WebPopupMenu):
1991         (WebKit::WebPopupMenu::~WebPopupMenu):
1992         (WebKit::WebPopupMenu::disconnectClient):
1993         (WebKit::WebPopupMenu::show):
1994         (WebKit::WebPopupMenu::hide):
1995         (WebKit::WebPopupMenu::updateFromElement):
1996         * WebProcess/WebCoreSupport/WebPopupMenu.h: Added.
1997         * WebProcess/WebCoreSupport/WebSearchPopupMenu.cpp: Added.
1998         (WebKit::WebSearchPopupMenu::WebSearchPopupMenu):
1999         (WebKit::WebSearchPopupMenu::popupMenu):
2000         (WebKit::WebSearchPopupMenu::saveRecentSearches):
2001         (WebKit::WebSearchPopupMenu::loadRecentSearches):
2002         (WebKit::WebSearchPopupMenu::enabled):
2003         * WebProcess/WebCoreSupport/WebSearchPopupMenu.h: Added.
2004
2005         As ChromeClient was made responsible for providing PopupMenu and SearchPopupMenu
2006         instances, concrete classes that inherit from ChromeClient needed to be changed to
2007         implement the new methods.
2008
2009         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2010         (WebKit::WebChromeClient::selectItemWritingDirectionIsNatural):
2011         (WebKit::WebChromeClient::createPopupMenu):
2012         (WebKit::WebChromeClient::createSearchPopupMenu):
2013         * WebProcess/WebCoreSupport/WebChromeClient.h:
2014
2015         build issues:
2016
2017         * WebKit2.xcodeproj/project.pbxproj:
2018         * win/WebKit2.vcproj:
2019
2020 2010-07-31  Sheriff Bot  <webkit.review.bot@gmail.com>
2021
2022         Unreviewed, rolling out r64422.
2023         http://trac.webkit.org/changeset/64422
2024         https://bugs.webkit.org/show_bug.cgi?id=43304
2025
2026         Build fixes are needed for Snow Leopard and Windows.
2027         (Requested by lca on #webkit).
2028
2029         * WebKit2.xcodeproj/project.pbxproj:
2030         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2031         * WebProcess/WebCoreSupport/WebChromeClient.h:
2032         * WebProcess/WebCoreSupport/WebPopupMenu.cpp: Removed.
2033         * WebProcess/WebCoreSupport/WebPopupMenu.h: Removed.
2034         * WebProcess/WebCoreSupport/WebSearchPopupMenu.cpp: Removed.
2035         * WebProcess/WebCoreSupport/WebSearchPopupMenu.h: Removed.
2036         * win/WebKit2.vcproj:
2037
2038 2010-07-27  Luiz Agostini  <luiz.agostini@openbossa.org>
2039
2040         Reviewed by Darin Fisher.
2041
2042         PopupMenu refactoring in preparation to WebKit2
2043         https://bugs.webkit.org/show_bug.cgi?id=42592
2044
2045         Classes WebPopupMenu and WebSearchPopupMenu inherit from PopupMenu and
2046         SearchPopupMenu respectively. At this point they are just empty implementations.
2047
2048         * WebProcess/WebCoreSupport/WebPopupMenu.cpp: Added.
2049         (WebKit::WebPopupMenu::WebPopupMenu):
2050         (WebKit::WebPopupMenu::~WebPopupMenu):
2051         (WebKit::WebPopupMenu::disconnectClient):
2052         (WebKit::WebPopupMenu::show):
2053         (WebKit::WebPopupMenu::hide):
2054         (WebKit::WebPopupMenu::updateFromElement):
2055         * WebProcess/WebCoreSupport/WebPopupMenu.h: Added.
2056         * WebProcess/WebCoreSupport/WebSearchPopupMenu.cpp: Added.
2057         (WebKit::WebSearchPopupMenu::WebSearchPopupMenu):
2058         (WebKit::WebSearchPopupMenu::popupMenu):
2059         (WebKit::WebSearchPopupMenu::saveRecentSearches):
2060         (WebKit::WebSearchPopupMenu::loadRecentSearches):
2061         (WebKit::WebSearchPopupMenu::enabled):
2062         * WebProcess/WebCoreSupport/WebSearchPopupMenu.h: Added.
2063
2064         As ChromeClient was made responsible for providing PopupMenu and SearchPopupMenu
2065         instances, concrete classes that inherit from ChromeClient needed to be changed to
2066         implement the new methods.
2067
2068         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2069         (WebKit::WebChromeClient::selectItemWritingDirectionIsNatural):
2070         (WebKit::WebChromeClient::createPopupMenu):
2071         (WebKit::WebChromeClient::createSearchPopupMenu):
2072         * WebProcess/WebCoreSupport/WebChromeClient.h:
2073
2074         build issues:
2075
2076         * WebKit2.xcodeproj/project.pbxproj:
2077         * win/WebKit2.vcproj:
2078
2079 2010-07-30  Darin Fisher  <darin@chromium.org>
2080
2081         Reviewed by Darin Adler.
2082
2083         Eliminate BackForwardList::pushStateItem
2084         https://bugs.webkit.org/show_bug.cgi?id=43282
2085
2086         * WebProcess/WebPage/WebBackForwardListProxy.cpp:
2087         * WebProcess/WebPage/WebBackForwardListProxy.h:
2088
2089 2010-07-30  Joseph Pecoraro  <joepeck@webkit.org>
2090
2091         Reviewed by David Kilzer.
2092
2093         Limit ApplicationCache Total and Per-Origin Storage Capacity (Quotas)
2094         https://bugs.webkit.org/show_bug.cgi?id=40627
2095
2096         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2097         (WebKit::WebChromeClient::reachedApplicationCacheOriginQuota):
2098         * WebProcess/WebCoreSupport/WebChromeClient.h:
2099
2100 2010-07-30  Sam Weinig  <sam@webkit.org>
2101
2102         Reviewed by Maciej Stachowiak.
2103
2104         Patch for https://bugs.webkit.org/show_bug.cgi?id=43290
2105         Add structured message passing from the injected bundle to UIProcess
2106
2107         * Platform/CoreIPC/MessageID.h:
2108         * Shared/CoreIPCSupport/WebContextMessageKinds.h: Added.
2109         * Shared/CoreIPCSupport/WebProcessProxyMessageKinds.h:
2110         (WebProcessProxyMessage::):
2111         * UIProcess/API/C/WKContext.h:
2112         * UIProcess/WebContext.cpp:
2113         (WebKit::):
2114         (WebKit::PostMessageEncoder::PostMessageDecoder::PostMessageDecoder):
2115         (WebKit::PostMessageEncoder::PostMessageDecoder::decode):
2116         (WebKit::WebContext::didReceiveMessageFromInjectedBundle):
2117         (WebKit::WebContext::didReceiveMessage):
2118         * UIProcess/WebContext.h:
2119         * UIProcess/WebContextInjectedBundleClient.cpp:
2120         (WebKit::WebContextInjectedBundleClient::didReceiveMessageFromInjectedBundle):
2121         * UIProcess/WebContextInjectedBundleClient.h:
2122         * UIProcess/WebProcessProxy.cpp:
2123         (WebKit::WebProcessProxy::didReceiveMessage):
2124         (WebKit::WebProcessProxy::didReceiveSyncMessage):
2125         * UIProcess/WebProcessProxy.h:
2126         * WebKit2.xcodeproj/project.pbxproj:
2127         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
2128         (WKBundlePostMessage):
2129         * WebProcess/InjectedBundle/API/c/WKBundle.h:
2130         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2131         (WebKit::):
2132         (WebKit::InjectedBundle::InjectedBundle):
2133         (WebKit::InjectedBundle::~InjectedBundle):
2134         (WebKit::InjectedBundle::initializeClient):
2135         (WebKit::InjectedBundle::postMessage):
2136         (WebKit::InjectedBundle::setShouldTrackVisitedLinks):
2137         (WebKit::InjectedBundle::removeAllVisitedLinks):
2138         (WebKit::InjectedBundle::didCreatePage):
2139         (WebKit::InjectedBundle::willDestroyPage):
2140         (WebKit::InjectedBundle::didReceiveMessage):
2141         * WebProcess/InjectedBundle/InjectedBundle.h:
2142
2143 2010-07-30  Andy Estes  <aestes@apple.com>
2144
2145         Reviewed by David Kilzer.
2146
2147         Add support to Xcode for compiling WebKit against iOS SDKs.
2148         https://bugs.webkit.org/show_bug.cgi?id=42796
2149
2150         * Configurations/FeatureDefines.xcconfig:
2151
2152 2010-07-30  Brady Eidson  <beidson@apple.com>
2153
2154         Reviewed by Sam Weinig.
2155
2156         Cast the return value for the templated ImmutableArray::at().
2157
2158         * Shared/ImmutableArray.h:
2159         (WebKit::ImmutableArray::at):
2160
2161 2010-07-30  Sam Weinig  <sam@webkit.org>
2162
2163         Reviewed by Anders Carlsson.
2164
2165         Patch for https://bugs.webkit.org/show_bug.cgi?id=43283
2166         Add APIObject template introspection support.
2167
2168         Add a way to get the type the APIObject::Type from the APIObject subclass typenames
2169         for template fun. Use this to make a type checking version of ImmutableArray::at.
2170
2171         * Shared/ImmutableArray.h:
2172         (WebKit::ImmutableArray::at):
2173         (WebKit::ImmutableArray::type):
2174         * Shared/WebString.h:
2175         (WebKit::WebString::type):
2176         * Shared/WebURL.h:
2177         (WebKit::WebURL::type):
2178         * UIProcess/API/C/WKArray.cpp:
2179         (WKArrayGetTypeID):
2180         * UIProcess/API/C/WKBackForwardList.cpp:
2181         (WKBackForwardListGetTypeID):
2182         * UIProcess/API/C/WKBackForwardListItem.cpp:
2183         (WKBackForwardListItemGetTypeID):
2184         * UIProcess/API/C/WKContext.cpp:
2185         (WKContextGetTypeID):
2186         * UIProcess/API/C/WKFrame.cpp:
2187         (WKFrameGetTypeID):
2188         * UIProcess/API/C/WKFramePolicyListener.cpp:
2189         (WKFramePolicyListenerGetTypeID):
2190         * UIProcess/API/C/WKNavigationData.cpp:
2191         (WKNavigationDataGetTypeID):
2192         * UIProcess/API/C/WKPage.cpp:
2193         (WKPageGetTypeID):
2194         * UIProcess/API/C/WKPageNamespace.cpp:
2195         (WKPageNamespaceGetTypeID):
2196         * UIProcess/API/C/WKPreferences.cpp:
2197         (WKPreferencesGetTypeID):
2198         * UIProcess/API/C/WKString.cpp:
2199         (WKStringGetTypeID):
2200         * UIProcess/API/C/WKURL.cpp:
2201         (WKURLGetTypeID):
2202         * UIProcess/WebBackForwardList.h:
2203         (WebKit::WebBackForwardList::type):
2204         * UIProcess/WebBackForwardListItem.h:
2205         (WebKit::WebBackForwardListItem::type):
2206         * UIProcess/WebContext.h:
2207         (WebKit::WebContext::type):
2208         * UIProcess/WebFramePolicyListenerProxy.h:
2209         (WebKit::WebFramePolicyListenerProxy::type):
2210         * UIProcess/WebFrameProxy.h:
2211         (WebKit::WebFrameProxy::type):
2212         * UIProcess/WebNavigationData.h:
2213         (WebKit::WebNavigationData::type):
2214         * UIProcess/WebPageNamespace.h:
2215         (WebKit::WebPageNamespace::type):
2216         * UIProcess/WebPageProxy.h:
2217         (WebKit::WebPageProxy::type):
2218         * UIProcess/WebPreferences.h:
2219         (WebKit::WebPreferences::type):
2220         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
2221         (WKBundleGetTypeID):
2222         * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
2223         (WKBundleFrameGetTypeID):
2224         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
2225         (WKBundlePageGetTypeID):
2226         * WebProcess/InjectedBundle/InjectedBundle.h:
2227         (WebKit::InjectedBundle::type):
2228         * WebProcess/WebPage/WebFrame.h:
2229         (WebKit::WebFrame::type):
2230         * WebProcess/WebPage/WebPage.h:
2231         (WebKit::WebPage::type):
2232
2233 2010-07-30  Sam Weinig  <sam@webkit.org>
2234
2235         Reviewed by Anders Carlsson.
2236
2237         Patch for https://bugs.webkit.org/show_bug.cgi?id=43275
2238         Make WKArrayRef more usable.
2239
2240         - Add Create functions.
2241         - Make WKArrayGetItemAtIndex return a WKTypeRef.
2242
2243         * UIProcess/API/C/WKArray.cpp:
2244         (WKArrayCreate):
2245         (WKArrayCreateAdoptingValues):
2246         (WKArrayGetItemAtIndex):
2247         * UIProcess/API/C/WKArray.h:
2248
2249 2010-07-30  Ada Chan  <adachan@apple.com>
2250
2251         Reviewed by John Sullivan.
2252
2253         Fix issue with populating the back list when limit is a huge number.
2254         https://bugs.webkit.org/show_bug.cgi?id=43270
2255
2256         * UIProcess/WebBackForwardList.cpp:
2257         (WebKit::WebBackForwardList::backListAsImmutableArrayWithLimit):
2258
2259 2010-07-29  Sam Weinig  <sam@webkit.org>
2260
2261         Reviewed by Anders Carlsson.
2262
2263         Patch for https://bugs.webkit.org/show_bug.cgi?id=43274
2264         Add first pass of structured message passing.
2265
2266         - Only supports passing messages from the UIProcess -> InjectedBundle
2267         - Only supports passing Strings, Arrays, and WebPage references (NOTE: There
2268           currently isn't a way to make an array).
2269         - Changed ImmutableArray to operate on APIObjects instead of void*'s and 
2270           removed the retain/release abstraction.
2271
2272         * Platform/CoreIPC/MessageID.h:
2273         (CoreIPC::):
2274         * Shared/CoreIPCSupport/InjectedBundleMessageKinds.h: Added.
2275         (InjectedBundleMessage::):
2276         (CoreIPC::):
2277         * Shared/CoreIPCSupport/WebProcessMessageKinds.h:
2278         (WebProcessMessage::):
2279         * Shared/ImmutableArray.cpp:
2280         (WebKit::ImmutableArray::ImmutableArray):
2281         (WebKit::ImmutableArray::~ImmutableArray):
2282         * Shared/ImmutableArray.h:
2283         (WebKit::ImmutableArray::create):
2284         (WebKit::ImmutableArray::adopt):
2285         (WebKit::ImmutableArray::at):
2286         * UIProcess/API/C/WKBase.h:
2287         * UIProcess/API/C/WKContext.cpp:
2288         (WKContextPostMessageToInjectedBundle):
2289         * UIProcess/API/C/WKContext.h:
2290         * UIProcess/API/C/WKType.cpp:
2291         (WKGetTypeID):
2292         * UIProcess/API/C/WebKit2.h:
2293         * UIProcess/WebBackForwardList.cpp:
2294         (WebKit::WebBackForwardList::backListAsImmutableArrayWithLimit):
2295         (WebKit::WebBackForwardList::forwardListAsImmutableArrayWithLimit):
2296         * UIProcess/WebContext.cpp:
2297         (WebKit::WebContext::postMessageToInjectedBundle):
2298         (WebKit::WebContext::didReceiveMessageFromInjectedBundle):
2299         * UIProcess/WebContext.h:
2300         * WebKit2.xcodeproj/project.pbxproj:
2301         * WebProcess/InjectedBundle/API/c/WKBundle.h:
2302         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2303         (WebKit::InjectedBundle::didReceiveMessage):
2304         * WebProcess/InjectedBundle/InjectedBundle.h:
2305         * WebProcess/WebPage/WebFrame.cpp:
2306         (WebKit::WebFrame::childFrames):
2307         * WebProcess/WebProcess.cpp:
2308         (WebKit::WebProcess::didReceiveMessage):
2309         * WebProcess/WebProcess.h:
2310         * win/WebKit2.vcproj:
2311
2312 2010-07-30  Anders Carlsson  <andersca@apple.com>
2313
2314         Reviewed by Sam Weinig.
2315
2316         Implement NPN_Evaluate
2317         https://bugs.webkit.org/show_bug.cgi?id=43268
2318
2319         * WebProcess/Plugins/NPRuntimeObjectMap.cpp:
2320         (WebKit::NPRuntimeObjectMap::evaluate):
2321         Evaluate the passed in string.
2322
2323         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
2324         (WebKit::NPN_Evaluate):
2325         Call NetscapePlugin::evaluate.
2326
2327         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
2328         (WebKit::NetscapePlugin::evaluate):
2329         Call PluginController::evaluate.
2330
2331         * WebProcess/Plugins/PluginController.h:
2332         Add evaluate pure virtual member function.
2333
2334         * WebProcess/Plugins/PluginView.cpp:
2335         (WebKit::PluginView::evaluate):
2336         Update the popup window state and call NPRuntimeObjectMap::evaluate.
2337
2338 2010-07-30  Anders Carlsson  <andersca@apple.com>
2339
2340         Reviewed by Sam Weinig.
2341
2342         Implement NPN_InvokeDefault
2343         https://bugs.webkit.org/show_bug.cgi?id=43266
2344
2345         * WebProcess/Plugins/JSNPObject.cpp:
2346         (WebKit::JSNPObject::JSNPObject):
2347         Remove ExecState parameter.
2348
2349         (WebKit::JSNPObject::callObject):
2350         Call the NPClass::invokeDefault function.
2351
2352         (WebKit::callNPJSObject):
2353         Call JSNPObject::callObject.
2354
2355         (WebKit::JSNPObject::getCallData):
2356         Check if the NPClass has an invokeDefault function.
2357
2358         * WebProcess/Plugins/JSNPObject.h:
2359         * WebProcess/Plugins/NPRuntimeObjectMap.cpp:
2360         (WebKit::NPRuntimeObjectMap::getOrCreateJSObject):
2361         Remove ExecState parameter.
2362
2363         (WebKit::NPRuntimeObjectMap::convertNPVariantToJSValue):
2364         Remove ExecState parameter.
2365
2366         * WebProcess/Plugins/PluginView.cpp:
2367         (WebKit::PluginView::scriptObject):
2368         Remove ExecState parameter.
2369
2370 2010-07-30  Adam Roben  <aroben@apple.com>
2371
2372         Roll our r64361 and r64363
2373
2374         We can't make these changes until QuartzCore.lib is included in
2375         WebKitSupportLibrary.
2376
2377 2010-07-30  Adam Roben  <aroben@apple.com>
2378
2379         Windows build fix
2380
2381         * win/WebKit2Apple.vsprops: Always link against QuartzCore, since
2382         WebKitSystemInterface requires it.
2383
2384 2010-07-30  Balazs Kelemen  <kb@inf.u-szeged.hu>
2385
2386         Unreviewed build fix.
2387
2388         [Qt] Build fix for recent API changes in WebKit2.
2389
2390         * UIProcess/API/cpp/qt/WKStringQt.cpp:
2391         (WKStringCopyQString):
2392         * UIProcess/API/cpp/qt/WKURLQt.cpp:
2393         (WKURLCopyQUrl):
2394         * UIProcess/API/qt/qwkpage.cpp:
2395         (QWKPage::QWKPage):
2396
2397 2010-07-29  Brady Eidson  <beidson@apple.com>
2398
2399         Reviewed by Sam Weinig.
2400
2401         Setting empty document schemes on the WKContext shouldn't start the WebProcess
2402         <rdar://problem/8253734> and https://bugs.webkit.org/show_bug.cgi?id=43222
2403         
2404         * UIProcess/WebContext.cpp:
2405         (WebKit::WebContext::ensureWebProcess):
2406         (WebKit::WebContext::registerURLSchemeAsEmptyDocument):
2407         * UIProcess/WebContext.h:
2408
2409 2010-07-29  Brady Eidson  <beidson@apple.com>
2410
2411         Reviewed by Sam Weinig.
2412
2413         Make all public facing client setters take const pointers
2414         https://bugs.webkit.org/show_bug.cgi?id=43219
2415
2416         * UIProcess/API/C/WKContext.cpp:
2417         (WKContextSetInjectedBundleClient):
2418         (WKContextSetHistoryClient):
2419         * UIProcess/API/C/WKContext.h:
2420
2421         * UIProcess/API/C/WKPage.cpp:
2422         (WKPageSetPageLoaderClient):
2423         (WKPageSetPagePolicyClient):
2424         (WKPageSetPageUIClient):
2425         * UIProcess/API/C/WKPage.h:
2426
2427         * UIProcess/WebContext.cpp:
2428         (WebKit::WebContext::initializeInjectedBundleClient):
2429         (WebKit::WebContext::initializeHistoryClient):
2430         * UIProcess/WebContext.h:
2431
2432         * UIProcess/WebContextInjectedBundleClient.cpp:
2433         (WebKit::WebContextInjectedBundleClient::initialize):
2434         * UIProcess/WebContextInjectedBundleClient.h:
2435
2436         * UIProcess/WebHistoryClient.cpp:
2437         (WebKit::WebHistoryClient::initialize):
2438         * UIProcess/WebHistoryClient.h:
2439
2440         * UIProcess/WebLoaderClient.cpp:
2441         (WebKit::WebLoaderClient::initialize):
2442         * UIProcess/WebLoaderClient.h:
2443
2444         * UIProcess/WebPageProxy.cpp:
2445         (WebKit::WebPageProxy::initializeLoaderClient):
2446         (WebKit::WebPageProxy::initializePolicyClient):
2447         (WebKit::WebPageProxy::initializeUIClient):
2448         * UIProcess/WebPageProxy.h:
2449
2450         * UIProcess/WebPolicyClient.cpp:
2451         (WebKit::WebPolicyClient::initialize):
2452         * UIProcess/WebPolicyClient.h:
2453
2454         * UIProcess/WebUIClient.cpp:
2455         (WebKit::WebUIClient::initialize):
2456         * UIProcess/WebUIClient.h:
2457
2458 2010-07-29  Anders Carlsson  <andersca@apple.com>
2459
2460         Reviewed by Sam Weinig.
2461
2462         Implement NPN_SetProperty
2463         https://bugs.webkit.org/show_bug.cgi?id=43217
2464
2465         * WebProcess/Plugins/NPJSObject.cpp:
2466         (WebKit::NPJSObject::setProperty):
2467         Convert the NPVariant to a JSValue and set it on the underlying JSObject.
2468
2469         (WebKit::NPJSObject::NP_SetProperty):
2470         Call NPJSObject::setProperty.
2471
2472         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
2473         (WebKit::NPN_GetProperty):
2474         Remove unused parameter name.
2475
2476         (WebKit::NPN_SetProperty):
2477         Call the NPClass::setProperty function.
2478
2479 2010-07-29  Anders Carlsson  <andersca@apple.com>
2480
2481         Reviewed by Sam Weinig.
2482
2483         Implement NPN_Enumerate
2484         https://bugs.webkit.org/show_bug.cgi?id=43215
2485
2486         * WebProcess/Plugins/JSNPObject.cpp:
2487         (WebKit::npIdentifierFromIdentifier):
2488         Get the UTF-8 string representation instead of the lossy ASCII representation.
2489         
2490         (WebKit::JSNPObject::getOwnPropertyNames):
2491         Implement by calling the NPClass::enumerate function.
2492
2493         * WebProcess/Plugins/JSNPObject.h:
2494         * WebProcess/Plugins/NPJSObject.cpp:
2495         (WebKit::NPJSObject::enumerate):
2496         Implement by calling JSObject::getPropertyNames.
2497
2498         (WebKit::NPJSObject::npClass):
2499         (WebKit::NPJSObject::NP_Enumerate):
2500         Call NPJSObject::enumerate.
2501
2502         * WebProcess/Plugins/NPJSObject.h:
2503         * WebProcess/Plugins/NPRuntimeUtilities.cpp:
2504         (WebKit::createNPObject):
2505         Fix a comment.
2506
2507         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
2508         (WebKit::NPN_Enumerate):
2509         Call the NPClass::enumerate function.
2510
2511 2010-07-29  John Sullivan  <sullivan@apple.com>
2512
2513         <https://bugs.webkit.org/show_bug.cgi?id=43203>
2514         WebBackForwardList::back/ForwardListWithLimit() crashes if passed a limit larger than max int
2515
2516         Reviewed by Sam Weinig.
2517
2518         * UIProcess/WebBackForwardList.cpp:
2519         (WebKit::WebBackForwardList::backListAsImmutableArrayWithLimit):
2520         Fixed casting so that a large unsigned won't become a negative int.
2521         (WebKit::WebBackForwardList::forwardListAsImmutableArrayWithLimit):
2522         Ditto.
2523
2524 2010-07-29  Anders Carlsson  <andersca@apple.com>
2525
2526         Reviewed by Sam Weinig.
2527
2528         Implement NPN_Status
2529         https://bugs.webkit.org/show_bug.cgi?id=43205
2530
2531         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
2532         (WebKit::NPN_Status):
2533         Convert the message char* to a String and call NetscapePlugin::setStatusbarText.
2534
2535         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
2536         (WebKit::NetscapePlugin::setStatusbarText):
2537         Call PluginController::setStatusbarText.
2538     
2539         * WebProcess/Plugins/PluginController.h:
2540         Add setStatusbarText.
2541
2542         * WebProcess/Plugins/PluginView.cpp:
2543         (WebKit::PluginView::setStatusbarText):
2544         Call the Chrome member function.
2545
2546 2010-07-29  Adam Roben  <aroben@apple.com>
2547
2548         Always say "plugins directory" when referring to a directory
2549         containing one or more plugins
2550
2551         Fixes <http://webkit.org/b/43197> WebKit2 often says "plugin
2552         directory" when it means "plugins directory"
2553
2554         Reviewed by John Sullivan.
2555
2556         * UIProcess/API/C/WKContext.cpp:
2557         (_WKContextSetAdditionalPluginsDirectory):
2558         * UIProcess/API/C/WKContextPrivate.h:
2559         Renamed from _WKContextSetAdditionalPluginDirectory.
2560
2561         * UIProcess/Plugins/PluginInfoStore.cpp:
2562         (WebKit::PluginInfoStore::setAdditionalPluginsDirectories): Renamed
2563         from setAdditionalPluginDirectories.
2564         (WebKit::PluginInfoStore::loadPluginsIfNecessary): Updated for rename.
2565
2566         * UIProcess/Plugins/PluginInfoStore.h: Renamed
2567         m_additionalPluginDirectories to m_additionalPluginsDirectories.
2568
2569         * UIProcess/Plugins/mac/PluginInfoStoreMac.mm:
2570         (WebKit::PluginInfoStore::pluginsDirectories):
2571         * UIProcess/Plugins/qt/PluginInfoStoreQt.cpp:
2572         (WebKit::PluginInfoStore::pluginsDirectories):
2573         * UIProcess/Plugins/win/PluginInfoStoreWin.cpp:
2574         (WebKit::PluginInfoStore::pluginsDirectories):
2575         Renamed from pluginDirectories.
2576
2577         * UIProcess/WebContext.cpp:
2578         (WebKit::WebContext::setAdditionalPluginsDirectory):
2579         * UIProcess/WebContext.h:
2580         Renamed from setAdditionalPluginDirectory.
2581
2582 2010-07-29  Adam Roben  <aroben@apple.com>
2583
2584         Always say "directory" when referring to a plugin directory
2585
2586         Fixes <http://webkit.org/b/43195> WebKit2 often says "plugin path"
2587         when it means "plugin directory"
2588
2589         Reviewed by John Sullivan.
2590
2591         * UIProcess/API/C/WKContext.cpp:
2592         (_WKContextSetAdditionalPluginDirectory):
2593         * UIProcess/API/C/WKContextPrivate.h:
2594         Renamed from _WKContextSetAdditionalPluginPath.
2595
2596         * UIProcess/Plugins/PluginInfoStore.cpp:
2597         (WebKit::PluginInfoStore::setAdditionalPluginDirectories): Renamed
2598         from setAdditionalPluginPaths.
2599         (WebKit::PluginInfoStore::loadPluginsIfNecessary): Updated for rename.
2600
2601         * UIProcess/Plugins/PluginInfoStore.h: Renamed m_additionalPluginPaths
2602         to m_additionalPluginDirectories.
2603
2604         * UIProcess/WebContext.cpp:
2605         (WebKit::WebContext::setAdditionalPluginDirectory):
2606         * UIProcess/WebContext.h:
2607         Renamed from setAdditionalPluginPath, and updated for PluginInfoStore
2608         rename.
2609
2610 2010-07-29  Adam Roben  <aroben@apple.com>
2611
2612         Remove PluginInfoStore::mimeTypeFromExtension
2613
2614         WebCore::MIMETypeRegistry already provides a cross-platform interface
2615         for this.
2616
2617         Fixes <http://webkit.org/b/43188>
2618         PluginInfoStore::mimeTypeFromExtension is unnecessary
2619
2620         Reviewed by Nikolas Zimmermann.
2621
2622         * UIProcess/Plugins/PluginInfoStore.cpp:
2623         (WebKit::PluginInfoStore::findPlugin): Changed to use
2624         MIMETypeRegistry.
2625
2626         * UIProcess/Plugins/PluginInfoStore.h:
2627         * UIProcess/Plugins/mac/PluginInfoStoreMac.mm:
2628         * UIProcess/Plugins/qt/PluginInfoStoreQt.cpp:
2629         * UIProcess/Plugins/win/PluginInfoStoreWin.cpp:
2630         Removed mimeTypeFromExtension.
2631
2632 2010-07-28  Sam Weinig  <sam@webkit.org>
2633
2634         Another Windows build fix.
2635
2636         * UIProcess/API/C/WKBase.h:
2637         * win/WebKit2Generated.make:
2638
2639 2010-07-28  Sam Weinig  <sam@webkit.org>
2640
2641         Fix builds.
2642
2643         * UIProcess/API/C/WKAPICast.h:
2644         (WebKit::ProxyingRefPtr::operator APIType):
2645         (toURLRef):
2646         (toCopiedRef):
2647         (toCopiedURLRef):
2648         * UIProcess/win/WebView.h:
2649         (WebKit::WebView::type):
2650
2651 2010-07-28  Sam Weinig  <sam@webkit.org>
2652
2653         Reviewed by Darin Adler.
2654
2655         Patch for https://bugs.webkit.org/show_bug.cgi?id=43163
2656         Add a CF-style base type (WKTypeRef) as a base for polymorphic functions.
2657
2658         - Add first polymorphic function, WKGetTypeID.
2659         - Add functions to each WK type to get their respective TypeIDs.
2660         - Adds WebURL to complement WebString.
2661
2662         * Shared/APIObject.h:
2663         (WebKit::APIObject::):
2664         (WebKit::APIObject::~APIObject):
2665         * Shared/ImmutableArray.h:
2666         (WebKit::ImmutableArray::type):
2667         * Shared/WebString.h:
2668         (WebKit::WebString::type):
2669         * Shared/WebURL.h: Added.
2670         (WebKit::WebURL::create):
2671         (WebKit::WebURL::type):
2672         (WebKit::WebURL::isNull):
2673         (WebKit::WebURL::isEmpty):
2674         (WebKit::WebURL::string):
2675         (WebKit::WebURL::WebURL):
2676         * UIProcess/API/C/WKAPICast.h:
2677         (WebKit::ProxyingRefPtr::ProxyingRefPtr):
2678         (WebKit::ProxyingRefPtr::operator APIType):
2679         (toRef):
2680         (toURLRef):
2681         (toCopiedURLRef):
2682         * UIProcess/API/C/WKArray.cpp:
2683         (WKArrayGetTypeID):
2684         * UIProcess/API/C/WKArray.h:
2685         * UIProcess/API/C/WKBackForwardList.cpp:
2686         (WKBackForwardListGetTypeID):
2687         * UIProcess/API/C/WKBackForwardList.h:
2688         * UIProcess/API/C/WKBackForwardListItem.cpp:
2689         (WKBackForwardListItemGetTypeID):
2690         * UIProcess/API/C/WKBackForwardListItem.h:
2691         * UIProcess/API/C/WKBase.h:
2692         * UIProcess/API/C/WKContext.cpp:
2693         (WKContextGetTypeID):
2694         * UIProcess/API/C/WKContext.h:
2695         * UIProcess/API/C/WKFrame.cpp:
2696         (WKFrameGetTypeID):
2697         * UIProcess/API/C/WKFrame.h:
2698         * UIProcess/API/C/WKFramePolicyListener.cpp:
2699         (WKFramePolicyListenerGetTypeID):
2700         * UIProcess/API/C/WKFramePolicyListener.h:
2701         * UIProcess/API/C/WKNavigationData.cpp:
2702         (WKNavigationDataGetTypeID):
2703         * UIProcess/API/C/WKNavigationData.h:
2704         * UIProcess/API/C/WKPage.cpp:
2705         (WKPageGetTypeID):
2706         * UIProcess/API/C/WKPage.h:
2707         * UIProcess/API/C/WKPageNamespace.cpp:
2708         (WKPageNamespaceGetTypeID):
2709         * UIProcess/API/C/WKPageNamespace.h:
2710         * UIProcess/API/C/WKPreferences.cpp:
2711         (WKPreferencesGetTypeID):
2712         * UIProcess/API/C/WKPreferences.h:
2713         * UIProcess/API/C/WKString.cpp:
2714         (WKStringGetTypeID):
2715         * UIProcess/API/C/WKString.h:
2716         * UIProcess/API/C/WKType.cpp: Added.
2717         (WKGetTypeID):
2718         * UIProcess/API/C/WKType.h: Added.
2719         * UIProcess/API/C/WKURL.cpp:
2720         (WKURLGetTypeID):
2721         * UIProcess/API/C/WKURL.h:
2722         * UIProcess/API/win/WKView.cpp:
2723         (WKViewGetTypeID):
2724         * UIProcess/API/win/WKView.h:
2725         * UIProcess/WebBackForwardList.h:
2726         (WebKit::WebBackForwardList::type):
2727         * UIProcess/WebBackForwardListItem.h:
2728         (WebKit::WebBackForwardListItem::type):
2729         * UIProcess/WebContext.h:
2730         (WebKit::WebContext::type):
2731         * UIProcess/WebFramePolicyListenerProxy.h:
2732         (WebKit::WebFramePolicyListenerProxy::type):
2733         * UIProcess/WebFrameProxy.h:
2734         (WebKit::WebFrameProxy::type):
2735         * UIProcess/WebNavigationData.h:
2736         (WebKit::WebNavigationData::type):
2737         * UIProcess/WebPageNamespace.h:
2738         (WebKit::WebPageNamespace::type):
2739         * UIProcess/WebPageProxy.h:
2740         (WebKit::WebPageProxy::type):
2741         * UIProcess/WebPreferences.h:
2742         (WebKit::WebPreferences::type):
2743         * WebKit2.xcodeproj/project.pbxproj:
2744         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
2745         (WKBundleGetTypeID):
2746         * WebProcess/InjectedBundle/API/c/WKBundle.h:
2747         * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
2748         (WKBundleFrameGetTypeID):
2749         * WebProcess/InjectedBundle/API/c/WKBundleFrame.h:
2750         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
2751         (WKBundlePageGetTypeID):
2752         (WKBundlePageSetEditorClient):
2753         (WKBundlePageSetLoaderClient):
2754         (WKBundlePageSetUIClient):
2755         * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
2756         * WebProcess/WebPage/WebFrame.h:
2757         (WebKit::WebFrame::type):
2758         * WebProcess/WebPage/WebPage.h:
2759         (WebKit::WebPage::type):
2760         * win/WebKit2.vcproj:
2761
2762 2010-07-28  Darin Adler  <darin@apple.com>
2763
2764         Reviewed by Sam Weinig.
2765
2766         WebKitTestRunner needs to support layoutTestController.execCommand
2767         <https://bugs.webkit.org/show_bug.cgi?id=42538>
2768
2769         WebKitTestRunner needs layoutTestController.isCommandEnabled
2770         <https://bugs.webkit.org/show_bug.cgi?id=42671>
2771
2772         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
2773         (WKBundlePageExecuteEditingCommand): Added.
2774         (WKBundlePageIsEditingCommandEnabled): Added.
2775         * WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h: Ditto.
2776
2777         * WebProcess/WebPage/WebPage.cpp:
2778         (WebKit::WebPage::executeEditingCommand): Added.
2779         (WebKit::WebPage::isEditingCommandEnabled): Added.
2780         * WebProcess/WebPage/WebPage.h: Ditto.
2781
2782 2010-07-28  Anders Carlsson  <andersca@apple.com>
2783
2784         Fix 64-bit build.
2785
2786         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
2787         (WebKit::NPN_GetValue):
2788
2789 2010-07-28  Brady Eidson  <beidson@apple.com>
2790
2791         Reviewed by Darin Adler.
2792
2793         First pass at visited link support for WK2
2794         https://bugs.webkit.org/show_bug.cgi?id=43157
2795
2796         * Shared/CoreIPCSupport/WebPageProxyMessageKinds.h:
2797         (WebPageProxyMessage::):
2798         * Shared/CoreIPCSupport/WebProcessMessageKinds.h:
2799         (WebProcessMessage::):
2800         * Shared/CoreIPCSupport/WebProcessProxyMessageKinds.h:
2801         (WebProcessProxyMessage::):
2802
2803         Move HistoryClient support from the page...:
2804         * UIProcess/API/C/WKPage.cpp:
2805         * UIProcess/API/C/WKPage.h:
2806         
2807         ...to the Context
2808         * UIProcess/API/C/WKContext.cpp:
2809         (WKContextSetHistoryClient):
2810         * UIProcess/API/C/WKContext.h:
2811
2812         * UIProcess/WebContext.cpp:
2813         (WebKit::WebContext::initializeHistoryClient):
2814         (WebKit::WebContext::ensureWebProcess): When a new WebProcess is created, set its "should track visited links" mode.
2815         (WebKit::WebContext::didNavigateWithNavigationData):
2816         (WebKit::WebContext::didPerformClientRedirect):
2817         (WebKit::WebContext::didPerformServerRedirect):
2818         (WebKit::WebContext::didUpdateHistoryTitle):
2819         (WebKit::WebContext::populateVisitedLinks):
2820         * UIProcess/WebContext.h:
2821         (WebKit::WebContext::hasValidProcess):
2822
2823         * UIProcess/WebHistoryClient.cpp:
2824         (WebKit::WebHistoryClient::initialize):
2825         (WebKit::WebHistoryClient::didNavigateWithNavigationData):
2826         (WebKit::WebHistoryClient::didPerformClientRedirect):
2827         (WebKit::WebHistoryClient::didPerformServerRedirect):
2828         (WebKit::WebHistoryClient::didUpdateHistoryTitle):
2829         (WebKit::WebHistoryClient::populateVisitedLinks):
2830         * UIProcess/WebHistoryClient.h:
2831         (WebKit::WebHistoryClient::shouldTrackVisitedLinks):
2832
2833         * UIProcess/WebPageProxy.cpp:
2834         (WebKit::WebPageProxy::didReceiveMessage):
2835         * UIProcess/WebPageProxy.h:
2836
2837         * UIProcess/WebProcessProxy.cpp:
2838         (WebKit::WebProcessProxy::didReceiveMessage):
2839         (WebKit::WebProcessProxy::didReceiveSyncMessage):
2840
2841         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2842         (WebKit::WebChromeClient::populateVisitedLinks):
2843
2844         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2845         (WebKit::WebFrameLoaderClient::updateGlobalHistory):
2846         (WebKit::WebFrameLoaderClient::updateGlobalHistoryRedirectLinks):
2847         (WebKit::WebFrameLoaderClient::setTitle):
2848
2849         * WebProcess/WebProcess.cpp:
2850         (WebKit::WebProcess::didReceiveMessage):
2851
2852 2010-07-28  Anders Carlsson  <andersca@apple.com>
2853
2854         Reviewed by Sam Weinig.
2855
2856         Add JSNPObject::getConstructData
2857         https://bugs.webkit.org/show_bug.cgi?id=43165
2858
2859         * WebProcess/Plugins/JSNPObject.cpp:
2860         (WebKit::JSNPObject::callMethod):
2861         Add a null check for m_npObject.
2862         
2863         (WebKit::JSNPObject::callConstructor):
2864         Call NPClass::construct.
2865
2866         (WebKit::JSNPObject::getConstructData):
2867         Set up the construct data.
2868
2869         (WebKit::JSNPObject::propertyGetter):
2870         convertNPVariantToJSValue now takes a JSGlobalObject as well.
2871         
2872         * WebProcess/Plugins/NPJSObject.cpp:
2873         (WebKit::NPJSObject::invoke):
2874         (WebKit::NPJSObject::invokeDefault):
2875         (WebKit::NPJSObject::construct):
2876         convertNPVariantToJSValue now takes a JSGlobalObject as well.
2877         
2878         * WebProcess/Plugins/NPJSObject.h:
2879         Make isNPJSObject and toNPJSObject public.
2880
2881         * WebProcess/Plugins/NPRuntimeObjectMap.cpp:
2882         (WebKit::NPRuntimeObjectMap::convertNPVariantToJSValue):
2883         Convert NPObjects correctly.
2884         
2885         (WebKit::NPRuntimeObjectMap::globalObject):
2886         Get the globalObject from the frame.
2887
2888         (WebKit::NPRuntimeObjectMap::globalExec):
2889         Call globalObject.
2890
2891         * WebProcess/Plugins/NPRuntimeObjectMap.h:
2892
2893 2010-07-28  Anders Carlsson  <andersca@apple.com>
2894
2895         Reviewed by Sam Weinig.
2896
2897         Implement NPN_InvokeDefault and NPN_Construct
2898         https://bugs.webkit.org/show_bug.cgi?id=43160
2899
2900         * WebProcess/Plugins/NPJSObject.cpp:
2901         (WebKit::NPJSObject::invoke):
2902         Just call invoke directly.
2903
2904         (WebKit::NPJSObject::invokeDefault):
2905         Call invoke.
2906
2907         (WebKit::NPJSObject::construct):
2908         Implement this.
2909
2910         (WebKit::NPJSObject::invoke):
2911         Add new invoke overload that takes the function as a JSValue.
2912
2913         (WebKit::NPJSObject::npClass):
2914         Add NP_Construct.
2915
2916         (WebKit::NPJSObject::NP_InvokeDefault):
2917         Call NPJSObject::invokeDefault.
2918
2919         (WebKit::NPJSObject::NP_Construct):
2920         Call NPJSObject::construct.
2921
2922         * WebProcess/Plugins/NPJSObject.h:
2923         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
2924         (WebKit::NPN_GetValue):
2925         Handle the Core Animation drawing model and the Carbon event model.
2926
2927         (WebKit::NPN_InvokeDefault):
2928         Call the NPClass::invokeDefault function.
2929
2930         (WebKit::NPN_Construct):
2931         Call the NPClass::construct function.
2932
2933 2010-07-28  Anders Carlsson  <andersca@apple.com>
2934
2935         Reviewed by Sam Weinig.
2936
2937         Implement NPN_Invoke
2938         https://bugs.webkit.org/show_bug.cgi?id=43158
2939
2940         * WebProcess/Plugins/NPJSObject.cpp:
2941         (WebKit::NPJSObject::hasMethod):
2942         Use the free getCallData function.
2943
2944         (WebKit::NPJSObject::invoke):
2945         Get the JavaScript function and call it.
2946
2947         (WebKit::NPJSObject::NP_Invoke):
2948         Call NPJSObject::invoke.
2949
2950         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
2951         (WebKit::NPN_Invoke):
2952         Call the NPClass::invoke function.
2953
2954 2010-07-28  Anders Carlsson  <andersca@apple.com>
2955
2956         Reviewed by Sam Weinig.
2957
2958         Implement NPN_HasMethod
2959         https://bugs.webkit.org/show_bug.cgi?id=43155
2960
2961         * WebProcess/Plugins/NPJSObject.cpp:
2962         (WebKit::NPJSObject::hasMethod):
2963         Check if the JSObject has a property with the given name. If it does, check that the value is a function.
2964     
2965         (WebKit::NPJSObject::hasProperty):
2966         Add a JSLock.
2967
2968         (WebKit::NPJSObject::npClass):
2969         Add some stubbed out functions.
2970
2971         (WebKit::NPJSObject::NP_HasMethod):
2972         Call NPJSObject::hasMethod.
2973
2974         (WebKit::NPJSObject::NP_Invoke):
2975         (WebKit::NPJSObject::NP_InvokeDefault):
2976         (WebKit::NPJSObject::NP_SetProperty):
2977         Stub out functions.
2978
2979         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
2980         (WebKit::NPN_HasMethod):
2981         Call the NPClass::hasMethod function.
2982
2983 2010-07-28  Brady Eidson  <beidson@apple.com>
2984
2985         Rubberstamped by Sam Weinig.
2986
2987         Make sure new pages are always added to the same PageGroup (for now).
2988
2989         * WebProcess/WebPage/WebPage.cpp:
2990         (WebKit::WebPage::WebPage):
2991
2992 2010-07-28  Sam Weinig  <sam@webkit.org>
2993
2994         Reviewed by Anders Carlsson.
2995
2996         Patch for https://bugs.webkit.org/show_bug.cgi?id=43097
2997         Make all objects in the WebKit2 API inherit from a single base class
2998
2999         - Adds an APIObject base class for all objects which one can get through
3000           the C API to inherit from.
3001         - Adds a WebString class which wraps WebCore::String for now. I am not too fond of
3002           this solution, so we should continue to iterate on it.
3003         - This is a first step toward make a CF-style base type (eg. CFTypeRef) for the C-API.
3004
3005         * Shared/APIObject.h: Added.
3006         (WebKit::APIObject::APIObject):
3007         Base class for API objects.
3008
3009         * Shared/ImmutableArray.h:
3010         Make inherit from APIObject.
3011
3012         * Shared/WebString.h: Added.
3013         (WebKit::WebString::create):
3014         (WebKit::WebString::isNull):
3015         (WebKit::WebString::isEmpty):
3016         (WebKit::WebString::string):
3017         (WebKit::WebString::WebString):
3018         Wraps a WebCore::String so that it can be passed out to the API
3019         and still inherit from APIObject.
3020
3021         * UIProcess/API/C/WKAPICast.h:
3022         (WebKit::WebStringAdaptor::WebStringAdaptor):
3023         (WebKit::WebStringAdaptor::operator WKStringRef):
3024         (WebKit::WebStringAdaptor::operator WKURLRef):
3025         Update conversion methods to deal in terms of WebStrings. Added WebStringAdaptor
3026         to ease passing strings to client functions.
3027
3028         * UIProcess/API/C/WKContext.cpp:
3029         (WKContextCreateWithInjectedBundlePath):
3030         (WKContextPostMessageToInjectedBundle):
3031         (_WKContextSetAdditionalPluginPath):
3032         (_WKContextRegisterURLSchemeAsEmptyDocument): 
3033         Get the WebCore::String from the WebString.
3034
3035         * UIProcess/API/C/WKPage.cpp:
3036         (WKPageLoadURL):
3037         Ditto.
3038
3039         * UIProcess/API/C/WKString.cpp:
3040         (WKStringIsEmpty):
3041         Implement in terms of WebString.
3042
3043         * UIProcess/API/C/WKURL.cpp:
3044         * UIProcess/API/C/cf/WKStringCF.cpp:
3045         (WKStringCreateWithCFString):
3046         (WKStringCopyCFString):
3047         Ditto.
3048     
3049         * UIProcess/API/C/cf/WKURLCF.cpp:
3050         (WKURLCreateWithCFURL):
3051         (WKURLCopyCFURL):
3052         Ditto.
3053
3054         * UIProcess/WebBackForwardList.h:
3055         Make inherit from APIObject.
3056
3057         * UIProcess/WebBackForwardListItem.h:
3058         Ditto.
3059
3060         * UIProcess/WebContext.cpp:
3061         (WebKit::WebContext::didReceiveMessageFromInjectedBundle):
3062         (WebKit::WebContext::postMessageToInjectedBundle):
3063         (WebKit::WebContext::registerURLSchemeAsEmptyDocument):
3064         Use String instead of StringImpl to be consistent.
3065
3066         * UIProcess/WebContext.h:
3067         Make inherit from APIObject.
3068
3069         * UIProcess/WebFramePolicyListenerProxy.h:
3070         Ditto.
3071
3072         * UIProcess/WebFrameProxy.h:
3073         Ditto.
3074
3075         * UIProcess/WebNavigationData.h:
3076         Ditto.
3077
3078         * UIProcess/WebPageNamespace.h:
3079         Ditto.
3080
3081         * UIProcess/WebPageProxy.h:
3082         Ditto.
3083
3084         * UIProcess/WebPreferences.h:
3085         Ditto.
3086
3087         * UIProcess/WebUIClient.cpp:
3088         (WebKit::WebUIClient::runJavaScriptPrompt):
3089         Implement in terms of WebString.
3090
3091         * UIProcess/win/WebView.h:
3092         Make inherit from APIObject.
3093
3094         * WebKit2.xcodeproj/project.pbxproj:
3095         Add new files.
3096
3097         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
3098         (WKBundlePostMessage):
3099         Get the WebCore::String from the WebString.
3100
3101         * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
3102         (WKBundleFramePauseAnimationOnElementWithId):
3103         Ditto.
3104
3105         * WebProcess/InjectedBundle/InjectedBundle.cpp:
3106         (WebKit::InjectedBundle::postMessage):
3107         * WebProcess/InjectedBundle/InjectedBundle.h:
3108         Use String instead of StringImpl to be consistent.
3109
3110         * WebProcess/WebPage/WebFrame.h:
3111         Make inherit from APIObject.
3112
3113         * WebProcess/WebPage/WebPage.h:
3114         Make inherit from APIObject.
3115
3116         * win/WebKit2.vcproj:
3117         Add new files.
3118
3119 2010-07-28  Anders Carlsson  <andersca@apple.com>
3120
3121         Reviewed by Sam Weinig.
3122
3123         Implement JSNPObject::put
3124         https://bugs.webkit.org/show_bug.cgi?id=43149
3125
3126         * WebProcess/Plugins/JSNPObject.cpp:
3127         (WebKit::JSNPObject::getOwnPropertySlot):
3128         Fix a typo.
3129
3130         (WebKit::JSNPObject::getOwnPropertyDescriptor):
3131         Implement this in the same way as it's implemented in RuntimeObject.
3132
3133         (WebKit::JSNPObject::put):
3134         Implement this, call NPClass::setProperty.
3135
3136         * WebProcess/Plugins/JSNPObject.h:
3137
3138 2010-07-28  Anders Carlsson  <andersca@apple.com>
3139
3140         Reviewed by Sam Weinig.
3141
3142         Add support for calling NPObject methods
3143         https://bugs.webkit.org/show_bug.cgi?id=43145
3144
3145         * WebKit2.xcodeproj/project.pbxproj:
3146         Add JSNPMethod.cpp and JSNPMethod.h
3147     
3148         * WebProcess/Plugins/JSNPMethod.cpp: Added.
3149         * WebProcess/Plugins/JSNPMethod.h: Added.
3150         * WebProcess/Plugins/JSNPObject.cpp:
3151         (WebKit::):
3152         Add a ClassInfo static variable for JSNPObject.
3153
3154         (WebKit::JSNPObject::callMethod):
3155         Convert the passed in arguments, call the method and convert the result back.
3156
3157         (WebKit::JSNPObject::getOwnPropertySlot):
3158         Check if the NPObject has a method.
3159
3160         (WebKit::JSNPObject::methodGetter):
3161         Return a new JSNPMethod.
3162
3163         * WebProcess/Plugins/JSNPObject.h:
3164         (WebKit::JSNPObject::classInfo):
3165         Return the s_info.
3166
3167         * WebProcess/Plugins/NPJSObject.cpp:
3168         (WebKit::NPJSObject::getProperty):
3169         Get the property from the JSObject.
3170
3171         * WebProcess/Plugins/NPRuntimeObjectMap.cpp:
3172         (WebKit::NPRuntimeObjectMap::convertJSValueToNPVariant):
3173         Convert the given JSValue to an NPVariant.
3174
3175         * win/WebKit2.vcproj:
3176         Add JSNPMethod.cpp and JSNPMethod.h
3177
3178 2010-07-28  Adam Roben  <aroben@apple.com>
3179
3180         Teach CoreIPC how to handle with a pipe closing during a write
3181
3182         Fixes <http://webkit.org/b/43131> Assertion failure in
3183         Connection::sendOutgoingMessage if the other process exits at just the
3184         wrong time
3185
3186         Reviewed by Darin Adler.
3187
3188         * Platform/CoreIPC/win/ConnectionWin.cpp:
3189         (CoreIPC::Connection::sendOutgoingMessage): If ::WriteFile fails with
3190         ERROR_NO_DATA, the pipe (and thus the connection) has closed.
3191
3192 2010-07-28  Adam Roben  <aroben@apple.com>
3193
3194         Teach CoreIPC the right way to send large messages on Windows
3195
3196         r63776 added support for ::WriteFile failing with ERROR_IO_PENDING,
3197         but it had a major flaw: we didn't ensure that the data being sent
3198         (which is owned by the ArgumentEncoder) stayed around until the write
3199         finished. We'd destroy the data immediately, leading to ::WriteFile
3200         accessing that freed memory later. This seemed to always manifest
3201         itself as a crash in ::WaitForMultipleObjects.
3202
3203         The correct solution (as hinted above) is to make sure that the data
3204         being written is not destroyed until the write completes. When
3205         ::WriteFile fails with ERROR_IO_PENDING, we store the data being sent
3206         in Connection::m_pendingWriteArguments, and don't send any more
3207         messages until that write completes. We use an event in the OVERLAPPED
3208         structure passed to ::WriteFile to detect when the write has completed
3209         (similar to what we do for reads).
3210
3211         Fixes <http://webkit.org/b/42785> <rdar://problem/8218522> Crash in
3212         WebKit2WebProcess in WaitForMultipleObjects beneath
3213         WorkQueue::workQueueThreadBody when running tests that produce a lot
3214         of output
3215
3216         Reviewed by Anders Carlsson.
3217
3218         * Platform/CoreIPC/Connection.cpp:
3219         (CoreIPC::Connection::canSendOutgoingMessages): Added. This calls out
3220         to a platform-specific function to allow each platform to have its own
3221         policy for when messages can and can't be sent.
3222         (CoreIPC::Connection::sendOutgoingMessages): Use the new
3223         canSendOutgoingMessages to determine whether we can send any messages
3224         right now. We now remove one message at a time from m_outgoingMessages
3225         and send it. We stop sending messages when sendOutgoingMessage returns
3226         false.
3227
3228         * Platform/CoreIPC/Connection.h: Added m_pendingWriteArguments and
3229         m_writeState on Windows.
3230         (CoreIPC::Connection::Message::Message): Added this default
3231         constructor.
3232
3233         * Platform/CoreIPC/MessageID.h:
3234         (CoreIPC::MessageID::MessageID): Made the default constructor public
3235         for Message's benefit.
3236
3237         * Platform/CoreIPC/mac/ConnectionMac.cpp:
3238         (CoreIPC::Connection::platformCanSendOutgoingMessages): Added. Always
3239         returns true.
3240         (CoreIPC::Connection::sendOutgoingMessage): Changed to return a
3241         boolean indicating whether more messages can be sent at this time.
3242
3243         * Platform/CoreIPC/qt/ConnectionQt.cpp:
3244         (CoreIPC::Connection::platformCanSendOutgoingMessages): Added. Returns
3245         true if we have a socket.
3246         (CoreIPC::Connection::sendOutgoingMessage): Changed a null-check of
3247         m_socket to an assertion since it should be checked for null in
3248         platformCanSendOutgoingMessages. Changed to return a boolean
3249         indicating whether more messages can be sent at this time.
3250
3251         * Platform/CoreIPC/win/ConnectionWin.cpp:
3252         (CoreIPC::Connection::platformInitialize): Added initialization of
3253         m_writeState.
3254         (CoreIPC::Connection::platformInvalidate): Close m_writeState's event
3255         handle.
3256         (CoreIPC::Connection::writeEventHandler): Added. Checks if the pending
3257         write has completed, cleans up our pending write state, and sends any
3258         remaining messages.
3259         (CoreIPC::Connection::open): Register our write event with the
3260         WorkQueue so that writeEventHandler will be called when the event is
3261         signaled.
3262         (CoreIPC::Connection::platformCanSendOutgoingMessages): Added. We can
3263         only send messages if there isn't a write pending.
3264         (CoreIPC::Connection::sendOutgoingMessage): Changed to return a
3265         boolean indicating whether more messages can be sent at this time. We
3266         now pass m_writeState to ::WriteFile instead of an empty OVERLAPPED
3267         struct so that our write event will be signaled when the write
3268         completes. We also no longer pass a pointer to receive how many bytes
3269         were written, as recommended by MSDN. If ::WriteFile fails with
3270         ERROR_IO_PENDING, we save the ArgumentEncoder for this message and
3271         return false to indicate that no more messages can be sent at this
3272         time.
3273
3274 2010-07-28  Adam Roben  <aroben@apple.com>
3275
3276         Stop leaking Connection::m_readState.hEvent on Windows
3277
3278         Fixes <http://webkit.org/b/43129> CoreIPC::Connection leaks its read
3279         event on Windows
3280
3281         Reviewed by Darin Adler.
3282
3283         * Platform/CoreIPC/win/ConnectionWin.cpp:
3284         (CoreIPC::Connection::platformInvalidate): Close the event handle.
3285
3286 2010-07-26  Steve Block  <steveblock@google.com>
3287
3288        Reviewed by Jeremy Orlow.
3289
3290        Page clients should be passed to Page constructor via structure of pointers
3291        https://bugs.webkit.org/show_bug.cgi?id=42834
3292
3293        * WebKit2/WebProcess/WebPage/WebPage.cpp:
3294        (WebPage::WebPage):
3295
3296 2010-07-28  Andras Becsi  <abecsi@webkit.org>
3297
3298         Unreviewed trivial build fix.
3299
3300         [Qt] Follow the API changes after r64172.
3301
3302         * UIProcess/API/qt/qwkpage.cpp:
3303         (QWKPage::url):
3304         (QWKPage::title):
3305
3306 2010-07-27  Anders Carlsson  <andersca@apple.com>
3307
3308         Fix Windows build.
3309
3310         * WebProcess/Plugins/JSNPObject.cpp:
3311         (WebKit::JSNPObject::propertyGetter):
3312         Remove unreachable code.
3313
3314 2010-07-27  Anders Carlsson  <andersca@apple.com>
3315
3316         Reviewed by Sam Weinig.
3317
3318         Implement JSNPObject::propertyGetter
3319         https://bugs.webkit.org/show_bug.cgi?id=43091
3320
3321         * WebProcess/Plugins/JSNPObject.cpp:
3322         (WebKit::JSNPObject::propertyGetter):
3323         Ask the NPObject for its property.
3324
3325         * WebProcess/Plugins/NPRuntimeObjectMap.cpp:
3326         (WebKit::NPRuntimeObjectMap::jsNPObjectDestroyed):
3327         Add a stub.
3328
3329         (WebKit::NPRuntimeObjectMap::convertNPVariantToValue):
3330         Implement this for everything except objects.
3331
3332 2010-07-27  Sam Weinig  <sam@webkit.org>
3333
3334         Reviewed by Anders Carlsson.
3335
3336         Patch for https://bugs.webkit.org/show_bug.cgi?id=43087
3337         Clean up handling of strings at the WebKit2 API layer.
3338
3339         - Always use the "copy" rule for functions that return WKStringRefs or WKURLRefs.
3340         - Never return a null WKStringRef or WKURLRef.
3341
3342         * UIProcess/API/C/WKAPICast.h:
3343         (toRef):
3344         (toURLRef):
3345         (toCopiedRef):
3346         (toCopiedURLRef):
3347         * UIProcess/API/C/WKBackForwardListItem.cpp:
3348         (WKBackForwardListItemCopyOriginalURL):
3349         (WKBackForwardListItemCopyURL):
3350         (WKBackForwardListItemCopyTitle):
3351         * UIProcess/API/C/WKBackForwardListItem.h:
3352         * UIProcess/API/C/WKFrame.cpp:
3353         (WKFrameIsMainFrame):
3354         (WKFrameCopyProvisionalURL):
3355         (WKFrameCopyURL):
3356         (WKFrameGetPage):
3357         (WKFrameRetain):
3358         (WKFrameRelease):
3359         * UIProcess/API/C/WKFrame.h:
3360         * UIProcess/API/C/WKNavigationData.cpp:
3361         (WKNavigationDataCopyTitle):
3362         (WKNavigationDataCopyURL):
3363         * UIProcess/API/C/WKNavigationData.h:
3364         * UIProcess/API/C/WKPage.cpp:
3365         (WKPageCopyTitle):
3366         * UIProcess/API/C/WKPage.h:
3367         * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
3368         (WKBundleFrameCopyURL):
3369         (WKBundleFrameCopyName):
3370         (WKBundleFrameCopyCounterValue):
3371         (WKBundleFrameCopyMarkerText):
3372         * WebProcess/InjectedBundle/API/c/WKBundleFrame.h:
3373         * WebProcess/InjectedBundle/API/c/WKBundleNode.cpp:
3374         (WKBundleNodeCopyNodeName):
3375         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
3376         (WKBundlePageCopyRenderTreeExternalRepresentation):
3377
3378 2010-07-27  Adam Roben  <aroben@apple.com>
3379
3380         Fix PageClient ownership in WebPageProxy
3381
3382         WKView now owns the PageClient, similar to how things work on Windows
3383         (where the WebView is the PageClient).
3384
3385         Fixes <http://webkit.org/b/40185> WebPageProxy should keep a weak
3386         reference to the PageClient
3387
3388         Reviewed by Anders Carlsson.
3389
3390         * UIProcess/API/mac/WKView.mm:
3391         (-[WKView initWithFrame:pageNamespaceRef:]): Store the PageClientImpl
3392         on our WKViewData object and pass it to the WebPageProxy.
3393
3394         * UIProcess/WebPageProxy.cpp:
3395         (WebKit::WebPageProxy::setPageClient):
3396         * UIProcess/WebPageProxy.h:
3397         Removed Mac-specific code that put the PageClient in an OwnPtr. We now
3398         store it in a bare pointer just like on Windows.
3399
3400 2010-07-27  Anders Carlsson  <andersca@apple.com>
3401
3402         Reviewed by Sam Weinig.
3403
3404         Add JSNPObject, a JSObject that wraps an NPObject
3405         https://bugs.webkit.org/show_bug.cgi?id=43079
3406
3407         * WebKit2.xcodeproj/project.pbxproj:
3408         Add JSNPObject.cpp and JSNPObject.h
3409         
3410         * WebProcess/Plugins/JSNPObject.cpp: Added.
3411         (WebKit::npIdentifierFromIdentifier):
3412         (WebKit::JSNPObject::JSNPObject):
3413         (WebKit::JSNPObject::~JSNPObject):
3414         (WebKit::JSNPObject::getOwnPropertySlot):
3415         Check if the NPObject has the given property.
3416
3417         (WebKit::JSNPObject::propertyGetter):
3418         (WebKit::JSNPObject::throwInvalidAccessError):
3419         * WebProcess/Plugins/JSNPObject.h: Added.
3420         (WebKit::JSNPObject::createStructure):
3421         * WebProcess/Plugins/NPJSObject.h:
3422         
3423         * win/WebKit2.vcproj:
3424         Add JSNPObject.cpp and JSNPObject.h
3425
3426 2010-07-27  Anders Carlsson  <andersca@apple.com>
3427
3428         Reviewed by Sam Weinig.
3429
3430         Expose interface for returning the plug-in script JSObject
3431         https://bugs.webkit.org/show_bug.cgi?id=43074
3432
3433         * WebProcess/Plugins/NPRuntimeObjectMap.cpp:
3434         (WebKit::NPRuntimeObjectMap::getOrCreateJSObject):
3435         Add empty stub.
3436
3437         * WebProcess/Plugins/NPRuntimeObjectMap.h:
3438         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
3439         (WebKit::NetscapePlugin::pluginScriptableNPObject):
3440         Ask the plug-in for it's scriptable NPObject.
3441
3442         * WebProcess/Plugins/Netscape/NetscapePlugin.h:
3443         * WebProcess/Plugins/Plugin.h:
3444         Add pluginScritableNPObject.
3445
3446         * WebProcess/Plugins/PluginView.cpp:
3447         (WebKit::PluginView::PluginView):
3448         Call PluginViewBase constructor.
3449
3450         (WebKit::PluginView::scriptObject):
3451         Ask the plug-in for its scriptable object and wrap it.
3452
3453         * WebProcess/Plugins/PluginView.h:
3454         PluginView now inherits from PluginViewBase.
3455
3456 2010-07-27  Anders Carlsson  <andersca@apple.com>
3457
3458         Reviewed by Adam Roben.
3459
3460         Move NPJSObject out into separate files
3461         https://bugs.webkit.org/show_bug.cgi?id=43068
3462
3463         * WebKit2.xcodeproj/project.pbxproj:
3464         * WebProcess/Plugins/NPJSObject.cpp: Added.
3465         (WebKit::NPJSObject::create):
3466         (WebKit::NPJSObject::NPJSObject):
3467         (WebKit::NPJSObject::~NPJSObject):
3468         (WebKit::NPJSObject::isNPJSObject):
3469         (WebKit::NPJSObject::initialize):
3470         (WebKit::identifierFromIdentifierRep):
3471         (WebKit::NPJSObject::hasProperty):
3472         (WebKit::NPJSObject::getProperty):
3473         (WebKit::NPJSObject::npClass):
3474         (WebKit::NPJSObject::NP_Allocate):
3475         (WebKit::NPJSObject::NP_Deallocate):
3476         (WebKit::NPJSObject::NP_HasProperty):
3477         (WebKit::NPJSObject::NP_GetProperty):
3478         * WebProcess/Plugins/NPJSObject.h: Added.
3479         (WebKit::NPJSObject::jsObject):
3480         (WebKit::NPJSObject::toNPJSObject):
3481         * WebProcess/Plugins/NPRuntimeObjectMap.cpp:
3482         (WebKit::NPRuntimeObjectMap::npJSObjectDestroyed):
3483         (WebKit::NPRuntimeObjectMap::globalExec):
3484         * WebProcess/Plugins/NPRuntimeObjectMap.h:
3485         * win/WebKit2.vcproj:
3486
3487 2010-07-27  Anders Carlsson  <andersca@apple.com>
3488
3489         Reviewed by Adam Roben.
3490
3491         Rename NPJSObjectMap to NPRuntimeObjectMap
3492         https://bugs.webkit.org/show_bug.cgi?id=43066
3493
3494         * WebKit2.xcodeproj/project.pbxproj:
3495         * WebProcess/Plugins/NPJSObjectMap.cpp: Removed.
3496         * WebProcess/Plugins/NPJSObjectMap.h: Removed.
3497         * WebProcess/Plugins/NPRuntimeObjectMap.cpp: Added.
3498         (WebKit::NPJSObject::NPJSObject):
3499         (WebKit::NPJSObject::~NPJSObject):
3500         (WebKit::NPJSObject::toNPJSObject):
3501         (WebKit::NPJSObject::create):
3502         (WebKit::NPJSObject::isNPJSObject):
3503         (WebKit::NPJSObject::initialize):
3504         (WebKit::identifierFromIdentifierRep):
3505         (WebKit::NPJSObject::hasProperty):
3506         (WebKit::NPJSObject::getProperty):
3507         (WebKit::NPJSObject::npClass):
3508         (WebKit::NPJSObject::NP_Allocate):
3509         (WebKit::NPJSObject::NP_Deallocate):
3510         (WebKit::NPJSObject::NP_HasProperty):
3511         (WebKit::NPJSObject::NP_GetProperty):
3512         (WebKit::NPRuntimeObjectMap::NPRuntimeObjectMap):
3513         (WebKit::NPRuntimeObjectMap::getOrCreateNPObject):
3514         (WebKit::NPRuntimeObjectMap::invalidate):
3515         * WebProcess/Plugins/NPRuntimeObjectMap.h: Added.
3516         * WebProcess/Plugins/PluginView.cpp:
3517         (WebKit::PluginView::PluginView):
3518         (WebKit::PluginView::~PluginView):
3519         (WebKit::PluginView::windowScriptNPObject):
3520         (WebKit::PluginView::pluginElementNPObject):
3521         * WebProcess/Plugins/PluginView.h:
3522         * win/WebKit2.vcproj:
3523
3524 2010-07-27  Adam Roben  <aroben@apple.com>
3525
3526         Make preferences APIs robust against web process crashes
3527
3528         Fixes <http://webkit.org/b/43049> Crash in
3529         WebPageNamespace::preferencesDidChange if preferences are changed
3530         after the web process crashes
3531
3532         Reviewed by Anders Carlsson.
3533
3534         * UIProcess/WebContext.cpp:
3535         (WebKit::WebContext::preferencesDidChange): Bail out if we don't have
3536         a web process. The new preference values will get propogated to the
3537         web process if and when it launches.
3538
3539 2010-07-27  Adam Roben  <aroben@apple.com>
3540
3541         Add a ProcessDidExit callback to the WKPageLoaderClient
3542
3543         Fixes <http://webkit.org/b/43048> UI process needs a way to find out
3544         when the web process crashes
3545
3546         Reviewed by Anders Carlsson.
3547
3548         * UIProcess/API/C/WKPage.h: Added WKPageProcessDidExitCallback, and a
3549         processDidExit member of that type to WKPageLoaderClient.
3550
3551         * UIProcess/WebLoaderClient.cpp:
3552         (WebKit::WebLoaderClient::processDidExit): Added. Calls through to the
3553         WKPageLoaderClient.
3554
3555         * UIProcess/WebLoaderClient.h: Added processDidExit.
3556
3557         * UIProcess/WebPageProxy.cpp:
3558         (WebKit::WebPageProxy::processDidExit): Tell the loader client the
3559         process exited.
3560
3561 2010-07-27  Andras Becsi  <abecsi@webkit.org>
3562
3563         Reviewed by Kenneth Rohde Christiansen.
3564
3565         [Qt] WebEventFactory::createWebMouseEvent should follow WebKit2 API changes
3566         https://bugs.webkit.org/show_bug.cgi?id=43042
3567
3568         * Shared/qt/WebEventFactoryQt.cpp:
3569         (WebKit::WebEventFactory::createWebMouseEvent):
3570         Set deltaX, deltaY and deltaZ arguments.
3571
3572 2010-07-27  Balazs Kelemen  <kb@inf.u-szeged.hu>
3573
3574         Reviewed by Kenneth Rohde Christiansen.
3575
3576         [Qt] WebKit::PageClient implementation needs a dedicated class
3577
3578         https://bugs.webkit.org/show_bug.cgi?id=42974
3579
3580         * UIProcess/API/qt/qwkpage.cpp:
3581         (PageClientImpl::PageClientImpl): Added.
3582         (PageClientImpl::pageDidEnterAcceleratedCompositing): Moved from QWKPagePrivate.
3583         (PageClientImpl::pageDidLeaveAcceleratedCompositing): Ditto.
3584         (PageClientImpl::processDidExit): Ditto.
3585         (PageClientImpl::processDidRevive): Ditto.
3586         (PageClientImpl::setCursor): Ditto.
3587         (PageClientImpl::takeFocus): Ditto.
3588         (PageClientImpl::toolTipChanged): Ditto.
3589         (QWKPagePrivate::QWKPagePrivate): Set a new instance of the PageClientImpl as PageClient rather than 'this'.
3590         * UIProcess/API/qt/qwkpage_p.h: Removed PageClient implementation methods from QWKPagePrivate.
3591
3592 2010-07-26  Darin Adler  <darin@apple.com>
3593
3594         Reviewed by Sam Weinig.
3595
3596         WebKitTestRunner needs to support layoutTestController.counterValueForElementById
3597         https://bugs.webkit.org/show_bug.cgi?id=42537
3598
3599         WebKitTestRunner needs layoutTestController.markerTextForListItem
3600         https://bugs.webkit.org/show_bug.cgi?id=42549
3601
3602         * UIProcess/API/C/WKString.cpp:
3603         (WKStringIsEmpty): Added.
3604         * UIProcess/API/C/WKString.h: Added WKStringIsEmpty.
3605
3606         * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
3607         (copiedString): Added. Helper for functions that return a
3608         WKStringRef that follows the copy rule.
3609         (WKBundleFrameCopyName): Use copiedString.
3610         (WKBundleFrameCopyCounterValue): Added. Calls counterValue.
3611         (WKBundleFrameCopyMarkerText): Added. Calls markerText.
3612         * WebProcess/InjectedBundle/API/c/WKBundleFramePrivate.h:
3613         Added WKBundleFrameCopyCounterValue and WKBundleFrameCopyMarkerText.
3614
3615         * WebProcess/WebPage/WebFrame.cpp:
3616         (WebKit::WebFrame::computedStyleIncludingVisitedInfo):
3617         Renamed argument to streamline function a bit.
3618         (WebKit::WebFrame::counterValue): Added.
3619         (WebKit::WebFrame::markerText): Added.
3620         * WebProcess/WebPage/WebFrame.h: Added counterValue and markerText.
3621
3622 2010-07-26  Sam Weinig  <sam@webkit.org>
3623
3624         Reviewed by Anders Carlsson.
3625
3626         Part 2 of https://bugs.webkit.org/show_bug.cgi?id=43013
3627         <rdar://problem/8152434>
3628         Add support for scrolling using the keyboard in WebKit2
3629
3630         Add support for scrolling with the space bar and ensure that we don't scroll
3631         if WebCore is handling the event in another way.
3632
3633         * WebProcess/WebPage/WebPage.cpp:
3634         (WebKit::WebPage::keyEvent):
3635         (WebKit::getScrollMapping):
3636         (WebKit::WebPage::performDefaultBehaviorForKeyEvent):
3637         * WebProcess/WebPage/WebPage.h:
3638
3639 2010-07-26  Sam Weinig  <sam@webkit.org>
3640
3641         Reviewed by Anders Carlsson.
3642
3643         Patch for https://bugs.webkit.org/show_bug.cgi?id=43013
3644         Part of <rdar://problem/8152434>
3645         Add support for scrolling using the keyboard in WebKit2
3646
3647         * WebProcess/WebPage/WebPage.cpp:
3648         (WebKit::getScrollMapping):
3649         (WebKit::WebPage::keyEvent):
3650         Scroll the page in response to keyDown.
3651         * WebProcess/WebPage/WebPage.h:
3652         * WebProcess/WebPage/mac/WebPageMac.mm:
3653         Use WindowsKeyboardCodes.h instead of redefining the constants.
3654
3655 2010-07-26  Ada Chan  <adachan@apple.com>
3656
3657         Fix Windows build.
3658
3659         * win/WebKit2Generated.make:
3660
3661 2010-07-26  Anders Carlsson  <andersca@apple.com>
3662
3663         Fix Windows build.
3664
3665         * WebProcess/Plugins/Netscape/NetscapePlugin.h:
3666         (WebKit::NetscapePlugin::platformHandleMouseEnterEvent):
3667         (WebKit::NetscapePlugin::platformHandleMouseLeaveEvent):
3668
3669 2010-07-26  Anders Carlsson  <andersca@apple.com>
3670
3671         Reviewed by Sam Weinig.
3672
3673         Handle mouseenter/mouseleave + focus events
3674         https://bugs.webkit.org/show_bug.cgi?id=42997
3675
3676         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
3677         (WebKit::NetscapePlugin::handleMouseEnterEvent):
3678         Call platformHandleMouseEnterEvent.
3679         
3680         (WebKit::NetscapePlugin::handleMouseLeaveEvent):
3681         Call platformHandleMouseExitEvent.
3682
3683         (WebKit::NetscapePlugin::setFocus):
3684         Call platformSetFocus.
3685
3686         * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
3687         (WebKit::fillInCocoaEventFromMouseEvent):
3688         Factor out code that fills in an NPCocoaEvent from a WebMouseEvent.
3689
3690         (WebKit::initializeMouseEvent):
3691         Call fillInCocoaEventFromMouseEvent.
3692         
3693         (WebKit::NetscapePlugin::platformHandleMouseEnterEvent):
3694         Send an NPCocoaEventMouseEntered event.
3695     
3696         (WebKit::NetscapePlugin::platformHandleMouseLeaveEvent):
3697         Send an NPCocoaEventMouseExited event.
3698
3699         (WebKit::NetscapePlugin::platformSetFocus):
3700         Send an NPCocoaEventFocusChanged.
3701
3702         * WebProcess/Plugins/Plugin.h:
3703         * WebProcess/Plugins/PluginView.cpp:
3704         (WebKit::PluginView::handleEvent):
3705         Dispatch mouse enter and mouse leave events. Call focusPluginElement on mousedown.
3706
3707         (WebKit::PluginView::focusPluginElement):
3708         Focus the plug-in's containing frame and its element.
3709
3710         (WebKit::PluginView::setFocus):
3711         Call Plugin::setFocus.
3712
3713 2010-07-26  Brady Eidson  <beidson@apple.com>
3714
3715         Reviewed by Sam Weinig.
3716
3717         Add ability for WK2 to register a scheme to always be displayed as an empty document
3718         https://bugs.webkit.org/show_bug.cgi?id=42995
3719
3720         * Shared/CoreIPCSupport/WebProcessMessageKinds.h:
3721         (WebProcessMessage::):
3722         
3723         * UIProcess/API/C/WKContext.cpp:
3724         (_WKContextRegisterURLSchemeAsEmptyDocument):
3725         * UIProcess/API/C/WKContextPrivate.h:
3726         
3727         * UIProcess/WebContext.cpp:
3728         (WebKit::WebContext::registerURLSchemeAsEmptyDocument):
3729         * UIProcess/WebContext.h:
3730         
3731         * WebProcess/WebProcess.cpp:
3732         (WebKit::WebProcess::registerURLSchemeAsEmptyDocument):
3733         (WebKit::WebProcess::didReceiveMessage):
3734         * WebProcess/WebProcess.h:
3735
3736 2010-07-26  Anders Carlsson  <andersca@apple.com>
3737
3738         Reviewed by Adam Roben.
3739
3740         Get rid of the dummy plug-in.
3741
3742         * WebKit2.xcodeproj/project.pbxproj:
3743         * WebProcess/Plugins/DummyPlugin.cpp: Removed.
3744         * WebProcess/Plugins/DummyPlugin.h: Removed.
3745         * win/WebKit2.vcproj:
3746
3747 2010-07-26  Sam Weinig  <sam@webkit.org>
3748
3749         Reviewed by Anders Carlsson.
3750
3751         Move some non-APIish functions into private headers.
3752
3753         * WebKit2.xcodeproj/project.pbxproj:
3754         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
3755         * WebProcess/InjectedBundle/API/c/WKBundle.h:
3756         * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
3757         * WebProcess/InjectedBundle/API/c/WKBundleFrame.h:
3758         * WebProcess/InjectedBundle/API/c/WKBundleFramePrivate.h: Copied from WebProcess/InjectedBundle/API/c/WKBundleFrame.h.
3759         * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h: Copied from WebProcess/InjectedBundle/API/c/WKBundle.h.
3760         * win/WebKit2.vcproj:
3761
3762 2010-07-26  Sam Weinig  <sam@webkit.org>
3763
3764         Reviewed by Anders Carlsson.
3765
3766         Fix for https://bugs.webkit.org/show_bug.cgi?id=42986
3767         Add prompt and confirm client functions to WebKit2
3768
3769         * Shared/CoreIPCSupport/WebPageProxyMessageKinds.h:
3770         (WebPageProxyMessage::):
3771         * UIProcess/API/C/WKPage.h:
3772         * UIProcess/WebPageProxy.cpp:
3773         (WebKit::WebPageProxy::didReceiveSyncMessage):
3774         (WebKit::WebPageProxy::runJavaScriptAlert):
3775         (WebKit::WebPageProxy::runJavaScriptConfirm):
3776         (WebKit::WebPageProxy::runJavaScriptPrompt):
3777         * UIProcess/WebPageProxy.h:
3778         * UIProcess/WebUIClient.cpp:
3779         (WebKit::WebUIClient::runJavaScriptAlert):
3780         (WebKit::WebUIClient::runJavaScriptConfirm):
3781         (WebKit::WebUIClient::runJavaScriptPrompt):
3782         * UIProcess/WebUIClient.h:
3783         * WebKit2.xcodeproj/project.pbxproj:
3784         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3785         (WebKit::WebChromeClient::runJavaScriptConfirm):
3786         (WebKit::WebChromeClient::runJavaScriptPrompt):
3787
3788 2010-07-26  Adam Roben  <aroben@apple.com>
3789
3790         Windows build fix
3791
3792         * win/WebKit2.vcproj:
3793         * win/WebKit2WebProcess.vcproj:
3794         Removed empty attributes so the values will be picked up from the
3795         vsprops files. (Also removed a couple of attributes that accidentally
3796         duplicated values from the vsprops files.)
3797
3798 2010-07-26  Simon Fraser  <simon.fraser@apple.com>
3799
3800         Reviewed by Anders Carlsson.
3801
3802         Composited layers don't scroll in WebKit2
3803         https://bugs.webkit.org/show_bug.cgi?id=42771
3804         
3805         In WebKit2, do the compositing layer geometry flipping on the drawing area's main 
3806         backing layer. This both avoids us having to flip the layer contents, and also avoids issues
3807         with the positioning of the root platform layer, which we want top-left. Doing the flipping
3808         lower down would require that the root platform layer know where the scrollbar is.
3809
3810         * WebProcess/WebPage/LayerBackedDrawingArea.cpp:
3811         (WebKit::LayerBackedDrawingArea::LayerBackedDrawingArea):
3812
3813 2010-07-26  Anders Carlsson  <andersca@apple.com>
3814
3815         Reviewed by Sam Weinig.
3816
3817         Deliver mouse and wheel events to plug-ins
3818         https://bugs.webkit.org/show_bug.cgi?id=42988
3819
3820         * Shared/WebEvent.h:
3821         (WebKit::WebMouseEvent::WebMouseEvent):
3822         (WebKit::WebMouseEvent::deltaX):
3823         (WebKit::WebMouseEvent::deltaY):
3824         (WebKit::WebMouseEvent::deltaZ):
3825         * Shared/mac/WebEventFactory.mm:
3826         (WebKit::WebEventFactory::createWebMouseEvent):
3827         Add deltaX, deltaY and deltaZ member variables to WebMosueEvent.
3828
3829         * WebKit2.xcodeproj/project.pbxproj:
3830         Rename NetscapePluginMac.cpp to NetscapePluginMac.mm.
3831         
3832         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
3833         (WebKit::NetscapePlugin::NPP_HandleEvent):
3834         Add NPP_ wrapper.
3835
3836         (WebKit::NetscapePlugin::handleMouseEvent):
3837         (WebKit::NetscapePlugin::handleWheelEvent):
3838         Call the platform variants.
3839     
3840         * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm: Added.
3841         (WebKit::modifierFlags):        
3842         (WebKit::buttonNumber):
3843         (WebKit::initializeMouseEvent):
3844         (WebKit::NetscapePlugin::platformHandleMouseEvent):
3845         Create an NPCocoaEvent and send it to the plug-in.
3846         
3847         (WebKit::NetscapePlugin::platformHandleWheelEvent):
3848         Ditto.
3849
3850         * WebProcess/Plugins/PluginView.cpp:
3851         (WebKit::PluginView::handleEvent):
3852         Get the current WebEvent and send it to the plug-in if necessary.
3853
3854         * WebProcess/WebPage/WebPage.cpp:
3855         (WebKit::WebPage::currentEvent):
3856         (WebKit::CurrentEvent::CurrentEvent):
3857         (WebKit::CurrentEvent::~CurrentEvent):
3858         (WebKit::WebPage::mouseEvent):
3859         (WebKit::WebPage::wheelEvent):
3860         (WebKit::WebPage::keyEvent):
3861         * WebProcess/WebPage/WebPage.h:
3862         Add RAII object for keeping track of the current event.
3863
3864 2010-07-26  Anders Carlsson  <andersca@apple.com>
3865
3866         Reviewed by Sam Weinig.
3867
3868         Clean up event handling functions
3869         https://bugs.webkit.org/show_bug.cgi?id=42977
3870
3871         * WebProcess/WebPage/WebPage.cpp:
3872         (WebKit::WebPage::mouseEvent):
3873         (WebKit::WebPage::wheelEvent):
3874         (WebKit::WebPage::keyEvent):
3875         (WebKit::WebPage::didReceiveMessage):
3876         * WebProcess/WebPage/WebPage.h:
3877
3878 2010-07-25  Darin Adler  <darin@apple.com>
3879
3880         Reviewed by Maciej Stachowiak.
3881
3882         WebKitTestRunner needs to support layoutTestController.keepWebHistory
3883         https://bugs.webkit.org/show_bug.cgi?id=42323
3884
3885         Added WKBundleSetShouldTrackVisitedLinks, WKBundleRemoveAllVisitedLinks,
3886         and WKBundleFrameGetComputedStyleIncludingVisitedInfo.
3887
3888         Also fixed misspellings of the word "receive".
3889
3890         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
3891         (WKBundleSetShouldTrackVisitedLinks): Added.
3892         (WKBundleRemoveAllVisitedLinks): Added.
3893         * WebProcess/InjectedBundle/API/c/WKBundle.h: Added functions and
3894         fixed mispellings of receive.
3895
3896         * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
3897         (WKBundleFrameGetJavaScriptContext): Moved the code from here into WebFrame,
3898         to be consistent with the rest of the functions in this file.
3899         (WKBundleFrameGetComputedStyleIncludingVisitedInfo): Added.
3900         * WebProcess/InjectedBundle/API/c/WKBundleFrame.h: Added
3901         WKBundleFrameGetComputedStyleIncludingVisitedInfo and tried to rearrange the
3902         file to be more logically ordered and grouped.
3903
3904         * WebProcess/InjectedBundle/InjectedBundle.cpp:
3905         (WebKit::InjectedBundle::setShouldTrackVisitedLinks): Added.
3906         (WebKit::InjectedBundle::removeAllVisitedLinks): Added.
3907         (WebKit::InjectedBundle::didReceiveMessage): Fixed mispellings of receive.
3908         * WebProcess/InjectedBundle/InjectedBundle.h: Ditto.
3909
3910         * WebProcess/WebPage/WebFrame.cpp:
3911         (WebKit::WebFrame::jsContext): Added. Contains the code that used to be in
3912         WKBundleFrameGetJavaScriptContext.
3913         (WebKit::WebFrame::computedStyleIncludingVisitedInfo): Added.
3914         * WebProcess/WebPage/WebFrame.h: Ditto.
3915
3916         * UIProcess/API/C/WKContext.h: Fixed misspellings of receive.
3917         * UIProcess/WebContext.cpp:
3918         (WebKit::WebContext::didReceiveMessageFromInjectedBundle): Ditto.
3919         * UIProcess/WebContext.h: Ditto.
3920         * UIProcess/WebContextInjectedBundleClient.cpp:
3921         (WebKit::WebContextInjectedBundleClient::didReceiveMessageFromInjectedBundle): Ditto.
3922         * UIProcess/WebContextInjectedBundleClient.h: Ditto.
3923         * UIProcess/WebProcessProxy.cpp:
3924         (WebKit::WebProcessProxy::forwardMessageToWebContext): Ditto.
3925         * WebProcess/WebProcess.cpp:
3926         (WebKit::WebProcess::forwardMessageToInjectedBundle): Ditto.
3927
3928 2010-07-25  Alexey Proskuryakov  <ap@apple.com>
3929
3930         Reviewed by Sam Weinig.
3931
3932         https://bugs.webkit.org/show_bug.cgi?id=42193
3933         Support layoutTestController.dumpEditingDelegates in WebKitTestRunner
3934
3935         Step 2 - add the rest of editing delegates.
3936
3937         * WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
3938         * WebProcess/InjectedBundle/API/c/WKBundleBase.h:
3939         Added enums for EditorInsertAction and EAffinity. Also added a dummy type for
3940         CSSStyleDeclaration - neither DumpRenderTree not WebKitTestRunner actually use that.
3941
3942         * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
3943         * WebProcess/InjectedBundle/InjectedBundlePageEditorClient.cpp:
3944         (WebKit::InjectedBundlePageEditorClient::shouldBeginEditing):
3945         (WebKit::InjectedBundlePageEditorClient::shouldEndEditing):
3946         (WebKit::InjectedBundlePageEditorClient::shouldInsertNode):
3947         (WebKit::InjectedBundlePageEditorClient::shouldInsertText):
3948         (WebKit::InjectedBundlePageEditorClient::shouldDeleteRange):
3949         (WebKit::InjectedBundlePageEditorClient::shouldChangeSelectedRange):
3950         (WebKit::InjectedBundlePageEditorClient::shouldApplyStyle):
3951         (WebKit::InjectedBundlePageEditorClient::didBeginEditing):
3952         (WebKit::InjectedBundlePageEditorClient::didEndEditing):
3953         (WebKit::InjectedBundlePageEditorClient::didChange):
3954         (WebKit::InjectedBundlePageEditorClient::didChangeSelection):
3955         * WebProcess/InjectedBundle/InjectedBundlePageEditorClient.h:
3956         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
3957         (WebKit::WebEditorClient::shouldDeleteRange):
3958         (WebKit::WebEditorClient::shouldEndEditing):
3959         (WebKit::WebEditorClient::shouldInsertNode):
3960         (WebKit::WebEditorClient::shouldInsertText):
3961         (WebKit::WebEditorClient::shouldChangeSelectedRange):
3962         (WebKit::WebEditorClient::shouldApplyStyle):
3963         (WebKit::WebEditorClient::didBeginEditing):
3964         (WebKit::WebEditorClient::respondToChangedContents):
3965         (WebKit::WebEditorClient::respondToChangedSelection):
3966         (WebKit::WebEditorClient::didEndEditing):
3967         Added remaining delagates that are needed for WebKitTestRunner.
3968
3969 2010-07-19 Balazs Kelemen <kb@inf.u-szeged.hu>
3970
3971         Reviewed by Kenneth Rohde Christiansen.
3972
3973         [Qt] Setup the QtWebProcess
3974
3975         https://bugs.webkit.org/show_bug.cgi?id=42623
3976
3977         * UIProcess/Launcher/qt/ProcessLauncherQt.cpp:
3978         Remove the framework entry point from here to WebProcess/qt/WebProcessMainQt.cpp to match with with the mac and the win port.
3979         * WebKit2.pro: Added.
3980         * WebProcess/qt/WebProcessMainQt.cpp: Added.
3981         (WebKit::WebProcessMainQt): Framework entry point for Qt.
3982         * qt/MainQt.cpp: Added.
3983         (main):
3984
3985 2010-07-22  Darin Adler  <darin@apple.com>
3986
3987         Reviewed by Sam Weinig.
3988
3989         Eliminate unneeded WKBundleFrameCopyInnerText function from WebKit2
3990         https://bugs.webkit.org/show_bug.cgi?id=42847
3991
3992         * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp: Removed WKBundleFrameCopyInnerText.
3993         * WebProcess/InjectedBundle/API/c/WKBundleFrame.h: Ditto.
3994         * WebProcess/WebPage/WebFrame.cpp: Removed innerText.
3995         * WebProcess/WebPage/WebFrame.h: Ditto.
3996
3997 2010-07-22  Alexey Proskuryakov  <ap@apple.com>
3998
3999         More Windows build fixing.
4000
4001         * win/WebKit2Generated.make: Copy the new public headers to $(WEBKITOUTPUTDIR)\include\WebKit2.
4002
4003 2010-07-22  Alexey Proskuryakov  <ap@apple.com>
4004
4005         Windows build fix.
4006
4007         * win/WebKit2.vcproj: Added new files.
4008
4009 2010-07-22  Alexey Proskuryakov  <ap@apple.com>
4010
4011         Reviewed by Sam Weinig and Darin Adler.
4012
4013         https://bugs.webkit.org/show_bug.cgi?id=42193
4014         Support layoutTestController.dumpEditingDelegates in WebKitTestRunner
4015
4016         Step 1: Add the method, and implement one actual delegate call as proof of concept. No tests
4017         fixed, but this makes difference one line smaller on many editing tests.
4018
4019         * WebKit2.xcodeproj/project.pbxproj:
4020         * WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
4021         * WebProcess/InjectedBundle/API/c/WKBundleBase.h:
4022         * WebProcess/InjectedBundle/API/c/WKBundleNode.cpp: Added.
4023         (WKBundleNodeCopyNodeName):
4024         (WKBundleNodeGetParent):
4025         * WebProcess/InjectedBundle/API/c/WKBundleNode.h: Added.
4026         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
4027         (WKBundlePageSetEditorClient):
4028         * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
4029         * WebProcess/InjectedBundle/API/c/WKBundleRange.cpp: Added.
4030         (WKBundleRangeGetStartOffset):
4031         (WKBundleRangeGetStartContainer):
4032         (WKBundleRangeGetEndOffset):
4033         (WKBundleRangeGetEndContainer):
4034         * WebProcess/InjectedBundle/API/c/WKBundleRange.h: Added.
4035         Added WKBundleRangeRef and WKBundleNodeRef types for injected bundles. These are just pointers
4036         to respective WebCore objects, without any WebKit2 wrappers.
4037
4038         * WebProcess/InjectedBundle/InjectedBundlePageEditorClient.cpp: Added.
4039         (WebKit::InjectedBundlePageEditorClient::InjectedBundlePageEditorClient):
4040         (WebKit::InjectedBundlePageEditorClient::initialize):
4041         (WebKit::InjectedBundlePageEditorClient::shouldBeginEditing):
4042         * WebProcess/InjectedBundle/InjectedBundlePageEditorClient.h: Added.
4043         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
4044         (WebKit::WebEditorClient::shouldBeginEditing):
4045         * WebProcess/WebPage/WebPage.cpp:
4046         (WebKit::WebPage::initializeInjectedBundleEditorClient):
4047         * WebProcess/WebPage/WebPage.h:
4048         (WebKit::WebPage::injectedBundleEditorClient):
4049         Added the plumbing for invoking injected bundle code for editor client. There is no real API
4050         for editor client yet.
4051
4052 2010-07-22  Ivan Krstić  <ike@apple.com>
4053
4054         Reviewed by Anders Carlsson.
4055
4056         Adapt sandbox for new WebProcess bootstrap service naming scheme.
4057         <rdar://problem/8225000>
4058
4059         * WebProcess/com.apple.WebProcess.sb:
4060
4061 2010-07-22  Anders Carlsson  <andersca@apple.com>
4062
4063         Reviewed by Adam Roben.
4064
4065         It should be possible to attach to the WebProcess in gdb during startup
4066         https://bugs.webkit.org/show_bug.cgi?id=42853
4067
4068         Create an unique bootstrap service name and pass it to the web process, instead of registering a per process
4069         name (which was incorrect anyway). This lets us get rid of the requirement that the UI process always should be
4070         the parent process of the web process, something which is false when running under the debugger.
4071
4072         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
4073         (WebKit::ProcessLauncher::launchProcess):
4074         * WebProcess/mac/WebProcessMainMac.mm:
4075         (WebKit::WebProcessMain):
4076
4077 2010-07-22  Anders Carlsson  <andersca@apple.com>
4078
4079         Reviewed by Sam Weinig.
4080
4081         Don't assert when Connection::invalidate is called before Connection::dispatchConnectionDidClose
4082         https://bugs.webkit.org/show_bug.cgi?id=42851
4083
4084         * Platform/CoreIPC/Connection.cpp:
4085         (CoreIPC::Connection::dispatchConnectionDidClose):
4086         Just return early if m_client is 0.
4087
4088 2010-07-22  Adam Roben  <aroben@apple.com>
4089
4090         Use ::MessageBox instead of ::DebugBreak to make the web process wait
4091         for a debugger
4092
4093         While ::DebugBreak can make it easier to attach a debugger (because it
4094         brings up the Just-in-Time debugger window), using ::MessageBox has
4095         two advantages:
4096           1) It explains to the user what's going on, so it's harder to
4097              mistake this debugging aid for a bug.
4098           2) It allows you to debug the UI process and the web process using
4099              the same debugger, if desired.
4100
4101         Special thanks to John Sullivan for help with the text that's shown in
4102         the alert.
4103
4104         Fixes <http://webkit.org/b/42848> WebKit2's wait-for-debugger
4105         debugging aid should explain to the user what's happening
4106
4107         Reviewed by John Sullivan and Anders Carlsson.
4108
4109         * WebProcess/WebKitMain.cpp:
4110         (WebKitMain): Use a ::MessageBox instead of a ::DebugBreak to wait for
4111         the debugger. The alert explains to the user what's going on.
4112
4113 2010-07-22  Adam Roben  <aroben@apple.com>
4114
4115         Make WorkQueue aware of potential errors with ::WaitForMultipleObjects
4116
4117         Fixes <http://webkit.org/b/42846> WorkQueue should detect
4118         ::WaitForMultipleObject failures
4119
4120         Reviewed by Anders Carlsson.
4121
4122         * Platform/win/WorkQueueWin.cpp:
4123         (WorkQueue::workQueueThreadBody): Added some assertions about the
4124         various things that can fail with ::WaitForMultipleObjects,
4125         specifically:
4126           - Passing too many objects
4127           - Timeouts (which shouldn't happen since we pass a timeout interval
4128             of INFINITE)
4129           - Abandoned mutexes (which shouldn't happen since we don't wait on
4130             any mutexes currently)
4131           - Miscellaneous failures
4132
4133 2010-07-22  Sam Weinig  <sam@webkit.org>
4134
4135         Reviewed by Anders Carlsson.
4136
4137         Patch for https://bugs.webkit.org/show_bug.cgi?id=42836
4138         Add localized strings stubs for WebKit2.
4139
4140         Gets us below 200 tests failing in WebKitTestRunner.
4141
4142         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
4143         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
4144
4145 2010-07-22  Andras Becsi  <abecsi@webkit.org>
4146
4147         Unreviewed trivial build fix.
4148
4149         [Qt] Mend remaining issues to fix the WebKit2 build.
4150
4151         * Shared/qt/UpdateChunk.h: add missing function
4152         (WebKit::UpdateChunk::isEmpty):
4153         * UIProcess/API/qt/qwkpage_p.h: Add stub implementation
4154         (QWKPagePrivate::pageDidEnterAcceleratedCompositing):
4155         (QWKPagePrivate::pageDidLeaveAcceleratedCompositing):
4156
4157 2010-07-22  Andras Becsi  <abecsi@webkit.org>
4158
4159         Reviewed by Antonio Gomes.
4160
4161         [Qt] Implement WebContext::applicationCacheDirectory() for the Qt port of WebKit2.
4162         https://bugs.webkit.org/show_bug.cgi?id=42830
4163
4164         * UIProcess/qt/WebContextQt.cpp: Added.
4165         (WebKit::WebContext::applicationCacheDirectory):
4166
4167 2010-07-22  Balazs Kelemen  <kb@inf.u-szeged.hu>
4168
4169         Unreviewed build fix.
4170
4171         [Qt] Fix WebKit2 build
4172
4173         https://bugs.webkit.org/show_bug.cgi?id=42638
4174
4175         * UIProcess/API/qt/qwkpage_p.h:
4176         (QWKPagePrivate::setCursor): Added empty implementation.
4177
4178 2010-07-22  Balazs Kelemen  <kb@inf.u-szeged.hu>
4179
4180         Reviewed by Antonio Gomes.
4181
4182         Lazy cursor creation should be guarded by #if USE(LAZY_NATIVE_CURSOR) in WebKit2
4183
4184         https://bugs.webkit.org/show_bug.cgi?id=42622
4185
4186         * Shared/WebCoreArgumentCoders.h:
4187         * UIProcess/WebPageProxy.cpp:
4188         (WebKit::WebPageProxy::didReceiveMessage):
4189         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
4190         (WebKit::WebChromeClient::setCursor):
4191
4192 2010-07-22  Jon Honeycutt  <jhoneycutt@apple.com>
4193
4194         Build fix. Unreviewed.
4195
4196         * win/WebKit2WebProcess.vcproj:
4197         Remove the pre- and post-build events, so that they will use the value
4198         inherited from the vsprops.
4199
4200 2010-07-21  Darin Adler  <darin@apple.com>
4201
4202         Reviewed by Sam Weinig.
4203
4204         WebKitTestRunner needs layoutTestController.dumpChildFrameScrollPositions
4205         https://bugs.webkit.org/show_bug.cgi?id=42548
4206
4207         Added WKBundleFrameCopyName.
4208
4209         * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
4210         (WKBundleFrameCopyName): Added.
4211         * WebProcess/InjectedBundle/API/c/WKBundleFrame.h: Ditto.
4212
4213         * WebProcess/WebPage/WebFrame.cpp:
4214         (WebKit::WebFrame::name): Added.
4215         * WebProcess/WebPage/WebFrame.h: Ditto.
4216
4217 2010-07-21  Darin Adler  <darin@apple.com>
4218
4219         Reviewed by Sam Weinig.
4220
4221         WebKitTestRunner needs to support dumping of scroll position
4222         https://bugs.webkit.org/show_bug.cgi?id=42514
4223
4224         Added WKBundleFrameGetJavaScriptContext function.
4225
4226         * WebKit2.xcodeproj: Added property svn:ignore.
4227
4228         * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
4229         (WKBundleFrameGetJavaScriptContext): Added.
4230         * WebProcess/InjectedBundle/API/c/WKBundleFrame.h: Ditto.
4231
4232         * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
4233         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp:
4234         (WebKit::InjectedBundlePageLoaderClient::didClearWindowObjectForFrame):
4235         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h:
4236         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
4237         (WebKit::WebFrameLoaderClient::dispatchDidClearWindowObjectInWorld):
4238         Use JSGlobalContextRef instead of JSContextRef and context instead of ct.
4239
4240 2010-07-21  Adam Roben  <aroben@apple.com>
4241
4242         Handle broken pipes in more places in CoreIPC
4243
4244         Fixes <http://webkit.org/b/42784> Assertion failure in
4245         Connection::readEventHandler when WebKitTestRunner exits
4246
4247         Reviewed by Anders Carlsson.
4248
4249         * Platform/CoreIPC/win/ConnectionWin.cpp:
4250         (CoreIPC::Connection::readEventHandler): Check for a broken pipe
4251         whenever we call ::PeekNamedPipe.
4252
4253 2010-07-21  Adam Roben  <aroben@apple.com>
4254
4255         Teach CoreIPC how to handle messages that are larger than the pipe's
4256         buffer
4257
4258         ::GetOverlappedResult and ::ReadFile can fail with ERROR_MORE_DATA
4259         when there is more data available on the pipe than was requested in
4260         the read operation. In those cases, the appropriate response is to
4261         perform another read operation to read the extra data. We now do this.
4262
4263         Also, MSDN says that, because we are doing asynchronous read
4264         operations, we should not pass a pointer to ::ReadFile to find out how
4265         many bytes were read. Instead we should always call
4266         ::GetOverlappedResult to find this out. I've changed
4267         Connection::readEventHandler to have a single loop that calls
4268         ::GetOverlappedResult and ::ReadFile in alternation, rather than
4269         sometimes calling ::ReadFile multiple times in a row, to satisfy this
4270         requirement.
4271
4272         In order to simplify the logic in this function, I've made us request
4273         only a single byte from the pipe when there are no messages already in
4274         the pipe. (Previously we were requesting 4096 bytes in this case.)
4275         This allows us not to have to consider the case where the received
4276         message is smaller than our read buffer. If we decide that this has a
4277         negative impact on performance, we can of course change it. I've
4278         mitigated this somewhat by using ::PeekNamedMessage to find out the
4279         size of the next message in the pipe (if any), so that we can read it
4280         all in one read operation.
4281
4282         Fixes <http://webkit.org/b/42710> <rdar://problem/8197571> Assertion
4283         in Connection::readEventHandler when launching WebKitTestRunner
4284
4285         Reviewed by Anders Carlsson.
4286
4287         * Platform/CoreIPC/win/ConnectionWin.cpp:
4288         (CoreIPC::Connection::readEventHandler): Put the call to
4289         ::GetOverlappedResult in the same loop as ::ReadFile so that we will
4290         call them alternately. If ::GetOverlappedResult fails with
4291         ERROR_MORE_DATA, use ::PeekNamedPipe to determine the size of the rest
4292         of the message, then read it from the pipe. After dispatching the
4293         message, use ::PeekNamedPipe to find out the size of the next message
4294         in the pipe so we can read it all in one operation. If there's no
4295         message in the pipe, we'll request just a single byte of the next
4296         message that becomes available, and Windows will tell us when the rest
4297         of the message is ready. If ::ReadFile fails with ERROR_MORE_DATA it
4298         means there is data available now even though we didn't think there
4299         was any. We go back to the top of the loop in this case and call
4300         ::GetOverlappedResult again to retrieve the available data.
4301
4302 2010-07-21  Sam Weinig  <sam@webkit.org>
4303
4304         Reviewed by Anders Carlsson.
4305
4306         Patch for https://bugs.webkit.org/show_bug.cgi?id=42539
4307         WebKitTestRunner needs to support printing ALERT, PROMPT and CONFIRM messages
4308
4309         - Convert injected bundle UIClient functions to will-style, at least until we establish
4310           more concrete use cases for them past the TestRunner.
4311
4312         * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
4313         * WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp:
4314         (WebKit::InjectedBundlePageUIClient::willAddMessageToConsole):
4315         (WebKit::InjectedBundlePageUIClient::willSetStatusbarText):
4316         (WebKit::InjectedBundlePageUIClient::willRunJavaScriptAlert):
4317         (WebKit::InjectedBundlePageUIClient::willRunJavaScriptConfirm):
4318         (WebKit::InjectedBundlePageUIClient::willRunJavaScriptPrompt):
4319         * WebProcess/InjectedBundle/InjectedBundlePageUIClient.h:
4320         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
4321         (WebKit::WebChromeClient::addMessageToConsole):
4322         (WebKit::WebChromeClient::runJavaScriptAlert):
4323         (WebKit::WebChromeClient::runJavaScriptConfirm):
4324         (WebKit::WebChromeClient::runJavaScriptPrompt):
4325         (WebKit::WebChromeClient::setStatusbarText):
4326
4327 2010-07-21  Simon Fraser  <simon.fraser@apple.com>
4328
4329         Windows build fix.
4330
4331         Need to supply implementations of PageClient::pageDidEnterAcceleratedCompositing()
4332         and pageDidLeaveAcceleratedCompositing() for WebView on Windows.
4333
4334         * UIProcess/win/WebView.cpp:
4335         (WebKit::WebView::pageDidEnterAcceleratedCompositing):
4336         (WebKit::WebView::pageDidLeaveAcceleratedCompositing):
4337         * UIProcess/win/WebView.h:
4338
4339 2010-07-21  Anders Carlsson  <andersca@apple.com>
4340
4341         Reviewed by Sam Weinig.
4342
4343         Don't assert when clicking on a plug-in in WebKit2
4344         https://bugs.webkit.org/show_bug.cgi?id=42762
4345
4346         Add stub for PluginView::handleEvent.
4347
4348         * WebProcess/Plugins/PluginView.cpp:
4349         (WebKit::PluginView::handleEvent):
4350         * WebProcess/Plugins/PluginView.h:
4351
4352 2010-07-21  Simon Fraser  <simon.fraser@apple.com>
4353
4354         Reviewed by Anders Carlsson.
4355
4356         Get accelerated compositing working with webkit2
4357         https://bugs.webkit.org/show_bug.cgi?id=41084
4358         
4359         Hook up dynamic DrawingArea switching, so that when the WebProcess hits a page
4360         that requires accelerated compositing, we switch to the LayerBackedDrawingArea.
4361         
4362         * Shared/CoreIPCSupport/DrawingAreaProxyMessageKinds.h:
4363         (DrawingAreaProxyMessage::):
4364         * Shared/CoreIPCSupport/WebPageProxyMessageKinds.h:
4365         (WebPageProxyMessage::):
4366         * UIProcess/API/mac/PageClientImpl.h:
4367         * UIProcess/API/mac/PageClientImpl.mm:
4368         (WebKit::PageClientImpl::pageDidEnterAcceleratedCompositing):
4369         (WebKit::PageClientImpl::pageDidLeaveAcceleratedCompositing):
4370         * UIProcess/API/mac/WKView.mm:
4371         (-[WKView _startAcceleratedCompositing:]):
4372         (-[WKView _switchToDrawingAreaTypeIfNecessary:DrawingAreaProxy::]):
4373         (-[WKView _pageDidEnterAcceleratedCompositing]):
4374         (-[WKView _pageDidLeaveAcceleratedCompositing]):
4375         * UIProcess/API/mac/WKViewInternal.h:
4376         * UIProcess/ChunkedUpdateDrawingAreaProxy.cpp:
4377         (WebKit::ChunkedUpdateDrawingAreaProxy::didReceiveSyncMessage):
4378         * UIProcess/ChunkedUpdateDrawingAreaProxy.h:
4379         * UIProcess/DrawingAreaProxy.h:
4380         (WebKit::DrawingAreaProxy::):
4381         (WebKit::DrawingAreaProxy::type):
4382         * UIProcess/LayerBackedDrawingAreaProxy.cpp:
4383         (WebKit::LayerBackedDrawingAreaProxy::didSetSize):
4384         (WebKit::LayerBackedDrawingAreaProxy::didReceiveMessage):
4385         (WebKit::LayerBackedDrawingAreaProxy::didReceiveSyncMessage):
4386         * UIProcess/LayerBackedDrawingAreaProxy.h:
4387         * UIProcess/PageClient.h:
4388         * UIProcess/WebPageProxy.cpp:
4389         (WebKit::WebPageProxy::setDrawingArea):
4390         (WebKit::WebPageProxy::didReceiveSyncMessage):
4391         (WebKit::WebPageProxy::didEnterAcceleratedCompositing):
4392         (WebKit::WebPageProxy::didLeaveAcceleratedCompositing):
4393         * UIProcess/WebPageProxy.h:
4394         * UIProcess/mac/LayerBackedDrawingAreaProxyMac.mm:
4395         (WebKit::LayerBackedDrawingAreaProxy::attachCompositingContext):
4396         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
4397         (WebKit::WebChromeClient::attachRootGraphicsLayer):
4398         * WebProcess/WebPage/ChunkedUpdateDrawingArea.h:
4399         (WebKit::ChunkedUpdateDrawingArea::attachCompositingContext):
4400         (WebKit::ChunkedUpdateDrawingArea::setRootCompositingLayer):
4401         * WebProcess/WebPage/DrawingArea.cpp:
4402         (WebKit::DrawingArea::create):
4403         * WebProcess/WebPage/DrawingArea.h:
4404         (WebKit::DrawingArea::):
4405         (WebKit::DrawingArea::type):
4406         * WebProcess/WebPage/LayerBackedDrawingArea.cpp:
4407         (WebKit::LayerBackedDrawingArea::LayerBackedDrawingArea):
4408         (WebKit::LayerBackedDrawingArea::setNeedsDisplay):
4409         (WebKit::LayerBackedDrawingArea::setSize):
4410         (WebKit::LayerBackedDrawingArea::didUpdate):
4411         (WebKit::LayerBackedDrawingArea::setRootCompositingLayer):
4412         * WebProcess/WebPage/LayerBackedDrawingArea.h:
4413         * WebProcess/WebPage/WebPage.cpp:
4414         (WebKit::WebPage::changeAcceleratedCompositingMode):
4415         (WebKit::WebPage::enterAcceleratedCompositingMode):
4416         (WebKit::WebPage::exitAcceleratedCompositingMode):
4417         * WebProcess/WebPage/WebPage.h:
4418         * WebProcess/WebPage/mac/LayerBackedDrawingAreaMac.mm:
4419         (WebKit::LayerBackedDrawingArea::platformInit):
4420         (WebKit::LayerBackedDrawingArea::attachCompositingContext):
4421         (WebKit::LayerBackedDrawingArea::detachCompositingContext):
4422         (WebKit::LayerBackedDrawingArea::setRootCompositingLayer):
4423
4424 2010-07-20  Steve Falkenburg  <sfalken@apple.com>
4425
4426         Reviewed by Adam Roben.
4427
4428         WebKit on Windows should build optionally with an unversioned ICU DLL
4429         https://bugs.webkit.org/show_bug.cgi?id=42722
4430         <rdar://problem/8211767> WebKit needs to link against unversioned ICU
4431
4432         To get the proper value for U_DISABLE_RENAMING into all source files, we force
4433         the include of ICUVersion.h (our generated header) via the compiler options.
4434
4435         Since the versioned and unversioned ICU have different filenames (libicuuc.lib vs icuuc.lib)
4436         we copy the ICU lib to an intermediate location under obj with a common name. This
4437         allows us to link properly with either without adding a new build configuration.
4438
4439         * win/WebKit2Common.vsprops:
4440         Copy ICU libs into a common location with a common name.
4441         Add additional library search path to pick up icu lib.
4442         Change ICU library filename specified to linker.
4443         Add forced include of ICUVersion.h.        
4444
4445 2010-07-21  Adam Roben  <aroben@apple.com>
4446
4447         Windows build fix
4448
4449         * Shared/win/UpdateChunk.h:
4450         (WebKit::UpdateChunk::isEmpty): Added to match the Mac definition.
4451
4452 2010-07-21  Anders Carlsson  <andersca@apple.com>
4453
4454         Land file I forgot to add.
4455
4456         * WebProcess/com.apple.WebProcess.sb: Added.
4457
4458 2010-07-21  Adam Roben  <aroben