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