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