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