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