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