859481a0707184304563573cd29322536ec52999
[WebKit-https.git] / WebKit2 / ChangeLog
1 2010-09-08  Sam Weinig  <sam@webkit.org>
2
3         Reviewed by Dan Bernstein.
4
5         WebKit2 needs a way to box numbers (for Array, Dictionary, etc.)
6         <rdar://problem/8408844>
7         https://bugs.webkit.org/show_bug.cgi?id=45429
8
9         This adds a generic WebNumber class that can be used for any scalar
10         numeric type. Right now, we are only exposing a double version, but it
11         is designed to allow more.
12
13         * Shared/APIObject.h:
14         * Shared/WebNumber.h: Added.
15         (WebKit::WebNumber::create):
16         (WebKit::WebNumber::value):
17         (WebKit::WebNumber::setValue):
18         (WebKit::WebNumber::WebNumber):
19         (WebKit::WebNumber::type):
20         * UIProcess/API/C/WKAPICast.h:
21         * UIProcess/API/C/WKBase.h:
22         * UIProcess/API/C/WKNumber.cpp: Added.
23         (WKDoubleGetTypeID):
24         (WKDoubleCreate):
25         (WKDoubleGetValue):
26         (WKDoubleSetValue):
27         * UIProcess/API/C/WKNumber.h: Added.
28         * UIProcess/API/C/WebKit2.h:
29         * WebKit2.pro:
30         * WebKit2.xcodeproj/project.pbxproj:
31         * win/WebKit2.vcproj:
32         * win/WebKit2Generated.make:
33
34 2010-09-08  Anders Carlsson  <andersca@apple.com>
35
36         Don't include the std namespace in a header. This hopefully fixes the Windows build.
37
38         * Shared/WebCoreArgumentCoders.h:
39
40 2010-09-08  Anders Carlsson  <andersca@apple.com>
41
42         Suggested and reviewed by Darin Adler.
43
44         Fix an overflow bug in bufferIsLargeEnoughToContain.
45
46         * Platform/CoreIPC/ArgumentDecoder.h:
47         (CoreIPC::ArgumentDecoder::bufferIsLargeEnoughToContain):
48
49 2010-09-08  Anders Carlsson  <andersca@apple.com>
50
51         Reviewed by Darin Adler.
52
53         Improve CoreIPC encoding of strings
54         https://bugs.webkit.org/show_bug.cgi?id=45418
55
56         Encode and decode null Strings. Check that the string length isn't bogus.
57
58         * Platform/CoreIPC/ArgumentCoders.h:
59         * Platform/CoreIPC/ArgumentDecoder.cpp:
60         (CoreIPC::ArgumentDecoder::bufferIsLargeEnoughToContain):
61         * Platform/CoreIPC/ArgumentDecoder.h:
62         (CoreIPC::ArgumentDecoder::bufferIsLargeEnoughToContain):
63         * Shared/WebCoreArgumentCoders.h:
64
65 2010-09-08  Adam Roben  <aroben@apple.com>
66
67         Add a way to cause the web process to crash at a random time
68
69         Setting the WEBKIT2_CRASH_WEB_PROCESS_RANDOMLY environment variable
70         will cause the web process to crash at a random point up to 3 minutes
71         after launching.
72
73         Fixes <http://webkit.org/b/43058> <rdar://problem/8240150>
74
75         Reviewed by Darin Adler.
76
77         * WebProcess/WebProcess.cpp:
78         (WebKit::sleep): Added an implementation of this function for Windows.
79         It just calls through to ::Sleep.
80         (WebKit::randomCrashThread): Added. Sleeps for a random amount of time
81         up to 3 minutes, then crashes.
82         (WebKit::startRandomCrashThreadIfRequested): Added. Starts the crash
83         thread if the WEBKIT2_CRASH_WEB_PROCESS_RANDOMLY environment variable
84         is set.
85         (WebKit::WebProcess::initialize): Added a call to
86         startRandomCrashThreadIfRequested.
87
88 2010-09-08  Adam Roben  <aroben@apple.com>
89
90         Fix potential ref-counting issues with WorkItemWin
91
92         Reviewed by Anders Carlsson.
93
94         * Platform/WorkQueue.h: Changed WorkItemWin to inherit from
95         ThreadSafeShared instead of RefCounted so that its ref-count will stay
96         consistent when used on multiple threads.
97
98 2010-09-08  Adam Roben  <aroben@apple.com>
99
100         Teach WorkQueue how to stop waiting on objects on Windows
101
102         WorkQueue now uses a subclass of WorkItemWin, HandleWorkItem, to hold
103         the waited-upon HANDLE and its corresponding wait handle. When a
104         HANDLE is unregistered, we use the HandleWorkItem to cancel the wait
105         and destroy the HANDLE.
106
107         Fixes <http://webkit.org/b/42826> <rdar://problem/8222253> Crash in
108         thread pool because WorkQueue keeps waiting on closed HANDLEs
109
110         Reviewed by Anders Carlsson.
111
112         * Platform/CoreIPC/win/ConnectionWin.cpp:
113         (CoreIPC::Connection::platformInvalidate): Changed to call
114         WorkQueue::unregisterAndCloseHandle instead of closing our handles
115         manually.
116
117         (CoreIPC::Connection::readEventHandler):
118         (CoreIPC::Connection::writeEventHandler):
119         Handle cases where the pipe has already closed by just bailing out.
120         This can happen if a WorkItem to call one of these functions has
121         already been scheduled before platformInvalidate is called.
122
123         * Platform/WorkQueue.h: Gave WorkItemWin a virtual destructor, added
124         HandleWorkItem, changed m_handles to hold HandleWorkItems, and added
125         functions for unregistering waits.
126
127         * Platform/win/WorkQueueWin.cpp:
128         (WorkQueue::WorkItemWin::~WorkItemWin): Added. This virtual destructor
129         ensures that HandleWorkItem's destructor gets called.
130
131         (WorkQueue::HandleWorkItem::HandleWorkItem):
132         (WorkQueue::HandleWorkItem::createByAdoptingHandle):
133         Added simple constructor/creator.
134
135         (WorkQueue::HandleWorkItem::~HandleWorkItem): Closes the handle we
136         adopted.
137         (WorkQueue::registerHandle): Changed to create a HandleWorkItemWin and
138         to store the wait handle in it.
139         (WorkQueue::unregisterAndCloseHandle): Added. Removes the
140         HandleWorkItem for this HANDLE from m_handles and then schedules its
141         wait to be unregistered and the item to be destroyed.
142         (WorkQueue::platformInvalidate): Added an assertion and removed an
143         obsolete FIXME.
144         (WorkQueue::unregisterWaitAndDestroyItemSoon): Added. Calls
145         unregisterWaitAndDestroyItemCallback on a worker thread, passing it
146         ownership of the HandleWorkItem.
147         (WorkQueue::unregisterWaitAndDestroyItemCallback): Added. Adopts the
148         passed-in HandleWorkItem, then unregisters the handle's wait, then
149         destroys the HandleWorkItem when the RefPtr holding it goes out of
150         scope. Destroying the HandleWorkItem closes the handle.
151
152 2010-09-08  Adam Roben  <aroben@apple.com>
153
154         Remove WKSerializedScriptValue.cpp/h from the Copy Files build phase
155
156         * WebKit2.xcodeproj/project.pbxproj:
157
158 2010-09-08  Adam Roben  <aroben@apple.com>
159
160         Get rid of WorkQueue::m_performWorkEvent
161
162         We were signaling m_performWorkEvent to spawn a worker thread. We can
163         use ::QueueUserWorkItem to spawn the thread instead.
164
165         Fixes <http://webkit.org/b/45407> WorkQueue::m_performWorkEvent is
166         unnecessary
167
168         Reviewed by Anders Carlsson.
169
170         * Platform/WorkQueue.h: Removed m_performWorkEvent.
171
172         * Platform/win/WorkQueueWin.cpp:
173         (WorkQueue::workThreadCallback): Replaced eventCallback with this
174         function. Its functionality is unchanged.
175
176         (WorkQueue::platformInitialize):
177         (WorkQueue::platformInvalidate):
178         Removed code to set up and clean up m_performWorkEvent.
179
180         (WorkQueue::scheduleWork): Use ::QueueUserWorkItem instead of
181         signaling m_performWorkEvent to spawn a worker thread.
182
183 2010-09-08  Adam Roben  <aroben@apple.com>
184
185         Fix WebKit2Common.vsprops line-endings
186
187         * win/WebKit2Common.vsprops: Made all line-endings be CRLF, as this is
188         the format Visual Studio wants.
189
190 2010-09-07  Oliver Hunt  <oliver@apple.com>
191
192         Reviewed by Anders Carlsson.
193
194         Support SerializedScriptValue in WebKit2
195         https://bugs.webkit.org/show_bug.cgi?id=45340
196
197         Add wrappers and IPC serialization for SerializedScriptValue
198
199         * Shared/APIObject.h:
200         * Shared/UserMessageCoders.h:
201         (WebKit::UserMessageEncoder::baseEncode):
202         (WebKit::UserMessageDecoder::baseDecode):
203         * Shared/WebSerializedScriptValue.h: Added.
204         (WebKit::WebSerializedScriptValue::create):
205         (WebKit::WebSerializedScriptValue::adopt):
206         (WebKit::WebSerializedScriptValue::deserialize):
207         (WebKit::WebSerializedScriptValue::data):
208         (WebKit::WebSerializedScriptValue::WebSerializedScriptValue):
209         (WebKit::WebSerializedScriptValue::type):
210         * UIProcess/API/C/WKAPICast.h:
211         * UIProcess/API/C/WKBase.h:
212         * UIProcess/API/C/WKSerializedScriptValue.cpp: Added.
213         (WKSerializedScriptValueGetTypeID):
214         (WKSerializedScriptValueCreate):
215         (WKSerializedScriptValueDeserialize):
216         * UIProcess/API/C/WKSerializedScriptValue.h: Added.
217         * WebKit2.xcodeproj/project.pbxproj:
218
219 2010-09-08  Sam Weinig  <sam@webkit.org>
220
221         Reviewed by Jon Honeycutt.
222
223         Would like WKBundleFrameRef to turn into WKFrameRef across postMessage boundary, a la PageRef
224         <rdar://problem/8402804>
225         https://bugs.webkit.org/show_bug.cgi?id=45370
226
227         * UIProcess/WebContextUserMessageCoders.h:
228         (WebKit::WebContextUserMessageEncoder::encode):
229         (WebKit::WebContextUserMessageDecoder::decode):
230         * WebProcess/InjectedBundle/InjectedBundleUserMessageCoders.h:
231         (WebKit::InjectedBundleUserMessageEncoder::encode):
232         (WebKit::InjectedBundleUserMessageDecoder::decode):
233
234 2010-09-07  Kinuko Yasuda  <kinuko@chromium.org>
235
236         Unreviewed, another Qt release build fix attempt.
237
238         * UIProcess/API/cpp/qt/WKURLQt.cpp:
239
240 2010-09-07  Kinuko Yasuda  <kinuko@chromium.org>
241
242         Unreviewed, attempt to fix Qt release build.
243
244         * UIProcess/API/cpp/qt/WKStringQt.cpp:
245
246 2010-09-07  Brent Fulgham  <bfulgham@webkit.org>
247
248         Build correction, no review.
249
250         * win/WebKit2.vcproj: Disable two unused files for
251         the WinCairo target.
252
253 2010-09-07  Anders Carlsson  <andersca@apple.com>
254
255         Reviewed by Sam Weinig.
256
257         Fix clang++ build.
258
259         * UIProcess/API/C/WKAPICast.h:
260         Move all functions into the WebKit namespace.
261         
262         * UIProcess/API/C/cf/WKStringCF.cpp:
263         Add using namespace WebKit.
264
265         * WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
266         Move all functions into the WebKit namespace.
267
268 2010-09-07  Anders Carlsson  <andersca@apple.com>
269
270         Reviewed by Darin Adler.
271
272         <rdar://problem/8381749> -Wcast-align warning emitted when building with clang
273
274         Remove the -Wcast-align-warning since it isn't really useful, and clang is more aggressive about warning than gcc.
275
276         * Configurations/Base.xcconfig:
277
278 2010-09-07  Sam Weinig  <sam@webkit.org>
279
280         Another windows fix.
281
282         * UIProcess/win/WebView.cpp:
283
284 2010-09-07  Sam Weinig  <sam@webkit.org>
285
286         Try and fix windows.
287
288         * UIProcess/WebEditCommandProxy.h:
289
290 2010-09-07  Sam Weinig  <sam@webkit.org>
291
292         Reviewed by Darin Adler.
293
294         Fix incorrect parameter name.
295
296         * UIProcess/API/mac/PageClientImpl.mm:
297
298 2010-09-07  Sam Weinig  <sam@webkit.org>
299
300         Reviewed by Darin Adler.
301
302         Add support for Undo/Redo
303         <rdar://problem/7660519>
304         https://bugs.webkit.org/show_bug.cgi?id=42781
305
306         Adds platform independent parts of Undo/Redo support and the mac
307         platform support.
308
309         To work around the common assumption made by platforms, that a redo
310         item will be added synchronously while an undo is in progress, we
311         ignore the calls from WebCore to add redo items, and instead add add
312         them after telling WebCore to unapply the EditCommand. We similarly
313         need to ignore undos, that take place during a redo, and force the
314         addition ourselves.
315
316         * Shared/CoreIPCSupport/WebPageMessageKinds.h:
317         * Shared/CoreIPCSupport/WebPageProxyMessageKinds.h:
318         Add new messages.
319
320         * UIProcess/API/mac/PageClientImpl.h:
321         * UIProcess/API/mac/PageClientImpl.mm:
322         (-[WebEditCommandObjC initWithWebEditCommandProxy:WebKit::]):
323         (-[WebEditCommandObjC WebKit::]):
324         (-[WebEditorUndoTargetObjC undoEditing:]):
325         (-[WebEditorUndoTargetObjC redoEditing:]):
326         (WebKit::PageClientImpl::PageClientImpl):
327         (WebKit::nameForEditAction):
328         (WebKit::PageClientImpl::registerEditCommand):
329         (WebKit::PageClientImpl::clearAllEditCommands):
330         * UIProcess/API/qt/qwkpage.cpp:
331         (QWKPagePrivate::registerEditCommand):
332         (QWKPagePrivate::clearAllEditCommands):
333         * UIProcess/API/qt/qwkpage_p.h:
334         * UIProcess/PageClient.h:
335         * UIProcess/win/WebView.cpp:
336         (WebKit::WebView::registerEditCommand):
337         (WebKit::WebView::clearAllEditCommands):
338         * UIProcess/win/WebView.h:
339         Add platform specific hooks for undo/redo.
340
341         * UIProcess/WebEditCommandProxy.cpp: Added.
342         (WebKit::WebEditCommandProxy::WebEditCommandProxy):
343         (WebKit::WebEditCommandProxy::~WebEditCommandProxy):
344         (WebKit::WebEditCommandProxy::unapply):
345         (WebKit::WebEditCommandProxy::reapply):
346         * UIProcess/WebEditCommandProxy.h: Added.
347         (WebKit::WebEditCommandProxy::create):
348         (WebKit::WebEditCommandProxy::commandID):
349         (WebKit::WebEditCommandProxy::editAction):
350         (WebKit::WebEditCommandProxy::invalidate):
351         A proxy for the WebEditCommands in the WebProcess. These are owned
352         by the platform back/forward list, with a weak reference back to the
353         WebPageProxy (which holds a weakset of live WebEditCommandProxys).
354
355         * UIProcess/WebPageProxy.cpp:
356         (WebKit::WebPageProxy::close):
357         (WebKit::WebPageProxy::didReceiveMessage):
358         (WebKit::WebPageProxy::registerEditCommandForUndo):
359         (WebKit::WebPageProxy::clearAllEditCommands):
360         (WebKit::WebPageProxy::registerEditCommandForRedo):
361         (WebKit::WebPageProxy::addEditCommand):
362         (WebKit::WebPageProxy::removeEditCommand):
363         (WebKit::WebPageProxy::processDidExit):
364         * UIProcess/WebPageProxy.h:
365         Forward messages.
366
367         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
368         (WebKit::WebEditorClient::registerCommandForUndo):
369         (WebKit::WebEditorClient::registerCommandForRedo):
370         (WebKit::WebEditorClient::clearUndoRedoOperations):
371         Send undo/redo registration and clearing to the UIProcess.
372
373         * WebProcess/WebPage/WebEditCommand.cpp: Added.
374         (WebKit::generateCommandID):
375         (WebKit::WebEditCommand::WebEditCommand):
376         * WebProcess/WebPage/WebEditCommand.h: Added.
377         (WebKit::WebEditCommand::create):
378         (WebKit::WebEditCommand::command):
379         (WebKit::WebEditCommand::commandID):
380         Wrapper for WebCore::EditCommand, with an added unique ID.
381
382         * WebProcess/WebPage/WebPage.cpp:
383         (WebKit::WebPage::WebPage):
384         (WebKit::WebPage::webEditCommand):
385         (WebKit::WebPage::addWebEditCommand):
386         (WebKit::WebPage::removeWebEditCommand):
387         (WebKit::WebPage::unapplyEditCommand):
388         (WebKit::WebPage::reapplyEditCommand):
389         (WebKit::WebPage::didRemoveEditCommand):
390         (WebKit::WebPage::didReceiveMessage):
391         * WebProcess/WebPage/WebPage.h:
392         (WebKit::WebPage::isInRedo):
393         Forward messages.
394
395         * WebKit2.pro:
396         * WebKit2.xcodeproj/project.pbxproj:
397         * win/WebKit2.vcproj:
398         Add new files.
399
400 2010-09-07  Jessie Berlin  <jberlin@apple.com>
401
402         Reviewed by Darin Adler.
403
404         Indicate which one of the ScriptWorlds for a Frame the Window Object has been cleared for
405         https://bugs.webkit.org/show_bug.cgi?id=45217
406
407         * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
408
409         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp:
410         (WebKit::InjectedBundlePageLoaderClient::didClearWindowObjectForFrame):
411         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h:
412
413         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
414         (WebKit::WebFrameLoaderClient::dispatchDidClearWindowObjectInWorld):
415
416 2010-09-06  Adam Barth  <abarth@webkit.org>
417
418         Reviewed by Darin Adler.
419
420         Rename SecurityOrigin::canLoad to canDisplay
421         https://bugs.webkit.org/show_bug.cgi?id=45214
422
423         Propagate name change.
424
425         * WebProcess/Plugins/PluginView.cpp:
426         (WebKit::PluginView::performFrameLoadURLRequest):
427
428 2010-09-04  Sam Weinig  <sam@webkit.org>
429
430         Reviewed by Anders Carlsson.
431
432         Allow passing null to postMessage API functions
433         https://bugs.webkit.org/show_bug.cgi?id=45234
434
435         * Shared/APIObject.h: Add TypeNull to enum. This is only used
436         for serialization purposes, and does not represent a concrete subclass
437         of APIObject.
438
439         * Shared/CoreIPCSupport/WebPageProxyMessageKinds.h: Remove WillSubmitFormWithUserData
440         now that it is not needed.
441
442         * Shared/UserMessageCoders.h:
443         (WebKit::UserMessageEncoder::baseEncode):
444         (WebKit::UserMessageDecoder::baseDecode):
445         Add explicit encoding/decoding of null for user messages.
446
447         * UIProcess/WebContextUserMessageCoders.h:
448         (WebKit::WebContextUserMessageEncoder::encode):
449         (WebKit::WebContextUserMessageDecoder::decode):
450         * WebProcess/InjectedBundle/InjectedBundleUserMessageCoders.h:
451         (WebKit::InjectedBundleUserMessageEncoder::encode):
452         (WebKit::InjectedBundleUserMessageDecoder::decode):
453         Update UserMessageCoders subclasses to call the base class in the correct
454         way to work with null messages. This means moving the encoding/decoding
455         of the type down to the base class, which is a nice cleanup.
456
457         * UIProcess/WebPageProxy.cpp:
458         (WebKit::WebPageProxy::didReceiveMessage):
459         Remove now redundant WillSubmitFormWithUserData implementation.
460
461         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
462         (WebKit::WebFrameLoaderClient::dispatchWillSubmitForm):
463         Ditto.
464
465 2010-09-03  Jesus Sanchez-Palencia  <jesus.palencia@openbossa.org>
466
467         Reviewed by Darin Adler.
468
469         Add NetworkingContext to avoid layer violations
470         https://bugs.webkit.org/show_bug.cgi?id=42292
471
472         Add FrameNetworkingContext implementation.
473
474         * WebKit2.pro:
475         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
476         (WebKit::WebFrameLoaderClient::createNetworkingContext):
477         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
478         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
479         (WebKit::WebFrameNetworkingContext::needsSiteSpecificQuirks):
480         (WebKit::WebFrameNetworkingContext::localFileContentSniffingEnabled):
481         (WebKit::WebFrameNetworkingContext::scheduledRunLoopPairs):
482         (WebKit::WebFrameNetworkingContext::blockedError):
483         * WebProcess/WebCoreSupport/qt/WebFrameNetworkingContext.cpp: Added.
484         (WebCore::WebFrameNetworkingContext::WebFrameNetworkingContext):
485         (WebCore::WebFrameNetworkingContext::create):
486         (WebCore::WebFrameNetworkingContext::originatingObject):
487         (WebCore::WebFrameNetworkingContext::networkAccessManager):
488         * WebProcess/WebCoreSupport/qt/WebFrameNetworkingContext.h: Added.
489         * WebProcess/WebCoreSupport/win/WebFrameNetworkingContext.cpp: Added.
490         * WebProcess/WebCoreSupport/win/WebFrameNetworkingContext.h: Added.
491         (WebFrameNetworkingContext::create):
492         (WebFrameNetworkingContext::WebFrameNetworkingContext):
493         * win/WebKit2.vcproj:
494         * win/WebKit2Common.vsprops:
495
496 2010-09-03  Sam Weinig  <sam@webkit.org>
497
498         Reviewed by Dan Bernstein.
499
500         Add ability to send UserData to willSubmitForm
501         https://bugs.webkit.org/show_bug.cgi?id=45222
502
503         - Adds a willSubmitForm callback to the BundlePageFormClient with an out
504           parameter WKTypeRef* parameter.
505         - That out parameter gets serialized and then passed to the PageFormClient's
506           willSubmitForm, which now has WKTypeRef parameter.
507
508         - Temporarily adds a new WillSubmitFormWithUserData message kind. This will
509           be replaced by the ability to explicitly serialize null as a UserMessage.
510
511         * Platform/CoreIPC/Arguments.h:
512         (CoreIPC::Arguments6::Arguments6):
513         (CoreIPC::Arguments6::encode):
514         (CoreIPC::Arguments6::decode):
515         (CoreIPC::In):
516         (CoreIPC::Out):
517         * Shared/CoreIPCSupport/WebPageProxyMessageKinds.h:
518         * UIProcess/API/C/WKPage.h:
519         * UIProcess/WebFormClient.cpp:
520         (WebKit::WebFormClient::willSubmitForm):
521         * UIProcess/WebFormClient.h:
522         * UIProcess/WebPageProxy.cpp:
523         (WebKit::WebPageProxy::didReceiveMessage):
524         (WebKit::WebPageProxy::willSubmitForm):
525         * UIProcess/WebPageProxy.h:
526         * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
527         * WebProcess/InjectedBundle/InjectedBundlePageFormClient.cpp:
528         (WebKit::InjectedBundlePageFormClient::textFieldDidBeginEditing):
529         (WebKit::InjectedBundlePageFormClient::textFieldDidEndEditing):
530         (WebKit::InjectedBundlePageFormClient::textDidChangeInTextField):
531         (WebKit::InjectedBundlePageFormClient::textDidChangeInTextArea):
532         (WebKit::InjectedBundlePageFormClient::willSubmitForm):
533         * WebProcess/InjectedBundle/InjectedBundlePageFormClient.h:
534         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
535         (WebKit::WebFrameLoaderClient::dispatchWillSubmitForm):
536
537 2010-09-03  Sam Weinig  <sam@webkit.org>
538
539         Reviewed by Gavin Barraclough.
540
541         Change WKDictionaryIsMutable to take a WKDictionaryRef instead of a WKMutableDictionaryRef.
542         If the type is already states it is mutable, there would be no reason for the check.
543
544         * UIProcess/API/C/WKMutableDictionary.cpp:
545         (WKDictionaryIsMutable):
546         * UIProcess/API/C/WKMutableDictionary.h:
547
548 2010-09-02  Sam Weinig  <sam@webkit.org>
549
550         Reviewed by Anders Carlsson.
551
552         Add ability to send WKDictionaryRefs via post message.
553         https://bugs.webkit.org/show_bug.cgi?id=45151
554
555         * Shared/ImmutableDictionary.cpp:
556         (WebKit::ImmutableDictionary::ImmutableDictionary):
557         * Shared/ImmutableDictionary.h:
558         (WebKit::ImmutableDictionary::adopt): Remove tag, it wasn't doing anything.
559         (WebKit::ImmutableDictionary::isMutable):
560         (WebKit::ImmutableDictionary::map): Add accessor of internal
561         map for encoder.
562
563         * Shared/UserMessageCoders.h:
564         (WebKit::UserMessageEncoder::baseEncode):
565         (WebKit::UserMessageDecoder::baseDecode):
566         Add encoder/decoder.
567
568 2010-09-02  Sam Weinig  <sam@webkit.org>
569
570         Reviewed by Anders Carlsson.
571
572         Share the common parts of UserMessage coding between both processes.
573         https://bugs.webkit.org/show_bug.cgi?id=45139
574
575         Add base classes UserMessageEncoder and UserMessageDecoder which implement
576         encoding/decoding of ImmutableArray and String (soon to be others as well, such
577         as ImmutableDictionary, Data, etc.) and add derived classes which implement the
578         process specific bits such as Page -> BundlePage conversion.
579
580         * Shared/UserMessageCoders.h: Copied from WebProcess/InjectedBundle/InjectedBundle.cpp.
581         (WebKit::UserMessageEncoder::baseEncode):
582         (WebKit::UserMessageEncoder::UserMessageEncoder):
583         (WebKit::UserMessageDecoder::baseDecode):
584         (WebKit::UserMessageDecoder::UserMessageDecoder):
585         * UIProcess/WebContext.cpp:
586         (WebKit::WebContext::postMessageToInjectedBundle):
587         (WebKit::WebContext::didReceiveMessage):
588         * UIProcess/WebContextUserMessageCoders.h: Copied from UIProcess/WebContext.cpp.
589         (WebKit::WebContextUserMessageEncoder::WebContextUserMessageEncoder):
590         (WebKit::WebContextUserMessageEncoder::encode):
591         (WebKit::WebContextUserMessageDecoder::WebContextUserMessageDecoder):
592         (WebKit::WebContextUserMessageDecoder::decode):
593         * WebKit2.pro:
594         * WebKit2.xcodeproj/project.pbxproj:
595         * WebProcess/InjectedBundle/InjectedBundle.cpp:
596         (WebKit::InjectedBundle::postMessage):
597         (WebKit::InjectedBundle::didReceiveMessage):
598         * WebProcess/InjectedBundle/InjectedBundleUserMessageCoders.h: Copied from WebProcess/InjectedBundle/InjectedBundle.cpp.
599         (WebKit::InjectedBundleUserMessageEncoder::InjectedBundleUserMessageEncoder):
600         (WebKit::InjectedBundleUserMessageEncoder::encode):
601         (WebKit::InjectedBundleUserMessageDecoder::InjectedBundleUserMessageDecoder):
602         (WebKit::InjectedBundleUserMessageDecoder::decode):
603         * win/WebKit2.vcproj:
604
605 2010-09-02  Sam Weinig  <sam@webkit.org>
606
607         Reviewed by Anders Carlsson.
608
609         Simplify ownership semantics of some WebKit2 types
610         https://bugs.webkit.org/show_bug.cgi?id=45120
611
612         - Make ImmutableArray and MutableArray use a Vector<RefPtr<APIObject> > and
613           therefore ref any items it takes in.
614         - Make the PostMessageDecoder operate on a RefPtr<APIObject>& to avoid the odd
615           leaking semantics.
616
617         * Shared/ImmutableArray.cpp:
618         (WebKit::ImmutableArray::ImmutableArray): This constructor now uses a for-loop
619         instead of memcpy to ref each item.
620         (WebKit::ImmutableArray::~ImmutableArray): No longer necessary to manually deref.
621         * Shared/ImmutableArray.h:
622         (WebKit::ImmutableArray::adopt):
623         (WebKit::ImmutableArray::at):
624         Changes to accommodate entries being changed to a Vector<RefPtr<APIObject> >.
625
626         * Shared/ImmutableDictionary.cpp:
627         (WebKit::ImmutableDictionary::keys):
628         Build a Vector<RefPtr<APIObject> >.
629
630         * UIProcess/WebBackForwardList.cpp:
631         (WebKit::WebBackForwardList::backListAsImmutableArrayWithLimit):
632         (WebKit::WebBackForwardList::forwardListAsImmutableArrayWithLimit):
633         Ditto.
634
635         * UIProcess/WebContext.cpp:
636         (WebKit::PostMessageEncoder::PostMessageDecoder::PostMessageDecoder):
637         (WebKit::PostMessageEncoder::PostMessageDecoder::decode):
638         (WebKit::WebContext::didReceiveMessage):
639         APIObject>& to avoid the odd leaking semantics.
640
641         * WebProcess/InjectedBundle/InjectedBundle.cpp:
642         (WebKit::PostMessageEncoder::PostMessageDecoder::PostMessageDecoder):
643         (WebKit::PostMessageEncoder::PostMessageDecoder::decode):
644         (WebKit::InjectedBundle::didReceiveMessage):
645         Ditto.
646
647         * WebProcess/WebPage/WebFrame.cpp:
648         (WebKit::WebFrame::childFrames):
649         Build a Vector<RefPtr<APIObject> >.
650
651 2010-09-02  Sam Weinig  <sam@webkit.org>
652
653         Reviewed by Anders Carlsson.
654
655         Add WKMutableDictionary API for WebKit2
656         https://bugs.webkit.org/show_bug.cgi?id=45117
657
658         Add WKMutableDictionary API that inherits from WKDictionaryRef
659         the same way WKMutableArrayRef inherits from WKArrayRef.
660
661         * Shared/ImmutableDictionary.h:
662         (WebKit::ImmutableDictionary::get):
663         (WebKit::ImmutableDictionary::isMutable):
664         * Shared/MutableDictionary.cpp: Added.
665         (WebKit::MutableDictionary::MutableDictionary):
666         (WebKit::MutableDictionary::~MutableDictionary):
667         (WebKit::MutableDictionary::add):
668         (WebKit::MutableDictionary::set):
669         * Shared/MutableDictionary.h: Added.
670         (WebKit::MutableDictionary::create):
671         (WebKit::MutableDictionary::isMutable):
672         * UIProcess/API/C/WKAPICast.h:
673         (toWK):
674         * UIProcess/API/C/WKBase.h:
675         * UIProcess/API/C/WKMutableDictionary.cpp: Added.
676         (WKMutableDictionaryCreate):
677         (WKDictionaryIsMutable):
678         (WKDictionaryAddItem):
679         (WKDictionarySetItem):
680         * UIProcess/API/C/WKMutableDictionary.h: Added.
681         * UIProcess/API/C/WebKit2.h:
682         * WebKit2.pro:
683         * WebKit2.xcodeproj/project.pbxproj:
684         * win/WebKit2.vcproj:
685         * win/WebKit2Generated.make:
686
687 2010-09-02  Jessie Berlin  <jberlin@apple.com>
688
689         Windows build fix. Unreviewed.
690
691         * UIProcess/API/win/WKAPICastWin.h:
692         (toWK):
693         * UIProcess/API/win/WKBaseWin.h:
694
695 2010-09-01  Jia Pu  <jpu@apple.com>
696
697         Reviewed by Dan Bernstein.
698
699         Add support for autocorrection UI on Mac OS X.
700         https://bugs.webkit.org/show_bug.cgi?id=44958
701         <rdar://problem/7326847>
702
703         See detailed high level description in WebCore/ChangeLog.
704
705         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
706         (WebKit::WebEditorClient::showCorrectionPanel): Dummy implementation.
707         (WebKit::WebEditorClient::dismissCorrectionPanel): Ditto
708
709         * WebProcess/WebCoreSupport/WebEditorClient.h: Added new methods declared in base class.
710
711 2010-09-01  Sam Weinig  <sam@webkit.org>
712
713         Fix the build.
714
715         As with CF, const struct OpaqueType* should be the default type
716         so that const_casts are not necessary in user code.
717
718         * UIProcess/API/C/WKArray.cpp:
719         (WKArrayCreate):
720         * UIProcess/API/C/WKBase.h:
721         * UIProcess/API/C/WKType.cpp:
722         (WKGetTypeID):
723         (WKRetain):
724         (WKRelease):
725         * WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
726         (toWK):
727         * WebProcess/InjectedBundle/API/c/WKBundleBase.h:
728
729 2010-09-01  Sam Weinig  <sam@webkit.org>
730
731         Reviewed by Adam Roben.
732
733         Add mutable array API to WebKit2
734         https://bugs.webkit.org/show_bug.cgi?id=45082
735
736         Add a mutable API to WebKit2 called WKMutableArrayRef. Make it "inherit" from 
737         WKArrayRef in the same way JSObjectRef can inherit from JSValueRef in the JSC
738         API, by abusing the c type system (WKArrayRef is defined as a const version of
739         WKMutableArrayRef). Add very basic mutable API to go along with it.
740
741         * Shared/ImmutableArray.h:
742         (WebKit::ImmutableArray::isMutable):
743         Add ability to ask it an array is mutable.
744
745         * Shared/MutableArray.cpp: Added.
746         (WebKit::MutableArray::MutableArray):
747         (WebKit::MutableArray::~MutableArray):
748         (WebKit::MutableArray::append):
749         * Shared/MutableArray.h: Added.
750         (WebKit::MutableArray::create):
751         (WebKit::MutableArray::isMutable):
752         Sketch out the mutable array interface.
753
754         * UIProcess/API/C/WKAPICast.h:
755         (toWK):
756         Now that the opaque types can be const, use template magic to const_cast
757         it away.
758
759         * UIProcess/API/C/WKBase.h:
760         Add new type and re-type WKArrayRef as const.
761
762         * UIProcess/API/C/WKMutableArray.cpp: Added.
763         (WKMutableArrayCreate):
764         (WKArrayIsMutable):
765         (WKArrayAppendItem):
766         * UIProcess/API/C/WKMutableArray.h: Added.
767         Fill in basic API.
768
769         * WebKit2.pro:
770         * WebKit2.xcodeproj/project.pbxproj:
771         * win/WebKit2.vcproj:
772         * win/WebKit2Generated.make:
773         Add files.
774
775 2010-09-01  Balazs Kelemen  <kb@inf.u-szeged.hu>
776
777         Reviewed by Kenneth Rohde Christiansen.
778
779         [Qt] Implement PluginInfoStore for UNIX
780         https://bugs.webkit.org/show_bug.cgi?id=45038
781
782         This implementation is generally just reusing the logic in WebCore since
783         there is no way to get informations from a UNIX plugin without loading it
784         - in contrast to mac bundles and windows dll-s.
785         * UIProcess/Plugins/qt/PluginInfoStoreQt.cpp:
786         (WebKit::PluginInfoStore::pluginsDirectories):
787         (WebKit::PluginInfoStore::pluginPathsInDirectory):
788         (WebKit::PluginInfoStore::getPluginInfo):
789         (WebKit::PluginInfoStore::shouldUsePlugin):
790
791 2010-09-01  Mark Rowe  <mrowe@apple.com>
792
793         Reviewed by Sam Weinig.
794
795         Allow the web process to load frameworks other than WebKit2.framework from the build directory
796         when running engineering builds.
797
798         * WebProcess/mac/WebProcessMainMac.mm:
799         (WebKit::WebProcessMain): Pass the path containing WebKit2.framework to the sandbox rather than
800         the path of the WebKit2.framework itself.
801
802 2010-09-01  Sam Weinig  <sam@webkit.org>
803
804         Reviewed by John Sullivan.
805
806         Change ImmutableArray to be backed by a Vector
807         https://bugs.webkit.org/show_bug.cgi?id=45064
808
809         Change ImmutableArray to be backed by a Vector to work toward having 
810         a mutable subclass and to improve the API when working with it in WebKit2
811         itself.
812
813         - Also remove WKArrayCreateAdoptingValues which was confusing and unused.
814
815         * Shared/ImmutableArray.cpp:
816         (WebKit::ImmutableArray::ImmutableArray):
817         (WebKit::ImmutableArray::~ImmutableArray):
818         * Shared/ImmutableArray.h:
819         (WebKit::ImmutableArray::adopt):
820         (WebKit::ImmutableArray::at):
821         (WebKit::ImmutableArray::size):
822         * Shared/ImmutableDictionary.cpp:
823         (WebKit::ImmutableDictionary::keys):
824         * UIProcess/API/C/WKArray.cpp:
825         * UIProcess/API/C/WKArray.h:
826         * UIProcess/WebBackForwardList.cpp:
827         (WebKit::WebBackForwardList::backListAsImmutableArrayWithLimit):
828         (WebKit::WebBackForwardList::forwardListAsImmutableArrayWithLimit):
829         * UIProcess/WebContext.cpp:
830         (WebKit::PostMessageEncoder::PostMessageDecoder::decode):
831         * WebProcess/InjectedBundle/InjectedBundle.cpp:
832         (WebKit::PostMessageEncoder::PostMessageDecoder::decode):
833         * WebProcess/WebPage/WebFrame.cpp:
834         (WebKit::WebFrame::childFrames):
835
836 2010-09-01  Sam Weinig  <sam@webkit.org>
837
838         Reviewed by Anders Carlsson.
839
840         Add URLResponse API for WebKit2
841         https://bugs.webkit.org/show_bug.cgi?id=45062
842
843         Add WebURLResponse class and WKURLResponseRef C API to go with it. Right now,
844         instance of WKURLResponseRef are manipulated via platform types just like
845         WKURLRequestRef.
846
847         This just adds the type and conversion functions, no uses yet.
848
849         * Shared/APIObject.h:
850         * Shared/WebCoreArgumentCoders.h:
851         * Shared/WebURLResponse.cpp: Added.
852         (WebKit::WebURLResponse::WebURLResponse):
853         * Shared/WebURLResponse.h: Added.
854         (WebKit::WebURLResponse::create):
855         (WebKit::WebURLResponse::resourceResponse):
856         (WebKit::WebURLResponse::type):
857         * Shared/mac/WebCoreArgumentCodersMac.mm:
858         (CoreIPC::encodeWithNSKeyedArchiver):
859         (CoreIPC::decodeWithNSKeyedArchiver):
860         (CoreIPC::encodeResourceRequest):
861         (CoreIPC::decodeResourceRequest):
862         * Shared/mac/WebURLResponseMac.mm: Added.
863         (WebKit::WebURLResponse::WebURLResponse):
864         (WebKit::WebURLResponse::platformResponse):
865         * Shared/qt/WebURLResponseQt.cpp: Added.
866         (WebKit::WebURLResponse::WebURLResponse):
867         (WebKit::WebURLResponse::platformResponse):
868         * Shared/win/WebURLResponseWin.cpp: Added.
869         (WebKit::WebURLResponse::WebURLResponse):
870         (WebKit::WebURLResponse::platformResponse):
871         * UIProcess/API/C/WKURLResponse.cpp: Added.
872         (WKURLResponseGetTypeID):
873         * UIProcess/API/C/WKURLResponse.h: Added.
874         * UIProcess/API/C/cf/WKURLResponseCF.cpp: Added.
875         (WKURLResponseCreateWithCFURLResponse):
876         (WKURLResponseCopyCFURLResponse):
877         * UIProcess/API/C/cf/WKURLResponseCF.h: Added.
878         * UIProcess/API/C/mac/WKURLResponseNS.h: Added.
879         * UIProcess/API/C/mac/WKURLResponseNS.mm: Added.
880         (WKURLResponseCreateWithNSURLResponse):
881         (WKURLResponseCopyNSURLResponse):
882         * WebKit2.pro:
883         * WebKit2.xcodeproj/project.pbxproj:
884         * win/WebKit2.vcproj:
885         * win/WebKit2Generated.make:
886
887 2010-09-01  Andras Becsi  <abecsi@webkit.org>
888
889         Reviewed by Antti Koivisto.
890
891         [Qt] Auto-generate WebKit2 forwarding headers
892         https://bugs.webkit.org/show_bug.cgi?id=44692
893
894         * DerivedSources.pro: let the generate-forwarding-headers.pl
895         script generate forwarding headers.
896         * generate-forwarding-headers.pl: Added.
897
898 2010-08-31  Dave Hyatt  <hyatt@apple.com>
899
900         Reviewed by Sam Weinig.
901
902         https://bugs.webkit.org/show_bug.cgi?id=44863
903
904         * WebProcess/WebPage/WebPage.cpp:
905         (WebKit::WebPage::layoutIfNeeded):
906
907 2010-08-31  Jon Honeycutt  <jhoneycutt@apple.com>
908
909         Fix some copy/paste errors.
910
911         Reviewed by Steve Falkenburg.
912
913         * WebProcess/InjectedBundle/InjectedBundlePageFormClient.cpp:
914         (WebKit::InjectedBundlePageFormClient::textFieldDidEndEditing):
915         Null check the correct callback.
916         (WebKit::InjectedBundlePageFormClient::textDidChangeInTextField):
917         Ditto.
918         (WebKit::InjectedBundlePageFormClient::textDidChangeInTextArea):
919         Ditto.
920
921 2010-08-31  Jon Honeycutt  <jhoneycutt@apple.com>
922
923         Crash when closing a page with a form field when using WebKit2.
924
925         Reviewed by Anders Carlsson.
926
927         The crash came from accessing a BundlePageFormClient that had been
928         destroyed. The client was intended to be cleared by a call to
929         WKBundlePageSetFormClient, but a null check there caused it not to be
930         cleared.
931
932         I fixed this and all of the other WK "set client" functions.
933
934         * UIProcess/API/C/WKContext.cpp:
935         (WKContextSetInjectedBundleClient):
936         Return early if the caller passed a client with a version not equal to
937         0.
938         (WKContextSetHistoryClient):
939         Ditto.
940
941         * UIProcess/API/C/WKPage.cpp:
942         (WKPageSetPageLoaderClient):
943         Ditto.
944         (WKPageSetPagePolicyClient):
945         Ditto.
946         (WKPageSetPageFormClient):
947         Ditto.
948         (WKPageSetPageUIClient):
949         Ditto.
950
951         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
952         (WKBundleSetClient):
953         Ditto.
954
955         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
956         (WKBundlePageSetEditorClient):
957         Ditto.
958         (WKBundlePageSetFormClient):
959         Ditto.
960         (WKBundlePageSetLoaderClient):
961         Ditto.
962         (WKBundlePageSetUIClient):
963         Ditto.
964
965 2010-08-31  Alexey Proskuryakov  <ap@apple.com>
966
967         Build fix.
968
969         * Shared/WebPreferencesStore.h: Actually remove encode(), which has been moved to WebPreferencesStore.cpp.
970
971 2010-08-31  Alexey Proskuryakov  <ap@apple.com>
972
973         Reviewed by Sam Weinig.
974
975         https://bugs.webkit.org/show_bug.cgi?id=42195
976         <rdar://problem/8186761> WebKitTestRunner needs to support layoutTestController.setXSSAuditorEnabled
977
978         * Shared/WebPreferencesStore.cpp:
979         (WebKit::WebPreferencesStore::WebPreferencesStore): Initialize xssAuditorEnabled.
980         (WebKit::WebPreferencesStore::decode): Moved from header, added xssAuditorEnabled.
981         (WebKit::WebPreferencesStore::encode): Ditto.
982         (WebKit::WebPreferencesStore::overrideXSSAuditorEnabledForTestRunner): Set an override, so
983         that decoding a WebPreferencesStore in the process will give the override result. WebProcess
984         doesn't hold to WebPreferencesStore, so there are no existing ones to patch.
985         (WebKit::WebPreferencesStore::removeTestRunnerOverrides): Remove the override.
986
987         * Shared/WebPreferencesStore.h: Added xssAuditorEnabled.
988
989         * UIProcess/API/C/WKPreferences.cpp:
990         (WKPreferencesSetXSSAuditorEnabled):
991         (WKPreferencesGetXSSAuditorEnabled):
992         * UIProcess/API/C/WKPreferences.h:
993         Added an API method to change xssAuditorEnabled preference.
994
995         * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::preferencesDidChange): Added a comment
996         explaining how making this method smarter could affect WebKitTestRunner.
997
998         * UIProcess/WebPreferences.cpp:
999         (WebKit::WebPreferences::setXSSAuditorEnabled):
1000         (WebKit::WebPreferences::xssAuditorEnabled):
1001         * UIProcess/WebPreferences.h:
1002         Implemented xssAuditorEnabled preference accessors.
1003
1004         * WebProcess/InjectedBundle/API/c/WKBundle.cpp: (WKBundleOverrideXSSAuditorEnabledForTestRunner):
1005         * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
1006         Added a private methods to temporarily change xssAuditor setting from an injected bundle,
1007         not notifying UIProcess about the change.
1008
1009         * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::overrideXSSAuditorEnabledForTestRunner):
1010         * WebProcess/InjectedBundle/InjectedBundle.h:
1011         Change the setting in existing pages, and override it for future ones.
1012
1013         * WebProcess/WebPage/WebPage.cpp:
1014         (WebKit::WebPage::WebPage): Take xssAuditorEnabled from preferences store.
1015         (WebKit::WebPage::preferencesDidChange): If preferences change, forget our override. This only
1016         happens in WKRT when the next test begins.
1017
1018 2010-08-31  Sam Weinig  <sam@webkit.org>
1019
1020         Reviewed by Gavin Barraclough.
1021
1022         WebKitTestRunner needs layoutTestController.addUserStyleSheet
1023         https://bugs.webkit.org/show_bug.cgi?id=42680
1024
1025         WebKitTestRunner needs layoutTestController.addUserScript
1026         https://bugs.webkit.org/show_bug.cgi?id=42681
1027
1028         Improve UserContent APIs to allow passing null in the same places
1029         the WebKit1 API allowed. Add convenience function toWTFString to do
1030         WKStringRef conversion with correct null string behavior.
1031
1032         * UIProcess/API/C/WKAPICast.h:
1033         (toWTFString):
1034         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
1035         (WKBundleAddUserScript):
1036         (WKBundleAddUserStyleSheet):
1037         (WKBundleRemoveUserScript):
1038         (WKBundleRemoveUserStyleSheet):
1039         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1040         (WebKit::toStringVector):
1041
1042 2010-08-31  Steve Falkenburg  <sfalken@apple.com>
1043
1044         Rubber stamped by Sam Weinig.
1045
1046         Remove library directive from def file to fix Debug_All build.
1047
1048         * win/WebKit2.def:
1049
1050 2010-08-31  Adam Roben  <aroben@apple.com>
1051
1052         Handle WM_PRINTCLIENT in WebKit2 on Windows
1053
1054         Reviewed by Sam Weinig.
1055
1056         * UIProcess/win/WebView.cpp:
1057         (WebKit::WebView::wndProc): Call through to onPrintClientEvent when we
1058         get a WM_PRINTCLIENT message.
1059         (WebKit::WebView::onPrintClientEvent): Added. Paints the entire view
1060         into the HDC provided by Windows.
1061
1062         * UIProcess/win/WebView.h: Added onPrintClientEvent.
1063
1064 2010-08-27  Adam Roben  <aroben@apple.com>
1065
1066         Don't send messages to the injected bundle if the web process has
1067         exited
1068
1069         Fixes <http://webkit.org/b/43046> <rdar://problem/8239455> Crash in
1070         WKContextPostMessageToInjectedBundle if the web process has exited
1071
1072         Reviewed by Sam Weinig.
1073
1074         * UIProcess/WebContext.cpp:
1075         (WebKit::WebContext::postMessageToInjectedBundle): Only send messages
1076         when we have a valid web process.
1077
1078 2010-08-27  Adam Roben  <aroben@apple.com>
1079
1080         Use the Windows thread pool instead of a dedicated thread for
1081         WorkQueue on Windows
1082
1083         WorkQueue now uses ::RegisterWaitForSingleObject to find out when work
1084         items need to be executed. This causes Windows to wait on the objects
1085         on a thread pool wait thread, and then to spawn a thread pool worker
1086         thread when an object is signaled. This is more efficient than using
1087         our own dedicated thread to perform the wait and the work because
1088         multiple WorkQueues (and even other parts of WebKit or other modules)
1089         can all share the same wait thread and worker thread pool.
1090
1091         Each time WorkQueue::m_performWorkEvent or any handle in
1092         WorkQueue::m_handles is signaled, a worker thread will be spawned.
1093         To maintain WorkQueue's serial nature, only one worker thread is
1094         allowed to perform work items at a time. (The worker thread that is
1095         actually performing work items is called the queue's "work thread".)
1096         To accomplish this, worker threads must register as the queue's work
1097         thread before performing work items.
1098         WorkQueue::m_isWorkThreadRegistered is used as an atomic guard to make
1099         sure that only one worker thread is registered at a time.
1100         
1101         Fixes <http://webkit.org/b/43150> <rdar://problem/8247280>.
1102
1103         Reviewed by Anders Carlsson.
1104
1105         * Platform/WorkQueue.h:
1106           - Added the WorkItemWin class, which is used to wrap WorkItems for
1107             WorkQueue's Windows implementation
1108           - Changed m_workItemQueue and m_handles to hold
1109             RefPtr<WorkItemWin>s
1110           - Replaced "work queue thread"-related members with new members that
1111             handle our thread pool code
1112
1113         * Platform/win/WorkQueueWin.cpp:
1114         (WorkQueue::WorkItemWin::WorkItemWin):
1115         (WorkQueue::WorkItemWin::create):
1116         Added simple constructor/creator.
1117
1118         (WorkQueue::handleCallback): Added. This function is called whenever a
1119         handle in WorkQueue::m_handles is signaled. We add the WorkItemWin
1120         that corresponds to the handle (passed via the context parameter) to
1121         the work item queue, then try to register as the work thread and
1122         perform any queued work. If another thread is already registered as
1123         the work thread, we just exit and let that thread handle the work we
1124         queued.
1125         (WorkQueue::registerHandle): Changed to wrap the WorkItem in a
1126         WorkItemWin, and to use ::RegisterWaitForSingleObject to wait on the
1127         handle.
1128         (WorkQueue::eventCallback): Added. This function is called whenever
1129         m_performWorkEvent is signaled. We try to register as the work thread
1130         and perfom any queued work. If another thread is already registered as
1131         the work thread, we just exit and let that thread handle the work.
1132         (WorkQueue::performWorkOnRegisteredWorkThread): Added. Performs any
1133         queued work in a loop until either the queue becomes invalid or no
1134         work is left to perform. Unregisters as the work thread before exiting
1135         so that other threads can perform work in the future.
1136         (WorkQueue::platformInitialize): Added initialization of
1137         m_isWorkThreadRegistered. Replaced code to spawn the old work queue
1138         thread with a call to ::RegisterWaitForSingleObject so that a worker
1139         thread from the thread pool will be spawned when m_performWorkEvent is
1140         signaled.
1141         (WorkQueue::tryRegisterAsWorkThread): Added. Attempts an atomic
1142         compare-and-swap to change m_isWorkThreadRegistered from 0 to 1. If
1143         sucessful, we return true to indicate that this thread is now
1144         registered as the work thread.
1145         (WorkQueue::unregisterAsWorkThread): Added. Uses an atomic
1146         compare-and-swap to change m_isWorkThreadRegistered back from 1 to 0.
1147         (WorkQueue::scheduleWork): Changed to wrap the WorkItem in a
1148         WorkItemWin. Also added an optimization to avoid signaling
1149         m_performWorkEvent when a work thread is already performing work, as
1150         it will pick up the item we just queued without us having to do
1151         anything.
1152
1153 2010-08-31  Csaba Osztrogonác  <ossy@webkit.org>
1154
1155         Reviewed by Antonio Gomes.
1156
1157         [Qt] Fix warnings in WebKit2 directory
1158         https://bugs.webkit.org/show_bug.cgi?id=44593
1159
1160         * Platform/CoreIPC/qt/ConnectionQt.cpp: Mark unused variables for compiler.
1161         (CoreIPC::Connection::readyReadHandler):
1162         (CoreIPC::Connection::sendOutgoingMessage):
1163         * Shared/qt/WebEventFactoryQt.cpp:
1164         (WebKit::WebEventFactory::createWebTouchEvent): Initialize state variable. Default case added.
1165         * WebProcess/Plugins/Netscape/qt/NetscapePluginQt.cpp:
1166         (WebKit::toNP): Return initialized NPEvent.
1167
1168 2010-08-31  Andras Becsi  <abecsi@webkit.org>
1169
1170         Reviewed by Antonio Gomes.
1171
1172         [Qt] Determine application path of MiniBrowser at runtime and use that path
1173         for QtWebProcess if the executable exists in that path.
1174
1175         * UIProcess/Launcher/qt/ProcessLauncherQt.cpp:
1176         (WebKit::ProcessLauncherHelper::launch):
1177
1178 2010-08-31  Zoltan Horvath  <zoltan@webkit.org>
1179
1180         Build fix after r66448 on WebKit2.
1181
1182         [Qt] qt_wk_didFinishDocumentLoadForFrame needs to be implemented 
1183         https://bugs.webkit.org/show_bug.cgi?id=44934
1184
1185         * UIProcess/API/qt/ClientImpl.cpp:
1186         (qt_wk_didFinishDocumentLoadForFrame):
1187         * UIProcess/API/qt/ClientImpl.h:
1188
1189 2010-08-30  Alice Liu  <alice.liu@apple.com>
1190
1191         Reviewed by Darin Adler.
1192
1193         Add missing parts of didFinishDocumentLoadForFrame
1194         https://bugs.webkit.org/show_bug.cgi?id=44913
1195
1196         * Shared/CoreIPCSupport/WebPageProxyMessageKinds.h: Added new kind
1197         * UIProcess/API/C/WKPage.h:
1198         * UIProcess/API/qt/qwkpage.cpp:
1199         (QWKPage::QWKPage): Updated struct
1200         * UIProcess/WebLoaderClient.cpp:
1201         (WebKit::WebLoaderClient::didFinishDocumentLoadForFrame): Added
1202         * UIProcess/WebLoaderClient.h:
1203         * UIProcess/WebPageProxy.cpp:
1204         (WebKit::WebPageProxy::didReceiveMessage): Added case for WebPageProxyMessage::DidFinishDocumentLoadForFrame
1205         (WebKit::WebPageProxy::didFinishDocumentLoadForFrame): Added
1206         * UIProcess/WebPageProxy.h:
1207
1208         Just rearranging existing code in these:
1209         * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
1210         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp:
1211         (WebKit::InjectedBundlePageLoaderClient::didFinishDocumentLoadForFrame):
1212         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h:
1213
1214 2010-08-30  Sam Weinig  <sam@webkit.org>
1215
1216         Try and fix the WebKit2 buildbot.
1217
1218         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
1219         (InitWebCoreSystemInterface): Add missing initialization of QTMovieDisableComponent.
1220
1221 2010-08-30  Sam Weinig  <sam@webkit.org>
1222
1223         Reviewed by Anders Carlsson.
1224
1225         Add URLRequest API for WebKit2
1226         https://bugs.webkit.org/show_bug.cgi?id=44910
1227
1228         Add WebURLRequest class and WKURLRequestRef C API to go with it. Right now,
1229         instance of WKURLRequestRef are manipulated via platform types, a la the
1230         WKStringRef and WKURLRef types.
1231
1232         - Pipes WKPageLoadURLRequest through to the WebProcess.
1233
1234         * Shared/APIObject.h:
1235         * Shared/CoreIPCSupport/WebPageMessageKinds.h:
1236         * Shared/WebCoreArgumentCoders.h:
1237         * Shared/WebURLRequest.cpp: Added.
1238         (WebKit::WebURLRequest::WebURLRequest):
1239         * Shared/WebURLRequest.h: Added.
1240         (WebKit::WebURLRequest::create):
1241         (WebKit::WebURLRequest::resourceRequest):
1242         (WebKit::WebURLRequest::type):
1243         * Shared/mac/WebCoreArgumentCodersMac.mm: Added.
1244         (CoreIPC::encodeResourceRequest):
1245         (CoreIPC::decodeResourceRequest):
1246         * Shared/mac/WebURLRequestMac.mm: Added.
1247         (WebKit::WebURLRequest::WebURLRequest):
1248         (WebKit::WebURLRequest::platformRequest):
1249         * Shared/qt/WebCoreArgumentCodersQt.cpp: Added.
1250         (CoreIPC::encodeResourceRequest):
1251         (CoreIPC::decodeResourceRequest):
1252         * Shared/qt/WebURLRequestQt.cpp: Added.
1253         (WebKit::WebURLRequest::WebURLRequest):
1254         (WebKit::WebURLRequest::platformRequest):
1255         * Shared/win/WebCoreArgumentCodersWin.cpp: Added.
1256         (CoreIPC::encodeResourceRequest):
1257         (CoreIPC::decodeResourceRequest):
1258         * Shared/win/WebURLRequestWin.cpp: Added.
1259         (WebKit::WebURLRequest::WebURLRequest):
1260         (WebKit::WebURLRequest::platformRequest):
1261         * UIProcess/API/C/WKAPICast.h:
1262         * UIProcess/API/C/WKBase.h:
1263         * UIProcess/API/C/WKPage.cpp:
1264         (WKPageLoadURLRequest):
1265         * UIProcess/API/C/WKPage.h:
1266         * UIProcess/API/C/WKURLRequest.cpp: Added.
1267         (WKURLRequestGetTypeID):
1268         * UIProcess/API/C/WKURLRequest.h: Added.
1269         * UIProcess/API/C/WebKit2.h:
1270         * UIProcess/API/C/cf/WKURLRequestCF.cpp: Added.
1271         (WKURLRequestCreateWithCFURLRequest):
1272         (WKURLRequestCopyCFURLRequest):
1273         * UIProcess/API/C/cf/WKURLRequestCF.h: Added.
1274         * UIProcess/API/C/mac: Added.
1275         * UIProcess/API/C/mac/WKURLRequestNS.h: Added.
1276         * UIProcess/API/C/mac/WKURLRequestNS.mm: Added.
1277         (WKURLRequestCreateWithNSURLRequest):
1278         (WKURLRequestCopyNSURLRequest):
1279         * UIProcess/WebPageProxy.cpp:
1280         (WebKit::WebPageProxy::loadURL):
1281         (WebKit::WebPageProxy::loadURLRequest):
1282         * UIProcess/WebPageProxy.h:
1283         * WebKit2.pro:
1284         * WebKit2.xcodeproj/project.pbxproj:
1285         * WebProcess/WebPage/WebPage.cpp:
1286         (WebKit::WebPage::loadURL):
1287         (WebKit::WebPage::loadURLRequest):
1288         (WebKit::WebPage::didReceiveMessage):
1289         * WebProcess/WebPage/WebPage.h:
1290         * win/WebKit2.vcproj:
1291         * win/WebKit2Generated.make:
1292
1293 2010-08-30  Anders Carlsson  <andersca@apple.com>
1294
1295         Reviewed by Sam Weinig.
1296
1297         WorkQueue leaks its dispatch queue
1298         <rdar://problem/8358509>
1299         https://bugs.webkit.org/show_bug.cgi?id=44689
1300
1301         * Platform/mac/WorkQueueMac.cpp:
1302         (WorkQueue::platformInvalidate):
1303
1304 2010-08-27  Sam Weinig  <sam@webkit.org>
1305
1306         Reviewed by Dan Bernstein.
1307
1308         Add UserContent API to WebKit2 InjectedBundle
1309         <rdar://problem/8367587>
1310         https://bugs.webkit.org/show_bug.cgi?id=44810
1311
1312         The new API differs from the version in WebKit1 in that the function do not take
1313         a group name since we currently do not expose a way to make multiple PageGroups in
1314         the API.
1315
1316         * WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
1317         (toUserScriptInjectionTime):
1318         (toUserContentInjectedFrames):
1319         Add conversion functions for enums.
1320
1321         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
1322         (WKBundleAddUserScript):
1323         (WKBundleAddUserStyleSheet):
1324         (WKBundleRemoveUserScript):
1325         (WKBundleRemoveUserStyleSheet):
1326         (WKBundleRemoveUserScripts):
1327         (WKBundleRemoveUserStyleSheets):
1328         (WKBundleRemoveAllUserContent):
1329         * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
1330         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1331         (WebKit::toStringVector):
1332         (WebKit::InjectedBundle::addUserScript):
1333         (WebKit::InjectedBundle::addUserStyleSheet):
1334         (WebKit::InjectedBundle::removeUserScript):
1335         (WebKit::InjectedBundle::removeUserStyleSheet):
1336         (WebKit::InjectedBundle::removeUserScripts):
1337         (WebKit::InjectedBundle::removeUserStyleSheets):
1338         (WebKit::InjectedBundle::removeAllUserContent):
1339         * WebProcess/InjectedBundle/InjectedBundle.h:
1340         Forward API to PageGroup.
1341
1342         * WebProcess/WebProcess.cpp:
1343         (WebKit::WebProcess::sharedPageGroup):
1344         (WebKit::WebProcess::visitedLinkStateChanged):
1345         (WebKit::WebProcess::allVisitedLinkStateChanged):
1346         * WebProcess/WebProcess.h: Ad accessor for global PageGroup.
1347
1348 2010-08-27  Sam Weinig  <sam@webkit.org>
1349
1350         Reviewed by Gavin Barraclough.
1351
1352         Move WKBundle didCreatePage callback to outside the WebPage
1353         constructor to avoid adoptRef errors.
1354
1355         * WebProcess/WebPage/WebPage.cpp:
1356         (WebKit::WebPage::create):
1357         (WebKit::WebPage::WebPage):
1358
1359 2010-08-27  Brady Eidson  <beidson@apple.com>
1360
1361         Reviewed by Sam Weinig.
1362
1363         <rdar://problem/8147879> - Null URL passed to WebKit2 HistoryDelegate
1364
1365         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1366         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForMIMEType): WK2 now loads initial about:blank document's synchronously,
1367           without consulting the policy delegate.
1368         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): Ditto.
1369
1370 2010-08-27  Adam Roben  <aroben@apple.com>
1371
1372         Handle ERROR_IO_INCOMPLETE more correctly in Connection
1373
1374         We still don't know exactly why we're getting this error, but at least
1375         we can do something sensible when we do.
1376
1377         Fixes <http://webkit.org/b/44776> Occasional crash in
1378         Connection::readEventHandler or assertion failure in
1379         Connection::writeEventHandler due to ERROR_IO_INCOMPLETE
1380
1381         Reviewed by Sam Weinig.
1382
1383         * Platform/CoreIPC/win/ConnectionWin.cpp:
1384         (CoreIPC::Connection::readEventHandler): Bail out of this function
1385         entirely when we get ERROR_IO_INCOMPLETE. We'll get called back later
1386         when the read completes. Continuing in the function at this point
1387         would cause us to treat an incomplete read as a complete one, leading
1388         to a crash. Added an assertion to make the crash more understandable
1389         in the future.
1390         (CoreIPC::Connection::writeEventHandler): Bail out when we get
1391         ERROR_IO_INCOMPLETE. We'll get called back later when the write
1392         completes.
1393
1394 2010-08-27  Adam Roben  <aroben@apple.com>
1395
1396         Make the web process pause on launch when the
1397         WEBKIT2_PAUSE_WEB_PROCESS_ON_LAUNCH environment variable is set
1398
1399         This is a bit easier to use than holding Ctrl-Alt-Shift during launch,
1400         since the process can sometimes take a long time to launch under the
1401         debugger. Ctrl-Alt-Shift still works, however.
1402
1403         Fixes <http://webkit.org/b/44774> Would like an easier way to pause
1404         the web process on launch
1405
1406         Reviewed by Sam Weinig.
1407
1408         * WebProcess/WebKitMain.cpp:
1409         (WebKitMain):
1410
1411 2010-08-27  Sam Weinig  <sam@webkit.org>
1412
1413         Rubber-stamped by Adam Roben.
1414
1415         * WebKit2.xcodeproj/project.pbxproj: Make WKBundleScriptWorld.h public.
1416
1417 2010-08-26  Daniel Bates  <dbates@rim.com>
1418
1419         Attempt to fix the Qt WebKit2 build.
1420
1421         * WebProcess/WebPage/qt/WebPageQt.cpp:
1422         (WebKit::WebPage::performDefaultBehaviorForKeyEvent): Pass m_page.get() to WebKit::scroll()
1423         instead of m_page since it expects a raw pointer.
1424
1425 2010-08-26  Gavin Barraclough  <barraclough@apple.com>
1426
1427         Speculative windows build fix.
1428
1429         * UIProcess/win/WebView.cpp:
1430         (WebKit::WebView::WebView):
1431
1432 2010-08-26  Sam Weinig  <sam@webkit.org>
1433
1434         Reviewed by Darin Adler.
1435
1436         Adopt more uses OwnPtr/OwnArray in WebKit2.
1437         https://bugs.webkit.org/show_bug.cgi?id=44728
1438
1439         Also clears up weird create vs. adoption semantics. Now both create
1440         and adopt both don't ref their pointers, adoption is just about the
1441         buffer.
1442
1443         * Shared/ImmutableArray.cpp:
1444         (WebKit::ImmutableArray::ImmutableArray):
1445         (WebKit::ImmutableArray::~ImmutableArray):
1446         * Shared/ImmutableArray.h:
1447         (WebKit::ImmutableArray::adopt):
1448         * Shared/ImmutableDictionary.cpp:
1449         (WebKit::ImmutableDictionary::keys):
1450         * Shared/WebData.h:
1451         * UIProcess/API/mac/PageClientImpl.h:
1452         * UIProcess/API/mac/PageClientImpl.mm:
1453         (WebKit::PageClientImpl::create):
1454         * UIProcess/API/mac/WKView.mm:
1455         (-[WKView initWithFrame:pageNamespaceRef:]):
1456         (-[WKView _switchToDrawingAreaTypeIfNecessary:DrawingAreaProxy::]):
1457         * UIProcess/API/qt/qgraphicswkview.cpp:
1458         (QGraphicsWKView::QGraphicsWKView):
1459         * UIProcess/API/qt/qwkpage.cpp:
1460         (QWKPagePrivate::init):
1461         * UIProcess/API/qt/qwkpage_p.h:
1462         * UIProcess/ChunkedUpdateDrawingAreaProxy.cpp:
1463         (WebKit::ChunkedUpdateDrawingAreaProxy::create):
1464         * UIProcess/ChunkedUpdateDrawingAreaProxy.h:
1465         * UIProcess/LayerBackedDrawingAreaProxy.cpp:
1466         (WebKit::LayerBackedDrawingAreaProxy::create):
1467         * UIProcess/LayerBackedDrawingAreaProxy.h:
1468         * UIProcess/WebBackForwardList.cpp:
1469         (WebKit::WebBackForwardList::backListAsImmutableArrayWithLimit):
1470         (WebKit::WebBackForwardList::forwardListAsImmutableArrayWithLimit):
1471         * UIProcess/WebContext.cpp:
1472         (WebKit::PostMessageEncoder::PostMessageDecoder::decode):
1473         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1474         (WebKit::PostMessageEncoder::PostMessageDecoder::decode):
1475         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1476         (WebKit::WebChromeClient::createPopupMenu):
1477         (WebKit::WebChromeClient::createSearchPopupMenu):
1478         * WebProcess/WebCoreSupport/WebPopupMenu.cpp:
1479         (WebKit::WebPopupMenu::create):
1480         * WebProcess/WebCoreSupport/WebPopupMenu.h:
1481         * WebProcess/WebCoreSupport/WebSearchPopupMenu.cpp:
1482         (WebKit::WebSearchPopupMenu::create):
1483         (WebKit::WebSearchPopupMenu::WebSearchPopupMenu):
1484         * WebProcess/WebCoreSupport/WebSearchPopupMenu.h:
1485         * WebProcess/WebPage/WebFrame.cpp:
1486         (WebKit::WebFrame::childFrames):
1487         * WebProcess/WebPage/WebPage.cpp:
1488         (WebKit::WebPage::WebPage):
1489         (WebKit::WebPage::close):
1490         * WebProcess/WebPage/WebPage.h:
1491         (WebKit::WebPage::corePage):
1492         * WebProcess/WebPage/mac/WebPageMac.mm:
1493         (WebKit::WebPage::performDefaultBehaviorForKeyEvent):
1494         * WebProcess/WebPage/win/WebPageWin.cpp:
1495         (WebKit::WebPage::performDefaultBehaviorForKeyEvent):
1496
1497 2010-08-26  Alexey Proskuryakov  <ap@apple.com>
1498
1499         Reviewed by Sam Weinig.
1500
1501         https://bugs.webkit.org/show_bug.cgi?id=44726
1502         <rdar://problem/7935518> WebFrameProxies aren't destroyed until a page is destroyed
1503
1504         Since frames can be moved across documents, they are not really a Page level concept.
1505         Moved frame tracking to WebProcess/WebProcessProxy.
1506
1507         * Shared/CoreIPCSupport/WebProcessProxyMessageKinds.h:
1508         (WebProcessProxyMessage::):
1509         * UIProcess/WebPageProxy.cpp:
1510         (WebKit::WebPageProxy::close):
1511         (WebKit::WebPageProxy::getStatistics):
1512         (WebKit::WebPageProxy::didReceiveMessage):
1513         (WebKit::WebPageProxy::didReceiveSyncMessage):
1514         (WebKit::WebPageProxy::didCreateMainFrame):
1515         (WebKit::WebPageProxy::didCreateSubFrame):
1516         (WebKit::WebPageProxy::processDidExit):
1517         * UIProcess/WebPageProxy.h:
1518         * UIProcess/WebProcessProxy.cpp:
1519         (WebKit::WebProcessProxy::didReceiveMessage):
1520         (WebKit::WebProcessProxy::didReceiveSyncMessage):
1521         (WebKit::WebProcessProxy::didClose):
1522         (WebKit::WebProcessProxy::webFrame):
1523         (WebKit::WebProcessProxy::frameCreated):
1524         (WebKit::WebProcessProxy::frameDestroyed):
1525         (WebKit::WebProcessProxy::disconnectFramesFromPage):
1526         (WebKit::WebProcessProxy::frameCountInPage):
1527         * UIProcess/WebProcessProxy.h:
1528         * WebProcess/WebPage/WebFrame.cpp:
1529         (WebKit::WebFrame::WebFrame):
1530         (WebKit::WebFrame::invalidate):
1531         * WebProcess/WebPage/WebPage.cpp:
1532         (WebKit::WebPage::didReceiveMessage):
1533         * WebProcess/WebPage/WebPage.h:
1534         * WebProcess/WebProcess.cpp:
1535         (WebKit::WebProcess::webFrame):
1536         (WebKit::WebProcess::addWebFrame):
1537         (WebKit::WebProcess::removeWebFrame):
1538         * WebProcess/WebProcess.h:
1539
1540 2010-08-26  Sam Weinig  <sam@webkit.org>
1541
1542         Reviewed by Darin Adler.
1543
1544         Add PassOwnArrayPtr
1545         https://bugs.webkit.org/show_bug.cgi?id=44627
1546
1547         * UIProcess/WebContext.cpp:
1548         (WebKit::PostMessageEncoder::PostMessageDecoder::decode):
1549         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1550         (WebKit::PostMessageEncoder::PostMessageDecoder::decode):
1551
1552 2010-08-26  Peter Kasting  <pkasting@google.com>
1553
1554         Reviewed by Dimitri Glazkov.
1555
1556         Misc. cleanup split off from bug 32356.
1557         https://bugs.webkit.org/show_bug.cgi?id=44696
1558
1559         * WebProcess/WebPage/qt/WebPageQt.cpp:
1560         (WebKit::WebPage::performDefaultBehaviorForKeyEvent):
1561
1562 2010-08-25  Brent Fulgham  <bfulgham@webkit.org>
1563
1564         Build fix, no review.
1565
1566         Add conditional guards around Safari-specific
1567         include files.
1568
1569         * WebProcess/WebPage/win/WebPageWin.cpp:
1570
1571 2010-08-25  Adam Roben  <aroben@apple.com>
1572
1573         Clean up Connection::open on Windows
1574
1575         Fixes <http://webkit.org/b/44185>.
1576
1577         Reviewed by Steve Falkenburg.
1578
1579         * Platform/CoreIPC/win/ConnectionWin.cpp:
1580         (CoreIPC::Connection::platformInitialize): Set m_isConnected to true
1581         since the pipe got connected before it was even given to us.
1582         (CoreIPC::Connection::readEventHandler): Removed code that will never
1583         run now that m_isConnected is always true when this function is
1584         called. Since no outgoing messages will have been queued before
1585         m_isConnected is set to true, there's no need to send them explicitly
1586         here; they'll get sent as they're queued.
1587         (CoreIPC::Connection::open): Removed the call to ::ConnectNamedPipe,
1588         since the pipe is already connected by this point. Changed to schedule
1589         a read in the server and client the same way (rather than using
1590         ::SetEvent in the server).
1591
1592 2010-08-19  Adam Roben  <aroben@apple.com>
1593
1594         Call NP_GetEntryPoints before NP_Initialize on Windows
1595
1596         Doing otherwise will cause Flash and QuickTime to crash inside
1597         NP_Initialize.
1598
1599         Fixes <http://webkit.org/b/44270> <rdar://problem/8330393> Crash in
1600         NP_Initialize when loading QuickTime when running
1601         plugins/embed-attributes-setting.html in WebKit2 on Windows
1602
1603         Reviewed by John Sullivan.
1604
1605         * WebProcess/Plugins/Netscape/NetscapePluginModule.cpp:
1606         (WebKit::NetscapePluginModule::tryLoad): On Windows, first call
1607         NP_GetEntryPoints, then NP_Initialize. Do the reverse on Mac to
1608         prevent Silverlight (e.g.) from crashing (see r38858).
1609
1610 2010-08-25  Balazs Kelemen  <kb@inf.u-szeged.hu>
1611
1612         Reviewed by Kenneth Rohde Christiansen.
1613
1614         [Qt] Implement WebKit::Module for qt
1615         https://bugs.webkit.org/show_bug.cgi?id=44527
1616
1617         * Platform/Module.h:
1618         * Platform/qt/ModuleQt.cpp:
1619         (WebKit::Module::load):
1620         (WebKit::Module::unload):
1621         (WebKit::Module::platformFunctionPointer):
1622
1623 2010-08-24  Sam Weinig  <sam@webkit.org>
1624
1625         Reviewed by Mark Rowe.
1626
1627         WebKit2 should launch the WebProcess in 32-bit mode if the UIProcess is in 32-bit mode
1628         <rdar://problem/8348100>
1629         https://bugs.webkit.org/show_bug.cgi?id=44537
1630
1631         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
1632         (WebKit::ProcessLauncher::launchProcess): Use posix_spawnattr_setbinpref_np
1633         to tell posix_spawn to launch the WebProcess in 32-bit mode when the UIProcess
1634         is running in 32-bit mode.
1635
1636 2010-08-24  Mark Rowe  <mrowe@apple.com>
1637
1638         Rubber-stamped by Sam Weinig.
1639
1640         Set the install path of WebKit2.framework to the build directory for debug and release builds
1641         to match our other frameworks.
1642
1643         * WebKit2.xcodeproj/project.pbxproj:
1644
1645 2010-08-24  Sam Weinig  <sam@webkit.org>
1646
1647         Reviewed by John Sullivan.
1648
1649         Update profile.
1650
1651         * WebProcess/com.apple.WebProcess.sb:
1652
1653 2010-08-23  Darin Adler  <darin@apple.com>
1654
1655         Reviewed by Geoff Garen.
1656
1657         * WebProcess/InjectedBundle/API/c/WKBundleNode.cpp:
1658         (WKBundleNodeGetParent): Update since parent now returns a
1659         ContainerNode*. The toRef function is a bit too picky to convert
1660         it without a bit of help.
1661
1662 2010-08-23  Sheriff Bot  <webkit.review.bot@gmail.com>
1663
1664         Unreviewed, rolling out r65703.
1665         http://trac.webkit.org/changeset/65703
1666         https://bugs.webkit.org/show_bug.cgi?id=44460
1667
1668         "Causing lots of crashes on Snow Leopard when running the
1669         layout tests" (Requested by eseidel2 on #webkit).
1670
1671         * WebProcess/Plugins/Netscape/NetscapePluginModule.cpp:
1672         (WebKit::NetscapePluginModule::tryLoad):
1673
1674 2010-08-23  Jon Honeycutt  <jhoneycutt@apple.com>
1675
1676         Layout tests do not run when using WebKitTestRunner in a Debug build.
1677         https://bugs.webkit.org/show_bug.cgi?id=44409
1678
1679         Reviewed by Dan Bernstein.
1680
1681         * UIProcess/Launcher/win/ProcessLauncherWin.cpp:
1682         (WebKit::ProcessLauncher::launchProcess):
1683         Use WebKit2WebProcess_debug.exe when building Debug.
1684
1685 2010-08-23  Daniel Bates  <dbates@rim.com>
1686
1687         Rubber-stamped by Adam Roben.
1688
1689         Substitute "sizeof("javascript:") - 1" for the hardcoded constant 11 when
1690         extracting the JavaScript code portion of a JavaScript URL so as to make
1691         it clearer that the 11 represents the length of the scheme portion of
1692         a JavaScript URL.
1693
1694         * WebProcess/Plugins/PluginView.cpp:
1695         (WebKit::PluginView::performJavaScriptURLRequest):
1696
1697 2010-08-23  Balazs Kelemen  <kb@inf.u-szeged.hu>
1698
1699         Reviewed by Ariya Hidayat.
1700
1701         [Qt] Find needed forwarding headers for WebKit2 automatically
1702         https://bugs.webkit.org/show_bug.cgi?id=44336
1703
1704         * DerivedSources.pro: Use the new enumerate-included-framework-headers script for generating
1705         the list of forwarding headers we want to create.
1706
1707 2010-08-23  Zoltan Horvath  <zoltan@webkit.org>
1708
1709         [Qt] Build fix.
1710
1711         * DerivedSources.pro:
1712         * WebKit2.pro:
1713         * WebProcess/Plugins/Netscape/qt: Added.
1714         * WebProcess/Plugins/Netscape/qt/NetscapePluginQt.cpp: Added.
1715         (WebKit::NetscapePlugin::platformPostInitialize):
1716         (WebKit::NetscapePlugin::platformPaint):
1717         (WebKit::toNP):
1718         (WebKit::NetscapePlugin::platformHandleMouseEvent):
1719         (WebKit::NetscapePlugin::platformHandleWheelEvent):
1720         (WebKit::NetscapePlugin::platformSetFocus):
1721         (WebKit::NetscapePlugin::platformHandleMouseEnterEvent):
1722         (WebKit::NetscapePlugin::platformHandleMouseLeaveEvent):
1723
1724 2010-08-22  Juha Savolainen  <juha.savolainen@weego.fi>
1725
1726         Reviewed by Kenneth Rohde Christiansen.
1727
1728         [Qt] Add QTouchEvents support for WebKit2
1729         https://bugs.webkit.org/show_bug.cgi?id=44330
1730
1731         This patch adds support for QTouchEvents in WebKit2. A new WebEvent-class
1732         is created for touchevents, WebTouchEvent. Also touchpoints needed a new
1733         class, WebPlatformTouchPoint. This is similar solution like in other
1734         events(like MouseEvent) on WebKit2. These classes are introduced in WebEvent.h 
1735         Also there was a need to create an empty constructor to PlatformTouchPoint-class.
1736
1737         * DerivedSources.pro:
1738         * Shared/CoreIPCSupport/WebPageMessageKinds.h:
1739         (WebPageMessage::):
1740         * Shared/WebEvent.h:
1741         (WebKit::WebEvent::):
1742         (WebKit::WebTouchPoint::):
1743         (WebKit::WebTouchPoint::WebTouchPoint):
1744         (WebKit::WebTouchPoint::id):
1745         (WebKit::WebTouchPoint::state):
1746         (WebKit::WebTouchPoint::screenPosX):
1747         (WebKit::WebTouchPoint::screenPosY):
1748         (WebKit::WebTouchPoint::posX):
1749         (WebKit::WebTouchPoint::posY):
1750         (WebKit::WebTouchPoint::setState):
1751         (WebKit::WebTouchPoint::encode):
1752         (WebKit::WebTouchPoint::decode):
1753         (WebKit::WebTouchEvent::WebTouchEvent):
1754         (WebKit::WebTouchEvent::type):
1755         (WebKit::WebTouchEvent::touchPoints):
1756         (WebKit::WebTouchEvent::encode):
1757         (WebKit::WebTouchEvent::decode):
1758         (WebKit::WebTouchEvent::isTouchEventType):
1759         * Shared/WebEventConversion.cpp:
1760         (WebKit::WebKit2PlatformTouchPoint::WebKit2PlatformTouchPoint):
1761         (WebKit::WebKit2PlatformTouchEvent::WebKit2PlatformTouchEvent):
1762         (WebKit::platform):
1763         * Shared/WebEventConversion.h:
1764         * Shared/qt/WebEventFactoryQt.cpp:
1765         (WebKit::webEventTypeForEvent):
1766         (WebKit::WebEventFactory::createWebTouchEvent):
1767         * Shared/qt/WebEventFactoryQt.h:
1768         * UIProcess/API/qt/qgraphicswkview.cpp:
1769         (QGraphicsWKView::event):
1770         (QGraphicsWKView::touchEvent):
1771         * UIProcess/API/qt/qgraphicswkview.h:
1772         * UIProcess/API/qt/qwkpage.cpp:
1773         (QWKPagePrivate::touchEvent):
1774         * UIProcess/API/qt/qwkpage_p.h:
1775         * UIProcess/WebPageProxy.cpp:
1776         (WebKit::WebPageProxy::touchEvent):
1777         * UIProcess/WebPageProxy.h:
1778         * WebProcess/WebPage/WebPage.cpp:
1779         (WebKit::WebPage::touchEvent):
1780         (WebKit::WebPage::didReceiveMessage):
1781         * WebProcess/WebPage/WebPage.h:
1782
1783 2010-08-21  Sam Weinig  <sam@webkit.org>
1784
1785         Reviewed by Dan Bernstein.
1786
1787         Remove specialized retain/release functions in favor of a single one for WKTypeRefs
1788         https://bugs.webkit.org/show_bug.cgi?id=44386
1789
1790         * UIProcess/API/C/WKArray.cpp:
1791         (WKArrayGetSize):
1792         * UIProcess/API/C/WKArray.h:
1793         * UIProcess/API/C/WKBackForwardList.cpp:
1794         (WKBackForwardListCopyForwardListWithLimit):
1795         * UIProcess/API/C/WKBackForwardList.h:
1796         * UIProcess/API/C/WKBackForwardListItem.cpp:
1797         (WKBackForwardListItemCopyTitle):
1798         * UIProcess/API/C/WKBackForwardListItem.h:
1799         * UIProcess/API/C/WKBase.h:
1800         * UIProcess/API/C/WKContext.cpp:
1801         * UIProcess/API/C/WKContext.h:
1802         * UIProcess/API/C/WKData.cpp:
1803         (WKDataGetSize):
1804         * UIProcess/API/C/WKData.h:
1805         * UIProcess/API/C/WKDictionary.cpp:
1806         (WKDictionaryCopyKeys):
1807         * UIProcess/API/C/WKDictionary.h:
1808         * UIProcess/API/C/WKError.h:
1809         * UIProcess/API/C/WKFormSubmissionListener.cpp:
1810         (WKFormSubmissionListenerContinue):
1811         * UIProcess/API/C/WKFormSubmissionListener.h:
1812         * UIProcess/API/C/WKFrame.cpp:
1813         (WKFrameGetPage):
1814         * UIProcess/API/C/WKFrame.h:
1815         * UIProcess/API/C/WKFramePolicyListener.cpp:
1816         (WKFramePolicyListenerIgnore):
1817         * UIProcess/API/C/WKFramePolicyListener.h:
1818         * UIProcess/API/C/WKNavigationData.cpp:
1819         (WKNavigationDataCopyURL):
1820         * UIProcess/API/C/WKNavigationData.h:
1821         * UIProcess/API/C/WKPage.cpp:
1822         * UIProcess/API/C/WKPage.h:
1823         * UIProcess/API/C/WKPageNamespace.cpp:
1824         (WKPageNamespaceGetContext):
1825         * UIProcess/API/C/WKPageNamespace.h:
1826         * UIProcess/API/C/WKPreferences.cpp:
1827         (WKPreferencesCreate):
1828         (WKPreferencesGetLocalStorageEnabled):
1829         * UIProcess/API/C/WKPreferences.h:
1830         * UIProcess/API/C/WKString.cpp:
1831         * UIProcess/API/C/WKString.h:
1832         * UIProcess/API/C/WKType.cpp:
1833         (WKRetain):
1834         (WKRelease):
1835         * UIProcess/API/C/WKType.h:
1836         * UIProcess/API/C/WKURL.cpp:
1837         (WKURLGetTypeID):
1838         * UIProcess/API/C/WKURL.h:
1839         * UIProcess/API/cpp/WKRetainPtr.h:
1840         * UIProcess/API/win/WKView.cpp:
1841         * UIProcess/API/win/WKView.h:
1842         * UIProcess/WebPreferences.cpp:
1843         (WebKit::WebPreferences::shared):
1844         * WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp:
1845         (WKBundleNodeHandleGetTypeID):
1846         * WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.h:
1847         * WebProcess/InjectedBundle/API/c/WKBundleScriptWorld.cpp:
1848         (WKBundleScriptWorldNormalWorld):
1849         * WebProcess/InjectedBundle/API/c/WKBundleScriptWorld.h:
1850
1851 2010-08-20  Balazs Kelemen  <kb@inf.u-szeged.hu>
1852
1853         Reviewed by Antonio Gomes.
1854
1855         [Qt] Implement cursor change in WebKit2
1856         https://bugs.webkit.org/show_bug.cgi?id=44263
1857
1858         Implemented PageClient::setCursor.
1859         * UIProcess/API/qt/qgraphicswkview.cpp: Added updateCursor slot to be connected to the QWKPage::setCursor signal.
1860         (QGraphicsWKView::QGraphicsWKView):
1861         (QGraphicsWKView::updateCursor): Sets the cursor of the widget.
1862         * UIProcess/API/qt/qgraphicswkview.h:
1863         * UIProcess/API/qt/qwkpage.cpp:
1864         (QWKPagePrivate::setCursor): Added implementation for PageClient::setCursor. Emitting singal through the QWKPage.
1865         * UIProcess/API/qt/qwkpage.h: Added setCursor signal.
1866         * UIProcess/API/qt/qwkpage_p.h:
1867
1868 2010-08-19  David Kilzer  <ddkilzer@apple.com>
1869
1870         BUILD FIX: Fix Mac build after Windows WebKit2 changes for Netscape Plug-ins
1871
1872         * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
1873         (WebKit::NetscapePlugin::platformPaint): Changed frameRect() to
1874         m_frameRect.
1875
1876 2010-08-19  Adam Roben  <aroben@apple.com>
1877
1878         Send mouse events to windowless plugins on Windows
1879
1880         This seems to have been the last issue blocking us from playing videos
1881         on vimeo.com.
1882
1883         Fixes <http://webkit.org/b/44276> <rdar://problem/8330398> Can't click
1884         play button in vimeo.com Flash video player in WebKit2 on Windows
1885
1886         Reviewed by Sam Weinig.
1887
1888         * WebProcess/Plugins/Netscape/win/NetscapePluginWin.cpp:
1889         (WebKit::toNP): Added. Converts a WebMouseEvent to an NPEvent. Code
1890         was adapted from WebCore's PluginViewWin.cpp.
1891
1892         (WebKit::NetscapePlugin::platformHandleMouseEvent):
1893         (WebKit::NetscapePlugin::platformHandleMouseEnterEvent):
1894         (WebKit::NetscapePlugin::platformHandleMouseLeaveEvent):
1895         Convert the WebMouseEvent to an NPEvent and send it to the plugin.
1896
1897 2010-08-19  Adam Roben  <aroben@apple.com>
1898
1899         Add support for painting windowless plugins on Windows
1900
1901         This gets the video on the front page of vimeo.com painting (though
1902         you can't make it play because we don't support mouse events yet).
1903
1904         Fixes <http://webkit.org/b/44274> <rdar://problem/8330395> Windowless
1905         plugins don't paint in WebKit2 on Windows
1906
1907         Reviewed by Sam Weinig.
1908
1909         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
1910         (WebKit::NPN_GetValue): Tell the plugin that we support windowless
1911         mode on Windows.
1912         (WebKit::NPN_SetValue): Implemented handling of NPPVpluginWindowBool
1913         by calling through to NetscapePlugin::setIsWindowed.
1914
1915         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
1916         (WebKit::NetscapePlugin::NetscapePlugin): Added initialization of
1917         m_isWindowed. It defaults to false on Mac and true on other platforms,
1918         matching WebCore's PluginView.
1919
1920         * WebProcess/Plugins/Netscape/NetscapePlugin.h: Added m_isWindowed.
1921         (WebKit::NetscapePlugin::setIsWindowed): Added standard setter.
1922
1923         * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
1924         (WebKit::NetscapePlugin::platformPaint): Moved Mac-specific context
1925         translation code here from PluginView::paint.
1926
1927         * WebProcess/Plugins/Netscape/win/NetscapePluginWin.cpp:
1928         (WebKit::NetscapePlugin::platformPaint): Implemented. Code was ported
1929         from WebCore's PluginViewWin.cpp.
1930
1931         * WebProcess/Plugins/Plugin.h: Updated the comment for Plugin::paint
1932         to explain the coordinate system of the context.
1933
1934         * WebProcess/Plugins/PluginView.cpp:
1935         (WebKit::PluginView::paint): Changed to translate the context from
1936         document to window coordinates. We were previously trying to translate
1937         to plugin-local coordinates, but this only worked for documents whose
1938         origin was the same as the window's origin (i.e., the main frame). The
1939         plugin takes care of any further translations needed. (Mac translates
1940         the context into plugin-local coordinates, and Windows leaves it in
1941         window coordinates.)
1942
1943 2010-08-19  Adam Roben  <aroben@apple.com>
1944
1945         Implement PluginInfoStore::pluginsDirectories
1946
1947         This makes WebKit2 able to find and load Flash on Windows.
1948
1949         Note that we aren't yet respecting the MozillaPlugins registry key.
1950         That's covered by <http://webkit.org/b/44271>.
1951
1952         Fixes <http://webkit.org/b/43510> <rdar://problem/8273827> WebKit2
1953         should load plugins from the same directories as old-WebKit
1954
1955         Reviewed by Jon Honeycutt and Ada Chan.
1956
1957         * UIProcess/Plugins/win/PluginInfoStoreWin.cpp:
1958         (WebKit::parseVersionString):
1959         (WebKit::compareVersions):
1960         (WebKit::safariPluginsDirectory):
1961         (WebKit::addMozillaPluginDirectories):
1962         (WebKit::addWindowsMediaPlayerPluginDirectory):
1963         (WebKit::addQuickTimePluginDirectory):
1964         (WebKit::addAdobeAcrobatPluginDirectory):
1965         (WebKit::addMacromediaPluginDirectories):
1966         (WebKit::PluginInfoStore::pluginsDirectories):
1967         Ported (and ever-so-slightly cleaned up) code from WebCore's
1968         PluginDatabaseWin.cpp.
1969
1970 2010-08-19  Adam Roben  <aroben@apple.com>
1971
1972         Call NP_GetEntryPoints before NP_Initialize on Windows
1973
1974         Doing otherwise will cause Flash and QuickTime to crash inside
1975         NP_Initialize.
1976
1977         Fixes <http://webkit.org/b/44270> <rdar://problem/8330393> Crash in
1978         NP_Initialize when loading QuickTime when running
1979         plugins/embed-attributes-setting.html in WebKit2 on Windows
1980
1981         Reviewed by Sam Weinig.
1982
1983         * WebProcess/Plugins/Netscape/NetscapePluginModule.cpp:
1984         (WebKit::NetscapePluginModule::tryLoad): On Windows, first call
1985         NP_GetEntryPoints, then NP_Initialize. Do the reverse on Mac to
1986         prevent Silverlight (e.g.) from crashing (see r38858).
1987
1988 2010-08-19  Adam Roben  <aroben@apple.com>
1989
1990         Add NetscapePluginWin.cpp
1991
1992         Fixes <http://webkit.org/b/44269> <rdar://problem/8330391>
1993         NetscapePlugin.h contains functions that should be in
1994         NetscapePluginWin.cpp
1995
1996         Reviewed by Sam Weinig.
1997
1998         * WebProcess/Plugins/Netscape/NetscapePlugin.h: Moved functions from
1999         here...
2000         * WebProcess/Plugins/Netscape/win/NetscapePluginWin.cpp: ...to here.
2001
2002         * win/WebKit2.vcproj: Added NetscapePluginWin.cpp and let VS reorder
2003         the file list.
2004
2005 2010-08-19  Sam Weinig  <sam@webkit.org>
2006
2007         Reviewed by Adam Roben.
2008
2009         Add modifier key info to policy client functions in WebKit2
2010         <rdar://problem/8185298>
2011         https://bugs.webkit.org/show_bug.cgi?id=44280
2012
2013         * UIProcess/API/C/WKAPICast.h:
2014         Add conversion function for modifiers and rename an incorrectly named
2015         toWK to toRef.
2016
2017         * UIProcess/API/C/WKPage.h:
2018         Add WKEventModifiers enum.
2019
2020         * UIProcess/WebPageProxy.cpp:
2021         (WebKit::WebPageProxy::didReceiveMessage):
2022         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
2023         (WebKit::WebPageProxy::decidePolicyForNewWindowAction):
2024         * UIProcess/WebPageProxy.h:
2025         * UIProcess/WebPolicyClient.cpp:
2026         (WebKit::WebPolicyClient::decidePolicyForNavigationAction):
2027         (WebKit::WebPolicyClient::decidePolicyForNewWindowAction):
2028         * UIProcess/WebPolicyClient.h:
2029         Pipe through modifier info.
2030
2031         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2032         (WebKit::modifiersForNavigationAction):
2033         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction):
2034         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
2035         Get modifier info out of the NavigationInfo class in the same manner as
2036         WebKit1.
2037
2038 2010-08-18  Sam Weinig  <sam@webkit.org>
2039
2040         Reviewed by Adam Roben.
2041
2042         Add ability to get all the keys from a WKDictionaryRef
2043         https://bugs.webkit.org/show_bug.cgi?id=44221
2044
2045         * Shared/ImmutableDictionary.cpp:
2046         (WebKit::ImmutableDictionary::keys):
2047         * Shared/ImmutableDictionary.h:
2048         Add keys function.
2049
2050         * UIProcess/API/C/WKDictionary.cpp:
2051         (WKDictionaryCopyKeys):
2052         * UIProcess/API/C/WKDictionary.h:
2053         Wrap keys function.
2054
2055 2010-08-18  Sam Weinig  <sam@webkit.org>
2056
2057         Reviewed by Jon Honeycutt.
2058
2059         Add ability to set custom userAgent for WebKit2
2060         https://bugs.webkit.org/show_bug.cgi?id=44215
2061
2062         * Shared/CoreIPCSupport/WebPageMessageKinds.h:
2063         (WebPageMessage::):
2064         * UIProcess/API/C/WKPage.cpp:
2065         (WKPageSetCustomUserAgent):
2066         * UIProcess/API/C/WKPage.h:
2067         * UIProcess/WebPageProxy.cpp:
2068         (WebKit::WebPageProxy::setCustomUserAgent):
2069         * UIProcess/WebPageProxy.h:
2070         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2071         (WebKit::WebFrameLoaderClient::userAgent):
2072         * WebProcess/WebPage/WebPage.cpp:
2073         (WebKit::WebPage::setCustomUserAgent):
2074         (WebKit::WebPage::userAgent):
2075         (WebKit::WebPage::didReceiveMessage):
2076         * WebProcess/WebPage/WebPage.h:
2077
2078 2010-08-18  Sam Weinig  <sam@webkit.org>
2079
2080         Rubber-stamped by John Sullivan.
2081
2082         Make WKBundleNodeHandleRef usable from WKRetainPtr.
2083
2084         * WebKit2.xcodeproj/project.pbxproj: Make WKBundleNodeHandle.h public.
2085         * WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.h: Add WKRetain/WKRelease overloads.
2086
2087 2010-08-18  Zoltan Horvath  <zoltan@webkit.org>
2088
2089         Reviewed by Kenneth Rohde Christiansen.
2090
2091         [Qt] Forwards QtWebProcess' stdout, stderr onto the UI process
2092         https://bugs.webkit.org/show_bug.cgi?id=44159
2093
2094         For debugging purposes forwards stdout and stderr of QtWebProcess onto the UI process.
2095
2096         * UIProcess/Launcher/qt/ProcessLauncherQt.cpp:
2097         (WebKit::ProcessLauncherHelper::launch):
2098
2099 2010-08-17  Jesus Sanchez-Palencia  <jesus.palencia@openbossa.org>
2100
2101         Reviewed by Darin Adler.
2102
2103         Add NetworkingContext to avoid layer violations
2104         https://bugs.webkit.org/show_bug.cgi?id=42292
2105
2106         Preparation: Just add the files to the build system.
2107
2108         * WebKit2.xcodeproj/project.pbxproj: Added new files.
2109         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.h: Added.
2110         Placeholder with tentative code that might be changed when landing
2111         the rest of it.
2112         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm: Added.
2113         Empty placeholder for now.
2114
2115 2010-08-16  Jon Honeycutt  <jhoneycutt@apple.com>
2116
2117         Allow some tests to pass in WebKitTestRunner before SharedMemory and
2118         PluginInfoStore are implemented on Windows.
2119
2120         Reviewed by Sam Weinig.
2121
2122         * Platform/win/SharedMemoryWin.cpp:
2123         Disable not implemented warnings.
2124         * UIProcess/Plugins/win/PluginInfoStoreWin.cpp:
2125         Ditto.
2126
2127 2010-08-16  Gavin Barraclough  <barraclough@apple.com>
2128
2129         Rubber stamped by Sam Weinig
2130
2131         Remove unnecessary includes from UString.h, add new includes as necessary.
2132
2133         * WebProcess/Plugins/Netscape/NetscapePlugin.h:
2134
2135 2010-08-16  Sam Weinig  <sam@webkit.org>
2136
2137         Fix windows build.
2138
2139         * Shared/win/CommandLineWin.cpp:
2140
2141 2010-08-16  Sam Weinig  <sam@webkit.org>
2142
2143         Reviewed by Gavin Barraclough.
2144
2145         Remove #includes of <WebCore/PlatformString.h> in favor of <wtf/text/WTFString.h>
2146
2147         * Platform/Module.cpp:
2148         * Platform/Module.h:
2149         * Shared/CommandLine.h:
2150         * Shared/WebCoreArgumentCoders.h:
2151         * Shared/WebEvent.h:
2152         * Shared/WebNavigationDataStore.h:
2153         * Shared/WebPreferencesStore.h:
2154         * Shared/WebString.h:
2155         * Shared/WebURL.h:
2156         * Shared/mac/CommandLineMac.cpp:
2157         * Shared/qt/UpdateChunk.cpp:
2158         * UIProcess/API/C/WKContext.cpp:
2159         * UIProcess/API/C/cf/WKStringCF.cpp:
2160         * UIProcess/API/C/cf/WKURLCF.cpp:
2161         * UIProcess/API/cpp/qt/WKStringQt.cpp:
2162         * UIProcess/API/cpp/qt/WKURLQt.cpp:
2163         * UIProcess/API/mac/PageClientImpl.mm:
2164         * UIProcess/API/qt/qgraphicswkview.cpp:
2165         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
2166         * UIProcess/Launcher/qt/ProcessLauncherQt.cpp:
2167         * UIProcess/Launcher/win/ProcessLauncherWin.cpp:
2168         * UIProcess/WebBackForwardListItem.cpp:
2169         * UIProcess/WebBackForwardListItem.h:
2170         * UIProcess/WebContext.h:
2171         * UIProcess/WebContextInjectedBundleClient.cpp:
2172         * UIProcess/WebFrameProxy.cpp:
2173         * UIProcess/WebFrameProxy.h:
2174         * UIProcess/WebPageProxy.h:
2175         * UIProcess/WebPolicyClient.cpp:
2176         * UIProcess/WebProcessProxy.cpp:
2177         * UIProcess/WebUIClient.cpp:
2178         * UIProcess/win/WebView.cpp:
2179         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
2180         * WebProcess/InjectedBundle/InjectedBundle.h:
2181         * WebProcess/InjectedBundle/InjectedBundlePageEditorClient.cpp:
2182         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp:
2183         * WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp:
2184         * WebProcess/InjectedBundle/mac/InjectedBundleMac.cpp:
2185         * WebProcess/Plugins/JSNPObject.cpp:
2186         * WebProcess/Plugins/NPJSObject.cpp:
2187         * WebProcess/Plugins/Netscape/NetscapePluginModule.cpp:
2188         * WebProcess/Plugins/Netscape/NetscapePluginModule.h:
2189         * WebProcess/WebCoreSupport/WebChromeClient.h:
2190         * WebProcess/WebKitMain.cpp:
2191         * WebProcess/win/WebProcessMainWin.cpp:
2192
2193 2010-08-16  Sam Weinig  <sam@webkit.org>
2194
2195         Reviewed by Gavin Barraclough.
2196
2197         Null CFURLRef returned from provisionalURL after searching on zillow.com
2198         <rdar://problem/8261812>
2199         https://bugs.webkit.org/show_bug.cgi?id=44072
2200
2201         Conversion from WKURLRef to CFRURLRef was breaking on URLs using characters
2202         such as '{'.
2203
2204         * UIProcess/API/C/cf/WKURLCF.cpp:
2205         (WKURLCopyCFURL): Use code similar to that found in KURLCFNet.cpp for conversion.
2206
2207 2010-08-16  Sam Weinig  <sam@webkit.org>
2208
2209         Reviewed by Gavin Barraclough.
2210
2211         Remove unnecessary copy constructor, assignment operator and swap function.
2212         The defaults (for all except swap) should do just fine.
2213
2214         * Shared/WebPreferencesStore.cpp:
2215         * Shared/WebPreferencesStore.h:
2216
2217 2010-08-16  Balazs Kelemen  <kb@inf.u-szeged.hu>
2218
2219         Reviewed by Kenneth Rohde Christiansen.
2220
2221         Handle content size change in WebKit2
2222         Re-landing after fix.
2223
2224         https://bugs.webkit.org/show_bug.cgi?id=43198
2225
2226         Based on the work of Antti Koivisto.
2227         Send message to the UI client when the contents size has changed through the WebChromeClient
2228         and propagate it to the WKPageUIClient.
2229
2230         * Shared/CoreIPCSupport/WebPageProxyMessageKinds.h:
2231         (WebPageProxyMessage::): Added ContentsSizeChanged message kind.
2232         * UIProcess/API/C/WKPage.h: Added WKPageContentsSizeChangedCallback callback to the WKPageUIClient.
2233         * UIProcess/API/qt/qwkpage.cpp:
2234         (QWKPage::QWKPage): Initialize the new callback to 0.
2235         * UIProcess/WebPageProxy.cpp:
2236         (WebKit::WebPageProxy::didReceiveMessage): Handle ContentsSizeChanged message. Calls contetsSizeChanged.
2237         (WebKit::WebPageProxy::contentsSizeChanged): Added. Propagate the event to the the UI client.
2238         * UIProcess/WebPageProxy.h:
2239         * UIProcess/WebUIClient.cpp:
2240         (WebKit::WebUIClient::contentsSizeChanged): Added. Propagate the event forward to the WKPageUIClient.
2241         * UIProcess/WebUIClient.h:
2242         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2243         (WebKit::WebChromeClient::contentsSizeChanged): Implemented.
2244
2245 2010-08-16  Sheriff Bot  <webkit.review.bot@gmail.com>
2246
2247         Unreviewed, rolling out r65419.
2248         http://trac.webkit.org/changeset/65419
2249         https://bugs.webkit.org/show_bug.cgi?id=44053
2250
2251         Broke the Windows build (Requested by bbandix on #webkit).
2252
2253         * Shared/CoreIPCSupport/WebPageProxyMessageKinds.h:
2254         (WebPageProxyMessage::):
2255         * UIProcess/API/C/WKPage.h:
2256         * UIProcess/API/qt/qwkpage.cpp:
2257         (QWKPage::QWKPage):
2258         * UIProcess/WebPageProxy.cpp:
2259         (WebKit::WebPageProxy::didReceiveMessage):
2260         * UIProcess/WebPageProxy.h:
2261         * UIProcess/WebUIClient.cpp:
2262         * UIProcess/WebUIClient.h:
2263         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2264         (WebKit::WebChromeClient::contentsSizeChanged):
2265
2266 2010-08-16  Balazs Kelemen  <kb@inf.u-szeged.hu>
2267
2268         Reviewed by Kenneth Rohde Christiansen.
2269
2270         Handle content size change in WebKit2
2271
2272         https://bugs.webkit.org/show_bug.cgi?id=43198
2273
2274         Based on the work of Antti Koivisto.
2275         Send message to the UI client when the contents size has changed through the WebChromeClient
2276         and propagate it to the WKPageUIClient.
2277
2278         * Shared/CoreIPCSupport/WebPageProxyMessageKinds.h:
2279         (WebPageProxyMessage::): Added ContentsSizeChanged message kind.
2280         * UIProcess/API/C/WKPage.h: Added WKPageContentsSizeChangedCallback callback to the WKPageUIClient.
2281         * UIProcess/API/qt/qwkpage.cpp:
2282         (QWKPage::QWKPage): Initialize the new callback to 0.
2283         * UIProcess/WebPageProxy.cpp:
2284         (WebKit::WebPageProxy::didReceiveMessage): Handle ContentsSizeChanged message. Calls contetsSizeChanged.
2285         (WebKit::WebPageProxy::contentsSizeChanged): Added. Propagate the event to the the UI client.
2286         * UIProcess/WebPageProxy.h:
2287         * UIProcess/WebUIClient.cpp:
2288         (WebKit::WebUIClient::contentsSizeChanged): Added. Propagate the event forward to the WKPageUIClient.
2289         * UIProcess/WebUIClient.h:
2290         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2291         (WebKit::WebChromeClient::contentsSizeChanged): Implemented.
2292
2293 2010-08-16  Balazs Kelemen  <kb@inf.u-szeged.hu>
2294
2295         Unreviewed Qt WebKit2 build fix.
2296
2297         * UIProcess/qt/WebContextQt.cpp:
2298         (WebKit::WebContext::platformSetUpWebProcess): Added empty stub implementation.
2299         * WebKit2.pro: Enumerate new files, include WebKit.pri for correct define macro set.
2300
2301 2010-08-15  Dan Bernstein  <mitz@apple.com>
2302
2303         Revised build fix from r65363 based on suggestion from Darin Adler.
2304
2305         * UIProcess/API/C/WKArray.h: Include stddef.h.
2306         * UIProcess/API/C/WKBase.h: Uninclude ctype.h.
2307         * UIProcess/API/C/WKData.h: Include stddef.h.
2308         * UIProcess/API/C/WKDictionary.h: Ditto.
2309
2310 2010-08-14  Dan Bernstein  <mitz@apple.com>
2311
2312         Reviewed by Anders Carlsson in Sweden.
2313
2314         Clean build of WebKitTestRunner fails with “'size_t' has not been declared” in WKArray.h
2315         https://bugs.webkit.org/show_bug.cgi?id=44005
2316
2317         * UIProcess/API/C/WKBase.h: Include ctype.h.
2318
2319 2010-08-13  Sam Weinig  <sam@webkit.org>
2320
2321         Fix build.
2322
2323         * WebKit2.xcodeproj/project.pbxproj: Make WKDictionary.h public.
2324
2325 2010-08-13  Sam Weinig  <sam@webkit.org>
2326
2327         Reviewed by Brady Eidson.
2328
2329         Pass values map to willSubmitForm in WebKit2 API
2330         Part of <rdar://problem/8255932>
2331         https://bugs.webkit.org/show_bug.cgi?id=43995
2332
2333         * Platform/CoreIPC/ArgumentCoders.h:
2334         (CoreIPC::):
2335         Add overload for std::pair.
2336
2337         * Shared/ImmutableDictionary.h:
2338         (WebKit::ImmutableDictionary::adopt):
2339         Fix function signature by removing size parameter.
2340
2341         * UIProcess/API/C/WKPage.h:
2342         Add dictionary parameter to callback.
2343
2344         * UIProcess/WebFormClient.cpp:
2345         (WebKit::WebFormClient::willSubmitForm):
2346         Create an ImmutableDictionary from the vector of string pairs.
2347
2348         * UIProcess/WebFormClient.h:
2349         * UIProcess/WebPageProxy.cpp:
2350         (WebKit::WebPageProxy::didReceiveMessage):
2351         (WebKit::WebPageProxy::willSubmitForm):
2352         * UIProcess/WebPageProxy.h:
2353         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2354         (WebKit::WebFrameLoaderClient::dispatchWillSubmitForm):
2355         Plumb through the values vector.
2356
2357 2010-08-13  Sam Weinig  <sam@webkit.org>
2358
2359         Reviewed by Brady Eidson.
2360
2361         Add dictionary API type
2362         https://bugs.webkit.org/show_bug.cgi?id=43990
2363
2364         Add an immutable dictionary type (WKStringRef -> WKTypeRef).
2365
2366         * Shared/APIObject.h:
2367         (WebKit::APIObject::):
2368         Add new APIType.
2369
2370         * Shared/ImmutableDictionary.cpp: Added.
2371         (WebKit::ImmutableDictionary::ImmutableDictionary):
2372         (WebKit::ImmutableDictionary::~ImmutableDictionary):
2373         * Shared/ImmutableDictionary.h: Added.
2374         (WebKit::ImmutableDictionary::create):
2375         (WebKit::ImmutableDictionary::adopt):
2376         (WebKit::ImmutableDictionary::get):
2377         (WebKit::ImmutableDictionary::size):
2378         (WebKit::ImmutableDictionary::):
2379         (WebKit::ImmutableDictionary::type):
2380         Add basic implementation
2381
2382         * UIProcess/API/C/WKAPICast.h:
2383         (WebKit::):
2384         Add new mappings.
2385
2386         * UIProcess/API/C/WKBase.h:
2387         Add new opaque type.
2388
2389         * UIProcess/API/C/WKDictionary.cpp: Added.
2390         (WKDictionaryGetTypeID):
2391         (WKDictionaryGetItemForKey):
2392         (WKDictionaryGetSize):
2393         (WKDictionaryRetain):
2394         (WKDictionaryRelease):
2395         * UIProcess/API/C/WKDictionary.h: Added.
2396         Add API wrappings.
2397     
2398         * UIProcess/API/C/WebKit2.h:
2399         Add missing public headers.
2400
2401         * WebKit2.xcodeproj/project.pbxproj:
2402         * win/WebKit2.vcproj:
2403         * win/WebKit2Generated.make:
2404         Add new files.
2405
2406 2010-08-13  Sam Weinig  <sam@webkit.org>
2407
2408         Reviewed by Jon Honeycutt.
2409
2410         Add form submission listener to WebKit2
2411         Part of <rdar://problem/8255932>
2412         https://bugs.webkit.org/show_bug.cgi?id=43947
2413
2414         * Shared/APIObject.h:
2415         Add TypeFormSubmissionListener APIType.
2416         
2417         * Shared/CoreIPCSupport/WebPageProxyMessageKinds.h:
2418         Add WillSubmitForm message kind.
2419
2420         * UIProcess/API/C/WKAPICast.h:
2421         Add new mappings for WKFormSubmissionListenerRef -> WebFormSubmissionListener
2422
2423         * UIProcess/API/C/WKBase.h:
2424         Add OpaqueWKFormSubmissionListener and rename the other opaque types to match.
2425
2426         * UIProcess/API/C/WKFormSubmissionListener.cpp: Added.
2427         (WKFormSubmissionListenerGetTypeID):
2428         (WKFormSubmissionListenerContinue):
2429         (WKFormSubmissionListenerRetain):
2430         (WKFormSubmissionListenerRelease):
2431         * UIProcess/API/C/WKFormSubmissionListener.h: Added.
2432         Add C wrapper for WebFormSubmissionListener.
2433
2434         * UIProcess/API/C/WKPage.cpp:
2435         (WKPageSetPageFormClient):
2436         * UIProcess/API/C/WKPage.h:
2437         Add WKPageFormClient with willSubmitForm callback. Additional callbacks will be added as
2438         needed.
2439
2440         * UIProcess/API/C/WebKit2.h:
2441         Add include for WKFormSubmissionListener.h
2442
2443         * UIProcess/WebFormClient.cpp: Added.
2444         (WebKit::WebFormClient::WebFormClient):
2445         (WebKit::WebFormClient::initialize):
2446         (WebKit::WebFormClient::willSubmitForm):
2447         * UIProcess/WebFormClient.h: Added.
2448         Add client for form related delagations.
2449
2450         * UIProcess/WebFormSubmissionListenerProxy.cpp: Added.
2451         (WebKit::WebFormSubmissionListenerProxy::WebFormSubmissionListenerProxy):
2452         (WebKit::WebFormSubmissionListenerProxy::continueSubmission):
2453         * UIProcess/WebFormSubmissionListenerProxy.h: Added.
2454         (WebKit::WebFormSubmissionListenerProxy::create):
2455         (WebKit::WebFormSubmissionListenerProxy::type):
2456         * UIProcess/WebFrameListenerProxy.cpp: Copied from UIProcess/WebFramePolicyListenerProxy.cpp.
2457         Add new type of listener for form submissions. It inherits from the new base class
2458         for listeners, WebFrameListenerProxy.
2459
2460         (WebKit::WebFrameListenerProxy::WebFrameListenerProxy):
2461         (WebKit::WebFrameListenerProxy::~WebFrameListenerProxy):
2462         (WebKit::WebFrameListenerProxy::invalidate):
2463         (WebKit::WebFrameListenerProxy::receivedPolicyDecision):
2464         * UIProcess/WebFrameListenerProxy.h: Copied from UIProcess/WebFramePolicyListenerProxy.h.
2465         Move logic that would have to be shared between WebFramePolicyListenerProxy and
2466         WebFormSubmissionListenerProxy into shared base class.
2467
2468         * UIProcess/WebFramePolicyListenerProxy.cpp:
2469         (WebKit::WebFramePolicyListenerProxy::WebFramePolicyListenerProxy):
2470         * UIProcess/WebFramePolicyListenerProxy.h:
2471         (WebKit::WebFramePolicyListenerProxy::create):
2472         (WebKit::WebFramePolicyListenerProxy::type):
2473         Move to inheriting from WebFrameListenerProxy.
2474
2475         * UIProcess/WebFrameProxy.cpp:
2476         (WebKit::WebFrameProxy::disconnect):
2477         (WebKit::WebFrameProxy::receivedPolicyDecision):
2478         (WebKit::WebFrameProxy::setUpPolicyListenerProxy):
2479         (WebKit::WebFrameProxy::setUpFormSubmissionListenerProxy):
2480         * UIProcess/WebFrameProxy.h:
2481         Change listener functions to act on WebFrameListenerProxys and add setUpFormSubmissionListenerProxy.
2482
2483         * UIProcess/WebPageProxy.cpp:
2484         (WebKit::WebPageProxy::initializeFormClient):
2485         (WebKit::WebPageProxy::didReceiveMessage):
2486         (WebKit::WebPageProxy::willSubmitForm):
2487         * UIProcess/WebPageProxy.h:
2488         Plumb through willSubmitForm call as we do with the other listeners.
2489
2490         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2491         (WebKit::WebFrameLoaderClient::dispatchWillSubmitForm):
2492         Ditto.
2493
2494         * WebKit2.xcodeproj/project.pbxproj: Add new files.
2495         * win/WebKit2.vcproj: Add new files.
2496         * win/WebKit2Generated.make: Ditto.
2497
2498 2010-08-13  Gavin Barraclough  <barraclough@apple.com>
2499
2500         Reviewed by Sam Weinig
2501
2502         Unify UString::UTF8String() & String::utf8() methods,
2503         remove UString::cost() & make atArrayIndex a free function.
2504
2505         * WebProcess/Plugins/JSNPObject.cpp:
2506         (WebKit::npIdentifierFromIdentifier):
2507         * WebProcess/Plugins/NPJSObject.cpp:
2508         (WebKit::NPJSObject::enumerate):
2509         * WebProcess/Plugins/NPRuntimeObjectMap.cpp:
2510         (WebKit::NPRuntimeObjectMap::convertJSValueToNPVariant):
2511
2512 2010-08-12  Sheriff Bot  <webkit.review.bot@gmail.com>
2513
2514         Unreviewed, rolling out r65295.
2515         http://trac.webkit.org/changeset/65295
2516         https://bugs.webkit.org/show_bug.cgi?id=43950
2517
2518         It broke 4 sputnik tests (Requested by Ossy on #webkit).
2519
2520         * WebProcess/Plugins/JSNPObject.cpp:
2521         (WebKit::npIdentifierFromIdentifier):
2522         * WebProcess/Plugins/NPJSObject.cpp:
2523         (WebKit::NPJSObject::enumerate):
2524         * WebProcess/Plugins/NPRuntimeObjectMap.cpp:
2525         (WebKit::NPRuntimeObjectMap::convertJSValueToNPVariant):
2526
2527 2010-08-12  Gavin Barraclough  <barraclough@apple.com>
2528
2529         Reviewed by Sam Weinig
2530
2531         Unify UString::UTF8String() & String::utf8() methods,
2532         remove UString::cost() & make atArrayIndex a free function.
2533
2534         * WebProcess/Plugins/JSNPObject.cpp:
2535         (WebKit::npIdentifierFromIdentifier):
2536         * WebProcess/Plugins/NPJSObject.cpp:
2537         (WebKit::NPJSObject::enumerate):
2538         * WebProcess/Plugins/NPRuntimeObjectMap.cpp:
2539         (WebKit::NPRuntimeObjectMap::convertJSValueToNPVariant):
2540
2541 2010-08-12  Maciej Stachowiak  <mjs@apple.com>
2542
2543         Reviewed by Sam Weinig.
2544
2545         WebKit2 crashes when WebFrame outlives WebPage
2546         https://bugs.webkit.org/show_bug.cgi?id=43939
2547
2548         * WebProcess/WebCoreSupport/WebChromeClient.h:
2549         (WebKit::WebChromeClient::page): Add this method, to allow
2550         WebFrame to retrieve its WebPage following WebCore pointers.
2551         * WebProcess/WebPage/WebFrame.cpp:
2552         (WebKit::WebFrame::WebFrame): Do not initialize m_page (it's gone).
2553         (WebKit::WebFrame::page): Don't use the data member, get it from
2554         WebCore.
2555         (WebKit::WebFrame::invalidate): Use method to get page() and null check.
2556         (WebKit::WebFrame::isMainFrame): ditto
2557         * WebProcess/WebPage/WebFrame.h:
2558
2559 2010-08-12  Jon Honeycutt  <jhoneycutt@apple.com>
2560
2561         WebKit2 needs to initialize SafariTheme
2562         https://bugs.webkit.org/show_bug.cgi?id=43901
2563
2564         Reviewed by Sam Weinig.
2565
2566         * WebProcess/win/WebProcessMainWin.cpp:
2567         (WebKit::initializeSafariTheme):
2568         Copied from old WebKit.
2569         (WebKit::WebProcessMain):
2570         If we're using SafariTheme, initialize it.
2571
2572 2010-08-12  Jon Honeycutt  <jhoneycutt@apple.com>
2573
2574         WebKitTestRunner needs to run tests without using native controls
2575         https://bugs.webkit.org/show_bug.cgi?id=43772
2576
2577         Reviewed by Sam Weinig.
2578
2579         * Shared/CoreIPCSupport/WebProcessMessageKinds.h:
2580         (WebProcessMessage::):
2581         Add a new message.
2582
2583         * UIProcess/API/C/win/WKContextPrivateWin.h: Added.
2584         Declare WKContextSetShouldPaintNativeControls().
2585
2586         * UIProcess/API/C/win/WKContextWin.cpp: Added.
2587         (WKContextSetShouldPaintNativeControls):
2588         Call the WebContext's setShouldPaintNativeControls().
2589
2590         * UIProcess/WebContext.cpp:
2591         (WebKit::WebContext::WebContext):
2592         Initialize m_shouldPaintNativeControls.
2593         (WebKit::WebContext::ensureWebProcess):
2594         If we created a web process, call platformSetUpWebProcess().
2595
2596         * UIProcess/WebContext.h:
2597         Declare new functions and a member to store whether we should paint
2598         native controls.
2599
2600         * UIProcess/mac/WebContextMac.mm:
2601         (WebKit::WebContext::platformSetUpWebProcess):
2602         Stubbed.
2603
2604         * UIProcess/win/WebContextWin.cpp:
2605         (WebKit::WebContext::setShouldPaintNativeControls):
2606         Set m_shouldPaintNativeControls. If we have a valid web process, send a
2607         SetShouldPaintNativeControls message.
2608         (WebKit::WebContext::platformSetUpWebProcess):
2609         Send a SetShouldPaintNativeControls message.
2610
2611         * WebProcess/WebProcess.cpp:
2612         (WebKit::WebProcess::didReceiveMessage):
2613         If this is a SetShouldPaintNativeControls message, decode the argument,
2614         and call Settings::setShouldPaintNativeControls().
2615
2616         * win/WebKit2.vcproj:
2617         Add WKContextPrivateWin.h and WKContextWin.cpp to project.
2618
2619         * win/WebKit2Generated.make:
2620         Copy WKContextPrivateWin.h.
2621
2622 2010-08-11  Sam Weinig  <sam@webkit.org>
2623
2624         Reviewed by Gavin Barraclough.
2625
2626         Add SPI to stop loading from the InjectedBundle.
2627
2628         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
2629         (WKBundlePageStopLoading):
2630         * WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h:
2631         * WebProcess/WebPage/WebPage.h:
2632
2633 2010-08-11  Sam Weinig  <sam@webkit.org>
2634
2635         Reviewed by Gavin Barraclough.
2636
2637         WKPageStopLoading always asserts
2638
2639         * WebProcess/WebPage/WebPage.cpp:
2640         (WebKit::WebPage::didReceiveMessage): Switch break to return, break made us
2641         hit the ASSERT_NOT_REACHED at the end of the function.
2642
2643 2010-08-11  Balazs Kelemen  <kb@inf.u-szeged.hu>
2644
2645         Unreviewed build fix.
2646
2647         [Qt] Update WebKit2 build environment, add stub implementation of SharedMemory.
2648
2649         * DerivedSources.pro:
2650         * Platform/qt/SharedMemoryQt.cpp: Added.
2651         (WebKit::SharedMemory::Handle::Handle):
2652         (WebKit::SharedMemory::Handle::~Handle):
2653         (WebKit::SharedMemory::Handle::encode):
2654         (WebKit::SharedMemory::Handle::decode):
2655         (WebKit::SharedMemory::create):
2656         (WebKit::SharedMemory::~SharedMemory):
2657         (WebKit::SharedMemory::createHandle):
2658         (WebKit::SharedMemory::systemPageSize):
2659         * WebKit2.pro:
2660         * WebKit2Prefix.h:
2661
2662 2010-08-11  Mark Rowe  <mrowe@apple.com>
2663
2664         Build fix.  Update references to StringHash.h.
2665
2666         * Shared/CommandLine.h:
2667         * UIProcess/WebContext.h:
2668         * WebProcess/Plugins/Netscape/NetscapePlugin.h:
2669         * WebProcess/win/WebProcessMainWin.cpp:
2670
2671 2010-08-10  Darin Adler  <darin@apple.com>
2672
2673         Reviewed by Sam Weinig.
2674
2675         Add leakRef and clear to all RefPtr variants
2676         https://bugs.webkit.org/show_bug.cgi?id=42389
2677
2678         * UIProcess/API/cpp/WKRetainPtr.h: Changed all uses of "template <...>" to
2679         "template<...>". Defined many of the inlined functions outside the class
2680         definition, to avoid style checker warnings about multiple statements on
2681         a single line and for slightly better clarity of the class definition itself.
2682         Renamed releaseRef to leakRef. Added a releaseRef that calls leakRef so we
2683         don't have to rename all callers at once. Added a clear function.
2684
2685 2010-08-10  Balazs Kelemen  <kb@inf.u-szeged.hu>
2686
2687         Reviewed by Antonio Gomes.
2688
2689         [Qt] Build WebKit2 into a static lib
2690
2691         https://bugs.webkit.org/show_bug.cgi?id=43621
2692
2693         * WebKit2.pri: Added. Defined addWebKit2Lib function that defines how to link against the static lib.
2694         * WebKit2.pro:  Build specification for the WebKit2 framework.
2695         * WebProcess.pro: Copied from WebKit2/WebKit2.pro. Build specification for the WebProcess binary.
2696
2697 2010-08-09  Sam Weinig  <sam@webkit.org>
2698
2699         Reviewed by Geoffrey Garen.
2700
2701         Add zoom support for injected bundle
2702         https://bugs.webkit.org/show_bug.cgi?id=43759
2703
2704         Add SPI to change the zoom factor for a page.
2705
2706         * WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
2707         (toZoomMode):
2708         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
2709         (WKBundlePageGetZoomFactor):
2710         (WKBundlePageSetZoomFactor):
2711         (WKBundlePageSetZoomMode):
2712         * WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h:
2713         * WebProcess/WebPage/WebPage.cpp:
2714         (WebKit::WebPage::zoomFactor):
2715         (WebKit::WebPage::setZoomFactor):
2716         (WebKit::WebPage::setZoomMode):
2717         * WebProcess/WebPage/WebPage.h:
2718
2719 2010-08-06  Gavin Barraclough  <barraclough@apple.com>
2720
2721         Rubber stamped by Sam Weinig
2722
2723         Bug 43594 - Add string forwards to Forward.h
2724         This allows us to remove forward declarations for these classes from
2725         WebCore/WebKit (a step in moving these class from WebCore:: to WTF::).
2726
2727         * UIProcess/PageClient.h:
2728         * UIProcess/VisitedLinkProvider.h:
2729         * UIProcess/WebContextInjectedBundleClient.h:
2730         * UIProcess/WebFrameProxy.h:
2731         * UIProcess/WebHistoryClient.h:
2732         * UIProcess/WebLoaderClient.h:
2733         * UIProcess/WebPolicyClient.h:
2734         * UIProcess/WebProcessProxy.h:
2735         * UIProcess/WebUIClient.h:
2736         * UIProcess/win/WebView.h:
2737         * WebProcess/InjectedBundle/InjectedBundlePageEditorClient.h:
2738         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h:
2739         * WebProcess/InjectedBundle/InjectedBundlePageUIClient.h:
2740         * WebProcess/Plugins/NPRuntimeObjectMap.h:
2741         * WebProcess/Plugins/Netscape/NetscapePluginStream.h:
2742         * WebProcess/Plugins/PluginController.h:
2743         * WebProcess/WebPage/WebFrame.h:
2744         * WebProcess/WebPage/WebPage.h:
2745         * WebProcess/WebProcess.h:
2746
2747 2010-08-09  Balazs Kelemen  <kb@inf.u-szeged.hu>
2748
2749         Reviewed by Kenneth Rohde Christiansen.
2750
2751         [Qt] No need for PageClientImpl
2752
2753         https://bugs.webkit.org/show_bug.cgi?id=43728
2754
2755         Remove PageClientImpl, take the implementation of WebKit::PageClient into QWKPagePrivate.
2756
2757         * UIProcess/API/qt/qwkpage.cpp:
2758         (QWKPagePrivate::QWKPagePrivate):
2759         (QWKPagePrivate::toolTipChanged):
2760         * UIProcess/API/qt/qwkpage_p.h:
2761         (QWKPagePrivate::pageDidEnterAcceleratedCompositing):
2762         (QWKPagePrivate::pageDidLeaveAcceleratedCompositing):
2763         (QWKPagePrivate::processDidExit):
2764         (QWKPagePrivate::processDidRevive):
2765         (QWKPagePrivate::setCursor):
2766         (QWKPagePrivate::takeFocus):
2767
2768 2010-08-07  Sam Weinig  <sam@webkit.org>
2769
2770         Reviewed by Anders Carlsson.
2771
2772         WebKitTestRunner needs to print onunload handler information
2773         <rdar://problem/8213831>
2774         https://bugs.webkit.org/show_bug.cgi?id=42703
2775
2776         Add SPI to get the number of pending unload events.
2777
2778         * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
2779         (WKBundleFrameGetPendingUnloadCount):
2780         * WebProcess/InjectedBundle/API/c/WKBundleFramePrivate.h:
2781         * WebProcess/WebPage/WebFrame.cpp:
2782         (WebKit::WebFrame::pendingUnloadCount):
2783         * WebProcess/WebPage/WebFrame.h:
2784
2785 2010-08-07  Sam Weinig  <sam@webkit.org>
2786
2787         Reviewed by Anders Carlsson.
2788
2789         Add additional loader client functions need to complete WebKitTestRunner
2790         https://bugs.webkit.org/show_bug.cgi?id=43684
2791
2792         * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
2793         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp:
2794         (WebKit::InjectedBundlePageLoaderClient::didCancelClientRedirectForFrame):
2795         (WebKit::InjectedBundlePageLoaderClient::willPerformClientRedirectForFrame):
2796         (WebKit::InjectedBundlePageLoaderClient::didChangeLocationWithinPageForFrame):
2797         (WebKit::InjectedBundlePageLoaderClient::didFinishDocumentLoadForFrame):
2798         (WebKit::InjectedBundlePageLoaderClient::didHandleOnloadEventsForFrame):
2799         (WebKit::InjectedBundlePageLoaderClient::didDisplayInsecureContentForFrame):
2800         (WebKit::InjectedBundlePageLoaderClient::didRunInsecureContentForFrame):
2801         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h:
2802         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2803         (WebKit::WebFrameLoaderClient::dispatchDidHandleOnloadEvents):
2804         (WebKit::WebFrameLoaderClient::dispatchDidCancelClientRedirect):
2805         (WebKit::WebFrameLoaderClient::dispatchWillPerformClientRedirect):
2806         (WebKit::WebFrameLoaderClient::dispatchDidChangeLocationWithinPage):
2807         (WebKit::WebFrameLoaderClient::dispatchDidFinishDocumentLoad):
2808         (WebKit::WebFrameLoaderClient::didDisplayInsecureContent):
2809         (WebKit::WebFrameLoaderClient::didRunInsecureContent):
2810
2811 2010-08-07  Sam Weinig  <sam@webkit.org>
2812
2813         Another fix for the windows build.
2814
2815         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
2816         (WebKit::NetscapePlugin::isAcceleratedCompositingEnabled):
2817
2818 2010-08-07  Sam Weinig  <sam@webkit.org>
2819
2820         Fix windows build.
2821
2822         * WebProcess/Plugins/PluginView.cpp:
2823         (WebKit::PluginView::platformLayer):
2824         * WebProcess/Plugins/PluginView.h:
2825
2826 2010-08-07  Sam Weinig  <sam@webkit.org>
2827
2828         Reviewed by Anders Carlsson.
2829
2830         WebKitTestRunner needs GCController
2831         <rdar://problem/8213834>
2832         https://bugs.webkit.org/show_bug.cgi?id=42701
2833
2834         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
2835         (WKBundleGarbageCollectJavaScriptObjects):
2836         (WKBundleGarbageCollectJavaScriptObjectsOnAlternateThreadForDebugging):
2837         (WKBundleGetJavaScriptObjectsCount):
2838         * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
2839         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2840         (WebKit::InjectedBundle::garbageCollectJavaScriptObjects):
2841         (WebKit::InjectedBundle::garbageCollectJavaScriptObjectsOnAlternateThreadForDebugging):
2842         (WebKit::InjectedBundle::javaScriptObjectsCount):
2843         * WebProcess/InjectedBundle/InjectedBundle.h:
2844
2845 2010-08-07  Anders Carlsson  <andersca@apple.com>
2846
2847         Reviewed by Sam Weinig.
2848
2849         CA drawing model support for Mac Plugins
2850         https://bugs.webkit.org/show_bug.cgi?id=43678
2851         <rdar://problem/7929701>
2852
2853         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
2854         (WebKit::NPN_GetValue):
2855         Handle WKNVSupportsCompositingCoreAnimationPluginsBool and 
2856         NPNVsupportsCoreAnimationBool and return true if accelerated compositing is enabled.
2857
2858         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
2859         (WebKit::NetscapePlugin::isAcceleratedCompositingEnabled):
2860         Call PluginController::isAcceleratedCompositingEnabled.
2861
2862         * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
2863         (WebKit::NetscapePlugin::platformPostInitialize):
2864         If the plug-in uses the Core Animation drawing model, ask it for its layer.
2865
2866         (WebKit::NetscapePlugin::platformPaint):
2867         Don't send draw events if the Core Animation drawing model is used.
2868
2869         (WebKit::NetscapePlugin::pluginLayer):
2870         Return the plug-in layer.
2871
2872         * WebProcess/Plugins/Plugin.h:
2873         Add a pluginLayer pure virtual member function.
2874
2875         * WebProcess/Plugins/PluginController.h:
2876         Add an isAcceleratedCompositingEnabled pure virtual member function.
2877
2878         * WebProcess/Plugins/PluginView.cpp:
2879         (WebKit::PluginView::initializePlugin):
2880         If the plug-in has a layer, enter compositing mode.
2881
2882         (WebKit::PluginView::platformLayer):
2883         Ask the plug-in for its layer.
2884
2885         (WebKit::PluginView::isAcceleratedCompositingEnabled):
2886         Call Settings::acceleratedCompositingEnabled.
2887
2888         * WebProcess/Plugins/PluginView.h:
2889
2890 2010-08-06  Sam Weinig  <sam@webkit.org>
2891
2892         Reviewed by Anders Carlsson.
2893
2894         Delete key doesn't go Back in WebKit2
2895         <rdar://problem/8272978>
2896         https://bugs.webkit.org/show_bug.cgi?id=43665
2897
2898         - Adds support for delete key going back (mac only for now)
2899         - Adds support for command-left/command right going back/forward
2900         - Flesh out scrolling due to arrow keys on the mac to match old webkit.
2901         - Made performDefaultBehaviorForKeyEvent platform specific and added
2902           a boolean return value which will be used later to inform the UI process
2903           about what events have been processed.
2904
2905         * Shared/CoreIPCSupport/WebPageProxyMessageKinds.h:
2906         (WebPageProxyMessage::):
2907         * UIProcess/API/mac/WKView.mm:
2908         (-[WKView _wantsKeyDownForEvent:]):
2909         * UIProcess/WebPageProxy.cpp:
2910         (WebKit::WebPageProxy::didReceiveSyncMessage):
2911         * WebProcess/WebPage/WebBackForwardListProxy.cpp:
2912         (WebKit::WebBackForwardListProxy::backItem):
2913         (WebKit::WebBackForwardListProxy::forwardItem):
2914         * WebProcess/WebPage/WebPage.cpp:
2915         (WebKit::WebPage::keyEvent):
2916         * WebProcess/WebPage/WebPage.h:
2917         * WebProcess/WebPage/mac/WebPageMac.mm:
2918         (WebKit::scroll):
2919         (WebKit::WebPage::performDefaultBehaviorForKeyEvent):
2920         * WebProcess/WebPage/qt/WebPageQt.cpp:
2921         (WebKit::scroll):
2922         (WebKit::WebPage::performDefaultBehaviorForKeyEvent):
2923         * WebProcess/WebPage/win/WebPageWin.cpp:
2924         (WebKit::scroll):
2925         (WebKit::WebPage::performDefaultBehaviorForKeyEvent):
2926
2927 2010-08-07  Sheriff Bot  <webkit.review.bot@gmail.com>
2928
2929         Unreviewed, rolling out r64904.
2930         http://trac.webkit.org/changeset/64904
2931         https://bugs.webkit.org/show_bug.cgi?id=43671
2932
2933         Broke the Qt Windows builders. (Requested by bbandix on
2934         #webkit).
2935
2936         * WebKit2.pri: Removed.
2937         * WebKit2.pro:
2938         * WebProcess.pro: Removed.
2939
2940 2010-08-07  Balazs Kelemen  <kb@inf.u-szeged.hu>
2941
2942         Reviewed by Eric Seidel.
2943
2944         NPAPI headers should be included through npruntime_internal.h
2945
2946         https://bugs.webkit.org/show_bug.cgi?id=43620
2947
2948         * DerivedSources.pro:
2949         * WebProcess/Plugins/NPJSObject.h:
2950         * WebProcess/Plugins/NPRuntimeUtilities.h:
2951         * WebProcess/Plugins/Netscape/NetscapePluginStream.h:
2952
2953 2010-08-07  Balazs Kelemen  <kb@inf.u-szeged.hu>
2954
2955         Reviewed by Eric Seidel.
2956
2957         [Qt] Build WebKit2 into a static lib
2958
2959         https://bugs.webkit.org/show_bug.cgi?id=43621
2960
2961         * WebKit2.pri: Added. Defined addWebKit2Lib function that defines how to link against the static lib.
2962         * WebKit2.pro:  Build specification for the WebKit2 framework.
2963         * WebProcess.pro: Copied from WebKit2/WebKit2.pro. Build specification for the WebProcess binary.
2964
2965 2010-08-05  Jon Honeycutt  <jhoneycutt@apple.com>
2966
2967         WebKitTestRunner needs to be able to set the font smoothing type
2968         https://bugs.webkit.org/show_bug.cgi?id=43406
2969
2970         Reviewed by Adam Roben.
2971
2972         * Shared/FontSmoothingLevel.h: Added.
2973         (WebKit::):
2974
2975         * Shared/WebPreferencesStore.cpp:
2976         (WebKit::WebPreferencesStore::WebPreferencesStore):
2977         Initialize fontSmoothingLevel.
2978         (WebKit::WebPreferencesStore::swap):
2979         Copy fontSmoothingLevel.
2980
2981         * Shared/WebPreferencesStore.h:
2982         (WebKit::WebPreferencesStore::encode):
2983         Encode fontSmoothingLevel.
2984         (WebKit::WebPreferencesStore::decode):
2985         Decode it.
2986
2987         * UIProcess/API/C/WKPreferencesPrivate.cpp: Added.
2988         (WKPreferencesSetFontSmoothingLevel):
2989         Get the font smoothing level from the WKFontSmoothingLevel, and call
2990         WebPreferences::setFontSmoothingLevel().
2991         (WKPreferencesGetFontSmoothingLevel):
2992         Get the font smoothing level from WebPreferences, and translate it to a
2993         WKFontSmoothingLevel.
2994
2995         * UIProcess/API/C/WKPreferencesPrivate.h: Added.
2996         Declare the font smoothing levels, and declare functions to get and set
2997         the level.
2998
2999         * UIProcess/WebPreferences.cpp:
3000         (WebKit::WebPreferences::setFontSmoothingLevel):
3001         Set fontSmoothingLevel and call update().
3002         (WebKit::WebPreferences::fontSmoothingLevel):
3003         Return the level.
3004
3005         * UIProcess/WebPreferences.h:
3006         Declare getter and setter for fontSmoothingLevel.
3007
3008         * WebKit2.xcodeproj/project.pbxproj:
3009         Add new files to project.
3010
3011         * WebProcess/WebPage/WebPage.cpp:
3012         (WebKit::WebPage::preferencesDidChange):
3013         Call platformPreferencesDidChange().
3014
3015         * WebProcess/WebPage/WebPage.h:
3016         Declare platformPreferencesDidChange().
3017
3018         * WebProcess/WebPage/mac/WebPageMac.mm:
3019         (WebKit::WebPage::platformPreferencesDidChange):
3020         Stubbed.
3021
3022         * WebProcess/WebPage/qt/WebPageQt.cpp:
3023         (WebKit::WebPage::platformPreferencesDidChange):
3024         Stubbed.
3025
3026         * WebProcess/WebPage/win/WebPageWin.cpp:
3027         (WebKit::WebPage::platformPreferencesDidChange):
3028         On CG platforms, call wkSetFontSmoothingLevel(). This matches the code
3029         in old WebKit's WebPreferences. Set the font rendering mode to either
3030         normal (CG) or alternative (GDI) based on the font smoothing level. This
3031         matches what was done in old WebKit's WebView.
3032
3033         * win/WebKit2.vcproj:
3034         Add FontSmoothingLevel.h and WKPreferencesPrivate.{h,cpp} to project.
3035
3036         * win/WebKit2Generated.make:
3037         Copy WKPreferencesPrivate.h.
3038
3039 2010-08-06  Anders Carlsson  <andersca@apple.com>
3040
3041         Build fixes.
3042
3043         * Platform/win/SharedMemoryWin.cpp:
3044         (WebKit::SharedMemory::Handle::encode):
3045         (WebKit::SharedMemory::Handle::decode):
3046         * Shared/qt/UpdateChunk.cpp:
3047         (WebKit::UpdateChunk::encode):
3048         (WebKit::UpdateChunk::decode):
3049         * Shared/qt/UpdateChunk.h:
3050         * Shared/win/UpdateChunk.cpp:
3051         (WebKit::UpdateChunk::encode):
3052         (WebKit::UpdateChunk::decode):
3053         * Shared/win/UpdateChunk.h:
3054
3055 2010-08-06  Anders Carlsson  <andersca@apple.com>
3056
3057         Reviewed by Sam Weinig.
3058
3059         Change all ArgumentEncoder and ArgumentDecoder references to pointers
3060         https://bugs.webkit.org/show_bug.cgi?id=43651
3061
3062         * Platform/CoreIPC/ArgumentCoder.h:
3063         * Platform/CoreIPC/ArgumentDecoder.h:
3064         * Platform/CoreIPC/Arguments.h:
3065         * Platform/CoreIPC/Attachment.cpp:
3066         * Platform/CoreIPC/Attachment.h:
3067         * Platform/CoreIPC/mac/MachPort.h:
3068         * Platform/SharedMemory.h:
3069         * Platform/mac/SharedMemoryMac.cpp:
3070         * Shared/DrawingAreaBase.cpp:
3071         * Shared/DrawingAreaBase.h:
3072         * Shared/WebEvent.h:
3073         * Shared/WebNavigationDataStore.h:
3074         * Shared/WebPreferencesStore.h:
3075         * Shared/mac/UpdateChunk.cpp:
3076         * Shared/mac/UpdateChunk.h:
3077         * UIProcess/ChunkedUpdateDrawingAreaProxy.cpp:
3078         * UIProcess/ChunkedUpdateDrawingAreaProxy.h:
3079         * UIProcess/DrawingAreaProxy.h:
3080         * UIProcess/LayerBackedDrawingAreaProxy.cpp:
3081         * UIProcess/LayerBackedDrawingAreaProxy.h:
3082         * UIProcess/WebContext.cpp:
3083         * UIProcess/WebContext.h:
3084         * UIProcess/WebPageProxy.cpp:
3085         * UIProcess/WebPageProxy.h:
3086         * UIProcess/WebProcessProxy.cpp:
3087         * WebProcess/InjectedBundle/InjectedBundle.cpp:
3088         * WebProcess/InjectedBundle/InjectedBundle.h:
3089         * WebProcess/WebPage/ChunkedUpdateDrawingArea.cpp:
3090         * WebProcess/WebPage/ChunkedUpdateDrawingArea.h:
3091         * WebProcess/WebPage/DrawingArea.h:
3092         * WebProcess/WebPage/LayerBackedDrawingArea.cpp:
3093         * WebProcess/WebPage/LayerBackedDrawingArea.h:
3094         * WebProcess/WebPage/WebPage.cpp:
3095         * WebProcess/WebPage/WebPage.h:
3096         * WebProcess/WebProcess.cpp:
3097
3098 2010-08-06  Anders Carlsson  <andersca@apple.com>
3099
3100         Reviewed by Sam Weinig.
3101
3102         Don't try to allocate a vector unless we know the buffer can contain it
3103         https://bugs.webkit.org/show_bug.cgi?id=43647
3104
3105         * Platform/CoreIPC/ArgumentCoders.h:
3106         (CoreIPC::):
3107         Check that the argument decoder buffer actually can hold all the vector elements.
3108
3109         * Platform/CoreIPC/ArgumentDecoder.cpp:
3110         (CoreIPC::ArgumentDecoder::bufferIsLargeEnoughtToContain):
3111         Align the current position to the given alignment, add the size and check if the position is
3112         past the end of the buffer.
3113
3114         * Platform/CoreIPC/ArgumentDecoder.h:
3115         (CoreIPC::ArgumentDecoder::bufferIsLargeEnoughtToContain):
3116         Get the size and alignment and call the other bufferIsLargeEnoughtToContain overload.
3117
3118 2010-08-06  Anders Carlsson  <andersca@apple.com>
3119
3120         Reviewed by Adam Roben.
3121
3122         Detect invalid CoreIPC messages and call didReceiveInvalidMessage
3123         https://bugs.webkit.org/show_bug.cgi?id=43643
3124         <rdar://problem/7891069>
3125
3126         * Platform/CoreIPC/ArgumentDecoder.cpp:
3127         (CoreIPC::ArgumentDecoder::alignBufferPosition):
3128         If we can't correctly align the buffer position, mark the decoder as invalid.
3129
3130         * Platform/CoreIPC/ArgumentDecoder.h:
3131         (CoreIPC::ArgumentDecoder::isInvalid):
3132         Check if the argument decoder is valid.
3133
3134         (CoreIPC::ArgumentDecoder::markInvalid):
3135         Mark the argument decoder as invalid, by setting its buffer position past its end position.
3136
3137         * Platform/CoreIPC/Connection.cpp:
3138         (CoreIPC::Connection::dispatchMessages):
3139         Check if m_client is null before dispatching messages. If an argument decoder was marked invalid, call
3140         Connection::Client::didReceiveInvalidMessage.
3141
3142         * Platform/CoreIPC/Connection.h:
3143         (CoreIPC::Connection::Message::releaseArguments):
3144         Rename destroy to releaseArguments and make it return a PassOwnPtr.
3145
3146         * UIProcess/WebProcessProxy.cpp:
3147         (WebKit::WebProcessProxy::~WebProcessProxy):
3148         Call releaseArguments instead of destroy.
3149
3150         (WebKit::WebProcessProxy::didReceiveInvalidMessage):
3151         Kill the web process and invalidate its connection.
3152
3153         * WebProcess/WebProcess.cpp:
3154         (WebKit::WebProcess::didReceiveInvalidMessage):
3155         Don't do anything, if the UI process is sending invalid messages there's not much we can do.
3156
3157         * WebProcess/WebProcess.h:
3158
3159 2010-08-06  Anders Carlsson  <andersca@apple.com>
3160
3161         Reviewed by Adam Roben.
3162
3163         Add CoreIPC::MessageReceiver class
3164         https://bugs.webkit.org/show_bug.cgi?id=43637
3165
3166         * Platform/CoreIPC/Connection.h:
3167         (CoreIPC::Connection::MessageReceiver::~MessageReceiver):
3168         Add MessageReceiver class and make Client inherit from it.
3169
3170         (CoreIPC::Connection::MessageReceiver::didReceiveSyncMessage):
3171         Change didReceiveSyncMessage from being a pure virtual member function and make it
3172         assert by default instead.
3173
3174         * UIProcess/ChunkedUpdateDrawingAreaProxy.cpp:
3175         * UIProcess/ChunkedUpdateDrawingAreaProxy.h:
3176         Remove ChunkedUpdateDrawingAreaProxy::didReceiveSyncMessage.
3177
3178         * Shared/DrawingAreaBase.h:
3179         Include "Connection.h" instead.
3180
3181         * UIProcess/DrawingAreaProxy.h:
3182         (WebKit::DrawingAreaProxy::didReceiveSyncMessage):
3183         Change didReceiveSyncMessage from being a pure virtual member function and make it
3184         assert by default instead.
3185
3186         * WebProcess/WebProcess.cpp:
3187         * WebProcess/WebProcess.h:
3188         Remove didReceiveSyncMessage.
3189
3190 2010-08-06  Jessie Berlin  <jberlin@apple.com>
3191
3192         Roll out http://trac.webkit.org/changeset/64801, which broke the Safari Windows Build.
3193         Unreviewed.
3194
3195         * UIProcess/PageClient.h:
3196         * UIProcess/VisitedLinkProvider.h:
3197         * UIProcess/WebContextInjectedBundleClient.h:
3198         * UIProcess/WebFrameProxy.h:
3199         * UIProcess/WebHistoryClient.h:
3200         * UIProcess/WebLoaderClient.h:
3201         * UIProcess/WebPolicyClient.h:
3202         * UIProcess/WebProcessProxy.h:
3203         * UIProcess/WebUIClient.h:
3204         * UIProcess/win/WebView.h:
3205         * WebProcess/InjectedBundle/InjectedBundlePageEditorClient.h:
3206         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h:
3207         * WebProcess/InjectedBundle/InjectedBundlePageUIClient.h:
3208         * WebProcess/Plugins/NPRuntimeObjectMap.h:
3209         * WebProcess/Plugins/Netscape/NetscapePluginStream.h:
3210         * WebProcess/Plugins/PluginController.h:
3211         * WebProcess/WebPage/WebFrame.h:
3212         * WebProcess/WebPage/WebPage.h:
3213         * WebProcess/WebProcess.h:
3214
3215 2010-08-05  Sam Weinig  <sam@webkit.org>
3216
3217         Reviewed by Anders Carlsson.
3218
3219         Add form client for injected bundle code
3220         https://bugs.webkit.org/show_bug.cgi?id=43603
3221
3222         * WebKit2.xcodeproj/project.pbxproj:
3223         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
3224         (WKBundlePageSetFormClient):
3225         * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
3226         * WebProcess/InjectedBundle/InjectedBundlePageFormClient.cpp: Added.
3227         (WebKit::InjectedBundlePageFormClient::InjectedBundlePageFormClient):
3228         (WebKit::InjectedBundlePageFormClient::initialize):
3229         (WebKit::InjectedBundlePageFormClient::textFieldDidBeginEditing):
3230         (WebKit::InjectedBundlePageFormClient::textFieldDidEndEditing):
3231         (WebKit::InjectedBundlePageFormClient::textDidChangeInTextField):
3232         (WebKit::InjectedBundlePageFormClient::textDidChangeInTextArea):
3233         * WebProcess/InjectedBundle/InjectedBundlePageFormClient.h: Added.
3234         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
3235         (WebKit::WebEditorClient::textFieldDidBeginEditing):
3236         (WebKit::WebEditorClient::textFieldDidEndEditing):
3237         (WebKit::WebEditorClient::textDidChangeInTextField):
3238         (WebKit::WebEditorClient::textDidChangeInTextArea):
3239         * WebProcess/WebPage/WebPage.cpp:
3240         (WebKit::WebPage::initializeInjectedBundleFormClient):
3241         * WebProcess/WebPage/WebPage.h:
3242         (WebKit::WebPage::injectedBundleFormClient):
3243         * win/WebKit2.vcproj:
3244
3245 2010-08-05  Sam Weinig  <sam@webkit.org>
3246
3247         Reviewed by Anders Carlsson.
3248
3249         Add ability to get a JSValueRef for a node handle and a world
3250         https://bugs.webkit.org/show_bug.cgi?id=43591
3251
3252         - Add API to get a JSValueRef for a world, node and frame (the
3253           frame is currently necessary to pick the right globalObject for
3254           the node wrapper).
3255         - Add API to a JSGlobalContextRef for a world and a frame.
3256
3257         * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
3258         (WKBundleFrameGetJavaScriptContextForWorld):
3259         (WKBundleFrameGetJavaScriptWrapperForNodeForWorld):
3260         * WebProcess/InjectedBundle/API/c/WKBundleFrame.h:
3261         * WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.h:
3262         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
3263         (WebKit::InjectedBundleNodeHandle::coreNode):
3264         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h:
3265         * WebProcess/InjectedBundle/InjectedBundleScriptWorld.cpp:
3266         (WebKit::InjectedBundleScriptWorld::coreWorld):
3267         * WebProcess/InjectedBundle/InjectedBundleScriptWorld.h:
3268         * WebProcess/WebPage/WebFrame.cpp:
3269         (WebKit::WebFrame::jsContext):
3270         (WebKit::WebFrame::jsContextForWorld):
3271         (WebKit::WebFrame::jsWrapperForWorld):
3272         * WebProcess/WebPage/WebFrame.h:
3273
3274 2010-08-05  Gavin Barraclough  <barraclough@apple.com>
3275
3276         Rubber stamped by Sam Weinig
3277
3278         Bug 43594 - Add string forwards to Forward.h
3279         This allows us to remove forward declarations for these classes from
3280         WebCore/WebKit (a step in moving these class from WebCore:: to WTF::).
3281
3282         * UIProcess/PageClient.h:
3283         * UIProcess/VisitedLinkProvider.h:
3284         * UIProcess/WebContextInjectedBundleClient.h:
3285         * UIProcess/WebFrameProxy.h:
3286         * UIProcess/WebHistoryClient.h:
3287         * UIProcess/WebLoaderClient.h:
3288         * UIProcess/WebPolicyClient.h:
3289         * UIProcess/WebProcessProxy.h:
3290         * UIProcess/WebUIClient.h:
3291         * UIProcess/win/WebView.h:
3292         * WebProcess/InjectedBundle/InjectedBundlePageEditorClient.h:
3293         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h:
3294         * WebProcess/InjectedBundle/InjectedBundlePageUIClient.h:
3295         * WebProcess/Plugins/NPRuntimeObjectMap.h:
3296         * WebProcess/Plugins/Netscape/NetscapePluginStream.h:
3297         * WebProcess/Plugins/PluginController.h:
3298         * WebProcess/WebPage/WebFrame.h:
3299         * WebProcess/WebPage/WebPage.h:
3300         * WebProcess/WebProcess.h:
3301
3302 2010-08-05  Anders Carlsson  <andersca@apple.com>
3303
3304         Reviewed by Sam Weinig.
3305
3306         Use the visited link provider for visited links
3307         https://bugs.webkit.org/show_bug.cgi?id=43583
3308
3309         * Shared/CoreIPCSupport/WebProcessMessageKinds.h:
3310         (WebProcessMessage::):
3311         Remove AddVisitedLink.
3312
3313         * Shared/CoreIPCSupport/WebProcessProxyMessageKinds.h:
3314         (WebProcessProxyMessage::):
3315         Remove PopulateVisitedLinks and add AddVisitedLink.
3316
3317         * UIProcess/WebContext.cpp:
3318         (WebKit::WebContext::sharedProcessContext):
3319         Initialize the main run loop before creating the context.
3320         
3321         (WebKit::WebContext::sharedThreadContext):
3322         Ditto.
3323         
3324         (WebKit::WebContext::create):
3325         Ditto.
3326
3327         (WebKit::WebContext::WebContext):
3328         Initialize the visited link provider.
3329
3330         (WebKit::WebContext::processDidFinishLaunching):
3331         Ask the visited link provider to populate visited links.
3332
3333         (WebKit::WebContext::addVisitedLink):
3334         Ask the visited link provider to add the visited link.
3335
3336         * UIProcess/WebProcessProxy.cpp:
3337         (WebKit::WebProcessProxy::addVisitedLink):
3338         Call WebContext::addVisitedLink.
3339
3340         (WebKit::WebProcessProxy::didReceiveMessage):
3341         Handle AddVisitedLink.
3342
3343         (WebKit::WebProcessProxy::didFinishLaunching):
3344         Call WebContext::processdidFinishLaunching.
3345
3346         * UIProcess/WebProcessProxy.h:
3347         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3348         (WebKit::WebChromeClient::populateVisitedLinks):
3349         Don't send the WebProcessProxyMessage::PopulateVisitedLinks message.
3350
3351         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
3352         (WebKit::WebPlatformStrategies::isLinkVisited):
3353         Call WebProcess::isLinkVisited.
3354         
3355         (WebKit::WebPlatformStrategies::addVisitedLink):
3356         Call WebProcess::addVisitedLink.
3357
3358         * WebProcess/WebProcess.cpp:
3359         (WebKit::WebProcess::setVisitedLinkTable):
3360         Create a shared memory object and tell the visited link table about it.
3361
3362         (WebKit::WebProcess::visitedLinkStateChanged):
3363         Go through the link hashes and call Page::visitedStateChanged.
3364
3365         (WebKit::WebProcess::allVisitedLinkStateChanged):
3366         Call Page::allVisitedStateChanged.
3367
3368         (WebKit::WebProcess::isLinkVisited):
3369         Call VisitedLinkTable::isLinkVisited.
3370
3371         (WebKit::WebProcess::addVisitedLink):
3372         Inform the UI process about the added link.
3373
3374         (WebKit::WebProcess::didReceiveMessage):
3375         Handle new messages.
3376
3377 2010-08-05  Steve Falkenburg  <sfalken@apple.com>
3378
3379         Windows build fix.
3380         Add missing include path.
3381
3382         * win/WebKit2Common.vsprops:
3383
3384 2010-08-05  Brady Eidson  <beidson@apple.com>
3385
3386         Rubberstamped by Sam Weinig.
3387
3388         Export WKError.h
3389
3390         * WebKit2.xcodeproj/project.pbxproj:
3391
3392 2010-08-05  Steve Falkenburg  <sfalken@apple.com>
3393
3394         Windows build fix.
3395         Correct vcproj nesting.
3396
3397         * win/WebKit2.vcproj:
3398
3399 2010-08-05  Sam Weinig  <sam@webkit.org>
3400
3401         Reviewed by Gavin Barraclough.
3402
3403         Add script world API for injected bundles
3404         https://bugs.webkit.org/show_bug.cgi?id=43577
3405
3406         * Shared/APIObject.h:
3407         (WebKit::APIObject::):
3408         * WebKit2.xcodeproj/project.pbxproj:
3409         * WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
3410         (WebKit::):
3411         * WebProcess/InjectedBundle/API/c/WKBundleBase.h:
3412         * WebProcess/InjectedBundle/API/c/WKBundleScriptWorld.cpp: Added.
3413         (WKBundleScriptWorldGetTypeID):
3414         (WKBundleScriptWorldCreateWorld):
3415         (WKBundleScriptWorldNormalWorld):
3416         (WKBundleScriptWorldRetain):
3417         (WKBundleScriptWorldRelease):
3418         * WebProcess/InjectedBundle/API/c/WKBundleScriptWorld.h: Added.
3419         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
3420         * WebProcess/InjectedBundle/InjectedBundleScriptWorld.cpp: Added.
3421         (WebKit::allWorlds):
3422         (WebKit::InjectedBundleScriptWorld::create):
3423         (WebKit::InjectedBundleScriptWorld::getOrCreate):
3424         (WebKit::InjectedBundleScriptWorld::normalWorld):
3425         (WebKit::InjectedBundleScriptWorld::InjectedBundleScriptWorld):
3426         (WebKit::InjectedBundleScriptWorld::~InjectedBundleScriptWorld):
3427         * WebProcess/InjectedBundle/InjectedBundleScriptWorld.h: Added.
3428         (WebKit::InjectedBundleScriptWorld::type):
3429         * win/WebKit2.vcproj:
3430         * win/WebKit2Generated.make:
3431
3432 2010-08-05  Sam Weinig  <sam@webkit.org>
3433
3434         Reviewed Anders Carlsson.
3435
3436         Add DOM Node wrapper class for injected bundle
3437         https://bugs.webkit.org/show_bug.cgi?id=43524
3438
3439         - This class should not expose any DOM APIs, but just be a handle that can be used to get a JS
3440           wrapper for the node in a specific world.
3441
3442         * Shared/APIObject.h:
3443         (WebKit::APIObject::):
3444         * WebKit2.xcodeproj/project.pbxproj:
3445         * WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
3446         (WebKit::):
3447         * WebProcess/InjectedBundle/API/c/WKBundleBase.h:
3448         * WebProcess/InjectedBundle/API/c/WKBundleNode.h:
3449         * WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp: Added.
3450         (WKBundleNodeHandleGetTypeID):
3451         (WKBundleNodeHandleRetain):
3452         (WKBundleNodeHandleRelease):
3453         * WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.h: Added.
3454         * WebProcess/InjectedBundle/DOM: Added.
3455         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp: Added.
3456         (WebKit::domHandleCache):
3457         (WebKit::getDOMHandle):
3458         (WebKit::setDOMHandle):
3459         (WebKit::removeDOMHandle):
3460         (WebKit::InjectedBundleNodeHandle::getOrCreate):
3461         (WebKit::InjectedBundleNodeHandle::create):
3462         (WebKit::InjectedBundleNodeHandle::InjectedBundleNodeHandle):
3463         (WebKit::InjectedBundleNodeHandle::~InjectedBundleNodeHandle):
3464         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h: Added.
3465         (WebKit::InjectedBundleNodeHandle::type):
3466         * win/WebKit2.vcproj:
3467         * win/WebKit2Generated.make:
3468
3469 2010-08-05  Anders Carlsson  <andersca@apple.com>
3470
3471         Build fix.
3472
3473         * Platform/mac/SharedMemoryMac.cpp:
3474
3475 2010-08-05  Anders Carlsson  <andersca@apple.com>
3476
3477         Reviewed by Sam Weinig.
3478
3479         Add VisitedLinkProvider class
3480         https://bugs.webkit.org/show_bug.cgi?id=43570
3481
3482         * Shared/CoreIPCSupport/WebProcessMessageKinds.h:
3483         (WebProcessMessage::):
3484         Add SetVisitedLinkTable, VisitedLinkStateChanged and AllVisitedLinkStateChanged.
3485
3486         * UIProcess/VisitedLinkProvider.cpp: Added.
3487         (WebKit::VisitedLinkProvider::VisitedLinkProvider):
3488         Initialize table.
3489
3490         (WebKit::VisitedLinkProvider::populateVisitedLinksIfNeeded):
3491         Ask the context to populate visited links.
3492
3493         (WebKit::VisitedLinkProvider::addVisitedLink):
3494         Add the link hash to the set of pending visited links and start the timer.
3495
3496         (WebKit::nextPowerOf2):
3497         Add helper function.
3498
3499         (WebKit::tableSizeForKeyCount):
3500         Given a key count, returns a table size. The table size is always a power of two, and
3501         is chosen so that the table is always at least half empty.
3502
3503         (WebKit::VisitedLinkProvider::pendingVisitedLinksTimerFired):
3504         First, check if we need to resize the hash table and allocate new shared memory for it if that is the case.
3505         Then, go through the pending link hash vector and insert all the elements in the table. Finally, notify the web
3506         process about visited links whose state have changed.
3507
3508         * WebProcess/WebProcess.cpp:
3509         (WebKit::WebProcess::didReceiveMessage):
3510         Add case statements.
3511
3512         * win/WebKit2.vcproj:
3513         * WebKit2.xcodeproj/project.pbxproj:
3514         Add VisitedLinkProvider.cpp and VisitedLinkProvider.h.
3515
3516 2010-08-05  Anders Carlsson  <andersca@apple.com>
3517
3518         Reviewed by Sam Weinig.
3519
3520         Add VisitedLinkTable class
3521         https://bugs.webkit.org/show_bug.cgi?id=43566
3522
3523         * Shared/VisitedLinkTable.cpp: Added.
3524         (WebKit::VisitedLinkTable::VisitedLinkTable):
3525         (WebKit::VisitedLinkTable::~VisitedLinkTable):
3526         Add out of line constructors so we won't have to include SharedMemory.h in the 
3527         VisitedLinkTable.h header.
3528
3529         (WebKit::isPowerOf2):
3530         Add helper function.
3531
3532         (WebKit::VisitedLinkTable::setSharedMemory):
3533         Set the new shared memory and update the table size and hash.
3534
3535         (WebKit::doubleHash):
3536         Add helper function from the WTF HashTable.
3537
3538         (WebKit::VisitedLinkTable::addLinkHash):
3539         Add a link hash to the table.
3540
3541         (WebKit::VisitedLinkTable::isLinkVisited):
3542         See if there is an entry for the given link hash.
3543
3544         * Shared/VisitedLinkTable.h: Added.
3545         (WebKit::VisitedLinkTable::sharedMemory):
3546         * WebKit2.xcodeproj/project.pbxproj:
3547         * win/WebKit2.vcproj:
3548         Add VisitedLinkTable.cpp and VisitedLinkTable.h
3549
3550 2010-08-04  Anders Carlsson  <andersca@apple.com>
3551
3552         Reviewed by Adam Roben.
3553
3554         Add shared memory abstraction
3555         https://bugs.webkit.org/show_bug.cgi?id=43535
3556         <rdar://problem/8275295>
3557
3558         * Platform/SharedMemory.h: Added.
3559         (WebKit::SharedMemory::):
3560         (WebKit::SharedMemory::size):
3561         Return the size, in bytes, of the shared memory object.
3562         
3563         (WebKit::SharedMemory::data):
3564         Return a pointer to the shared memory object.
3565         
3566         * Platform/mac/SharedMemoryMac.cpp: Added.
3567         (WebKit::SharedMemory::Handle):
3568         A shared memory handle, which can be passed in a CoreIPC Connection.
3569
3570         (WebKit::SharedMemory::create):
3571         Allocate the shared memory.
3572
3573         (WebKit::SharedMemory::~SharedMemory):
3574         Deallocate the shared memory.
3575
3576         (WebKit::SharedMemory::createHandle):
3577         Create a mach port and pass it to the handle.
3578
3579         (WebKit::SharedMemory::systemPageSize):
3580         Return the system page size, in bytes.
3581         
3582         * Platform/win/SharedMemoryWin.cpp: Added.
3583         Add stubbed out version.
3584
3585         * WebKit2.xcodeproj/project.pbxproj:
3586         * win/WebKit2.vcproj:
3587         Add files.
3588
3589 2010-08-05  Jian Li  <jianli@chromium.org>
3590
3591         Reviewed by David Levin.
3592
3593         Unify blob related feature defines to ENABLE(BLOB).
3594         https://bugs.webkit.org/show_bug.cgi?id=43081
3595
3596         * Configurations/FeatureDefines.xcconfig:
3597
3598 2010-08-05  Balazs Kelemen  <kb@inf.u-szeged.hu>
3599
3600         Rubber-stamped by Kenneth Rohde Christiansen.
3601
3602         [Qt] Remove redundant include paths from WebKit2.pro.
3603
3604         * WebKit2.pro:
3605
3606 2010-08-04  Adam Roben  <aroben@apple.com>
3607
3608         Teach WebKit2 how to load the TestNetscapePlugin
3609
3610         Fixes <http://webkit.org/b/43513> WebKitTestRunner on Windows fails to
3611         load TestNetscapePlugin
3612
3613         Reviewed by Jon Honeycutt.
3614
3615         * Platform/Module.cpp:
3616         (WebKit::Module::Module): Initialize m_module on Windows.
3617
3618         * Platform/Module.h: Added m_module on Windows.
3619
3620         * Platform/win/ModuleWin.cpp:
3621         (WebKit::Module::load): Implemented using ::LoadLibraryExW.
3622         (WebKit::Module::unload): Implemented using ::FreeLibrary.
3623         (WebKit::Module::platformFunctionPointer): Implemented using
3624         ::GetProcAddress.
3625
3626         * Platform/win/RunLoopWin.cpp:
3627         (RunLoop::TimerBase::timerFired): Kill the native timer before calling
3628         the fired callback. This makes all our timers non-repeating, but
3629         that's all we need currently.
3630         (RunLoop::TimerBase::start): Added an assertion to help us figure out
3631         when we need to implement repeating timers. Also fixed a typo.
3632
3633         * UIProcess/Plugins/win/PluginInfoStoreWin.cpp:
3634         (WebKit::PluginInfoStore::pluginsDirectories): Added a FIXME.
3635
3636         (WebKit::PathWalker::PathWalker):
3637         (WebKit::PathWalker::~PathWalker):
3638         (WebKit::PathWalker::isValid):
3639         (WebKit::PathWalker::data):
3640         (WebKit::PathWalker::step):
3641         Added. This class wraps the ::FindFirstFile/::FindNextFile APIs.
3642
3643         (WebKit::PluginInfoStore::pluginPathsInDirectory): Implemented by
3644         porting logic from
3645         WebCore::PluginDatabase::getPluginPathsInDirectories.
3646         (WebKit::getVersionInfo): Copied from PluginDatabaseWin.cpp.
3647         (WebKit::PluginInfoStore::getPluginInfo): Implemented by porting logic
3648         from WebCore::PluginPackage::fetchInfo.
3649         (WebKit::PluginInfoStore::shouldUsePlugin): Changed to always return
3650         true for now. Added a FIXME about implementing this for real.
3651
3652         * UIProcess/WebProcessProxy.cpp:
3653         (WebKit::WebProcessProxy::didReceiveSyncMessage):
3654         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3655         (WebKit::WebFrameLoaderClient::createPlugin):
3656         Removed PLATFORM(MAC) guards around plugin code.
3657
3658         * win/WebKit2.vcproj: Let VS sort the file.
3659
3660 2010-08-05  Antti Koivisto  <koivisto@iki.fi>
3661
3662         Reviewed by Kenneth Rohde Christiansen.
3663
3664         Use toCopiedRef for making WK objects
3665         https://bugs.webkit.org/show_bug.cgi?id=43552
3666
3667         * UIProcess/API/cpp/qt/WKStringQt.cpp:
3668         (WKStringCreateWithQString):
3669         * UIProcess/API/cpp/qt/WKURLQt.cpp:
3670         (WKURLCreateWithQUrl):
3671
3672 2010-08-04  Brady Eidson  <beidson@apple.com>
3673
3674         Reviewed by Sam Weinig.
3675
3676         Change callback APIs to include an Error object in one callback, instead of having a second callback for failure.
3677         https://bugs.webkit.org/show_bug.cgi?id=43522
3678
3679         This includes adding a WKErrorRef object which - for now - either exists or doesn't.
3680         In the future, it may contain useful information about the error.
3681         
3682         * WebKit2.xcodeproj/project.pbxproj:
3683         * win/WebKit2.vcproj:
3684         * win/WebKit2Generated.make:
3685         
3686         * Shared/APIObject.h:
3687         (WebKit::APIObject::):
3688         * UIProcess/API/C/WKAPICast.h:
3689         * UIProcess/API/C/WKBase.h:
3690         
3691         * Shared/WebError.h: Added.
3692         (WebKit::WebError::create):
3693         (WebKit::WebError::WebError):
3694         (WebKit::WebError::type):
3695         
3696         * UIProcess/API/C/WKError.cpp: Added.
3697         (WKErrorGetTypeID):
3698         * UIProcess/API/C/WKError.h: Added.
3699         
3700         * UIProcess/API/C/WKPage.cpp:
3701         (WKPageRunJavaScriptInMainFrame):
3702         (callRunJavaScriptBlockAndRelease):
3703         (WKPageRunJavaScriptInMainFrame_b):
3704         (WKPageRenderTreeExternalRepresentation):
3705         (callRenderTreeExternalRepresentationBlockAndDispose):
3706         (WKPageRenderTreeExternalRepresentation_b):
3707         * UIProcess/API/C/WKPage.h:
3708         * UIProcess/API/C/WKPagePrivate.h:
3709         
3710         * UIProcess/GenericCallback.h:
3711         (WebKit::GenericCallback::create):
3712         (WebKit::GenericCallback::performCallbackWithReturnValue):
3713         (WebKit::GenericCallback::invalidate):
3714         (WebKit::GenericCallback::GenericCallback):
3715
3716 2010-08-04  Ada Chan  <adachan@apple.com>
3717
3718         Windows build fix        
3719
3720         * win/WebKit2Generated.make:
3721
3722 2010-08-04  John Sullivan  <sullivan@apple.com>
3723
3724         Build fix, rubber-stamped by Brady Eidson.
3725
3726         * WebKit2.xcodeproj/project.pbxproj:
3727         Made WKData.h a public header.
3728
3729 2010-08-04  Adam Roben  <aroben@apple.com>
3730
3731         Windows build fix
3732
3733         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
3734         (WebKit::NPN_SetValue): Removed unreachable code.
3735
3736 2010-08-04  Adam Roben  <aroben@apple.com>
3737
3738         Windows build fix
3739
3740         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
3741         (WebKit::NPN_SetValue): Added some case statements that are compiled
3742         on Windows to avoid a warning about having default but not cases.
3743
3744 2010-08-04  Adam Roben  <aroben@apple.com>
3745
3746         Windows build fix
3747
3748         * win/WebKit2.vcproj: Added NetscapeBrowserFuncs.
3749
3750 2010-08-04  Adam Roben  <aroben@apple.com>
3751
3752         Windows build fix
3753
3754         The functions in NetscapePluginModuleWin.cpp have been moved to
3755         NetscapePluginModule.cpp.
3756
3757         * WebProcess/Plugins/Netscape/win/NetscapePluginModuleWin.cpp: Removed.
3758         * win/WebKit2.vcproj: Removed NetscapePluginModuleWin.
3759
3760 2010-08-04  Adam Roben  <aroben@apple.com>
3761
3762         Move bundle-loading code from NetscapePluginModule to a new Module
3763         class
3764
3765         This allows more NetscapePluginModule code to be cross-platform.
3766
3767         Fixes <http://webkit.org/b/43497> NetscapePluginModule::try/unload
3768         should be cross-platform
3769
3770         Reviewed by Anders Carlsson.
3771
3772         * Platform/Module.cpp: Added.
3773         (WebKit::Module::Module): Store our path.
3774         (WebKit::Module::~Module): Unload our native module.
3775
3776         * Platform/Module.h: Added.
3777         (WebKit::Module::leakBundle): Does what it says.
3778         (WebKit::Module::functionPointer): Returns a pointer to the named
3779         function, with the right type.
3780
3781         * Platform/mac/ModuleMac.mm: Added.
3782         (WebKit::Module::load): Code was moved here from
3783         NetscapePluginModule::tryLoad.
3784         (WebKit::Module::unload): Just clears our bundle.
3785         (WebKit::Module::platformFunctionPointer): Code was moved here from
3786         NetscapePluginModuleMac.cpp.
3787
3788         * Platform/qt/ModuleQt.cpp: Added.
3789         (WebKit::Module::load):
3790         (WebKit::Module::unload):
3791         (WebKit::Module::platformFunctionPointer):
3792         * Platform/win/ModuleWin.cpp: Added.
3793         (WebKit::Module::load):
3794         (WebKit::Module::unload):
3795         (WebKit::Module::platformFunctionPointer):
3796         Just stubbed out these functions.
3797
3798         * WebKit2.xcodeproj/project.pbxproj: Added Module.
3799
3800         * WebProcess/Plugins/Netscape/NetscapePluginModule.cpp:
3801         (WebKit::NetscapePluginModule::tryLoad):
3802         (WebKit::NetscapePluginModule::unload):
3803         Moved here from NetscapePluginModuleMac.cpp. Now uses the
3804         cross-platform m_module member.
3805
3806         * WebProcess/Plugins/Netscape/NetscapePluginModule.h: Replaced
3807         m_bundle with m_module.
3808
3809         * WebProcess/Plugins/Netscape/mac/NetscapePluginModuleMac.cpp: Removed.
3810
3811         * win/WebKit2.vcproj: Added Module.
3812
3813 2010-08-04  Brady Eidson  <beidson@apple.com>
3814
3815         Reviewed by Sam Weinig.
3816
3817         Lay the groundwork for saving/restoring page session state to WK2
3818         https://bugs.webkit.org/show_bug.cgi?id=43495
3819
3820         * WebKit2.xcodeproj/project.pbxproj:
3821         * win/WebKit2.vcproj:
3822
3823         * Shared/APIObject.h:
3824         (WebKit::APIObject::):
3825         * UIProcess/API/C/WKAPICast.h:
3826         * UIProcess/API/C/WKBase.h:
3827         
3828         Arbitrary byte buffer:
3829         * Shared/WebData.h: Added.
3830         (WebKit::WebData::create):
3831         (WebKit::WebData::bytes):
3832         (WebKit::WebData::size):
3833         (WebKit::WebData::WebData):
3834         (WebKit::WebData::type):
3835         
3836         API facing object to act as a byte buffer:
3837         * UIProcess/API/C/WKData.cpp: Added.
3838         (WKDataGetTypeID):
3839         (WKDataCreate):
3840         (WKDataGetBytes):
3841         (WKDataGetSize):
3842         (WKDataRetain):
3843         (WKDataRelease):
3844         * UIProcess/API/C/WKData.h: Added.
3845
3846         API for saving/restoring state:
3847         * UIProcess/API/C/WKPage.cpp:
3848         (WKPageCopySessionState):
3849         (WKPageRestoreFromSessionState):
3850         * UIProcess/API/C/WKPage.h:
3851
3852         These will be filled in later:
3853         * UIProcess/WebPageProxy.cpp:
3854         (WebKit::WebPageProxy::sessionState):
3855         (WebKit::WebPageProxy::restoreFromSessionState):
3856         * UIProcess/WebPageProxy.h:
3857
3858
3859 2010-08-04  Sam Weinig  <sam@webkit.org>
3860
3861         Reviewed by Anders Carlsson.
3862
3863         Set correct default minimumFontSize.
3864
3865         * Shared/WebPreferencesStore.cpp:
3866         (WebKit::WebPreferencesStore::WebPreferencesStore):
3867
3868 2010-08-03  Adam Roben  <aroben@apple.com>
3869
3870         Turn on PLATFORM_STRATEGIES on Windows
3871
3872         Fixes <http://webkit.org/b/43431>.
3873
3874         Reviewed by Anders Carlsson.
3875
3876         * win/WebKit2.vcproj: Added WebPlatformStrategies. Also let VS reorder
3877         this file as it saw fit.
3878
3879 2010-08-03  Balazs Kelemen  <kb@inf.u-szeged.hu>
3880
3881         Reviewed by Kenneth Rohde Christiansen.
3882
3883         [Qt] Close the WebProcess
3884
3885         https://bugs.webkit.org/show_bug.cgi?id=41690
3886
3887         * Platform/CoreIPC/qt/ConnectionQt.cpp:
3888         (CoreIPC::Connection::open): Registered connectionDidClose to be called when the client disconnected.
3889         * Platform/qt/RunLoopQt.cpp:
3890         (RunLoop::stop): Implemented by calling QCoreApplication::exit.
3891
3892 2010-08-03  Jon Honeycutt  <jhoneycutt@apple.com>
3893
3894         WebKitTestRunner needs to activate the Mac font ascent hack
3895         https://bugs.webkit.org/show_bug.cgi?id=43404
3896
3897         Reviewed by Darin Adler.
3898
3899         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
3900         (WKBundleActivateMacFontAscentHack):
3901         Get the InjectedBundle, and calls its activateMacFontAscentHack().
3902
3903         * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
3904         Declare WKBundleActivateMacFontAscentHack().
3905
3906         * WebProcess/InjectedBundle/InjectedBundle.h:
3907         Declare activateMacFontAscentHack().
3908
3909         * WebProcess/InjectedBundle/mac/InjectedBundleMac.cpp:
3910         (WebKit::InjectedBundle::activateMacFontAscentHack):
3911         Stubbed.
3912
3913         * WebProcess/InjectedBundle/qt/InjectedBundleQt.cpp:
3914         (WebKit::InjectedBundle::activateMacFontAscentHack):
3915         Stubbed.
3916
3917         * WebProcess/InjectedBundle/win/InjectedBundleWin.cpp:
3918         (WebKit::InjectedBundle::activateMacFontAscentHack):
3919         Activate the ascent hack.
3920
3921 2010-08-03  Simon Fraser  <simon.fraser@apple.com>
3922
3923         Fix typo in typo fix.
3924
3925         * Shared/DrawingAreaBase.h:
3926         (WebKit::DrawingAreaBase::DrawingAreaInfo::DrawingAreaInfo):
3927         (WebKit::DrawingAreaBase::DrawingAreaBase):
3928
3929 2010-08-03  Simon Fraser  <simon.fraser@apple.com>
3930
3931         Fix typo in previous commit.
3932
3933         * Shared/DrawingAreaBase.h:
3934         (WebKit::DrawingAreaBase::DrawingAreaInfo::DrawingAreaInfo):
3935         (WebKit::DrawingAreaBase::DrawingAreaBase):
3936
3937 2010-08-03  Simon Fraser  <simon.fraser@apple.com>
3938
3939         Reviewed by Anders Carlsson.
3940
3941         Compositing iframe layout test crashes in WebKit2
3942         https://bugs.webkit.org/show_bug.cgi?id=42860
3943         
3944         Fix assertion caused by a DrawingArea handling a message that was targetted at an older DrawingArea
3945         that it has replaced.
3946         
3947         This was done by assigning a unique ID to each DrawingAreaProxy that gets created, and passing
3948         this ID, along with the type, to the WebProcess via an encoded DrawingAreaInfo. Each message
3949         also includes this ID. Messages with an ID that doesn't match that of the current DrawingArea are ignored.
3950         
3951         Refactored some common code and data into a DrawingAreaBase class which is shared, and adding
3952         encode/decode of DrawingAreaInfo.
3953
3954         * Shared/DrawingAreaBase.cpp: Added.
3955         (WebKit::DrawingAreaBase::encode):
3956         (WebKit::DrawingAreaBase::decode):
3957         * Shared/DrawingAreaBase.h: Added.
3958         (WebKit::DrawingAreaBase::):
3959         (WebKit::DrawingAreaBase::~DrawingAreaBase):
3960         (WebKit::DrawingAreaBase::type):
3961         (WebKit::DrawingAreaBase::id):
3962         (WebKit::DrawingAreaBase::DrawingAreaInfo::DrawingAreaInfo):
3963         (WebKit::DrawingAreaBase::DrawingAreaBase):
3964         (CoreIPC::):
3965         * UIProcess/ChunkedUpdateDrawingAreaProxy.cpp:
3966         (WebKit::ChunkedUpdateDrawingAreaProxy::setSize):
3967         (WebKit::ChunkedUpdateDrawingAreaProxy::setPageIsVisible):
3968         (WebKit::ChunkedUpdateDrawingAreaProxy::update):
3969         * UIProcess/DrawingAreaProxy.cpp:
3970         (WebKit::DrawingAreaProxy::DrawingAreaProxy):
3971         (WebKit::DrawingAreaProxy::nextDrawingAreaID):
3972         * UIProcess/DrawingAreaProxy.h:
3973         * UIProcess/LayerBackedDrawingAreaProxy.cpp:
3974         (WebKit::LayerBackedDrawingAreaProxy::setSize):
3975         (WebKit::LayerBackedDrawingAreaProxy::setPageIsVisible):
3976         (WebKit::LayerBackedDrawingAreaProxy::update):
3977         * UIProcess/LayerBackedDrawingAreaProxy.h:
3978         * UIProcess/WebPageProxy.cpp:
3979         (WebKit::WebPageProxy::didReceiveSyncMessage):
3980         * WebKit2.xcodeproj/project.pbxproj:
3981         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3982         (WebKit::WebChromeClient::createWindow):
3983         * WebProcess/WebPage/ChunkedUpdateDrawingArea.cpp:
3984         (WebKit::ChunkedUpdateDrawingArea::ChunkedUpdateDrawingArea):
3985         (WebKit::ChunkedUpdateDrawingArea::didReceiveMessage):
3986         * WebProcess/WebPage/ChunkedUpdateDrawingArea.h:
3987         * WebProcess/WebPage/DrawingArea.cpp:
3988         (WebKit::DrawingArea::create):
3989         (WebKit::DrawingArea::DrawingArea):
3990         * WebProcess/WebPage/DrawingArea.h:
3991         * WebProcess/WebPage/LayerBackedDrawingArea.cpp:
3992         (WebKit::LayerBackedDrawingArea::LayerBackedDrawingArea):
3993         (WebKit::LayerBackedDrawingArea::didReceiveMessage):
3994         * WebProcess/WebPage/LayerBackedDrawingArea.h:
3995         * WebProcess/WebPage/WebPage.cpp:
3996         (WebKit::WebPage::create):
3997         (WebKit::WebPage::WebPage):
3998         (WebKit::WebPage::changeAcceleratedCompositingMode):
3999         * WebProcess/WebPage/WebPage.h:
4000         * WebProcess/WebProcess.cpp:
4001         (WebKit::WebProcess::createWebPage):
4002         (WebKit::WebProcess::didReceiveMessage):
4003         * WebProcess/WebProcess.h:
4004         * win/WebKit2.vcproj:
4005
4006 2010-08-03  Alex Milowski  <alex@milowski.com>
4007
4008         Reviewed by Beth Dakin.
4009
4010         Changed the ENABLE_MATHML value to enable MathML by default.
4011
4012         * Configurations/FeatureDefines.xcconfig:
4013
4014 2010-08-03  Simon Fraser  <simon.fraser@apple.com>
4015
4016         Reviewed by Sam Weinig.
4017
4018         Compositing iframe layout test crashes in WebKit2
4019         https://bugs.webkit.org/show_bug.cgi?id=42860
4020         
4021         Part one of the fix: make DrawingArea ref-counted, so that the object
4022         can survide a swap in drawing areas inside the run loop observer callback.
4023
4024         * WebProcess/WebPage/DrawingArea.cpp:
4025         (WebKit::DrawingArea::create):
4026         * WebProcess/WebPage/DrawingArea.h:
4027         * WebProcess/WebPage/WebPage.h:
4028         * WebProcess/WebPage/mac/LayerBackedDrawingAreaMac.mm:
4029         (WebKit::LayerBackedDrawingArea::platformClear):
4030         (WebKit::LayerBackedDrawingArea::updateLayoutRunLoopObserverCallback):
4031         (WebKit::LayerBackedDrawingArea::updateLayoutRunLoopObserverFired):
4032
4033 2010-08-03  Anders Carlsson  <andersca@apple.com>
4034
4035         Reviewed by Adam Roben.
4036
4037         Frequent ASSERT_NOT_REACHED in Connection::processIncomingMessage when running regression tests
4038         https://bugs.webkit.org/show_bug.cgi?id=42926
4039         <rdar://problem/8237329>
4040
4041         Remove this assert, it's bogus. It would fire when a reply came in on the connection queue before 
4042         waitForReply was called on the client thread, but that case is already covered.
4043
4044         * Platform/CoreIPC/Connection.cpp:
4045         (CoreIPC::Connection::processIncomingMessage):
4046
4047 2010-08-03  Adam Roben  <aroben@apple.com>
4048
4049         Compile out two Mac-only localized strings on non-Mac platforms
4050
4051         Fixes <http://webkit.org/b/43433> copyImageUnknownFileLabel and
4052         AXARIAContentGroupText should only be compiled on Mac
4053
4054         Reviewed by Anders Carlsson.
4055
4056         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
4057         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
4058         Wrapped copyImageUnknownFileLabel and AXARIAContentGroupText in
4059         PLATFORM(MAC).
4060
4061 2010-08-03  Balazs Kelemen  <kb@inf.u-szeged.hu>
4062
4063         [Qt] Unreviewed typo fix in the WebKit2/DerivedSources.pro project file.
4064
4065         Use QMAKE_MKDIR as the command for directory creation.
4066
4067         * DerivedSources.pro:
4068
4069 2010-08-02  Brady Eidson  <beidson@apple.com>
4070
4071         Reviewed by Anders Carlsson.
4072
4073         Add VisitedLinkStrategy for each platform to implement
4074         https://bugs.webkit.org/show_bug.cgi?id=43393
4075
4076         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
4077         (WebKit::WebPlatformStrategies::createVisitedLinkStrategy):
4078         (WebKit::WebPlatformStrategies::isLinkVisited): Call back into PageGroup's visited links, for now.
4079         (WebKit::WebPlatformStrategies::addVisitedLink): Ditto.
4080         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
4081
4082 2010-07-27  Luiz Agostini  <luiz.agostini@openbossa.org>
4083
4084         Reviewed by Darin Fisher.
4085
4086         PopupMenu refactoring in preparation to WebKit2
4087         https://bugs.webkit.org/show_bug.cgi?id=42592
4088
4089         Classes WebPopupMenu and WebSearchPopupMenu inherit from PopupMenu and
4090         SearchPopupMenu respectively. At this point they are just empty implementations.
4091
4092         * WebProcess/WebCoreSupport/WebPopupMenu.cpp: Added.
4093         (WebKit::WebPopupMenu::WebPopupMenu):
4094         (WebKit::WebPopupMenu::~WebPopupMenu):
4095         (WebKit::WebPopupMenu::disconnectClient):
4096         (WebKit::WebPopupMenu::show):
4097         (WebKit::WebPopupMenu::hide):
4098         (WebKit::WebPopupMenu::updateFromElement):
4099         * WebProcess/WebCoreSupport/WebPopupMenu.h: Added.
4100         * WebProcess/WebCoreSupport/WebSearchPopupMenu.cpp: Added.
4101         (WebKit::WebSearchPopupMenu::WebSearchPopupMenu):
4102         (WebKit::WebSearchPopupMenu::popupMenu):
4103         (WebKit::WebSearchPopupMenu::saveRecentSearches):
4104         (WebKit::WebSearchPopupMenu::loadRecentSearches):
4105         (WebKit::WebSearchPopupMenu::enabled):
4106         * WebProcess/WebCoreSupport/WebSearchPopupMenu.h: Added.
4107
4108         As ChromeClient was made responsible for providing PopupMenu and SearchPopupMenu
4109         instances, concrete classes that inherit from ChromeClient needed to be changed to
4110         implement the new methods.
4111
4112         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
4113         (WebKit::WebChromeClient::selectItemWritingDirectionIsNatural):
4114         (WebKit::WebChromeClient::createPopupMenu):
4115         (WebKit::WebChromeClient::createSearchPopupMenu):
4116         * WebProcess/WebCoreSupport/WebChromeClient.h:
4117
4118         build issues:
4119
4120         * WebKit2.xcodeproj/project.pbxproj:
4121         * win/WebKit2.vcproj:
4122
4123 2010-08-02  Anders Carlsson  <andersca@apple.com>
4124
4125         Reviewed by Sam Weinig.
4126
4127         Fix plug-in test failures and remove tests from the Skipped list
4128         https://bugs.webkit.org/show_bug.cgi?id=43389
4129
4130         * WebProcess/Plugins/JSNPMethod.cpp:
4131         JSNPMethod::s_info should specify InternalFunction::info as its parent.
4132
4133         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
4134         (WebKit::NetscapePlugin::cancelStreamLoad):
4135         Special-case the manual stream and call PluginController::cancelManualStreamLoad.
4136
4137         * WebProcess/Plugins/Netscape/NetscapePluginStream.cpp:
4138         (WebKit::NetscapePluginStream::stop):
4139         It's OK to call stop on a stream that hasn't been started. Remove assertion and return early.
4140         
4141         * WebProcess/Plugins/PluginController.h:
4142         Add cancelManualStreamLoad.
4143
4144         * WebProcess/Plugins/PluginView.cpp:
4145         (WebKit::PluginView::cancelManualStreamLoad):
4146         Tell the document loader to cancel the main resource load.
4147
4148         * WebProcess/WebPage/WebFrame.cpp:
4149         (WebKit::WebFrame::innerText):
4150         Check for a null document element.
4151
4152 2010-08-02  Anders Carlsson  <andersca@apple.com>
4153
4154         Reviewed by Sam Weinig.
4155
4156         Add support for loading manual streams
4157         https://bugs.webkit.org/show_bug.cgi?id=43380
4158
4159         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
4160         (WebKit::NetscapePlugin::NetscapePlugin):
4161         Initialize m_loadManually to false.
4162
4163         (WebKit::NetscapePlugin::removePluginStream):
4164         Special case the manual stream.
4165
4166         (WebKit::NetscapePlugin::initialize):
4167         Don't request the stream if we're already loading.
4168
4169         (WebKit::NetscapePlugin::manualStreamDidReceiveResponse):
4170         Create the manual stream and pass the response to it.
4171
4172         (WebKit::NetscapePlugin::manualStreamDidReceiveData):
4173         Pass the data to the manual stream.
4174
4175         (WebKit::NetscapePlugin::manualStreamDidFinishLoading):
4176         Call the manual stream.
4177
4178         (WebKit::NetscapePlugin::manualStreamDidFail):
4179         Ditto.
4180
4181         * WebProcess/Plugins/Plugin.h:
4182         Add pure virtual member functions for manual stream loading.
4183
4184         * WebProcess/Plugins/PluginView.cpp:
4185         (WebKit::buildHTTPHeaders):
4186         Put code in a function so both PluginView::Stream::didReceiveResponse and 
4187         manualLoadDidReceiveResponse can call it.
4188
4189         (WebKit::PluginView::Stream::didReceiveResponse):
4190         Call buildHTTPHeaders.
4191
4192         (WebKit::PluginView::Stream::didFinishLoading):
4193         Protect the plug-in when calling destroyStream.
4194
4195         (WebKit::PluginView::manualLoadDidReceiveResponse):
4196         Call Plugin::manualStreamDidReceiveResponse.
4197
4198         (WebKit::PluginView::manualLoadDidReceiveData):
4199         Call Plugin::manualStreamDidReceiveData.
4200
4201         (WebKit::PluginView::manualLoadDidFinishLoading):
4202         Call Plugin::manualStreamDidFinishLoading.
4203
4204         (WebKit::PluginView::manualLoadDidFail):
4205         Call Plugin::manualStreamDidFail.
4206
4207         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
4208         (WebKit::WebFrameLoaderClient::WebFrameLoaderClient):
4209         Initialize m_hasSentResponseToPluginView to false.
4210
4211         (WebKit::WebFrameLoaderClient::setMainDocumentError):
4212         Call PluginView::manualLoadDidFail.
4213
4214         (WebKit::WebFrameLoaderClient::committedLoad):
4215         Call PluginView::manualLoadDidReceiveResponse.
4216
4217         (WebKit::WebFrameLoaderClient::finishedLoading):
4218         Call PluginView::manualLoadDidFinishLoading.
4219
4220         (WebKit::WebFrameLoaderClient::redirectDataToPlugin):
4221         Keep track of the plug-in view.
4222
4223 2010-08-02  Brady Eidson  <beidson@apple.com>
4224
4225         Reviewed by Anders Carlsson.
4226
4227         Basic WK2 visited link coloring
4228         https://bugs.webkit.org/show_bug.cgi?id=43377
4229
4230         Add simple API that allows the WK2 app to add 1 visited link at a time.
4231         For now, this just pipes each individual LinkHash down to WebCore.
4232         
4233         * Shared/CoreIPCSupport/WebProcessMessageKinds.h:
4234         (WebProcessMessage::):
4235
4236         * UIProcess/API/C/WKContext.cpp:
4237         (WKContextAddVisitedLink):
4238         * UIProcess/API/C/WKContext.h:
4239
4240         * UIProcess/WebContext.cpp:
4241         (WebKit::WebContext::addVisitedLink):
4242         * UIProcess/WebContext.h:
4243
4244         * WebProcess/WebProcess.cpp:
4245         (WebKit::WebProcess::addVisitedLinkHash):
4246         (WebKit::WebProcess::didReceiveMessage):
4247         * WebProcess/WebProcess.h:
4248
4249 2010-08-02  Darin Adler  <darin@apple.com>
4250
4251         Reviewed by Sam Weinig.
4252
4253         WebKitTestRunner needs layoutTestController.setCanOpenWindows
4254         https://bugs.webkit.org/show_bug.cgi?id=42321
4255
4256         WebKitTestRunner needs layoutTestController.setCloseRemainingWindowsWhenComplete
4257         https://bugs.webkit.org/show_bug.cgi?id=42779
4258
4259         Implemented window.close, added a function that does a similar operation on behalf
4260         of injected bundle code named WKBundlePageClose, and fixed the reference counting of
4261         the result of the createNewPage client function.
4262
4263         * UIProcess/API/cpp/WKRetainPtr.h: Added clear. Tweaked formatting. Renamed
4264         releaseRef to leakRef.
4265
4266         * UIProcess/API/mac/WKView.mm:
4267         (-[WKView _updateVisibility]): Handle the case where drawing area is 0. This
4268         came up in WebKitTestRunner and other functions handle drawing area of 0.
4269
4270         * UIProcess/WebPageProxy.cpp:
4271         (WebKit::WebPageProxy::didReceiveSyncMessage): Update now that createNewPage
4272         returns a PassRefPtr.
4273         (WebKit::WebPageProxy::createNewPage): Changed to return a PassRefPtr.
4274         * UIProcess/WebPageProxy.h: Ditto.
4275
4276         * UIProcess/WebUIClient.cpp:
4277         (WebKit::WebUIClient::createNewPage): Changed to return a PassRefPtr and adopt
4278         the WKPageRef passed from the client. This follows the "create rule".
4279         * UIProcess/WebUIClient.h: Ditto.
4280
4281         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
4282         (WKBundlePageClose): Added.
4283         * WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h: Added WKBundlePageClose
4284         and re-sorted the other functions in this file.
4285
4286         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
4287         (WebKit::WebChromeClient::closeWindowSoon): Implemented this.
4288
4289         * WebProcess/WebPage/WebPage.cpp:
4290         (WebKit::WebPage::WebPage): Called setJavaScriptCanOpenWindowsAutomatically(true).
4291         I suppose we will need to revisit this later when we implement pop-up blocking.
4292         (WebKit::WebPage::tryClose): Factored out the part of this that sends a message
4293         to the other process.
4294         (WebKit::WebPage::sendClose): This is where the part that sends a message went.
4295         * WebProcess/WebPage/WebPage.h: Added sendClose, used by both closeWindowSoon
4296         and WKBundlePageClose.
4297
4298 2010-08-02  John Sullivan  <sullivan@apple.com>
4299
4300         https://bugs.webkit.org/show_bug.cgi?id=43369
4301         WebBackForwardList::forwardListAsImmutableArrayWithLimit can return partly-uninitialized array
4302         
4303         Reviewed by Ada Chan.
4304
4305         * UIProcess/WebBackForwardList.cpp:
4306         (WebKit::WebBackForwardList::forwardListAsImmutableArrayWithLimit):
4307         Use a simpler and correct expression to determine "last".
4308
4309 2010-08-02  Anders Carlsson  <andersca@apple.com>
4310
4311         Reviewed by&