ad2c0de88c49b2a6ae93297981c7d6e4598e5ee7
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2011-03-29  Anders Carlsson  <andersca@apple.com>
2
3         Reviewed by Sam Weinig.
4
5         Allow the AppleConnect plug-in to use the QuickDraw drawing model
6         https://bugs.webkit.org/show_bug.cgi?id=57365
7         <rdar://problem/8712320>
8
9         * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
10         (WebKit::NetscapePluginModule::determineQuirks):
11         * Shared/Plugins/PluginQuirks.h:
12         * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
13         (WebKit::NetscapePlugin::platformPostInitialize):
14
15 2011-03-29  Darin Adler  <darin@apple.com>
16
17         Reviewed by Adam Roben.
18
19         WebKit2 bundle page needs to offer generated file hooks
20         https://bugs.webkit.org/show_bug.cgi?id=57279
21
22         * WebProcess/InjectedBundle/API/c/WKBundlePage.h: Added shouldGenerateFileForUpload and
23         generateFileForUpload callback pointers.
24
25         * WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp:
26         (WebKit::InjectedBundlePageUIClient::shouldGenerateFileForUpload): Added.
27         (WebKit::InjectedBundlePageUIClient::generateFileForUpload): Added.
28         * WebProcess/InjectedBundle/InjectedBundlePageUIClient.h: Added functions above.
29
30         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
31         (WebKit::WebChromeClient::shouldReplaceWithGeneratedFileForUpload): Implemented by
32         calling the functions above.
33         (WebKit::WebChromeClient::generateReplacementFile): Ditto.
34
35 2011-03-29  Anders Carlsson  <andersca@apple.com>
36
37         Reviewed by Darin Adler.
38
39         Assertion failure in plug-in process with clang-built 32/64-bit WebKit2
40         https://bugs.webkit.org/show_bug.cgi?id=57359
41
42         Don't use __alignof when encoding and decoding scalar types.
43         
44         Darwin 32-bit, double and unsigned long long are 4-byte aligned but on 64-bit they're
45         8-byte aligned which causes problems when doing IPC between 32-bit and 64-bit processes.
46         GCC is buggy and returns 8, but clang is correct and returns 4. Use sizeof instead which we know
47         is equal to or greater than the alignment.
48
49         * Platform/CoreIPC/ArgumentDecoder.cpp:
50         (CoreIPC::ArgumentDecoder::decodeBool):
51         (CoreIPC::ArgumentDecoder::decodeUInt32):
52         (CoreIPC::ArgumentDecoder::decodeUInt64):
53         (CoreIPC::ArgumentDecoder::decodeInt32):
54         (CoreIPC::ArgumentDecoder::decodeInt64):
55         (CoreIPC::ArgumentDecoder::decodeFloat):
56         (CoreIPC::ArgumentDecoder::decodeDouble):
57         * Platform/CoreIPC/ArgumentEncoder.cpp:
58         (CoreIPC::ArgumentEncoder::encodeBool):
59         (CoreIPC::ArgumentEncoder::encodeUInt32):
60         (CoreIPC::ArgumentEncoder::encodeUInt64):
61         (CoreIPC::ArgumentEncoder::encodeInt32):
62         (CoreIPC::ArgumentEncoder::encodeInt64):
63         (CoreIPC::ArgumentEncoder::encodeFloat):
64         (CoreIPC::ArgumentEncoder::encodeDouble):
65
66 2011-03-29  Brent Fulgham  <bfulgham@webkit.org>
67
68         Unreviewed build fix after r81928.
69
70         * win/WebKit2.vcproj: Don't build CG-specific icon routines
71         for WinCairo port.
72
73 2011-03-29  Sam Weinig  <sam@webkit.org>
74
75         Reviewed by Anders Carlsson.
76
77         Reproducible crash running under libgmalloc, in -[WKView(Internal) removeTrackingRect:] --&gt; objc_assign_ivar_non_gc
78         <rdar://problem/9193352>
79         https://bugs.webkit.org/show_bug.cgi?id=57358
80
81         -[WKView removeTrackingRect] can be called from below -[WKView dealloc] after we have
82         destroyed _data. So, nil out _data after releasing it and nil check it appropriately.
83         
84         * UIProcess/API/mac/WKView.mm:
85         (-[WKView dealloc]):
86         Nil out _data after releasing it.
87
88         (-[WKView removeTrackingRect:]):
89         Add early return for nil _data.
90
91 2011-03-29  Jeff Miller  <jeffm@apple.com>
92
93         Reviewed by Jon Honeycutt.
94
95         Add WebCore::copyCertificateToData() on Windows
96         https://bugs.webkit.org/show_bug.cgi?id=57296
97         
98         Remove duplicate code that implemented this functionality in WebCoreArgumentCodersWin.cpp and use WebCore::copyCertificateToData() instead. 
99
100         * Shared/win/WebCoreArgumentCodersWin.cpp:
101         (CoreIPC::decodeResourceError): Use WebCore::copyCertificateToData().
102
103 2011-03-29  Balazs Kelemen  <kbalazs@webkit.org>
104
105         Unreviewed build fix (64 bit gcc).
106
107         GCC does not accept uint64_t formatted as %lli.
108
109         * UIProcess/WebIconDatabase.cpp:
110         (WebKit::WebIconDatabase::getLoadDecisionForIconURL): Add explicit cast to long long.
111
112 2011-03-28  Maciej Stachowiak  <mjs@apple.com>
113
114         Reviewed by Dan Bernstein.
115
116         WKPageGetSourceForFrame and WKPageGetContentsAsString should throw an error in case of a race with page loading
117         https://bugs.webkit.org/show_bug.cgi?id=57305
118         <rdar://problem/8738060>, <rdar://problem/8780168>
119
120         * UIProcess/WebPageProxy.cpp:
121         (WebKit::WebPageProxy::close): Clear m_loadDependentStringCallbackIDs
122         (WebKit::WebPageProxy::getSourceForFrame): track the callback as load dependent
123         (WebKit::WebPageProxy::getContentsAsString): ditto
124         (WebKit::WebPageProxy::clearLoadDependentCallbacks): Invalidate all load dependent callbacks
125         (WebKit::WebPageProxy::didCommitLoadForFrame): Call clearLoadDependentCallbacks
126         (WebKit::WebPageProxy::didFailLoadForFrame): ditto
127         (WebKit::WebPageProxy::stringCallback): Remove callback from load dependent set if appropriate
128         (WebKit::WebPageProxy::processDidCrash): Clear m_loadDependentStringCallbackIDs
129         * UIProcess/WebPageProxy.h: Add m_loadDependentStringCallbackIDs hash set.
130
131 2011-03-28  Patrick Gansterer  <paroga@webkit.org>
132
133         Reviewed by Darin Adler.
134
135         Use String instead of CString as return value of openTemporaryFile
136         https://bugs.webkit.org/show_bug.cgi?id=55332
137
138         * Shared/WebMemorySampler.cpp:
139         (WebKit::WebMemorySampler::initializeTempLogFile):
140         * WebProcess/Plugins/Netscape/NetscapePluginStream.cpp:
141         (WebKit::NetscapePluginStream::stop):
142         * WebProcess/Plugins/Netscape/NetscapePluginStream.h:
143
144 2011-03-28  Brian Weinstein  <bweinstein@apple.com>
145
146         Reviewed by Jon Honeycutt.
147
148         WebKit2: Downloads started with DownloadCFNet::start never start
149         https://bugs.webkit.org/show_bug.cgi?id=57268
150
151         * WebProcess/Downloads/cfnet/DownloadCFNet.cpp:
152         (WebKit::Download::start): Call CFURLDownloadStart on the download we create.
153
154 2011-03-28  Anders Carlsson  <andersca@apple.com>
155
156         Fix Windows build.
157
158         * Shared/ShareableBitmap.h:
159
160 2011-03-28  Anders Carlsson  <andersca@apple.com>
161
162         Reviewed by Sam Weinig.
163
164         Beep when pressing a menu key equivalent when a plug-in has focus
165         https://bugs.webkit.org/show_bug.cgi?id=57264
166         <rdar://problem/8935597>
167
168         We don't want the WKTextInputWindowController inputContext to be involved in interpretKeyEvents.
169
170         * UIProcess/API/mac/WKView.mm:
171         (-[WKView inputContext]):
172
173 2011-03-28  Anders Carlsson  <andersca@apple.com>
174
175         Reviewed by Sam Weinig.
176
177         CGImageRefs must hold a strong reference to underlying data
178         https://bugs.webkit.org/show_bug.cgi?id=57263
179         <rdar://problem/9146179>
180
181         Make paintBitmapContext use CGBitmapContextCreateImage, which creates a copy-on-write copy
182         of the bitmap data. Also, add ShareableBitmap::makeCGImageCopy which does the same thing, and
183         ShareableBitmap::makeCGImage in the cases where we know that the ShareableBitmap data will never change.
184
185         * Platform/cg/CGUtilities.cpp:
186         (WebKit::paintImage):
187         Factor image painting code out into a separate function.
188
189         (WebKit::paintBitmapContext):
190         Call paintImage.
191
192         * Shared/API/c/cg/WKImageCG.cpp:
193         (WKImagemakeCGImage):
194         Use ShareableBitmap::makeCGImageCopy.
195
196         * Shared/ShareableBitmap.h:
197         * Shared/cg/ShareableBitmapCG.cpp:
198         (WebKit::ShareableBitmap::createGraphicsContext):
199         (WebKit::ShareableBitmap::paint):
200         (WebKit::ShareableBitmap::makeCGImageCopy):
201         (WebKit::ShareableBitmap::makeCGImage):
202         (WebKit::ShareableBitmap::releaseBitmapContextData):
203         (WebKit::ShareableBitmap::releaseDataProviderData):
204         Add makeCGImage and makeCGImageCopy.
205
206         * Shared/cg/WebCoreArgumentCodersCG.cpp:
207         (CoreIPC::createImage):
208         Use ShareableBitmap::makeCGImage.
209         
210         * UIProcess/API/mac/PageClientImpl.mm:
211         (WebKit::PageClientImpl::setDragImage):
212         Use ShareableBitmap::makeCGImage and plug a CGImageRef leak.
213
214 2011-03-28  Alexey Proskuryakov  <ap@apple.com>
215
216         Build fix.
217
218         * UIProcess/API/mac/WKView.mm: (-[WKView keyDown:]): It's not "event" in this function, it's
219         "theEvent".
220
221 2011-03-28  Alexey Proskuryakov  <ap@apple.com>
222
223         Reviewed by Darin Adler.
224
225         https://bugs.webkit.org/show_bug.cgi?id=57260
226         Clean up text input code a little
227
228         * UIProcess/API/mac/WKView.mm:
229         (-[WKView doCommandBySelector:]): This NSTextInput protocol method lacked a LOG() call.
230         (-[WKView keyDown:]): Added (possibly useless) event protection to match performKeyEquivalent:
231         and also WebKit1.
232
233         * WebProcess/WebPage/mac/WebPageMac.mm: Removed an obsolete comment.
234
235 2011-03-28  Jeff Miller  <jeffm@apple.com>
236
237         Reviewed by Adam Roben.
238
239         ResourceError::certificate() should return a PCCERT_CONTEXT
240         https://bugs.webkit.org/show_bug.cgi?id=57262
241
242         * Shared/win/PlatformCertificateInfo.cpp:
243         (WebKit::PlatformCertificateInfo::PlatformCertificateInfo): Don't assert if no PCCERT_CONTEXT is specified.
244         * Shared/win/WebCoreArgumentCodersWin.cpp:
245         (CoreIPC::encodeResourceError): Removed unneeded code now that ResourceError::certificate() returns a PCCERT_CONTEXT.
246
247 2011-03-28  Jeff Miller  <jeffm@apple.com>
248
249         Rubber-stamped by Adam Roben.
250
251         Remove unused CFErrorRef.
252
253         * Shared/win/WebCoreArgumentCodersWin.cpp:
254         (CoreIPC::encodeResourceError): Remove unused CFErrorRef.
255
256 2011-03-28  Jeff Miller  <jeffm@apple.com>
257
258         Reviewed by Adam Roben.
259
260         Include certificate when sending a WebCore::ResourceError to UI process on Windows
261         https://bugs.webkit.org/show_bug.cgi?id=57195
262         
263         Add support for sending the certificate with the WebCore::ResourceError.
264
265         * Shared/win/WebCoreArgumentCodersWin.cpp:
266         (CoreIPC::encodeResourceError): Encode certificate data.
267         (CoreIPC::deallocCertContext): Added.
268         (CoreIPC::createCertContextDeallocator): Added.
269         (CoreIPC::copyCert): Added.
270         (CoreIPC::decodeResourceError): Decode certificate data.
271
272 2011-03-27  Andy Estes  <aestes@apple.com>
273
274         Reviewed by Maciej Stachowiak.
275
276         Correctly get a plug-in's MIME type when it uses WebPluginMIMETypesFilename
277         https://bugs.webkit.org/show_bug.cgi?id=57205
278         
279         If the plug-in's Info.plist uses WebPluginMIMETypesFilename to specify
280         plug-in MIME types, WebKit has to check for a property list file in
281         ~/Library/Preferences for the MIME type dictionary.
282
283         * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
284         (WebKit::getMIMETypesFromPluginBundle): If the bundle's Info dictionary
285         has the key WebPluginMIMETypesFilename, open the property list
286         specified by that key's value and return the MIME type dictionary from
287         there. Otherwise, return the MIME type dictionary specified by the key
288         WebPluginMIMETypes.
289         (WebKit::getPluginInfoFromPropertyLists): Call
290         getMIMETypesFromPluginBundle().
291
292 2011-03-27  Jer Noble  <jer.noble@apple.com>
293
294         Reviewed by Maciej Stachowiak.
295
296         Full Screen: disable keyboard access by default
297         https://bugs.webkit.org/show_bug.cgi?id=56684
298
299         Take into account whether keyboard access was requested when deciding whether full
300         screen mode is supported.
301
302         * UIProcess/WebFullScreenManagerProxy.cpp:
303         (WebKit::WebFullScreenManagerProxy::supportsFullScreen):
304         * UIProcess/WebFullScreenManagerProxy.h:
305         * UIProcess/WebFullScreenManagerProxy.messages.in:
306         * WebProcess/FullScreen/WebFullScreenManager.cpp:
307         (WebKit::WebFullScreenManager::supportsFullScreen):
308         * WebProcess/FullScreen/WebFullScreenManager.h:
309         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
310         (WebKit::WebChromeClient::supportsFullScreenForElement):
311         * WebProcess/WebCoreSupport/WebChromeClient.h:
312
313 2011-03-27  Anders Carlsson  <andersca@apple.com>
314
315         Reviewed by Sam Weinig.
316
317         Dock doesn't come back after leaving fullscreen on Hulu
318         https://bugs.webkit.org/show_bug.cgi?id=57189
319         <rdar://problem/9192413>
320
321         Port some code over from the old WebKit1 plug-in host.
322
323         * PluginProcess/mac/PluginProcessShim.mm:
324         (WebKit::shimShowMenuBar):
325         (WebKit::shimHideMenuBar):
326         (WebKit::shimIsMenuBarVisible):
327
328 2011-03-27  Anders Carlsson  <andersca@apple.com>
329
330         Reviewed by Sam Weinig.
331
332         Keep a strong reference to the connection to avoid crashes.
333
334         * Platform/CoreIPC/Connection.cpp:
335
336 2011-03-26  Jeff Miller  <jeffm@apple.com>
337
338         Reviewed by Sam Weinig.
339
340         WKErrorCopyCFError() doesn't actually return a copy of the CFErrorRef
341         https://bugs.webkit.org/show_bug.cgi?id=57172
342
343         * Shared/API/c/cf/WKErrorCF.cpp:
344         (WKErrorCopyCFError): Use RetainPtr<> and leakRef() to return a real copy.
345
346 2011-03-26  Maciej Stachowiak  <mjs@apple.com>
347
348         Revert inadvertently commited changes.
349
350         * WebProcess/com.apple.WebProcess.sb:
351
352 2011-03-26  Jer Noble  <jer.noble@apple.com>
353
354         Reviewed by Eric Carlson.
355
356         Enable the Full Screen API by default in WebKit/mac and WebKit2
357         https://bugs.webkit.org/show_bug.cgi?id=56956
358
359         * Shared/WebPreferencesStore.h: Default the fullScreenEnabled preference to true.
360
361 2011-03-26  Jeff Miller  <jeffm@apple.com>
362
363         Reviewed by Steve Falkenburg.
364
365         Add PlatformCertificateInfo::PlatformCertificateInfo(PCCERT_CONTEXT) constructor on Windows
366         https://bugs.webkit.org/show_bug.cgi?id=57152
367         
368         We're going to need to create a PlatformCertificateInfo with a single certificate on Windows to support client certificates.
369         Also, stop relying on the fact that the Win32 API CertDuplicateCertificateContext() currently returns the same PCCERT_CONTEXT that you pass to it, since that may change in the future.
370
371         * Shared/win/PlatformCertificateInfo.cpp:
372         (WebKit::PlatformCertificateInfo::PlatformCertificateInfo): Added PlatformCertificateInfo(PCCERT_CONTEXT) construtor. Use return value from CertDuplicateCertificateContext().
373         (WebKit::PlatformCertificateInfo::operator=): Use return value from CertDuplicateCertificateContext().
374         * Shared/win/PlatformCertificateInfo.h: Added PlatformCertificateInfo(PCCERT_CONTEXT) construtor.
375
376 2011-03-26  Anders Carlsson  <andersca@apple.com>
377
378         Reviewed by Sam Weinig.
379
380         Graphic corruption appeared with Silverlight contents while resizing window
381         https://bugs.webkit.org/show_bug.cgi?id=57167
382         <rdar://problem/9094052>
383
384         Pass DispatchMessageEvenWhenWaitingForSyncReply when sending GeometryDidChange messages since that will guarantee
385         that those messages will be handled before PaintEntirePlugin messages which prevents the PaintEntirePlugin handler from
386         painting into the wrong backing store.
387
388         * WebProcess/Plugins/PluginProxy.cpp:
389         (WebKit::PluginProxy::geometryDidChange):
390
391 2011-03-26  Sam Weinig  <sam@webkit.org>
392
393         Reviewed by Anders Carlsson.
394
395         Web process considered unresponsive (SPOD shown) when displaying a JavaScript alert() as a result of a click
396         <rdar://problem/9067557>
397         https://bugs.webkit.org/show_bug.cgi?id=57166
398
399         * UIProcess/WebPageProxy.cpp:
400         (WebKit::WebPageProxy::runJavaScriptAlert):
401         (WebKit::WebPageProxy::runJavaScriptConfirm):
402         (WebKit::WebPageProxy::runJavaScriptPrompt):
403         Invalidate the responsiveness timer before calling out to the client.
404
405 2011-03-26  Anders Carlsson  <andersca@apple.com>
406
407         Reviewed by Sam Weinig.
408
409         ASSERTION FAILED: m_operationInProgress == NoOperation loading nytimes.com
410         https://bugs.webkit.org/show_bug.cgi?id=57165
411         <rdar://problem/9024311>
412
413         The assertion fired because during GC, the web process sends a synchronous NPObjectMessageReceiver::Deallocate
414         message to the plug-in process. Since this is a synchronous message, the web process needs to process incoming synchronous
415         messages. While waiting, we get an incoming PluginProxy::Evaluate message from the plug-in. This causes JavaScript to run
416         during GC which is very bad.
417
418         The fix for this is to add a flag on the connection that will cause synchronous messages sent by the connection (in this case the
419         plug-in process) to not be processed while the other side (the web process) is waiting for a synchronous reply _unless_ the connection
420         is actually processing a synchronous message. (The last part is to avoid deadlocks).
421
422         Since the call to NPN_Evaluate by the plug-in (that ends up sending the PluginProxy::Evaluate message) comes from a run loop timer firing,
423         it's OK to wait for it to be processed by the web process when it returns to the run loop.
424
425         * Platform/CoreIPC/Connection.cpp:
426         (CoreIPC::Connection::Connection):
427         Initialize m_onlySendMessagesAsDispatchWhenWaitingForSyncReplyWhenProcessingSuchAMessage and m_inDispatchMessageMarkedDispatchWhenWaitingForSyncReplyCount.
428
429         (CoreIPC::Connection::setOnlySendMessagesAsDispatchWhenWaitingForSyncReplyWhenProcessingSuchAMessage):
430         Set m_onlySendMessagesAsDispatchWhenWaitingForSyncReplyWhenProcessingSuchAMessage.
431
432         (CoreIPC::Connection::sendMessage):
433         Don't add the MessageID::DispatchMessageWhenWaitingForSyncReply flag when the right flags has been set on the connection, and it's not processing a synchronous message.
434
435         (CoreIPC::Connection::dispatchMessage):
436         Increment and decrement m_inDispatchMessageMarkedDispatchWhenWaitingForSyncReplyCount accordingly.
437
438         * PluginProcess/WebProcessConnection.cpp:
439         (WebKit::WebProcessConnection::WebProcessConnection):
440         Call setOnlySendMessagesAsDispatchWhenWaitingForSyncReplyWhenProcessingSuchAMessage on the connection.
441
442 2011-03-26  Sam Weinig  <sam@webkit.org>
443
444         Rollout r82042 (If a user doesn't have a Database/LocalStorage directory, it can't be created (sandbox violations))
445
446         -[NSString stringByResolvingSymlinksInPath] does not do what we needed for paths within /private.
447         This caused all SSL sites to stop working.
448
449         * WebProcess/mac/WebProcessMac.mm:
450         (WebKit::appendSandboxParameterPath):
451         (WebKit::initializeSandbox):
452
453 2011-03-26  Sam Weinig  <sam@webkit.org>
454
455         Reviewed by Anders Carlsson.
456
457         If a user doesn't have a Database/LocalStorage directory, it can't be created (sandbox violations)
458         <rdar://problem/9127411>
459         https://bugs.webkit.org/show_bug.cgi?id=57164
460
461         * WebProcess/mac/WebProcessMac.mm:
462         (WebKit::appendSandboxParameterPath):
463         (WebKit::initializeSandbox):
464         Use -[NSString stringByResolvingSymlinksInPath] instead of realpath to ensure we can resolve
465         symlinks even if the file/directory doesn't exist yet.
466
467 2011-03-26  Anders Carlsson  <andersca@apple.com>
468
469         Reviewed by Sam Weinig.
470
471         Factor processing of incoming sync replies out into processIncomingSyncReply
472         https://bugs.webkit.org/show_bug.cgi?id=57161
473
474         * Platform/CoreIPC/Connection.cpp:
475         (CoreIPC::Connection::sendSyncMessage):
476         Pass DispatchMessageEvenWhenWaitingForSyncReply to sendMessage.
477
478         (CoreIPC::Connection::processIncomingSyncReply):
479         Move code from processIncomingMessage to here.
480
481         (CoreIPC::Connection::processIncomingMessage):
482         Call processIncomingSyncReply.
483
484 2011-03-26  Sam Weinig  <sam@webkit.org>
485
486         Reviewed by Anders Carlsson.
487
488         WebKit2: Assert in CoreIPC::typeFromCFTypeRef() when loading a site with an invalid certificate
489         <rdar://problem/9188041>
490         https://bugs.webkit.org/show_bug.cgi?id=57159
491
492         * Shared/cf/ArgumentCodersCF.cpp:
493         (CoreIPC::typeFromCFTypeRef):
494         (CoreIPC::encode):
495         (CoreIPC::decode):
496         * Shared/cf/ArgumentCodersCF.h:
497         Add encoding/decoding for SecCertificateRef type.
498
499         * Shared/mac/PlatformCertificateInfo.mm:
500         (WebKit::PlatformCertificateInfo::encode):
501         (WebKit::PlatformCertificateInfo::decode):
502         Use ArgumentCodersCF now that it knows how to encode/decode SecCertificateRefs.
503
504 2011-03-26  Anders Carlsson  <andersca@apple.com>
505
506         Reviewed by Sam Weinig.
507
508         Handle synchronous replies coming in out of order
509         https://bugs.webkit.org/show_bug.cgi?id=57158
510
511         When processing an incoming reply, don't assume that it belongs to the last sent synchronous request.
512         Instead, iterate over the m_pendingSyncReplies vector backwards looking for the corresponding request.
513
514         * Platform/CoreIPC/Connection.cpp:
515         (CoreIPC::Connection::processIncomingMessage):
516
517 2011-03-26  Anders Carlsson  <andersca@apple.com>
518
519         Reviewed by Sam Weinig.
520
521         Fix a possible deadlock when two synchronous messages are sent at the same time
522         https://bugs.webkit.org/show_bug.cgi?id=57155
523
524         Simplify code and fix a possible (although highly improbable) dead lock.
525
526         * Platform/CoreIPC/Connection.cpp:
527         Make SyncMessageState atomically ref counted since it can be ref()'ed from the connection queue.
528         Get rid of m_waitForSyncReplyCount and add m_didScheduleDispatchMessagesWork.
529
530         (CoreIPC::Connection::SyncMessageState::SyncMessageState):
531         Initialize m_didScheduleDispatchMessagesWork to false.
532
533         (CoreIPC::Connection::SyncMessageState::processIncomingMessage):
534         if m_didScheduleDispatchMessagesWork is false, schedule a call to dispatchMessageAndResetDidScheduleDispatchMessagesWork
535         on the client run loop.
536
537         (CoreIPC::Connection::SyncMessageState::dispatchMessageAndResetDidScheduleDispatchMessagesWork):
538         Dispatch messages and set m_didScheduleDispatchMessagesWork back to false.
539
540         (CoreIPC::Connection::sendSyncMessage):
541         Remove calls to beginWaitForSyncReply and endWaitForSyncReply.
542
543 2011-03-25  Sam Weinig  <sam@webkit.org>
544
545         Reviewed by Adele Peterson.
546
547         WKPageLoadAlternateHTMLString doesn't re-spawn a dead WebProcess, but should
548         <rdar://problem/9191493>
549         https://bugs.webkit.org/show_bug.cgi?id=57134
550
551         Make all load functions respawn a dead WebProcess for consistency.
552
553         * UIProcess/WebPageProxy.cpp:
554         (WebKit::WebPageProxy::loadHTMLString):
555         Respawn a dead WebProcess.
556
557         (WebKit::WebPageProxy::loadAlternateHTMLString):
558         Respawn a dead WebProcess.
559
560         (WebKit::WebPageProxy::loadPlainTextString):
561         Respawn a dead WebProcess.
562
563         (WebKit::WebPageProxy::didStartProvisionalLoadForFrame):
564         * UIProcess/WebPageProxy.h:
565         * UIProcess/WebPageProxy.messages.in:
566         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
567         (WebKit::WebFrameLoaderClient::dispatchDidStartProvisionalLoad):
568         * WebProcess/WebPage/WebPage.cpp:
569         (WebKit::WebPage::loadAlternateHTMLString):
570         Since we may no longer always have a main frame when calling WKPageLoadAlternateHTMLString,
571         set the unreachable URL, if there is one, on provisional load.
572
573 2011-03-25  Anders Carlsson  <andersca@apple.com>
574
575         Reviewed by Sam Weinig.
576
577         PluginView's call to invalidateContentsAndWindow() in invalidateRect() is wrong for plug-ins which paint into compositing layers
578         https://bugs.webkit.org/show_bug.cgi?id=57133
579         <rdar://problem/9029442>
580
581         * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
582         (WebKit::NetscapePlugin::platformInvalidate):
583         Return true under the Core Animation drawing model, since that prevents the plug-in from calling PluginController::invalidate.
584
585         * WebProcess/Plugins/PluginView.cpp:
586         (WebKit::PluginView::invalidateRect):
587         Don't call invalidateContentsAndWindow() if the plug-in has a Core Animation layer.
588
589 2011-03-25  Brady Eidson  <beidson@apple.com>
590
591         Reviewed by Sam Weinig.
592
593         <rdar://problem/8648311> and https://bugs.webkit.org/show_bug.cgi?id=56425
594         WebKit2 IconDatabase and API
595
596         This gets a basic, usable API in place.
597         Enhancements can come in other bugs as they're needed.
598
599         * UIProcess/API/C/WKIconDatabase.cpp:
600         (WKIconDatabaseRetainIconForURL):
601         (WKIconDatabaseReleaseIconForURL):
602         (WKIconDatabaseEnableDatabaseCleanup):
603         * UIProcess/API/C/WKIconDatabase.h:
604         
605         The first actual accessor for an "icon for a URL" is for a CGImageRef:
606         * UIProcess/API/C/cg: Added.
607         * UIProcess/API/C/cg/WKIconDatabaseCG.cpp: Added.
608         (WKIconDatabaseGetCGImageForURL):
609         * UIProcess/API/C/cg/WKIconDatabaseCG.h: Added.
610         
611         Expose relevant methods to support the above API:
612         * UIProcess/WebIconDatabase.cpp:
613         (WebKit::WebIconDatabase::WebIconDatabase): New IconDatabases will have cleanup disabled from the start,
614           and require a single call to "enableDatabaseCleanup" to allow cleanup.
615         (WebKit::WebIconDatabase::setDatabasePath):
616         (WebKit::WebIconDatabase::enableDatabaseCleanup):
617         (WebKit::WebIconDatabase::imageForPageURL):
618         * UIProcess/WebIconDatabase.h:
619         
620         Project file stuff:
621         * WebKit2.xcodeproj/project.pbxproj:
622         * win/WebKit2.vcproj:
623
624 2011-03-25  Jeff Miller  <jeffm@apple.com>
625
626         Reviewed by Darin Adler.
627
628         Add CoreIPC::encodeResourceError() and CoreIPC::decodeResourceError() for all platforms
629         https://bugs.webkit.org/show_bug.cgi?id=57125
630         
631         Currently, these are only implemented on the Mac, but we're going to need them for Windows as well, so we might as well make them always platform-specific.
632         In this patch, just replicate the existing common non-Mac implementation in WebCoreArgumentCoders.h to platform-specific files.
633
634         * Shared/WebCoreArgumentCoders.h: Move non-Mac implementations of encodeResourceError() and decodeResourceError() to common files.
635         * Shared/gtk/WebCoreArgumentCodersGtk.cpp:
636         (CoreIPC::encodeResourceError): Added.
637         (CoreIPC::decodeResourceError): Added.
638         * Shared/qt/WebCoreArgumentCodersQt.cpp:
639         (CoreIPC::encodeResourceError): Added.
640         (CoreIPC::decodeResourceError): Added.
641         * Shared/win/WebCoreArgumentCodersWin.cpp:
642         (CoreIPC::encodeResourceError): Added.
643         (CoreIPC::decodeResourceError): Added.
644
645 2011-03-25  Andy Estes  <aestes@apple.com>
646
647         Reviewed by Adele Peterson.
648
649         REGRESSION (r70748): latest nightly builds kills AC_QuickTime.js
650         https://bugs.webkit.org/show_bug.cgi?id=49016
651
652         Update objectContentType() implementation to handle the
653         shouldPreferPlugInsForImages flag.
654
655         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
656         (WebKit::WebFrameLoaderClient::objectContentType):
657         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
658
659 2011-03-25  Brent Fulgham  <bfulgham@webkit.org>
660
661         Unreviewed build correction.
662
663         Add stubs for WK2 cookie handling with cURL.
664
665         * WebProcess/Cookies/curl: Added.
666         * WebProcess/Cookies/curl/WebCookieManagerCurl.cpp: Added.
667         (WebKit::WebCookieManager::platformSetHTTPCookieAcceptPolicy):
668         (WebKit::WebCookieManager::platformGetHTTPCookieAcceptPolicy):
669         * win/WebKit2.vcproj:
670
671 2011-03-25  Steve Falkenburg  <sfalken@apple.com>
672
673         Reviewed by Brian Weinstein.
674
675         Microsoft Windows Presentation Foundation (WPF) plug-in complains about missing xpcom.dll
676         https://bugs.webkit.org/show_bug.cgi?id=57119
677         <rdar://problem/9054148>
678
679         This plug-in from Microsoft links against xpcom.dll, which is a Firefox-specific DLL
680         not available in WebKit. The plug-in is fairly widespread, since it was included in
681         a Windows Update push at one point.
682
683         * UIProcess/Plugins/win/PluginInfoStoreWin.cpp:
684         (WebKit::PluginInfoStore::shouldUsePlugin): Blacklist npwpf.dll.
685
686 2011-03-25  Jessie Berlin  <jberlin@apple.com>
687
688         Reviewed by Anders Carlsson.
689
690         WebKit2: Need to be able to set and get the Cookie Storage Policy.
691         https://bugs.webkit.org/show_bug.cgi?id=50780
692
693         Part 2: Make it possible to set the initial policy on Windows.
694
695         In WebKit1, we read the initial policy on Windows from WebPreferences at startup.
696         Since that is not possible in WebKit2, make it possible to specify the initial policy
697         as a creation parameter to the WebProcess.
698
699         * Shared/WebProcessCreationParameters.cpp:
700         (WebKit::WebProcessCreationParameters::encode):
701         Encode initialHTTPCookieAcceptPolicy on Windows.
702         (WebKit::WebProcessCreationParameters::decode):
703         Decode initialHTTPCookieAcceptPolicy on Windows.
704         * Shared/WebProcessCreationParameters.h:
705
706         * UIProcess/API/C/win/WKContextPrivateWin.h:
707         * UIProcess/API/C/win/WKContextWin.cpp:
708         (WKContextSetInitialHTTPCookieAcceptPolicy):
709         Call through to WebContext.
710
711         * UIProcess/WebContext.cpp:
712         (WebKit::WebContext::WebContext):
713         Give the initial policy a default of "Always".
714         * UIProcess/WebContext.h:
715         (WebKit::WebContext::setInitialHTTPCookieAcceptPolicy):
716         * UIProcess/win/WebContextWin.cpp:
717         (WebKit::WebContext::platformInitializeWebProcess):
718         Set the initial policy on Windows.
719
720         * WebProcess/Cookies/WebCookieManager.h:
721         Make setHTTPCookieAcceptPolicy public so that it can be called from WebProcessWin.
722
723         * WebProcess/win/WebProcessWin.cpp:
724         (WebKit::WebProcess::platformInitializeWebProcess):
725         Tell the WebCookieManager about the initial policy.
726
727 2011-03-25  Jessie Berlin  <jberlin@apple.com>
728
729         Reviewed by Sam Weinig.
730
731         WebKit2: Need to be able to set and get the Cookie Storage Policy.
732         https://bugs.webkit.org/show_bug.cgi?id=50780
733
734         * Shared/HTTPCookieAcceptPolicy.h: Added.
735
736         * UIProcess/API/C/WKAPICast.h:
737         (WebKit::toHTTPCookieAcceptPolicy):
738         (WebKit::toAPI):
739
740         * UIProcess/API/C/WKCookieManager.cpp:
741         (WKCookieManagerSetHTTPCookieAcceptPolicy):
742         Call through to WebCookieManagerProxy.
743         (WKCookieManagerGetHTTPCookieAcceptPolicy):
744         Ditto.
745         * UIProcess/API/C/WKCookieManager.h:
746
747         * UIProcess/WebCookieManagerProxy.cpp:
748         (WebKit::WebCookieManagerProxy::invalidate):
749         Invalidate the get http cookie accept policy callbacks.
750         (WebKit::WebCookieManagerProxy::setHTTPCookieAcceptPolicy):
751         Send a message to the Web Process with the new value.
752         (WebKit::WebCookieManagerProxy::getHTTPCookieAcceptPolicy):
753         Keep track of the callback and send a message to the Web Process.
754         (WebKit::WebCookieManagerProxy::didGetHTTPCookieAcceptPolicy):
755         Invoke the callback.
756         * UIProcess/mac/WebCookieManagerProxyMac.mm: Added.
757         (WebKit::WebCookieManagerProxy::persistHTTPCookieAcceptPolicy):
758         On Mac, also set the policy in the UI Process because the sandboxed Web Process cannot
759         persist the policy.
760         * UIProcess/WebCookieManagerProxy.h:
761         * UIProcess/WebCookieManagerProxy.messages.in:
762
763         * WebKit2.pri:
764         * WebKit2.pro:
765         * WebKit2.xcodeproj/project.pbxproj:
766         * win/WebKit2.vcproj:
767         * win/WebKit2Common.vsprops:
768
769         * WebProcess/Cookies/WebCookieManager.cpp:
770         (WebKit::WebCookieManager::setHTTPCookieAcceptPolicy):
771         Call platformSetHTTPCookieAcceptPolicy.
772         (WebKit::WebCookieManager::getHTTPCookieAcceptPolicy):
773         Send the result of platformGetHTTPCookieAcceptPolicy to the UI Process.
774         * WebProcess/Cookies/WebCookieManager.h:
775         * WebProcess/Cookies/WebCookieManager.messages.in:
776
777         * WebProcess/Cookies/cf: Added.
778         * WebProcess/Cookies/cf/WebCookieManagerCFNet.cpp: Added.
779         (WebKit::WebCookieManager::platformSetHTTPCookieAcceptPolicy):
780         Set the policy on both the default cookie storage and any Private Browsing cookie storage.
781         (WebKit::WebCookieManager::platformGetHTTPCookieAcceptPolicy):
782         * WebProcess/Cookies/mac: Added.
783         * WebProcess/Cookies/mac/WebCookieManagerMac.mm: Added.
784         (WebKit::WebCookieManager::platformSetHTTPCookieAcceptPolicy):
785         Set the policy on the default cookie storage and add a FIXME to set it on any Private
786         Browsing cookie storage.
787         (WebKit::WebCookieManager::platformGetHTTPCookieAcceptPolicy):
788
789         * WebProcess/Cookies/gtk: Added.
790         * WebProcess/Cookies/gtk/WebCookieManagerGtk.cpp: Added.
791         (WebKit::WebCookieManager::platformSetHTTPCookieAcceptPolicy):
792         (WebKit::WebCookieManager::platformGetHTTPCookieAcceptPolicy):
793         * WebProcess/Cookies/qt: Added.
794         * WebProcess/Cookies/qt/WebCookieManagerQt.cpp: Added.
795         (WebKit::WebCookieManager::platformSetHTTPCookieAcceptPolicy):
796         (WebKit::WebCookieManager::platformGetHTTPCookieAcceptPolicy):
797
798 2011-03-25  Brian Weinstein  <bweinstein@apple.com>
799
800         Reviewed by Alexey Proskuryakov.
801
802         REGRESSION(r79227): CFURLCache not initialized correctly in WebKit2
803         https://bugs.webkit.org/show_bug.cgi?id=57109
804         <rdar://problem/9184590>
805         
806         Check for a trailing Windows path separator, not a Unix path separator.
807
808         * UIProcess/win/WebContextWin.cpp:
809         (WebKit::WebContext::platformInitializeWebProcess):
810
811 2011-03-25  Benjamin Poulain  <benjamin.poulain@nokia.com>
812
813         Reviewed by Andreas Kling.
814
815         [Qt] QtWebKit will not compile with QT_ASCII_CAST_WARNINGS enabled
816         https://bugs.webkit.org/show_bug.cgi?id=57087
817
818         Use explicit conversion for string to avoid depending on the default codec
819         installed by the user code.
820
821         * Platform/qt/SharedMemoryQt.cpp:
822         (WebKit::SharedMemory::create):
823         * Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp:
824         (WebKit::initializeGTK):
825         * UIProcess/API/qt/tests/qgraphicswkview/tst_qgraphicswkview.cpp:
826         (tst_QGraphicsWKView::loadEmptyPage):
827         (tst_QGraphicsWKView::loadEmptyUrl):
828         * UIProcess/API/qt/tests/qwkpage/tst_qwkpage.cpp:
829         (tst_QWKPage::loadEmptyUrl):
830         * UIProcess/Launcher/qt/ProcessLauncherQt.cpp:
831         (WebKit::ProcessLauncher::launchProcess):
832         * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:
833         (WebKit::getPluginDisplay):
834         * WebProcess/qt/WebProcessMainQt.cpp:
835         (WebKit::EnvHttpProxyFactory::initializeFromEnvironment):
836         (WebKit::WebProcessMainQt):
837
838 2011-03-25  Brent Fulgham  <bfulgham@webkit.org>
839
840         Correct project file missing $(WebKitVSPropsRedirectionDir)s
841         after r81924.
842
843         * win/WebKit2.vcproj: Restore lost $(WebKitVSPropsRedirectionDir)
844
845 2011-03-25  Alejandro G. Castro  <alex@igalia.com>
846
847         Reviewed by Martin Robinson.
848
849         [WK2] Consider .c files in the generate-forwarding-headers script
850         https://bugs.webkit.org/show_bug.cgi?id=56680
851
852         * Scripts/generate-forwarding-headers.pl:
853
854 2011-03-24  Sheriff Bot  <webkit.review.bot@gmail.com>
855
856         Unreviewed, rolling out r81916 and r81917.
857         http://trac.webkit.org/changeset/81916
858         http://trac.webkit.org/changeset/81917
859         https://bugs.webkit.org/show_bug.cgi?id=57071
860
861         broke a test on platforms that do not have QuickTime installed
862         (Requested by estes on #webkit).
863
864         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
865         (WebKit::WebFrameLoaderClient::objectContentType):
866         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
867
868 2011-03-24  Brady Eidson  <beidson@apple.com>
869
870         Reviewed by Darin Adler.
871
872         https://bugs.webkit.org/show_bug.cgi?id=57069
873         Add WKIconDatabase api to the project files, and expose accessor on WKContext.
874
875         Project file stuffs:
876         * GNUmakefile.am:
877         * WebKit2.xcodeproj/project.pbxproj:
878         * win/WebKit2.vcproj:
879
880         * Shared/API/c/WKBase.h:
881         * UIProcess/API/C/WKAPICast.h:
882
883         * UIProcess/API/C/WKContext.cpp:
884         (WKContextGetIconDatabase):
885         * UIProcess/API/C/WKContext.h:
886
887         * UIProcess/API/C/WKIconDatabase.cpp: Added.
888         (WKIconDatabaseGetTypeID):
889         * UIProcess/API/C/WKIconDatabase.h: Added.
890
891         * UIProcess/WebContext.h:
892         (WebKit::WebContext::iconDatabase):
893
894 2011-03-24  Brent Fulgham  <bfulgham@webkit.org>
895
896         Build correction.
897
898         Disable the CA Layer stuff when building with Cairo.
899
900         * win/WebKit2.vcproj:
901
902 2011-03-24  Brady Eidson  <beidson@apple.com>
903
904         Reviewed by Sam Weinig.
905
906         https://bugs.webkit.org/show_bug.cgi?id=57058
907         Hookup the UIProcess WebIconDatabase to a WebCore::IconDatabase as its implementation
908
909         * UIProcess/WebIconDatabase.cpp:
910         (WebKit::WebIconDatabase::WebIconDatabase):
911         (WebKit::WebIconDatabase::setDatabasePath): Create a new WebCore::IconDatabase and open it to this path.
912         (WebKit::WebIconDatabase::retainIconForPageURL): Actually retain the url, using the impl.
913         (WebKit::WebIconDatabase::releaseIconForPageURL): Actually release the url, using the impl.
914         (WebKit::WebIconDatabase::setIconURLForPageURL): Actually set the url, using the impl.
915         (WebKit::WebIconDatabase::setIconDataForIconURL): Actually set the data, using the impl.
916         (WebKit::WebIconDatabase::getLoadDecisionForIconURL): Actually ask for a load decision to call back with.
917         (WebKit::WebIconDatabase::performImport):
918         (WebKit::WebIconDatabase::didImportIconURLForPageURL):
919         (WebKit::WebIconDatabase::didImportIconDataForPageURL):
920         (WebKit::WebIconDatabase::didChangeIconForPageURL):
921         (WebKit::WebIconDatabase::didRemoveAllIcons):
922         (WebKit::WebIconDatabase::didFinishURLImport): Notify all the pending callbacks what their load decisions
923           are now that they're available.
924         * UIProcess/WebIconDatabase.h:
925
926         Add an IconDatabase logging channel:
927         * Platform/Logging.cpp:
928         (WebKit::initializeLogChannelsIfNecessary):
929         * Platform/Logging.h:
930
931         * UIProcess/WebContext.cpp:
932         (WebKit::WebContext::setIconDatabasePath): Pass the new path on to the WebIconDatabase, possibly
933           opening it.
934         * UIProcess/WebContext.h:
935
936 2011-03-24  Andy Estes  <aestes@apple.com>
937
938         Reviewed by Darin Adler.
939
940         REGRESSION (r70748): latest nightly builds kills AC_QuickTime.js
941         https://bugs.webkit.org/show_bug.cgi?id=49016
942
943         Update objectContentType() implementation to handle the
944         shouldPreferPlugInsForImages flag.
945
946         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
947         (WebKit::WebFrameLoaderClient::objectContentType):
948         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
949
950 2011-03-24  Adam Roben  <aroben@apple.com>
951
952         Start compiling LayerTreeHostCA on Windows
953
954         Fixes <http://webkit.org/b/57060> WebKit2.vcproj should compile LayerTreeHostCA
955
956         Reviewed by Anders Carlsson.
957
958         * WebProcess/WebPage/ca/win/LayerTreeHostCAWin.cpp: Added.
959         (WebKit::LayerTreeHostCA::platformInitialize):
960         (WebKit::LayerTreeHostCA::scheduleLayerFlush):
961         (WebKit::LayerTreeHostCA::platformInvalidate):
962         (WebKit::LayerTreeHostCA::platformSizeDidChange):
963         (WebKit::LayerTreeHostCA::platformForceRepaint):
964         (WebKit::LayerTreeHostCA::platformDidPerformScheduledLayerFlush):
965         Stubbed out.
966
967         * win/WebKit2.vcproj: Added new files. Let VS reorder existing files.
968
969         * win/WebKit2Apple.vsprops: Added WebProcess\WebPage\ca to the include path.
970
971 2011-03-24  Jer Noble  <jer.noble@apple.com>
972
973         Unreviewed build fix.
974
975         Remove reference to LayerTreeHostMac.h from WebFullScreenManagerMac.mm.
976
977         * WebProcess/FullScreen/mac/WebFullScreenManagerMac.mm:
978
979 2011-03-24  Adam Roben  <aroben@apple.com>
980
981         Split Mac-specific parts of LayerTreeHostCA into LayerTreeHostCAMac.mm
982
983         Fixes <http://webkit.org/b/57046> LayerTreeHostMac's code should be shareable with Windows
984
985         Reviewed by Anders Carlsson.
986
987         * WebKit2.xcodeproj/project.pbxproj:
988
989         * WebProcess/WebPage/ca/LayerTreeHostCA.cpp: Renamed from Source/WebKit2/WebProcess/WebPage/ca/LayerTreeHostCA.mm.
990         (WebKit::LayerTreeHostCA::LayerTreeHostCA): Moved some Mac-specific code to
991         LayerTreeHostCAMac.mm.
992         (WebKit::LayerTreeHostCA::~LayerTreeHostCA): Wrapped some Mac-specific code in
993         PLATFORM(MAC).
994
995         (WebKit::LayerTreeHostCA::invalidate):
996         (WebKit::LayerTreeHostCA::sizeDidChange):
997         (WebKit::LayerTreeHostCA::forceRepaint):
998         Moved some Mac-specific code to LayerTreeHostCAMac.mm.
999
1000         (WebKit::LayerTreeHostCA::performScheduledLayerFlush): Renamed from
1001         flushPendingLayerChangesRunLoopObserverCallback. Moved some code from here...
1002         (WebKit::LayerTreeHostCA::didPerformScheduledLayerFlush): ...to here. Moved some
1003         Mac-specific code to LayerTreeHostCAMac.mm.
1004
1005         * WebProcess/WebPage/ca/LayerTreeHostCA.h: Added new functions, wrapped some Mac-specific
1006         declarations in PLATFORM(MAC).
1007
1008         * WebProcess/WebPage/ca/mac/LayerTreeHostCAMac.mm: Added.
1009         (WebKit::LayerTreeHostCA::platformInitialize):
1010         (WebKit::LayerTreeHostCA::scheduleLayerFlush):
1011         (WebKit::LayerTreeHostCA::platformInvalidate):
1012         (WebKit::LayerTreeHostCA::platformSizeDidChange):
1013         (WebKit::LayerTreeHostCA::platformForceRepaint):
1014         (WebKit::LayerTreeHostCA::flushPendingLayerChangesRunLoopObserverCallback):
1015         (WebKit::LayerTreeHostCA::platformDidPerformScheduledLayerFlush):
1016         Code was extracted from LayerTreeHostCA.cpp.
1017
1018 2011-03-24  Adam Roben  <aroben@apple.com>
1019
1020         Rename LayerTreeHostMac to LayerTreeHostCA
1021
1022         This is the first step toward sharing code with Windows.
1023
1024         Fixes <http://webkit.org/b/57051>.
1025
1026         Reviewed by Anders Carlsson.
1027
1028         * WebKit2.xcodeproj/project.pbxproj:
1029         * WebProcess/WebPage/LayerTreeHost.cpp:
1030         (WebKit::LayerTreeHost::create):
1031         Updated for rename.
1032
1033         * WebProcess/WebPage/ca/LayerTreeHostCA.h: Renamed from Source/WebKit2/WebProcess/WebPage/mac/LayerTreeHostMac.h.
1034         * WebProcess/WebPage/ca/LayerTreeHostCA.mm: Renamed from Source/WebKit2/WebProcess/WebPage/mac/LayerTreeHostMac.mm.
1035
1036 2011-03-17  Jer Noble  <jer.noble@apple.com>
1037
1038         Reviewed by Maciej Stachowiak.
1039
1040         WebKit2: Cancelling full screen early leaves full screen window up.
1041         https://bugs.webkit.org/show_bug.cgi?id=56589
1042
1043         No new tests, as WebKitTestRunner does not currently support the new Full Screen API.
1044
1045         Notify the UIProcess when it needs to tear down its layer hosting view, turn off
1046         the background layer when not in accelerated rendering mode and don't swap out 
1047         the web view unnecessarily 
1048
1049         * UIProcess/mac/WKFullScreenWindowController.mm:
1050         (-[WKFullScreenWindowController beganExitFullScreenAnimation]): Check before swapping _webView.
1051         (-[WKFullScreenWindowController enterAcceleratedCompositingMode:]): Add the _layerHostingView
1052             to the full screen window's animationView, not its contentsView.
1053         (-[WKFullScreenWindowController exitAcceleratedCompositingMode]): Hide the background layer.
1054         * WebProcess/FullScreen/mac/WebFullScreenManagerMac.mm:
1055         (WebKit::WebFullScreenManagerMac::setRootFullScreenLayer): If given a null rootLayer, tell
1056             the client to exit accelerated mode.
1057
1058 2011-03-24  Enrica Casucci  <enrica@apple.com>
1059
1060         Reviewed by Alexey Proskuryakov.
1061
1062         WebKit2:Services menu item to convert selected Simplified/Traditional Chinese Text is not working.
1063         https://bugs.webkit.org/show_bug.cgi?id=56975
1064         <rdar://problem/8915066>
1065         
1066         Adding missing entry point to support Mac OS X services in WebKit2.
1067
1068         * UIProcess/API/mac/WKView.mm:
1069         (-[WKView readSelectionFromPasteboard:]): Added.
1070         * UIProcess/WebPageProxy.h:
1071         * UIProcess/mac/WebPageProxyMac.mm:
1072         (WebKit::WebPageProxy::readSelectionFromPasteboard): Added.
1073         * WebProcess/WebPage/WebPage.h:
1074         * WebProcess/WebPage/WebPage.messages.in: Added synchronous
1075         message.
1076         * WebProcess/WebPage/mac/WebPageMac.mm:
1077         (WebKit::WebPage::readSelectionFromPasteboard): Added.
1078
1079 2011-03-24  Jia Pu  <jpu@apple.com>
1080
1081         Reviewed by Darin Adler.
1082
1083         Dismissed reversion suggestion is incorrectly learned.
1084         https://bugs.webkit.org/show_bug.cgi?id=57039
1085
1086         CorrectionPanel should always use [NSSpellChecker dismissCorrectionBubbleForView].
1087         [NSSpellChecker cancelCorrectionBubbleForView] is reserved for situation where correction panel
1088         is dismissed explicitly by ESC key or clicking the dimiss button. Misusing these causes
1089         incorrect automatic learning.
1090
1091         * UIProcess/mac/CorrectionPanel.mm:
1092         (WebKit::CorrectionPanel::dismissInternal):
1093
1094 2011-03-24  Brian Weinstein  <bweinstein@apple.com>
1095
1096         Reviewed by Adam Roben.
1097
1098         WebKit2: Add Trackpoint driver hack to support IBM trackpads
1099         https://bugs.webkit.org/show_bug.cgi?id=49830
1100         <rdar://problem/8705951>
1101
1102         Copy code from WebKit1 to WebKit2 to handle initializing fake scrollbars so 
1103         IBM machines with a trackpad send us WM_VSCROLL and WM_HSCROLL messages.
1104
1105         Listen for the WM_VSCROLL and WM_HSCROLL messages, and turn the values into
1106         ScrollDirection and ScrollGranularity, and send a scroll command to the
1107         WebProcess.
1108
1109         * UIProcess/WebPageProxy.cpp:
1110         (WebKit::WebPageProxy::scrollBy): Send a message to the WebProcess.
1111         * UIProcess/WebPageProxy.h:
1112         * UIProcess/win/WebView.cpp:
1113         (WebKit::WebView::wndProc): Add WM_VSCROLL and WM_HSCROLL message handling.
1114         (WebKit::WebView::initialize): Call shouldInitializeTrackPointHack.
1115         (WebKit::WebView::onHorizontalScroll): Turn wParam into a ScrollDirection and ScrollGranularity. 
1116         (WebKit::WebView::onVerticalScroll): Ditto.
1117         (WebKit::WebView::shouldInitializeTrackPointHack): Check the registry for keys that indicate
1118             the machine has a IBM Trackpoint driver.
1119         * UIProcess/win/WebView.h:
1120         * WebProcess/WebPage/WebPage.cpp:
1121         (WebKit::WebPage::scrollBy): Call scroll method.
1122         (WebKit::WebPage::scroll): Moved from WebPageMac and WebPageWin.
1123         (WebKit::WebPage::logicalScroll): Ditto.
1124         * WebProcess/WebPage/WebPage.h:
1125         * WebProcess/WebPage/WebPage.messages.in: Add a new scrollBy message. 
1126         * WebProcess/WebPage/mac/WebPageMac.mm: Remove scroll and logicalScroll, they are now in WebPage.cpp.
1127         * WebProcess/WebPage/win/WebPageWin.cpp: Ditto.
1128
1129 2011-03-24  Sam Weinig  <sam@webkit.org>
1130
1131         Reviewed by Darin Adler.
1132
1133         Dictionary text extraction is not correctly detecting word boundaries on bing.com
1134         <rdar://problem/9078569>
1135         https://bugs.webkit.org/show_bug.cgi?id=56995
1136
1137         * Shared/DictionaryPopupInfo.cpp:
1138         (WebKit::DictionaryPopupInfo::encode):
1139         (WebKit::DictionaryPopupInfo::decode):
1140         * Shared/DictionaryPopupInfo.h:
1141         Add options dictionary.
1142
1143         * UIProcess/API/mac/PageClientImpl.mm:
1144         (WebKit::PageClientImpl::didPerformDictionaryLookup):
1145         Add path that can pass options through.
1146
1147         * WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm:
1148         (WebKit::WebContextMenuClient::lookUpInDictionary):
1149         Use the new performDictionaryLookupForSelection which can extract context
1150         if supported.
1151
1152         * WebProcess/WebPage/WebPage.h:
1153         * WebProcess/WebPage/mac/WebPageMac.mm:
1154         (WebKit::characterRangeAtPositionForPoint):
1155         (WebKit::characterRangeAtPoint):
1156         Split functionality out of characterRangeAtPoint and into 
1157         characterRangeAtPositionForPoint to avoid doing duplicate work 
1158         if you already have the position.
1159
1160         (WebKit::isPositionInRange):
1161         (WebKit::shouldUseSelection):
1162         Add predicate to determine if we should use the selection instead
1163         of expanding to find the word we are over.
1164
1165         (WebKit::WebPage::performDictionaryLookupAtLocation):
1166         If available, use the surrounding paragraph as context to get better extraction
1167         and to get lexicographical information about the word. Also, clean up and use 
1168         editing APIs to make the code more concise and understandable.
1169
1170         (WebKit::WebPage::performDictionaryLookupForSelection):
1171         Use similar logic as in performDictionaryLookupAtLocation to extract additional
1172         details from a selection for use in the dictionary popup.
1173
1174         (WebKit::WebPage::performDictionaryLookupForRange):
1175         Pass options to WebProcess if available.
1176
1177 2011-03-24  Jon Lee  <jonlee@apple.com>
1178
1179         Reviewed by Darin Adler.
1180
1181         WebKit2: Tabbing from the last focused field to a non-webpage element leaves the selection in a weird state
1182         <rdar://problem/8553962>
1183
1184         * WebProcess/WebPage/WebPage.cpp:
1185         (WebKit::WebPage::setFocused): When the page loses focus, clear out any selection in the frame
1186
1187 2011-03-24  Brian Weinstein  <bweinstein@apple.com>
1188
1189         Rubber-stamped by Sam Weinig.
1190
1191         Fix a typo in the VK_LEFT case of performDefaultBehaviorForKeyEvent.
1192
1193         * WebProcess/WebPage/mac/WebPageMac.mm:
1194         (WebKit::WebPage::performDefaultBehaviorForKeyEvent): It should be a logical or,
1195             not a bitwise or.
1196
1197 2011-03-24  Jeff Miller  <jeffm@apple.com>
1198
1199         Fix typo - USE(CF_NETWORK) should be USE(CFNETWORK).
1200
1201         * WebProcess/InjectedBundle/win/InjectedBundleWin.cpp:
1202         (WebKit::InjectedBundle::setHostAllowsAnyHTTPSCertificate): USE(CF_NETWORK) should be USE(CFNETWORK)
1203
1204 2011-03-23  Jia Pu  <jpu@apple.com>
1205
1206         Reviewed by Darin Adler.
1207
1208         Hook up new AppKit autocorrection UI with WK2.
1209         https://bugs.webkit.org/show_bug.cgi?id=56055
1210         <rdar://problem/8947463>
1211
1212         Please see WebCore/ChangeLog for detail.
1213
1214         The calls to AppKit are implemented in PageClientImpl. Other changes are necessary for the
1215         plumbing work.
1216
1217         * UIProcess/API/mac/PageClientImpl.h:
1218         * UIProcess/API/mac/PageClientImpl.mm:
1219         (WebKit::PageClientImpl::showCorrectionPanel):
1220         (WebKit::PageClientImpl::dismissCorrectionPanel):
1221         (WebKit::PageClientImpl::dismissCorrectionPanelSoon):
1222         (WebKit::PageClientImpl::recordAutocorrectionResponse):
1223         * UIProcess/API/mac/WKView.mm:
1224         (-[WKView spellCheckerDocumentTag]):
1225         (-[WKView handleCorrectionPanelResult:]):
1226         * UIProcess/API/mac/WKViewPrivate.h:
1227         * UIProcess/PageClient.h:
1228         * UIProcess/WebPageProxy.cpp:
1229         (WebKit::WebPageProxy::didCommitLoadForFrame):
1230         (WebKit::WebPageProxy::showCorrectionPanel):
1231         (WebKit::WebPageProxy::dismissCorrectionPanel):
1232         (WebKit::WebPageProxy::dismissCorrectionPanelSoon):
1233         (WebKit::WebPageProxy::recordAutocorrectionResponse):
1234         (WebKit::WebPageProxy::handleCorrectionPanelResult):
1235         * UIProcess/WebPageProxy.h:
1236         * UIProcess/WebPageProxy.messages.in:
1237         * UIProcess/mac/CorrectionPanel.h: Added.
1238         (WebKit::CorrectionPanel::isShowing):
1239         * UIProcess/mac/CorrectionPanel.mm: Added.
1240         (correctionBubbleType):
1241         (WebKit::CorrectionPanel::CorrectionPanel):
1242         (WebKit::CorrectionPanel::~CorrectionPanel):
1243         (WebKit::CorrectionPanel::show):
1244         (WebKit::CorrectionPanel::dismiss):
1245         (WebKit::CorrectionPanel::dismissSoon):
1246         (WebKit::CorrectionPanel::dismissInternal):
1247         (WebKit::CorrectionPanel::recordAutocorrectionResponse):
1248         * WebKit2.xcodeproj/project.pbxproj:
1249         * WebProcess/WebCoreSupport/WebEditorClient.h:
1250         * WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
1251         (WebKit::WebEditorClient::showCorrectionPanel):
1252         (WebKit::WebEditorClient::dismissCorrectionPanel):
1253         (WebKit::WebEditorClient::dismissCorrectionPanelSoon):
1254         (WebKit::WebEditorClient::recordAutocorrectionResponse):
1255         * WebProcess/WebPage/WebPage.cpp:
1256         (WebKit::WebPage::handleCorrectionPanelResult):
1257         * WebProcess/WebPage/WebPage.h:
1258         * WebProcess/WebPage/WebPage.messages.in:
1259
1260 2011-03-23  Brian Weinstein  <bweinstein@apple.com>
1261
1262         Reviewed by Maciej Stachowiak.
1263
1264         WebKit2: Need API to manage the Media Cache
1265         https://bugs.webkit.org/show_bug.cgi?id=56878
1266         <rdar://problem/9082503>
1267
1268         Call through to HTMLMediaElement functions to manage the WebCore media cache.
1269
1270         * WebProcess/MediaCache/WebMediaCacheManager.cpp:
1271         (WebKit::WebMediaCacheManager::getHostnamesWithMediaCache):
1272         (WebKit::WebMediaCacheManager::clearCacheForHostname):
1273         (WebKit::WebMediaCacheManager::clearCacheForAllHostnames):
1274
1275 2011-03-23  Jeff Miller  <jeffm@apple.com>
1276
1277         Reviewed by Darin Adler.
1278
1279         Add WKBundleSetHostAllowsAnyHTTPSCertificate() for Windows
1280         https://bugs.webkit.org/show_bug.cgi?id=56972
1281         
1282         This is the WebKit2 equivalent to the WebKit1 API IWebMutableURLRequest::setAllowsAnyHTTPSCertificate().
1283
1284         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
1285         (WKBundleSetHostAllowsAnyHTTPSCertificate): Added.
1286         * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h: Added WKBundleSetHostAllowsAnyHTTPSCertificate().
1287         * WebProcess/InjectedBundle/InjectedBundle.h: Added setHostAllowsAnyHTTPSCertificate().
1288         * WebProcess/InjectedBundle/gtk/InjectedBundleGtk.cpp:
1289         (WebKit::InjectedBundle::setHostAllowsAnyHTTPSCertificate): Added, should never be called.
1290         * WebProcess/InjectedBundle/mac/InjectedBundleMac.cpp:
1291         (WebKit::InjectedBundle::setHostAllowsAnyHTTPSCertificate): Added, should never be called.
1292         * WebProcess/InjectedBundle/qt/InjectedBundleQt.cpp:
1293         (WebKit::InjectedBundle::setHostAllowsAnyHTTPSCertificate): Added, should never be called.
1294         * WebProcess/InjectedBundle/win/InjectedBundleWin.cpp:
1295         (WebKit::InjectedBundle::setHostAllowsAnyHTTPSCertificate): Added.
1296
1297 2011-03-23  Sam Weinig  <sam@webkit.org>
1298
1299         Reviewed by Anders Carlsson.
1300
1301         Roll out r81593 Need WebKit2 API for creating a page with a specific main frame name
1302
1303         This API is not necessary.
1304
1305         * Shared/WebPageCreationParameters.cpp:
1306         (WebKit::WebPageCreationParameters::encode):
1307         (WebKit::WebPageCreationParameters::decode):
1308         * Shared/WebPageCreationParameters.h:
1309         * UIProcess/API/mac/WKView.h:
1310         * UIProcess/API/mac/WKView.mm:
1311         (-[WKView initWithFrame:]):
1312         (-[WKView initWithFrame:contextRef:]):
1313         (-[WKView initWithFrame:contextRef:pageGroupRef:]):
1314         * UIProcess/WebPageProxy.cpp:
1315         (WebKit::WebPageProxy::creationParameters):
1316         * UIProcess/WebPageProxy.h:
1317         * WebProcess/WebPage/WebFrame.cpp:
1318         (WebKit::WebFrame::createMainFrame):
1319         * WebProcess/WebPage/WebFrame.h:
1320         * WebProcess/WebPage/WebPage.cpp:
1321         (WebKit::WebPage::WebPage):
1322
1323 2011-03-23  Balazs Kelemen  <kbalazs@webkit.org>
1324
1325         Reviewed by Andreas Kling.
1326
1327         [WK2] Handle keyboard and mouse events on X11
1328         https://bugs.webkit.org/show_bug.cgi?id=56103
1329
1330         Propagate keyboard and mouse events to the plugin
1331         as XEvent's.
1332
1333         * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:
1334         (WebKit::initializeXEvent):
1335         (WebKit::xTimeStamp):
1336         (WebKit::xKeyModifiers):
1337         (WebKit::setCommonMouseEventFields):
1338         (WebKit::setXMotionEventFields):
1339         (WebKit::setXButtonEventFields):
1340         (WebKit::setXCrossingEventFields):
1341         (WebKit::NetscapePlugin::platformHandleMouseEvent):
1342         (WebKit::NetscapePlugin::platformHandleMouseEnterEvent):
1343         (WebKit::NetscapePlugin::platformHandleMouseLeaveEvent):
1344         (WebKit::setXKeyEventFields):
1345         (WebKit::NetscapePlugin::platformHandleKeyboardEvent):
1346
1347 2011-03-23  Anders Carlsson  <andersca@apple.com>
1348
1349         Reviewed by Sam Weinig.
1350
1351         Connection::SyncMessageState::processIncomingMessage should ignore whether the message is sync or not
1352         https://bugs.webkit.org/show_bug.cgi?id=56954
1353
1354         This is so we'll eventually be able to send sync messages that aren't processed immediately if the 
1355         destination is waiting for a reply to another synchronous message.
1356
1357         * Platform/CoreIPC/Connection.cpp:
1358         (CoreIPC::Connection::SyncMessageState::processIncomingMessage):
1359         Only check for the DispatchMessageWhenWaitingForSyncReply flag.
1360
1361         (CoreIPC::Connection::sendSyncMessage):
1362         Add both DispatchMessageWhenWaitingForSyncReply and SyncMessage to the message ID.
1363
1364         * Platform/CoreIPC/Connection.h:
1365         (CoreIPC::Connection::sendSync):        
1366         (CoreIPC::Connection::deprecatedSendSync):
1367         No need to add SyncMessage here anymore.
1368
1369 2011-03-23  Brian Weinstein  <bweinstein@apple.com>
1370
1371         Qt Build Fix.
1372
1373         * DerivedSources.pro:
1374
1375 2011-03-22  Brian Weinstein  <bweinstein@apple.com>
1376
1377         Reviewed by Darin Adler.
1378
1379         WebKit2: Need API to manage the Media Cache
1380         https://bugs.webkit.org/show_bug.cgi?id=56878
1381         <rdar://problem/9082503>
1382
1383         Project File Fun:
1384         * GNUmakefile.am:
1385         * WebKit2.pri:
1386         * WebKit2.pro:
1387         * WebKit2.xcodeproj/project.pbxproj:
1388         * win/WebKit2.vcproj:
1389         * win/WebKit2Common.vsprops:
1390         * win/WebKit2Generated.make:
1391         
1392         Derived Sources and API fun:
1393         * DerivedSources.make:
1394         * DerivedSources.pro:
1395         * Platform/CoreIPC/MessageID.h:
1396         * Shared/API/c/WKBase.h:
1397         * Shared/APIObject.h:
1398         * UIProcess/API/C/WKAPICast.h:
1399         
1400         * UIProcess/WebProcessProxy.cpp:
1401         (WebKit::WebProcessProxy::didReceiveMessage): Add a case for MediaCache messages.
1402         * WebProcess/WebProcess.cpp:
1403         (WebKit::WebProcess::didReceiveMessage): Ditto.
1404         
1405         * UIProcess/WebContext.cpp:
1406         (WebKit::WebContext::WebContext): Initialize the WebMediaCacheManagerProxy member variable.
1407         (WebKit::WebContext::~WebContext): Invalidate the WebMediaCacheManagerProxy.
1408         (WebKit::WebContext::disconnectProcess): Ditto.
1409         (WebKit::WebContext::didReceiveMessage): Add a case for MediaCache messages.
1410         * UIProcess/WebContext.h:
1411         (WebKit::WebContext::mediaCacheManagerProxy):
1412
1413         * UIProcess/API/C/WKContext.cpp:
1414         (WKContextGetMediaCacheManager): Returns the context's WebMediaCacheManager.
1415         * UIProcess/API/C/WKContext.h:
1416
1417         * UIProcess/API/C/WKMediaCacheManager.cpp: Added.
1418         (WKMediaCacheManagerGetTypeID): Returns the WebMediaCacheManagerProxy type.
1419         (WKMediaCacheManagerGetHostnamesWithMediaCache): Calls down to the WebMediaCacheManagerProxy.
1420         (WKMediaCacheManagerClearCacheForHostname): Ditto.
1421         (WKMediaCacheManagerClearCacheForAllHostnames): Ditto.
1422         * UIProcess/API/C/WKMediaCacheManager.h: Added.
1423
1424         * UIProcess/WebMediaCacheManagerProxy.cpp: Added.
1425         (WebKit::WebMediaCacheManagerProxy::create):
1426         (WebKit::WebMediaCacheManagerProxy::WebMediaCacheManagerProxy):
1427         (WebKit::WebMediaCacheManagerProxy::~WebMediaCacheManagerProxy):
1428         (WebKit::WebMediaCacheManagerProxy::invalidate):
1429         (WebKit::WebMediaCacheManagerProxy::didReceiveMessage):
1430         (WebKit::WebMediaCacheManagerProxy::getHostnamesWithMediaCache): Call through to the WebProcess.
1431         (WebKit::WebMediaCacheManagerProxy::didGetHostnamesWithMediaCache): Process the WebProcess response,
1432             and call the callback.
1433         (WebKit::WebMediaCacheManagerProxy::clearCacheForHostname): Call through to the WebProcess.
1434         (WebKit::WebMediaCacheManagerProxy::clearCacheForAllHostnames): Call through to the WebProcess.
1435         * UIProcess/WebMediaCacheManagerProxy.h: Added.
1436         (WebKit::WebMediaCacheManagerProxy::clearContext):
1437         (WebKit::WebMediaCacheManagerProxy::type):
1438         * UIProcess/WebMediaCacheManagerProxy.messages.in: Added.
1439
1440         * WebProcess/MediaCache: Added.
1441         * WebProcess/MediaCache/WebMediaCacheManager.cpp: Added.
1442         (WebKit::WebMediaCacheManager::shared):
1443         (WebKit::WebMediaCacheManager::WebMediaCacheManager):
1444         (WebKit::WebMediaCacheManager::didReceiveMessage):
1445         (WebKit::WebMediaCacheManager::getHostnamesWithMediaCache): Added a FIXME to call through to WebCore.
1446         (WebKit::WebMediaCacheManager::clearCacheForHostname): Ditto.
1447         (WebKit::WebMediaCacheManager::clearCacheForAllHostnames): Ditto.
1448         * WebProcess/MediaCache/WebMediaCacheManager.h: Added.
1449         * WebProcess/MediaCache/WebMediaCacheManager.messages.in: Added.
1450
1451 2011-03-22  Brady Eidson  <beidson@apple.com>
1452
1453         Reviewed by Sam Weinig.
1454
1455         Add asynchronous load decision call to WebKit2 IconDatabase
1456         https://bugs.webkit.org/show_bug.cgi?id=56887
1457
1458         * UIProcess/WebIconDatabase.cpp:
1459         (WebKit::WebIconDatabase::getLoadDecisionForIconURL): In the future, get the actual load decision from the database.
1460           For now, always message "IconLoadNo" back to the WebProcess.
1461         * UIProcess/WebIconDatabase.h:
1462         * UIProcess/WebIconDatabase.messages.in:
1463         
1464         * WebProcess/IconDatabase/WebIconDatabaseProxy.cpp:
1465         (WebKit::WebIconDatabaseProxy::loadDecisionForIconURL): Message the UIProcess for the load decision.
1466         (WebKit::WebIconDatabaseProxy::receivedIconLoadDecision): Callback into WebCore with the received load decision.
1467         * WebProcess/IconDatabase/WebIconDatabaseProxy.h:
1468         * WebProcess/IconDatabase/WebIconDatabaseProxy.messages.in:
1469
1470 2011-03-23  Chris Fleizach  <cfleizach@apple.com>
1471
1472         Reviewed by Darin Adler.
1473
1474         REGRESSION: WK2: AX: PDF in Safari no longer accessible.
1475         https://bugs.webkit.org/show_bug.cgi?id=56849
1476
1477         The WKView needs to know when to return the WKPDFView and when to return
1478         the remote web process connection.
1479
1480         * UIProcess/API/mac/PDFViewController.h:
1481         (WebKit::PDFViewController::pdfView):
1482         * UIProcess/API/mac/WKView.mm:
1483         (-[WKView accessibilityFocusedUIElement]):
1484         (-[WKView accessibilityHitTest:]):
1485         (-[WKView accessibilityAttributeValue:]):
1486
1487 2011-03-21  Stephanie Lewis  <slewis@apple.com>
1488
1489         Reviewed by Simon Fraser.
1490
1491         https://bugs.webkit.org/show_bug.cgi?id=56798
1492         Wrap autorelease pools around calls that can have pathological memory growth on Membuster.  
1493         Only wrap the main runloop because some background threads are not expected to call into 
1494         objc and an autorelease pool could mask bugs.
1495
1496         * Platform/mac/RunLoopMac.mm:
1497         (RunLoop::performWork):
1498         (RunLoop::TimerBase::timerFired):
1499         * WebProcess/WebPage/mac/LayerTreeHostMac.mm:
1500         (WebKit::LayerTreeHostMac::flushPendingLayerChangesRunLoopObserverCallback):
1501
1502 2011-03-22  Anders Carlsson  <andersca@apple.com>
1503
1504         Reviewed by Sam Weinig.
1505
1506         OBJECT element with DivX source is always downloaded
1507         https://bugs.webkit.org/show_bug.cgi?id=56879
1508
1509         * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
1510         (WebKit::getPluginInfoFromPropertyLists):
1511         Always try to split every element in the "WebPluginExtensions" array, since the DivX plug-in
1512         specifies multiple file extensions in a single element.
1513         
1514         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1515         (WebKit::pluginSupportsExtension):
1516         Add a new helper function.
1517
1518         (WebKit::WebFrameLoaderClient::objectContentType):
1519         If we can't find the MIME for an extension, explicitly check if there's a plugin that claims to
1520         handle the given extension.
1521
1522 2011-03-22  Brady Eidson  <beidson@apple.com>
1523
1524         Reviewed by Sam Weinig.
1525
1526         Rename the synchronous icon database messages to be prefixed with "synchronous"
1527
1528         * UIProcess/WebIconDatabase.cpp:
1529         (WebKit::WebIconDatabase::synchronousIconDataForPageURL):
1530         (WebKit::WebIconDatabase::synchronousIconURLForPageURL):
1531         (WebKit::WebIconDatabase::synchronousIconDataKnownForIconURL):
1532         (WebKit::WebIconDatabase::synchronousLoadDecisionForIconURL):
1533         * UIProcess/WebIconDatabase.h:
1534         * UIProcess/WebIconDatabase.messages.in:
1535
1536         * WebProcess/IconDatabase/WebIconDatabaseProxy.cpp:
1537         (WebKit::WebIconDatabaseProxy::synchronousIconForPageURL):
1538
1539 2011-03-22  Sam Weinig  <sam@webkit.org>
1540
1541         Rubber-stamped by Anders Carlsson.
1542
1543         Loading a new tab does not dismiss Lookup
1544         <rdar://problem/9138391> 
1545
1546         * UIProcess/API/mac/WKView.mm:
1547         (-[WKView viewDidMoveToWindow]):
1548         Hide the dictionary popup when moving the WKView out of a window.
1549
1550 2011-03-22  Anders Carlsson  <andersca@apple.com>
1551
1552         Reviewed by Sam Weinig.
1553
1554         Microsoft Silverlight playback shows artifacts
1555         https://bugs.webkit.org/show_bug.cgi?id=56863
1556         <rdar://problem/9103136>
1557
1558         * PluginProcess/PluginControllerProxy.cpp:
1559         (WebKit::PluginControllerProxy::paint):
1560         If the plug-in is transparent, clear the dirty rect before painting.
1561
1562         * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
1563         (WebKit::NetscapePluginModule::determineQuirks):
1564         Add the MakeTransparentIfBackgroundAttributeExists quirk for Silverlight plug-ins.
1565
1566         * Shared/Plugins/PluginQuirks.h:
1567         Add MakeTransparentIfBackgroundAttributeExists quirk.
1568
1569         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
1570         (WebKit::NPN_SetValue):
1571         Handle NPPVpluginTransparentBool.
1572
1573         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
1574         (WebKit::NetscapePlugin::NetscapePlugin):
1575         Initialize m_isTransparent to false.
1576
1577         (WebKit::NetscapePlugin::setIsTransparent):
1578         Set m_isTransparent.
1579
1580         (WebKit::NetscapePlugin::initialize):
1581         If the plug-in has the MakeTransparentIfBackgroundAttributeExists quirk, make it transparent
1582         if there's a 'background' attribute.
1583
1584         (WebKit::NetscapePlugin::isTransparent):
1585         Add getter.
1586
1587         * WebProcess/Plugins/Plugin.h:
1588         Add isTransparent().
1589
1590         * WebProcess/Plugins/PluginProxy.cpp:
1591         (WebKit::PluginProxy::paint):
1592         Always copy the plug-in backing store to the plug-in proxy backing store.
1593
1594         (WebKit::PluginProxy::isTransparent):
1595         Add getter that should never be called.
1596
1597         (WebKit::PluginProxy::update):
1598         Always copy the plug-in backing store to the plug-in proxy backing store.
1599
1600 2011-03-22  Anders Carlsson  <andersca@apple.com>
1601
1602         Reviewed by Sam Weinig.
1603
1604         Crash when calling PluginProxy::evaluate on a destroyed plug-in
1605         https://bugs.webkit.org/show_bug.cgi?id=56848
1606         <rdar://problem/9168975>
1607
1608         Return early if the NPObject doesn't exist anymore.
1609
1610         * WebProcess/Plugins/PluginProxy.cpp:
1611         (WebKit::PluginProxy::evaluate):
1612
1613 2011-03-22  Sam Weinig  <sam@webkit.org>
1614
1615         Reviewed by Adam Roben.
1616
1617         WebKit2: Cannot make a selection past the end of the visible page (no autoscrolling)
1618         <rdar://problem/8823874>
1619         https://bugs.webkit.org/show_bug.cgi?id=56847
1620
1621         * Shared/mac/WebEventFactory.mm:
1622         (WebKit::currentMouseButton):
1623         (WebKit::mouseButtonForEvent):
1624         Add mouse button for mouseEnter/Exit events. [NSEvent buttonNumber] doesn't seem to give the right result
1625         for these events, but getting the currentMouseButton does work.
1626
1627 2011-03-21  Brady Eidson  <beidson@apple.com>
1628
1629         Fix Mac release builds after https://bugs.webkit.org/show_bug.cgi?id=56783
1630
1631         * Platform/mac/Logging.mac.mm:
1632
1633 2011-03-21  Brady Eidson  <beidson@apple.com>
1634
1635         Reviewed by Brian Weinstein.
1636
1637         https://bugs.webkit.org/show_bug.cgi?id=56783
1638         Actually hook up WebKit2 logging on Mac.
1639
1640         * Platform/Logging.cpp:
1641         (WebKit::initializeLogChannel):
1642         * Platform/Logging.h:
1643         * Platform/mac/Logging.mac.mm: Added.
1644         (WebKit::initializeLogChannel):
1645  
1646        * UIProcess/WebContext.cpp:
1647         (WebKit::WebContext::WebContext): Initialize logging if necessary.
1648
1649         * WebKit2.xcodeproj/project.pbxproj:
1650
1651 2011-03-21  Alexey Proskuryakov  <ap@apple.com>
1652
1653         Reviewed by Darin Adler.
1654
1655         REGRESSION (r81269): WebKit2 gets into an infinite recursion after an unhandled command key
1656         https://bugs.webkit.org/show_bug.cgi?id=56782
1657         <rdar://problem/9151993>
1658
1659         * UIProcess/API/mac/PageClientImpl.mm: (WebKit::PageClientImpl::doneWithKeyEvent):
1660         Factored out code for resending an event and moved it to WKView.
1661
1662         * UIProcess/API/mac/WKView.mm:
1663         (-[WKView performKeyEquivalent:]): Don't zero out _keyDownEventBeingResent, it's easier
1664         to just do that in _resendKeyDownEvent:.
1665         (-[WKView keyDown:]): Ditto.
1666         (-[WKView _resendKeyDownEvent:]): Moved from PageClientImpl.mm. Added an assertion that we
1667         are not already resending an event - it would be too confusing if we ever had to do that,
1668         but looks like this never happens.
1669
1670         * UIProcess/API/mac/WKViewInternal.h: Exposed _resendKeyDownEvent.
1671
1672 2011-03-21  Anders Carlsson  <andersca@apple.com>
1673
1674         Reviewed by Sam Weinig.
1675
1676         QT plug-in fails to load contextual menu
1677         https://bugs.webkit.org/show_bug.cgi?id=56777
1678         <rdar://problem/8979033>
1679
1680         Open a Carbon resource map and make it the current map when calling NP_Initialize.
1681
1682         * Platform/Module.cpp:
1683         (WebKit::Module::Module):
1684         Initialize m_bundleResourceMap to -1.
1685
1686         * Platform/Module.h:
1687         Add m_bundleResourceMap.
1688
1689         * Platform/mac/ModuleMac.mm:
1690         (WebKit::Module::unload):
1691         Close the resource map.
1692
1693         (WebKit::Module::bundleResourceMap):
1694         Open a resource map if necessary.
1695
1696         * Shared/Plugins/Netscape/NetscapePluginModule.cpp:
1697         (WebKit::NetscapePluginModule::tryLoad):
1698         Get the resource map and make it current before calling NP_Initialize.
1699
1700 2011-03-21  Anders Carlsson  <andersca@apple.com>
1701
1702         Reviewed by Sam Weinig.
1703
1704         Plug-in process crashes if it fails to load a plug-in module
1705         https://bugs.webkit.org/show_bug.cgi?id=56775
1706
1707         * PluginProcess/PluginControllerProxy.cpp:
1708         (WebKit::PluginControllerProxy::initialize):
1709         If NetscapePlugin::create returns null, call removePluginControllerProxy with a null plug-in.
1710
1711         * PluginProcess/WebProcessConnection.cpp:
1712         (WebKit::WebProcessConnection::removePluginControllerProxy):
1713         Remove an incorrect assertion. Don't invalidate the remote object map if the plug-in is null.
1714
1715 2011-03-21  Anders Carlsson  <andersca@apple.com>
1716
1717         Reviewed by Sam Weinig.
1718
1719         QT plug-in loads controller at top of movie not bottom
1720         https://bugs.webkit.org/show_bug.cgi?id=56764
1721         <rdar://problem/8979037>
1722
1723         Create a layer with geometryFlipped set and add the plug-in layer as a sublayer,
1724         matching WebKit1.
1725
1726         * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
1727         (WebKit::NetscapePlugin::platformPostInitialize):
1728
1729 2011-03-21  Sam Weinig  <sam@webkit.org>
1730
1731         Reviewed by Anders Carlsson.
1732
1733         WebKit2 needs preferences to change security knobs
1734         https://bugs.webkit.org/show_bug.cgi?id=56762
1735
1736         Add preferences for WebSecurityEnabled, UniversalAccessFromFileURLsAllowed
1737         and FileAccessFromFileURLsAllowed.
1738
1739         * Shared/WebPreferencesStore.h:
1740         * UIProcess/API/C/WKPreferences.cpp:
1741         (WKPreferencesSetWebSecurityEnabled):
1742         (WKPreferencesGetWebSecurityEnabled):
1743         (WKPreferencesSetUniversalAccessFromFileURLsAllowed):
1744         (WKPreferencesGetUniversalAccessFromFileURLsAllowed):
1745         (WKPreferencesSetFileAccessFromFileURLsAllowed):
1746         (WKPreferencesGetFileAccessFromFileURLsAllowed):
1747         * UIProcess/API/C/WKPreferencesPrivate.h:
1748         * WebProcess/WebPage/WebPage.cpp:
1749         (WebKit::WebPage::updatePreferences):
1750
1751 2011-03-21  Sam Weinig  <sam@webkit.org>
1752
1753         Reviewed by Anders Carlsson.
1754
1755         Remove old DrawingArea and LayerHostingView code from WKView.
1756
1757         * UIProcess/API/mac/WKView.mm:
1758         (-[WKView drawRect:]):
1759         (-[WKView hitTest:]):
1760         (-[WKView WebKit::]):
1761
1762 2011-03-21  Sam Weinig  <sam@webkit.org>
1763
1764         Reviewed by Anders Carlsson.
1765
1766         Need WebKit2 API for creating a page with a specific main frame name
1767         https://bugs.webkit.org/show_bug.cgi?id=56759
1768
1769         * Shared/WebPageCreationParameters.cpp:
1770         (WebKit::WebPageCreationParameters::encode):
1771         (WebKit::WebPageCreationParameters::decode):
1772         * Shared/WebPageCreationParameters.h:
1773         Add mainFrameName to creation parameters.
1774
1775         * UIProcess/API/mac/WKView.h:
1776         * UIProcess/API/mac/WKView.mm:
1777         (-[WKView initWithFrame:]):
1778         (-[WKView initWithFrame:contextRef:]):
1779         (-[WKView initWithFrame:contextRef:pageGroupRef:]):
1780         (-[WKView initWithFrame:contextRef:pageGroupRef:mainFrameName:]):
1781         Add new initializer which takes a main frame name.
1782
1783         * UIProcess/WebPageProxy.cpp:
1784         (WebKit::WebPageProxy::setMainFrameName):
1785         (WebKit::WebPageProxy::creationParameters):
1786         * UIProcess/WebPageProxy.h:
1787         Store the main frame name for initialization/re-initialization.
1788
1789         * WebProcess/WebPage/WebFrame.cpp:
1790         (WebKit::WebFrame::createMainFrame):
1791         * WebProcess/WebPage/WebFrame.h:
1792         * WebProcess/WebPage/WebPage.cpp:
1793         (WebKit::WebPage::WebPage):
1794         Pass the name to main frame creation.
1795
1796 2011-03-20  Bill Budge  <bbudge@chromium.org>
1797
1798         Reviewed by Adam Barth.
1799
1800         Rename ThreadSafeShared to ThreadSafeRefCounted
1801         https://bugs.webkit.org/show_bug.cgi?id=56714
1802
1803         No new tests. Exposes no new functionality.
1804
1805         * Platform/CoreIPC/Connection.h:
1806         * Platform/WorkQueue.h:
1807         * Platform/win/WorkQueueWin.cpp:
1808         * UIProcess/Launcher/ProcessLauncher.h:
1809         * UIProcess/Launcher/ThreadLauncher.h:
1810
1811 2011-03-19  Anton D'Auria  <adauria@apple.com>
1812
1813         Reviewed by Alexey Proskuryakov.
1814
1815         ApplicationCacheGroup is not obsolete after being deleted via ApplicationCacheStorage::deleteEntriesForOrigin
1816         https://bugs.webkit.org/show_bug.cgi?id=56415
1817
1818         * WebProcess/ApplicationCache/WebApplicationCacheManager.cpp: calling ApplicationCacheGroup::deleteCacheGroupsForOrigin
1819         instead of ApplicationCacheStorage::deleteEntriesForOrigin.
1820         (WebKit::WebApplicationCacheManager::deleteEntriesForOrigin):
1821
1822 2011-03-18  Sam Weinig  <sam@webkit.org>
1823
1824         Attempt to fix the WinCairo build.
1825
1826         * win/WebKit2.vcproj:
1827
1828 2011-03-18  Anders Carlsson  <andersca@apple.com>
1829
1830         Reviewed by Dan Bernstein.
1831
1832         Empty gray page after going back from a PDF
1833         https://bugs.webkit.org/show_bug.cgi?id=56694
1834         <rdar://problem/8811854>
1835
1836         Update m_frameHasCustomRepresentation when loading a page that's in the page cache.
1837
1838         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1839         (WebKit::WebFrameLoaderClient::transitionToCommittedFromCachedFrame):
1840
1841 2011-03-18  Anders Carlsson  <andersca@apple.com>
1842
1843         Reviewed by Sam Weinig.
1844
1845         Crash when sending a sync message ends up invalidating the connection
1846         https://bugs.webkit.org/show_bug.cgi?id=56686
1847         <rdar://problem/9048781>
1848
1849         Guard against a null client.
1850
1851         * Platform/CoreIPC/Connection.cpp:
1852         (CoreIPC::Connection::sendSyncMessage):
1853
1854 2011-03-18  Balazs Kelemen  <kbalazs@webkit.org>
1855
1856         Reviewed by Benjamin Poulain.
1857
1858         [Qt][WK2] Need a way to debug the web process after the UI process dies
1859         https://bugs.webkit.org/show_bug.cgi?id=56116
1860
1861         Allow the web process to outlive it's parent process
1862         in debug builds if the QT_WEBKIT_KEEP_ALIVE_WEB_PROCESS
1863         environment variable is set.
1864
1865         * UIProcess/Launcher/qt/ProcessLauncherQt.cpp:
1866         (WebKit::QtWebProcess::setupChildProcess): Used getenv
1867         since the prctl call is already in a Linux-only block
1868         and the implementation in this file is a candidate
1869         for sharing across ports in the future.
1870
1871 2011-03-18  Darin Adler  <darin@apple.com>
1872
1873         Reviewed by Anders Carlsson.
1874
1875         Command-period does not stop load when page has focus in WebKit2
1876         https://bugs.webkit.org/show_bug.cgi?id=56601
1877
1878         * UIProcess/API/mac/WKView.mm:
1879         (-[WKView doCommandBySelector:]): If called outside interpretKeyEvents,
1880         call through to super.
1881         (-[WKView insertText:]): Assert that we are inside interpretKeyEvents.
1882         (-[WKView unmarkText]): Ditto.
1883         (-[WKView setMarkedText:selectedRange:]): Ditto.
1884         (-[WKView _interceptKeyEvent:]): Set a flag to indicate we are inside
1885         interpretKeyEvents for use by the above.
1886
1887 2011-03-18  Brady Eidson  <beidson@apple.com>
1888
1889         Reviewed by Sam Weinig.
1890
1891         https://bugs.webkit.org/show_bug.cgi?id=56425
1892         More groundwork for WebKit2 IconDatabase
1893
1894         -Update the synchronous method names to be prefixed with "synchronous."
1895         -Add empty implementations for the asynchronous accessors.
1896
1897         * WebProcess/IconDatabase/WebIconDatabaseProxy.cpp:
1898         (WebKit::WebIconDatabaseProxy::setEnabled):
1899         (WebKit::WebIconDatabaseProxy::synchronousIconForPageURL):
1900         (WebKit::WebIconDatabaseProxy::synchronousIconURLForPageURL):
1901         (WebKit::WebIconDatabaseProxy::synchronousIconDataKnownForIconURL):
1902         (WebKit::WebIconDatabaseProxy::synchronousLoadDecisionForIconURL):
1903         (WebKit::WebIconDatabaseProxy::supportsAsynchronousMode):
1904         (WebKit::WebIconDatabaseProxy::loadDecisionForIconURL):
1905         (WebKit::WebIconDatabaseProxy::iconDataForIconURL):
1906         * WebProcess/IconDatabase/WebIconDatabaseProxy.h:
1907
1908 2011-03-18  Alejandro G. Castro  <alex@igalia.com>
1909
1910         Reviewed by Martin Robinson.
1911
1912         Fixed compilation after r80925.
1913
1914         * GNUmakefile.am:
1915         * UIProcess/gtk/WebFullScreenManagerProxyGtk.cpp: Added.
1916         (WebKit::WebFullScreenManagerProxy::enterFullScreen):
1917         (WebKit::WebFullScreenManagerProxy::exitFullScreen):
1918         (WebKit::WebFullScreenManagerProxy::beganEnterFullScreenAnimation):
1919         (WebKit::WebFullScreenManagerProxy::finishedEnterFullScreenAnimation):
1920         (WebKit::WebFullScreenManagerProxy::beganExitFullScreenAnimation):
1921         (WebKit::WebFullScreenManagerProxy::finishedExitFullScreenAnimation):
1922         (WebKit::WebFullScreenManagerProxy::enterAcceleratedCompositingMode):
1923         (WebKit::WebFullScreenManagerProxy::exitAcceleratedCompositingMode):
1924         (WebKit::WebFullScreenManagerProxy::getFullScreenRect):
1925         * WebProcess/FullScreen/gtk/WebFullScreenManagerGtk.cpp: Added.
1926         (WebKit::WebFullScreenManagerGtk::WebFullScreenManagerGtk):
1927         (WebKit::WebFullScreenManager::create):
1928         (WebKit::WebFullScreenManagerGtk::setRootFullScreenLayer):
1929         (WebKit::WebFullScreenManagerGtk::beginEnterFullScreenAnimation):
1930         (WebKit::WebFullScreenManagerGtk::beginExitFullScreenAnimation):
1931         * WebProcess/FullScreen/gtk/WebFullScreenManagerGtk.h: Added.
1932
1933 2011-03-18  Alejandro G. Castro  <alex@igalia.com>
1934
1935         Unreviewed, fixed compilation after r81208.
1936
1937         * GNUmakefile.am:
1938
1939 2011-03-18  John Sullivan  <sullivan@apple.com>
1940
1941         Reviewed by Dan Bernstein.
1942
1943         https://bugs.webkit.org/show_bug.cgi?id=56645
1944         Assertion fires when hidden Find-on-Page matches are encountered in WebKit2
1945
1946         * WebProcess/WebPage/FindController.cpp:
1947         (WebKit::FindController::updateFindIndicator):
1948         Bail out if the selection rect is empty, before trying to generate an appropriately-sized
1949         bitmap. (Previously it was bailing out afterwards, but encountering an assertion in debug
1950         builds along the way.)
1951
1952 2011-03-18  Mark Rowe  <mrowe@apple.com>
1953
1954         Rubber-stamped by Jon Honeycutt.
1955
1956         <rdar://problem/9153929> PluginProcess fails to launch due to PluginProcessShim.dylib building for 64-bit only
1957
1958         Fix a bogus change from r81392 that made PluginProcessShim.xcconfig import DebugRelease.xcconfig.
1959         As its name suggests, DebugRelease.xcconfig is only applicable for the debug and release configurations.
1960         It overrides the valid build architectures and also restricts the build to only the active architecture.
1961         
1962         * Configurations/PluginProcessShim.xcconfig: Import BaseTarget.xcconfig instead. This is what
1963         each target-specific .xcconfig file should import.
1964
1965 2011-03-17  Mark Rowe  <mrowe@apple.com>
1966
1967         Fix the build.
1968
1969         * WebKit2.xcodeproj/project.pbxproj:
1970
1971 2011-03-17  Anders Carlsson  <andersca@apple.com>
1972
1973         Reviewed by Sam Weinig.
1974
1975         Implement PluginProcessProxy::setFullscreenWindowIsShowing
1976         https://bugs.webkit.org/show_bug.cgi?id=56618
1977
1978         * UIProcess/Plugins/PluginProcessProxy.cpp:
1979         (WebKit::PluginProcessProxy::PluginProcessProxy):
1980         Initialize m_fullscreenWindowIsShowing.
1981
1982         (WebKit::PluginProcessProxy::didClose):
1983         if m_fullscreenWindowIsShowing is true, call exitFullscreen.
1984
1985         * UIProcess/Plugins/PluginProcessProxy.h:
1986         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
1987         (WebKit::PluginProcessProxy::getPluginProcessSerialNumber):
1988         Add helper function for getting a PSN for the plug-in process.
1989
1990         (WebKit::PluginProcessProxy::makePluginProcessTheFrontProcess):
1991         Make the plug-in process the front process.
1992
1993         (WebKit::PluginProcessProxy::makeUIProcessTheFrontProcess):
1994         Make the current process (the UI process) the front process.
1995
1996         (WebKit::PluginProcessProxy::setFullscreenWindowIsShowing):
1997         Call enterFullscreen or exitFullscreen.
1998
1999         (WebKit::PluginProcessProxy::enterFullscreen):
2000         Make the plug-in process the front process and hide the menu bar.
2001
2002         (WebKit::PluginProcessProxy::exitFullscreen):
2003         Show the menu bar and if necessary make the UI process the front process.
2004
2005         (WebKit::PluginProcessProxy::endModal):
2006         call makeUIProcessTheFrontProcess.
2007
2008         (WebKit::PluginProcessProxy::applicationDidBecomeActive):
2009         Call makePluginProcessTheFrontProcess.
2010
2011 2011-03-17  Adam Roben  <aroben@apple.com>
2012
2013         Make bidi text in <select> menus in WebKit2 on Windows match WebKit1
2014
2015         Fixes <http://webkit.org/b/56614> 3 <select> bidi tests failing on Windows 7 Release
2016         (WebKit2 Tests)
2017
2018         Reviewed by Sam Weinig.
2019
2020         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2021         (WebKit::WebChromeClient::selectItemWritingDirectionIsNatural):
2022         (WebKit::WebChromeClient::selectItemAlignmentFollowsMenuWritingDirection):
2023         On Windows, return the same values we return in WebKit1.
2024
2025 2011-03-17  Anders Carlsson  <andersca@apple.com>
2026
2027         Reviewed by Sam Weinig.
2028
2029         Implement PluginProcessProxy::setModalWindowIsShowing
2030         https://bugs.webkit.org/show_bug.cgi?id=56615
2031
2032         * UIProcess/Plugins/PluginProcessProxy.cpp:
2033         (WebKit::PluginProcessProxy::PluginProcessProxy):
2034         Initialize m_modalWindowIsShowing.
2035
2036         (WebKit::PluginProcessProxy::didClose):
2037         If m_modalWindowIsShowing is true, we must call endModal.
2038
2039         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
2040         (-[WKPlaceholderModalWindow _wantsUserAttention]):
2041         Add a WKPlaceholderModalWindow.
2042
2043         (WebKit::PluginProcessProxy::setModalWindowIsShowing):
2044         Call beginModal or endModal depending on whether we're showing a modal window or not.
2045
2046         (WebKit::PluginProcessProxy::beginModal):
2047         Create a fake window and start a nested run loop. Listen for NSApplicationWillBecomeActiveNotification notifications.
2048
2049         (WebKit::PluginProcessProxy::endModal):
2050         Tear down the window and the run loop.
2051
2052         (WebKit::PluginProcessProxy::applicationDidBecomeActive):
2053         Make sure that the plug-in process is frontmost.
2054
2055 2011-03-17  Jeff Miller  <jeffm@apple.com>
2056
2057         Reviewed by Adam Roben.
2058
2059         Web page shouldn't swallow alt-key combinations on Windows
2060         https://bugs.webkit.org/show_bug.cgi?id=56612
2061         
2062         Make Alt+Left Arrow and Alt+Right Arrow go back and forward, but make
2063         sure any alt-key combinations bubble up to the client.
2064
2065         * WebProcess/WebPage/win/WebPageWin.cpp:
2066         (WebKit::WebPage::performDefaultBehaviorForKeyEvent): Make Alt+Left Arrow and Alt+Right Arrow go back and forward, ignore any other alt-key combinations.
2067
2068 2011-03-17  Anders Carlsson  <andersca@apple.com>
2069
2070         Reviewed by Sam Weinig.
2071
2072         Send SetModalWindowIsShowing and SetFullscreenWindowIsShowing messages to the UI process
2073         https://bugs.webkit.org/show_bug.cgi?id=56610
2074
2075         * PluginProcess/mac/PluginProcessMac.mm:
2076         (WebKit::FullscreenWindowTracker::FullscreenWindowTracker):
2077         Add fullscreen window tracker class.
2078
2079         (WebKit::rectCoversAnyScreen):
2080         Return whether the given rect covers any screen.
2081
2082         (WebKit::windowCoversAnyScreen):
2083         Return whether the given window covers any screen.
2084
2085         (WebKit::FullscreenWindowTracker::windowShown):
2086         If we're showing a fullscreen window, call PluginProcess::setFullscreenWindowIsShowing.
2087
2088         (WebKit::FullscreenWindowTracker::windowHidden):
2089         If we're hiding the last fullscreen window, call PluginProcess::setFullscreenWindowIsShowing.
2090
2091         (WebKit::cocoaWindowShown):
2092         (WebKit::cocoaWindowHidden):
2093         (WebKit::carbonWindowShown):
2094         (WebKit::carbonWindowHidden):
2095         Call the window tracking functions.
2096
2097         (WebKit::setModal):
2098         Call PluginProcess::setModalWindowIsShowing.
2099
2100         (WebKit::PluginProcess::setModalWindowIsShowing):
2101         (WebKit::PluginProcess::setFullscreenWindowIsShowing):
2102         Send CoreIPC messages.
2103
2104         * UIProcess/Plugins/PluginProcessProxy.h:
2105         * UIProcess/Plugins/PluginProcessProxy.messages.in:
2106         Add new messages.
2107
2108         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
2109         (WebKit::PluginProcessProxy::setModalWindowIsShowing):
2110         (WebKit::PluginProcessProxy::setFullscreenWindowIsShowing):
2111         Add stubs.
2112
2113 2011-03-17  Sam Weinig  <sam@webkit.org>
2114
2115         Reviewed by Brady Eidson.
2116
2117         Allow passing a certificate chain as a user message
2118         <rdar://problem/8951709>
2119         https://bugs.webkit.org/show_bug.cgi?id=56605
2120
2121         * Shared/API/c/mac/WKCertificateInfoMac.h:
2122         * Shared/API/c/mac/WKCertificateInfoMac.mm:
2123         (WKCertificateInfoCreateWithCertficateChain):
2124         Added. Creates a WKCertificate from a certificate chain.
2125
2126         * Shared/UserMessageCoders.h:
2127         (WebKit::UserMessageEncoder::baseEncode):
2128         (WebKit::UserMessageDecoder::baseDecode):
2129         Add encoding/decoding of WebCertificateInfo.
2130
2131 2011-03-17  Anders Carlsson  <andersca@apple.com>
2132
2133         Reviewed by Sam Weinig.
2134
2135         Add PluginProcessShim hooks for when windows are shown and hidden
2136         https://bugs.webkit.org/show_bug.cgi?id=56597
2137
2138         * Configurations/PluginProcessShim.xcconfig:
2139         Add HEADER_SEARCH_PATHS so we can find WebKitSystemInterface.h.
2140
2141         * PluginProcess/mac/PluginProcessMac.mm:
2142         (WebKit::cocoaWindowShown):
2143         (WebKit::cocoaWindowHidden):
2144         (WebKit::carbonWindowShown):
2145         (WebKit::carbonWindowHidden):
2146         (WebKit::setModal):
2147         (WebKit::PluginProcess::initializeShim):
2148         Add empty stubs.
2149
2150         * PluginProcess/mac/PluginProcessShim.h:
2151         * PluginProcess/mac/PluginProcessShim.mm:
2152         (WebKit::beginModal):
2153         (WebKit::endModal):
2154         Keep a modal count and call setModal accordingly.
2155
2156         (WebKit::shim_NSApplication_RunModalForWindow):
2157         (WebKit::shimModalDialog):
2158         (WebKit::shimAlert):
2159         Call beginModal/endModal.
2160
2161         (WebKit::shimShowWindow):
2162         (WebKit::shimHideWindow):
2163         Call the shim functions.
2164         
2165         (WebKit::WebKitPluginProcessShimInitialize):
2166         Listen for notifications and call the necessary shim functions.
2167
2168         * WebKit2.xcodeproj/project.pbxproj:
2169         Link the plug-in process shim with AppKit and QuartzCore and WKSI.
2170
2171 2011-03-17  Jeff Miller  <jeffm@apple.com>
2172
2173         Use a consistent set of file patterns in the svn:ignore property for all .xcodeproj directories, specifically:
2174         
2175         *.mode*
2176         *.pbxuser
2177         *.perspective*
2178         project.xcworkspace
2179         xcuserdata
2180
2181         * WebKit2.xcodeproj: Modified property svn:ignore.
2182
2183 2011-03-17  Sam Weinig  <sam@webkit.org>
2184
2185         Reviewed by Anders Carlsson.
2186
2187         WKErrors need the PeerCertificateChain for certificate errors
2188         <rdar://problem/8951784>
2189         https://bugs.webkit.org/show_bug.cgi?id=56592
2190
2191         * Shared/WebCoreArgumentCoders.h:
2192         Special case encoding/decoding of ResourceErrors for the mac.
2193
2194         * Shared/mac/PlatformCertificateInfo.h:
2195         * Shared/mac/PlatformCertificateInfo.mm:
2196         (WebKit::PlatformCertificateInfo::PlatformCertificateInfo):
2197         Add constructor that take the PeerCertificateChain as CFArrayRef.
2198
2199         * Shared/mac/WebCoreArgumentCodersMac.mm:
2200         (CoreIPC::encodeResourceError):
2201         (CoreIPC::decodeResourceError):
2202         Add encode/decode for ResourceError using the underlying NSError
2203         and encoding/decoding as much of the userInfo as we know how to.
2204         Right now this includes all string values and the PeerCertificateChain.
2205
2206 2011-03-17  John Sullivan  <sullivan@apple.com>
2207
2208         Reviewed by Adam Roben.
2209
2210         https://bugs.webkit.org/show_bug.cgi?id=56574
2211         Dealloc'ing a WKView can leave a stale reference to it in NSWindow
2212
2213         * UIProcess/API/mac/WKView.mm:
2214         (-[WKView viewWillMoveToWindow:]):
2215         Clear the outgoing window's growBoxOwner if it is this view.
2216
2217 2011-03-17  Anders Carlsson  <andersca@apple.com>
2218
2219         Rubber-stamped by John Sullivan.
2220
2221         Rename PluginProcessShim.cpp to PluginProcessShim.mm.
2222
2223         * PluginProcess/mac/PluginProcessShim.cpp: Removed.
2224         * PluginProcess/mac/PluginProcessShim.mm: Copied from PluginProcess/mac/PluginProcessShim.cpp.
2225         * WebKit2.xcodeproj/project.pbxproj:
2226
2227 2011-03-17  Anders Carlsson  <andersca@apple.com>
2228
2229         Reviewed by Darin Adler.
2230
2231         Invalidate all NPObjects for a plug-in when that plug-in is destroyed
2232         https://bugs.webkit.org/show_bug.cgi?id=56511
2233         <rdar://problem/8993491>
2234
2235         Before this change, we would invalidate NPObjectProxy objects and delete NPObjectMessageReceiver
2236         objects when the last plug-in of a certain type was destroyed. Doing so caused us to hold on to memory
2237         which we don't need, and could also lead to crashes if the NPObjectMessageReceiver would get a message and
2238         tried to invoke it on a already deallocated NPObject.
2239
2240         * PluginProcess/PluginControllerProxy.cpp:
2241         (WebKit::PluginControllerProxy::initialize):
2242         If we fail to initialize, call removePluginControllerProxy instead of having WebProcessConnection do so.
2243
2244         (WebKit::PluginControllerProxy::destroy):
2245         Pass the plug-in to removePluginControllerProxy.
2246
2247         * PluginProcess/WebProcessConnection.cpp:
2248         (WebKit::WebProcessConnection::removePluginControllerProxy):
2249         Call NPRemoteObjectMap::pluginDestroyed when the plug-in has been destroyed.
2250
2251         (WebKit::WebProcessConnection::createPlugin):
2252         Don't call removePluginControllerProxy if the plug-in fails to initialize. PluginControllerProxy::initialize now
2253         takes care of doing this.
2254
2255         * Shared/Plugins/NPObjectMessageReceiver.cpp:
2256         (WebKit::NPObjectMessageReceiver::NPObjectMessageReceiver):
2257         (WebKit::NPObjectMessageReceiver::~NPObjectMessageReceiver):
2258         * Shared/Plugins/NPObjectMessageReceiver.h:
2259         Remove m_shouldReleaseObjectWhenInvalidating, we now know that no NPObjects will have been deallocated
2260         by the time the NPObjectMessageReceiver is destroyed.
2261
2262         (WebKit::NPObjectMessageReceiver::plugin):
2263         Add getter.
2264         
2265         * Shared/Plugins/NPObjectProxy.h:
2266         (WebKit::NPObjectProxy::plugin):
2267         Add getter.
2268         
2269         * Shared/Plugins/NPRemoteObjectMap.cpp:
2270         (WebKit::NPRemoteObjectMap::NPRemoteObjectMap):
2271         Remove m_isInvalidating.
2272
2273         (WebKit::NPRemoteObjectMap::npObjectProxyDestroyed):
2274         Simplify code.
2275
2276         (WebKit::NPRemoteObjectMap::pluginDestroyed):
2277         Rename invalidate to pluginDestroyed. Only invalidate/delete objects that belong to the given plug-in.
2278
2279         * Shared/Plugins/NPRemoteObjectMap.h:
2280         Remove m_isInvalidating.
2281         
2282         * WebProcess/Plugins/PluginProcessConnection.cpp:
2283         (WebKit::PluginProcessConnection::removePluginProxy):
2284         Call NPRemoteObjectMap::pluginDestroyed when the plug-in has been destroyed.
2285
2286 2011-03-17  Oleg Romashin  <oleg.romashin@nokia.com>
2287
2288         Reviewed by Anders Carlsson.
2289
2290         Teach WebKit2 messages.py generator to ifdef headers include
2291         which are related to ifdef-ed methods/types
2292         https://bugs.webkit.org/show_bug.cgi?id=55658
2293
2294         * Scripts/webkit2/messages.py:
2295         * Scripts/webkit2/messages_unittest.py:
2296
2297 2011-03-16  Joseph Pecoraro  <joepeck@webkit.org>
2298
2299         Reviewed by Kenneth Rohde Christiansen.
2300
2301         Viewport no longer allows an auto value for "user-scalable"
2302         https://bugs.webkit.org/show_bug.cgi?id=55416
2303
2304         Make the default value for userScalable be true.
2305
2306         * UIProcess/API/qt/qwkpage.cpp:
2307         (QWKPage::viewportAttributesForSize):
2308
2309 2011-03-16  Anders Carlsson  <andersca@apple.com>
2310
2311         Reviewed by Dan Bernstein.
2312
2313         NPObjectProxy and NPObjectMessageReceiver objects should know their Plugin object
2314         https://bugs.webkit.org/show_bug.cgi?id=56506
2315
2316         * PluginProcess/PluginControllerProxy.cpp:
2317         (WebKit::PluginControllerProxy::windowScriptNPObject):
2318         (WebKit::PluginControllerProxy::pluginElementNPObject):
2319         (WebKit::PluginControllerProxy::evaluate):
2320         (WebKit::PluginControllerProxy::getPluginScriptableNPObject):
2321         * Shared/Plugins/NPObjectMessageReceiver.cpp:
2322         (WebKit::NPObjectMessageReceiver::create):
2323         (WebKit::NPObjectMessageReceiver::NPObjectMessageReceiver):
2324         (WebKit::NPObjectMessageReceiver::invoke):
2325         (WebKit::NPObjectMessageReceiver::invokeDefault):
2326         (WebKit::NPObjectMessageReceiver::getProperty):
2327         (WebKit::NPObjectMessageReceiver::setProperty):
2328         (WebKit::NPObjectMessageReceiver::construct):
2329         * Shared/Plugins/NPObjectMessageReceiver.h:
2330         * Shared/Plugins/NPObjectProxy.cpp:
2331         (WebKit::NPObjectProxy::create):
2332         (WebKit::NPObjectProxy::NPObjectProxy):
2333         (WebKit::NPObjectProxy::invalidate):
2334         (WebKit::NPObjectProxy::initialize):
2335         (WebKit::NPObjectProxy::invoke):
2336         (WebKit::NPObjectProxy::invokeDefault):
2337         (WebKit::NPObjectProxy::getProperty):
2338         (WebKit::NPObjectProxy::setProperty):
2339         (WebKit::NPObjectProxy::construct):
2340         * Shared/Plugins/NPObjectProxy.h:
2341         * Shared/Plugins/NPRemoteObjectMap.cpp:
2342         (WebKit::NPRemoteObjectMap::createNPObjectProxy):
2343         (WebKit::NPRemoteObjectMap::registerNPObject):
2344         (WebKit::NPRemoteObjectMap::npVariantToNPVariantData):
2345         (WebKit::NPRemoteObjectMap::npVariantDataToNPVariant):
2346         * Shared/Plugins/NPRemoteObjectMap.h:
2347         * WebProcess/Plugins/PluginProxy.cpp:
2348         (WebKit::PluginProxy::pluginScriptableNPObject):
2349         (WebKit::PluginProxy::getWindowScriptNPObject):
2350         (WebKit::PluginProxy::getPluginElementNPObject):
2351         (WebKit::PluginProxy::evaluate):
2352
2353 2011-03-16  Beth Dakin  <bdakin@apple.com>
2354
2355         Reviewed by Darin Adler.
2356
2357         Fix for https://bugs.webkit.org/show_bug.cgi?id=54987 Crash beneath 
2358         WebPageProxy::viewWillStartLiveResize when resizing window after web process 
2359         crashed
2360         -and corresponding-
2361         <rdar://problem/9037685>
2362
2363         Just need simple isValid() checks here. 
2364         * UIProcess/WebPageProxy.cpp:
2365         (WebKit::WebPageProxy::initializeUIClient):
2366         (WebKit::WebPageProxy::viewWillStartLiveResize):
2367         (WebKit::WebPageProxy::viewWillEndLiveResize):
2368
2369 2011-03-16  Damian Kaleta  <dkaleta@apple.com>
2370
2371         Reviewed by Kevin Decker.
2372
2373         Add a user default that will force all plugins to opt in to non-executable data
2374         https://bugs.webkit.org/show_bug.cgi?id=56487
2375         <rdar://problem/9109095>
2376
2377         * UIProcess/Plugins/PluginProcessProxy.cpp:
2378         (WebKit::PluginProcessProxy::PluginProcessProxy):
2379         * UIProcess/Plugins/PluginProcessProxy.h:
2380         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
2381         (WebKit::PluginProcessProxy::pluginNeedsExecutableHeap):
2382
2383 2011-03-16  Chris Fleizach  <cfleizach@apple.com>
2384
2385         Reviewed by Darin Adler.
2386
2387         WK2: Need to propagate enhanced accessibility flag from UI -> web process
2388         https://bugs.webkit.org/show_bug.cgi?id=56379
2389
2390         Support sending the enhanced accessibility flag between processes.
2391
2392         * UIProcess/WebContext.cpp:
2393         (WebKit::WebContext::~WebContext):
2394         (WebKit::WebContext::setEnhancedAccessibility):
2395         * UIProcess/WebContext.h:
2396         * UIProcess/gtk/WebContextGtk.cpp:
2397         (WebKit::WebContet::platformInvalidateContext):
2398         * UIProcess/mac/WebContextMac.mm:
2399         (WebKit::WebContext::platformInitializeWebProcess):
2400         (WebKit::WebContext::platformInvalidateContext):
2401         * UIProcess/qt/WebContextQt.cpp:
2402         (WebKit::WebContext::platformInvalidateContext):
2403         * UIProcess/win/WebContextWin.cpp:
2404         (WebKit::WebContext::platformInvalidateContext):
2405         * WebProcess/WebProcess.cpp:
2406         (WebKit::WebProcess::setEnhancedAccessibility):
2407         * WebProcess/WebProcess.h:
2408         * WebProcess/WebProcess.messages.in:
2409
2410 2011-03-15  Oliver Hunt  <oliver@apple.com>
2411
2412         Reviewed by Geoffrey Garen.
2413
2414         Make Structure creation require a JSGlobalData
2415         https://bugs.webkit.org/show_bug.cgi?id=56438
2416
2417         Mechanical change to make all Structure creation use a JSGlobalData&.
2418
2419         * WebProcess/Plugins/Netscape/JSNPMethod.cpp:
2420         (WebKit::JSNPMethod::JSNPMethod):
2421         * WebProcess/Plugins/Netscape/JSNPMethod.h:
2422         (WebKit::JSNPMethod::createStructure):
2423         * WebProcess/Plugins/Netscape/JSNPObject.cpp:
2424         (WebKit::JSNPObject::JSNPObject):
2425         * WebProcess/Plugins/Netscape/JSNPObject.h:
2426         (WebKit::JSNPObject::createStructure):
2427
2428 2011-03-16  Alexey Proskuryakov  <ap@apple.com>
2429
2430         Reviewed by Dan Bernstein.
2431
2432         WebKit2: Sometimes Command-[ opens a new tab and loads the back page in it
2433         https://bugs.webkit.org/show_bug.cgi?id=56477
2434         <rdar://problem/8806664>
2435
2436         * UIProcess/API/mac/PageClientImpl.mm: (WebKit::PageClientImpl::doneWithKeyEvent):
2437         Set NSApplication current event when re-dispatching a key event that returned from the web
2438         process unhandled. That way, code that looks at current event modifiers won't be confused.
2439
2440 2011-03-16  Sam Weinig  <sam@webkit.org>
2441
2442         Reviewed by Adam Roben.
2443
2444         Add WebKit2 API to figure out if an input or textarea was edited
2445         https://bugs.webkit.org/show_bug.cgi?id=56474
2446
2447         Expose WKBundleNodeHandleGetHTMLInputElementLastChangeWasUserEdit and
2448         WKBundleNodeHandleGetHTMLTextAreaElementLastChangeWasUserEdit. Next time,
2449         I will work on giving these functions longer names.
2450
2451         * WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp:
2452         (WKBundleNodeHandleGetHTMLInputElementLastChangeWasUserEdit):
2453         (WKBundleNodeHandleGetHTMLTextAreaElementLastChangeWasUserEdit):
2454         * WebProcess/InjectedBundle/API/c/WKBundleNodeHandlePrivate.h:
2455         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
2456         (WebKit::InjectedBundleNodeHandle::htmlInputElementLastChangeWasUserEdit):
2457         (WebKit::InjectedBundleNodeHandle::htmlTextAreaElementLastChangeWasUserEdit):
2458         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h:
2459
2460 2011-03-16  Brady Eidson  <beidson@apple.com>
2461
2462         Reviewed by Adam Roben.
2463
2464         https://bugs.webkit.org/show_bug.cgi?id=56467
2465         IconDatabase-related crash seen in WK2 tests
2466
2467         * WebProcess/IconDatabase/WebIconDatabaseProxy.cpp:
2468         (WebKit::WebIconDatabaseProxy::setIconDataForIconURL): The IconLoader might set a null data for an icon, so handle that case.
2469
2470 2011-03-16  Benjamin Poulain  <benjamin.poulain@nokia.com>
2471
2472         Reviewed by Kenneth Rohde Christiansen.
2473
2474         [Qt][WK2] Loading an empty URL crashes
2475         https://bugs.webkit.org/show_bug.cgi?id=55501
2476
2477         A null WKURLRef is created in the API of WebKit 2 when converting a null string. The code
2478         of WKPageLoadURL assume the WKPageRef is not null which causes crashes if it is.
2479
2480         This patch uses the converter toWTFString() to pass from WKPageRef to WTFString. This converter
2481         ensure the returned string is a valid null string.
2482
2483         Tested through the Qt API tests.
2484
2485         * UIProcess/API/C/WKPage.cpp:
2486         (WKPageLoadURL):
2487         * UIProcess/API/qt/tests/qgraphicswkview/tst_qgraphicswkview.cpp:
2488         (tst_QGraphicsWKView::loadEmptyUrl):
2489         * UIProcess/API/qt/tests/qwkpage/qwkpage.pro: Added.
2490         * UIProcess/API/qt/tests/qwkpage/tst_qwkpage.cpp: Added.
2491         (tst_QWKPage::init):
2492         (tst_QWKPage::cleanup):
2493         (tst_QWKPage::loadEmptyUrl):
2494         * UIProcess/API/qt/tests/tests.pro:
2495
2496 2011-03-15  Brady Eidson  <beidson@apple.com>
2497
2498         Reviewed by Sam Weinig.
2499
2500         https://bugs.webkit.org/show_bug.cgi?id=56425
2501         WebKit2 icon database.
2502
2503         Project file paperwork:
2504         * DerivedSources.make:
2505         * DerivedSources.pro:
2506         * GNUmakefile.am:
2507         * WebKit2.pri:
2508         * WebKit2.pro:
2509         * WebKit2.xcodeproj/project.pbxproj:
2510         * win/WebKit2.vcproj:
2511         * win/WebKit2Common.vsprops:
2512         * Scripts/webkit2/messages.py: Special-case capitalization for messages that start with "URL" to be lowercased
2513           to "url" instead of "uRL".
2514
2515         Add messaging-related stuff:
2516         * Platform/CoreIPC/MessageID.h:
2517         * UIProcess/WebIconDatabase.messages.in: Added.
2518         * WebProcess/IconDatabase/WebIconDatabaseProxy.messages.in: Added.
2519         * UIProcess/WebProcessProxy.cpp:
2520         (WebKit::WebProcessProxy::didReceiveMessage):
2521         (WebKit::WebProcessProxy::didReceiveSyncMessage):
2522
2523         Prep to make WebIconDatabase an API object:
2524         * Shared/APIObject.h:
2525
2526         Add an "icon DB is enabled" flag to WebProcessCreationParameters:
2527         * Shared/WebProcessCreationParameters.cpp:
2528         (WebKit::WebProcessCreationParameters::encode):
2529         (WebKit::WebProcessCreationParameters::decode):
2530         * Shared/WebProcessCreationParameters.h:
2531
2532         Add SPI for client apps to set the icon database path:
2533         * UIProcess/API/C/WKContext.cpp:
2534         (WKContextSetIconDatabasePath):
2535         * UIProcess/API/C/WKContextPrivate.h:
2536         * UIProcess/WebContext.h:
2537         (WebKit::WebContext::setIconDatabasePath):
2538
2539         Hook up initialization, clearing, and messaging for the icon database:
2540         * UIProcess/WebContext.cpp:
2541         (WebKit::WebContext::WebContext):
2542         (WebKit::WebContext::~WebContext):
2543         (WebKit::WebContext::ensureWebProcess):
2544         (WebKit::WebContext::didReceiveMessage):
2545         (WebKit::WebContext::didReceiveSyncMessage):
2546         (WebKit::WebContext::iconDatabasePath):
2547         * UIProcess/gtk/WebContextGtk.cpp:
2548         (WebKit::WebContext::platformDefaultIconDatabasePath):
2549         * UIProcess/mac/WebContextMac.mm:
2550         (WebKit::WebContext::platformDefaultIconDatabasePath):
2551         * UIProcess/qt/WebContextQt.cpp:
2552         (WebKit::WebContext::platformDefaultIconDatabasePath):
2553         * UIProcess/win/WebContextWin.cpp:
2554         (WebKit::WebContext::platformDefaultIconDatabasePath):
2555
2556         Add the UIProcess-side IconDatabase. It will be the "actual database" as well as the API object:
2557         * UIProcess/WebIconDatabase.cpp: Added.
2558         (WebKit::WebIconDatabase::create):
2559         (WebKit::WebIconDatabase::~WebIconDatabase):
2560         (WebKit::WebIconDatabase::WebIconDatabase):
2561         (WebKit::WebIconDatabase::invalidate):
2562         (WebKit::WebIconDatabase::retainIconForPageURL):
2563         (WebKit::WebIconDatabase::releaseIconForPageURL):
2564         (WebKit::WebIconDatabase::setIconURLForPageURL):
2565         (WebKit::WebIconDatabase::setIconDataForIconURL):
2566         (WebKit::WebIconDatabase::iconDataForPageURL):
2567         (WebKit::WebIconDatabase::iconURLForPageURL):
2568         (WebKit::WebIconDatabase::iconDataKnownForIconURL):
2569         (WebKit::WebIconDatabase::loadDecisionForIconURL):
2570         (WebKit::WebIconDatabase::didReceiveMessage):
2571         (WebKit::WebIconDatabase::didReceiveSyncMessage):
2572         * UIProcess/WebIconDatabase.h: Added.
2573         (WebKit::WebIconDatabase::clearContext):
2574         (WebKit::WebIconDatabase::type):
2575
2576         Add the WebProcess-side IconDatabaseProxy. It acts as the WebCore IconDatabase and operates via messaging:
2577         * WebProcess/IconDatabase: Added.
2578         * WebProcess/IconDatabase/WebIconDatabaseProxy.cpp: Added.
2579         (WebKit::WebIconDatabaseProxy::~WebIconDatabaseProxy):
2580         (WebKit::WebIconDatabaseProxy::WebIconDatabaseProxy):
2581         (WebKit::WebIconDatabaseProxy::isEnabled):
2582         (WebKit::WebIconDatabaseProxy::setEnabled):
2583         (WebKit::WebIconDatabaseProxy::iconForPageURL):
2584         (WebKit::WebIconDatabaseProxy::retainIconForPageURL):
2585         (WebKit::WebIconDatabaseProxy::releaseIconForPageURL):
2586         (WebKit::WebIconDatabaseProxy::iconURLForPageURL):
2587         (WebKit::WebIconDatabaseProxy::iconDataKnownForIconURL):
2588         (WebKit::WebIconDatabaseProxy::loadDecisionForIconURL):
2589         (WebKit::WebIconDatabaseProxy::setIconURLForPageURL):
2590         (WebKit::WebIconDatabaseProxy::setIconDataForIconURL):
2591         (WebKit::WebIconDatabaseProxy::urlImportFinished):
2592         (WebKit::WebIconDatabaseProxy::didReceiveMessage):
2593         * WebProcess/IconDatabase/WebIconDatabaseProxy.h: Added.
2594
2595         Hook up initialization and messaging for the icon database proxy:
2596         * WebProcess/WebProcess.cpp:
2597         (WebKit::WebProcess::WebProcess):
2598         (WebKit::WebProcess::initializeWebProcess):
2599         (WebKit::WebProcess::didReceiveMessage):
2600         * WebProcess/WebProcess.h:
2601
2602 2011-03-15  Sam Weinig  <sam@webkit.org>
2603
2604         Reviewed by Anders Carlsson.
2605
2606         WebKit2: False SPOD cursor when context menu is open
2607         <rdar://problem/9029154>
2608         https://bugs.webkit.org/show_bug.cgi?id=56433
2609
2610         * UIProcess/WebPageProxy.cpp:
2611         (WebKit::WebPageProxy::showContextMenu):
2612         Update to match showPopupMenu idiomatically, and stop the responsivenessTimer
2613         since the act of showing the context menu could spin a nested runloop.
2614
2615         * UIProcess/mac/WebContextMenuProxyMac.mm:
2616         (WebKit::WebContextMenuProxyMac::showContextMenu):
2617         * UIProcess/qt/WebContextMenuProxyQt.cpp:
2618         (WebKit::WebContextMenuProxyQt::showContextMenu):
2619         * UIProcess/win/WebContextMenuProxyWin.cpp:
2620         (WebKit::WebContextMenuProxyWin::showContextMenu):
2621         Move isEmpty() check to implementations, since we don't want to show
2622         this in any case, not just the one where we check it.
2623
2624 2011-03-15  Siddharth Mathur  <siddharth.mathur@nokia.com>
2625
2626         Reviewed by Laszlo Gombos.
2627
2628         [Qt][Symbian][WK2] Fix exporting and importing the WebProcessMainQt symbol
2629         https://bugs.webkit.org/show_bug.cgi?id=56417
2630
2631         Use the Q_DECL_EXPORT and Q_DECL_IMPORT macros directly to make sure
2632         the symbol is always exported/imported.
2633
2634         * WebProcess/qt/WebProcessMainQt.cpp:
2635         (WebKit::WebProcessMainQt):
2636         * qt/MainQt.cpp:
2637
2638 2011-03-15  Alexey Proskuryakov  <ap@apple.com>
2639
2640         Reviewed by Darin Adler.
2641
2642         REGRESSION (WebKit2): keygen element doesn't work
2643         https://bugs.webkit.org/show_bug.cgi?id=56402
2644         <rdar://problem/9006545>
2645
2646         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
2647         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
2648         Added strings used by keygen.
2649
2650         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm: Initialize a WebCore pointer to
2651         a function used by keygen.
2652
2653 2011-03-15  Beth Dakin  <bdakin@apple.com>
2654
2655         Reviewed by Simon Fraser.
2656
2657         WebKit2 part of <rdar://problem/9075624> Overlay scrollbars slow down PLT by 6%
2658
2659         New WebKitystemInterface function to force the scrollbars to flash
2660         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
2661         (InitWebCoreSystemInterface):
2662
2663 2011-03-15  Anders Carlsson  <andersca@apple.com>
2664
2665         Reviewed by Sam Weinig.
2666
2667         Make sure that NP_Shutdown is always the last NPP function called
2668         https://bugs.webkit.org/show_bug.cgi?id=56391
2669         <rdar://problem/8989902>
2670
2671         Make sure to always increment the load count whenever a web process connection
2672         is opened to a plug-in process, and decrement it when the last web process connection
2673         goes away.
2674
2675         * PluginProcess/PluginProcess.cpp:
2676         (WebKit::PluginProcess::createWebProcessConnection):
2677         (WebKit::PluginProcess::startShutdownTimerIfNecessary):
2678         * Shared/Plugins/Netscape/NetscapePluginModule.cpp:
2679         * Shared/Plugins/Netscape/NetscapePluginModule.h:
2680         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
2681         (WebKit::NetscapePlugin::NetscapePlugin):
2682         (WebKit::NetscapePlugin::~NetscapePlugin):
2683
2684 2011-03-15  Martin Robinson  <mrobinson@igalia.com>
2685
2686         Reviewed by Adam Barth.
2687
2688         [GTK] [WebKit2] The UIProcess never changes the mouse cursor
2689         https://bugs.webkit.org/show_bug.cgi?id=56333
2690
2691         Add an implementation for WebView::addCursor for WebKit2 GTK+. This allows
2692         the cursor to change as the user mouses around the page. There is currently
2693         no test infrastructure to track cursor changes.
2694
2695         * UIProcess/gtk/WebView.cpp:
2696         (WebKit::WebView::setCursor): Ported implementation from WebKit1.
2697
2698 2011-03-15  Kevin Ollivier  <kevino@theolliviers.com>
2699
2700         Reviewed by Darin Adler.
2701
2702         Introduce WTF_USE_EXPORT_MACROS, which will allow us to put shared library import/export
2703         info into the headers rather than in export symbol definition files, but disable it on 
2704         all platforms initially so we can deal with port build issues one port at a time.
2705         
2706         https://bugs.webkit.org/show_bug.cgi?id=27551
2707
2708         * config.h:
2709
2710 2011-03-14  Alexey Proskuryakov  <ap@apple.com>
2711
2712         Reviewed by Darin Adler.
2713
2714         REGRESSION: Print preview is blank when selecting multiple pages per sheet
2715         https://bugs.webkit.org/show_bug.cgi?id=56341
2716         <rdar://problem/8991382>
2717
2718         * UIProcess/API/mac/WKPrintingView.mm: (pageDidDrawToPDF): Don't reset latest expected
2719         callback number after receiving a different one. We only update preview after receiving
2720         the latest expected page data (and the assumption is that AppKit will ask for pages in
2721         natural order for N-up).
2722
2723 2011-03-14  Adam Roben  <aroben@apple.com>
2724
2725         Make WKBundlePageCanHandleRequest return true for empty document URLs
2726
2727         Reviewed by Sam Weinig.
2728
2729         * WebProcess/WebPage/WebPage.cpp:
2730         (WebKit::WebPage::canHandleRequest): Return true for any URL schemes that are handled as
2731         empty documents, and defer to the platform for everything else.
2732
2733         * WebProcess/WebPage/WebPage.h: Added platformCanHandleRequest.
2734
2735         * WebProcess/WebPage/mac/WebPageMac.mm:
2736         (WebKit::WebPage::platformCanHandleRequest):
2737         * WebProcess/WebPage/qt/WebPageQt.cpp:
2738         (WebKit::WebPage::platformCanHandleRequest):
2739         * WebProcess/WebPage/win/WebPageWin.cpp:
2740         (WebKit::WebPage::platformCanHandleRequest):
2741         Renamed from canHandleRequest.
2742
2743 2011-03-14  Chris Fleizach  <cfleizach@apple.com>
2744
2745         Reviewed by Beth Dakin.
2746
2747         CrashTracer: 60 crashes in WebProcess at com.apple.WebKit2: -[AccessibilityWebPageObject accessibilityHitTest:] + 248
2748         https://bugs.webkit.org/show_bug.cgi?id=56336
2749
2750         Crash trace indicates a nil pointer access in one of these m_page->mainFrame()->coreFrame()->view()
2751         pointers.
2752
2753         * WebProcess/WebPage/mac/AccessibilityWebPageObject.mm:
2754         (-[AccessibilityWebPageObject accessibilityHitTest:]):
2755
2756 2011-03-14  Alice Liu  <alice.liu@apple.com>
2757
2758         Reviewed by Sam Weinig.
2759
2760         Provide API for creating WKImage from CGImageRef
2761         https://bugs.webkit.org/show_bug.cgi?id=56159
2762
2763         Add function for creating a WKImage from CGImage data.
2764         * Shared/API/c/cg/WKImageCG.cpp:
2765         (WKImageCreateFromCGImage): Added. Creates a graphics context for the bitmap-backed image and draws into it. 
2766         * Shared/API/c/cg/WKImageCG.h:
2767
2768 2011-03-14  Balazs Kelemen  <kbalazs@webkit.org>
2769
2770         Reviewed by Adam Roben.
2771
2772         [Qt][WK2]Unbreak InjectedBundle on Qt
2773         https://bugs.webkit.org/show_bug.cgi?id=54109
2774
2775         Add API's to WKURL and WKString to satisfy
2776         WebKitTestRunner's needs.
2777
2778         * Shared/API/c/WKString.cpp:
2779         (WKStringIsEqualToUTF8CStringIgnoringCase):
2780         * Shared/API/c/WKString.h:
2781         * Shared/API/c/WKURL.cpp:
2782         (WKURLCopyHostName):
2783         (WKURLCopyScheme):
2784         * Shared/API/c/WKURL.h:
2785         * Shared/WebString.h:
2786         (WebKit::WebString::equalToUTF8StringIgnoringCase):
2787         * Shared/WebURL.h: Added OwnPtr<KURL> member to be able
2788         to lazily parse the URL and store the result.
2789         (WebKit::WebURL::host):
2790         (WebKit::WebURL::protocol):
2791         (WebKit::WebURL::parseURLIfNecessary):
2792         * win/WebKit2.def: Revert the symbol exports that were
2793         needed to use KURL in WebKitTestRunner.
2794
2795 2011-03-14  Jeff Miller  <jeffm@apple.com>
2796
2797         Reviewed by Adam Roben.
2798
2799         Add WKViewSetScrollOffsetOnNextResize() to C API on Windows
2800         https://bugs.webkit.org/show_bug.cgi?id=56340
2801
2802         * UIProcess/API/C/win/WKView.cpp:
2803         (WKViewSetScrollOffsetOnNextResize): Added.
2804         * UIProcess/API/C/win/WKView.h: Added WKViewSetScrollOffsetOnNextResize().
2805         * UIProcess/win/WebView.cpp:
2806         (WebKit::WebView::onSizeEvent): Apply any scroll offset when setting the drawing area size.
2807         (WebKit::WebView::setScrollOffsetOnNextResize): Added.
2808         * UIProcess/win/WebView.h: Added setScrollOffsetOnNextResize().
2809
2810 2011-03-14  Brian Weinstein  <bweinstein@apple.com>
2811
2812         Reviewed by Adam Roben and Gavin Barraclough.
2813
2814         FileSystemWin.cpp needs listDirectory() implementation
2815         https://bugs.webkit.org/show_bug.cgi?id=56331
2816         <rdar://problem/9126635>
2817         
2818         Move PathWalker down into WebCore, and call the PathWalker in WebCore
2819         (that now has a second argument, the pattern to take).
2820
2821         * UIProcess/Plugins/win/PluginInfoStoreWin.cpp:
2822         (WebKit::PluginInfoStore::pluginPathsInDirectory):
2823
2824 2011-03-14  Sam Weinig  <sam@webkit.org>
2825
2826         Reviewed by Darin Adler.
2827
2828         WebKit2: No icon shown for <input type=file>
2829         <rdar://problem/8988982>
2830         https://bugs.webkit.org/show_bug.cgi?id=54288
2831
2832         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2833         (WebKit::WebChromeClient::chooseIconForFiles):
2834         Add implementation for chooseIconForFiles which calls down to Icon::createIconForFiles.
2835
2836 2011-03-14  Brady Eidson  <beidson@apple.com>
2837
2838         Reviewed by Dan Bernstein.
2839
2840         <rdar://problem/8762095> and https://bugs.webkit.org/show_bug.cgi?id=55172
2841         Need WK2 API to view/manage origins with LocalStorage
2842
2843         Hookup the existing API stubs to the WebCore implementations:
2844         * WebProcess/KeyValueStorage/WebKeyValueStorageManager.cpp:
2845         (WebKit::WebKeyValueStorageManager::getKeyValueStorageOrigins):
2846         (WebKit::WebKeyValueStorageManager::deleteEntriesForOrigin):
2847         (WebKit::WebKeyValueStorageManager::deleteAllEntries):
2848
2849 2011-03-13  Brady Eidson  <beidson@apple.com>
2850
2851         Reviewed by Sam Weinig.
2852
2853         <rdar://problem/9127270> and https://bugs.webkit.org/show_bug.cgi?id=56282
2854
2855         Pass the path along with creation parameters:
2856         * Shared/WebProcessCreationParameters.cpp:
2857         (WebKit::WebProcessCreationParameters::encode):
2858         (WebKit::WebProcessCreationParameters::decode):
2859         * Shared/WebProcessCreationParameters.h:
2860
2861         Add SPI to set the path:
2862         * UIProcess/API/C/WKContext.cpp:
2863         (WKContextSetLocalStorageDirectory):
2864         * UIProcess/API/C/WKContextPrivate.h:
2865
2866         Pass the path along in the process creation parameters:
2867         * UIProcess/WebContext.cpp:
2868         (WebKit::WebContext::ensureWebProcess):
2869         (WebKit::WebContext::localStorageDirectory):
2870         * UIProcess/WebContext.h:
2871         (WebKit::WebContext::setLocalStorageDirectory):
2872
2873         * UIProcess/gtk/WebContextGtk.cpp:
2874         (WebKit::WebContext::platformDefaultLocalStorageDirectory):
2875         * UIProcess/mac/WebContextMac.mm:
2876         (WebKit::WebContext::platformDefaultLocalStorageDirectory):
2877         * UIProcess/qt/WebContextQt.cpp:
2878         (WebKit::WebContext::platformDefaultLocalStorageDirectory):
2879         * UIProcess/win/WebContextWin.cpp:
2880         (WebKit::WebContext::platformDefaultLocalStorageDirectory):
2881
2882         Include the path with settings updates, because WebCore needs it set on the Settings object:
2883         * WebProcess/WebPage/WebPage.cpp:
2884         (WebKit::WebPage::updatePreferences):
2885
2886         * WebProcess/WebProcess.cpp:
2887         (WebKit::WebProcess::initializeWebProcess):
2888         * WebProcess/WebProcess.h:
2889         (WebKit::WebProcess::localStorageDirectory):
2890
2891         Sandboxing stuff:
2892         * WebProcess/com.apple.WebProcess.sb:
2893         * WebProcess/mac/WebProcessMac.mm:
2894         (WebKit::initializeSandbox):
2895
2896 2011-03-12  Jer Noble  <jer.noble@apple.com>
2897
2898         Reviewed by Mark Rowe.
2899
2900         WebKit2: Build WKFullScreenWindowController cleanly in 32-bit.
2901         https://bugs.webkit.org/show_bug.cgi?id=56260
2902
2903         Include <Carbon/Carbon.h> instead of <HIToolbox/MacApplication.h>.
2904
2905         * UIProcess/mac/WKFullScreenWindowController.mm:
2906
2907 2011-03-13  Sam Weinig  <sam@webkit.org>
2908
2909         Reviewed by Anders Carlsson.
2910
2911         Add ability to create a WKErrorRef
2912         <rdar://problem/9115768>
2913         https://bugs.webkit.org/show_bug.cgi?id=56279
2914
2915         * Shared/API/c/cf/WKErrorCF.cpp: Added.
2916         (WKErrorCreateWithCFError):
2917         (WKErrorCopyCFError):
2918         * Shared/API/c/cf/WKErrorCF.h: Added.
2919         Add new API to create a WKErrorRef from a CFErrorRef
2920         and vice-versa.
2921
2922         * WebKit2.xcodeproj/project.pbxproj:
2923         * win/WebKit2.vcproj:
2924         * win/WebKit2Generated.make:
2925         Add new files.
2926
2927 2011-03-13  Pratik Solanki  <psolanki@apple.com>
2928
2929         Reviewed by Brady Eidson.
2930
2931         Make adjustMIMETypeIfNecessary use CFNetwork directly
2932         https://bugs.webkit.org/show_bug.cgi?id=55912
2933
2934         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
2935         (InitWebCoreSystemInterface): Support for new WKSI functions.
2936
2937 2011-03-13  Dan Bernstein  <mitz@apple.com>
2938
2939         Reviewed by Darin Adler.
2940
2941         WebPageProxy cleanup
2942         https://bugs.webkit.org/show_bug.cgi?id=56267
2943
2944         * UIProcess/WebPageProxy.cpp: Moved all Mac-only function implementations from
2945         here to WebPageProxyMac.mm.
2946         * UIProcess/WebPageProxy.h: Cleaned up #includes.
2947         * UIProcess/mac/WebPageProxyMac.mm: Moved all Mac-only function implementations
2948         here.
2949         (WebKit::WebPageProxy::updateWindowIsVisible):
2950         (WebKit::WebPageProxy::windowAndViewFramesChanged):
2951         (WebKit::WebPageProxy::getMarkedRange):
2952         (WebKit::WebPageProxy::characterIndexForPoint):
2953         (WebKit::WebPageProxy::firstRectForCharacterRange):
2954         (WebKit::WebPageProxy::writeSelectionToPasteboard):
2955         (WebKit::WebPageProxy::setDragImage):
2956         (WebKit::WebPageProxy::performDictionaryLookupAtLocation):
2957         (WebKit::WebPageProxy::interpretKeyEvent):
2958         (WebKit::WebPageProxy::sendComplexTextInputToPlugin):
2959         (WebKit::WebPageProxy::uppercaseWord):
2960         (WebKit::WebPageProxy::lowercaseWord):
2961         (WebKit::WebPageProxy::capitalizeWord):
2962         (WebKit::WebPageProxy::setSmartInsertDeleteEnabled):
2963         (WebKit::WebPageProxy::didPerformDictionaryLookup):
2964         (WebKit::WebPageProxy::registerWebProcessAccessibilityToken):
2965         (WebKit::WebPageProxy::registerUIProcessAccessibilityTokens):
2966         (WebKit::WebPageProxy::setComplexTextInputEnabled):
2967
2968 2011-03-13  Dan Bernstein  <mitz@apple.com>
2969
2970         Reviewed by Darin Adler.
2971
2972         <rdar://problem/8949683> WebKit2: Drag image is offset when the page is scrolled down
2973         https://bugs.webkit.org/show_bug.cgi?id=56265
2974
2975         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
2976         (WebKit::WebDragClient::startDrag): Send the location in view coordinates rather than
2977         document coordinates.
2978
2979 2011-03-13  Dan Bernstein  <mitz@apple.com>
2980
2981         Reviewed by Mark Rowe.
2982
2983         Fix a crash when dragging.
2984
2985         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
2986         (WebKit::convertImageToBitmap): Retain the saved context.
2987
2988 2011-03-12  Darin Adler  <darin@apple.com>
2989
2990         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
2991         (WebKit::WebDragClient::startDrag): Fixed typo in a comment.
2992
2993 2011-03-11  Darin Adler  <darin@apple.com>
2994
2995         Reviewed by Sam Weinig.
2996
2997         Dragging image to desktop gives webloc instead of image file in WebKit2
2998         https://bugs.webkit.org/show_bug.cgi?id=56193
2999
3000         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
3001         (WebKit::convertImageToBitmap): Added. Factored out from startDrag to
3002         make the startDrag code clearer.
3003         (WebKit::WebDragClient::startDrag): Streamlined code a bit.
3004         (WebKit::cachedImage): Added. Helper for function below.
3005         (WebKit::arrayForURLsWithTitles): Added. Helper for function below.
3006         (WebKit::WebDragClient::declareAndWriteDragImage): Added code to handle file
3007         promises and removed a log of uneeded code.
3008         (-[WKPasteboardFilePromiseOwner copyDropDirectory]): Added.
3009         (promisedDataClient): Added.
3010         (-[WKPasteboardOwner clearImage]): Added.
3011         (-[WKPasteboardOwner initWithImage:]): Added.
3012         (-[WKPasteboardOwner dealloc]): Added.
3013         (-[WKPasteboardOwner finalize]): Added.
3014         (-[WKPasteboardOwner pasteboard:provideDataForType:]): Added.
3015         (-[WKPasteboardOwner pasteboardChangedOwner:]): Added.
3016         (matchesExtensionOrEquivalent): Added.
3017         (-[WKPasteboardOwner namesOfPromisedFilesDroppedAtDestination:]): Added.
3018         Much of the new code above came from the WebKit1 drag code.
3019
3020         * WebProcess/WebPage/WebPage.cpp:
3021         (WebKit::WebPage::dragEnded): Added call to Mac-only platformDragEnded.
3022         * WebProcess/WebPage/WebPage.h: Added Mac-only platformDragEnded and m_dragSource.
3023         * WebProcess/WebPage/mac/WebPageMac.mm:
3024         (WebKit::WebPage::setDragSource): Added.
3025         (WebKit::WebPage::platformDragEnded): Added.
3026
3027 2011-03-12  Mark Rowe  <mrowe@apple.com>
3028
3029         Fix the 32-bit build.
3030
3031         This involves hacking around some HIToolbox headers that do things of dubious correctness,
3032         and fixing the usual CGRect vs NSRect issues.
3033         
3034         * UIProcess/mac/WKFullScreenWindowController.mm:
3035         (-[WKFullScreenWindowController enterFullScreen:]): NSRect is not CGRect.
3036         * WebProcess/FullScreen/mac/WebFullScreenManagerMac.mm:
3037         (WebKit::WebFullScreenManagerMac::beginExitFullScreenAnimation): Ditto.
3038
3039 2011-03-12  Anders Carlsson  <andersca@apple.com>
3040
3041         Reviewed by Sam Weinig.
3042
3043         * WebProcess/WebPage/WebFrame.cpp:
3044         (WebKit::WebFrame::url):
3045         Get the URL from the loader, not from the document.
3046
3047         (WebKit::WebFrame::suggestedFilenameForResourceWithURL):
3048         Return the correct suggested filename for the main resource.
3049
3050         (WebKit::WebFrame::mimeTypeForResourceWithURL):
3051         Return the correct mime type for the main resource.
3052
3053 2011-03-12  Anders Carlsson  <andersca@apple.com>
3054
3055         Reviewed by Sam Weinig.
3056
3057         Should be able to download a PDF to the Downloads folder
3058         https://bugs.webkit.org/show_bug.cgi?id=56256
3059
3060         * UIProcess/API/C/WKPage.h:
3061         Add WKPageSaveDataToFileInDownloadsFolderCallback to the UI client.
3062
3063         * UIProcess/API/mac/PDFViewController.h:
3064         * UIProcess/API/mac/PDFViewController.mm:
3065         (-[WKPDFView _applyPDFPreferences]):
3066         (-[WKPDFView _updatePreferences:]):
3067         Use new PDFViewController::page getter.
3068
3069         (-[WKPDFView PDFViewSavePDFToDownloadFolder:]):
3070         Call PDFViewController::savePDFToDownloadsFolder.
3071
3072         (WebKit::releaseCFData):
3073         (WebKit::PDFViewController::savePDFToDownloadsFolder):
3074         Create a WebData that wraps the CFData, then pass it along to
3075         WebPageProxy::saveDataToFileInDownloadsFolder.
3076
3077         * UIProcess/WebPageProxy.cpp:
3078         (WebKit::WebPageProxy::saveDataToFileInDownloadsFolder):
3079         Call WebUIClient::saveDataToFileInDownloadsFolder.
3080
3081         (WebKit::WebUIClient::saveDataToFileInDownloadsFolder):
3082         * UIProcess/WebUIClient.h:
3083         Call the UI client callback function.
3084
3085 2011-03-12  Anders Carlsson  <andersca@apple.com>
3086
3087         Reviewed by Sam Weinig.
3088
3089         WebData should be able to wrap already existing data
3090         https://bugs.webkit.org/show_bug.cgi?id=56254
3091
3092         * Shared/WebData.h:
3093         (WebKit::WebData::createWithoutCopying):
3094         (WebKit::WebData::create):
3095         (WebKit::WebData::~WebData):
3096         (WebKit::WebData::bytes):
3097         (WebKit::WebData::size):
3098         (WebKit::WebData::WebData):
3099         (WebKit::WebData::fastFreeBytes):
3100
3101 2011-03-12  Jer Noble  <jer.noble@apple.com>
3102
3103         Reviewed by Eric Carlson.
3104
3105         WebKit2: Initialize the WebFullScreenManagerProxy with a WKView
3106         https://bugs.webkit.org/show_bug.cgi?id=56250
3107
3108         * UIProcess/API/mac/WKView.mm:
3109         (-[WKView initWithFrame:contextRef:pageGroupRef:]): Call fullScreenManager()->setView(self).
3110
3111 2011-03-11  Jer Noble  <jer.noble@apple.com>
3112
3113         Reviewed by Anders Carlsson.
3114
3115         Add full screen animation code to WebFullScreenManager.
3116         https://bugs.webkit.org/show_bug.cgi?id=56220
3117
3118         * WebProcess/FullScreen/WebFullScreenManager.cpp: .
3119         (WebKit::WebFullScreenManager::~WebFullScreenManager): Added.
3120         (WebKit::WebFullScreenManager::exitFullScreenForElement): Remove ASSERTs.
3121         (WebKit::WebFullScreenManager::willEnterFullScreen): Set the full screen renderer's background color.
3122         (WebKit::WebFullScreenManager::didEnterFullScreen): Ditto.
3123         (WebKit::WebFullScreenManager::willExitFullScreen): Ditto.
3124         (WebKit::WebFullScreenManager::didExitFullScreen): Ditto.
3125         * WebProcess/FullScreen/WebFullScreenManager.h: Make a few functions pure virtual to be implemented in a 
3126             concrete subclass.
3127         * WebProcess/FullScreen/mac/WebFullScreenManagerMac.h: Added.
3128         * WebProcess/FullScreen/mac/WebFullScreenManagerMac.mm: Added.
3129         (-[WebFullScreenManagerAnimationListener initWithManager:WebKit::began:finished:]): Listener for CAAnimations.
3130         (-[WebFullScreenManagerAnimationListener animationDidStart:]): Added.
3131         (-[WebFullScreenManagerAnimationListener animationDidStop:finished:]): Added.
3132         (-[WebFullScreenManagerAnimationListener invalidate]): Added.
3133         (WebKit::WebFullScreenManager::create): Now creates a WebFullScreenManagerMac.
3134         (WebKit::WebFullScreenManagerMac::create): Added.
3135         (WebKit::WebFullScreenManagerMac::WebFullScreenManagerMac): Added.
3136         (WebKit::WebFullScreenManagerMac::~WebFullScreenManagerMac): Added.
3137         (WebKit::WebFullScreenManagerMac::setRootFullScreenLayer): Set up the remote layer host.
3138         (WebKit::WebFullScreenManagerMac::beginEnterFullScreenAnimation): Create a CATransform3D
3139             which will animate the full screen renderer from its initial position to its final one.
3140         (WebKit::WebFullScreenManagerMac::beginExitFullScreenAnimation): Ditto.
3141
3142 2011-03-11  Jer Noble  <jer.noble@apple.com>
3143
3144         Reviewed by Anders Carlsson.
3145
3146         Hook up new WKFullScreenWindowController functions to WebFullScreenManagerProxy
3147         https://bugs.webkit.org/show_bug.cgi?id=56218
3148
3149         * UIProcess/WebFullScreenManagerProxy.cpp:
3150         * UIProcess/mac/WebFullScreenManagerProxyMac.mm: Added.
3151         (WebKit::WebFullScreenManagerProxy::enterFullScreen): Call into WKFullScreenWindowController.
3152         (WebKit::WebFullScreenManagerProxy::exitFullScreen): Ditto.
3153         (WebKit::WebFullScreenManagerProxy::beganEnterFullScreenAnimation): Ditto.
3154         (WebKit::WebFullScreenManagerProxy::finishedEnterFullScreenAnimation): Ditto.
3155         (WebKit::WebFullScreenManagerProxy::beganExitFullScreenAnimation): Ditto.
3156         (WebKit::WebFullScreenManagerProxy::finishedExitFullScreenAnimation): Ditto.
3157         (WebKit::WebFullScreenManagerProxy::enterAcceleratedCompositingMode): Ditto.
3158         (WebKit::WebFullScreenManagerProxy::exitAcceleratedCompositingMode): Ditto.
3159         (WebKit::WebFullScreenManagerProxy::getFullScreenRect): Ditto.
3160         * UIProcess/API/mac/WKView.mm:
3161         (-[WKView fullScreenWindowController]): Lazily instantiate a WKFullScreenWindowController.
3162         * UIProcess/API/mac/WKViewInternal.h:
3163
3164 2011-03-11  Jer Noble  <jer.noble@apple.com>
3165
3166         Reviewed by Anders Carlsson.
3167
3168         Add the WKFullScreenWindowController, mostly cribbed from WebKit's WebFullScreenController.
3169
3170         [WebKit2] Implement a full screen window controller
3171         https://bugs.webkit.org/show_bug.cgi?id=56210
3172
3173         * UIProcess/mac/WKFullScreenWindowController.h: Added.
3174         * UIProcess/mac/WKFullScreenWindowController.mm: Added.
3175         (-[WKFullScreenWindowController init]): Remove the _mediaEventListener.
3176         (-[WKFullScreenWindowController dealloc]): Make sure to cancel previous async requests.
3177         (-[WKFullScreenWindowController windowDidLoad]): Remove the Tiger protection.
3178         (-[WKFullScreenWindowController webView]): Type change.
3179         (-[WKFullScreenWindowController setWebView:]): Type change.
3180         (-[WKFullScreenWindowController applicationDidResignActive:]): Case changes.
3181         (-[WKFullScreenWindowController applicationDidChangeScreenParameters:]): Case changes.
3182         (-[WKFullScreenWindowController enterFullScreen:]): Removed most of the animation code
3183             which will reappear in WebFullScreenManager.
3184         (-[WKFullScreenWindowController beganEnterFullScreenAnimation]): Added.
3185         (-[WKFullScreenWindowController finishedEnterFullScreenAnimation:]): Added.
3186         (-[WKFullScreenWindowController exitFullScreen]): Ditto to enterFullScreen.
3187         (-[WKFullScreenWindowController beganExitFullScreenAnimation]): Added.
3188         (-[WKFullScreenWindowController finishedExitFullScreenAnimation:]): Added.
3189         (-[WKFullScreenWindowController enterAcceleratedCompositingMode:WebKit::]): Set up the
3190             layer tree host.
3191         (-[WKFullScreenWindowController exitAcceleratedCompositingMode]): Tear down same.
3192         (-[WKFullScreenWindowController getFullScreenRect:WebCore::]): Added.
3193         (-[WKFullScreenWindowController _updateMenuAndDockForFullScreen]): Case changes.
3194         (-[WKFullScreenWindowController _disableIdleDisplaySleep]): Ditto.
3195         (-[WKFullScreenWindowController _enableIdleDisplaySleep]): Ditto.
3196         (-[WKFullScreenWindowController _disableIdleSystemSleep]): Ditto.
3197         (-[WKFullScreenWindowController _enableIdleSystemSleep]): Ditto.
3198         (-[WKFullScreenWindowController _enableTickleTimer]): Ditto.
3199         (-[WKFullScreenWindowController _disableTickleTimer]): Ditto.
3200         (-[WKFullScreenWindowController _tickleTimerFired]): Ditto.
3201         (-[WKFullScreenWindowController _updatePowerAssertions]): Use _isPlaying ivar.
3202         (-[WKFullScreenWindowController _manager]): Added.
3203         (-[WKFullScreenWindowController _requestExit]): Case changes.
3204         (-[WKFullScreenWindowController _requestExitFullScreenWithAnimation:]): Ditto.
3205         (-[WKFullScreenWindowController _swapView:with:]): Added.
3206         (-[WKFullScreenWindowController _fullScreenWindow]): Case changes.
3207         (-[WKFullScreenWindow initWithContentRect:styleMask:backing:defer:]): Geometry no
3208             longer needs to be flipped.
3209         (-[WKFullScreenWindow cancelOperation:]): Case changes.
3210
3211 2011-03-11  Jer Noble  <jer.noble@apple.com>
3212
3213         Reviewed by Anders Carlsson.
3214
3215         Create new interface stubs to support full screen mode in WebKit2.
3216
3217         WebKit2: Plumb new full screen animation APIs through WebKit2.
3218         https://bugs.webkit.org/show_bug.cgi?id=55993
3219
3220         * UIProcess/WebFullScreenManagerProxy.cpp:
3221         (WebKit::WebFullScreenManagerProxy::WebFullScreenManagerProxy): Added.
3222         (WebKit::WebFullScreenManagerProxy::invalidate): Clear m_webView.
3223         (WebKit::WebFullScreenManagerProxy::setWebView): Set m_webView.
3224         (WebKit::WebFullScreenManagerProxy::beginEnterFullScreenAnimation): Added.
3225         (WebKit::WebFullScreenManagerProxy::beginExitFullScreenAnimation): Added.
3226         (WebKit::WebFullScreenManagerProxy::beganEnterFullScreenAnimation): Added stub.
3227         (WebKit::WebFullScreenManagerProxy::finishedEnterFullScreenAnimation): Added stub.
3228         (WebKit::WebFullScreenManagerProxy::beganExitFullScreenAnimation): Added stub.
3229         (WebKit::WebFullScreenManagerProxy::finishedExitFullScreenAnimation): Added stub.
3230         (WebKit::WebFullScreenManagerProxy::enterAcceleratedCompositingMode): Added stub.
3231         (WebKit::WebFullScreenManagerProxy::exitAcceleratedCompositingMode): Added stub.
3232         (WebKit::WebFullScreenManagerProxy::getFullScreenRect): Added stub.
3233         * UIProcess/WebFullScreenManagerProxy.h:
3234         * UIProcess/WebFullScreenManagerProxy.messages.in: Added new message definitions.
3235         * UIProcess/WebPageProxy.cpp: Moved include of WebFullScreenManagerProxy.h into source file.
3236         * UIProcess/WebPageProxy.h: Ditto.
3237         * WebProcess/FullScreen/WebFullScreenManager.cpp:
3238         (WebKit::WebFullScreenManager::element): Added.
3239         (WebKit::WebFullScreenManager::supportsFullScreen): Send message through WebPage.
3240         (WebKit::WebFullScreenManager::enterFullScreenForElement): Ditto.
3241         (WebKit::WebFullScreenManager::exitFullScreenForElement): Ditto.
3242         (WebKit::WebFullScreenManager::beganEnterFullScreenAnimation): Added..
3243         (WebKit::WebFullScreenManager::finishedEnterFullScreenAnimation): Added.
3244         (WebKit::WebFullScreenManager::beganExitFullScreenAnimation): Added.
3245         (WebKit::WebFullScreenManager::finishedExitFullScreenAnimation): Added.
3246         (WebKit::WebFullScreenManager::setRootFullScreenLayer): Added stub.
3247         (WebKit::WebFullScreenManager::getFullScreenRect): Added.
3248         (WebKit::WebFullScreenManager::beginEnterFullScreenAnimation): Added stub.
3249         (WebKit::WebFullScreenManager::beginExitFullScreenAnimation): Added stub.
3250         * WebProcess/FullScreen/WebFullScreenManager.h:
3251         * WebProcess/FullScreen/WebFullScreenManager.messages.in: Added new message definitions.
3252         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3253         (WebKit::WebChromeClient::setRootFullScreenLayer): Added.
3254         * WebProcess/WebCoreSupport/WebChromeClient.h:
3255
3256 2011-03-11  Alice Liu  <alice.liu@apple.com>
3257
3258         Reviewed by Sam Weinig.
3259
3260         Support encoding /decoding WebData in usermessages
3261         https://bugs.webkit.org/show_bug.cgi?id=56158
3262
3263         Added encoding/decoding for APIObject::TypeData
3264         * Shared/UserMessageCoders.h:
3265         (WebKit::UserMessageEncoder::baseEncode):
3266         (WebKit::UserMessageDecoder::baseDecode):
3267
3268 2011-03-11  Alice Liu  <alice.liu@apple.com>
3269
3270         Reviewed by Sam Weinig.
3271
3272         Add api for "remove" to WKMutableDictionary
3273         https://bugs.webkit.org/show_bug.cgi?id=56157
3274
3275         * Shared/API/c/WKMutableDictionary.cpp:
3276         (WKDictionaryRemoveItem): Added; call remove on MutableDictionary impl.
3277         * Shared/API/c/WKMutableDictionary.h:
3278         * Shared/MutableDictionary.cpp:
3279         (WebKit::MutableDictionary::remove): Added; call remove on the underlying hashmap.
3280         * Shared/MutableDictionary.h:
3281
3282 2011-03-11  Sheriff Bot  <webkit.review.bot@gmail.com>
3283
3284         Unreviewed, rolling out r80899 and r80912.
3285         http://trac.webkit.org/changeset/80899
3286         http://trac.webkit.org/changeset/80912
3287         https://bugs.webkit.org/show_bug.cgi?id=56236
3288
3289         Caused animation tests to crash on Snow Leopard WebKit2
3290         (Requested by rniwa on #webkit).
3291
3292         * Shared/ShareableBitmap.cpp:
3293         (WebKit::ShareableBitmap::create):
3294         (WebKit::ShareableBitmap::createShareable):
3295         (WebKit::ShareableBitmap::resize):
3296         * Shared/ShareableBitmap.h:
3297         (WebKit::ShareableBitmap::numBytesForSize):
3298         (WebKit::ShareableBitmap::sizeInBytes):
3299         * UIProcess/DrawingAreaProxyImpl.cpp:
3300         (WebKit::DrawingAreaProxyImpl::update):
3301         * WebKit2.xcodeproj/project.pbxproj:
3302         * WebProcess/WebPage/DrawingArea.h:
3303         (WebKit::DrawingArea::didUpdate):
3304         * WebProcess/WebPage/DrawingArea.messages.in:
3305         * WebProcess/WebPage/DrawingAreaImpl.cpp:
3306         (WebKit::DrawingAreaImpl::~DrawingAreaImpl):
3307         (WebKit::DrawingAreaImpl::sendDidUpdateBackingStoreState):
3308         (WebKit::DrawingAreaImpl::didUpdate):
3309         (WebKit::DrawingAreaImpl::exitAcceleratedCompositingMode):
3310         (WebKit::DrawingAreaImpl::display):
3311         * WebProcess/WebPage/DrawingAreaImpl.h:
3312         * WebProcess/WebPage/SharedMemoryCache.cpp: Removed.
3313         * WebProcess/WebPage/SharedMemoryCache.h: Removed.
3314         * win/WebKit2.vcproj:
3315
3316 2011-03-11  Brian Weinstein  <bweinstein@apple.com>
3317
3318         Windows build fix. Add SharedMemoryCache to the vcproj.
3319
3320         * win/WebKit2.vcproj:
3321
3322 2011-03-11  Alexey Proskuryakov  <ap@apple.com>
3323
3324         Reviewed by Sam Weinig.
3325
3326         https://bugs.webkit.org/show_bug.cgi?id=56222
3327         A window remains frozen if web process crashes during printing
3328
3329         * UIProcess/API/mac/PageClientImpl.h:
3330         * UIProcess/API/mac/PageClientImpl.mm:
3331         * UIProcess/PageClient.h:
3332         * UIProcess/WebPageProxy.cpp:
3333         (WebKit::WebPageProxy::setComplexTextInputEnabled):
3334         * UIProcess/WebPageProxy.h:
3335         Moved setAutodisplay code into WKPrintingView.
3336
3337         * UIProcess/API/mac/WKPrintingView.h:
3338         * UIProcess/API/mac/WKView.mm:
3339         (-[WKView printOperationWithPrintInfo:forFrame:]):
3340         Keep a reference to the actual WKView, so that we can manipulate how it displays, even if
3341         page goes away.
3342
3343         * UIProcess/API/mac/WKPrintingView.mm:
3344         (-[WKPrintingView initWithFrameProxy:WebKit::view:]):
3345         (-[WKPrintingView _setAutodisplay:]):
3346         (-[WKPrintingView _suspendAutodisplay]):
3347         (-[WKPrintingView _delayedResumeAutodisplayTimerFired]):
3348         Move setAutodisplay here.
3349
3350 2011-03-11  Anders Carlsson  <andersca@apple.com>
3351
3352         Reviewed by Sam Weinig.
3353
3354         Add a shared memory cache to the web process
3355         https://bugs.webkit.org/show_bug.cgi?id=56232
3356
3357         Add a very simple shared memory cache to the web process, so that we don't have to allocate and
3358         free memory over and over when painting.
3359
3360         * Shared/ShareableBitmap.cpp:
3361         (WebKit::ShareableBitmap::create):
3362         (WebKit::ShareableBitmap::createShareable):
3363         (WebKit::ShareableBitmap::resize):
3364         * Shared/ShareableBitmap.h:
3365         (WebKit::ShareableBitmap::numBytesNeededForBitmapSize):
3366         (WebKit::ShareableBitmap::sizeInBytes):
3367         Rename numBytesForSize to numBytesNeededForBitmapSize.
3368
3369         * UIProcess/DrawingAreaProxyImpl.cpp:
3370         (WebKit::DrawingAreaProxyImpl::update):
3371         Always send back a DidUpdate message, even if we didn't use the update info.
3372         This is needed so that the web process knows when the UI process is done with the shared memory inside
3373         the update info struct.
3374
3375         * WebKit2.xcodeproj/project.pbxproj:
3376         Add new files.
3377
3378         * WebProcess/WebPage/DrawingArea.h:
3379         (WebKit::DrawingArea::didUpdate):
3380         * WebProcess/WebPage/DrawingArea.messages.in:
3381         DidUpdate now takes a boolean.
3382
3383         * WebProcess/WebPage/DrawingAreaImpl.cpp:
3384         (WebKit::sharedMemoryCache):
3385         Add shared memory cache.
3386
3387         (WebKit::DrawingAreaImpl::~DrawingAreaImpl):
3388         Return the shared memory to the cache.
3389
3390         (WebKit::DrawingAreaImpl::sendDidUpdateBackingStoreState):
3391         display now takes an extra boolean.
3392
3393         (WebKit::DrawingAreaImpl::didUpdate):
3394         Return the shared memory to the cache.
3395
3396         (WebKit::DrawingAreaImpl::display):
3397         If useSharedMemoryCache is true, get shared memory from the cache.
3398
3399         * WebProcess/WebPage/SharedMemoryCache.cpp: Added.
3400         (WebKit::SharedMemoryCache::acquireSharedMemory):
3401         If the memory we currently hold on to is big enough, return it.
3402
3403         (WebKit::SharedMemoryCache::releaseSharedMemory):
3404         If we're already holding on to shared memory, evict it if the returned
3405         shared memory object is bigger than the one we currently hold.
3406
3407         (WebKit::SharedMemoryCache::clearCacheTimerFired):
3408         Null out the shared memory object.
3409
3410 2011-03-11  Jessie Berlin  <jberlin@apple.com>
3411
3412         Reviewed by Adam Roben.
3413
3414         Crash calling WebContext::clearResourceCaches(InMemoryResourceCachesOnly) before the Web
3415         Process has finished launching.
3416         https://bugs.webkit.org/show_bug.cgi?id=56208
3417
3418         Only send the message if the Web Process is valid.
3419
3420         * UIProcess/WebContext.cpp:
3421         (WebKit::WebContext::clearResourceCaches):
3422
3423 2011-03-11  Anders Carlsson  <andersca@apple.com>
3424
3425         Reviewed by Dan Bernstein.
3426
3427         Don't paint more than 60 times per second
3428         https://bugs.webkit.org/show_bug.cgi?id=56206
3429         <rdar://problem/9085989>
3430
3431         * WebProcess/WebPage/DrawingAreaImpl.cpp:
3432         (WebKit::DrawingAreaImpl::DrawingAreaImpl):
3433         Initialize m_lastDisplayTime to 0. Change the display timer to call displayTimerFired.
3434
3435         (WebKit::DrawingAreaImpl::didUpdate):
3436         Call displayTimerFired instead of display.
3437
3438         (WebKit::DrawingAreaImpl::displayTimerFired):
3439         If we're asked to paint again less than 1/60th of a second after we've already painted,
3440         defer painting.
3441
3442         (WebKit::DrawingAreaImpl::display):
3443         Update m_lastDisplayTime.
3444
3445 2011-03-11  Mark Rowe  <mrowe@apple.com>
3446
3447         Reviewed by Alice Liu.
3448
3449         <rdar://problem/9120161> WKPageRestoreFromSessionState does not set the pending API request URL.
3450
3451         * UIProcess/cf/WebPageProxyCF.cpp:
3452         (WebKit::WebPageProxy::restoreFromSessionStateData): If we're navigating to a back/forward item
3453         as part of the restoration, call setPendingAPIRequestURL. When there's a provisional URL this will
3454         be done by our call to loadURL elsewhere in the function.
3455
3456 2011-03-10  Alexey Proskuryakov  <ap@apple.com>
3457
3458         Reviewed by Jon Honeycutt.
3459
3460         WebKit2 UI process crashes if web process crashes while computing page rects for printing
3461         https://bugs.webkit.org/show_bug.cgi?id=56160
3462         <rdar://problem/9027410>
3463
3464         * UIProcess/API/mac/WKPrintingView.mm:
3465         (-[WKPrintingView _suspendAutodisplay]): Added a null check for page, matching one that
3466         we have when resuming autodisplay.
3467         (-[WKPrintingView _delayedResumeAutodisplayTimerFired]): Added a FIXME.
3468         (pageDidComputePageRects): Sanitize results coming from the web process (and avoid crashing
3469         when there is a communication error, so results are all null).
3470         (-[WKPrintingView knowsPageRange:]): If there is no page any more, we can't tell how many
3471         pages it had.
3472         (-[WKPrintingView rectForPage:]): Handle the case where we are neither calculating pages
3473         nor knowing them, as it happens when the web process crashes.        
3474
3475 2011-03-10  Mark Rowe  <mrowe@apple.com>
3476
3477         Rubber-stamped by Sam Weinig.
3478
3479         Part of <rdar://problem/8728860> WebKit2 needs to be made localizable
3480
3481         The presence of CFBundleDevelopmentRegion in the application's Info.plist prevents
3482         the default localization that we set during launch from being respected.
3483
3484         * PluginProcess/Info.plist: Remove CFBundleDevelopmentRegion.
3485         * WebProcess/Info.plist: Ditto.
3486
3487 2011-03-10  Martin Robinson  <mrobinson@igalia.com>
3488
3489         Build for WebKit2 GTK+ after r80714.
3490
3491         * GNUmakefile.am: Update source list.
3492         * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp: 
3493         (WebKit::x11Display): Add missing semicolon.
3494
3495 2011-03-10  Chris Fleizach  <cfleizach@apple.com>
3496
3497         Reviewed by Darin Adler.
3498
3499         REGRESSION (WebKit2): VoiceOver focus no longer follows keyboard focus
3500         https://bugs.webkit.org/show_bug.cgi?id=55959
3501
3502         NSApplication has to return the focused element within the app in order
3503         for NSAccessibilityHandleFocusChanged() to work. The default implementation
3504         relies on keyWindow. Consequently, in WK2, the WebProcess must override that method
3505         to return the appropriate focused element within the WebProcess, since
3506         there is no keyWindow.
3507
3508         * WebKit2.xcodeproj/project.pbxproj:
3509         * WebProcess/WebPage/mac/AccessibilityWebPageObject.mm:
3510         (-[AccessibilityWebPageObject accessibilityFocusedUIElement]):
3511         * WebProcess/WebProcess.cpp:
3512         (WebKit::WebProcess::focusedWebPage):
3513         * WebProcess/WebProcess.h:
3514         * WebProcess/mac/NSApplicationOverride.mm: Added.
3515         (-[NSApplication accessibilityFocusedUIElement]):
3516
3517 2011-03-10  Oleg Romashin  <romaxa@gmail.com>
3518
3519         Reviewed by Andreas Kling.
3520
3521         Make Qt port compiling with ENABLE_PLUGIN_PROCESS=1, part3
3522         Solving conflict of Qt and Xlib includes
3523
3524         * Shared/Plugins/NPIdentifierData.cpp:
3525         * Shared/Plugins/NPIdentifierData.h:
3526         * Shared/Plugins/NPObjectProxy.cpp:
3527         * Shared/Plugins/NPVariantData.h:
3528
3529 2011-03-10  Sam Weinig  <sam@webkit.org>
3530
3531         Reviewed by Mark Rowe.
3532
3533         - Fix plugins in release and production builds.
3534
3535         * WebKit2.xcodeproj/project.pbxproj:
3536         Make sure to base the PluginProcess target on the correct xcconfig file
3537         in all configurations.
3538
3539 2011-03-09  Matthew Delaney  <mdelaney@apple.com>
3540
3541         Reviewed by Simon Fraser.
3542
3543         Plumb through settings for accelerated drawing for canvas
3544         https://bugs.webkit.org/show_bug.cgi?id=56039
3545
3546         * Shared/WebPreferencesStore.h:
3547         * UIProcess/API/C/WKPreferences.cpp:
3548         * UIProcess/API/C/WKPreferencesPrivate.h:
3549         * WebProcess/WebPage/WebPage.cpp:
3550
3551 2011-03-10  Jessie Berlin  <jberlin@apple.com>
3552
3553         Reviewed by Oliver Hunt and Brian Weinstein.
3554
3555         WebKit2: Need a way to clear only the in-memory resource caches
3556         https://bugs.webkit.org/show_bug.cgi?id=56022
3557
3558         Add a parameter to WKContextClearResourceCaches to specify whether to clear all the caches
3559         or just the memory caches.
3560
3561         * Shared/ResourceCachesToClear.h: Added.
3562         * UIProcess/API/C/WKAPICast.h:
3563         (WebKit::toResourceCachesToClear):
3564
3565         * UIProcess/API/C/WKContext.cpp:
3566         (WKContextClearResourceCaches):
3567         Add the new parameter.
3568         * UIProcess/API/C/WKContext.h:
3569         * UIProcess/WebContext.cpp:
3570         (WebKit::WebContext::clearResourceCaches):
3571         Ditto.
3572         * UIProcess/WebContext.h:
3573
3574         * WebProcess/WebProcess.cpp:
3575         (WebKit::WebProcess::clearResourceCaches):
3576         Pass the new parameter through to the platform-specific functions.
3577         * WebProcess/WebProcess.h:
3578         Add the new parameter and give it a default of AllResourceCaches.
3579         * WebProcess/WebProcess.messages.in:
3580         Ditto.
3581         * WebProcess/gtk/WebProcessGtk.cpp:
3582         (WebKit::WebProcess::platformClearResourceCaches):
3583         Ditto.
3584         * WebProcess/qt/WebProcessQt.cpp:
3585         (WebKit::WebProcess::platformClearResourceCaches):
3586         Ditto.
3587         * WebProcess/win/WebProcessWin.cpp:
3588         (WebKit::WebProcess::platformClearResourceCaches):
3589         When told to clear only the in-memory caches, return early so as not to clear the CFNetwork
3590         disk cache.
3591         * WebProcess/mac/WebProcessMac.mm:
3592         (WebKit::WebProcess::platformClearResourceCaches):
3593         Ditto.
3594
3595         * WebKit2.xcodeproj/project.pbxproj:
3596         Add ResourceCachesToClear.h
3597         * win/WebKit2.vcproj:
3598         Ditto.
3599
3600 2011-03-10  Jeff Miller  <jeffm@apple.com>
3601
3602         Reviewed by Adam Roben.
3603
3604         WKViewRegisterEditCommandCallback should use WKViewUndoType
3605         https://bugs.webkit.org/show_bug.cgi?id=56120
3606
3607         * UIProcess/API/C/win/WKView.h: Change undoOrRedo parameter in WKViewRegisterEditCommandCallback to be WKViewUndoType.
3608
3609 2011-03-10  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
3610
3611         Reviewed by Kenneth Rohde Christiansen.
3612
3613         Tiled backing store's delegated scroll request uses incorrect convention
3614         https://bugs.webkit.org/show_bug.cgi?id=56011
3615
3616         Adapt all of the internal API to match the delta to point
3617         conversion at the WebCore side.
3618
3619         * UIProcess/API/qt/qwkpage.cpp:
3620         (QWKPagePrivate::pageDidRequestScroll):
3621         * UIProcess/API/qt/qwkpage_p.h:
3622         * UIProcess/PageClient.h:
3623         * UIProcess/WebPageProxy.cpp:
3624         (WebKit::WebPageProxy::pageDidRequestScroll):
3625         * UIProcess/WebPageProxy.h:
3626         * UIProcess/WebPageProxy.messages.in:
3627         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3628         (WebKit::WebChromeClient::delegatedScrollRequested):
3629         * WebProcess/WebCoreSupport/WebChromeClient.h:
3630         * WebProcess/WebPage/WebPage.cpp:
3631         (WebKit::WebPage::pageDidRequestScroll):
3632         * WebProcess/WebPage/WebPage.h:
3633
3634 2011-03-10  Balazs Kelemen  <kbalazs@webkit.org>
3635
3636         Reviewed by Andreas Kling.
3637
3638         [WK2] Make non-transparent windowless plugins paint on X11
3639         https://bugs.webkit.org/show_bug.cgi?id=55660
3640
3641         Implement painting for non-transparent windowless X11 plugins.
3642         The essence of the logic has been adapted from WebCore.
3643         The implementation is stubbed for GTK and working only on Qt
3644         but it should be really easy to finish it for GTK.
3645
3646         * WebKit2.pro:
3647         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
3648         (WebKit::NPN_GetValue): Handle X11 specific values that are necessary.
3649         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
3650         (WebKit::NetscapePlugin::NetscapePlugin): Initialize the X11 specific
3651         members that has been added.
3652         (WebKit::NetscapePlugin::callSetWindow): Always set the x and y coordinates
3653         of the NP_Window to 0 on X11 since we are using a backings store as the
3654         painting area for the plugin.
3655         * WebProcess/Plugins/Netscape/NetscapePlugin.h:
3656         * WebProcess/Plugins/Netscape/gtk/NetscapePluginGtk.cpp: Removed in favour
3657         of a common implementation for X11.
3658         * WebProcess/Plugins/Netscape/qt/NetscapePluginQt.cpp: Ditto.
3659         * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp: Added.
3660         (WebKit::getPluginDisplay):
3661
3662         Platform specific static getters.
3663         (WebKit::x11Display):
3664         (WebKit::displayDepth):
3665         (WebKit::rootWindowID):
3666         (WebKit::x11Screen):
3667
3668         (WebKit::NetscapePlugin::platformPostInitialize): Set up the visual
3669         settings and the colormap for the plugin.
3670         (WebKit::NetscapePlugin::platformDestroy):
3671         (WebKit::NetscapePlugin::platformInvalidate): Remained stub.
3672         (WebKit::NetscapePlugin::platformGeometryDidChange): Create a new
3673         pixmap that fits the geometry.
3674         (WebKit::NetscapePlugin::platformPaint): Propagate a paint event
3675         to the plugin, sync with it if necessary and draw the pixmap to
3676         the screen.
3677         (WebKit::toNP): Remained stub.
3678         (WebKit::NetscapePlugin::platformHandleMouseEvent): Remained stub.
3679         (WebKit::NetscapePlugin::platformHandleWheelEvent): Remained stub.
3680         (WebKit::NetscapePlugin::platformSetFocus): Remained stub.
3681         (WebKit::NetscapePlugin::platformHandleMouseEnterEvent): Remained stub.
3682         (WebKit::NetscapePlugin::platformHandleMouseLeaveEvent): Remained stub.
3683         (WebKit::NetscapePlugin::platformHandleKeyboardEvent): Remained stub.
3684         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3685         (WebKit::WebFrameLoaderClient::createPlugin): Hack. Inject wmode=opaque
3686         key-value pair to the plugin parameters to force Flash to act in
3687         non-transparent windowless mode. Qt also doing this in WebCore.
3688
3689 2011-03-09  Peter Kasting  <pkasting@google.com>
3690
3691         Reviewed by Mihai Parparita.
3692
3693         Unify Windows version checks.
3694         https://bugs.webkit.org/show_bug.cgi?id=55979
3695
3696         * UIProcess/win/WebPageProxyWin.cpp:
3697         (WebKit::WebPageProxy::standardUserAgent):
3698
3699 2011-03-09  Adele Peterson  <adele@apple.com>
3700
3701         Reviewed by Anders Carlsson.
3702
3703         Fix for https://bugs.webkit.org/show_bug.cgi?id=56068
3704         <rdar://problem/9058245> WebKit2: Can't uncheck 'Spelling and Grammar' contextual items
3705
3706         * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::contextMenuItemSelected):
3707         Add cases for ContextMenuItemTagCorrectSpellingAutomatically, ContextMenuItemTagCheckSpellingWhileTyping, 
3708         and ContextMenuItemTagCheckGrammarWithSpelling
3709
3710 2011-03-09  Alexey Proskuryakov  <ap@apple.com>
3711
3712         Reviewed by Dan Bernstein.
3713
3714         Frequent crashes when printing in WebPageProxy::setAutodisplay
3715         https://bugs.webkit.org/show_bug.cgi?id=56057
3716         <rdar://problem/9053290>
3717
3718         * UIProcess/API/mac/WKPrintingView.mm: (-[WKPrintingView _delayedResumeAutodisplayTimerFired]):
3719         Null check the page, there is no reason for it to still exist.
3720
3721 2011-03-09  Brent Fulgham  <bfulgham@webkit.org>
3722
3723         Unreviewed build correction.
3724
3725         * UIProcess/DrawingAreaProxy.messages.in: Exclude the other
3726           method using LayerTreeContext for non-accelerated composition case.
3727
3728 2011-03-09  Sam Weinig  <sam@webkit.org>
3729
3730         Reviewed by Anders Carlsson.
3731
3732         Change plugins to use their own executable on Mac OS X
3733         https://bugs.webkit.org/show_bug.cgi?id=55991
3734
3735         * Configurations/PluginProcess.xcconfig: Copied from Source/WebKit2/Configurations/WebProcess.xcconfig.
3736         * PluginProcess/Info.plist: Copied from Source/WebKit2/WebProcess/Info.plist.
3737         Add files necessary for adding PluginProcess.app.
3738
3739         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
3740         (WebKit::ProcessLauncher::launchProcess):
3741         Launch the PluginProcess.app when launching a plugin process.
3742
3743         * WebKit2.xcodeproj/project.pbxproj:
3744         Add new executable and new files, removes some unneeded copying
3745         and duplicate compiling of files.
3746
3747         * WebProcess/Info.plist:
3748         Sorted.
3749
3750 2011-03-09  Jessie Berlin  <jberlin@apple.com>
3751
3752         Reviewed by Adam Roben.
3753
3754         Use the Cookie Storage from the Private Browsing Storage Session directly
3755         https://bugs.webkit.org/show_bug.cgi?id=55986
3756
3757         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
3758         (InitWebCoreSystemInterface):
3759
3760 2011-03-09  Alejandro G. Castro  <alex@igalia.com>
3761
3762         Fix compilation after r80596, add soup Download stubs.
3763
3764         * GNUmakefile.am:
3765         * WebProcess/Downloads/soup/DownloadSoup.cpp: Added.
3766         (WebKit::Download::start):
3767         (WebKit::Download::startWithHandle):
3768         (WebKit::Download::cancel):
3769         (WebKit::Download::platformInvalidate):
3770         (WebKit::Download::didDecideDestination):
3771         (WebKit::Download::platformDidFinish):
3772
3773 2011-03-09  Alejandro G. Castro  <alex@igalia.com>
3774
3775         Fix GTK+ compilation after r80619. Add WebFullScreenManager.
3776
3777         * GNUmakefile.am:
3778
3779 2011-03-08  Jer Noble  <jer.noble@apple.com>
3780
3781         Reviewed by Sam Weinig.
3782
3783         WebKit2: Plumb through the FULLSCREEN_API Chrome client calls
3784         https://bugs.webkit.org/show_bug.cgi?id=55273
3785
3786         The FULLSCREEN_API Chrome client calls need to be plumbed through from the 
3787         WebProcess to the UIProcess.  To do this, WebFullScreenManager (and Proxy)
3788         classes have been added to WebPage.
3789
3790         * DerivedSources.make: Added rules necessary to build DerivedSources for new .in files.
3791         * DerivedSources.pro: Ditto.
3792         * Platform/CoreIPC/MessageID.h: Added message types for WebFullScreenManager.
3793         * Shared/API/c/WKBase.h: Added WKFullScreenManagerRef.
3794         * Shared/APIObject.h: Added APIType for WebFullScreenManager.
3795         * UIProcess/WebFullScreenManagerProxy.cpp: Added.
3796         * UIProcess/WebFullScreenManagerProxy.h: Added.
3797         * UIProcess/WebFullScreenManagerProxy.messages.in: Added.
3798         * UIProcess/WebPageProxy.cpp:
3799         (WebKit::WebPageProxy::close): Invalidate and clear m_fullScreenManager.
3800         (WebKit::WebPageProxy::processDidCrash): Ditto.
3801         (WebKit::WebPageProxy::didReceiveMessage): Pass messages on to WebFullScreenManagerProxy.
3802         (WebKit::WebPageProxy::didReceiveSyncMessage): Ditto.
3803         (WebKit::WebPageProxy::fullScreenManager): Added. Lazy instantiation of m_fullScreenManager.
3804         * UIProcess/WebPageProxy.h:
3805         * UIProcess/WebPageProxy.messages.in:
3806         * UIProcess/WebUIClient.cpp:
3807         * UIProcess/WebUIClient.h:
3808         * WebKit2.xcodeproj/project.pbxproj: Added references to new classes in project file.
3809         * WebKit2.pro: Ditto.
3810         * win/WebKit2.vcproj: Ditto.
3811         * WebKit2.pri: Added new directories to include file path.
3812         * win/WebKit2Common.vsprops: Ditto.
3813         * WebProcess/FullScreen/WebFullScreenManager.cpp: Added.
3814         * WebProcess/FullScreen/WebFullScreenManager.h: Added.
3815         * WebProcess/FullScreen/WebFullScreenManager.messages.in: Added.
3816         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3817         (WebKit::WebChromeClient::supportsFullScreenForElement): Pass through to WebFullScreenManager.
3818         (WebKit::WebChromeClient::enterFullScreenForElement): Ditto.
3819         (WebKit::WebChromeClient::exitFullScreenForElement): Ditto.
3820         * WebProcess/WebPage/WebPage.cpp:
3821         (WebKit::WebPage::close): Invalidate and clear m_fullScreenManager.
3822         (WebKit::WebPage::fullScreenManager): Lazy instantiation of m_fullScreenManager.
3823         (WebKit::WebPage::didReceiveMessage): Pass messages through to WebFullScreenManager.
3824         * WebProcess/WebPage/WebPage.h:
3825
3826 2011-03-08  Jer Noble  <jer.noble@apple.com>
3827
3828         Reviewed by Sam Weinig.
3829
3830         WebKit2: Plumb through the "supportsFullScreen" preference.
3831         https://bugs.webkit.org/show_bug.cgi?id=55261
3832
3833         The "supportsFullScreen" preference needs to be plumbed through from
3834         the UIProcess to the WebProcess.
3835
3836         * Shared/WebPreferencesStore.h: Add a new macro entry.
3837         * UIProcess/API/C/WKPreferences.cpp: Implement preferences getter and setter.
3838         (WKPreferencesSetFullScreenEnabled):
3839         (WKPreferencesGetFullScreenEnabled):
3840         * UIProcess/API/C/WKPreferences.h:
3841         * WebProcess/WebPage/WebPage.cpp:
3842         (WebKit::WebPage::updatePreferences): Sync the fullScreenEnabled setting through to
3843             the settings object.
3844
3845 2011-03-08  Jeff Miller  <jeffm@apple.com>
3846
3847         Reviewed by Adele Peterson.
3848
3849         WebKit2: Implement Windows glue for Undo/Redo
3850         https://bugs.webkit.org/show_bug.cgi?id=55961
3851         
3852         Expose Undo/Redo infrastructure through WKView on Windows by
3853         adding an undo client as well as APIs to reapply and unapply
3854         an edit command.
3855
3856         * UIProcess/API/C/win/WKView.cpp:
3857         (WKViewSetViewUndoClient): Added.
3858         (WKViewReapplyEditCommand): Added.
3859         (WKViewUnapplyEditCommand): Added.
3860         * UIProcess/API/C/win/WKView.h: Added WKViewUndoClient, WKViewSetViewUndoClient(), and WKViewUnapplyEditCommand().
3861         * UIProcess/WebPageProxy.cpp:
3862         (WebKit::WebPageProxy::isValidEditCommand): Added, used to validated an edit command from a WKView API.
3863         * UIProcess/WebPageProxy.h: Added isValidEditCommand().
3864         * UIProcess/win/WebUndoClient.cpp: Added, APIClient for WKViewUndoClient. 
3865         (WebKit::WebUndoClient::registerEditCommand): Added.
3866         (WebKit::WebUndoClient::clearAllEditCommands): Added.
3867         * UIProcess/win/WebUndoClient.h: Added, APIClient for WKViewUndoClient.
3868         * UIProcess/win/WebView.cpp:
3869         (WebKit::WebView::initializeUndoClient): Added.
3870         (WebKit::WebView::close): Clear out undo client.
3871         (WebKit::WebView::registerEditCommand): Implemented to call through to WKViewUndoClient.
3872         (WebKit::WebView::clearAllEditCommands): Implmented to call through to WKViewUndoClient.
3873         (WebKit::WebView::reapplyEditCommand): Added.
3874         (WebKit::WebView::unapplyEditCommand): Added.
3875         * UIProcess/win/WebView.h: Added undo client support.
3876         * win/WebKit2.vcproj: Added WebUndoClient.cpp and WebUndoClient.h.
3877
3878 2011-03-08  Jeff Miller  <jeffm@apple.com>
3879
3880         Reviewed by Sam Weinig.
3881
3882         WebKit2: Expose WebEditCommandProxy in the C API on Windows
3883         https://bugs.webkit.org/show_bug.cgi?id=55962
3884         
3885         Make WebEditCommandProxy a subclass of APIObject, and define
3886         WKEditCommandRef as the type that will be exposed through the C API.
3887
3888         * Shared/API/c/win/WKBaseWin.h: Add WKEditCommandRef.
3889         * Shared/APIObject.h: Add platform-specific TypeEditCommandProxy.
3890         * UIProcess/API/C/win/WKAPICastWin.h: Add API mapping for WKEditCommandRef.
3891         * UIProcess/WebEditCommandProxy.h: Subclass WebEditCommandProxy from APIObject.
3892         (WebKit::WebEditCommandProxy::type): Added.
3893
3894 2011-03-08  Jeff Miller  <jeffm@apple.com>
3895
3896         Reviewed by Oliver Hunt.
3897
3898         WebKit2: Redo is broken
3899         https://bugs.webkit.org/show_bug.cgi?id=55978
3900         
3901         WebEditCommandProxy::unapply() and WebEditCommandProxy::reapply() were registering the wrong edit command when an undo or redo happens.
3902         For example, when we unapply(), we should register a Redo command, not an Undo command.
3903
3904         * UIProcess/WebEditCommandProxy.cpp:
3905         (WebKit::WebEditCommandProxy::unapply): Register a Redo command, not an Undo command.
3906         (WebKit::WebEditCommandProxy::reapply): Register an Undo command, not a Redo command.
3907
3908 2011-03-08  Brent Fulgham  <bfulgham@webkit.org>
3909
3910         Reviewed by Adam Roben.
3911
3912         https://bugs.webkit.org/show_bug.cgi?id=55977
3913         Refine CF/CFNet distinctions for better code sharing.
3914         1. Rename Downloads/cf/win/DownloadCFNetWin.cpp to DownloadCFWin.cpp
3915            since it does not use any CFNETWORK features.
3916         2. Create new cfnet directory.
3917         3. Move Downloads/cf/DownloadCFNet.cpp to Downloads/cfnet
3918         4. Update project file.
3919
3920         * WebProcess/Downloads/cf/DownloadCFNet.cpp: Removed.
3921         * WebProcess/Downloads/cf/win/DownloadCFNetWin.cpp: Removed.
3922         * WebProcess/Downloads/cf/win/DownloadCFWin.cpp: Copied from WebProcess/Downloads/cf/win/DownloadCFNetWin.cpp.
3923         * WebProcess/Downloads/cfnet: Added.
3924         * WebProcess/Downloads/cfnet/DownloadCFNet.cpp: Copied from WebProcess/Downloads/cf/DownloadCFNet.cpp.
3925         * win/WebKit2.vcproj:
3926
3927 2011-03-08  Mark Rowe  <mrowe@apple.com>
3928
3929         Reviewed by Brady Eidson.
3930
3931         <http://webkit.org/b/55976> Provisional URL should be loaded when restoring session state even if there are back / forward list entries.
3932
3933         * UIProcess/cf/WebPageProxyCF.cpp:
3934         (WebKit::WebPageProxy::restoreFromSessionStateData): If there's a provisional URL that we will load then restore the session state
3935         without navigating to the current item.
3936         * WebProcess/WebPage/WebPage.messages.in: Expose the ability to restore the session state without navigating to the current item.
3937
3938 2011-03-08  Brent Fulgham  <bfulgham@webkit.org>
3939
3940         Reviewed by Anders Carlsson.
3941
3942         https://bugs.webkit.org/show_bug.cgi?id=55956
3943         WebKit2 Changes to correct WinCairo port build
3944
3945         * Shared/LayerTreeContext.h: Don't exclude CoreIPC declarations for non-accelerated
3946           compositing case.
3947         * UIProcess/DrawingAreaProxy.h: Add "stdint.h" include needed for Cairo build.
3948         * UIProcess/DrawingAreaProxyImpl.cpp: Exclude accelerated compositing code for
3949           WinCairo build.
3950         (WebKit::DrawingAreaProxyImpl::~DrawingAreaProxyImpl):
3951         (WebKit::DrawingAreaProxyImpl::didUpdateBackingStoreState):
3952         (WebKit::DrawingAreaProxyImpl::enterAcceleratedCompositingMode):
3953         (WebKit::DrawingAreaProxyImpl::exitAcceleratedCompositingMode):
3954         (WebKit::DrawingAreaProxyImpl::sendUpdateBackingStoreState):
3955         (WebKit::DrawingAreaProxyImpl::waitForAndDispatchDidUpdateBackingStoreState):
3956         * UIProcess/DrawingAreaProxyImpl.h: Exclude declarations for code only used when
3957           accelerated compositing is enabled.
3958         (WebKit::DrawingAreaProxyImpl::isInAcceleratedCompositingMode):
3959         * UIProcess/win/WebView.cpp: Protect CG-specific drawing code.
3960         (WebKit::WebView::setFindIndicator):
3961         * WebProcess/Downloads/Download.h: Allow CFLite implentation to share overwrite flag,
3962           as well as destination and bundle paths.
3963         * WebProcess/Downloads/curl/DownloadCurl.cpp: Remove stub (to share CFNet implementation
3964           of file handling.  This will be moved to a common area in a future patch.)
3965         * WebProcess/WebPage/DrawingAreaImpl.cpp: Exclude accelerated-compositing paths.
3966         (WebKit::DrawingAreaImpl::layerHostDidFlushLayers):
3967         (WebKit::DrawingAreaImpl::sendDidUpdateBackingStoreState):
3968         (WebKit::DrawingAreaImpl::exitAcceleratedCompositingMode):
3969         * WebProcess/WebPage/WebPage.cpp: Protect CG-specific drawing code.
3970         (WebKit::WebPage::drawRectToPDF):
3971         (WebKit::WebPage::drawPagesToPDF):
3972         * win/WebKit2.vcproj: Exclude unused LayerTreeContext from WinCairo
3973
3974 2011-03-08  Ivan Krstić  <ike@apple.com>
3975
3976         Reviewed by Sam Weinig.
3977
3978         Re-fix: can't paste from 3rd party text editor into WebKit2 window
3979         <rdar://problem/8978624>
3980
3981         * WebProcess/com.apple.WebProcess.sb:
3982
3983 2011-03-08  Martin Robinson  <mrobinson@igalia.com>
3984
3985         Fix the WebKit2 compilation after r80578.
3986
3987         * UIProcess/gtk/WebView.cpp:
3988         (WebKit::WebView::setFocus): Added.
3989         * UIProcess/gtk/WebView.h:
3990
3991 2011-03-08  Jessie Berlin  <jberlin@apple.com>
3992
3993         Reviewed by Anders Carlsson.
3994
3995         Crash in CFNetwork visiting google.com
3996         https://bugs.webkit.org/show_bug.cgi?id=55958
3997
3998         * Shared/API/c/cf/WKURLResponseCF.cpp:
3999         (WKURLResponseCopyCFURLResponse):
4000         If the response to copy is null, return 0;
4001
4002 2011-03-08  John Sullivan  <sullivan@apple.com>
4003
4004         Reverted the patch for https://bugs.webkit.org/show_bug.cgi?id=55940
4005         
4006         The patch was insufficient, and it wasn't useful for the intended client use either.
4007
4008         * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
4009         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
4010         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
4011
4012 2011-03-08  Alejandro G. Castro  <alex@igalia.com>
4013
4014         Unreviewed, fixed GTK+ compilation after r80569.
4015
4016         * UIProcess/gtk/WebView.cpp:
4017         (WebKit::WebView::windowToScreen):
4018         * UIProcess/gtk/WebView.h:
4019
4020 2011-03-08  Chris Fleizach  <cfleizach@apple.com>
4021
4022         Reviewed by Sam Weinig.
4023
4024         WK2: Cannot set focus on an element when focus is outside of WKView
4025         https://bugs.webkit.org/show_bug.cgi?id=55281
4026
4027         * UIProcess/API/mac/PageClientImpl.h:
4028         * UIProcess/API/mac/PageClientImpl.mm:
4029         (WebKit::PageClientImpl::setFocus):
4030         * UIProcess/API/qt/qwkpage_p.h:
4031         (QWKPagePrivate::setFocus):
4032         * UIProcess/PageClient.h:
4033         * UIProcess/WebPageProxy.cpp:
4034         (WebKit::WebPageProxy::setFocus):
4035         * UIProcess/WebPageProxy.h:
4036         * UIProcess/WebPageProxy.messages.in:
4037         * UIProcess/win/WebView.h:
4038         (WebKit::WebView::setFocus):
4039         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
4040         (WebKit::WebChromeClient::focus):
4041         (WebKit::WebChromeClient::unfocus):
4042
4043 2011-03-08  Jeff Miller  <jeffm@apple.com>
4044
4045         Unreviewed, fix last change so WKBaseWin.h is in alphabetical order in the project XML.
4046
4047         * win/WebKit2.vcproj: Move WKBaseWin.h to be in alphabetical order.
4048
4049 2011-03-08  Jeff Miller  <jeffm@apple.com>
4050
4051         Reviewed by Darin Adler.
4052
4053         Remove Source/WebKit2/UIProcess/API/C/win/WKBaseWin.h
4054         https://bugs.webkit.org/show_bug.cgi?id=55952
4055
4056         * UIProcess/API/C/win/WKBaseWin.h: Removed.
4057         * win/WebKit2.vcproj: Refer to the Shared version of WKBaseWin.h instead of the one in UIProcess.
4058
4059 2011-03-08  Alejandro G. Castro  <alex@igalia.com>
4060
4061         Reviewed by Martin Robinson.
4062
4063         [GTK] Add new files to compilation after r77974
4064         https://bugs.webkit.org/show_bug.cgi?id=54076
4065
4066         The commit added new code to allow passing context to policy
4067         delegate methods, we also added dummy ResourceRequest and
4068         ResourceResponse decoders until we implement them.
4069
4070         * GNUmakefile.am:
4071         * Shared/gtk/WebCoreArgumentCodersGtk.cpp:
4072         (CoreIPC::decodeResourceRequest):
4073         (CoreIPC::decodeResourceResponse):
4074
4075 2011-03-08  Chris Fleizach  <cfleizach@apple.com>
4076
4077         Reviewed by Darin Adler.
4078
4079         AX: Webkit2 not sending UAZoomFocusChanged notifications
4080         https://bugs.webkit.org/show_bug.cgi?id=55916
4081
4082         Needed to implement the windowToScreen() method so that the right frame
4083         could be calculated to send for zoom focus changes.
4084
4085         * UIProcess/API/mac/PageClientImpl.h:
4086         * UIProcess/API/mac/PageClientImpl.mm:
4087         (WebKit::PageClientImpl::windowToScreen):
4088         * UIProcess/API/qt/qwkpage.cpp:
4089         (QWKPagePrivate::windowToScreen):
4090         * UIProcess/API/qt/qwkpage_p.h:
4091         * UIProcess/PageClient.h:
4092         * UIProcess/WebPageProxy.cpp:
4093         (WebKit::WebPageProxy::windowToScreen):
4094         * UIProcess/WebPageProxy.h:
4095         * UIProcess/WebPageProxy.messages.in:
4096         * UIProcess/win/WebView.cpp:
4097         (WebKit::WebView::windowToScreen):
4098         * UIProcess/win/WebView.h:
4099         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
4100         (WebKit::WebChromeClient::windowToScreen):
4101         * WebProcess/WebPage/WebPage.cpp:
4102         (WebKit::WebPage::windowToScreen):
4103         * WebProcess/WebPage/WebPage.h:
4104
4105 2011-03-08  John Sullivan  <sullivan@apple.com>
4106
4107         Reviewed by Darin Adler.
4108
4109         https://bugs.webkit.org/show_bug.cgi?id=55940
4110         WebKit2 should support Ignore policy from injected bundle client
4111
4112         * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
4113         Added WKBundlePagePolicyActionIgnore.
4114         
4115         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
4116         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
4117         If the injected bundle client returns WKBundlePagePolicyActionIgnore, convert it
4118         to the loader's PolicyIgnore.
4119
4120 2011-03-08  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
4121
4122         Reviewed by Kenneth Rohde Christiansen.
4123
4124         [Qt] [Symbian] [WK2] Fix building WebKit 2 API tests
4125         https://bugs.webkit.org/show_bug.cgi?id=55876
4126
4127         Make sure TESTS_SOURCE_DIR is set for Symbian the same way
4128         as it is for WK1.
4129
4130         * UIProcess/API/qt/tests/qgraphicswkview/tst_qgraphicswkview.cpp:
4131         (tst_QGraphicsWKView::loadEmptyPage):
4132         * UIProcess/API/qt/tests/tests.pri:
4133