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