Fix build for Darin's previous change w/ the obvious renaming.
[WebKit.git] / WebKit2 / ChangeLog
1 2011-01-06  Maciej Stachowiak  <mjs@apple.com>
2
3         Rubber stamped by Dan Bernstein.
4
5         Fix build for Darin's previous change w/ the obvious renaming.
6
7         * WebProcess/WebPage/WebBackForwardListProxy.h:
8         * WebProcess/WebPage/WebPage.cpp:
9         (WebKit::WebPage::didRemoveBackForwardItem):
10
11 2011-01-05  Darin Adler  <darin@apple.com>
12
13         Reviewed by Geoff Garen.
14
15         Back/Forward entries in WebKit2 leak
16         https://bugs.webkit.org/show_bug.cgi?id=51983
17
18         Besides fixing the leak, this also fixes a problem where
19         all history items were sent over to the UI process, but
20         we wanted to send only back/forward items.
21
22         * UIProcess/WebBackForwardList.cpp:
23         (WebKit::WebBackForwardList::pageClosed): Added.
24         Tells the web process about all the back/forward
25         items being removed.
26         (WebKit::WebBackForwardList::addItem): Ditto.
27         Also removed a redundant call to didChangeBackForwardList.
28         (WebKit::WebBackForwardList::clear): Ditto.
29
30         * UIProcess/WebBackForwardList.h: Added pageClosed.
31
32         * UIProcess/WebPageProxy.cpp:
33         (WebKit::WebPageProxy::close): Added a call to pageClosed.
34         (WebKit::WebPageProxy::backForwardRemovedItem): Added.
35         Sends a message to the web page in the web process.
36
37         * UIProcess/WebPageProxy.h: Added backForwardRemovedItem.
38
39         * WebProcess/WebPage/WebBackForwardListProxy.cpp:
40         (WebKit::updateBackForwardItem): Added an itemID argument,
41         since callers will now be getting it and we don't want to
42         get it twice. Removed the code to generate an ID. Also
43         removed some local variables to make the code a little
44         tighter and clearer.
45         (WebKit::WK2NotifyHistoryItemChanged): Only call
46         updateBackForwardItem for items that already have IDs.
47         We don't want to send cross-process messages for every
48         history item; just the ones that are top level back/forward
49         items.
50         (WebKit::WebBackForwardListProxy::removeItem):
51         Added. For use when the UI process tells us to remove it.
52         (WebKit::WebBackForwardListProxy::addItem): Added code to
53         assign an ID and put this item into the maps. This is called
54         exactly once on each back/forward item.
55
56         * WebProcess/WebPage/WebBackForwardListProxy.h: Added
57         removeItem.
58
59         * WebProcess/WebPage/WebPage.cpp:
60         (WebKit::WebPage::didRemoveBackForwardItem): Added.
61
62         * WebProcess/WebPage/WebPage.h: Added didRemoveBackForwardItem.
63
64         * WebProcess/WebPage/WebPage.messages.in: Added
65         DidRemoveBackForwardItem message.
66
67 2011-01-05  Steve Falkenburg  <sfalken@apple.com>
68
69         Reviewed by Darin Adler.
70
71         Debug and Release builds on Windows clobber each other
72         https://bugs.webkit.org/show_bug.cgi?id=49185
73
74         Changes the structure of WebKitBuild build products directory so we
75         completely separate each build configuration into independent directories.
76         
77         Although we previously had per-configuration directories for obj, this change adds
78         per-configuration directories for bin, lib, obj, and include. Each configuration's
79         build products are stored within a directory inside of WebKitBuild.
80         
81         Most use of $(WebKitOutputDir) in the build files has been replaced by $(ConfigurationBuildDir),
82         defined in common.vsprops to be $(WebKitOutputDir)\$(ConfigurationName).
83
84         * win/WebKit2.make:
85         * win/WebKit2.vcproj:
86         * win/WebKit2Common.vsprops:
87         * win/WebKit2Generated.make:
88         * win/WebKit2GeneratedCommon.vsprops:
89         * win/WebKit2WebProcessPostBuild.cmd:
90         * win/WebKit2WebProcessPreBuild.cmd:
91         * win/WebKitPostBuild.cmd:
92         * win/WebKitPreBuild.cmd:
93
94 2011-01-05  Alexey Proskuryakov  <ap@apple.com>
95
96         Reviewed by Anders Carlsson.
97
98         https://bugs.webkit.org/show_bug.cgi?id=51973
99         Make main frame PDF printing work
100
101         * UIProcess/API/mac/PDFViewController.h:
102         * UIProcess/API/mac/PDFViewController.mm: (WebKit::PDFViewController::makePrintOperation):
103         Ask PDFDocument to create an NSPrintOperation.
104
105         * UIProcess/API/mac/WKView.h:
106         * UIProcess/API/mac/WKView.mm:
107         (-[WKView printOperationWithPrintInfo:forFrame:]): Create a new NSPrintOperation, either
108         from scratch or from a PDF view.
109         (-[WKView canPrintHeadersAndFooters]): Report if the view can be re-paginated to add headers
110         and footers.
111
112 2011-01-05  Anders Carlsson  <andersca@apple.com>
113
114         Reviewed by Sam Weinig.
115
116         <rdar://problem/8750248>
117         Need a way to create a new DownloadProxy from an arbitrary resource request
118
119         <rdar://problem/8750465>
120         Need a way to start a download in WKDownload
121         
122         <rdar://problem/8752204>
123         WK2 Context Menus - "Save linked file" support
124
125         * Shared/ContextMenuState.h: Added.
126         Add a ContextMenuState struct which contains state for context menus.
127
128         * UIProcess/API/C/WKContext.cpp:
129         (WKContextDownloadURLRequest):
130         Call WebContext::download.
131
132         * UIProcess/WebContext.cpp:
133         (WebKit::WebContext::download):
134         Send a DownloadRequest message to the web process.
135
136         * UIProcess/WebPageProxy.cpp:
137         (WebKit::WebPageProxy::showContextMenu):
138         Set the active context menu state.
139
140         (WebKit::WebPageProxy::contextMenuItemSelected):
141         Handle ContextMenuItemTagDownloadImageToDisk and ContextMenuItemTagDownloadLinkToDisk by calling
142         WebContext::Download, passing the respective URLs.
143
144         * UIProcess/WebPageProxy.messages.in:
145         ShowContextMenu now takes state as well.
146
147         * WebProcess/WebCoreSupport/WebContextMenuClient.cpp:
148         (WebKit::WebContextMenuClient::downloadURL):
149         Assert that this is never reached; downloads are handled in the UI process.
150
151         * WebProcess/WebPage/WebContextMenu.cpp:
152         (WebKit::WebContextMenu::show):
153         Pass the context menu state along when sending the ShowContextMenu message.
154
155         * WebProcess/WebProcess.cpp:
156         (WebKit::WebProcess::downloadRequest):
157         Call the shared DownloadManager.
158
159         * WebProcess/WebProcess.messages.in:
160         Add DownloadRequest message.
161
162         * WebKit2.xcodeproj/project.pbxproj:
163         * win/WebKit2.vcproj:
164         Add ContextMenuState.h.
165
166 2011-01-05  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
167
168         Unreviewed build fix.
169
170         [Qt] [Symbian] Fix building NPAPI support
171
172         NPEvent is mapped to QAction on Symbian. QAction has no
173         default constructor, so toNP() fails to build. Add a case for
174         Symbian behind the OS(SYMBIAN) guard.
175
176         * WebProcess/Plugins/Netscape/qt/NetscapePluginQt.cpp:
177         (WebKit::toNP):
178
179 2011-01-05  Jeff Miller  <jeffm@apple.com>
180
181         Reviewed by Dan Bernstein.
182
183         Copy WKImageCG.h to include\WebKit2 in build output
184         https://bugs.webkit.org/show_bug.cgi?id=51944
185
186         * win/WebKit2Generated.make:
187         Add xcopy command to copy WKImageCG.h.
188
189 2011-01-05  Brady Eidson  <beidson@apple.com>
190
191         Reviewed by Sam Weinig.
192
193         Part of <rdar://problem/8261624> and https://bugs.webkit.org/show_bug.cgi?id=47355
194         Change WebKit2 session restoring to restore the full back/forward list
195
196         Add a new message to tell the WebProcess to restore a session state:
197         * WebProcess/WebPage/WebPage.cpp:
198         (WebKit::WebPage::restoreSession):
199         * WebProcess/WebPage/WebPage.h:
200         * WebProcess/WebPage/WebPage.messages.in: Add the new message, AND fix the intentional misspellings.
201         
202         Also, Sam sucks.
203
204         Change WebProcess back/forward list item ids to be odd (UIProcess's will be even):
205         * WebProcess/WebPage/WebBackForwardListProxy.cpp:
206         (WebKit::generateHistoryItemID):
207
208         Provide accessors to the entries in the list to pass to the WebProcess:
209         * UIProcess/WebBackForwardList.h:
210         (WebKit::WebBackForwardList::entries):
211         (WebKit::WebBackForwardList::currentIndex):
212
213         Add decoding of the saved back/forward list itmes (we already encode them):
214         * UIProcess/cf/WebBackForwardListCF.cpp:
215         (WebKit::generateWebBackForwardItemID):
216         (WebKit::WebBackForwardList::restoreFromCFDictionaryRepresentation):
217
218         Instead of loading the current URL, pass the entire last back to the WebProcess:
219         * UIProcess/cf/WebPageProxyCF.cpp:
220         (WebKit::WebPageProxy::restoreFromSessionStateData):
221
222 2011-01-05  Brady Eidson  <beidson@apple.com>
223
224         Reviewed by Darin Adler.
225
226         https://bugs.webkit.org/show_bug.cgi?id=51953
227         Add a "SessionState" object for IPC messaging.
228
229         This object includes all data necessary to restore a session state;
230         For now, this is just the back/forward list to restore.
231
232         * Shared/SessionState.cpp: Added.
233         (WebKit::SessionState::SessionState):
234         (WebKit::SessionState::encode):
235         (WebKit::SessionState::decode):
236         * Shared/SessionState.h: Added.
237         (WebKit::SessionState::list):
238         (WebKit::SessionState::currentIndex):
239
240         * WebKit2.pro:
241         * WebKit2.xcodeproj/project.pbxproj:
242         * win/WebKit2.vcproj:
243
244 2011-01-05  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
245
246         Unreviewed build fix.
247
248         Include unistd.h for _exit() for non-Windows builds.
249
250         Build break noticed on QtWebkit Symbian builds.
251
252         * Shared/ChildProcess.cpp:
253
254 2011-01-05  Brady Eidson  <beidson@apple.com>
255
256         Reviewed by Darin Adler.
257
258         https://bugs.webkit.org/show_bug.cgi?id=51949
259         Make WebBackForwardListItem shared, and add encoders and decoders
260
261         * Shared/WebBackForwardListItem.cpp: Copied from UIProcess/WebBackForwardListItem.cpp.
262         (WebKit::WebBackForwardListItem::encode):
263         (WebKit::WebBackForwardListItem::decode):
264         * Shared/WebBackForwardListItem.h: Copied from UIProcess/WebBackForwardListItem.h.
265         * UIProcess/WebBackForwardListItem.cpp: Removed.
266         * UIProcess/WebBackForwardListItem.h: Removed.
267
268         * WebKit2.pro:
269         * WebKit2.xcodeproj/project.pbxproj:
270         * win/WebKit2.vcproj:
271
272 2011-01-05  Anders Carlsson  <andersca@apple.com>
273
274         Reviewed by Sam Weinig.
275
276         Handle smart insert/delete
277         https://bugs.webkit.org/show_bug.cgi?id=51946
278
279         * Shared/WebPageCreationParameters.cpp:
280         (WebKit::WebPageCreationParameters::encode):
281         (WebKit::WebPageCreationParameters::decode):
282         * Shared/WebPageCreationParameters.h:
283         Add isSmartInsertDelete enabled.
284
285         * UIProcess/API/mac/WKView.mm:
286         (-[WKView validateUserInterfaceItem:]):
287         Handle toggleSmartInsertDelete:.
288
289         (-[WKView toggleSmartInsertDelete:]):
290         Toggle the smart insert/delete state.
291
292         * UIProcess/TextChecker.h:
293         Add isSmartInsertDeleteEnabled and setSmartInsertDeleteEnabled.
294
295         * UIProcess/WebPageProxy.cpp:
296         (WebKit::WebPageProxy::WebPageProxy):
297         Initialize m_isSmartInsertDeleteEnabled.
298
299         (WebKit::WebPageProxy::contextMenuItemSelected):
300         Handle ContextMenuItemTagSmartCopyPaste.
301
302         (WebKit::WebPageProxy::setSmartInsertDeleteEnabled):
303         Update the state and send a SetSmartInsertDeleteEnabled message.
304
305         (WebKit::WebPageProxy::creationParameters):
306         Initialize isSmartInsertDeleteEnabled.
307
308         * UIProcess/WebPageProxy.h:
309         (WebKit::WebPageProxy::isSmartInsertDeleteEnabled):
310         Return m_isSmartInsertDeleteEnabled.
311
312         * UIProcess/mac/TextCheckerMac.mm:
313         (WebKit::TextChecker::isSmartInsertDeleteEnabled):
314         (WebKit::TextChecker::setSmartInsertDeleteEnabled):
315         Store and fetch the smart insert delete state.
316
317         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
318         (WebKit::WebEditorClient::smartInsertDeleteEnabled):
319         Call WebPage::isSmartInsertDeleteEnabled.
320
321         * WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
322         (WebKit::WebEditorClient::toggleSmartInsertDelete):
323         Assert that this is never called.
324
325         * WebProcess/WebPage/WebPage.cpp:
326         (WebKit::WebPage::WebPage):
327         Initialize m_isSmartInsertDeleteEnabled
328
329         * WebProcess/WebPage/WebPage.h:
330         (WebKit::WebPage::isSmartInsertDeleteEnabled):
331         (WebKit::WebPage::setSmartInsertDeleteEnabled):
332         Add getter and setter.
333
334         * WebProcess/WebPage/WebPage.messages.in:
335         Add SetSmartInsertDeleteEnabled message.
336
337 2011-01-05  Anders Carlsson  <andersca@apple.com>
338
339         Fix Windows build.
340         
341         * WebProcess/WebPage/WebPage.cpp:
342
343 2011-01-05  Anders Carlsson  <andersca@apple.com>
344
345         Reviewed by Adele Peterson.
346
347         Implement word transformation
348         https://bugs.webkit.org/show_bug.cgi?id=51943
349
350         * UIProcess/API/mac/WKView.mm:
351         (-[WKView validateUserInterfaceItem:]):
352         Handle the word transformation selectors.
353
354         (-[WKView uppercaseWord:]):
355         (-[WKView lowercaseWord:]):
356         (-[WKView capitalizeWord:]):
357         Call down to the WebPageProxy.
358
359         * UIProcess/WebPageProxy.cpp:
360         (WebKit::WebPageProxy::uppercaseWord):
361         (WebKit::WebPageProxy::lowercaseWord):
362         (WebKit::WebPageProxy::capitalizeWord):
363         Send messages to the WebPage.
364
365         * WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
366         (WebKit::changeWordCase):
367         Add helper function.
368
369         (WebKit::WebEditorClient::uppercaseWord):
370         (WebKit::WebEditorClient::lowercaseWord):
371         (WebKit::WebEditorClient::capitalizeWord):
372         Call helper function.
373
374         * WebProcess/WebPage/WebPage.cpp:
375         (WebKit::WebPage::changeSpellingToWord):
376         Call replaceSelectionWithText.
377
378         (WebKit::WebPage::uppercaseWord):
379         (WebKit::WebPage::lowercaseWord):
380         (WebKit::WebPage::capitalizeWord):
381         Call the editor functions.
382
383         (WebKit::WebPage::replaceSelectionWithText):
384         New helper function that replaces the selected string with another string.
385
386         * WebProcess/WebPage/WebPage.messages.in:
387         Add new messages.
388
389 2011-01-05  Alexey Proskuryakov  <ap@apple.com>
390
391         Reviewed by Anders Carlsson.
392
393         https://bugs.webkit.org/show_bug.cgi?id=51935
394         Add WebKit2 API for largest frame
395
396         * UIProcess/API/C/WKPage.cpp:
397         (WKPageGetFrameSetLargestFrame):
398         * UIProcess/API/C/WKPage.h:
399
400 2011-01-05  Anders Carlsson  <andersca@apple.com>
401
402         Reviewed by Sam Weinig.
403
404         More work on spelling
405         https://bugs.webkit.org/show_bug.cgi?id=51939
406
407         * UIProcess/API/mac/WKView.mm:
408         (-[WKView validateUserInterfaceItem:]):
409         Handle changeSpelling: as well.
410
411         (-[WKView showGuessPanel:]):
412         Show or hide the guess panel.
413
414         (-[WKView checkSpelling:]):
415         Pass false to advanceToNextMisspelling.
416
417         (-[WKView changeSpelling:]):
418         Call changeSpellingToWord.
419
420         * UIProcess/TextChecker.h:
421         * UIProcess/WebPageProxy.cpp:
422         (WebKit::WebPageProxy::WebPageProxy):
423         Initialize m_pendingLearnOrIgnoreWordMessageCount.
424
425         (WebKit::WebPageProxy::contextMenuItemSelected):
426         Handle smart toggles directly in the UI process, keep track of whether
427         we're asked to learn or ignore a word.
428
429         (WebKit::WebPageProxy::advanceToNextMisspelling):
430         Pass the boolean through.
431
432         (WebKit::WebPageProxy::changeSpellingToWord):
433         Send a ChangeSpellingToWord message.
434
435         (WebKit::WebPageProxy::learnWord):
436         (WebKit::WebPageProxy::ignoreWord):
437         Check that we do have a pending learn or ignore word message. Call through to
438         the text checker.
439
440         (WebKit::WebPageProxy::processDidCrash):
441         Reset the m_pendingLearnOrIgnoreWordMessageCount variable.
442
443         * UIProcess/WebPageProxy.h:
444         * UIProcess/WebPageProxy.messages.in:
445         Add new messages.
446
447         * UIProcess/mac/TextCheckerMac.mm:
448         (WebKit::TextChecker::learnWord):
449         (WebKit::TextChecker::ignoreWord):
450         Implement in terms of NSSpellChecker.
451
452         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
453         (WebKit::WebEditorClient::ignoreWordInSpellDocument):
454         (WebKit::WebEditorClient::learnWord):
455         Send IgnoreWord and LearnWord messages.
456
457         * WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
458         (WebKit::WebEditorClient::toggleAutomaticQuoteSubstitution):
459         (WebKit::WebEditorClient::toggleAutomaticLinkDetection):
460         (WebKit::WebEditorClient::toggleAutomaticDashSubstitution):
461         (WebKit::WebEditorClient::toggleAutomaticTextReplacement):
462         Add assertions.
463
464         * WebProcess/WebPage/WebPage.cpp:
465         (WebKit::WebPage::advanceToNextMisspelling):
466         Pass the bool along to the Editor.
467
468         (WebKit::WebPage::changeSpellingToWord):
469         Replace the selected text.
470
471         * WebProcess/WebPage/WebPage.messages.in:
472         Add new ChangeSpellingToWord message and add a boolean to AdvanceToNextMisspelling.
473
474 2011-01-05  Anders Carlsson  <andersca@apple.com>
475
476         Reviewed by Dan Bernstein.
477
478         Keep track of active text substitution preferences
479         https://bugs.webkit.org/show_bug.cgi?id=51931
480
481         * Shared/TextCheckerState.h:
482         * UIProcess/API/mac/WKView.mm:
483         (-[WKView validateUserInterfaceItem:]):
484         Handle new selectors, mostly copied from WebKit1 code.
485
486         (-[WKView orderFrontSubstitutionsPanel:]):
487         Open the substitution panel.
488
489         (-[WKView isAutomaticQuoteSubstitutionEnabled]):
490         (-[WKView setAutomaticQuoteSubstitutionEnabled:]):
491         (-[WKView toggleAutomaticQuoteSubstitution:]):
492         (-[WKView isAutomaticDashSubstitutionEnabled]):
493         (-[WKView setAutomaticDashSubstitutionEnabled:]):
494         (-[WKView toggleAutomaticDashSubstitution:]):
495         (-[WKView isAutomaticLinkDetectionEnabled]):
496         (-[WKView setAutomaticLinkDetectionEnabled:]):
497         (-[WKView toggleAutomaticLinkDetection:]):
498         (-[WKView isAutomaticTextReplacementEnabled]):
499         (-[WKView setAutomaticTextReplacementEnabled:]):
500         (-[WKView toggleAutomaticTextReplacement:]):
501         Call the text checker, and update the state in the web process if needed.
502
503         * UIProcess/TextChecker.h:
504         Add new flags.
505
506         * UIProcess/mac/TextCheckerMac.mm:
507         (WebKit::initializeState):
508         Initialize flags from user defaults.
509
510         (WebKit::TextChecker::setAutomaticQuoteSubstitutionEnabled):
511         (WebKit::TextChecker::setAutomaticDashSubstitutionEnabled):
512         (WebKit::TextChecker::setAutomaticLinkDetectionEnabled):
513         (WebKit::TextChecker::setAutomaticTextReplacementEnabled):
514         Update and save the flags.
515
516         * WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
517         (WebKit::WebEditorClient::isAutomaticQuoteSubstitutionEnabled):
518         (WebKit::WebEditorClient::isAutomaticLinkDetectionEnabled):
519         (WebKit::WebEditorClient::isAutomaticDashSubstitutionEnabled):
520         (WebKit::WebEditorClient::isAutomaticTextReplacementEnabled):
521         Get the text checker state.
522
523 2011-01-05  Dan Bernstein  <mitz@apple.com>
524
525         Rubber-stamped by Darin Adler.
526
527         Cleaned up com.apple.WebProcess.sb
528
529         * WebProcess/com.apple.WebProcess.sb: Moved the closing parentheses of multi-line blocks to
530         their own lines. Changed to use WebKit-standard 4-space indentation.
531
532 2011-01-05  Alexey Proskuryakov  <ap@apple.com>
533
534         Reviewed by Sam Weinig.
535
536         https://bugs.webkit.org/show_bug.cgi?id=51903
537         Tell UI process which subframe is largest
538
539         * UIProcess/WebPageProxy.h:
540         (WebKit::WebPageProxy::frameSetLargestFrame):
541         Remember largest frame in frameset pages.
542
543         * UIProcess/WebPageProxy.cpp:
544         (WebKit::WebPageProxy::frameDidBecomeFrameSet): Reset stored largest frame if main frame
545         changes to a frameset or back.
546         (WebKit::WebPageProxy::frameSetLargestFrameChanged): Store a new largest frame when notified
547         of a change.
548
549         * UIProcess/WebPageProxy.messages.in: Added FrameSetLargestFrameChanged.
550
551         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
552         (WebKit::area): Calculate area of a frame.
553         (WebKit::findLargestFrameInFrameSet): Find largest first-level subframe in a frameset page.
554         (WebKit::WebChromeClient::contentsSizeChanged): Recalculate largest frame, and notify UI
555         process if it changed.
556
557         * WebProcess/WebCoreSupport/WebChromeClient.h: Store the latest largest frame.
558
559         * WebProcess/WebPage/WebFrame.cpp: (WebKit::WebFrame::size):
560         * WebProcess/WebPage/WebFrame.h:
561         Expose frame size.
562
563 2011-01-04  Benjamin Poulain  <benjamin.poulain@nokia.com>
564
565         Reviewed by Kenneth Rohde Christiansen.
566
567         [Qt] [WK2] Add support for non-trivial context menu action
568         https://bugs.webkit.org/show_bug.cgi?id=51902
569
570         Implement a call back from the QAction triggered in the UIProcess to the
571         action in WebProcess.
572
573         A few basic actions have been implemented based on this feature.
574
575         * UIProcess/API/qt/qwkpage.cpp:
576         (contextMenuActionForWebAction):
577         (QWKPage::triggerAction):
578         (QWKPage::action):
579         * UIProcess/API/qt/qwkpage.h:
580         * UIProcess/qt/WebContextMenuProxyQt.cpp:
581         (WebKit::webActionForContextMenuAction):
582
583 2011-01-04  Siddharth Mathur  <siddharth.mathur@nokia.com>
584
585         Reviewed by Laszlo Gombos.
586
587         Include unistd.h for sleep() for non-Windows builds.
588
589         * WebProcess/WebProcess.cpp:
590         * WebProcess/qt/WebProcessMainQt.cpp:
591
592 2011-01-04  Brian Weinstein  <bweinstein@apple.com>
593
594         Windows build fix. Change the inline type of consumePermanently.
595
596         * Shared/SandboxExtension.h:
597         (WebKit::SandboxExtension::consumePermanently):
598
599 2011-01-04  Anders Carlsson  <andersca@apple.com>
600
601         Reviewed by Dan Bernstein.
602
603         <rdar://problem/8821203> Sandbox violations trying to access the Safari cache
604
605         * Shared/SandboxExtension.h:
606         (WebKit::SandboxExtension::consumePermanently):
607         New function which consumes a sandbox extension and destroys it, making it impossible
608         to later revoke it.
609
610         * Shared/WebProcessCreationParameters.cpp:
611         (WebKit::WebProcessCreationParameters::encode):
612         (WebKit::WebProcessCreationParameters::decode):
613         Encode and decode the path extension handle.
614
615         * Shared/mac/SandboxExtensionMac.mm:
616         (WebKit::SandboxExtension::createHandle):
617         Standardize the path before creating the handle.
618
619         * UIProcess/mac/WebContextMac.mm:
620         (WebKit::WebContext::platformInitializeWebProcess):
621         Create a sandbox extension for the cache path.
622
623         * WebProcess/mac/WebProcessMac.mm:
624         (WebKit::WebProcess::platformInitializeWebProcess):
625         Consume the sandbox extension.
626
627 2011-01-04  Anders Carlsson  <andersca@apple.com>
628
629         Fix build.
630
631         * UIProcess/mac/TextCheckerMac.mm:
632         (WebKit::TextChecker::getGuessesForWord):
633
634 2011-01-04  Jeff Miller  <jeffm@apple.com>
635
636         Reviewed by Darin Adler.
637
638         Mouse events in WebKit2 on Windows need to know whether the click activated the WebView to match WebKit1 behavior.
639         https://bugs.webkit.org/show_bug.cgi?id=51228
640
641         * Shared/WebEvent.h:
642         (WebKit::WebMouseEvent::didActivateWebView):
643         Add m_didActivateWebView to WebMouseEvent on Windows.
644
645         * Shared/WebEventConversion.cpp:
646         (WebKit::WebKit2PlatformMouseEvent::WebKit2PlatformMouseEvent):
647         Propagate whether the click activated the WebView when converting to a PlatformMouseEvent.
648
649         * Shared/WebMouseEvent.cpp:
650         (WebKit::WebMouseEvent::WebMouseEvent):
651         Add m_didActivateWebView to WebMouseEvent on Windows.
652
653         (WebKit::WebMouseEvent::encode):
654         (WebKit::WebMouseEvent::decode):
655         Encode and decode new m_didActivateWebView member variable.
656
657         * Shared/win/WebEventFactory.cpp:
658         (WebKit::WebEventFactory::createWebMouseEvent):
659         * Shared/win/WebEventFactory.h:
660         Add didActivateWebView parameter to createWebMouseEvent().
661
662         * UIProcess/win/WebView.cpp:
663         (WebKit::WebView::wndProc):
664         (WebKit::WebView::WebView):
665         (WebKit::WebView::onMouseEvent):
666         * UIProcess/win/WebView.h:
667         (WebKit::WebView::setWasActivatedByMouseEvent):
668         Keep track of whether the click activated the WebView.
669
670 2011-01-04  Ivan Krstić  <ike@apple.com>
671
672         Reviewed and landed by Anders Carlsson.
673
674         <rdar://problem/8602585>
675         <rdar://problem/8711641>
676
677         * WebProcess/com.apple.WebProcess.sb:
678         Fix a misplaced right parenthesis and add a new system path regex.
679
680 2011-01-04  Anders Carlsson  <andersca@apple.com>
681
682         Reviewed by Sam Weinig.
683
684         More work on spelling and grammar
685         https://bugs.webkit.org/show_bug.cgi?id=51910
686
687         * Scripts/webkit2/messages.py:
688         Add special case for WebCore::TextCheckingResult.
689
690         * Shared/NotImplemented.h:
691         Fix macro so that defining DISABLE_NOT_IMPLEMENTED_WARNINGS to 0 will enable the warnings.
692         
693         * Shared/WebCoreArgumentCoders.h:
694         Add argument coders for WebCore::GrammarDetail and WebCore::TextCheckingResult.
695
696         * UIProcess/API/mac/WKView.mm:
697         (-[WKView checkSpelling:]):
698         Call advanceToNextMisspelling.
699
700         * UIProcess/TextChecker.h:
701         Add new NSSpellChecker wrappers.
702
703         * UIProcess/WebPageProxy.cpp:
704         (WebKit::WebPageProxy::WebPageProxy):
705         Initialize the new member variables.
706
707         (WebKit::WebPageProxy::~WebPageProxy):
708         Call TextChecker::closeSpellDocumentWithTag.
709
710         (WebKit::WebPageProxy::advanceToNextMisspelling):
711         Send the AdvanceToNextMisspelling message.
712
713         (WebKit::WebPageProxy::spellDocumentTag):
714         Create a spell document tag if necessary.
715
716         (WebKit::WebPageProxy::checkTextOfParagraph):
717         (WebKit::WebPageProxy::updateSpellingUIWithMisspelledWord):
718         (WebKit::WebPageProxy::getGuessesForWord):
719         Call the TextChecker.
720         
721         * UIProcess/WebPageProxy.messages.in:
722         Add new messages.
723
724         * UIProcess/mac/TextCheckerMac.mm:
725         (WebKit::TextChecker::uniqueSpellDocumentTag):
726         (WebKit::TextChecker::closeSpellDocumentWithTag):
727         (WebKit::TextChecker::checkTextOfParagraph):
728         (WebKit::TextChecker::updateSpellingUIWithMisspelledWord):
729         (WebKit::TextChecker::getGuessesForWord):
730         Add NSSpellChecker wrappers.
731
732         * UIProcess/qt/TextCheckerQt.cpp:
733         * UIProcess/win/TextCheckerWin.cpp:
734         Add stubs.
735
736         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
737         (WebKit::WebEditorClient::isContinuousSpellCheckingEnabled):
738         (WebKit::WebEditorClient::isGrammarCheckingEnabled):
739         Get the text checking state from the web process.
740
741         (WebKit::WebEditorClient::updateSpellingUIWithMisspelledWord):
742         (WebKit::WebEditorClient::getGuessesForWord):
743         Proxy calls to the UI process.
744
745         * WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
746         (WebKit::WebEditorClient::isAutomaticSpellingCorrectionEnabled):
747         
748         (WebKit::WebEditorClient::checkTextOfParagraph):
749         Proxy calls to the UI process.
750
751         * WebProcess/WebPage/WebPage.cpp:
752         (WebKit::WebPage::advanceToNextMisspelling):
753         Call the frame.
754
755         * WebProcess/WebPage/WebPage.messages.in:
756         Add AdvanceToNextMisspelling message.
757
758         * WebProcess/WebProcess.cpp:
759         (WebKit::WebProcess::initializeWebProcess):
760         Set the text checker state.
761
762 2011-01-04  Chris Fleizach  <cfleizach@apple.com>
763
764         Unreviewed. Build fix.
765
766         WK2: Support Accessibility
767         https://bugs.webkit.org/show_bug.cgi?id=51859
768
769         * WebProcess/WebPage/mac/AccessibilityWebPageObject.mm:
770
771 2011-01-04  Chris Fleizach  <cfleizach@apple.com>
772
773         Unreviewed. Build fix.
774
775         WK2: Support Accessibility
776         https://bugs.webkit.org/show_bug.cgi?id=51859
777
778         * WebProcess/WebPage/mac/AccessibilityWebPageObject.mm:
779         (-[AccessibilityWebPageObject accessibilityAttributeValue:]):
780
781 2011-01-04  Chris Fleizach  <cfleizach@apple.com>
782
783         Reviewed by Sam Weinig.
784
785         WK2: Support Accessibility
786         https://bugs.webkit.org/show_bug.cgi?id=51859
787
788         Implement remote accessibility API to support cross process accessibility
789         on the Mac platform.
790
791         * Shared/WebProcessCreationParameters.cpp:
792         (WebKit::WebProcessCreationParameters::encode):
793         (WebKit::WebProcessCreationParameters::decode):
794         * Shared/WebProcessCreationParameters.h:
795         * UIProcess/API/mac/PageClientImpl.h:
796         * UIProcess/API/mac/PageClientImpl.mm:
797         (WebKit::PageClientImpl::accessibilityChildTokenReceived):
798         * UIProcess/API/mac/WKView.mm:
799         (-[WKView initWithFrame:contextRef:pageGroupRef:]):
800         (-[WKView _updateWindowAndViewFrames]):
801         (-[WKView _setAccessibilityChildToken:]):
802         (-[WKView accessibilityIsIgnored]):
803         (-[WKView accessibilityHitTest:]):
804         (-[WKView accessibilityAttributeValue:]):
805         * UIProcess/API/mac/WKViewInternal.h:
806         * UIProcess/PageClient.h:
807         * UIProcess/WebContext.cpp:
808         (WebKit::WebContext::ensureWebProcess):
809         * UIProcess/WebPageProxy.cpp:
810         (WebKit::WebPageProxy::windowAndViewFramesChanged):
811         (WebKit::WebPageProxy::didReceiveAccessibilityPageToken):
812         (WebKit::WebPageProxy::sendAccessibilityPresenterToken):
813         * UIProcess/WebPageProxy.h:
814         * UIProcess/WebPageProxy.messages.in:
815         * WebKit2.xcodeproj/project.pbxproj:
816         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
817         (WebKit::WebFrameLoaderClient::accessibilityRemoteObject):
818         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
819         * WebProcess/WebPage/WebPage.cpp:
820         (WebKit::WebPage::windowAndViewFramesChanged):
821         * WebProcess/WebPage/WebPage.h:
822         (WebKit::WebPage::accessibilityPosition):
823         * WebProcess/WebPage/WebPage.messages.in:
824         * WebProcess/WebPage/mac/AccessibilityWebPageObject.h: Added.
825         * WebProcess/WebPage/mac/AccessibilityWebPageObject.mm: Added.
826         (-[AccessibilityWebPageObject setWebPage:]):
827         (-[AccessibilityWebPageObject setRemoteParent:]):
828         (-[AccessibilityWebPageObject dealloc]):
829         (-[AccessibilityWebPageObject accessibilityIsIgnored]):
830         (-[AccessibilityWebPageObject accessibilityAttributeNames]):
831         (-[AccessibilityWebPageObject accessibilityIsAttributeSettable:]):
832         (-[AccessibilityWebPageObject accessibilitySetValue:forAttribute:]):
833         (-[AccessibilityWebPageObject accessibilityActionNames]):
834         (-[AccessibilityWebPageObject accessibilityChildren]):
835         (-[AccessibilityWebPageObject accessibilityAttributeValue:]):
836         (-[AccessibilityWebPageObject accessibilityShouldUseUniqueId]):
837         (-[AccessibilityWebPageObject accessibilityHitTest:]):
838         (-[AccessibilityWebPageObject accessibilityFocusedUIElement]):
839         * WebProcess/WebPage/mac/WebPageMac.mm:
840         (WebKit::WebPage::platformInitialize):
841         (WebKit::WebPage::sendAccessibilityPresenterToken):
842         (WebKit::WebPage::accessibilityRemoteObject):
843         * WebProcess/WebProcess.cpp:
844         (WebKit::WebProcess::initializeWebProcess):
845         * WebProcess/WebProcess.h:
846         (WebKit::WebProcess::presenterApplicationPid):
847         * WebProcess/mac/WebProcessMainMac.mm:
848         (WebKit::WebProcessMain):
849
850 2011-01-04  Brady Eidson  <beidson@apple.com>
851
852         Reviewed by Darin Adler.
853
854         Get rid of an extra copy in the back/forward item IPC message by using a DataReference.
855
856         * UIProcess/WebBackForwardListItem.cpp:
857         (WebKit::WebBackForwardListItem::WebBackForwardListItem):
858         (WebKit::WebBackForwardListItem::setBackForwardData):
859         * UIProcess/WebBackForwardListItem.h:
860
861         * UIProcess/WebPageProxy.cpp:
862         (WebKit::WebPageProxy::dataCallback): Get rid of no-longer-needed check for size 0.
863
864         * UIProcess/WebProcessProxy.cpp:
865         (WebKit::WebProcessProxy::addBackForwardItem):
866         * UIProcess/WebProcessProxy.h:
867
868         * UIProcess/WebProcessProxy.messages.in:
869
870         * WebProcess/WebPage/EncoderAdapter.cpp:
871         (WebKit::EncoderAdapter::data):
872         * WebProcess/WebPage/EncoderAdapter.h:
873
874         * WebProcess/WebPage/WebBackForwardListProxy.cpp:
875
876 2011-01-04  Brady Eidson  <beidson@apple.com>
877
878         Reviewed by Darin Adler.
879
880         Store more data per history entry in the session state blob.
881
882         * UIProcess/WebBackForwardListItem.cpp:
883         (WebKit::WebBackForwardListItem::WebBackForwardListItem):
884         * UIProcess/WebBackForwardListItem.h:
885         (WebKit::WebBackForwardListItem::create):
886
887         * UIProcess/WebProcessProxy.cpp:
888         (WebKit::WebProcessProxy::addBackForwardItem):
889
890         * UIProcess/cf/WebBackForwardListCF.cpp:
891         (WebKit::WebBackForwardList::createCFDictionaryRepresentation):
892
893         * UIProcess/cf/WebPageProxyCF.cpp:
894
895 2011-01-04  Darin Adler  <darin@apple.com>
896
897         Reviewed by Brady Eidson.
898
899         Add back/forward encoding and decoding to WebKit2
900         https://bugs.webkit.org/show_bug.cgi?id=51901
901
902         * GNUmakefile.am: Added new source files.
903         * WebKit2.pro: Ditto.
904         * WebKit2.xcodeproj/project.pbxproj: Ditto.
905         * win/WebKit2.vcproj: Ditto.
906
907         * WebProcess/WebPage/DecoderAdapter.cpp: Added.
908         * WebProcess/WebPage/DecoderAdapter.h: Added.
909         * WebProcess/WebPage/EncoderAdapter.cpp: Added.
910         * WebProcess/WebPage/EncoderAdapter.h: Added.
911
912         * WebProcess/WebPage/WebBackForwardListProxy.cpp:
913         (WebKit::updateBackForwardItem): Added code to encode the back/forward
914         tree and send it along. The code to decode needs to wait on Brady's
915         current project.
916
917 2011-01-04  Anders Carlsson  <andersca@apple.com>
918
919         Reviewed by Sam Weinig.
920
921         <rdar://problem/8766999> WebKit2: Sandboxing causes certificate error on access to any HTTPS URL
922
923         Allow read access to /Library/Preferences/com.apple.security.plist.
924
925         * WebProcess/com.apple.WebProcess.sb:
926
927 2011-01-04  Anders Carlsson  <andersca@apple.com>
928
929         Build fixes.
930
931         * UIProcess/qt/TextCheckerQt.cpp:
932         * UIProcess/win/TextCheckerWin.cpp:
933
934 2011-01-04  Anders Carlsson  <andersca@apple.com>
935
936         Reviewed by Darin Adler.
937
938         Don't use macros for the key names.
939
940         * UIProcess/mac/TextCheckerMac.mm:
941
942 2011-01-04  Anders Carlsson  <andersca@apple.com>
943
944         Reviewed by Sam Weinig.
945
946         Send over text checker state to the web process
947         https://bugs.webkit.org/show_bug.cgi?id=51896
948
949         * Platform/CoreIPC/Arguments.h:
950         Remove 'const' from the argument, this matches all the other Arguments classes.
951
952         * Shared/TextCheckerState.h: Added.
953         New class with text checker state.
954
955         * Shared/WebProcessCreationParameters.cpp:
956         (WebKit::WebProcessCreationParameters::encode):
957         (WebKit::WebProcessCreationParameters::decode):
958         * Shared/WebProcessCreationParameters.h:
959         Add textCheckerState.
960
961         * UIProcess/API/mac/WKView.mm:
962         (-[WKView validateUserInterfaceItem:]):        
963         (-[WKView toggleContinuousSpellChecking:]):
964         (-[WKView toggleGrammarChecking:]):
965         (-[WKView toggleAutomaticSpellingCorrection:]):
966         Get the needed flags from the text checker state.
967
968         * UIProcess/TextChecker.h:
969         Add state() function, remove getters.
970
971         * UIProcess/WebContext.cpp:
972         (WebKit::WebContext::ensureWebProcess):
973         Initialize the text checker state.
974
975         * UIProcess/WebProcessProxy.cpp:
976         (WebKit::WebProcessProxy::updateTextCheckerState):
977         Send the SetTextCheckerState message to the web process.
978
979         * UIProcess/mac/TextCheckerMac.mm:
980         (WebKit::initializeState):
981         Initialize the state from the user defaults.
982
983         (WebKit::TextChecker::state):
984         Return the state.
985
986         (WebKit::TextChecker::setContinuousSpellCheckingEnabled):
987         (WebKit::TextChecker::setGrammarCheckingEnabled):
988         (WebKit::TextChecker::setAutomaticSpellingCorrectionEnabled):
989         Make sure to write the new state.
990         
991         * UIProcess/qt/TextCheckerQt.cpp:
992         (WebKit::TextChecker::state):
993         * UIProcess/win/TextCheckerWin.cpp:
994         (WebKit::TextChecker::state):
995         Add stubs.
996
997         * WebKit2.xcodeproj/project.pbxproj:
998         Add TextCheckerState.h.
999
1000         * WebProcess/WebProcess.cpp:
1001         (WebKit::WebProcess::WebProcess):
1002         Initialize m_textCheckerState.
1003
1004         (WebKit::WebProcess::setTextCheckerState):
1005         Update.
1006
1007         * WebProcess/WebProcess.messages.in:
1008         Add SetTextCheckerState message.
1009
1010         * win/WebKit2.vcproj:
1011         Add TextCheckerState.h.
1012
1013 2011-01-04  Brady Eidson  <beidson@apple.com>
1014
1015         Rubberstamped by Anders Carlsson.
1016
1017         Attach a radar # to this FIXME:
1018         * WebProcess/WebPage/WebBackForwardListProxy.cpp:
1019
1020 2011-01-04  Anders Carlsson  <andersca@apple.com>
1021
1022         Reviewed by John Sullivan.
1023
1024         Add more spelling/grammar related methods
1025         https://bugs.webkit.org/show_bug.cgi?id=51886
1026
1027         * UIProcess/API/mac/WKView.mm:
1028         (-[WKView validateUserInterfaceItem:]):
1029         Handle more selectors.
1030
1031         (-[WKView showGuessPanel:]):
1032         Add stub.
1033
1034         (-[WKView checkSpelling:]):
1035         Ditto.
1036
1037         (-[WKView toggleAutomaticSpellingCorrection:]):
1038         Toggle automatic spelling correction.
1039
1040         * UIProcess/TextChecker.h:
1041         Add setAutomaticSpellingCorrectionEnabled and isAutomaticSpellingCorrectionEnabled.
1042
1043         * UIProcess/mac/TextCheckerMac.mm:
1044         (WebKit::TextChecker::setAutomaticSpellingCorrectionEnabled):
1045         (WebKit::TextChecker::isAutomaticSpellingCorrectionEnabled):
1046         Update the toggle.
1047
1048         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
1049         * WebProcess/WebCoreSupport/mac/WebErrorsMac.mm:
1050         Add a Radar URL for the localization FIXMEs.
1051
1052 2011-01-04  Brent Fulgham  <bfulgham@webkit.org>
1053
1054         Unreviewed build fix.
1055
1056         * win/WebKit2.vcproj: Correct the missing $(WebKitVSPropsRedirectionDir)
1057         variables that Visual Studio helpfully removes when making changes.
1058
1059 2011-01-04  Brent Fulgham  <bfulgham@webkit.org>
1060
1061         Unreviewed build fix.
1062
1063         * win/WebKit2.vcproj: Disable CG-specific WKImageCG.cpp from
1064         Debug_Cairo_CFLite/Release_Cario_CFLite builds.
1065
1066 2011-01-04  Brady Eidson  <beidson@apple.com>
1067
1068         Reviewed by Darin Adler.
1069
1070         https://bugs.webkit.org/show_bug.cgi?id=51856
1071         Pass encoded back/forward tree data from the WebProcess to the UIProcess
1072
1073         Remove the WKBackForwardListItemCopyOriginalURL API as it's not needed:
1074         * UIProcess/API/C/WKBackForwardListItem.cpp:
1075         * UIProcess/API/C/WKBackForwardListItem.h:
1076         * UIProcess/API/qt/qwkhistory.cpp:
1077         * UIProcess/API/qt/qwkhistory.h:
1078         
1079         * UIProcess/WebBackForwardListItem.cpp:
1080         (WebKit::WebBackForwardListItem::WebBackForwardListItem):
1081         * UIProcess/WebBackForwardListItem.h:
1082         (WebKit::WebBackForwardListItem::create):
1083         (WebKit::WebBackForwardListItem::setBackForwardData):
1084         (WebKit::WebBackForwardListItem::backForwardData):
1085         
1086         * UIProcess/WebProcessProxy.cpp:
1087         (WebKit::WebProcessProxy::addBackForwardItem):
1088         * UIProcess/WebProcessProxy.h:
1089         
1090         * UIProcess/WebProcessProxy.messages.in:
1091         
1092         * WebProcess/WebPage/WebBackForwardListProxy.cpp:
1093         (WebKit::updateBackForwardItem):
1094
1095 2011-01-04  Balazs Kelemen  <kbalazs@webkit.org>
1096
1097         Reviewed by Kenneth Rohde Christiansen.
1098
1099         [Qt][WK2] Incomplete clean up on termination
1100         https://bugs.webkit.org/show_bug.cgi?id=51474
1101
1102         Do not kill the web process to force it's termination.
1103         Fix object destruction and cleanup logic and make the cleanup more reliable.
1104         Do not try to cleanup on crash because it is not reliable.
1105
1106         * Platform/CoreIPC/qt/ConnectionQt.cpp:
1107         (CoreIPC::Connection::platformInvalidate): Do not delete the socket if we
1108         do not own it. This is the case with a server connection.
1109         * Platform/qt/MappedMemoryPool.cpp:
1110         Turn MappedMemoryPool into a QObject so the CleanupHandler can destruct it
1111         in the same way as the other objects.
1112         (WebKit::MappedMemoryPool::instance):
1113         (WebKit::MappedMemoryPool::~MappedMemoryPool):
1114         * Platform/qt/MappedMemoryPool.h:
1115         (WebKit::MappedMemoryPool::MappedMemoryPool):
1116         * Platform/qt/SharedMemoryQt.cpp:
1117         (WebKit::SharedMemory::create): No need to care about QCoreApplication::aboutToQuit.
1118         It is handled by the CleanupHandler.
1119         (WebKit::SharedMemory::~SharedMemory): Ditto.
1120         * Shared/qt/CleanupHandler.cpp: Renamed from WebKit2/Shared/qt/CrashHandler.cpp.
1121         No longer try to handle crash but just normal termination.
1122         (WebKit::CleanupHandler::CleanupHandler): Connect deleteObjects with QCoreApplication::aboutToQuit.
1123         Ensure appropriate thread affinity.
1124         (WebKit::CleanupHandler::sigTermHandler): Stop the main event loop.
1125         (WebKit::CleanupHandler::deleteObjects): Use deleteLater instead of delete since it is more reliable.
1126         * Shared/qt/CleanupHandler.h: Renamed from WebKit2/Shared/qt/CrashHandler.h.
1127         (WebKit::CleanupHandler::instance):
1128         (WebKit::CleanupHandler::markForCleanup):
1129         (WebKit::CleanupHandler::unmark):
1130         * UIProcess/Launcher/qt/ProcessLauncherQt.cpp:
1131         Do not kill the web process immidiately but give it a chance to cleanup.
1132         Use QLocalServer::removeServer for assuring that the socket file will be removed.
1133         (WebKit::ProcessLauncherHelper::serverName):
1134         (WebKit::cleanupAtExit): Renamed from cleanupProcesses. Only kill the web process when it times
1135         out terminating. Fixed the bug of changing the list while iterating it over by disconnecting
1136         from the processStateChanged slot.
1137         (WebKit::QtWebProcess::QtWebProcess): Added missing meta type registration of QProcess::ProcessState.
1138         (WebKit::ProcessLauncherHelper::~ProcessLauncherHelper):
1139         (WebKit::ProcessLauncherHelper::ProcessLauncherHelper): No need to add the the instance to the
1140         CleanupHandler because we will remove the socket file in cleanupAtExit.
1141         (WebKit::ProcessLauncherHelper::instance):
1142         (WebKit::ProcessLauncher::terminateProcess):
1143         * WebKit2.pro:
1144
1145 2011-01-04  Benjamin Poulain  <benjamin.poulain@nokia.com>
1146
1147         Reviewed by Kenneth Rohde Christiansen.
1148
1149         [Qt] [WK2] create an initial implementation of the context menu handling for WebKit 2
1150         https://bugs.webkit.org/show_bug.cgi?id=51825
1151
1152         Implement the necessary methods to get a basic context menu working for Qt.
1153
1154         Only 4 basic WebAction have been added on the UIProcess side: back, forward, stop and reload.
1155
1156         * UIProcess/API/qt/qgraphicswkview.cpp:
1157         (QGraphicsWKView::QGraphicsWKView):
1158         (QGraphicsWKView::showContextMenu):
1159         (QGraphicsWKViewPrivate::QGraphicsWKViewPrivate):
1160         * UIProcess/API/qt/qgraphicswkview.h:
1161         * UIProcess/API/qt/qwkpage.cpp:
1162         (QWKPagePrivate::createContextMenuProxy):
1163         * UIProcess/API/qt/qwkpage.h:
1164         * UIProcess/qt/WebContextMenuProxyQt.cpp:
1165         (WebKit::webActionForContextMenuAction):
1166         (WebKit::WebContextMenuProxyQt::WebContextMenuProxyQt):
1167         (WebKit::WebContextMenuProxyQt::create):
1168         (WebKit::WebContextMenuProxyQt::showContextMenu):
1169         (WebKit::WebContextMenuProxyQt::hideContextMenu):
1170         (WebKit::WebContextMenuProxyQt::createContextMenu):
1171         * UIProcess/qt/WebContextMenuProxyQt.h:
1172
1173 2011-01-03  Yi Shen  <yi.4.shen@nokia.com>
1174
1175         Reviewed by Adam Barth.
1176
1177         [Qt] Add SelectAll option to the context menu for the editor
1178         https://bugs.webkit.org/show_bug.cgi?id=50049
1179
1180         Add WebPlatformStrategies::contextMenuItemTagSelectAll for Qt.
1181
1182         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
1183         (WebKit::WebPlatformStrategies::contextMenuItemTagSelectAll):
1184         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
1185
1186 2011-01-03  Sam Weinig  <sam@webkit.org>
1187
1188         Reviewed by Anders Carlsson.
1189
1190         Ensure that the correct initial focusable area is focused when tabbing
1191         and shift-tabbing into the WKView.
1192
1193         * UIProcess/API/mac/WKView.mm:
1194         (-[WKView becomeFirstResponder]): Use the keyViewSelectionDirection to set
1195         the initial focus.
1196
1197 2011-01-02  Dan Bernstein  <mitz@apple.com>
1198
1199         Rubber-stamped by Simon Fraser.
1200
1201         <rdar://problem/8812159> Update copyright strings
1202
1203         * Info.plist:
1204         * WebProcess/Info.plist:
1205
1206 2011-01-02  Benjamin Poulain  <benjamin.poulain@nokia.com>
1207
1208         Reviewed by Csaba Osztrogonác.
1209
1210         WebKit 2 does not build on 64bits with a recent GCC
1211         https://bugs.webkit.org/show_bug.cgi?id=51754
1212
1213         Change the argument coding for DatabaseDetails to use explicitly the 64 bits type.
1214
1215         * Shared/OriginAndDatabases.h:
1216         * Shared/WebCoreArgumentCoders.h:
1217
1218 2011-01-02  Csaba Osztrogonác  <ossy@webkit.org>
1219
1220         Reviewed by Adam Barth.
1221
1222         Move JavaScriptCore to Source
1223         https://bugs.webkit.org/show_bug.cgi?id=51604
1224
1225         Workaround until moving all sources to Source directory is finished.
1226
1227         * Scripts/generate-forwarding-headers.pl: Add Sources to searching path for JavaScriptCore.
1228
1229 2011-01-01  Adam Barth  <abarth@webkit.org>
1230
1231         Speculative build fix for Qt.  Add some more include paths.
1232
1233         * WebKit2.pro:
1234
1235 2011-01-01  Adam Barth  <abarth@webkit.org>
1236
1237         Reviewed by Eric Seidel.
1238
1239         Move JavaScriptCore to Source
1240         https://bugs.webkit.org/show_bug.cgi?id=51604
1241
1242         * WebKit2.pro:
1243           - Point to JavaScriptCore in its new location.
1244
1245 2010-12-15  Amruth Raj  <amruthraj@motorola.com> and Ravi Kasibhatla  <ravi.kasibhatla@motorola.com>
1246
1247         Reviewed by Martin Robinson.
1248
1249         [GTK] Enable building whatever already exists of WebKit2
1250         https://bugs.webkit.org/show_bug.cgi?id=37369
1251
1252         * GNUmakefile.am: Added. 
1253         * WebKit2Prefix.h: Included WebCore/config.h for GTK port as the first header
1254         file for WebKit2 sources files.
1255         * gtk: Added.
1256         * gtk/webkit2.pc.in: Added.
1257
1258 2010-12-29  Juha Savolainen  <juha.savolainen@weego.fi>
1259
1260         Reviewed by Kenneth Rohde Christiansen.
1261
1262         [Qt] [WK2] Added more webattributes to the qwkpreferences
1263         https://bugs.webkit.org/show_bug.cgi?id=51697
1264
1265         Added PrivateBrowsingEnabled, DeveloperExtrasEnabled, DnsPrefetchEnabled attributes
1266
1267         * UIProcess/API/qt/qwkpreferences.cpp:
1268         (QWKPreferences::testAttribute): 
1269         (QWKPreferences::setAttribute): 
1270         * UIProcess/API/qt/qwkpreferences.h:
1271
1272 2010-12-27  Sam Weinig  <sam@webkit.org>
1273
1274         Reviewed by Anders Carlsson.
1275
1276         WebKit2 snapshots should contain accelerated content
1277         <rdar://problem/8807393>
1278         https://bugs.webkit.org/show_bug.cgi?id=51660
1279
1280         When creating a snapshot, flatten the layer tree for painting so that
1281         accelerated content is included in the snapshot.
1282
1283         * WebProcess/WebPage/WebPage.cpp:
1284         (WebKit::WebPage::snapshotInViewCoordinates):
1285         (WebKit::WebPage::snapshotInDocumentCoordinates):
1286
1287 2010-12-27  Daniel Bates  <dbates@rim.com>
1288
1289         Attempt to fix the WebKit2 Windows build after changeset 74698
1290         <http://trac.webkit.org/changeset/74698> (bug #51656).
1291
1292         Add "..\Shared\API\c\WKImage.h" to WebKit2Generated.make.
1293
1294         * win/WebKit2Generated.make:
1295
1296 2010-12-27  Sam Weinig  <sam@webkit.org>
1297
1298         Reviewed by Anders Carlsson.
1299
1300         WebKit2: Add API for getting snapshots
1301         https://bugs.webkit.org/show_bug.cgi?id=51656
1302
1303         * Shared/API/c/WKBase.h:
1304         * Shared/API/c/WKImage.cpp: Added.
1305         (WKImageGetTypeID):
1306         (WKImageCreate):
1307         (WKImageGetSize):
1308         * Shared/API/c/WKImage.h: Added.
1309         * Shared/WebImage.cpp: Added.
1310         (WebKit::WebImage::create):
1311         (WebKit::WebImage::size):
1312         * Shared/WebImage.h: Added.
1313         (WebKit::WebImage::backingStore):
1314         (WebKit::WebImage::WebImage):
1315         (WebKit::WebImage::type):
1316         Add a general purpose API image class.
1317
1318         * Shared/API/c/cg: Added.
1319         * Shared/API/c/cg/WKImageCG.cpp: Added.
1320         (WKImageCreateCGImage):
1321         * Shared/API/c/cg/WKImageCG.h: Added.
1322         Add function to convert a WKImageRef to a CGImageRef for platforms that use CG.
1323
1324         * Shared/API/c/WKSharedAPICast.h:
1325         (WebKit::toFloatRect):
1326         (WebKit::toIntSize):
1327         (WebKit::toIntPoint):
1328         (WebKit::toIntRect):
1329         (WebKit::toImageOptions):
1330         Make conversion functions that are ambiguous more explicit.
1331
1332         * Shared/APIObject.h:
1333         * Shared/BackingStore.h:
1334         (WebKit::BackingStore::isBackedBySharedMemory):
1335         * Shared/ImageOptions.h: Added.
1336         * Shared/UserMessageCoders.h:
1337         (WebKit::UserMessageEncoder::baseEncode):
1338         (WebKit::UserMessageDecoder::baseDecode):
1339         Allow a WKImageRef to be passed in user messages.  Right now, it only
1340         works if the image is sharable.
1341
1342         * UIProcess/API/C/WKPage.cpp:
1343         (WKPageScaleWebView):
1344         * UIProcess/WebUIClient.cpp:
1345         (WebKit::WebUIClient::windowFrame):
1346         Use the more explicit conversion function name.
1347
1348         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
1349         (WKBundlePageCreateSnapshotInViewCoordinates):
1350         (WKBundlePageCreateSnapshotInDocumentCoordinates):
1351         * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
1352         * WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:
1353         (WKBundlePageOverlaySetNeedsDisplay):
1354         * WebProcess/WebPage/WebPage.cpp:
1355         (WebKit::WebPage::snapshotInViewCoordinates):
1356         (WebKit::WebPage::snapshotInDocumentCoordinates):
1357         Add function to take the snapshot.
1358
1359         * WebProcess/WebPage/WebPage.h:
1360         * WebKit2.pro:
1361         * WebKit2.xcodeproj/project.pbxproj:
1362         * win/WebKit2.vcproj:
1363         Add new files.
1364
1365 2010-12-27  Sam Weinig  <sam@webkit.org>
1366
1367         Reviewed by Anders Carlsson.
1368
1369         WebKit2: Add additional API for managing databases
1370         https://bugs.webkit.org/show_bug.cgi?id=51629
1371
1372         - Adds client for the database manager to get notifications
1373           of changes to databases.
1374
1375         * UIProcess/API/C/WKDatabaseManager.cpp:
1376         (WKDatabaseManagerSetClient):
1377         * UIProcess/API/C/WKDatabaseManager.h:
1378         * UIProcess/WebDatabaseManagerProxy.cpp:
1379         (WebKit::WebDatabaseManagerProxy::initializeClient):
1380         (WebKit::WebDatabaseManagerProxy::didModifyOrigin):
1381         (WebKit::WebDatabaseManagerProxy::didModifyDatabase):
1382         * UIProcess/WebDatabaseManagerProxy.h:
1383         * UIProcess/WebDatabaseManagerProxy.messages.in:
1384         * UIProcess/WebDatabaseManagerProxyClient.cpp: Added.
1385         (WebKit::WebDatabaseManagerProxyClient::didModifyOrigin):
1386         (WebKit::WebDatabaseManagerProxyClient::didModifyDatabase):
1387         * UIProcess/WebDatabaseManagerProxyClient.h: Added.
1388         * WebKit2.pro:
1389         * WebKit2.xcodeproj/project.pbxproj:
1390         * WebProcess/WebCoreSupport/WebDatabaseManager.cpp:
1391         (WebKit::WebDatabaseManager::WebDatabaseManager):
1392         (WebKit::WebDatabaseManager::~WebDatabaseManager):
1393         (WebKit::WebDatabaseManager::dispatchDidModifyOrigin):
1394         (WebKit::WebDatabaseManager::dispatchDidModifyDatabase):
1395         * WebProcess/WebCoreSupport/WebDatabaseManager.h:
1396         * win/WebKit2.vcproj:
1397
1398 2010-12-27  Sam Weinig  <sam@webkit.org>
1399
1400         Reviewed by Anders Carlsson.
1401
1402         WebKit2: Add additional API for managing databases
1403         https://bugs.webkit.org/show_bug.cgi?id=51629
1404
1405         - Adds WKDatabaseManagerGetDatabasesByOrigin, which asynchronously returns
1406           an array of dictionaries containing details about each origin using 
1407           databases and details about each database. Keys were added for accessing
1408           the data in the dictionaries.
1409         - Adds WKDatabaseManagerDeleteDatabasesWithNameForOrigin to delete a database
1410           with a specific identifier.
1411         - Adds WKDatabaseManagerSetQuotaForOrigin to set the quota for an origin.
1412
1413         * Shared/OriginAndDatabases.cpp: Added.
1414         (WebKit::OriginAndDatabases::encode):
1415         (WebKit::OriginAndDatabases::decode):
1416         * Shared/OriginAndDatabases.h: Added.
1417         * Shared/WebCoreArgumentCoders.h:
1418         * UIProcess/API/C/WKDatabaseManager.cpp:
1419         (WKDatabaseManagerGetOriginKey):
1420         (WKDatabaseManagerGetOriginQuotaKey):
1421         (WKDatabaseManagerGetOriginUsageKey):
1422         (WKDatabaseManagerGetDatabaseDetailsKey):
1423         (WKDatabaseManagerGetDatabaseDetailsNameKey):
1424         (WKDatabaseManagerGetDatabaseDetailsDisplayNameKey):
1425         (WKDatabaseManagerGetDatabaseDetailsExpectedUsageKey):
1426         (WKDatabaseManagerGetDatabaseDetailsCurrentUsageKey):
1427         (WKDatabaseManagerGetDatabasesByOrigin):
1428         (callGetDatabasesByOriginBlockAndDispose):
1429         (WKDatabaseManagerGetDatabasesByOrigin_b):
1430         (WKDatabaseManagerGetDatabaseOrigins):
1431         (callGetDatabaseOriginsBlockBlockAndDispose):
1432         (WKDatabaseManagerGetDatabaseOrigins_b):
1433         (WKDatabaseManagerDeleteDatabasesWithNameForOrigin):
1434         (WKDatabaseManagerDeleteDatabasesForOrigin):
1435         (WKDatabaseManagerDeleteAllDatabases):
1436         (WKDatabaseManagerSetQuotaForOrigin):
1437         * UIProcess/API/C/WKDatabaseManager.h:
1438         * UIProcess/WebDatabaseManagerProxy.cpp:
1439         (WebKit::WebDatabaseManagerProxy::originKey):
1440         (WebKit::WebDatabaseManagerProxy::originQuotaKey):
1441         (WebKit::WebDatabaseManagerProxy::originUsageKey):
1442         (WebKit::WebDatabaseManagerProxy::databaseDetailsKey):
1443         (WebKit::WebDatabaseManagerProxy::databaseDetailsNameKey):
1444         (WebKit::WebDatabaseManagerProxy::databaseDetailsDisplayNameKey):
1445         (WebKit::WebDatabaseManagerProxy::databaseDetailsExpectedUsageKey):
1446         (WebKit::WebDatabaseManagerProxy::databaseDetailsCurrentUsageKey):
1447         (WebKit::WebDatabaseManagerProxy::invalidate):
1448         (WebKit::WebDatabaseManagerProxy::getDatabasesByOrigin):
1449         (WebKit::WebDatabaseManagerProxy::didGetDatabasesByOrigin):
1450         (WebKit::WebDatabaseManagerProxy::getDatabaseOrigins):
1451         (WebKit::WebDatabaseManagerProxy::didGetDatabaseOrigins):
1452         (WebKit::WebDatabaseManagerProxy::deleteDatabaseWithNameForOrigin):
1453         (WebKit::WebDatabaseManagerProxy::deleteDatabasesForOrigin):
1454         (WebKit::WebDatabaseManagerProxy::setQuotaForOrigin):
1455         * UIProcess/WebDatabaseManagerProxy.h:
1456         * UIProcess/WebDatabaseManagerProxy.messages.in:
1457         * WebKit2.pro:
1458         * WebKit2.xcodeproj/project.pbxproj:
1459         * WebProcess/WebCoreSupport/WebDatabaseManager.cpp:
1460         (WebKit::WebDatabaseManager::getDatabasesByOrigin):
1461         (WebKit::WebDatabaseManager::deleteDatabaseWithNameForOrigin):
1462         (WebKit::WebDatabaseManager::setQuotaForOrigin):
1463         * WebProcess/WebCoreSupport/WebDatabaseManager.h:
1464         * WebProcess/WebCoreSupport/WebDatabaseManager.messages.in:
1465         * win/WebKit2.vcproj:
1466
1467 2010-12-26  Anders Carlsson  <andersca@apple.com>
1468
1469         Reviewed by Dan Bernstein.
1470
1471         Rename DrawingAreaMessage and DrawingAreaLegacyMessage and
1472         DrawingAreaProxyMessage to DrawingAreaProxyLegacyMessage.
1473
1474         * Platform/CoreIPC/MessageID.h:
1475         * Shared/CoreIPCSupport/DrawingAreaMessageKinds.h:
1476         * Shared/CoreIPCSupport/DrawingAreaProxyMessageKinds.h:
1477         * UIProcess/ChunkedUpdateDrawingAreaProxy.cpp:
1478         (WebKit::ChunkedUpdateDrawingAreaProxy::paint):
1479         (WebKit::ChunkedUpdateDrawingAreaProxy::setPageIsVisible):
1480         (WebKit::ChunkedUpdateDrawingAreaProxy::update):
1481         (WebKit::ChunkedUpdateDrawingAreaProxy::sendSetSize):
1482         (WebKit::ChunkedUpdateDrawingAreaProxy::didReceiveMessage):
1483         * UIProcess/LayerBackedDrawingAreaProxy.cpp:
1484         (WebKit::LayerBackedDrawingAreaProxy::sizeDidChange):
1485         (WebKit::LayerBackedDrawingAreaProxy::setPageIsVisible):
1486         (WebKit::LayerBackedDrawingAreaProxy::update):
1487         (WebKit::LayerBackedDrawingAreaProxy::didReceiveMessage):
1488         (WebKit::LayerBackedDrawingAreaProxy::didReceiveSyncMessage):
1489         * UIProcess/TiledDrawingAreaProxy.cpp:
1490         (WebKit::TiledDrawingAreaProxy::sizeDidChange):
1491         (WebKit::TiledDrawingAreaProxy::setPageIsVisible):
1492         (WebKit::TiledDrawingAreaProxy::didReceiveMessage):
1493         (WebKit::TiledDrawingAreaProxy::requestTileUpdate):
1494         (WebKit::TiledDrawingAreaProxy::waitUntilUpdatesComplete):
1495         (WebKit::TiledDrawingAreaProxy::takeSnapshot):
1496         (WebKit::TiledDrawingAreaProxy::removeTile):
1497         * UIProcess/WebPageProxy.cpp:
1498         (WebKit::WebPageProxy::didReceiveMessage):
1499         (WebKit::WebPageProxy::didReceiveSyncMessage):
1500         * WebProcess/WebPage/ChunkedUpdateDrawingArea.cpp:
1501         (WebKit::ChunkedUpdateDrawingArea::display):
1502         (WebKit::ChunkedUpdateDrawingArea::setSize):
1503         (WebKit::ChunkedUpdateDrawingArea::didReceiveMessage):
1504         * WebProcess/WebPage/LayerBackedDrawingArea.cpp:
1505         (WebKit::LayerBackedDrawingArea::setSize):
1506         (WebKit::LayerBackedDrawingArea::didReceiveMessage):
1507         * WebProcess/WebPage/TiledDrawingArea.cpp:
1508         (WebKit::TiledDrawingArea::display):
1509         (WebKit::TiledDrawingArea::setSize):
1510         (WebKit::TiledDrawingArea::updateTile):
1511         (WebKit::TiledDrawingArea::tileUpdateTimerFired):
1512         (WebKit::TiledDrawingArea::didReceiveMessage):
1513         * WebProcess/WebPage/WebPage.cpp:
1514         (WebKit::WebPage::didReceiveMessage):
1515         * WebProcess/WebPage/mac/LayerBackedDrawingAreaMac.mm:
1516         (WebKit::LayerBackedDrawingArea::attachCompositingContext):
1517
1518 2010-12-26  Anders Carlsson  <andersca@apple.com>
1519
1520         Reviewed by Sam Weinig.
1521
1522         Drawing area cleanup. Remove a bunch of redundant functions that just ended
1523         up calling setNeedsDisplay.
1524
1525         * UIProcess/DrawingAreaProxy.h:
1526         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1527         (WebKit::WebChromeClient::invalidateWindow):
1528         (WebKit::WebChromeClient::invalidateContentsAndWindow):
1529         (WebKit::WebChromeClient::invalidateContentsForSlowScroll):
1530         * WebProcess/WebPage/ChunkedUpdateDrawingArea.cpp:
1531         * WebProcess/WebPage/ChunkedUpdateDrawingArea.h:
1532         * WebProcess/WebPage/DrawingArea.h:
1533         * WebProcess/WebPage/LayerBackedDrawingArea.cpp:
1534         * WebProcess/WebPage/LayerBackedDrawingArea.h:
1535         * WebProcess/WebPage/TiledDrawingArea.cpp:
1536         * WebProcess/WebPage/TiledDrawingArea.h:
1537
1538 2010-12-25  Sam Weinig  <sam@webkit.org>
1539
1540         Reviewed by Dan Bernstein.
1541
1542         Fill in some more preferences for WebKit2
1543         https://bugs.webkit.org/show_bug.cgi?id=51610
1544
1545         * Shared/WebPreferencesStore.h:
1546         * UIProcess/API/C/WKPreferences.cpp:
1547         (WKPreferencesSetAuthorAndUserStylesEnabled):
1548         (WKPreferencesGetAuthorAndUserStylesEnabled):
1549         (WKPreferencesSetWebArchiveDebugModeEnabled):
1550         (WKPreferencesGetWebArchiveDebugModeEnabled):
1551         (WKPreferencesSetLocalFileContentSniffingEnabled):
1552         (WKPreferencesGetLocalFileContentSniffingEnabled):
1553         (WKPreferencesSetPageCacheEnabled):
1554         (WKPreferencesGetPageCacheEnabled):
1555         (WKPreferencesSetPaginateDuringLayoutEnabled):
1556         (WKPreferencesGetPaginateDuringLayoutEnabled):
1557         (WKPreferencesSetDOMPasteAllowedEnabled):
1558         (WKPreferencesGetDOMPasteAllowedEnabled):
1559         * UIProcess/API/C/WKPreferences.h:
1560         * UIProcess/API/C/WKPreferencesPrivate.h:
1561         * WebProcess/WebPage/WebPage.cpp:
1562         (WebKit::WebPage::updatePreferences):
1563         Pipe through some more preferences.
1564
1565 2010-12-24  Dan Bernstein  <mitz@apple.com>
1566
1567         Reviewed by Alexey Proskuryakov.
1568
1569         REGRESSION (r74648): XHR layout test failures
1570         https://bugs.webkit.org/show_bug.cgi?id=51603
1571
1572         Reverted r74648.
1573
1574         * UIProcess/WebPageProxy.cpp:
1575         (WebKit::WebPageProxy::didReceiveAuthenticationChallenge):
1576         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1577         (WebKit::WebFrameLoaderClient::shouldUseCredentialStorage):
1578         * WebProcess/mac/WebProcessMainMac.mm:
1579         (WebKit::WebProcessMain):
1580
1581 2010-12-24  Simon Fraser  <simon.fraser@apple.com>
1582
1583         Fix the Qt build after r74650.
1584
1585         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
1586
1587 2010-12-24  Benjamin Poulain  <ikipou@gmail.com>
1588
1589         Reviewed by Darin Adler.
1590
1591         [Qt] [WK2] WebKit 2 does not build on mac, missing reference to RetainPtr
1592         https://bugs.webkit.org/show_bug.cgi?id=51598
1593
1594         Fix the build, add the missing header.
1595
1596         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
1597
1598 2010-12-24  Dan Bernstein  <mitz@apple.com>
1599
1600         Reviewed by Anders Carlsson.
1601
1602         <rdar://problem/8758386> The web process uses its own credential storage
1603         https://bugs.webkit.org/show_bug.cgi?id=51599
1604
1605         * UIProcess/WebPageProxy.cpp:
1606         (WebKit::WebPageProxy::didReceiveAuthenticationChallenge): Try to answer the challenge using
1607         the UI process’s credential storage first.
1608         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1609         (WebKit::WebFrameLoaderClient::shouldUseCredentialStorage): Prevent the web process from using
1610         its own credential storage.
1611         * WebProcess/mac/WebProcessMainMac.mm:
1612         (WebKit::WebProcessMain): Ditto.
1613
1614 2010-12-23  Dan Bernstein  <mitz@apple.com>
1615
1616         Reviewed by Sam Weinig.
1617
1618         Make dragging work again after r74591.
1619
1620         * UIProcess/WebPageProxy.cpp:
1621         (WebKit::WebPageProxy::didReceiveEvent): Fixed a typo.
1622
1623 2010-12-23  Jessie Berlin  <jberlin@apple.com>
1624
1625         Reviewed by Sam Weinig.
1626
1627         Need WebKit2 API to create a SecurityOrigin from protocol, host, and port
1628         https://bugs.webkit.org/show_bug.cgi?id=51563
1629
1630         Add WKSecurityOriginCreate(WKStringRef protocol, WKStringRef host, int port).
1631
1632         * Shared/API/c/WKSecurityOrigin.cpp:
1633         (WKSecurityOriginCreateFromIdentifier):
1634         Renamed so as not to clash with the new WKSecurityOriginCreate.
1635         (WKSecurityOriginCreate):
1636         * Shared/API/c/WKSecurityOrigin.h:
1637         * Shared/WebSecurityOrigin.h:
1638         (WebKit::WebSecurityOrigin::create):
1639
1640 2010-12-23  Anders Carlsson  <andersca@apple.com>
1641
1642         Reviewed by Simon Fraser.
1643
1644         Ensure that we are not getting too many mouse move events
1645         https://bugs.webkit.org/show_bug.cgi?id=51568
1646         <rdar://problem/7881470>
1647         <rdar://problem/8735512>
1648
1649         Implement throttling of mouse move events.
1650
1651         * UIProcess/WebPageProxy.cpp:
1652         (WebKit::WebPageProxy::WebPageProxy):
1653         Initialize m_processingMouseMoveEvent to false.
1654
1655         (WebKit::WebPageProxy::handleMouseEvent):
1656         If we're already processing a mouse move events, just update 
1657         m_nextMouseMoveEvent and return.
1658  
1659         (WebKit::WebPageProxy::didReceiveEvent):
1660         If we received a mouse move event, send the next mouse move event if there is one.
1661
1662 2010-12-23  Brian Weinstein  <bweinstein@apple.com>
1663
1664         Reviewed by Anders Carlsson.
1665
1666         Assertion when loading www.yahoo.com in WebKit2 under decodeResourceRequest
1667         https://bugs.webkit.org/show_bug.cgi?id=51562
1668         
1669         Don't assert that our data reference isn't empty when we try to get the data from it.
1670         If it is empty, just return 0.
1671         
1672         All callers are safe with this function returning 0.
1673
1674         * Platform/CoreIPC/DataReference.h:
1675         (CoreIPC::DataReference::data): Change the assert to an early return.
1676         * Shared/cf/ArgumentCodersCF.cpp:
1677         (CoreIPC::decode): Add an assert, and remove a ternarny operator because the function now does
1678             this for us (if the data is empty, return 0).
1679
1680 2010-12-23  Sam Weinig  <sam@webkit.org>
1681
1682         Fix incorrect assertion causing all pages with subframes to crash.
1683
1684         * UIProcess/WebFrameProxy.cpp:
1685         (WebKit::WebFrameProxy::appendChild):
1686
1687 2010-12-23  Anders Carlsson  <andersca@apple.com>
1688
1689         Reviewed by Darin Adler.
1690
1691         Clean up the selection handling code
1692         https://bugs.webkit.org/show_bug.cgi?id=51550
1693
1694         * Shared/SelectionState.h: Added.
1695         Add SelectionState class which hold information about the current selection.
1696
1697         * UIProcess/API/mac/PageClientImpl.h:
1698         * UIProcess/API/mac/PageClientImpl.mm:
1699         Remove selectionChanged function.
1700
1701         * UIProcess/API/mac/WKView.mm:
1702         (-[WKView initWithFrame:contextRef:pageGroupRef:]):
1703         Remove all the selection related state; it lives in the WebPageProxy object now.
1704         
1705         (-[WKView insertText:]):
1706         (-[WKView selectedRange]):
1707         (-[WKView hasMarkedText]):
1708         Get the selection information from the WebPageProxy.
1709
1710         * UIProcess/API/mac/WKViewInternal.h:
1711         Remove _selectionChanged declaration.
1712
1713         * UIProcess/PageClient.h:
1714         Remove selectionChanged functions.
1715
1716         * UIProcess/WebPageProxy.cpp:
1717         (WebKit::WebPageProxy::selectionStateChanged):
1718         Update the selection state.
1719
1720         * UIProcess/WebPageProxy.h:
1721         (WebKit::WebPageProxy::selectionState):
1722         Return the selection state.
1723
1724         * UIProcess/WebPageProxy.messages.in:
1725         Add SelectionStateChanged message.
1726
1727         * UIProcess/win/WebView.cpp:
1728         (WebKit::WebView::WebView):
1729         Remove all the selection related state; it lives in the WebPageProxy object now.
1730
1731         (WebKit::WebView::compositionSelectionChanged):
1732         (WebKit::WebView::onIMEComposition):
1733         (WebKit::WebView::onIMEEndComposition):
1734         (WebKit::WebView::onIMERequestCharPosition):
1735         (WebKit::WebView::onIMERequest):
1736         Get the selection information from the WebPageProxy.
1737         
1738         * WebKit2.xcodeproj/project.pbxproj:
1739         Add SelectionState.h
1740
1741         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
1742         (WebKit::WebEditorClient::respondToChangedSelection):
1743         Send a SelectionStateChanged message with the updated state.
1744
1745         * WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
1746         Remove mac specific code.
1747
1748         * WebProcess/WebPage/WebPage.cpp:
1749         (WebKit::WebPage::getLocationAndLengthFromRange):
1750         Rename this function from convertRangeToPlatformRange and move it out of WebPageMac.mm
1751
1752         * WebProcess/WebPage/mac/WebPageMac.mm:
1753         (WebKit::WebPage::getMarkedRange):
1754         (WebKit::WebPage::characterIndexForPoint):
1755         Call getLocationAndLengthFromRange.
1756
1757         * win/WebKit2.vcproj:
1758         Add SelectionState.h
1759
1760 2010-12-23  Darin Adler  <darin@apple.com>
1761
1762         Reviewed by Sam Weinig.
1763
1764         WKView should not try to do asynchronous validation for selectors that are not editor commands
1765         https://bugs.webkit.org/show_bug.cgi?id=51555
1766
1767         * UIProcess/API/mac/WKView.mm:
1768         (-[WKView validateUserInterfaceItem:]): Removed the special case for startSpeaking.
1769         Added call to commandIsSupportedFromMenuOrKeyBinding so we only try to do validation
1770         for commands that are supported. Tweaked comments and added some bug numbers.
1771         (-[WKView _setUserInterfaceItemState:enabled:state:]): Tweaked comment and added
1772         bug number.
1773
1774 2010-12-23  Sam Weinig  <sam@webkit.org>
1775
1776         Reviewed by Anders Carlsson.
1777
1778         <rdar://problem/8799032>
1779         REGRESSION(r74436) Crash opening many pages with WebKit2
1780
1781         * Shared/cf/ArgumentCodersCF.cpp:
1782         (CoreIPC::decode):
1783         Fix paste-o. Decode into a CFDataRef not a CFDictionaryRef
1784         when decoding CFDataRefs.
1785
1786 2010-12-22  Sam Weinig  <sam@webkit.org>
1787
1788         Reviewed by Darin Adler.
1789
1790         WebKit2 needs to mirror the frame tree in the UIProcess
1791         https://bugs.webkit.org/show_bug.cgi?id=51546
1792
1793         * UIProcess/API/C/WKFrame.cpp:
1794         (WKFrameCopyChildFrames):
1795         * UIProcess/API/C/WKFrame.h:
1796         Add API to get the child frames of a frame.
1797
1798         * UIProcess/WebFrameProxy.cpp:
1799         (WebKit::WebFrameProxy::WebFrameProxy):
1800         (WebKit::WebFrameProxy::disconnect):
1801         (WebKit::WebFrameProxy::appendChild):
1802         (WebKit::WebFrameProxy::removeChild):
1803         (WebKit::WebFrameProxy::isDescendantOf):
1804         (WebKit::WebFrameProxy::dumpFrameTree):
1805         (WebKit::WebFrameProxy::didRemoveFromHierarchy):
1806         (WebKit::WebFrameProxy::childFrames):
1807         * UIProcess/WebFrameProxy.h:
1808         (WebKit::WebFrameProxy::parentFrame): Add getter.
1809         (WebKit::WebFrameProxy::nextSibling): Add getter.
1810         (WebKit::WebFrameProxy::previousSibling): Add getter.
1811         (WebKit::WebFrameProxy::firstChild): Add getter.
1812         (WebKit::WebFrameProxy::lastChild): Add getter.
1813         Make frames keep track of their subframes.
1814
1815         * UIProcess/WebPageProxy.cpp:
1816         (WebKit::WebPageProxy::didCreateSubframe):
1817         Use the now passed parentID to insert the frame into the hierarchy
1818
1819         (WebKit::WebPageProxy::didSaveFrameToPageCache):
1820         When a frame is added to the page cache, remove it from the hierarchy.
1821
1822         (WebKit::WebPageProxy::didRestoreFrameFromPageCache):
1823         When a frame is restored from the page cache, add it back to the hierarchy.
1824
1825         (WebKit::WebPageProxy::didRemoveFrameFromHierarchy):
1826         Detached frames should also be removed from the hierarchy.
1827
1828         * UIProcess/WebPageProxy.h:
1829         Add new declarations for didSaveFrameToPageCache and didRestoreFrameFromPageCache.
1830
1831         * UIProcess/WebPageProxy.messages.in:
1832         Add messages for DidSaveFrameToPageCache and DidRestoreFrameFromPageCache.
1833
1834         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1835         (WebKit::WebFrameLoaderClient::savePlatformDataToCachedFrame): 
1836         (WebKit::WebFrameLoaderClient::transitionToCommittedFromCachedFrame):
1837         Remove notImplemented, there is no work we need to do here.
1838
1839         (WebKit::WebFrameLoaderClient::didSaveToPageCache): 
1840         (WebKit::WebFrameLoaderClient::didRestoreFromPageCache):
1841         Send message to UIProcess to indicate this happened.
1842         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
1843
1844         * WebProcess/WebPage/WebFrame.cpp:
1845         (WebKit::WebFrame::createSubframe):
1846         Send parent frameID in addition to our own in the message to UIProcess.
1847
1848 2010-12-23  Anders Carlsson  <andersca@apple.com>
1849
1850         Reviewed by Sam Weinig.
1851
1852         New popup windows open disproportionately big
1853         https://bugs.webkit.org/show_bug.cgi?id=51547
1854         <rdar://problem/8637029>
1855
1856         * UIProcess/WebPageProxy.cpp:
1857         (WebKit::WebPageProxy::createNewPage):
1858         Pass the correct size back to the UI process.
1859
1860         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1861         (WebKit::WebChromeClient::pageRect):
1862         Implement this and return the size of the page.
1863
1864 2010-12-23  Anders Carlsson  <andersca@apple.com>
1865
1866         Reviewed by John Sullivan.
1867
1868         Nothing happens clicking "launch live player" on live.cnn.com
1869         https://bugs.webkit.org/show_bug.cgi?id=51540
1870         <rdar://problem/8791086>
1871
1872         Implement NPN_PushPopupsEnabledState/NPN_PopPopupsEnabledState.
1873
1874         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
1875         (WebKit::NPN_PushPopupsEnabledState):
1876         Call NetscapePlugin::pushPopupsEnabledState.
1877
1878         (WebKit::NPN_PopPopupsEnabledState):
1879         Call NetscapePlugin::popPopupsEnabledState.
1880
1881         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
1882         (WebKit::NetscapePlugin::pushPopupsEnabledState):
1883         Append the boolean to the vector.
1884
1885         (WebKit::NetscapePlugin::popPopupsEnabledState):
1886         Remove the last boolean from the vector.
1887
1888         (WebKit::NetscapePlugin::allowPopups):
1889         Return the last boolean from the vector.
1890
1891         * WebProcess/Plugins/Netscape/NetscapePlugin.h:
1892         * WebProcess/Plugins/PluginView.cpp:
1893         (WebKit::PluginView::performJavaScriptURLRequest):
1894         Update the "allowPopupsFromPlugin" state.
1895
1896 2010-12-22  Anders Carlsson  <andersca@apple.com>
1897
1898         Reviewed by Sam Weinig.
1899
1900         Webkit2: WebProcess crashes when Private browsing is turned on on yahoo.com
1901         https://bugs.webkit.org/show_bug.cgi?id=51516
1902         <rdar://problem/8766995>
1903
1904         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
1905         (WebKit::NetscapePlugin::NPP_SetValue):
1906         Add a null check for NPP_SetValue.
1907
1908 2010-12-22  Anders Carlsson  <andersca@apple.com>
1909
1910         Reviewed by Sam Weinig.
1911
1912         REGRESSION (WK2): Plugins swallow CMD-W, CMD-Q, and probably other shortcuts
1913         https://bugs.webkit.org/show_bug.cgi?id=51515
1914         <rdar://problem/8740926>
1915
1916         Always return false for keyboard events where the command key is down.
1917
1918         * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
1919         (WebKit::NetscapePlugin::platformHandleKeyboardEvent):
1920
1921 2010-12-22  Sam Weinig  <sam@webkit.org>
1922
1923         Reviewed by Darin Adler.
1924
1925         WebProcess should be terminated if invalid frameIDs are
1926         passed to the UIProcess.
1927         https://bugs.webkit.org/show_bug.cgi?id=51508
1928
1929         - Introduce a mechanism to mark a messages as invalid due to
1930           reasons other than in ability to decode the message, eg. an
1931           invalid frameID is passed in a message.
1932
1933         * Platform/CoreIPC/Connection.cpp:
1934         (CoreIPC::Connection::Connection):
1935         (CoreIPC::Connection::markCurrentlyDispatchedMessageAsInvalid): Sets
1936         the m_didReceiveInvalidMessage bit so that it can be picked up in 
1937         (CoreIPC::Connection::dispatchMessages): Check for m_didReceiveInvalidMessage in
1938         addition to tainted arguments.
1939         * Platform/CoreIPC/Connection.h:
1940         Add base macro for others to extend, that calls markCurrentlyDispatchedMessageAsInvalid()
1941         ASSERTs, and returns.
1942
1943         * UIProcess/WebPageProxy.cpp:
1944         Add Message checks for all WebFrameProxy's gotten from frameIDs passed
1945         over the wire.
1946         * UIProcess/WebProcessProxy.cpp:
1947         (WebKit::isGoodMapKey):
1948         Checks that the key can be inserted safely into a map (eg. not the empty or deleted value).
1949
1950         (WebKit::WebProcessProxy::webFrame):
1951         Return null for bad keys (eg. 0 or -1).
1952
1953         (WebKit::WebProcessProxy::canCreateFrame):
1954         Added. Checks that the ID is good and not in the map yet. Used
1955         as a consistency check before creating frames.
1956
1957         (WebKit::WebProcessProxy::frameCreated): 
1958         ASSERT that the key is good, in addition to not in the map yet.
1959
1960         (WebKit::WebProcessProxy::didDestroyFrame):
1961         ASSERT that the key is good.
1962
1963         * UIProcess/WebProcessProxy.h:
1964         Move WebFrameProxy HashMap type into a typedef.
1965
1966 2010-12-22  Darin Adler  <darin@apple.com>
1967
1968         Reviewed by Anders Carlsson.
1969
1970         WebKit2 needs a way to return the main resource data
1971         https://bugs.webkit.org/show_bug.cgi?id=51510
1972
1973         * UIProcess/API/C/WKFrame.cpp:
1974         (WKFrameGetMainResourceData): Added.
1975         (callGetMainResourceDataBlockAndDispose): Added.
1976         (WKFrameGetMainResourceData_b): Added.
1977         * UIProcess/API/C/WKFrame.h: Added WKFrameGetMainResourceData.
1978
1979         * UIProcess/WebFrameProxy.cpp:
1980         (WebKit::WebFrameProxy::getMainResourceData): Added.
1981         * UIProcess/WebFrameProxy.h: Ditto.
1982
1983         * UIProcess/WebPageProxy.cpp:
1984         (WebKit::WebPageProxy::getMainResourceDataOfFrame): Added.
1985         (WebKit::WebPageProxy::dataCallback): Replaced the individual callbacks
1986         with just these two.
1987         (WebKit::WebPageProxy::stringCallback): Ditto.
1988         * UIProcess/WebPageProxy.h: Ditto.
1989         * UIProcess/WebPageProxy.messages.in: Ditto.
1990
1991         * WebProcess/WebPage/WebPage.cpp:
1992         (WebKit::WebPage::runJavaScriptInMainFrame): Send the string callback
1993         message instead of a specific one.
1994         (WebKit::WebPage::getContentsAsString): Ditto.
1995         (WebKit::WebPage::getRenderTreeExternalRepresentation): Ditto.
1996         (WebKit::WebPage::getSelectionOrContentsAsString): Ditto.
1997         (WebKit::WebPage::getSourceForFrame): Ditto.
1998         (WebKit::WebPage::getMainResourceDataOfFrame): Added.
1999         (WebKit::WebPage::getWebArchiveOfFrame): Send the data callback message
2000         instead of a specific one.
2001         * WebProcess/WebPage/WebPage.h: Added getMainResourceDataOfFrame.
2002         * WebProcess/WebPage/WebPage.messages.in: Ditto.
2003
2004 2010-12-22  Darin Adler  <darin@apple.com>
2005
2006         * WebProcess/WebPage/WebPage.cpp: Add #if to try to fix non-Mac builds.
2007
2008 2010-12-22  Darin Adler  <darin@apple.com>
2009
2010         Reviewed by Anders Carlsson.
2011
2012         Make Speech menu items work in WebKit2
2013         https://bugs.webkit.org/show_bug.cgi?id=51504
2014
2015         * UIProcess/API/C/WKFrame.cpp:
2016         (WKFrameGetWebArchive): Updated to use new-named typedef.
2017         * UIProcess/API/C/WKPage.cpp:
2018         (WKPageRunJavaScriptInMainFrame): Ditto.
2019         (WKPageRenderTreeExternalRepresentation): Ditto.
2020         (WKPageGetSourceForFrame): Ditto.
2021         (WKPageGetContentsAsString): Ditto.
2022
2023         * UIProcess/API/mac/WKView.mm:
2024         (menuItem): Added. Helper function to make it easy to call menu item
2025         functions on arbitrary user interface items.
2026         (toolbarItem): Ditto.
2027         (-[WKView validateUserInterfaceItem:]): Added validation for startSpeaking
2028         and stopSpeaking commands. Reworked the code to fix a bug where
2029         toggleContinuousSpellChecking would always be enabled even when it should
2030         be disabled. Reworked the asynchronous validation code so it works for
2031         items other than menu items and can also handle more than one item for the
2032         same command. Added some comments.
2033         (speakString): Added. Helper function to be used as a callback when we
2034         get the selection or contents to speak.
2035         (-[WKView startSpeaking:]): Added. Uses getSelectionOrContentsAsString.
2036         (-[WKView stopSpeaking:]): Added.
2037         (-[WKView _setUserInterfaceItemState:enabled:state:]): Reworked to work
2038         with the changes to validateUserInterfaceItem above.
2039
2040         * UIProcess/WebFrameProxy.cpp:
2041         (WebKit::WebFrameProxy::isDisplayingMarkupDocument): Added a FIXME about
2042         a problem I noticed.
2043         (WebKit::WebFrameProxy::didCommitLoad): Tweaked argument name.
2044         (WebKit::WebFrameProxy::getWebArchive): Changed to use new-named typedef.
2045         * UIProcess/WebFrameProxy.h: Changed WebArchiveCallback to DataCallaback.
2046
2047         * UIProcess/WebPageProxy.cpp:
2048         (WebKit::WebPageProxy::close): Invalidate the two callback maps since
2049         we only have two now.
2050         (WebKit::WebPageProxy::runJavaScriptInMainFrame): Changed to use merged
2051         maps and typedefs so we don't need a separate callback map for each function.
2052         (WebKit::WebPageProxy::getRenderTreeExternalRepresentation): Ditto.
2053         (WebKit::WebPageProxy::getSourceForFrame): Ditto.
2054         (WebKit::WebPageProxy::getContentsAsString): Ditto.
2055         (WebKit::WebPageProxy::getSelectionOrContentsAsString): Added.
2056         (WebKit::WebPageProxy::getWebArchiveOfFrame): Ditto.
2057         (WebKit::WebPageProxy::didGetContentsAsString): Ditto.
2058         (WebKit::WebPageProxy::didGetSelectionOrContentsAsString): Ditto.
2059         (WebKit::WebPageProxy::didRunJavaScriptInMainFrame): Ditto.
2060         (WebKit::WebPageProxy::didGetRenderTreeExternalRepresentation): Ditto.
2061         (WebKit::WebPageProxy::didGetSourceForFrame): Ditto.
2062         (WebKit::WebPageProxy::didGetWebArchiveOfFrame): Ditto.
2063         (WebKit::WebPageProxy::processDidCrash): Ditto.
2064
2065         * UIProcess/WebPageProxy.h: Updated for changes above.
2066
2067         * UIProcess/WebPageProxy.messages.in: Added DidGetSelectionOrContentsAsString,
2068         GetIsSpeaking, Speak, and StopSpeaking.
2069
2070         * UIProcess/mac/WebPageProxyMac.mm:
2071         (WebKit::WebPageProxy::getIsSpeaking): Added.
2072         (WebKit::WebPageProxy::speak): Added.
2073         (WebKit::WebPageProxy::stopSpeaking): Added.
2074
2075         * WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm:
2076         (WebKit::WebContextMenuClient::isSpeaking): Call WebPage instead of doing
2077         the work directly, so it can run in the UI process.
2078         (WebKit::WebContextMenuClient::speak): Ditto.
2079         (WebKit::WebContextMenuClient::stopSpeaking): Ditto.
2080         (WebKit::WebContextMenuClient::searchWithSpotlight): Added FIXME comment and
2081         changed code to avoid a C-style cast.
2082
2083         * WebProcess/WebPage/WebFrame.cpp:
2084         (WebKit::WebFrame::selectionAsString): Added.
2085         * WebProcess/WebPage/WebFrame.h: Ditto.
2086
2087         * WebProcess/WebPage/WebPage.cpp:
2088         (WebKit::WebPage::changeAcceleratedCompositingMode): Use sendSync in the
2089         modern way instead of explicitly calling WebProcess.
2090         (WebKit::WebPage::getSelectionOrContentsAsString): Added.
2091         (WebKit::WebPage::isSpeaking): Added.
2092         (WebKit::WebPage::speak): Added.
2093         (WebKit::WebPage::stopSpeaking): Added.
2094         * WebProcess/WebPage/WebPage.h: Added functions.
2095
2096         * WebProcess/WebPage/WebPage.messages.in: Added GetSelectionOrContentsAsString.
2097
2098 2010-12-22  Anders Carlsson  <andersca@apple.com>
2099
2100         Fix build.
2101
2102         * Platform/mac/MachUtilities.cpp:
2103
2104 2010-12-22  Anders Carlsson  <andersca@apple.com>
2105
2106         Reviewed by Darin Adler.
2107
2108         Detect WebProcess crashes sooner, without waiting for ReportCrash to finish
2109         https://bugs.webkit.org/show_bug.cgi?id=51505
2110
2111         * Platform/CoreIPC/CoreIPCMessageKinds.h:
2112         Add SetExceptionPort.
2113
2114         * Platform/CoreIPC/mac/ConnectionMac.cpp:
2115         (CoreIPC::Connection::platformInvalidate):
2116         If we have an exception port, unregister it.
2117
2118         (CoreIPC::Connection::platformInitialize):
2119         Set m_exceptionPort to null.
2120
2121         (CoreIPC::Connection::open):
2122         If we have an exception port, register an event handler for it and send it over
2123         to the other side.
2124
2125         (CoreIPC::Connection::receiveSourceEventHandler):
2126         Handle the SetExceptionPort message.
2127
2128         (CoreIPC::Connection::exceptionSourceEventHandler):
2129         Receive the message, forward it to the real exception handler and call connectionDidClose.
2130
2131         (CoreIPC::Connection::setShouldCloseConnectionOnMachExceptions):
2132         Create an exception port.
2133
2134         * Platform/mac/MachUtilities.cpp:
2135         (machExceptionPort):
2136         (setMachExceptionPort):
2137         * Platform/mac/MachUtilities.h:
2138         Add helper functions for getting and setting the mach exception port.
2139
2140         * UIProcess/WebProcessProxy.cpp:
2141         (WebKit::WebProcessProxy::didFinishLaunching):
2142         Call setShouldCloseConnectionOnMachExceptions on Mac.
2143
2144 2010-12-22  Anders Carlsson  <andersca@apple.com>
2145
2146         Reviewed by Sam Weinig.
2147
2148         Move Mach message receiving code out into a new function
2149         https://bugs.webkit.org/show_bug.cgi?id=51502
2150
2151         * Platform/CoreIPC/mac/ConnectionMac.cpp:
2152         (CoreIPC::readFromMachPort):
2153         (CoreIPC::Connection::receiveSourceEventHandler):
2154
2155 2010-12-22  Jeff Miller  <jeffm@apple.com>
2156
2157         Reviewed by Sam Weinig.
2158
2159         InjectedBundle methods should  use the relative URL constructor for KURL instead of the ParsedURLStringTag version
2160         https://bugs.webkit.org/show_bug.cgi?id=51491
2161         
2162         The url passed to various InjectedBundle methods is not from KURL::string(), i.e. it has not already been parsed by KURL,
2163         so we have to use the relative URL constructor for KURL instead of the ParsedURLStringTag version.
2164
2165         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2166         (WebKit::InjectedBundle::addUserScript):
2167         (WebKit::InjectedBundle::addUserStyleSheet):
2168         (WebKit::InjectedBundle::removeUserScript):
2169         (WebKit::InjectedBundle::removeUserStyleSheet):
2170
2171 2010-12-22  Darin Adler  <darin@apple.com>
2172
2173         Reviewed by Sam Weinig.
2174
2175         Move more of WebPageProxy::didCommitLoadForFrame into WebFrameProxy::didCommitLoad.
2176
2177         * UIProcess/WebFrameProxy.cpp:
2178         (WebKit::WebFrameProxy::didCommitLoad): Added type and certificate info arguments,
2179         and set m_MIMEType, m_isFrameSet, and m_certificateInfo.
2180         * UIProcess/WebFrameProxy.h: Removed setMIMEType and setCertificateInfo and added
2181         arguments to didCommitLoad.
2182         * UIProcess/WebPageProxy.cpp:
2183         (WebKit::WebPageProxy::didCommitLoadForFrame): Removed code that is now inside the
2184         WebFrameProxy::didCommitLoad function.
2185
2186 2010-12-21  Darin Adler  <darin@apple.com>
2187
2188         Reviewed by Brady Eidson and Sam Weinig.
2189
2190         Add a way to get a web archive in WebKit2
2191         https://bugs.webkit.org/show_bug.cgi?id=51437
2192
2193         * UIProcess/API/C/WKFrame.cpp:
2194         (WKFrameGetWebArchive): Added.
2195         (callGetWebArchiveBlockAndDispose): Added.
2196         (WKFrameGetWebArchive_b): Added.
2197         * UIProcess/API/C/WKFrame.h: Added functions above.
2198         * UIProcess/WebPageProxy.cpp:
2199         (WebKit::WebPageProxy::close): Clear out m_webArchiveCallbacks.
2200         (WebKit::WebPageProxy::getWebArchiveOfFrame): Added.
2201         (WebKit::WebPageProxy::didGetWebArchiveOfFrame): Added.
2202         (WebKit::WebPageProxy::processDidCrash): Clear out m_webArchiveCallbacks.
2203         * UIProcess/WebPageProxy.h: Added functions above.
2204         * UIProcess/WebPageProxy.messages.in: Added DidGetWebArchiveOfFrame.
2205         * WebProcess/WebPage/WebPage.cpp:
2206         (WebKit::WebPage::getWebArchiveOfFrame): Added.
2207         * WebProcess/WebPage/WebPage.h: Added function above.
2208         * WebProcess/WebPage/WebPage.messages.in: Added GetWebArchiveOfFrame.
2209
2210 2010-12-21  Siddharth Mathur  <siddharth.mathur@nokia.com>
2211
2212         Reviewed by Laszlo Gombos.
2213
2214         [Qt] [WK2] Guard gcc-specific syntax
2215
2216         * WebKit2.pro: Non-gcc based compliers choke on the "-include" 
2217         syntax for preinclude, make sure it has guard around it.
2218
2219 2010-12-21  Anders Carlsson  <andersca@apple.com>
2220
2221         Reviewed by Darin Adler.
2222
2223         Can't stop QT music on santastreefarm.com
2224         https://bugs.webkit.org/show_bug.cgi?id=51438
2225         <rdar://problem/8741152>
2226
2227         Implement NPN_ConvertPoint.
2228
2229         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
2230         (WebKit::NPN_ConvertPoint):
2231         Call NetscapePlugin::convertPoint.
2232
2233         (WebKit::initializeBrowserFuncs):
2234         Only initialize NPN_ConvertPoint and NPN_PopUpContextMenu on Mac.
2235
2236         * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
2237         (WebKit::NetscapePlugin::convertPoint):
2238         Implement conversion routines.
2239
2240         (WebKit::NetscapePlugin::windowAndViewFramesChanged):
2241         Keep track of the window and view frames, they are needed to do coordinate conversion.
2242
2243 2010-12-21  Sam Weinig  <weinig@apple.com>
2244
2245         Reviewed by Anders Carlsson.
2246
2247         Implement encoding/decoding of ResourceRequest and 
2248         ResourceResponse for Windows/CFNetwork.
2249
2250         * Shared/win/WebCoreArgumentCodersWin.cpp:
2251         (CoreIPC::encodeResourceRequest):
2252         (CoreIPC::decodeResourceRequest):
2253         (CoreIPC::encodeResourceResponse):
2254         (CoreIPC::decodeResourceResponse):
2255         * win/WebKit2.vcproj:
2256         * win/WebKit2Common.vsprops:
2257
2258 2010-12-21  Darin Adler  <darin@apple.com>
2259
2260         Reviewed by Sam Weinig.
2261
2262         Mac WebKit delivers an extra didCommit when loading web archives
2263         https://bugs.webkit.org/show_bug.cgi?id=51419
2264
2265         * UIProcess/WebFrameProxy.cpp:
2266         (WebKit::WebFrameProxy::didStartProvisionalLoad): Added assertions so we catch
2267         inconsistencies here instead of at the application level. Later, we will have
2268         to decide what to do in cases these assertions fail. The right policy is probably
2269         to consider it a web process failure and do whatever we do for those.
2270         (WebKit::WebFrameProxy::didReceiveServerRedirectForProvisionalLoad): Ditto.
2271         (WebKit::WebFrameProxy::didFailProvisionalLoad): Ditto.
2272         (WebKit::WebFrameProxy::didCommitLoad): Ditto.
2273         (WebKit::WebFrameProxy::didFinishLoad): Ditto.
2274         (WebKit::WebFrameProxy::didFailLoad): Ditto.
2275
2276 2010-12-21  Anders Carlsson  <andersca@apple.com>
2277
2278         Fix Snow Leopard build.
2279
2280         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
2281         (WebKit::NPN_GetValue):
2282
2283 2010-12-21  Anders Carlsson  <andersca@apple.com>
2284
2285         Reviewed by Dan Bernstein.
2286
2287         Fix crash when a Carbon plug-in fails to initialize correctly
2288         https://bugs.webkit.org/show_bug.cgi?id=51415
2289
2290         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
2291         (WebKit::NPN_GetValue):
2292         Don't claim to support the QuickDraw event model.
2293
2294         * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
2295         (WebKit::NetscapePlugin::platformDestroy):
2296         Only try to remove the window from the map if it's not null.
2297
2298 2010-12-21  Anders Carlsson  <andersca@apple.com>
2299
2300         Reviewed by Darin Adler.
2301
2302         Add ArgumentCoder support for CFDataRef
2303         https://bugs.webkit.org/show_bug.cgi?id=51412
2304
2305         * Shared/cf/ArgumentCodersCF.cpp:
2306         (CoreIPC::typeFromCFTypeRef):
2307         (CoreIPC::encode):
2308         (CoreIPC::decode):
2309         * Shared/cf/ArgumentCodersCF.h:
2310
2311 2010-12-21  Anders Carlsson  <andersca@apple.com>
2312
2313         Reviewed by John Sullivan.
2314
2315         Clicking missing plug-in text does not show a sheet
2316         https://bugs.webkit.org/show_bug.cgi?id=51403
2317
2318         * UIProcess/API/C/WKPage.h:
2319         Add missingPluginButtonClicked to WKPageUIClient.
2320
2321         * UIProcess/WebPageProxy.cpp:        
2322         (WebKit::WebPageProxy::missingPluginButtonClicked):
2323         Call the WebUIClient member function.
2324
2325         * UIProcess/WebPageProxy.messages.in:
2326         Add MissingPluginButtonClicked message.
2327
2328         * UIProcess/WebUIClient.cpp:
2329         (WebKit::WebUIClient::missingPluginButtonClicked):
2330         Call the WKPageUIClient callback.
2331
2332         * UIProcess/WebUIClient.h:
2333         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2334         (WebKit::WebChromeClient::shouldMissingPluginMessageBeButton):
2335         Always return true for now.
2336
2337         (WebKit::WebChromeClient::missingPluginButtonClicked):
2338         Send a MissingPluginButtonClicked message.
2339
2340 2010-12-21  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
2341
2342         Reviewed by Andreas Kling.
2343
2344         [Qt] Set BUILDING_QT__ consistently
2345         https://bugs.webkit.org/show_bug.cgi?id=51341
2346
2347         * WebKit2.pro: Remove the definition of BUILDING_QT__ as it
2348         is already defined in WebKit.pri.
2349
2350 2010-12-20  Sam Weinig  <sam@webkit.org>
2351
2352         Reviewed by Anders Carlsson.
2353
2354         WebKit2: Add resource load client API
2355         https://bugs.webkit.org/show_bug.cgi?id=51370
2356
2357         This just pipes through the basic resource load client data.
2358
2359         * UIProcess/API/C/WKPage.cpp:
2360         (WKPageSetPageResourceLoadClient):
2361         * UIProcess/API/C/WKPage.h:
2362         * UIProcess/WebPageProxy.cpp:
2363         (WebKit::WebPageProxy::initializeResourceLoadClient):
2364         (WebKit::WebPageProxy::didInitiateLoadForResource):
2365         (WebKit::WebPageProxy::didSendRequestForResource):
2366         (WebKit::WebPageProxy::didReceiveResponseForResource):
2367         (WebKit::WebPageProxy::didReceiveContentLengthForResource):
2368         (WebKit::WebPageProxy::didFinishLoadForResource):
2369         (WebKit::WebPageProxy::didFailLoadForResource):
2370         * UIProcess/WebPageProxy.h:
2371         * UIProcess/WebPageProxy.messages.in:
2372         * UIProcess/WebResourceLoadClient.cpp: Added.
2373         (WebKit::WebResourceLoadClient::didInitiateLoadForResource):
2374         (WebKit::WebResourceLoadClient::didSendRequestForResource):
2375         (WebKit::WebResourceLoadClient::didReceiveResponseForResource):
2376         (WebKit::WebResourceLoadClient::didReceiveContentLengthForResource):
2377         (WebKit::WebResourceLoadClient::didFinishLoadForResource):
2378         (WebKit::WebResourceLoadClient::didFailLoadForResource):
2379         * UIProcess/WebResourceLoadClient.h: Added.
2380         * WebKit2.pro:
2381         * WebKit2.xcodeproj/project.pbxproj:
2382         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2383         (WebKit::WebFrameLoaderClient::assignIdentifierToInitialRequest):
2384         (WebKit::WebFrameLoaderClient::dispatchWillSendRequest):
2385         (WebKit::WebFrameLoaderClient::dispatchDidReceiveResponse):
2386         (WebKit::WebFrameLoaderClient::dispatchDidReceiveContentLength):
2387         (WebKit::WebFrameLoaderClient::dispatchDidFinishLoading):
2388         (WebKit::WebFrameLoaderClient::dispatchDidFailLoading):
2389         * win/WebKit2.vcproj:
2390
2391 2010-12-20  Anders Carlsson  <andersca@apple.com>
2392
2393         Reviewed by Sam Weinig.
2394
2395         Add a TextChecker class, hook up spelling and grammar toggling
2396         https://bugs.webkit.org/show_bug.cgi?id=51363
2397
2398         * UIProcess/API/mac/WKView.mm:
2399         (-[WKView validateUserInterfaceItem:]):
2400         (-[WKView toggleContinuousSpellChecking:]):
2401         (-[WKView toggleGrammarChecking:]):
2402         * UIProcess/TextChecker.h: Added.
2403         * UIProcess/WebPageProxy.cpp:
2404         (WebKit::WebPageProxy::unmarkAllMisspellings):
2405         (WebKit::WebPageProxy::unmarkAllBadGrammar):
2406         * UIProcess/WebPageProxy.h:
2407         * UIProcess/mac/TextCheckerMac.mm: Added.
2408         (WebKit::TextChecker::isContinuousSpellCheckingAllowed):
2409         (WebKit::TextChecker::isContinuousSpellCheckingEnabled):
2410         (WebKit::TextChecker::setContinuousSpellCheckingEnabled):
2411         (WebKit::TextChecker::isGrammarCheckingEnabled):
2412         (WebKit::TextChecker::setGrammarCheckingEnabled):
2413         * UIProcess/qt/TextCheckerQt.cpp: Added.
2414         (WebKit::TextChecker::isContinuousSpellCheckingAllowed):
2415         (WebKit::TextChecker::isContinuousSpellCheckingEnabled):
2416         (WebKit::TextChecker::setContinuousSpellCheckingEnabled):
2417         (WebKit::TextChecker::isGrammarCheckingEnabled):
2418         (WebKit::TextChecker::setGrammarCheckingEnabled):
2419         * UIProcess/win/TextCheckerWin.cpp: Added.
2420         (WebKit::TextChecker::isContinuousSpellCheckingAllowed):
2421         (WebKit::TextChecker::isContinuousSpellCheckingEnabled):
2422         (WebKit::TextChecker::setContinuousSpellCheckingEnabled):
2423         (WebKit::TextChecker::isGrammarCheckingEnabled):
2424         (WebKit::TextChecker::setGrammarCheckingEnabled):
2425         * WebKit2.pro:
2426         * WebKit2.xcodeproj/project.pbxproj:
2427         * WebProcess/WebPage/WebPage.cpp:
2428         (WebKit::WebPage::unmarkAllMisspellings):
2429         (WebKit::WebPage::unmarkAllBadGrammar):
2430         * WebProcess/WebPage/WebPage.h:
2431         * WebProcess/WebPage/WebPage.messages.in:
2432         * win/WebKit2.vcproj:
2433
2434 2010-12-20  Anders Carlsson  <andersca@apple.com>
2435
2436         Reviewed by Sam Weinig.
2437
2438         Flash plug-in does not work on YouTube video page when accelerated compositing is disabled
2439         https://bugs.webkit.org/show_bug.cgi?id=51348
2440         <rdar://problem/8787667>
2441
2442         * Platform/CoreIPC/HandleMessage.h:
2443         (CoreIPC::callMemberFunction):
2444         Add new overload.
2445
2446         * PluginProcess/PluginControllerProxy.cpp:
2447         (WebKit::PluginControllerProxy::create):
2448         (WebKit::PluginControllerProxy::PluginControllerProxy):
2449         These now take an additional isAcceleratedCompositingEnabled parameter.
2450
2451         (WebKit::PluginControllerProxy::isAcceleratedCompositingEnabled):
2452         Return m_isAcceleratedCompositingEnabled.
2453
2454         * PluginProcess/PluginControllerProxy.h:
2455         * PluginProcess/WebProcessConnection.cpp:
2456         (WebKit::WebProcessConnection::createPlugin):
2457         This now takes an additional isAcceleratedCompositingEnabled parameter.
2458
2459         * PluginProcess/WebProcessConnection.messages.in:
2460         Add isAcceleratedCompositingEnabled parameter to the CreatePlugin message.
2461
2462         * WebProcess/Plugins/PluginProxy.cpp:
2463         (WebKit::PluginProxy::initialize):
2464         Pass isAcceleratedCompositingEnabled when sending the CreatePlugin message.
2465
2466 2010-12-20  Anders Carlsson  <andersca@apple.com>
2467
2468         Unreviewed, rolling out r74345.
2469         http://trac.webkit.org/changeset/74345
2470         https://bugs.webkit.org/show_bug.cgi?id=51115
2471
2472         Not the correct fix.
2473
2474         * Platform/CoreIPC/Connection.h:
2475         * Platform/CoreIPC/qt/ConnectionQt.cpp:
2476         (CoreIPC::Connection::open):
2477
2478 2010-12-20  Balazs Kelemen  <kbalazs@webkit.org>
2479
2480         Reviewed by Kenneth Rohde Christiansen.
2481
2482         [Qt][WK2] Crash in web process after the connection had been closed
2483         https://bugs.webkit.org/show_bug.cgi?id=51115
2484
2485         Do not call connectionDidClose with a connection that has been explicitly
2486         invalidated on the listener thread.
2487         * Platform/CoreIPC/Connection.h:
2488         * Platform/CoreIPC/qt/ConnectionQt.cpp:
2489         (CoreIPC::Connection::disconnectHandler): Added.
2490         (CoreIPC::Connection::open):
2491
2492 2010-12-19  Dan Bernstein  <mitz@apple.com>
2493
2494         Reviewed by Sam Weinig.
2495
2496         Improve the fix for <rdar://problem/8769525>.
2497
2498         * UIProcess/API/mac/WKView.mm:
2499         (-[WKView performKeyEquivalent:]): Do not retain the view. Doing so is necessary in
2500         -[WebHTMLView performKeyEquivalent:], which this method was based upon, but not here, because
2501         there is no way for the web process to cause the WKView to be released while it is handling
2502         the event.
2503
2504 2010-12-19  Dan Bernstein  <mitz@apple.com>
2505
2506         Reviewed by Sam Weinig.
2507
2508         <rdar://problem/8769525> WKView leak when performing key equivalents
2509         https://bugs.webkit.org/show_bug.cgi?id=51315
2510
2511         * UIProcess/API/mac/WKView.mm:
2512         (-[WKView performKeyEquivalent:]): Use a RetainPtr to ensure that the view is released in the
2513         early return code path.
2514
2515 2010-12-19  Benjamin Poulain  <benjamin.poulain@nokia.com>
2516
2517         Reviewed by Kenneth Rohde Christiansen.
2518
2519         [Qt] [WK2] QWKPagePrivate::paint() does not need to save the graphics context
2520         https://bugs.webkit.org/show_bug.cgi?id=51300
2521
2522         Remove the unnecessary save() and restore() on the QPainter.
2523
2524         * UIProcess/API/qt/qwkpage.cpp:
2525         (QWKPagePrivate::paint):
2526
2527 2010-12-19  Kenneth Rohde Christiansen  <kenneth@webkit.org>
2528
2529         Reviewed by Andreas Kling.
2530
2531         [Qt] [WK2] Client are expected to render their own background for WebPages
2532         https://bugs.webkit.org/show_bug.cgi?id=51296
2533
2534         Remove the rendering of the checkerboard from the tiled DrawingAreaProxy
2535
2536         * UIProcess/TiledDrawingAreaProxy.cpp:
2537         (WebKit::TiledDrawingAreaProxy::paint):
2538         * UIProcess/TiledDrawingAreaTile.h:
2539         * UIProcess/qt/TiledDrawingAreaTileQt.cpp:
2540
2541 2010-12-19  Benjamin Poulain  <benjamin.poulain@nokia.com>
2542
2543         Reviewed by Kenneth Rohde Christiansen.
2544
2545         [Qt] [WK2] Client are expected to render their own background for WebPages
2546         https://bugs.webkit.org/show_bug.cgi?id=51296
2547
2548         Do not render a white background before rendering the page with DrawingAreaProxy.
2549
2550         * UIProcess/API/qt/qwkpage.cpp:
2551         (QWKPagePrivate::paint):
2552
2553 2010-12-17  Darin Adler  <darin@apple.com>
2554
2555         Reviewed by Dan Bernstein.
2556
2557         Window title for image documents shows corrupted characters instead of multiplication sign when using WebKit2
2558         https://bugs.webkit.org/show_bug.cgi?id=43505
2559
2560         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: Changed UI_STRING macros to return
2561         WebCore::String objects instead of C strings.
2562         (WebKit::formatLocalizedString): Added. Uses the Core Foundation string formatting function for
2563         reasons explained in the comment.
2564         (WebKit::WebPlatformStrategies::multipleFileUploadText): Use formatLocalizedString instead of
2565         String::format.
2566         (WebKit::WebPlatformStrategies::imageTitle): Ditto.
2567         (WebKit::WebPlatformStrategies::localizedMediaTimeDescription): Ditto.
2568
2569 2010-12-17  Anders Carlsson  <andersca@apple.com>
2570
2571         Reviewed by Sam Weinig.
2572
2573         Resizing a WKView while loading a page can leave the page at a size that doesn't match the window
2574         https://bugs.webkit.org/show_bug.cgi?id=51282
2575         <rdar://problem/8133142>
2576
2577         Fix a race condition in waitForMessage. If we time out on the wait condition, we would keep the
2578         m_waitForMessageMutex mutex unlocked for a brief period of time before taking the lock again and
2579         then removing the messageID/destinationID pair from the hash map. Under some circumstances, the
2580         connection queue would update the hash map right before we removed it, leading to a lost message.
2581         
2582         * Platform/CoreIPC/Connection.cpp:
2583         (CoreIPC::Connection::waitForMessage):
2584
2585 2010-12-17  Anders Carlsson  <andersca@apple.com>
2586
2587         Reviewed by Simon Fraser.
2588
2589         Clean up ChunkedUpdateDrawingAreaProxy
2590         https://bugs.webkit.org/show_bug.cgi?id=51277
2591
2592         Get rid of m_lastSetViewSize since it was always equal to m_size.
2593
2594         * UIProcess/ChunkedUpdateDrawingAreaProxy.cpp:
2595         (WebKit::ChunkedUpdateDrawingAreaProxy::sizeDidChange):
2596         Call sendSetSize().
2597
2598         (WebKit::ChunkedUpdateDrawingAreaProxy::didSetSize):
2599         Call sendSetSize if the size differs.
2600
2601         (WebKit::ChunkedUpdateDrawingAreaProxy::sendSetSize):
2602         Move code from sizeDidChange over here.
2603
2604         * UIProcess/ChunkedUpdateDrawingAreaProxy.h:
2605         * UIProcess/DrawingAreaProxy.cpp:
2606         (WebKit::DrawingAreaProxy::setSize):
2607         Add back the early return if the sizes are equal.
2608
2609 2010-12-17  Brent Fulgham  <bfulgham@webkit.org>
2610
2611         Unreviewed build fix.
2612
2613         * WebProcess/WebPage/win/WebPageWin.cpp:
2614         (WebKit::WebPage::canHandleRequest): Provide alternative for
2615         non-CFNetwork implementation.
2616
2617 2010-12-17  Ada Chan  <adachan@apple.com>
2618
2619         Reviewed by Anders Carlsson.
2620
2621         Implement WKView::setInitialFocus().
2622         https://bugs.webkit.org/show_bug.cgi?id=51274
2623
2624         * UIProcess/API/C/win/WKView.cpp:
2625         (WKViewSetInitialFocus):
2626         * UIProcess/API/C/win/WKView.h:
2627         * UIProcess/WebPageProxy.cpp:
2628         (WebKit::WebPageProxy::setInitialFocus): Send message to the Web Process to set
2629         initial focus.
2630         * UIProcess/WebPageProxy.h:
2631         * UIProcess/win/WebView.cpp:
2632         (WebKit::WebView::setInitialFocus):
2633         * UIProcess/win/WebView.h:
2634         * WebProcess/WebPage/WebPage.cpp:
2635         (WebKit::WebPage::setInitialFocus): Set the focused node to null initially.  Then
2636         ask FocusController to set the initial focus based on the focus direction.
2637         * WebProcess/WebPage/WebPage.h:
2638         * WebProcess/WebPage/WebPage.messages.in: Add a new message for SetInitialFocus.
2639
2640 2010-12-17  Anders Carlsson  <andersca@apple.com>
2641
2642         Reviewed by Sam Weinig.
2643
2644         Remove a check that probably uncovered a resizing bug.
2645
2646         * UIProcess/DrawingAreaProxy.cpp:
2647         (WebKit::DrawingAreaProxy::setSize):
2648
2649 2010-12-17  Brian Weinstein  <bweinstein@apple.com>
2650
2651         Qt build fix.
2652
2653         * UIProcess/qt/WebPopupMenuProxyQt.h:
2654
2655 2010-12-17  Brian Weinstein  <bweinstein@apple.com>
2656
2657         Reviewed by Anders Carlsson.
2658
2659         Text area does not update when you arrow through a <select> in WebKit2
2660         https://bugs.webkit.org/show_bug.cgi?id=51269
2661         <rdar://problem/8612853>
2662         
2663         Patch by Sam Weinig.
2664         
2665         Insteaed of keeping track of the selected index of a <select> just in the UI process, we
2666         need to pass this information along to the web process so that the web process can draw
2667         the correct text in the text field at the top of the select, when the selection changes (via
2668         the arrows or other typing while the select is opened).
2669         
2670         When the selected item in a popup changes, the UI process sends a message to the web process, telling
2671         it about the new selected index. The web process gets this message, and then sets the text that
2672         is visible in the select element.
2673
2674         * UIProcess/API/mac/PageClientImpl.h: CreatePopupMenuProxy now takes a WebPageProxy.
2675         * UIProcess/API/mac/PageClientImpl.mm:
2676         (WebKit::PageClientImpl::createPopupMenuProxy): Pass the WebPageProxy to create.
2677         * UIProcess/API/qt/qwkpage.cpp:
2678         (QWKPagePrivate::createPopupMenuProxy):
2679         * UIProcess/API/qt/qwkpage_p.h: CreatePopupMenuProxy now takes a WebPageProxy.
2680         * UIProcess/PageClient.h: CreatePopupMenuProxy now takes a WebPageProxy.
2681         * UIProcess/WebPageProxy.cpp:
2682         (WebKit::WebPageProxy::valueChangedForPopupMenu): Send that the selected index changed to the 
2683             web process.selected
2684         (WebKit::WebPageProxy::setTextFromItemForPopupMenu): Send that we should update the text for the
2685             active popup menu (with the index of the item to show).
2686         (WebKit::WebPageProxy::showPopupMenu): Pass the WebPageProxy to createPopupMenuProxy.
2687         * UIProcess/WebPageProxy.h:
2688         * UIProcess/WebPopupMenuProxy.h: Add a client who has virtual functions for the state changing of the
2689             popup menu. ShowPopupMenu doesn't take a new selected index anymore, that is handled by the client,
2690             and calling down to the web process.
2691         (WebKit::WebPopupMenuProxy::Client::~Client):
2692         (WebKit::WebPopupMenuProxy::WebPopupMenuProxy): Initialize the client.
2693         * UIProcess/mac/WebPopupMenuProxyMac.h:
2694         (WebKit::WebPopupMenuProxyMac::create): Takes a WebPopupMenuProxy::Client, and passes it to the constructor.
2695         * UIProcess/mac/WebPopupMenuProxyMac.mm:
2696         (WebKit::WebPopupMenuProxyMac::WebPopupMenuProxyMac): Update what's initialized by the constructor.
2697         (WebKit::WebPopupMenuProxyMac::showPopupMenu): Call through to the web process that the value changed.
2698         * UIProcess/qt/WebPopupMenuProxyQt.cpp:
2699         (WebKit::WebPopupMenuProxyQt::WebPopupMenuProxyQt): Update what's initialized by the constructor.
2700         * UIProcess/win/WebPopupMenuProxyWin.cpp:
2701         (WebKit::WebPopupMenuProxyWin::WebPopupMenuProxyWin): Ditto.
2702         (WebKit::WebPopupMenuProxyWin::showPopupMenu): Call through to the web process that the value changed.
2703         (WebKit::WebPopupMenuProxyWin::setFocusedIndex): Resolve a FIXME to set the text of the popup menu.
2704         * UIProcess/win/WebPopupMenuProxyWin.h:
2705         (WebKit::WebPopupMenuProxyWin::create): Take in a WebPopupMenuProxy::client, and pass it to the constructor.
2706         * UIProcess/win/WebView.cpp:
2707         (WebKit::WebView::createPopupMenuProxy): Pass the WebPageProxy to create.
2708         * UIProcess/win/WebView.h:
2709         * WebProcess/WebCoreSupport/WebPopupMenu.cpp:
2710         (WebKit::WebPopupMenu::setTextForIndex): Call through to setTextFromItem to set the select text.
2711         * WebProcess/WebCoreSupport/WebPopupMenu.h:
2712         * WebProcess/WebPage/WebPage.cpp: Call through to setTextForIndex on the active popup menu.
2713         (WebKit::WebPage::setTextForActivePopupMenu):
2714         * WebProcess/WebPage/WebPage.h:
2715         * WebProcess/WebPage/WebPage.messages.in: Add a new message.
2716
2717 2010-12-17  Anders Carlsson  <andersca@apple.com>
2718
2719         Reviewed by Sam Weinig.
2720
2721         DrawingAreaProxy::setSize shouldn't be a virtual member function
2722         https://bugs.webkit.org/show_bug.cgi?id=51275
2723
2724         Add a pure virtual sizeDidChange member function to DrawingAreaProxy, and only
2725         call it if the size changes.
2726
2727         * UIProcess/ChunkedUpdateDrawingAreaProxy.cpp:
2728         (WebKit::ChunkedUpdateDrawingAreaProxy::sizeDidChange):
2729         * UIProcess/ChunkedUpdateDrawingAreaProxy.h:
2730         * UIProcess/DrawingAreaProxy.cpp:
2731         (WebKit::DrawingAreaProxy::setSize):
2732         * UIProcess/DrawingAreaProxy.h:
2733         (WebKit::DrawingAreaProxy::size):
2734         * UIProcess/LayerBackedDrawingAreaProxy.cpp:
2735         (WebKit::LayerBackedDrawingAreaProxy::sizeDidChange):
2736         * UIProcess/LayerBackedDrawingAreaProxy.h:
2737         * UIProcess/TiledDrawingAreaProxy.cpp:
2738         (WebKit::TiledDrawingAreaProxy::sizeDidChange):
2739         * UIProcess/TiledDrawingAreaProxy.h:
2740
2741 2010-12-17  Anders Carlsson  <andersca@apple.com>
2742
2743         Reviewed by Sam Weinig.
2744
2745         Add a WebPageProxy parameter to the DrawingAreaProxy constructor
2746         https://bugs.webkit.org/show_bug.cgi?id=51271
2747
2748         * UIProcess/API/mac/WKView.mm:
2749         (-[WKView initWithFrame:contextRef:pageGroupRef:]):
2750         (-[WKView _switchToDrawingAreaTypeIfNecessary:DrawingAreaInfo::]):
2751         * UIProcess/API/qt/qgraphicswkview.cpp:
2752         (QGraphicsWKView::QGraphicsWKView):
2753         * UIProcess/ChunkedUpdateDrawingAreaProxy.cpp:
2754         (WebKit::ChunkedUpdateDrawingAreaProxy::create):
2755         (WebKit::ChunkedUpdateDrawingAreaProxy::ChunkedUpdateDrawingAreaProxy):
2756         * UIProcess/ChunkedUpdateDrawingAreaProxy.h:
2757         * UIProcess/DrawingAreaProxy.cpp:
2758         (WebKit::DrawingAreaProxy::DrawingAreaProxy):
2759         * UIProcess/DrawingAreaProxy.h:
2760         * UIProcess/LayerBackedDrawingAreaProxy.cpp:
2761         (WebKit::LayerBackedDrawingAreaProxy::create):
2762         (WebKit::LayerBackedDrawingAreaProxy::LayerBackedDrawingAreaProxy):
2763         * UIProcess/LayerBackedDrawingAreaProxy.h:
2764         * UIProcess/TiledDrawingAreaProxy.cpp:
2765         (WebKit::TiledDrawingAreaProxy::create):
2766         (WebKit::TiledDrawingAreaProxy::TiledDrawingAreaProxy):
2767         * UIProcess/TiledDrawingAreaProxy.h:
2768         * UIProcess/win/WebView.cpp:
2769         (WebKit::WebView::WebView):
2770         (WebKit::WebView::switchToDrawingAreaTypeIfNecessary):
2771
2772 2010-12-17  Dan Bernstein  <mitz@apple.com>
2773
2774         Reviewed by Darin Adler.
2775
2776         Add API for "Always Use the Complex Text Code Path"
2777         https://bugs.webkit.org/show_bug.cgi?id=51265
2778
2779         * Shared/WebProcessCreationParameters.cpp:
2780         (WebKit::WebProcessCreationParameters::WebProcessCreationParameters): Initialize shouldAlwaysUseComplexTextCodePath.
2781         (WebKit::WebProcessCreationParameters::encode): Encode shouldAlwaysUseComplexTextCodePath.
2782         (WebKit::WebProcessCreationParameters::decode): Decode shouldAlwaysUseComplexTextCodePath.
2783         * Shared/WebProcessCreationParameters.h:
2784         * UIProcess/API/C/WKContext.cpp: 
2785         (_WKContextSetAlwaysUsesComplexTextCodePath): Added.
2786         * UIProcess/API/C/WKContextPrivate.h:
2787         * UIProcess/WebContext.cpp:
2788         (WebKit::WebContext::WebContext): Initialize m_alwaysUsesComplexTextCodePath.
2789         (WebKit::WebContext::ensureWebProcess): Set shouldAlwaysUseComplexTextCodePath in the creation parameters.
2790         (WebKit::WebContext::setAlwaysUsesComplexTextCodePath): Added. Sets m_alwaysUsesComplexTextCodePath and
2791         sends a message to the WebProcess.
2792         * UIProcess/WebContext.h:
2793         * WebProcess/WebProcess.cpp:
2794         (WebKit::WebProcess::initializeWebProcess): Call setAlwaysUsesComplexTextCodePath() based on the creation
2795         parameters.
2796         (WebKit::WebProcess::setAlwaysUsesComplexTextCodePath): Added.
2797         * WebProcess/WebProcess.h:
2798         * WebProcess/WebProcess.messages.in: Added SetAlwaysUsesComplexTextCodePath.
2799
2800 2010-12-17  Sam Weinig  <sam@webkit.org>
2801
2802         Reviewed by Darin Adler.
2803
2804         WebKit2: Implement a title attribute per frame
2805         https://bugs.webkit.org/show_bug.cgi?id=51266
2806
2807         Cache the title of each frame on the WebFrameProxy. Removes
2808         the WebPageProxy's cache of the main frame title to just
2809         access the main frame.
2810
2811         We clear the cached title on new committed loads and on failures
2812         to load.
2813
2814         * UIProcess/API/C/WKFrame.cpp:
2815         (WKFrameCopyTitle):
2816         * UIProcess/API/C/WKFrame.h:
2817         * UIProcess/WebFrameProxy.cpp:
2818         (WebKit::WebFrameProxy::didCommitLoad):
2819         (WebKit::WebFrameProxy::didFailLoad):
2820         (WebKit::WebFrameProxy::didChangeTitle):
2821         * UIProcess/WebFrameProxy.h:
2822         (WebKit::WebFrameProxy::title):
2823         * UIProcess/WebPageProxy.cpp:
2824         (WebKit::WebPageProxy::close):
2825         (WebKit::WebPageProxy::pageTitle):
2826         (WebKit::WebPageProxy::didReceiveTitleForFrame):
2827         (WebKit::WebPageProxy::processDidCrash):
2828         * UIProcess/WebPageProxy.h:
2829
2830 2010-12-16  Darin Adler  <darin@apple.com>
2831
2832         Reviewed by Maciej Stachowiak.
2833
2834         Add text encoding menu API for WebKit2
2835         https://bugs.webkit.org/show_bug.cgi?id=51226
2836
2837         * UIProcess/API/C/WKPage.cpp:
2838         (WKPageSupportsTextEncoding): Added.
2839         (WKPageCopyCustomTextEncodingName): Added.
2840         (WKPageSetCustomTextEncodingName): Added.
2841         * UIProcess/API/C/WKPage.h: Added the functions above.
2842
2843         * UIProcess/WebPageProxy.cpp:
2844         (WebKit::WebPageProxy::WebPageProxy): Initialize
2845         m_mainFrameHasCustomRepresentation to false.
2846         (WebKit::WebPageProxy::supportsTextEncoding): Added.
2847         (WebKit::WebPageProxy::setCustomTextEncodingName): Added.
2848         (WebKit::WebPageProxy::didCommitLoadForFrame): Set
2849         m_mainFrameHasCustomRepresentation.
2850
2851         * UIProcess/WebPageProxy.h: Added supportsTextEncoding,
2852         setCustomTextEncodingName, customTextEncodingName, and
2853         m_mainFrameHasCustomRepresentation.
2854
2855         * UIProcess/WebPageProxy.messages.in: Tweaked formatting
2856         (added a blank line).
2857
2858         * WebProcess/WebPage/WebPage.cpp:
2859         (WebKit::WebPage::setCustomTextEncodingName): Added.
2860         * WebProcess/WebPage/WebPage.h: Added setCustomTextEncodingName.
2861
2862         * WebProcess/WebPage/WebPage.messages.in: Added the
2863         SetCustomTextEncodingName message. Tweaked formatting of the
2864         dummy message.
2865
2866 2010-12-17  Sheriff Bot  <webkit.review.bot@gmail.com>
2867
2868         Unreviewed, rolling out r74201.
2869         http://trac.webkit.org/changeset/74201
2870         https://bugs.webkit.org/show_bug.cgi?id=51248
2871
2872         It broke ~6000 layout tests (Requested by Ossy_ on #webkit).
2873
2874         * UIProcess/API/qt/qgraphicswkview.cpp:
2875         (QGraphicsWKView::setGeometry):
2876         (QGraphicsWKView::itemChange):
2877
2878 2010-12-16  Sam Weinig  <sam@webkit.org>
2879
2880         Reviewed by Darin Adler.
2881
2882         Add svn:eol-style native to the message.in files as a favor to Darin Adler.
2883
2884         * PluginProcess/PluginControllerProxy.messages.in: Added property svn:eol-style.
2885         * PluginProcess/PluginProcess.messages.in: Added property svn:eol-style.
2886         * PluginProcess/WebProcessConnection.messages.in: Added property svn:eol-style.
2887         * Shared/Plugins/NPObjectMessageReceiver.messages.in: Added property svn:eol-style.
2888         * UIProcess/Downloads/DownloadProxy.messages.in: Added property svn:eol-style.
2889         * UIProcess/Plugins/PluginProcessProxy.messages.in: Added property svn:eol-style.
2890         * UIProcess/WebContext.messages.in: Added property svn:eol-style.
2891         * UIProcess/WebDatabaseManagerProxy.messages.in: Added property svn:eol-style.
2892         * UIProcess/WebInspectorProxy.messages.in: Added property svn:eol-style.
2893         * UIProcess/WebPageProxy.messages.in: Added property svn:eol-style.
2894         * UIProcess/WebProcessProxy.messages.in: Added property svn:eol-style.
2895         * WebProcess/Authentication/AuthenticationManager.messages.in: Added property svn:eol-style.
2896         * WebProcess/Plugins/PluginProxy.messages.in: Added property svn:eol-style.
2897         * WebProcess/WebCoreSupport/WebDatabaseManager.messages.in: Added property svn:eol-style.
2898         * WebProcess/WebPage/WebInspector.messages.in: Added property svn:eol-style.
2899         * WebProcess/WebPage/WebPage.messages.in: Added property svn:eol-style.
2900         * WebProcess/WebProcess.messages.in: Added property svn:eol-style.
2901
2902 2010-12-16  Sam Weinig  <sam@webkit.org>
2903
2904         Reviewed by Anders Carlsson.
2905
2906         Move NSURLCache initialization from the ProcessLauncherMac to the centralized
2907         WebContext initialize WebProcess mechanism.
2908
2909         * Shared/WebProcessCreationParameters.cpp:
2910         (WebKit::WebProcessCreationParameters::WebProcessCreationParameters):
2911         (WebKit::WebProcessCreationParameters::encode):
2912         (WebKit::WebProcessCreationParameters::decode):
2913         * Shared/WebProcessCreationParameters.h:
2914         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
2915         (WebKit::ProcessLauncher::launchProcess):
2916         * UIProcess/mac/WebContextMac.mm:
2917         (WebKit::WebContext::platformInitializeWebProcess):
2918         * WebProcess/WebProcess.cpp:
2919         (WebKit::WebProcess::initializeWebProcess):
2920         * WebProcess/mac/WebProcessMac.mm:
2921         (WebKit::WebProcess::platformInitializeWebProcess):
2922         * WebProcess/mac/WebProcessMainMac.mm:
2923         (WebKit::WebProcessMain):
2924         * WebProcess/win/WebProcessWin.cpp:
2925         (WebKit::WebProcess::platformInitializeWebProcess):
2926         (WebKit::WebProcess::setShouldPaintNativeControls):
2927
2928 2010-12-16  Anders Carlsson  <andersca@apple.com>
2929
2930         Reviewed by Dan Bernstein.
2931
2932         Defer getting a PluginProcessConnection object until the plug-in is initialized
2933         https://bugs.webkit.org/show_bug.cgi?id=51207
2934         <rdar://problem/8731306>
2935
2936         Before this change, we would pass the PluginProcessConnection to the PluginProxy constructor, but not
2937         call PluginProcessConnection::addPluginProxy (which associates the plug-in proxy with the connection)
2938         until the plug-in is initialized.
2939
2940         This could lead to a PluginProxy holding a reference to a PluginProcessConnection when the PluginProxyConnection
2941         itself did not know anything about the PluginProxy. This would happen when a page with plug-ins is opened in a background
2942         tab, with the plug-ins not yet initialized.
2943
2944         Because of this, we could end up in a weird state, where the PluginProcessConnection would think that there are no
2945         more plug-ins alive, and invalidate (and null out) the underlying CoreIPC connection, which would lead to crashes
2946         when trying to send messages to the connection during later initialization.
2947
2948         The fix is to pass the plug-in path to the PluginProxy constructor, and get the connection from PluginProxy::initialize.
2949         
2950         PluginProcessConnection object 
2951         * WebProcess/Plugins/PluginProxy.cpp:
2952         (WebKit::PluginProxy::create):
2953         (WebKit::PluginProxy::PluginProxy):
2954         (WebKit::PluginProxy::initialize):
2955         * WebProcess/Plugins/PluginProxy.h:
2956         * WebProcess/WebPage/WebPage.cpp:
2957         (WebKit::WebPage::createPlugin):
2958
2959 2010-12-16  Enrica Casucci  <enrica@apple.com>
2960
2961         Reviewed by Maciej Stachowiak.
2962
2963         WebKit2: Cannot copy two successive selections using cmd-c
2964         <rdar://problem/8680309> 
2965         https://bugs.webkit.org/show_bug.cgi?id=51203
2966         
2967         The previous implementation assumed a call sequence from AppKit that
2968         was not always happening.
2969         When the user clicks on the pulldown menu, AppKit sends validateUserInterfaceItem
2970         calls for each element that needs validation and we used to count the number of
2971         validation requests being sent to the web process.
2972         All these calls are made before we have the chance to get one reply from the WebProcess.
2973         We also delayed the menu update until we had received all the replies to the validation requests.
2974         At that point we called update on the menu to trigger the validation one more time with
2975         the data retrived from the WebProcess.
2976         When the user simply presses cmd-c, only one call to vaidateUserInterfaceItem is made
2977         and the menu update triggered the validation of all the menu entries causing the internal
2978         state to be out of sync.
2979         The new implementation is very simple: for each validation request from AppKit we send
2980         a request to the WebProcess and we cache a reference to the menu item being validated.
2981         When the WebProcess replies, we retrieve the menu item from our cache and update its state.
2982         
2983         * UIProcess/API/mac/WKView.mm:
2984         (-[WKView initWithFrame:contextRef:pageGroupRef:]): Removed initialization of deleted memebers.
2985         (-[WKView validateUserInterfaceItem:]): Request validation to the WebProcess and return YES to 
2986         allow AppKit to do the keyBinding processing.
2987         (-[WKView _setUserInterfaceItemState:enabled:state:]): Called when the WebProcess replies to the
2988         validation request to check/uncheck and enable/disable the menu item.
2989
2990 2010-12-16  Anders Carlsson  <andersca@apple.com>
2991
2992         Reviewed by Oliver Hunt.
2993
2994         Don't try to call plug-in member functions if the plug-in hasn't been initialized
2995         https://bugs.webkit.org/show_bug.cgi?id=51205
2996         <rdar://problem/8730204>
2997
2998         Make sure that all PluginView functions that can be called while a plug-in has not been
2999         initialized (if the plug-in page is in a background tab for example) have an additional
3000         check for m_isInitialized.
3001
3002         * WebProcess/Plugins/PluginView.cpp:
3003         (WebKit::PluginView::setWindowIsFocused):
3004         (WebKit::PluginView::windowAndViewFramesChanged):
3005         (WebKit::PluginView::platformLayer):
3006         (WebKit::PluginView::scriptObject):
3007         (WebKit::PluginView::privateBrowsingStateChanged):
3008         (WebKit::PluginView::handleEvent):
3009         (WebKit::PluginView::viewGeometryDidChange):
3010         (WebKit::PluginView::setFocus):
3011
3012 2010-12-16  Anders Carlsson  <andersca@apple.com>
3013
3014         Reviewed by John Sullivan.
3015
3016         Add a bunch of m_isStarted assertions to plug-in code.
3017
3018         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
3019         (WebKit::NetscapePlugin::frameDidFinishLoading):
3020         (WebKit::NetscapePlugin::frameDidFail):
3021         (WebKit::NetscapePlugin::didEvaluateJavaScript):
3022         (WebKit::NetscapePlugin::streamDidReceiveResponse):
3023         (WebKit::NetscapePlugin::streamDidReceiveData):
3024         (WebKit::NetscapePlugin::streamDidFinishLoading):
3025         (WebKit::NetscapePlugin::streamDidFail):
3026         (WebKit::NetscapePlugin::manualStreamDidReceiveResponse):
3027         (WebKit::NetscapePlugin::manualStreamDidReceiveData):
3028         (WebKit::NetscapePlugin::manualStreamDidFinishLoading):
3029         (WebKit::NetscapePlugin::manualStreamDidFail):
3030         (WebKit::NetscapePlugin::handleMouseEvent):
3031         (WebKit::NetscapePlugin::handleWheelEvent):
3032         (WebKit::NetscapePlugin::handleMouseEnterEvent):
3033         (WebKit::NetscapePlugin::handleMouseLeaveEvent):
3034         (WebKit::NetscapePlugin::handleKeyboardEvent):
3035         (WebKit::NetscapePlugin::setFocus):
3036         (WebKit::NetscapePlugin::pluginScriptableNPObject):
3037         (WebKit::NetscapePlugin::privateBrowsingStateChanged):
3038
3039 2010-12-16  Anders Carlsson  <andersca@apple.com>
3040
3041         Reviewed by Darin Adler.
3042
3043         Save the manual plug-in stream data and redeliver it when the plug-in is initialized
3044         https://bugs.webkit.org/show_bug.cgi?id=51201
3045
3046         * WebProcess/Plugins/PluginView.cpp:
3047         (WebKit::PluginView::PluginView):
3048         Initialize m_manualStreamState.
3049
3050         (WebKit::PluginView::manualLoadDidReceiveResponse):
3051         If the plug-in hasn't been initialized, store the response.
3052
3053         (WebKit::PluginView::manualLoadDidReceiveData):
3054         If the plug-in hasn't been initialized, store the data.
3055         
3056         (WebKit::PluginView::manualLoadDidFinishLoading):
3057         If the plug-in hasn't been initialized, update the state.
3058
3059         (WebKit::PluginView::manualLoadDidFail):
3060         If the plug-in hasn't been initialized, store the error and update the state.
3061         
3062         (WebKit::PluginView::initializePlugin):
3063         Call redeliverManualStream.
3064
3065         (WebKit::PluginView::redeliverManualStream):
3066         Redeliver the manual stream to the plug-in.
3067
3068         * WebProcess/Plugins/PluginView.h:
3069
3070 2010-12-16  Kimmo Kinnunen  <kimmo.t.kinnunen@nokia.com>
3071
3072         Reviewed by Andreas Kling.
3073
3074         [Qt] Turn off drawing area updates if the item is not visible
3075
3076         The updates are controlled by the QGraphicsItem::visible property.
3077
3078         * UIProcess/API/qt/qgraphicswkview.cpp:
3079         (QGraphicsWKViewPrivate::updateViewportSize):
3080         (QGraphicsWKView::setGeometry):
3081         (QGraphicsWKView::itemChange):
3082
3083 2010-12-15  Dan Bernstein  <mitz@apple.com>
3084
3085         Reviewed by Sam Weinig.
3086
3087         <rdar://problem/8731320> WebProcess’s CFNetwork cache is in ~/Library/Caches/com.apple.WebProcess
3088
3089         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
3090         (WebKit::ProcessLauncher::launchProcess): Get the location, disk capacity and memory capacity
3091         of the UI process’s NSURLCache and pass them to the WebProcess.
3092         * WebProcess/mac/WebProcessMainMac.mm:
3093         (WebKit::WebProcessMain): If an NSURLCache location was passed on the command line, set the
3094         shared NSURLCache to that path and use the specified capacities as initial values.
3095
3096 2010-12-15  Dan Bernstein  <mitz@apple.com>
3097
3098         Reviewed by Sam “I blame andersca” Weinig.
3099
3100         Allow responses to be cached by the NSURLCache.
3101
3102         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3103         (WebKit::WebFrameLoaderClient::willCacheResponse): Changed to return the response instead of 0.
3104
3105 2010-12-14  Enrica Casucci  <enrica@apple.com>
3106
3107         Reviewed by Adam Roben.
3108
3109         Add IME support to WebKit2 on Windows
3110         https://bugs.webkit.org/show_bug.cgi?id=51049
3111         The implementation is very close to the one in WebKit.
3112         The main change is the addition of handlers for WM_IME_STARTCOMPOSITION,
3113         WM_IME_REQUEST, WM_IME_COMPOSITION, WM_IME_ENDCOMPOSITION,
3114         WM_IME_SELECT, WM_IME_SETCONTEXT and a number of new messages
3115         between the UI process and the WebProcess to send/retrieve
3116         the data being handled by the messages listed above.
3117
3118         * UIProcess/PageClient.h: Added compositionSelectionChanged for Windows platform.
3119         * UIProcess/WebPageProxy.cpp:
3120         The following methods send synchronous messages to the WebProcess.
3121         (WebKit::WebPageProxy::firstRectForCharacterInSelectedRange): Retrieves the rectangle to position
3122         the cnadidates window.
3123         (WebKit::WebPageProxy::getSelectedText): Retrieves the currently selected text.
3124         The following methods send asynchronous messages to the WebProcess.
3125         (WebKit::WebPageProxy::confirmComposition):
3126         (WebKit::WebPageProxy::setComposition):
3127         (WebKit::WebPageProxy::didChangeSelection): Name changed.
3128         (WebKit::WebPageProxy::didChangeCompositionSelection): Called when there is a change
3129         in the composition selection.
3130         * UIProcess/WebPageProxy.messages.in: Added messages corresponding to the methods above.
3131         * UIProcess/win/WebView.cpp:
3132         (WebKit::WebView::wndProc): Added handling of messages for IME.
3133         The following are the handlers for the window message being sent during composition.
3134         (WebKit::WebView::onIMEComposition):
3135         (WebKit::WebView::onIMEEndComposition):
3136         (WebKit::WebView::onIMERequestCharPosition):
3137         (WebKit::WebView::onIMERequestReconvertString):
3138         (WebKit::WebView::onIMERequest):
3139         (WebKit::WebView::onIMESelect):
3140         (WebKit::WebView::onIMESetContext):
3141         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
3142         (WebKit::WebEditorClient::respondToChangedSelection): Added notification
3143         of composition selection changed for Windows.
3144         * WebProcess/WebPage/win/WebPageWin.cpp:
3145         The following are the WebProcess counterparts of the new messages.
3146         (WebKit::WebPage::confirmComposition):
3147         (WebKit::WebPage::setComposition):
3148         (WebKit::WebPage::firstRectForCharacterInSelectedRange):
3149         (WebKit::WebPage::getSelectedText):
3150
3151 2010-12-15  Sam Weinig  <sam@webkit.org>
3152
3153         Reviewed by Brady Eidson.
3154
3155         Loading webkit.org over and over is slower in WebKit2 than WebKit1, looks like page is not cached
3156         <rdar://problem/8774683>
3157         https://bugs.webkit.org/show_bug.cgi?id=51143
3158
3159         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3160         (WebKit::WebFrameLoaderClient::canCachePage): Return true as long as we
3161         are not a custom representation (eg. a PDF).
3162         (WebKit::WebFrameLoaderClient::shouldCacheResponse): Always return true.
3163         * WebProcess/WebPage/WebPage.cpp:
3164         (WebKit::WebPage::updatePreferences): Enable the page cache.
3165
3166 2010-12-15  Simon Fraser  <simon.fraser@apple.com>
3167
3168         Reviewed by Adele Peterson.
3169
3170         WebKit2 in compositing mode no longer has font smoothing
3171         https://bugs.webkit.org/show_bug.cgi?id=50733
3172         
3173         Tell the root GraphicsLayer that its contents are opaque
3174         if the WebPage draws its background, and that background
3175         is not transparent.
3176         
3177         The GraphicsLayer then uses the 'contentsOpaque' setting to
3178         determine whether to use font smoothing.
3179         
3180         Add pageBackgroundTransparencyChanged() to DrawingArea
3181         so that the WebPage can inform the DrawingArea when the
3182         background transparency changes.
3183
3184         * WebProcess/WebPage/DrawingArea.h:
3185         (WebKit::DrawingArea::pageBackgroundTransparencyChanged):
3186         (WebKit::DrawingArea::onPageClose):
3187         * WebProcess/WebPage/LayerBackedDrawingArea.cpp:
3188         (WebKit::LayerBackedDrawingArea::LayerBackedDrawingArea):
3189         (WebKit::LayerBackedDrawingArea::pageBackgroundTransparencyChanged):
3190         * WebProcess/WebPage/LayerBackedDrawingArea.h:
3191         * WebProcess/WebPage/WebPage.cpp:
3192         (WebKit::WebPage::setDrawsBackground):
3193         (WebKit::WebPage::setDrawsTransparentBackground):
3194
3195 2010-12-15  Anders Carlsson  <andersca@apple.com>
3196
3197         Reviewed by Sam Weinig.
3198
3199         Fix assertion in plugins/return-error-from-new-stream-callback-in-full-frame-plugin.html test
3200         https://bugs.webkit.org/show_bug.cgi?id=51136
3201
3202         Ensure that a plug-in that has explicitly cancelled the manual stream won't get any more callbacks.
3203
3204         * PluginProcess/PluginControllerProxy.cpp:
3205         (WebKit::PluginControllerProxy::PluginControllerProxy):
3206         (WebKit::PluginControllerProxy::cancelManualStreamLoad):
3207         (WebKit::PluginControllerProxy::manualStreamDidReceiveResponse):
3208         (WebKit::PluginControllerProxy::manualStreamDidReceiveData):
3209         (WebKit::PluginControllerProxy::manualStreamDidFinishLoading):
3210         (WebKit::PluginControllerProxy::manualStreamDidFail):
3211         * PluginProcess/PluginControllerProxy.h:
3212
3213 2010-12-15  Brian Weinstein  <bweinstein@apple.com>
3214
3215         Windows Build Fix. A .h file was added to the vcproj twice, but not its corresponding cpp file.
3216
3217         * win/WebKit2.vcproj:
3218
3219 2010-12-15  Sam Weinig  <sam@webkit.org>
3220
3221         Reviewed by Anders Carlsson.
3222
3223         WebKit2: Can't add files to an <input type=file>
3224         https://bugs.webkit.org/show_bug.cgi?id=51087
3225
3226         * Scripts/webkit2/messages.py:
3227         Adds new types.
3228
3229         * Shared/API/c/WKBase.h:
3230         Adds WKOpenPanelParametersRef and WKOpenPanelResultListenerRef.
3231
3232         * Shared/APIObject.h:
3233         Adds TypeOpenPanelParameters and TypeOpenPanelResultListener.
3234
3235         * Shared/WebOpenPanelParameters.cpp: Added.
3236         (WebKit::WebOpenPanelParameters::create):
3237         (WebKit::WebOpenPanelParameters::WebOpenPanelParameters):
3238         (WebKit::WebOpenPanelParameters::~WebOpenPanelParameters):
3239         (WebKit::WebOpenPanelParameters::Data::encode):
3240         (WebKit::WebOpenPanelParameters::Data::decode):
3241         * Shared/WebOpenPanelParameters.h: Added.
3242         (WebKit::WebOpenPanelParameters::allowMultipleFiles):
3243         (WebKit::WebOpenPanelParameters::type):
3244         Class representing options one can pass to open panel.
3245
3246         * UIProcess/API/C/WKAPICast.h:
3247         Add casts for WebOpenPanelParameters and WebOpenPanelResultListenerProxy.
3248
3249         * UIProcess/API/C/WKOpenPanelParameters.cpp: Added.
3250         (WKOpenPanelParametersGetTypeID):
3251         (WKOpenPanelParametersGetAllowsMultipleFiles):
3252         * UIProcess/API/C/WKOpenPanelParameters.h: Added.
3253         * UIProcess/API/C/WKOpenPanelResultListener.cpp: Added.
3254         (WKOpenPanelResultListenerGetTypeID):
3255         (WKOpenPanelResultListenerChooseFiles):
3256         (WKOpenPanelResultListenerCancel):
3257         * UIProcess/API/C/WKOpenPanelResultListener.h: Added.
3258         Add API wrappers.
3259
3260         * UIProcess/API/C/WKPage.h:
3261         Add new UI callback, WKPageRunOpenPanelCallback.
3262
3263         * UIProcess/API/C/WebKit2.h:
3264         Add includes for new API headers.
3265
3266         * UIProcess/API/qt/qwkpage.cpp:
3267         (QWKPage::QWKPage):
3268         Stub out the runOpenPanel callback.
3269
3270         * UIProcess/WebOpenPanelResultListenerProxy.cpp: Added.
3271         (WebKit::WebOpenPanelResultListenerProxy::WebOpenPanelResultListenerProxy):
3272         (WebKit::WebOpenPanelResultListenerProxy::~WebOpenPanelResultListenerProxy):
3273         (WebKit::WebOpenPanelResultListenerProxy::chooseFiles):
3274         (WebKit::WebOpenPanelResultListenerProxy::cancel):
3275         (WebKit::WebOpenPanelResultListenerProxy::invalidate):
3276         * UIProcess/WebOpenPanelResultListenerProxy.h: Added.
3277         (WebKit::WebOpenPanelResultListenerProxy::create):
3278         (WebKit::WebOpenPanelResultListenerProxy::type):
3279         Adds the listener used to choose files for <input type=file>
3280
3281         * UIProcess/WebPageProxy.cpp:
3282         (WebKit::WebPageProxy::runOpenPanel):
3283         (WebKit::WebPageProxy::didChooseFilesForOpenPanel):
3284         (WebKit::WebPageProxy::didCancelForOpenPanel):
3285         * UIProcess/WebPageProxy.h:
3286         * UIProcess/WebPageProxy.messages.in:
3287         * UIProcess/WebUIClient.cpp:
3288         (WebKit::WebUIClient::runOpenPanel):
3289         * UIProcess/WebUIClient.h:
3290         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3291         (WebKit::WebChromeClient::runOpenPanel):
3292         * WebProcess/WebPage/WebOpenPanelResultListener.cpp: Added.
3293         (WebKit::WebOpenPanelResultListener::create):
3294         (WebKit::WebOpenPanelResultListener::WebOpenPanelResultListener):
3295         (WebKit::WebOpenPanelResultListener::~WebOpenPanelResultListener):
3296         (WebKit::WebOpenPanelResultListener::didChooseFiles):
3297         * WebProcess/WebPage/WebOpenPanelResultListener.h: Added.
3298         (WebKit::WebOpenPanelResultListener::disconnectFromPage):
3299         * WebProcess/WebPage/WebPage.cpp:
3300         (WebKit::WebPage::close):
3301         (WebKit::WebPage::setActiveOpenPanelResultListener):
3302         (WebKit::WebPage::didChooseFilesForOpenPanel):
3303         (WebKit::WebPage::didCancelForOpenPanel):
3304         * WebProcess/WebPage/WebPage.h:
3305         (WebKit::WebPage::activeOpenPanelResultListener):
3306         * WebProcess/WebPage/WebPage.messages.in:
3307         Pipe through file choosing.
3308
3309         * WebKit2.pro:
3310         * WebKit2.xcodeproj/project.pbxproj:
3311         * win/WebKit2.vcproj:
3312         * win/WebKit2Generated.make:
3313         Add new files.
3314
3315 2010-12-15  Anders Carlsson  <andersca@apple.com>
3316
3317         Reviewed by Maciej Stachowiak.
3318
3319         Semi-reproducible crash in ChunkedUpdateDrawingArea::paintIntoUpdateChunk closing a particular yahoo page
3320         https://bugs.webkit.org/show_bug.cgi?id=51126
3321         <rdar://problem/8771219>
3322
3323         Laying out the web page can cause the drawing area to change so we need to protect against this.
3324
3325         * WebProcess/WebPage/ChunkedUpdateDrawingArea.cpp:
3326         (WebKit::ChunkedUpdateDrawingArea::display):
3327         * WebProcess/WebPage/LayerBackedDrawingArea.cpp:
3328         (WebKit::LayerBackedDrawingArea::display):
3329         * WebProcess/WebPage/mac/LayerBackedDrawingAreaMac.mm:
3330         (WebKit::LayerBackedDrawingArea::updateLayoutRunLoopObserverFired):
3331
3332 2010-12-15  Brian Weinstein  <bweinstein@apple.com>
3333
3334         Reviewed by Adam Roben.
3335
3336         WebKit2: WebPageWin needs implementations of hasLocalDataForURL and canHandleRequest
3337         https://bugs.webkit.org/show_bug.cgi?id=51090
3338         
3339         Implement these functions for WebKit2 on Windows.
3340
3341         * WebProcess/WebPage/WebPage.cpp:
3342         (WebKit::WebPage::hasLocalDataForURL): Does the cross-platform part of the check for having local
3343             data (file URL or subresource), then calls platformHasLocalDataForURL to let the platform do
3344             their specific checks.
3345         * WebProcess/WebPage/WebPage.h:
3346         * WebProcess/WebPage/mac/WebPageMac.mm:
3347         (WebKit::WebPage::platformHasLocalDataForURL): Moved the cross-platform code from here to WebPage::hasLocalDataForURL.
3348         * WebProcess/WebPage/qt/WebPageQt.cpp:
3349         (WebKit::WebPage::platformHasLocalDataForURL): Renamed from hasLocalDataForURL.
3350         * WebProcess/WebPage/win/WebPageWin.cpp:
3351         (WebKit::WebPage::platformHasLocalDataForURL): Renamed from hasLocalDataForURL and implemented with CFNetwork calls. This is the
3352             CFNetwork equivalent of the code in WebPageMac::platformHasLocalDataForURL.
3353         (WebKit::WebPage::canHandleRequest): Copied the line of code from WebView::canHandleRequest in WebKit1, with a FIXME saying
3354             this might not be enough (although it was in WebKit1 on Windows).
3355
3356 2010-12-15  Sheriff Bot  <webkit.review.bot@gmail.com>
3357
3358         Unreviewed, rolling out r74117.
3359         http://trac.webkit.org/changeset/74117
3360         https://bugs.webkit.org/show_bug.cgi?id=51113
3361
3362         This broke the GTK1 build. (Requested by mrobinson on
3363         #webkit).
3364
3365         * GNUmakefile.am: Removed.
3366         * Scripts/generate-forwarding-headers.pl:
3367         * WebKit2Prefix.h:
3368         * gtk/webkit2.pc.in: Removed.
3369
3370 2010-12-15  Amruth Raj  <amruthraj@motorola.com> and Ravi Kasibhatla  <ravi.kasibhatla@motorola.com>
3371
3372         Reviewed by Martin Robinson.
3373
3374         Changes to enable building WebKit2 for Gtk port.
3375         (https://bugs.webkit.org/show_bug.cgi?id=37369)
3376
3377         * GNUmakefile.am: Added. 
3378         * Scripts/generate-forwarding-headers.pl: For GTK port, taking 1 extra argument for copying network headers.
3379         * WebKit2Prefix.h: Included WebCore/config.h for GTK port as the first header file for WebKit2 sources files.
3380         * gtk: Added.
3381         * gtk/webkit2.pc.in: Added.
3382
3383 2010-12-15  Jan Erik Hanssen  <jhanssen@sencha.com>
3384
3385         Reviewed by Andreas Kling.
3386
3387         [Qt][WK2] webkit2 does not compile on OS X
3388         https://bugs.webkit.org/show_bug.cgi?id=50128
3389
3390         prctl(2) is only available on Linux, so use an atexit handler for killing
3391         all the child processes when the process is exiting.
3392
3393         * UIProcess/Launcher/qt/ProcessLauncherQt.cpp:
3394         (WebKit::cleanupProcesses):
3395         (WebKit::QtWebProcess::QtWebProcess):
3396         (WebKit::QtWebProcess::processStateChanged):
3397         (WebKit::ProcessLauncherHelper::instance):
3398
3399 2010-12-14  Anders Carlsson  <andersca@apple.com>
3400
3401         Fix Windows build.
3402
3403         * win/WebKit2Common.vsprops:
3404
3405 2010-12-14  Anders Carlsson  <andersca@apple.com>
3406
3407         Fix Qt build.
3408
3409         * WebKit2.pro:
3410
3411 2010-12-14  Anders Carlsson  <andersca@apple.com>
3412
3413         Reviewed by TYPO FIX.
3414
3415         Fix a typo.
3416
3417         * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
3418         (WebKit::NetscapePluginModule::determineQuirks):
3419
3420 2010-12-14  Anders Carlsson  <andersca@apple.com>
3421
3422         Reviewed by Sam Weinig.
3423
3424         Cannot type into plugin edit field
3425         https://bugs.webkit.org/show_bug.cgi?id=51074
3426         <rdar://problem/8483741>
3427
3428         Add a PrognameShouldBeWebKitPluginHost quirk, since it turns out Flash Player calls getprogname() and checks
3429         if the return value is "WebKitPluginHost" in order to determine when to handle NPCocoaEventKeyDown events.
3430
3431         * PluginProcess/PluginProcess.cpp:
3432         (WebKit::PluginProcess::netscapePluginModule):
3433         If the plug-in module has the PrognameShouldBeWebKitPluginHost quirk, call setprogname("WebKitPluginHost").
3434         
3435         * Shared/Plugins/Netscape/NetscapePluginModule.cpp:
3436         (WebKit::NetscapePluginModule::load):
3437         Call determineQuirks()
3438
3439         * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
3440         (WebKit::NetscapePluginModule::determineQuirks):
3441         Add the PrognameShouldBeWebKitPluginHost quirk for Flash.
3442         
3443         * Shared/Plugins/Netscape/win/NetscapePluginModuleWin.cpp:
3444         (WebKit::NetscapePluginModule::determineQuirks):
3445         * Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp:
3446         (WebKit::NetscapePluginModule::determineQuirks):
3447         Add stubs.
3448
3449         * Shared/Plugins/PluginQuirks.h:
3450         Add new PluginQuirks file.
3451
3452         * WebKit2.xcodeproj/project.pbxproj:
3453         Add PluginQuirks.h
3454
3455 2010-12-14  Anders Carlsson  <andersca@apple.com>
3456
3457         Reviewed by Sam Weinig.
3458
3459         Add a NetscapePluginModuleX11 and move the Qt implementation of PluginInfoStore::getPluginInfo there
3460         https://bugs.webkit.org/show_bug.cgi?id=51066
3461
3462         * Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp: Copied from WebKit2/UIProcess/Plugins/qt/PluginInfoStoreQt.cpp.
3463         (WebKit::NetscapePluginModule::getPluginInfo):
3464         * UIProcess/Plugins/qt/PluginInfoStoreQt.cpp:
3465         (WebKit::PluginInfoStore::getPluginInfo):
3466         * WebKit2.pro:
3467
3468 2010-12-14  Anders Carlsson  <andersca@apple.com>
3469
3470         Reviewed by Dan Bernstein.
3471
3472         Move Windows version of getPluginInfo to NetscapePluginModule
3473         https://bugs.webkit.org/show_bug.cgi?id=51073
3474
3475         * Shared/Plugins/Netscape/win/NetscapePluginModuleWin.cpp: Added.
3476         (WebKit::getVersionInfo):
3477         (WebKit::fileVersion):
3478         (WebKit::NetscapePluginModule::getPluginInfo):
3479         * UIProcess/Plugins/win/PluginInfoStoreWin.cpp:
3480         (WebKit::PluginInfoStore::getPluginInfo):
3481         * win/WebKit2.vcproj:
3482
3483 2010-12-14  Alice Liu  <alice.liu@apple.com>
3484
3485         Fix clang++ build.
3486
3487         * UIProcess/WebProcessProxy.h:
3488         (WebKit::WebProcessProxy::sendSync):
3489         Move the default argument to the declaration.
3490
3491 2010-12-14  Anders Carlsson  <andersca@apple.com>
3492
3493         Reviewed by Adam Roben.
3494
3495         Move PluginInfoStore::getPluginInfo to NetscapePluginModule
3496         https://bugs.webkit.org/show_bug.cgi?id=51058
3497
3498         * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
3499         Move implementation of PluginInfoStore::getPluginInfo and related
3500         helper functions here.
3501
3502         * UIProcess/Plugins/mac/PluginInfoStoreMac.mm:
3503         (WebKit::PluginInfoStore::getPluginInfo):
3504         Just call NetscapePluginModule::getPluginInfo here for now.
3505
3506         * WebKit2.xcodeproj/project.pbxproj:
3507         Add NetscapePluginModuleMac.mm.
3508
3509 2010-12-14  Anders Carlsson  <andersca@apple.com>
3510
3511         Reviewed by John Sullivan.
3512
3513         Switch name and description order when fetching Carbon plug-in info
3514         https://bugs.webkit.org/show_bug.cgi?id=46211
3515
3516         The plug-in description comes before the name in the Carbon string list resource.
3517
3518         * UIProcess/Plugins/mac/PluginInfoStoreMac.mm:
3519         (WebKit::getPluginInfoFromCarbonResources):
3520
3521 2010-12-14  Anders Carlsson  <andersca@apple.com>
3522
3523         Reviewed by Adam Roben.
3524
3525         Move NetscapePluginModule.{cpp|h} to Shared/Plugins/Netscape
3526         https://bugs.webkit.org/show_bug.cgi?id=51052
3527
3528         * Shared/Plugins/Netscape/NetscapePluginModule.cpp: Renamed from WebKit2/WebProcess/Plugins/Netscape/NetscapePluginModule.cpp.
3529         * Shared/Plugins/Netscape/NetscapePluginModule.h: Renamed from WebKit2/WebProcess/Plugins/Netscape/NetscapePluginModule.h.
3530         * WebKit2.pro:
3531         * WebKit2.xcodeproj/project.pbxproj:
3532         * win/WebKit2.vcproj:
3533         * win/WebKit2Common.vsprops:
3534
3535 2010-12-14  Anders Carlsson  <andersca@apple.com>
3536
3537         Reviewed by Sam Weinig.
3538
3539         Handle complex text input for plug-ins
3540         https://bugs.webkit.org/show_bug.cgi?id=51047
3541
3542         * PluginProcess/PluginControllerProxy.cpp:
3543         (WebKit::PluginControllerProxy::sendComplexTextInput):
3544         Pass along the text input to the plug-in.
3545
3546         * PluginProcess/PluginControllerProxy.messages.in:
3547         Add SendComplexTextInput message.
3548
3549         * UIProcess/API/mac/WKTextInputWindowController.h: Added.
3550         * UIProcess/API/mac/WKTextInputWindowController.mm: Added.
3551         Add text input window controller, mostly copied from WebKit1.
3552         
3553         * UIProcess/API/mac/WKView.mm:
3554         (-[WKView keyDown:]):
3555         If needed, pass along the event to the text input window controller.
3556
3557         (-[WKView inputContext]):
3558         Return the input context of the text input window controller.
3559
3560         (-[WKView _setComplexTextInputEnabled:pluginComplexTextInputIdentifier:]):
3561         Notify the input window controller that the input source changed.
3562
3563         * UIProcess/WebPageProxy.cpp:
3564         (WebKit::WebPageProxy::sendComplexTextInputToPlugin):
3565         Send the complex text input to the web process.
3566
3567         * WebKit2.xcodeproj/project.pbxproj:
3568         Add new files.
3569
3570         * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
3571         (WebKit::convertStringToKeyCodes):
3572         Convert a string to a vector of key codes in the current encoding.
3573
3574         (WebKit::NetscapePlugin::sendComplexTextInput):
3575         In the Cocoa event model, create and dispatch an NPCocoaEventTextInput event.
3576         In the Carbon event model, convert the string to individual key codes and send them
3577         as key down events.
3578
3579         * WebProcess/Plugins/PluginProxy.cpp:
3580         (WebKit::PluginProxy::sendComplexTextInput):
3581         Send the text to the plug-in controller proxy.
3582
3583         * WebProcess/Plugins/PluginView.cpp:
3584         (WebKit::PluginView::sendComplexTextInput):
3585         If the plug-in has a matching text input identifier, call Plugin::sendComplexTextInput.
3586
3587         * WebProcess/WebPage/WebPage.messages.in:
3588         Add SendComplexTextInputToPlugin message.
3589
3590         * WebProcess/WebPage/mac/WebPageMac.mm:
3591         (WebKit::WebPage::sendComplexTextInputToPlugin):
3592         Iterate over all known plug-in views and try to find one to send the text input to.
3593
3594 2010-12-13  Alexey Proskuryakov  <ap@apple.com>
3595
3596         Reviewed by Adam Barth.
3597
3598         https://bugs.webkit.org/show_bug.cgi?id=50953
3599         DNS Prefetch should be an opt-in feature
3600
3601         Pass the preference through WebKit2.
3602
3603         * Shared/WebPreferencesStore.h:
3604         * UIProcess/API/C/WKPreferences.cpp:
3605         (WKPreferencesSetDNSPrefetchingEnabled):
3606         (WKPreferencesGetDNSPrefetchingEnabled):
3607         * UIProcess/API/C/WKPreferences.h:
3608         * WebProcess/WebPage/WebPage.cpp:
3609         (WebKit::WebPage::updatePreferences):
3610
3611 2010-12-13  Anders Carlsson  <andersca@apple.com>
3612
3613         Reviewed by Kevin Decker.
3614
3615         Pass the complex text input status to the WKView
3616         https://bugs.webkit.org/show_bug.cgi?id=50993
3617
3618         * UIProcess/API/mac/PageClientImpl.h:
3619         * UIProcess/API/mac/PageClientImpl.mm:
3620         (WebKit::PageClientImpl::setComplexTextInputEnabled):
3621         * UIProcess/API/mac/WKView.mm:
3622         (-[WKView _setComplexTextInputEnabled:pluginComplexTextInputIdentifier:]):
3623         * UIProcess/API/mac/WKViewInternal.h:
3624         * UIProcess/PageClient.h:
3625         * UIProcess/WebPageProxy.cpp:
3626         (WebKit::WebPageProxy::setComplexTextInputEnabled):
3627
3628 2010-12-14  Benjamin Poulain  <benjamin.poulain@nokia.com>
3629
3630         Reviewed by Kenneth Rohde Christiansen.
3631
3632         WebKit 2 does not send touch cancel events correctly between processes
3633         https://bugs.webkit.org/show_bug.cgi?id=50235
3634
3635         The classes WebKit2PlatformTouchPoint and WebKit2PlatformTouchEvent
3636         misses the conversion of TouchCancel events and points.
3637
3638         This patch add the missing enums when converting from a WebTouchEvent
3639         to a PlatformTouchEvent.
3640
3641         Testing is already covered by fast/events/touch/send-oncancel-event.html
3642
3643         * Shared/WebEventConversion.cpp:
3644         (WebKit::WebKit2PlatformTouchPoint::WebKit2PlatformTouchPoint):
3645         (WebKit::WebKit2PlatformTouchEvent::WebKit2PlatformTouchEvent):
3646
3647 2010-12-14  Zalan Bujtas  <zbujtas@gmail.com>
3648
3649         Reviewed by Kenneth Rohde Christiansen.
3650
3651         Add loadFinished() for provisional load error
3652         This fixes the hanging UI state, when provisional load error occurs due to
3653         the async nature of policy check.
3654
3655         https://bugs.webkit.org/show_bug.cgi?id=48724
3656
3657         * UIProcess/API/qt/ClientImpl.cpp:
3658         (loadFinished):
3659         (qt_wk_didFailProvisionalLoadWithErrorForFrame):
3660         (qt_wk_didFinishLoadForFrame):
3661         (qt_wk_didFailLoadWithErrorForFrame):
3662
3663 2010-12-13  Sam Weinig  <sam@webkit.org>
3664
3665         Reviewed by Anders Carlsson.
3666
3667         WebKit2: Need to be able to set the application name for the user agent for a WKPage
3668         https://bugs.webkit.org/show_bug.cgi?id=51011
3669
3670         Fixes:
3671             WebKit2: Need to be able to set the application name for the user agent for a WKPage
3672             <rdar://problem/8564532>
3673             WebKit2: Need to be able to get the computed user agent for a WKPage
3674             <rdar://problem/8637285>
3675
3676         Moves user agent computation to the UIProcess and just passes it to the WebProcess
3677         when it has changed.
3678
3679         * Shared/WebPageCreationParameters.cpp:
3680         (WebKit::WebPageCreationParameters::encode):
3681         (WebKit::WebPageCreationParameters::decode):
3682         * Shared/WebPageCreationParameters.h:
3683         Add a user agent to the creation parameters.
3684
3685         * UIProcess/API/C/WKPage.cpp:
3686         (WKPageCopyUserAgent):
3687         (WKPageCopyApplicationNameForUserAgent):
3688         (WKPageSetApplicationNameForUserAgent):
3689         (WKPageSetCustomUserAgent):
3690         * UIProcess/API/C/WKPage.h:
3691         Add new API to set the application name and access the computed user agent.
3692
3693         * UIProcess/WebPageProxy.cpp:
3694         (WebKit::WebPageProxy::WebPageProxy):
3695         (WebKit::WebPageProxy::close):
3696         (WebKit::WebPageProxy::setUserAgent):
3697         (WebKit::WebPageProxy::setApplicationNameForUserAgent):
3698         (WebKit::WebPageProxy::setCustomUserAgent):
3699         (WebKit::WebPageProxy::proce