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