486984cc5507ee73e44eb53d4759914de0f4b691
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2011-03-08  John Sullivan  <sullivan@apple.com>
2
3         Reviewed by Darin Adler.
4
5         https://bugs.webkit.org/show_bug.cgi?id=55940
6         WebKit2 should support Ignore policy from injected bundle client
7
8         * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
9         Added WKBundlePagePolicyActionIgnore.
10         
11         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
12         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
13         If the injected bundle client returns WKBundlePagePolicyActionIgnore, convert it
14         to the loader's PolicyIgnore.
15
16 2011-03-08  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
17
18         Reviewed by Kenneth Rohde Christiansen.
19
20         [Qt] [Symbian] [WK2] Fix building WebKit 2 API tests
21         https://bugs.webkit.org/show_bug.cgi?id=55876
22
23         Make sure TESTS_SOURCE_DIR is set for Symbian the same way
24         as it is for WK1.
25
26         * UIProcess/API/qt/tests/qgraphicswkview/tst_qgraphicswkview.cpp:
27         (tst_QGraphicsWKView::loadEmptyPage):
28         * UIProcess/API/qt/tests/tests.pri:
29
30 2011-03-07  Damian Kaleta  <dkaleta@apple.com>
31
32         Reviewed by Anders Carlsson.
33
34         QuickTime plugin should opt in to a 32-bit non-executable heap
35         https://bugs.webkit.org/show_bug.cgi?id=55704
36         <rdar://problem/8105706>
37
38         * UIProcess/Plugins/PluginProcessProxy.cpp:
39         (WebKit::pluginNeedsExecutableHeap): Decides per plugin if it should opt-in to a 32-bit non-executable heap.
40         By default it should opt-out.
41         (WebKit::PluginProcessProxy::PluginProcessProxy):
42
43 2011-03-07  Sam Weinig  <sam@webkit.org>
44
45         Reviewed by Anders Carlsson.
46
47         Add unableToImplementPolicy callback for WebKit2 policy client
48         <rdar://problem/9071902>
49         https://bugs.webkit.org/show_bug.cgi?id=55884
50
51         * UIProcess/API/C/WKPage.h:
52         * UIProcess/WebPageProxy.cpp:
53         (WebKit::WebPageProxy::unableToImplementPolicy):
54         * UIProcess/WebPageProxy.h:
55         * UIProcess/WebPageProxy.messages.in:
56         * UIProcess/WebPolicyClient.cpp:
57         (WebKit::WebPolicyClient::unableToImplementPolicy):
58         * UIProcess/WebPolicyClient.h:
59         * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
60         * WebProcess/InjectedBundle/InjectedBundlePagePolicyClient.cpp:
61         (WebKit::InjectedBundlePagePolicyClient::unableToImplementPolicy):
62         * WebProcess/InjectedBundle/InjectedBundlePagePolicyClient.h:
63         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
64         (WebKit::WebFrameLoaderClient::dispatchUnableToImplementPolicy):
65         Pipe unableToImplementPolicy through both the bundle and the main WebKit2 API.
66
67 2011-03-07  Sam Weinig  <sam@webkit.org>
68
69         Reviewed by Anders Carlsson.
70
71         Replace WebKit2's decidePolicyForMIMEType with decidePolicyForResponse
72         https://bugs.webkit.org/show_bug.cgi?id=55827
73
74         - Renamed FrameLoaderClient::dispatchDecidePolicyForMIMEType to dispatchDecidePolicyForResponse
75           and pass the entire response, instead of just the MIMEType.
76         - Updated both UIProcess API and bundle API to also be based on the whole response, not just the
77           MIMEType.
78
79         * UIProcess/API/C/WKPage.h:
80         * UIProcess/WebPageProxy.cpp:
81         (WebKit::WebPageProxy::decidePolicyForResponse):
82         * UIProcess/WebPageProxy.h:
83         * UIProcess/WebPageProxy.messages.in:
84         * UIProcess/WebPolicyClient.cpp:
85         (WebKit::WebPolicyClient::decidePolicyForResponse):
86         * UIProcess/WebPolicyClient.h:
87         * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
88         * WebProcess/InjectedBundle/InjectedBundlePagePolicyClient.cpp:
89         (WebKit::InjectedBundlePagePolicyClient::decidePolicyForResponse):
90         * WebProcess/InjectedBundle/InjectedBundlePagePolicyClient.h:
91         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
92         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
93         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
94
95 2011-03-06  Jessie Berlin  <jberlin@apple.com>
96
97         Reviewed by Sam Weinig.
98
99         WebKit2: Use CFNetwork Sessions API.
100         https://bugs.webkit.org/show_bug.cgi?id=55435.
101
102         When Private Browsing is enabled, use cookies from a in-memory cookie storage based on the
103         Private Browsing Storage Session.
104
105         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
106         (InitWebCoreSystemInterface):
107         Add support for using the new WKSI functions in WebCore.
108
109 2011-03-06  Oleg Romashin  <romaxa@gmail.com>
110
111         Reviewed by Kenneth Rohde Christiansen.
112
113         [Qt][WK2] Make Qt port compiling with ENABLE_PLUGIN_PROCESS=1, part1
114         Adding dummy Qt files for Plugin Process implementation,
115         Adding missing sources into Qt pro files
116         https://bugs.webkit.org/show_bug.cgi?id=55719
117
118         * DerivedSources.pro:
119         * PluginProcess/qt: Added.
120         * PluginProcess/qt/PluginControllerProxyQt.cpp: Added.
121         (WebKit::PluginControllerProxy::platformInitialize):
122         (WebKit::PluginControllerProxy::platformDestroy):
123         (WebKit::PluginControllerProxy::platformGeometryDidChange):
124         * PluginProcess/qt/PluginProcessMainQt.cpp: Added.
125         (WebKit::PluginProcessMain):
126         * PluginProcess/qt/PluginProcessQt.cpp: Added.
127         (WebKit::PluginProcess::platformInitialize):
128         * UIProcess/Plugins/qt/PluginProcessProxyQt.cpp: Added.
129         (WebKit::PluginProcessProxy::platformInitializePluginProcess):
130         * WebKit2.pri:
131         * WebKit2.pro:
132         * WebKit2API.pri:
133         * WebProcess/Plugins/Netscape/qt/PluginProxyQt.cpp: Added.
134         (WebKit::PluginProxy::needsBackingStore):
135
136 2011-03-05  Sam Weinig  <sam@webkit.org>
137
138         Reviewed by Dan Bernstein.
139
140         Remove unneeded onPageClose function from DrawingArea
141         https://bugs.webkit.org/show_bug.cgi?id=55836
142
143         * WebProcess/WebPage/DrawingArea.h:
144         Remove empty function.
145
146         * WebProcess/WebPage/WebPage.cpp:
147         (WebKit::WebPage::close):
148         Remove only called
149
150 2011-03-04  Jon Honeycutt  <jhoneycutt@apple.com>
151
152         WK2 Mac build fix.
153
154         * UIProcess/API/C/WKPage.cpp:
155         (WKPageComputePagesForPrinting):
156         (WKPageBeginPrinting):
157
158         * UIProcess/API/C/WKPagePrivate.h:
159
160 2011-03-04  Jon Honeycutt  <jhoneycutt@apple.com>
161
162         WK2 Mac build fix.
163
164         * UIProcess/API/C/WKPagePrivate.h:
165
166 2011-03-04  Jon Honeycutt  <jhoneycutt@apple.com>
167
168         WK2 needs printing support on Windows
169         https://bugs.webkit.org/show_bug.cgi?id=55800
170         <rdar://problem/8903808>
171
172         Reviewed by Darin Adler.
173
174         * UIProcess/API/C/WKPage.cpp:
175         (ComputedPagesContext::ComputedPagesContext):
176         (computedPagesCallback):
177         From the Vector of WebCore::IntRects, build up a Vector of WKRects.
178         Call the callback, passing these rects and the scale factor.
179         (printInfoFromWKPrintInfo):
180         Return a PrintInfo structure from the WKPrintInfo.
181         (WKPageComputePagesForPrinting):
182         Call WebPageProxy::computePagesForPrinting(). Pass
183         computedPagesCallback as the callback function, so that we can
184         translate the WebCore rect type to WKRect before calling the caller's
185         callback function.
186         (WKPageBeginPrinting):
187         Call WebPageProxy::beginPrinting().
188         (WKPageDrawPagesToPDF):
189         Call WebPageProxy::drawPagesToPDF().
190
191         * UIProcess/API/C/WKPagePrivate.h:
192         Declare the WKPrintInfo type and new functions.
193
194         * UIProcess/WebPageProxy.cpp:
195         Compile this code on Windows.
196
197         * UIProcess/WebPageProxy.h:
198         Ditto.
199
200         * UIProcess/win/WebView.cpp:
201         (WebKit::WebView::paint):
202         We're painting the window; leave printing mode.
203
204         * WebProcess/WebPage/WebPage.cpp:
205         Compile this code on Windows.
206
207         * WebProcess/WebPage/WebPage.h:
208         Ditto.
209
210         * WebProcess/WebPage/WebPage.messages.in:
211         Ditto.
212
213 2011-03-04  Steve Falkenburg  <sfalken@apple.com>
214
215         Reviewed by Darin Adler.
216
217         Adopt VersionStamper tool for Windows WebKit DLLs
218         https://bugs.webkit.org/show_bug.cgi?id=55784
219         <rdar://problem/9021320>
220
221         We now use a tool to stamp the version number onto the Apple WebKit DLLs
222         during the post-build step.
223
224         Fetch the WebKit version from a string resource instead of the version resource.
225
226         * UIProcess/win/WebPageProxyWin.cpp:
227         (WebKit::userVisibleWebKitVersionString): Fetch version from a string resource.
228         * win/WebKit2.rc: Removed version, added stringtable.
229         * win/WebKit2WebProcess.rc: Removed.
230         * win/WebKit2WebProcess.vcproj:
231         * win/WebKit2WebProcessPostBuild.cmd: Don't run autoversion script. It isn't used in this project.
232         * win/WebKit2WebProcessPreBuild.cmd: Stamp version.
233         * win/WebKitPostBuild.cmd: Stamp version.
234
235 2011-03-04  Jeff Miller  <jeffm@apple.com>
236
237         Reviewed by Darin Adler.
238
239         Add WKPageValidateCommand()
240         https://bugs.webkit.org/show_bug.cgi?id=55793
241         
242         On the Mac, validation of edit menu commands is handled within WebKit2 in WKView.mm.
243         However, on Windows we need to do this in the client, so expose this functionality
244         in the API via WKPageValidateCommand().
245         
246         Change the Mac implementation to call WebPageProxy::validateCommand() with a callback
247         to match this new API, so it no longer has to go through PageClient to get notified
248         when a command is validated.  This makes PageClient::setEditCommandState() obsolete,
249         so I removed the stub implementations in qt and gtk as well.
250
251         * UIProcess/API/C/WKPage.cpp:
252         (WKPageValidateCommand): Added.
253         * UIProcess/API/C/WKPage.h: Added WKPageValidateCommand().
254         * UIProcess/API/mac/PageClientImpl.h: Removed setEditCommandState().
255         * UIProcess/API/mac/PageClientImpl.mm: Removed setEditCommandState().
256         * UIProcess/API/mac/WKView.mm:
257         (validateCommandCallback): Added.
258         (-[WKView validateUserInterfaceItem:]): Pass callback to validateCommand().
259         * UIProcess/API/qt/qwkpage.cpp: Removed setEditCommandState().
260         * UIProcess/API/qt/qwkpage_p.h: Removed setEditCommandState().
261         * UIProcess/PageClient.h: Removed setEditCommandState().
262         * UIProcess/WebPageProxy.cpp: Removed didValidateCommand().
263         (WebKit::WebPageProxy::validateCommand): This now takes a callback.
264         (WebKit::WebPageProxy::validateCommandCallback): Added.
265         (WebKit::WebPageProxy::processDidCrash): Invalidate m_validateCommandCallbacks.
266         * UIProcess/WebPageProxy.h: Removed didValidateCommand(), validateCommand() now takes a callback.
267         (WebKit::ValidateCommandCallback::create): Added.
268         (WebKit::ValidateCommandCallback::~ValidateCommandCallback): Added.
269         (WebKit::ValidateCommandCallback::performCallbackWithReturnValue): Added.
270         (WebKit::ValidateCommandCallback::invalidate): Added.
271         (WebKit::ValidateCommandCallback::ValidateCommandCallback): Added.
272         * UIProcess/WebPageProxy.messages.in: Removed DidValidateCommand, added ValidateCommandCallback.
273         * UIProcess/gtk/WebView.cpp: Removed setEditCommandState().
274         * UIProcess/gtk/WebView.h: Removed setEditCommandState().
275         * UIProcess/win/WebView.cpp: Removed setEditCommandState().
276         * UIProcess/win/WebView.h: Removed setEditCommandState().
277         * WebProcess/WebPage/WebPage.cpp:
278         (WebKit::WebPage::validateCommand): This now takes a callbackID.
279         * WebProcess/WebPage/WebPage.h: validateCommand now takes a callbackID.
280         * WebProcess/WebPage/WebPage.messages.in: ValidateCommand now takes a callbackID.
281
282 2011-03-04  Brian Weinstein  <bweinstein@apple.com>
283
284         Reviewed by Darin Adler.
285
286         Reference-counting for WKBundlePageResourceLoadClient::willSendRequestForFrame seems unclear/wrong
287         https://bugs.webkit.org/show_bug.cgi?id=53919
288         <rdar://problem/8966020>
289         
290         Adopt the result of m_client.willSendRequestForFrame (which will be leaked by the client).
291
292         * WebProcess/InjectedBundle/InjectedBundlePageResourceLoadClient.cpp:
293         (WebKit::InjectedBundlePageResourceLoadClient::willSendRequestForFrame):
294
295 2011-03-04  Darin Adler  <darin@apple.com>
296
297         Reviewed by Mark Rowe.
298
299         WebKit2 session state should include even loads too new to be in the back/forward list
300         https://bugs.webkit.org/show_bug.cgi?id=55781
301         part of <rdar://problem/8968847>
302
303         * UIProcess/cf/WebPageProxyCF.cpp:
304         (WebKit::WebPageProxy::sessionStateData): Save URLs that are early enough in the loading
305         process to not be included in the back/forward list yet: The pending API request URL and
306         the provisional URL.
307         (WebKit::WebPageProxy::restoreFromSessionStateData): Call loadURL if the back/forward
308         list is not restored and a URL is present. Later we can improve the way we handle the
309         case where we have both a back/forward list and a URL.
310
311 2011-03-04  Jessie Berlin  <jberlin@apple.com>
312
313         Reviewed by Darin Adler.
314
315         WebKit2: Use CFNetwork Sessions API.
316         https://bugs.webkit.org/show_bug.cgi?id=55435.
317
318         Add in the CFURLSTORAGESESSIONS guards that I incorrectly left out because the code was
319         contained within guards that made USE(CFURLSTORAGESESSIONS) always be true.
320
321         * UIProcess/mac/WebContextMac.mm:
322         (WebKit::WebContext::platformInitializeWebProcess):
323         * UIProcess/win/WebContextWin.cpp:
324         (WebKit::WebContext::platformInitializeWebProcess):
325
326 2011-03-04  Jessie Berlin  <jberlin@apple.com>
327
328         Reviewed by Maciej Stachowiak.
329
330         WebKit2: Use CFNetwork Sessions API.
331         https://bugs.webkit.org/show_bug.cgi?id=55435.
332
333         When Private Browsing is enabled, get the cached url response from the cache associated with
334         the Private Browsing Storage Session.
335
336         * WebProcess/WebPage/mac/WebPageMac.mm:
337         (WebKit::WebPage::platformHasLocalDataForURL):
338         If Private Browsing is enabled, call into WKSI to get the response.
339         (WebKit::WebPage::cachedResponseMIMETypeForURL):
340         Ditto.
341         * WebProcess/WebPage/win/WebPageWin.cpp:
342         (WebKit::WebPage::platformHasLocalDataForURL):
343         If Private Browsing is enabled, call into WKSI to get the CFURLCacheRef.
344         (WebKit::WebPage::cachedResponseMIMETypeForURL):
345         Ditto.
346
347 2011-03-04  Jeff Miller  <jeffm@apple.com>
348
349         Reviewed by Darin Adler.
350
351         Move WKViewExecuteCommand() to WKPageExecuteCommand()
352         https://bugs.webkit.org/show_bug.cgi?id=55744
353         
354         Executing a command operates on a page, so it makes more sense for it to be in WKPage.
355         This also makes it available on all platforms, not just Windows.
356
357         * UIProcess/API/C/WKPage.cpp:
358         (WKPageExecuteCommand): Added.
359         * UIProcess/API/C/WKPage.h: Add WKPageExecuteCommand().
360         * UIProcess/API/C/win/WKView.cpp: Remove WKViewExecuteCommand().
361         * UIProcess/API/C/win/WKView.h: Remove WKViewExecuteCommand().
362
363 2011-03-04  Dan Bernstein  <mitz@apple.com>
364
365         LLVM Compiler build fix.
366
367         * WebProcess/WebPage/WebPage.cpp:
368         (WebKit::WebPage::runJavaScriptInMainFrame):
369
370 2011-03-03  Timothy Hatcher  <timothy@apple.com>
371
372         Make the WKPageRunJavaScriptFunction callback take a WKSerializedScriptValueRef.
373
374         https://webkit.org/b/55623
375
376         Reviewed by Darin Adler.
377
378         * UIProcess/API/C/WKPage.cpp:
379         (WKPageRunJavaScriptInMainFrame): Use ScriptValueCallback.
380         (callRunJavaScriptBlockAndRelease): Use WKSerializedScriptValueRef.
381         * UIProcess/API/C/WKPage.h: Use WKSerializedScriptValueRef.
382         * UIProcess/WebPageProxy.cpp:
383         (WebKit::WebPageProxy::close): Call invalidateCallbackMap for m_scriptValueCallbacks.
384         (WebKit::WebPageProxy::runJavaScriptInMainFrame): Take a ScriptValueCallback.
385         (WebKit::WebPageProxy::scriptValueCallback): Added. Create a WebSerializedScriptValue
386         from the DataReference before calling the callback.
387         (WebKit::WebPageProxy::processDidCrash): Call invalidateCallbackMap for m_scriptValueCallbacks.
388         * UIProcess/WebPageProxy.h: Added ScriptValueCallback and m_scriptValueCallbacks.
389         * UIProcess/WebPageProxy.messages.in: Added ScriptValueCallback.
390         * WebProcess/WebPage/WebPage.cpp:
391         (WebKit::WebPage::runJavaScriptInMainFrame): Create a DataReference from a WebCore::SerializedScriptValue.
392         And use ScriptValueCallback to send the message back.
393
394 2011-03-03  Brian Weinstein  <bweinstein@apple.com>
395
396         Reviewed by Adam Roben.
397
398         Cleanup from https://bugs.webkit.org/show_bug.cgi?id=55427.
399         
400         Call WebCore::startObservingCookieChanges and WebCore::stopObservingCookieChanges
401         on all platforms, and stub the functions on platforms that don't implement them.
402
403         * WebProcess/Cookies/WebCookieManager.cpp:
404         (WebKit::WebCookieManager::startObservingCookieChanges):
405         (WebKit::WebCookieManager::stopObservingCookieChanges):
406
407 2011-03-03  Jeff Miller  <jeffm@apple.com>
408
409         Reviewed by Darin Adler.
410
411         Refactor classes in GenericCallback.h
412         https://bugs.webkit.org/show_bug.cgi?id=55732
413         
414         Since we're going to need to add additional callback classes, make a CallbackBase class that manages
415         the context and the callback ID.  The existing callback classes (VoidCallback, GenericCallback, and
416         ComputedPagesCallback) now all derive from CallbackBase.
417         
418         Fix bug in VoidCallback where we meant to implement the destructor, but we were implementing the default
419         constructor instead (we forgot the leading ~).
420  
421         * UIProcess/GenericCallback.h:
422         (WebKit::CallbackBase::~CallbackBase):
423         (WebKit::CallbackBase::callbackID):
424         (WebKit::CallbackBase::CallbackBase):
425         (WebKit::CallbackBase::context):
426         (WebKit::CallbackBase::generateCallbackID):
427         (WebKit::VoidCallback::~VoidCallback):
428         (WebKit::VoidCallback::performCallback):
429         (WebKit::VoidCallback::invalidate):
430         (WebKit::VoidCallback::VoidCallback):
431         (WebKit::GenericCallback::create):
432         (WebKit::GenericCallback::~GenericCallback):
433         (WebKit::GenericCallback::performCallbackWithReturnValue):
434         (WebKit::GenericCallback::invalidate):
435         (WebKit::GenericCallback::GenericCallback):
436         (WebKit::ComputedPagesCallback::create):
437         (WebKit::ComputedPagesCallback::~ComputedPagesCallback):
438         (WebKit::ComputedPagesCallback::performCallbackWithReturnValue):
439         (WebKit::ComputedPagesCallback::invalidate):
440         (WebKit::ComputedPagesCallback::ComputedPagesCallback):
441
442 2011-03-03  Adam Roben  <aroben@apple.com>
443
444         Don't assume the web process has had a chance to paint before the view has to paint
445
446         Fixes <http://webkit.org/b/55739> REGRESSION (r80307): Lots of tests crashing in
447         BackingStore::paint
448
449         Reviewed by Anders Carlsson.
450
451         * UIProcess/DrawingAreaProxyImpl.cpp:
452         (WebKit::DrawingAreaProxyImpl::paint): Bail if the web process hasn't had a chance to paint
453         yet.
454
455 2011-03-03  Adam Roben  <aroben@apple.com>
456
457         Throw away DrawingAreaProxyImpl's backing store after not painting for 5 seconds
458
459         The intent is to save memory for views that aren't painting.
460
461         Fixes <http://webkit.org/b/51262> <rdar://problem/8782537> WebPageProxy should delete its
462         backing store after not painting for a while
463
464         Reviewed by Anders Carlsson.
465
466         * UIProcess/DrawingAreaProxyImpl.cpp:
467         (WebKit::DrawingAreaProxyImpl::DrawingAreaProxyImpl): Initialize our timer.
468         (WebKit::DrawingAreaProxyImpl::paint): Don't bail if we don't have a backing store (but do
469         bail if we're in accelerated compositing mode); we might have thrown it away to save memory
470         but now are being asked to paint by the view. The existing code in this function will handle
471         getting a new backing store if possible by blocking for a little while to try to receive a
472         DidUpdateBackingStoreState message. Added an assertion that we do have a backing store if we
473         don't have any outstanding UpdateBackingStoreState requests. After painting, call
474         discardBackingStoreSoon to update our timer.
475         (WebKit::DrawingAreaProxyImpl::discardBackingStoreSoon): Set the timer for 5 seconds in the
476         future.
477         (WebKit::DrawingAreaProxyImpl::discardBackingStore): Throw away the backing store, and tell
478         the web process we'll need a full backing store update on the next paint.
479
480         * UIProcess/DrawingAreaProxyImpl.h: Added m_discardBackingStoreTimer.
481
482 2011-03-03  Adam Roben  <aroben@apple.com>
483
484         Add a way to tell the web process to perform a full backing store update on its next paint
485
486         Messages::DrawingArea::UpdateBackingStoreState now takes a boolean specifying whether the
487         full backing store update should happen immediately or should be deferred until the next
488         paint or compositing mode change occurs. The deferred update isn't used yet, but will be
489         used when we start throwing away backing stores to save memory.
490
491         Fixes <http://webkit.org/b/55730> UI process needs a way to tell the web process its backing
492         store needs a full update on the next paint
493
494         Reviewed by Anders Carlsson.
495
496         * UIProcess/DrawingAreaProxyImpl.cpp:
497         (WebKit::DrawingAreaProxyImpl::paint): If we have an outstanding backing store state change
498         request, tell the web process to perform the backing store update right away, in case we
499         previously told it it could defer the update.
500         (WebKit::DrawingAreaProxyImpl::sizeDidChange): Specify that we need an immediate backing
501         store update.
502         (WebKit::DrawingAreaProxyImpl::didUpdateBackingStoreState): We can no longer assert that we
503         were waiting for a DidUpdateBackingStoreState message when we receive one, as it's possible
504         for the web process to decide to send us this message on its own (if we asked it to do a
505         deferred backing store update and then it needed to paint some part of the page). Specify
506         that we need an immediate backing store update if the web process hasn't updated to our
507         latest state, as we're about to draw potentially out-of-date bits to the screen and want to
508         get the right bits as soon as possible. Also added a FIXME about a potential optimization.
509         (WebKit::DrawingAreaProxyImpl::backingStoreStateDidChange): Added a RespondImmediatelyOrNot
510         parameter, which is just passed through to sendUpdateBackingStoreState.
511         (WebKit::DrawingAreaProxyImpl::sendUpdateBackingStoreState): Added a RespondImmediatelyOrNot
512         parameter that is used to specify to the web process whether to perform the full backing
513         store update immediately. We now only wait for a DidUpdateBackingStoreState message (and
514         thus suppress any more UpdateBackingStoreState messages until one is received) when we ask
515         the web process for an immediate response; otherwise we could end up accidentally calling
516         waitForAndDispatchDidUpdateBackingStoreState when the web process hasn't been told to send
517         us such a message.
518
519         * UIProcess/DrawingAreaProxyImpl.h: Added RespondImmediatelyOrNot.
520
521         * WebProcess/WebPage/DrawingArea.h:
522         (WebKit::DrawingArea::updateBackingStoreState): Added respondImmediately argument.
523
524         * WebProcess/WebPage/DrawingArea.messages.in: Added respondImmediately argument to
525         UpdateBackingStoreState message.
526
527         * WebProcess/WebPage/DrawingAreaImpl.cpp:
528         (WebKit::DrawingAreaImpl::DrawingAreaImpl): Initialize new member that's used to track
529         whether we should send a DidUpdateBackingStoreState message instead of an Update or
530         compositing mode change message. This will be set to true when a deferred backing store
531         update is pending.
532         (WebKit::DrawingAreaImpl::layerHostDidFlushLayers): If a deferred update is pending, send a
533         DidUpdateBackingStoreState message instead of a compositing mode change message.
534         (WebKit::DrawingAreaImpl::updateBackingStoreState): Added respondImmediately argument. If
535         we've already been told about this state ID (as can happen when the UI process decides it
536         needs an immediate update to a state that it previously requested a deferred update to),
537         don't bother updating the page's size, etc. In addition, if we've already sent a
538         DidUpdateBackingStoreState message for this state, we don't have to do anything at all.
539         Moved code to send the DidUpdateBackingStoreState message from here...
540         (WebKit::DrawingAreaImpl::sendDidUpdateBackingStoreState): ...to here.
541         (WebKit::DrawingAreaImpl::exitAcceleratedCompositingMode): Always update our dirty region,
542         even if painting is suspended or we're in the process of updating the backing store state.
543         It causes no harm and simplifies the code. If a deferred update is pending, send a
544         DidUpdateBackingStoreState message instead of a compositing mode change message. Also
545         removed a redundant if.
546         (WebKit::DrawingAreaImpl::display): Added an assertion that this isn't called while updating
547         backing store state, as otherwise we might end up sending two DidUpdateBackingStoreState
548         messages. If a deferred update is pending, send a DidUpdateBackingStoreState message instead
549         of an Update message.
550
551         * WebProcess/WebPage/DrawingAreaImpl.h: Updated updateBackingStoreState to match the base
552         class. Added sendDidUpdateBackingStoreState and m_shouldSendDidUpdateBackingStoreState.
553
554 2011-03-03  Andy Estes  <aestes@apple.com>
555
556         Reviewed by Darin Adler.
557
558         When displaying the missing plug-in sheet, pass the 'pluginspage'
559         attribute to the UI process.
560         https://bugs.webkit.org/show_bug.cgi?id=55553
561
562         * UIProcess/API/C/WKPage.h: Add pluginsPageURL as the third argument to
563         missingPluginButtonClicked.
564         * UIProcess/WebPageProxy.cpp:
565         (WebKit::WebPageProxy::missingPluginButtonClicked): Ditto.
566         * UIProcess/WebPageProxy.h: Ditto.
567         * UIProcess/WebPageProxy.messages.in: Ditto.
568         * UIProcess/WebUIClient.cpp:
569         (WebKit::WebUIClient::missingPluginButtonClicked): Ditto.
570         * UIProcess/WebUIClient.h: Ditto.
571         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
572         (WebKit::WebChromeClient::missingPluginButtonClicked): Get the value of
573         pluginspageAttr.
574
575 2011-03-03  Alexey Proskuryakov  <ap@apple.com>
576
577         Suggested by Dan Bernstein.
578
579         Move "const" around "NSString *", so that it suddenly begins to make sense.
580
581         * WebProcess/mac/FullKeyboardAccessWatcher.mm:
582
583 2011-03-03  Jeff Miller  <jeffm@apple.com>
584
585         Reviewed by Anders Carlsson.
586
587         WebKit2: Add WKViewRef API for executing edit commands
588         https://bugs.webkit.org/show_bug.cgi?id=49829
589
590         Added WKViewExecuteCommand() and documented some of the WebCore EditorCommand strings.
591
592         * UIProcess/API/C/win/WKView.cpp:
593         (WKViewExecuteCommand): Added.
594         * UIProcess/API/C/win/WKView.h: Added WKViewExecuteCommand() and comment block with WebCore EditorCommand strings.
595
596 2011-03-03  Jessie Berlin  <jberlin@apple.com>
597
598         Reviewed by Adam Roben.
599
600         WebKit2: Use CFNetwork Sessions API.
601         https://bugs.webkit.org/show_bug.cgi?id=55435
602
603         Set the Private Browsing Storage Session on requests when Private Browsing is enabled.
604
605         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
606         (InitWebCoreSystemInterface):
607         Support using WKCopyRequestWithStorageSession in WebCore.
608
609 2011-03-03  Adam Roben  <aroben@apple.com>
610
611         Don't try to paint outside the page's bounds
612
613         When the page is resized smaller, we would allocate a ShareableBitmap at the old, larger
614         size, even though we only needed to paint at the new, smaller size.
615
616         The assertion added in this patch will fire during the WebKit2/ResizeViewWhileHidden API
617         test if this fix gets broken in the future.
618
619         Fixes <http://webkit.org/b/55715> DrawingAreaImpl allocates more memory than necessary when
620         the page is resized smaller
621
622         Reviewed by Anders Carlsson.
623
624         * WebProcess/WebPage/DrawingAreaImpl.cpp:
625         (WebKit::DrawingAreaImpl::updateBackingStoreState): Update our dirty region even if painting
626         is suspended (but still refrain from updating it when in accelerated compositing mode).
627         Rather than unite our existing dirty region with the page's new bounds, overwrite our dirty
628         region with the page's new bounds. This prevents us from accumulating a dirty region that is
629         larger than the page in the case where the page is being resized smaller.
630         (WebKit::DrawingAreaImpl::display): Added an assertion that we're not trying to paint
631         outside of the page's bounds.
632
633 2011-03-03  Maciej Stachowiak  <mjs@apple.com>
634
635         Reviewed by Brady Eidson.
636
637         WebProcess is calling CFURLCacheRemoveAllCachedResponses when loading, results in origin-load for all resources
638         https://bugs.webkit.org/show_bug.cgi?id=55701
639         <rdar://problem/9074017>
640
641         * Shared/WebProcessCreationParameters.cpp:
642         (WebKit::WebProcessCreationParameters::WebProcessCreationParameters): Initialize cache-clearing
643         flag parameters to false.
644         (WebKit::WebProcessCreationParameters::encode): Serialize them properly.
645         (WebKit::WebProcessCreationParameters::decode): And deserialize.
646
647 2011-03-03  Alexey Proskuryakov  <ap@apple.com>
648
649         Reviewed by Darin Adler.
650
651         REGRESSION (WebKit2): Tab keys no longer observe Full Keyboard Access
652         https://bugs.webkit.org/show_bug.cgi?id=55633
653         <rdar://problem/8963023>
654
655         * WebKit2.xcodeproj/project.pbxproj:
656         * WebProcess/mac/FullKeyboardAccessWatcher.h: Added.
657         * WebProcess/mac/FullKeyboardAccessWatcher.mm: Added.
658         (-[FullKeyboardAccessWatcher retrieveKeyboardUIModeFromPreferences:]):
659         (-[FullKeyboardAccessWatcher init]):
660         (+[FullKeyboardAccessWatcher fullKeyboardAccessEnabled]):
661         Get the current state of full keyboard access, listening for change notifications.
662
663         * WebProcess/WebProcess.h:  Added fullKeyboardAccessEnabled().
664
665         * WebProcess/WebProcess.cpp: (WebKit::WebProcess::fullKeyboardAccessEnabled):
666         WebKit1 also doesn't implement this on platforms other than Mac.
667
668         * WebProcess/mac/WebProcessMac.mm: (WebKit::WebProcess::fullKeyboardAccessEnabled):
669         Just ask FullKeyboardAccessWatcher.
670
671         * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::keyboardUIMode):
672         * WebProcess/WebCoreSupport/WebChromeClient.h:
673         Added keyboardUIMode(), removed tabsToLinks().
674
675         * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::keyboardUIMode):
676         * WebProcess/WebPage/WebPage.h:
677         Generate keyboard UI mode from tabToLinks preference and current state of FKA.
678
679 2011-03-03  Sam Weinig  <sam@webkit.org>
680
681         Reviewed by Anders Carlsson.
682
683         Give the Bundle's policy client the option of deciding the policy
684         https://bugs.webkit.org/show_bug.cgi?id=55699
685
686         * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
687         Add WKBundlePagePolicyAction enum and make it the return value of
688         the WKBundlePagePolicyClient functions.
689
690         * WebProcess/InjectedBundle/InjectedBundlePagePolicyClient.cpp:
691         (WebKit::InjectedBundlePagePolicyClient::decidePolicyForNavigationAction):
692         (WebKit::InjectedBundlePagePolicyClient::decidePolicyForNewWindowAction):
693         (WebKit::InjectedBundlePagePolicyClient::decidePolicyForMIMEType):
694         * WebProcess/InjectedBundle/InjectedBundlePagePolicyClient.h:
695         Pass the return value back to the caller. For unimplemented functions, return WKBundlePagePolicyActionPassThrough.
696
697         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
698         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForMIMEType):
699         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction):
700         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
701         Call the policy function early if the bundle handles it.
702
703 2011-03-02  Brian Weinstein  <bweinstein@apple.com>
704
705         Reviewed by Adam Roben.
706
707         Rest of WebKit2: Need a way to send notifications to client when cookies change
708         https://bugs.webkit.org/show_bug.cgi?id=55427
709         <rdar://problem/9056027>
710         
711         This patch adds the communication from the WebProcess <-> UIProcess about starting/stopping
712         listening for cookies changing, and adds a mechanism for the WebProcess to notify the UIProcess
713         when the cookies have changed. The WebProcess sends a message to the UIProcess when the cookies
714         change, and the UIProcess passes this along to the WebCookieManagerProxyClient.
715
716         * UIProcess/API/C/WKCookieManager.cpp:
717         (WKCookieManagerSetClient): Call through to WebCookieManagerProxy.
718         (WKCookieManagerStartObservingCookieChanges): Ditto.
719         (WKCookieManagerStopObservingCookieChanges): Ditto.
720
721         * UIProcess/API/C/WKCookieManager.h: Add new functions and a WKCookieManagerClient
722             which is responsible for cookiesDidChange.
723
724         * UIProcess/WebCookieManagerProxy.cpp:
725         (WebKit::WebCookieManagerProxy::initializeClient):
726         (WebKit::WebCookieManagerProxy::startObservingCookieChanges): Send the message down to the web process.
727         (WebKit::WebCookieManagerProxy::stopObservingCookieChanges): Ditto.
728         (WebKit::WebCookieManagerProxy::cookiesDidChange): Tell the WKCookieManagerClient the cookies were
729             modified.
730         * UIProcess/WebCookieManagerProxy.h:
731         * UIProcess/WebCookieManagerProxy.messages.in: Add new messages.
732
733         * UIProcess/WebCookieManagerProxyClient.cpp: Added.
734         (WebKit::WebCookieManagerProxyClient::cookiesDidChange): Calls through to the client saying that
735             cookies changed.
736         * UIProcess/WebCookieManagerProxyClient.h: Added.
737     
738         * WebProcess/Cookies/WebCookieManager.cpp:
739         (WebKit::WebCookieManager::startObservingCookieChanges): Call through to WebCore::startObservingCookieChanges
740             (on platforms that support it).
741         (WebKit::WebCookieManager::stopObservingCookieChanges): Ditto (for stopObservingCookieChanges).
742         (WebKit::WebCookieManager::dispatchDidModifyCookies): Send a message to the UI process that cookies changed.
743         * WebProcess/Cookies/WebCookieManager.h:
744         * WebProcess/Cookies/WebCookieManager.messages.in:
745         
746         Add new files.
747         * WebKit2.pro:
748         * WebKit2.xcodeproj/project.pbxproj:
749         * GNUmakefile.am:
750         * win/WebKit2.vcproj:
751
752 2011-03-03  Anders Carlsson  <andersca@apple.com>
753
754         Reviewed by Darin Adler.
755
756         Remove CanRunBeforeUnloadConfirmPanel sync message
757         https://bugs.webkit.org/show_bug.cgi?id=55689
758
759         * Shared/WebPageCreationParameters.cpp:
760         (WebKit::WebPageCreationParameters::encode):
761         (WebKit::WebPageCreationParameters::decode):
762         Encode and decode canRunBeforeUnloadConfirmPanel, as well as canRunModal, which wasn't
763         being encoded/decoded.
764
765         * Shared/WebPageCreationParameters.h:
766         Add canRunBeforeUnloadConfirmPanel.
767
768         * UIProcess/WebPageProxy.cpp:
769         (WebKit::WebPageProxy::initializeUIClient):
770         Send SetCanRunBeforeUnloadConfirmPanel and SetCanRunModal messages.
771
772         (WebKit::WebPageProxy::creationParameters):
773         Initialize parameters.canRunBeforeUnloadConfirmPanel.
774
775         * UIProcess/WebPageProxy.messages.in:
776         Remove CanRunBeforeUnloadConfirmPanel message.
777
778         * UIProcess/WebUIClient.cpp:
779         (WebKit::WebUIClient::canRunBeforeUnloadConfirmPanel):
780         * UIProcess/WebUIClient.h:
781         Make canRunBeforeUnloadConfirmPanel const.
782
783         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
784         (WebKit::WebChromeClient::canRunBeforeUnloadConfirmPanel):
785         Ask the web page instead of sending a synchronous message.
786
787         * WebProcess/WebPage/WebPage.cpp:
788         (WebKit::WebPage::WebPage):
789         Initialize m_canRunBeforeUnloadConfirmPanel.
790
791         * WebProcess/WebPage/WebPage.h:
792         (WebKit::WebPage::canRunBeforeUnloadConfirmPanel):
793         (WebKit::WebPage::setCanRunBeforeUnloadConfirmPanel):
794         Add getter and setter for m_canRunBeforeUnloadConfirmPanel.
795
796         (WebKit::WebPage::setCanRunModal):
797         Add setter for m_canRunModal.
798
799         * WebProcess/WebPage/WebPage.messages.in:
800         Add SetCanRunBeforeUnloadConfirmPanel and SetCanRunModal messages.
801
802 2011-03-03  Adam Roben  <aroben@apple.com>
803
804         Create the CFBundleRef for WebKit.dll on Windows if needed
805
806         WebKit part of <http://webkit.org/b/55672> <rdar://problem/9080867> All inspector tests time
807         out or crash on Windows 7 Release (WebKit2 Tests)
808
809         Reviewed by Darin Adler.
810
811         * Shared/win/WebKitBundle.cpp: Added.
812         (WebKit::createWebKitBundle): Returns a pre-existing bundle, if possible, otherwise creates
813         and returns a new bundle.
814         (WebKit::webKitBundle): Creates and caches a bundle, and returns it.
815
816         * Shared/win/WebKitBundle.h: Added.
817
818         * UIProcess/win/WebInspectorProxyWin.cpp:
819         (WebKit::WebInspectorProxy::inspectorPageURL):
820         * WebProcess/WebPage/win/WebInspectorWin.cpp:
821         (WebKit::WebInspector::localizedStringsURL):
822         Changed to use webKitBundle() to ensure that the bundle has been created.
823
824         * win/WebKit2.vcproj: Added new files.
825
826 2011-03-03  Peter Kasting  <pkasting@google.com>
827
828         Reviewed by James Robinson.
829
830         Drop redundant "Windows; " from the Windows-specific User Agent string.
831         https://bugs.webkit.org/show_bug.cgi?id=54567
832
833         * UIProcess/win/WebPageProxyWin.cpp:
834         (WebKit::WebPageProxy::standardUserAgent):
835
836 2011-03-02  Sheriff Bot  <webkit.review.bot@gmail.com>
837
838         Unreviewed, rolling out r80188.
839         http://trac.webkit.org/changeset/80188
840         https://bugs.webkit.org/show_bug.cgi?id=55647
841
842         Broke the WebKit API tests. (Requested by xenon on #webkit).
843
844         * UIProcess/API/C/WKPage.cpp:
845         (WKPageRunJavaScriptInMainFrame):
846         (callRunJavaScriptBlockAndRelease):
847         * UIProcess/API/C/WKPage.h:
848         * UIProcess/WebPageProxy.cpp:
849         (WebKit::WebPageProxy::close):
850         (WebKit::WebPageProxy::runJavaScriptInMainFrame):
851         (WebKit::WebPageProxy::processDidCrash):
852         * UIProcess/WebPageProxy.h:
853         * UIProcess/WebPageProxy.messages.in:
854         * WebProcess/WebPage/WebPage.cpp:
855         (WebKit::WebPage::runJavaScriptInMainFrame):
856
857 2011-03-02  Jeff Miller  <jeffm@apple.com>
858
859         Reviewed by Darin Adler.
860
861         Rename WebKit::WebPage::validateMenuItem() to validateCommand()
862         https://bugs.webkit.org/show_bug.cgi?id=55636
863         
864         Since this method can validate more than menu items, validateCommand() is a better name.  Also rename various messages and WebKit::WebPageProxy::didValidateMenuItem() to didValidateCommand().
865
866         * UIProcess/API/mac/WKView.mm:
867         (-[WKView validateUserInterfaceItem:]): Call validateCommand() instead of validateMenuItem().
868         * UIProcess/WebPageProxy.cpp:
869         (WebKit::WebPageProxy::validateCommand): Renamed from validateMenuItem().
870         (WebKit::WebPageProxy::didValidateCommand): Renamed from didValidateMenuItem().
871         * UIProcess/WebPageProxy.h:
872         * UIProcess/WebPageProxy.messages.in: Renamed DidValidateMenuItem to DidValidateCommand.
873         * WebProcess/WebPage/WebPage.cpp:
874         (WebKit::WebPage::validateCommand): Renamed from validateMenuItem().
875         * WebProcess/WebPage/WebPage.h:
876         * WebProcess/WebPage/WebPage.messages.in: Renamed ValidateMenuItem to ValidateCommand.
877
878 2011-03-02  Anders Carlsson  <andersca@apple.com>
879
880         Reviewed by Sam Weinig.
881
882         WKPageSetMemoryCacheClientCallsEnabled doesn't persist if web process crashes
883         https://bugs.webkit.org/show_bug.cgi?id=55635
884
885         * Shared/WebPageCreationParameters.cpp:
886         (WebKit::WebPageCreationParameters::encode):
887         (WebKit::WebPageCreationParameters::decode):
888         Encode and decode areMemoryCacheClientCallsEnabled.
889
890         * Shared/WebPageCreationParameters.h:
891         Add areMemoryCacheClientCallsEnabled member variable.
892
893         * UIProcess/WebPageProxy.cpp:
894         (WebKit::WebPageProxy::WebPageProxy):
895         Initialize m_areMemoryCacheClientCallsEnabled.
896
897         (WebKit::WebPageProxy::setMemoryCacheClientCallsEnabled):
898         Update m_areMemoryCacheClientCallsEnabled. Send a message if necessary.
899
900         (WebKit::WebPageProxy::creationParameters):
901         Set areMemoryCacheClientCallsEnabled.
902
903         * WebProcess/WebPage/WebPage.cpp:
904         (WebKit::WebPage::WebPage):
905         Call WebPage::setMemoryCacheMessagesEnabled.
906
907 2011-03-02  Timothy Hatcher  <timothy@apple.com>
908
909         Make the runJavaScriptInMainFrame callback send a WKSerializedScriptValueRef.
910
911         https://webkit.org/b/55623
912
913         Reviewed by Darin Adler.
914
915         * UIProcess/API/C/WKPage.cpp:
916         (WKPageRunJavaScriptInMainFrame): Use ScriptValueCallback.
917         (callRunJavaScriptBlockAndRelease): Use WKSerializedScriptValueRef.
918         * UIProcess/API/C/WKPage.h: Use WKSerializedScriptValueRef.
919         * UIProcess/WebPageProxy.cpp:
920         (WebKit::WebPageProxy::close): Call invalidateCallbackMap for m_scriptValueCallbacks.
921         (WebKit::WebPageProxy::runJavaScriptInMainFrame): Take a ScriptValueCallback.
922         (WebKit::WebPageProxy::scriptValueCallback): Added. Create a WebSerializedScriptValue
923         from the DataReference before calling the callback.
924         (WebKit::WebPageProxy::processDidCrash): Call invalidateCallbackMap for m_scriptValueCallbacks.
925         * UIProcess/WebPageProxy.h: Added ScriptValueCallback and m_scriptValueCallbacks.
926         * UIProcess/WebPageProxy.messages.in: Added ScriptValueCallback.
927         * WebProcess/WebPage/WebPage.cpp:
928         (WebKit::WebPage::runJavaScriptInMainFrame): Create a DataReference from a WebCore::SerializedScriptValue.
929         And use ScriptValueCallback to send the message back.
930
931 2011-03-02  Jessie Berlin  <jberlin@apple.com>
932
933         Reviewed by Adam Roben.
934
935         WebKit2: Use CFNetwork Sessions API.
936         https://bugs.webkit.org/show_bug.cgi?id=55435
937
938         Add the ability to create a Private Browsing Storage Session.
939
940         * Shared/WebProcessCreationParameters.cpp:
941         (WebKit::WebProcessCreationParameters::encode):
942         Encode the UI Process bundle identifier.
943         (WebKit::WebProcessCreationParameters::decode):
944         Decode the UI Process bundle identifier.
945         * Shared/WebProcessCreationParameters.h:
946
947         * UIProcess/mac/WebContextMac.mm:
948         (WebKit::WebContext::platformInitializeWebProcess):
949         Grab the bundle identifier and use it to set the WebProcessCreationParameter.
950         * UIProcess/win/WebContextWin.cpp:
951         (WebKit::WebContext::platformInitializeWebProcess):
952         Ditto.
953
954         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
955         (InitWebCoreSystemInterface):
956         Support using the wkCreatePrivateStorageSession WKSI in WebCore.
957
958         * WebProcess/WebProcess.cpp:
959         (WebKit::WebProcess::initializeWebProcess):
960         Set the base for the Private Browsing Storage Session identifier to be the bundle identifier
961         from the UI Process so that WebKit1 would create a Private Browsing Storage Session with the
962         same identifier as WebKit2.
963
964 2011-03-01  Brian Weinstein  <bweinstein@apple.com>
965
966         Reviewed by Adam Roben.
967
968         Part of WebKit2: Need a way to send notifications to client when cookies change
969         https://bugs.webkit.org/show_bug.cgi?id=55427
970         <rdar://problem/9056027>
971
972         * WebProcess/Cookies/WebCookieManager.cpp:
973         (WebKit::WebCookieManager::dispatchDidModifyCookies): Add a stub with a FIXME to send a 
974             message to the UI process.
975
976         * WebProcess/Cookies/WebCookieManager.h:
977         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
978         (WebKit::WebPlatformStrategies::createCookiesStrategy):
979         (WebKit::WebPlatformStrategies::notifyCookiesChanged): Call WebCookieManager::dispatchDidModifyCookies.
980         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
981
982 2011-03-02  Andras Becsi  <abecsi@webkit.org>
983
984         Reviewed by Laszlo Gombos.
985
986         [Qt][WK2] generate-forwarding-headers.pl should generate paths with framework names
987         https://bugs.webkit.org/show_bug.cgi?id=55478
988
989         On case insensitive systems the generated forwarding headers cause build problems.
990
991         * Scripts/generate-forwarding-headers.pl: The generated header should
992         also contain the framework name.
993
994 2011-03-01  Jeff Miller  <jeffm@apple.com>
995
996         Reviewed by Darin Adler.
997
998         Expose some selection state fields in WKPage
999         https://bugs.webkit.org/show_bug.cgi?id=55541
1000         
1001         Added WKPageCanDelete(), WKPageHasSelectedRange(), and WKPageIsContentEditable() so we can enable some
1002         Edit menu items properly on Windows when using WebKit2.
1003
1004         * UIProcess/API/C/WKPage.cpp:
1005         (WKPageCanDelete): Added.
1006         (WKPageHasSelectedRange): Added.
1007         (WKPageIsContentEditable): Added.
1008         * UIProcess/API/C/WKPage.h: Added new functions.
1009         * UIProcess/WebPageProxy.h:
1010         (WebKit::WebPageProxy::canDelete): Added.
1011         (WebKit::WebPageProxy::hasSelectedRange): Added.
1012         (WebKit::WebPageProxy::isContentEditable): Added.
1013
1014 2011-03-01  Mark Rowe  <mrowe@apple.com>
1015
1016         Hide the typeinfo name symbols for std::exception and std::bad_alloc too.
1017
1018         * Configurations/Base.xcconfig:
1019
1020 2011-03-01  Mark Rowe  <mrowe@apple.com>
1021
1022         Reviewed by Sam Weinig.
1023
1024         Add verification scripts to WebKit2 project and fix the issues they reveal.
1025
1026         * Configurations/Base.xcconfig: Add linker flags to prevent C++ standard
1027         library functions from being exported as weak externals.
1028         * Configurations/WebKit2.xcconfig: Inherit linker flags from the project level.
1029         * Shared/WebContextMenuItem.cpp:
1030         (WebKit::WebContextMenuItem::separatorItem): Use DEFINE_STATIC_LOCAL.
1031         * UIProcess/WebPageGroup.cpp:
1032         (WebKit::webPageGroupMap): Ditto.
1033         * WebKit2.xcodeproj/project.pbxproj: Don't copy .in files in to the framework.
1034         Run verification scripts at the appropriate times.
1035         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
1036         (WebKit::WebEditorClient::didBeginEditing): Use DEFINE_STATIC_LOCAL.
1037         (WebKit::WebEditorClient::respondToChangedContents): Ditto.
1038         (WebKit::WebEditorClient::respondToChangedSelection): Ditto.
1039         (WebKit::WebEditorClient::didEndEditing): Ditto.
1040         * WebProcess/WebPage/WebBackForwardListProxy.cpp:
1041         (WebKit::idToHistoryItemMap): Ditto.
1042         (WebKit::historyItemToIDMap): Ditto.
1043
1044 2011-03-01  Joseph Pecoraro  <joepeck@webkit.org>
1045
1046         Unreviewed. Roll out r80068 and r80073 due to breaking WebKit2 Qt port.
1047
1048         * UIProcess/API/qt/qwkpage.cpp:
1049         (QWKPage::viewportAttributesForSize):
1050
1051 2011-03-01  Joseph Pecoraro  <joepeck@webkit.org>
1052
1053         Unreviewed, missed updating a call to WebCore::computeViewportAttributes
1054         who's prototype changed.
1055
1056         Viewport Warning/Error Messages Are Now Inaccurate
1057         https://bugs.webkit.org/show_bug.cgi?id=53707
1058
1059         * UIProcess/API/qt/qwkpage.cpp:
1060         (QWKPage::viewportAttributesForSize): pass in a value for the document argument.
1061
1062 2011-03-01  Anders Carlsson  <andersca@apple.com>
1063
1064         Reviewed by Sam Weinig.
1065
1066         WKPluginSiteDataManagerClearAllSiteData is not working
1067         https://bugs.webkit.org/show_bug.cgi?id=55528
1068         <rdar://problem/9071823>
1069
1070         * Shared/Plugins/Netscape/NetscapePluginModule.cpp:
1071         (WebKit::NetscapePluginModule::tryGetSitesWithData):
1072         Remove version checks, checking that the function pointer is not null is enough.
1073
1074         (WebKit::NetscapePluginModule::tryClearSiteData):
1075         Remove version checks, checking that the function pointer is not null is enough.
1076         Also, correctly convert a null String to a null CString.
1077
1078 2011-03-01  Adam Roben  <aroben@apple.com>
1079
1080         Incorporate a review comment I missed in r80051
1081
1082         * Shared/Plugins/Netscape/NetscapePluginModule.cpp: Clarified error message.
1083
1084 2011-03-01  Adam Roben  <aroben@apple.com>
1085
1086         Make the PLUGIN_ARCHITECTURE() macro work with MSVC
1087
1088         Fixes <http://webkit.org/b/55513> <rdar://problem/9069189> REGRESSION (r79925): Lots of
1089         plugins tests crashing in NetscapePlugin::initialize on Windows
1090
1091         Reviewed by Anders Carlsson.
1092
1093         * Shared/Plugins/Netscape/NetscapePluginModule.cpp: Added a compile-time check to make sure
1094         PLUGIN_ARCHITECTURE() is defined for some platform.
1095
1096         * config.h: Removed the parentheses from the use of "defined" in the PLUGIN_ARCHITECTURE()
1097         macro. This matches PLATFORM(), OS(), etc., and makes the macro work on Windows. Also
1098         replaced the nonsense OS(WIN) with OS(WINDOWS).
1099
1100         * win/WebKit2.vcproj: Added config.h for editing convenience. Let VS do its thang.
1101
1102 2011-03-01  Sam Weinig  <sam@webkit.org>
1103
1104         Reviewed by Timothy Hatcher.
1105
1106         WebKit2 needs to be made localizable
1107         https://bugs.webkit.org/show_bug.cgi?id=55483
1108
1109         * PluginProcess/mac/PluginProcessMainMac.mm:
1110         * WebProcess/mac/WebProcessMainMac.mm:
1111         Set the default localization from the passed in parameter.
1112
1113         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
1114         Add the preferred localization as a parameter when launching processes
1115         so that they can set their localization to match the launching app.
1116
1117         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
1118         Use WebCore's localizedString function on the mac, to actually localize
1119         these strings.
1120
1121         (WebKit::WebPlatformStrategies::imageTitle):
1122         Switch to using replace, instead of concatenation, to give localizers a chance
1123         to rearrange the wording.
1124
1125 2011-03-01  Balazs Kelemen  <kbalazs@webkit.org>
1126
1127         Reviewed by Anders Carlsson.
1128
1129         [Qt][WK2] Plugin initialization
1130         https://bugs.webkit.org/show_bug.cgi?id=48127
1131
1132         Apply the quirks that are necessary for the flash plugin
1133         to not crash on X11.
1134
1135         * Platform/qt/ModuleQt.cpp:
1136         (WebKit::Module::load): Use the ResolveAllSymbols hint as we do in WebCore.
1137         * Shared/Plugins/Netscape/NetscapePluginModule.cpp:
1138         (WebKit::NetscapePluginModule::tryLoad): Call applyX11QuirksBeforeLoad
1139         if PLUGIN_ARCHITECTURE is X11.
1140         * Shared/Plugins/Netscape/NetscapePluginModule.h:
1141         * Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp:
1142         (WebKit::initializeGTK):  The same hack that we do in WebCore.
1143         Call gtk_init because flash don't do it for itself.
1144         (WebKit::NetscapePluginModule::applyX11QuirksBeforeLoad): Added for X11.
1145         Do the hacks that we need to do before calling NP_Initialize on the
1146         flash plugin to save it form crashing.
1147         * Shared/Plugins/PluginQuirks.h: Use PLUGIN_ARCHITECTURE macros.
1148         Added RequiresGTKToolKit quirk for X11.
1149         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
1150         (WebKit::NPN_GetValue): Handle the RequiresGTKToolKit quirk on X11.
1151         * WebProcess/Plugins/Netscape/NetscapePlugin.h:
1152         (WebKit::NetscapePlugin::quirks): Added getter for the PluginModule's
1153         quirks to be available in NPN_GetValue.
1154
1155 2011-03-01  Adam Roben  <aroben@apple.com>
1156
1157         Convert seconds to milliseconds before calling ::SetTimer
1158
1159         Fixes <http://webkit.org/b/55417> <rdar://problem/9065287> RunLoop::Timer fires 1000x too
1160         early on Windows
1161
1162         Reviewed by Anders Carlsson.
1163
1164         * Platform/win/RunLoopWin.cpp:
1165         (RunLoop::TimerBase::start): Convert the timeout interval to milliseconds, since that's what
1166         ::SetTimer expects.
1167
1168 2011-03-01  Andras Becsi  <abecsi@webkit.org>
1169
1170         Reviewed by Csaba Osztrogonác.
1171
1172         [Qt] Clean up the project files and move common options to WebKit.pri.
1173
1174         * WebKit2.pro: Deduplicate options.
1175
1176 2011-03-01  Juha Savolainen  <juha.savolainen@weego.fi>
1177
1178         Reviewed by Andreas Kling.
1179
1180         [Qt] WebKit2 needs to support font size changing and getting default font size
1181         https://bugs.webkit.org/show_bug.cgi?id=53671
1182
1183         Added new enum for font size type and added methods to set and get default font sizes.
1184
1185         * UIProcess/API/qt/qwkpreferences.cpp:
1186         (QWKPreferences::setFontSize): Added.
1187         (QWKPreferences::fontSize): Added.
1188         * UIProcess/API/qt/qwkpreferences.h:
1189
1190 2011-02-28  Alice Liu  <alice.liu@apple.com>
1191
1192         Reviewed by Adam Roben and Gavin Barraclough.
1193
1194         https://bugs.webkit.org/show_bug.cgi?id=54898
1195         InjectedBundleNodeHandle dies too early in WKBundleHitTestResultGetNodeHandle
1196
1197         * WebProcess/InjectedBundle/API/c/WKBundleHitTestResult.cpp:
1198         (WKBundleHitTestResultCopyNodeHandle): 
1199         Instead of .get(), call .release.leakRef() like other functions that return WKBundleNodeHandleRef.
1200         * WebProcess/InjectedBundle/API/c/WKBundleHitTestResult.h:
1201         Renamed from "get" to "copy", because it leaksRef.
1202
1203 2011-02-28  Alice Liu  <alice.liu@apple.com>
1204
1205         Reviewed by Gavin Barraclough.
1206
1207         https://bugs.webkit.org/show_bug.cgi?id=55442
1208         Webarchives don't contain subframe content
1209
1210         * WebProcess/WebPage/WebPage.cpp:
1211         (WebKit::WebPage::getWebArchiveOfFrame):
1212         Pass the frame's document instead of just the frame, to use a different LegacyWebArchive::create function.
1213
1214 2011-02-28  Benjamin Poulain  <benjamin.poulain@nokia.com>
1215
1216         Reviewed by Kenneth Rohde Christiansen.
1217
1218         [Qt][WK2] Add a way to test the WebKit 2 APIs
1219         https://bugs.webkit.org/show_bug.cgi?id=55408
1220
1221         Add an initial test for the WebKit 2 APIs of Qt.
1222
1223         * UIProcess/API/qt/tests/html/basic_page.html: Added.
1224         * UIProcess/API/qt/tests/qgraphicswkview/qgraphicswkview.pro: Added.
1225         * UIProcess/API/qt/tests/qgraphicswkview/tst_qgraphicswkview.cpp: Added.
1226         (View::View):
1227         (View::resizeEvent):
1228         (tst_QGraphicsWKView::init):
1229         (tst_QGraphicsWKView::cleanup):
1230         (tst_QGraphicsWKView::loadEmptyPage):
1231         * UIProcess/API/qt/tests/tests.pri: Added.
1232         * UIProcess/API/qt/tests/tests.pro: Added.
1233         * UIProcess/API/qt/tests/util.h: Added.
1234         (waitForSignal):
1235
1236 2011-02-28  Anders Carlsson  <andersca@apple.com>
1237
1238         Fix clang build.
1239
1240         * UIProcess/API/mac/FindIndicatorWindow.mm:
1241         * UIProcess/ChunkedUpdateDrawingAreaProxy.cpp:
1242         (WebKit::ChunkedUpdateDrawingAreaProxy::deprecatedUpdate):
1243         (WebKit::ChunkedUpdateDrawingAreaProxy::didReceiveMessage):
1244         * UIProcess/ChunkedUpdateDrawingAreaProxy.h:
1245         * WebProcess/WebPage/ChunkedUpdateDrawingArea.cpp:
1246         (WebKit::ChunkedUpdateDrawingArea::deprecatedResumePainting):
1247         (WebKit::ChunkedUpdateDrawingArea::didReceiveMessage):
1248         * WebProcess/WebPage/ChunkedUpdateDrawingArea.h:
1249
1250 2011-02-28  Dan Bernstein  <mitz@apple.com>
1251
1252         Rubber-stamped by Anders Carlsson.
1253
1254         Do not copy config.h into WebKit2.
1255
1256         * WebKit2.xcodeproj/project.pbxproj:
1257
1258 2011-02-28  Dan Bernstein  <mitz@apple.com>
1259
1260         LLVM Compiler build fix.
1261
1262         * Scripts/webkit2/messages.py:
1263         * UIProcess/WebPageProxy.h:
1264
1265 2011-02-28  Anders Carlsson  <andersca@apple.com>
1266
1267         Reviewed by Dan Bernstein, Sam Weinig, Alexey Proskuryakov and Darin Adler.
1268
1269         Open PDF in Preview doesn't work
1270         https://bugs.webkit.org/show_bug.cgi?id=55400
1271         <rdar://problem/8750353>
1272
1273         * UIProcess/API/mac/PDFViewController.mm:
1274         (-[WKPDFView initWithFrame:PDFViewController:]):
1275         Set the WKPDFView as the delegate of itself.
1276
1277         (-[WKPDFView PDFViewOpenPDFInNativeApplication:]):
1278         Call PDFViewController::openPDFInFinder.
1279
1280         (WebKit::PDFViewController::PDFViewController):
1281         Initialize m_hasWrittenPDFToDisk to false.
1282
1283         (WebKit::PDFViewController::openPDFInFinder):
1284         Write the PDF to disk if needed and then open it using -[NSWorkspace openFile:].
1285         
1286         (WebKit::temporaryPDFDirectoryPath):
1287         Create a directory to put PDFs in.
1288
1289         (WebKit::PDFViewController::pathToPDFOnDisk):
1290         Return a path to a (non-existent) file in the temporary PDF directory.
1291
1292 2011-02-28  Alexey Proskuryakov  <ap@apple.com>
1293
1294         Reviewed by Dan Bernstein.
1295
1296         Frequent crashes in CFURLCache code on Snow Leopard
1297         https://bugs.webkit.org/show_bug.cgi?id=55412
1298         <rdar://problem/9063922>
1299
1300         CString is evil, it has two lengths which can be different - specifically, fileSystemRepresentation()
1301         creates a string with maximum possible buffer size. A path with garbage at the end confused
1302         CFURLCache into corrupting its data structures.
1303
1304         * Shared/WebProcessCreationParameters.h: Added a FIXME about merging Mac and Windows code.
1305         This problem wouldn't have occured if we didn't use CString in the first place.
1306
1307         * UIProcess/mac/WebContextMac.mm: (WebKit::WebContext::platformInitializeWebProcess):
1308         Added an assertion matching Windows behavior (seems likely that NSURLCache also wouldn't
1309         have liked trailing slash).
1310
1311         * UIProcess/win/WebContextWin.cpp: (WebKit::WebContext::platformInitializeWebProcess):
1312         Made slash removal conditional for robustness.
1313
1314         * WebProcess/mac/WebProcessMac.mm: (WebKit::WebProcess::platformInitializeWebProcess):
1315         Use actual string length, not CString::length().
1316
1317 2011-02-28  Balazs Kelemen  <kbalazs@webkit.org>
1318
1319         Reviewed by Anders Carlsson.
1320
1321         [Qt][WK2] Plugin initialization
1322         https://bugs.webkit.org/show_bug.cgi?id=48127
1323
1324         Specialize the way of initializing the plugin for X11.
1325         Introduce PLUGIN_ARCHITECTURE macros to allow code sharing
1326         across platforms.
1327
1328         * Shared/Plugins/Netscape/NetscapePluginModule.cpp:
1329         (WebKit::NetscapePluginModule::tryLoad):
1330         * config.h:
1331
1332 2011-02-28  Sam Weinig  <sam@webkit.org>
1333
1334         Reviewed by Brady Eidson.
1335
1336         WK2 Context Menus - Implement LookUpInDictionary
1337         https://bugs.webkit.org/show_bug.cgi?id=55405
1338
1339         * Shared/DictionaryPopupInfo.cpp:
1340         (WebKit::DictionaryPopupInfo::encode):
1341         (WebKit::DictionaryPopupInfo::decode):
1342         * Shared/DictionaryPopupInfo.h:
1343         Add type to differentiate between HotKey and ContextMenu triggered
1344         dictionary popups. This is necessary since HotKey triggered ones want
1345         to override the style to always be overlay.
1346
1347         * UIProcess/API/mac/PageClientImpl.mm:
1348         (WebKit::PageClientImpl::didPerformDictionaryLookup):
1349         Only force the overlay style for HotKey triggered dictionary lookups.
1350
1351         * WebProcess/WebPage/WebPage.h:
1352         * WebProcess/WebPage/mac/WebPageMac.mm:
1353         (WebKit::WebPage::performDictionaryLookupAtLocation):
1354         (WebKit::WebPage::performDictionaryLookupForRange):
1355         Factor out shared functionality into performDictionaryLookupForRange.
1356
1357         * WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm:
1358         (WebKit::WebContextMenuClient::lookUpInDictionary):
1359         Get selected range and call newly factored out performDictionaryLookupForRange.
1360
1361 2011-02-28  Anders Carlsson  <andersca@apple.com>
1362
1363         Reviewed by Dan Bernstein.
1364
1365         PDFViewController should hold a reference to the PDF data
1366         https://bugs.webkit.org/show_bug.cgi?id=55394
1367
1368         * UIProcess/API/mac/PDFViewController.h:
1369         * UIProcess/API/mac/PDFViewController.mm:
1370         (WebKit::PDFViewController::setPDFDocumentData):
1371
1372 2011-02-28  Sam Weinig  <sam@webkit.org>
1373
1374         Reviewed by Darin Adler.
1375
1376         Size of text in popup menu doesn't match size of text in <select> itself in WebKit2
1377         https://bugs.webkit.org/show_bug.cgi?id=48234
1378
1379         * Shared/TextInfo.cpp: Removed.
1380         * Shared/TextInfo.h: Removed.
1381         Replace this with the more appropriately DictionaryPopupInfo.
1382
1383         * Shared/DictionaryPopupInfo.cpp: Copied from Source/WebKit2/Shared/TextInfo.cpp.
1384         (WebKit::DictionaryPopupInfo::encode):
1385         (WebKit::DictionaryPopupInfo::decode):
1386         * Shared/DictionaryPopupInfo.h: Copied from Source/WebKit2/Shared/TextInfo.h.
1387         (WebKit::DictionaryPopupInfo::DictionaryPopupInfo):
1388         Replace individual font related fields with FontInfo.
1389
1390         * Shared/FontInfo.cpp: Added.
1391         (WebKit::FontInfo::FontInfo):
1392         (WebKit::FontInfo::encode):
1393         (WebKit::FontInfo::decode):
1394         * Shared/FontInfo.h: Added.
1395         Add class to encapsulate passing a font description over the wire.
1396
1397         * Shared/PlatformPopupMenuData.cpp:
1398         (WebKit::PlatformPopupMenuData::encode):
1399         (WebKit::PlatformPopupMenuData::decode):
1400         * Shared/PlatformPopupMenuData.h:
1401         Add FontInfo as extra data for the Mac.
1402
1403         * UIProcess/API/mac/PageClientImpl.h:
1404         * UIProcess/API/mac/PageClientImpl.mm:
1405         (WebKit::PageClientImpl::didPerformDictionaryLookup):
1406         * UIProcess/PageClient.h:
1407         Add scaleFactor and use it to construct a font at the right size.
1408
1409         * UIProcess/WebPageProxy.cpp:
1410         (WebKit::WebPageProxy::showPopupMenu):
1411         (WebKit::WebPageProxy::didPerformDictionaryLookup):
1412         * UIProcess/WebPageProxy.h:
1413         * UIProcess/WebPageProxy.messages.in:
1414         * UIProcess/WebPopupMenuProxy.h:
1415         * UIProcess/mac/WebPopupMenuProxyMac.h:
1416         (WebKit::WebPopupMenuProxyMac::create):
1417         * UIProcess/mac/WebPopupMenuProxyMac.mm:
1418         (WebKit::WebPopupMenuProxyMac::WebPopupMenuProxyMac):
1419         (WebKit::WebPopupMenuProxyMac::populate):
1420         (WebKit::WebPopupMenuProxyMac::showPopupMenu):
1421         * UIProcess/qt/WebPopupMenuProxyQt.cpp:
1422         (WebKit::WebPopupMenuProxyQt::showPopupMenu):
1423         * UIProcess/qt/WebPopupMenuProxyQt.h:
1424         * UIProcess/win/WebPopupMenuProxyWin.cpp:
1425         (WebKit::WebPopupMenuProxyWin::showPopupMenu):
1426         * UIProcess/win/WebPopupMenuProxyWin.h:
1427         * WebProcess/WebCoreSupport/mac/WebPopupMenuMac.mm:
1428         (WebKit::WebPopupMenu::setUpPlatformData):
1429         * WebProcess/WebPage/mac/WebPageMac.mm:
1430         (WebKit::WebPage::performDictionaryLookupAtLocation):
1431         Pass scale factor through and rename TextInfo -> DictionaryPopupInfo.
1432
1433         * WebKit2.pro:
1434         * WebKit2.xcodeproj/project.pbxproj:
1435         * win/WebKit2.vcproj:
1436         Add new files.
1437
1438 2011-02-28  Adam Roben  <aroben@apple.com>
1439
1440         One more rename as a followup to r79868
1441
1442         Rubber-stamped by Anders Carlsson.
1443
1444         * UIProcess/DrawingAreaProxyImpl.cpp:
1445         * UIProcess/DrawingAreaProxyImpl.h:
1446         Rename stateDidChange to backingStoreStateDidChange.
1447
1448 2011-02-28  Adam Roben  <aroben@apple.com>
1449
1450         Rename DrawingArea[Proxy]Impl's "state ID" concept to "backing store state ID"
1451
1452         Rubber-stamped (and suggested) by Anders Carlsson.
1453
1454         * UIProcess/DrawingAreaProxy.h:
1455         * UIProcess/DrawingAreaProxy.messages.in:
1456         * UIProcess/DrawingAreaProxyImpl.cpp:
1457         * UIProcess/DrawingAreaProxyImpl.h:
1458         * WebProcess/WebPage/DrawingArea.h:
1459         * WebProcess/WebPage/DrawingArea.messages.in:
1460         * WebProcess/WebPage/DrawingAreaImpl.cpp:
1461         * WebProcess/WebPage/DrawingAreaImpl.h:
1462         Perform the rename.
1463
1464 2011-02-28  Adam Roben  <aroben@apple.com>
1465
1466         Decouple state changes from sending of UpdateState messages in DrawingAreaProxyImpl
1467
1468         The new DrawingAreaProxyImpl::stateDidChange function should be called whenever
1469         DrawingAreaProxyImpl's state changes in a way that will require allocating a new backing
1470         store. (Currently, this is just when the size changes.) This function will sometimes (but
1471         not always, as when we're waiting for a DidUpdateState message) send an UpdateState message
1472         to the web process. This means it's now possible for the state IDs sent in consecutive
1473         UpdateState messages to increase by more than one, but that's OK.
1474
1475         This should cause no change in behavior.
1476
1477         Fixes <http://webkit.org/b/55382> DrawingAreaProxyImpl's state ID should be updated whenever
1478         its state changes, not just when we send an UpdateState message
1479
1480         Reviewed by Anders Carlsson.
1481
1482         * UIProcess/DrawingAreaProxyImpl.cpp:
1483         (WebKit::DrawingAreaProxyImpl::DrawingAreaProxyImpl): Updated for rename.
1484         (WebKit::DrawingAreaProxyImpl::sizeDidChange): Changed to call stateDidChange.
1485         (WebKit::DrawingAreaProxyImpl::didUpdateState): Updated for rename, and changed to call
1486         sendUpdateState whenever our state has changed for any reason since the last UpdateState
1487         message was sent.
1488         (WebKit::DrawingAreaProxyImpl::stateDidChange): Added. Increments m_nextStateID and calls
1489         through to sendUpdateState.
1490         (WebKit::DrawingAreaProxyImpl::sendUpdateState): Updated for rename, moved incrementing of
1491         the state ID we send to the web process from here to stateDidChange, and added an assertion.
1492
1493         * UIProcess/DrawingAreaProxyImpl.h: Renamed m_requestedStateID to m_nextStateID, and updated
1494         the comment explaining its meaning.
1495
1496 2011-02-28  Adam Roben  <aroben@apple.com>
1497
1498         Pass the right dirty rect to Plugin::paint
1499
1500         A typo in r79040 broke this. Much of this patch is just support for testing the fix.
1501
1502         Fixes <http://webkit.org/b/55365> <rdar://problem/9031089> REGRESSION (r79040): WebKit2:
1503         Large portions of pages with plugins paint black
1504
1505         Reviewed by Anders Carlsson.
1506
1507         * WebProcess/Plugins/PluginView.cpp:
1508         (WebKit::PluginView::paint): Pass the dirty rect we calculated earlier to Plugin::paint,
1509         rather than just passing along the dirty rect that was passed into this function. This is
1510         the bug fix.
1511
1512         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
1513         (WKBundlePageForceRepaint):
1514         * WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h:
1515         Added new SPI. Just calls through to WebPage::forceRepaintWithoutCallback.
1516
1517         * WebProcess/WebPage/WebPage.cpp:
1518         (WebKit::WebPage::forceRepaintWithoutCallback): Moved code to force a repaint here...
1519         (WebKit::WebPage::forceRepaint): ...from here.
1520
1521         * WebProcess/WebPage/WebPage.h: Added forceRepaintWithoutCallback.
1522
1523 2011-02-27  Sam Weinig  <sam@webkit.org>
1524
1525         Reviewed by Dan Bernstein.
1526
1527         Force dictionary popup to use overlay type
1528         <rdar://problem/9052483>
1529         https://bugs.webkit.org/show_bug.cgi?id=55337
1530
1531         * UIProcess/API/mac/PageClientImpl.mm:
1532         (WebKit::PageClientImpl::didPerformDictionaryLookup): As this is only
1533         used for the hot key version of the dictionary popup, force the overlay
1534         style.
1535
1536 2011-02-27  Benjamin Poulain  <benjamin.poulain@nokia.com>
1537
1538         Reviewed by Kenneth Rohde Christiansen.
1539
1540         [Qt] [WK2] QGraphicsWKView::showContextMenu() should be public
1541         https://bugs.webkit.org/show_bug.cgi?id=55330
1542
1543         Move QGraphicsWKView::showContextMenu() to the public API. Add documentation
1544         on its use.
1545
1546         * UIProcess/API/qt/qgraphicswkview.cpp:
1547         * UIProcess/API/qt/qgraphicswkview.h:
1548
1549 2011-02-27  Alejandro G. Castro  <alex@igalia.com>
1550
1551         Unreviewed, fixed GTK compilation after r79806.
1552
1553         * UIProcess/gtk/WebView.cpp:
1554         (WebKit::WebView::didFinishLoadingDataForCustomRepresentation):
1555         * UIProcess/gtk/WebView.h:
1556
1557 2011-02-26  Anders Carlsson  <andersca@apple.com>
1558
1559         Reviewed by Dan Bernstein.
1560
1561         Asynchronous response to FramePolicyListener is not finishing the load
1562         https://bugs.webkit.org/show_bug.cgi?id=55305
1563         <rdar://problem/9044356>
1564
1565         Always initialize the receivedPolicyAction reply parameter.
1566
1567         * UIProcess/WebPageProxy.cpp:
1568         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
1569         (WebKit::WebPageProxy::decidePolicyForMIMEType):
1570
1571 2011-02-26  Anders Carlsson  <andersca@apple.com>
1572
1573         Reviewed by Sam Weinig.
1574
1575         DidFinishLoadingDataForCustomRepresentation should pass along the suggested filename
1576         https://bugs.webkit.org/show_bug.cgi?id=55304
1577
1578         * UIProcess/API/mac/PDFViewController.h:
1579         * UIProcess/API/mac/PDFViewController.mm:
1580         (WebKit::PDFViewController::setPDFDocumentData):
1581         * UIProcess/API/mac/PageClientImpl.h:
1582         * UIProcess/API/mac/PageClientImpl.mm:
1583         (WebKit::PageClientImpl::didFinishLoadingDataForCustomRepresentation):
1584         * UIProcess/API/mac/WKView.mm:
1585         (-[WKView _didFinishLoadingDataForCustomRepresentationWithSuggestedFilename:dataReference:CoreIPC::]):
1586         * UIProcess/API/mac/WKViewInternal.h:
1587         * UIProcess/API/qt/qwkpage.cpp:
1588         (QWKPagePrivate::didFinishLoadingDataForCustomRepresentation):
1589         * UIProcess/API/qt/qwkpage_p.h:
1590         * UIProcess/PageClient.h:
1591         * UIProcess/WebPageProxy.cpp:
1592         (WebKit::WebPageProxy::didFinishLoadingDataForCustomRepresentation):
1593         * UIProcess/WebPageProxy.h:
1594         * UIProcess/WebPageProxy.messages.in:
1595         * UIProcess/win/WebView.cpp:
1596         (WebKit::WebView::didFinishLoadingDataForCustomRepresentation):
1597         * UIProcess/win/WebView.h:
1598         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1599         (WebKit::WebFrameLoaderClient::finishedLoading):
1600
1601 2011-02-26  Anders Carlsson  <andersca@apple.com>
1602
1603         Reviewed by Oliver Hunt.
1604
1605         DrawingArea should not be reference counted
1606         https://bugs.webkit.org/show_bug.cgi?id=55284
1607
1608         * Shared/DrawingAreaInfo.h:
1609         * Shared/WebPageCreationParameters.cpp:
1610         (WebKit::WebPageCreationParameters::encode):
1611         (WebKit::WebPageCreationParameters::decode):
1612         * Shared/WebPageCreationParameters.h:
1613         * UIProcess/ChunkedUpdateDrawingAreaProxy.cpp:
1614         (WebKit::ChunkedUpdateDrawingAreaProxy::ChunkedUpdateDrawingAreaProxy):
1615         (WebKit::ChunkedUpdateDrawingAreaProxy::setPageIsVisible):
1616         (WebKit::ChunkedUpdateDrawingAreaProxy::update):
1617         (WebKit::ChunkedUpdateDrawingAreaProxy::sendSetSize):
1618         * UIProcess/ChunkedUpdateDrawingAreaProxy.h:
1619         * UIProcess/DrawingAreaProxy.cpp:
1620         (WebKit::DrawingAreaProxy::DrawingAreaProxy):
1621         * UIProcess/DrawingAreaProxy.h:
1622         (WebKit::DrawingAreaProxy::type):
1623         * UIProcess/DrawingAreaProxyImpl.cpp:
1624         (WebKit::DrawingAreaProxyImpl::DrawingAreaProxyImpl):
1625         * UIProcess/DrawingAreaProxyImpl.h:
1626         * UIProcess/TiledDrawingAreaProxy.cpp:
1627         (WebKit::TiledDrawingAreaProxy::TiledDrawingAreaProxy):
1628         * UIProcess/TiledDrawingAreaProxy.h:
1629         * UIProcess/WebPageProxy.cpp:
1630         (WebKit::WebPageProxy::didReceiveSyncMessage):
1631         (WebKit::WebPageProxy::creationParameters):
1632         * WebProcess/Geolocation/GeolocationPermissionRequestManager.cpp:
1633         * WebProcess/WebPage/ChunkedUpdateDrawingArea.cpp:
1634         (WebKit::ChunkedUpdateDrawingArea::ChunkedUpdateDrawingArea):
1635         (WebKit::ChunkedUpdateDrawingArea::display):
1636         (WebKit::ChunkedUpdateDrawingArea::setSize):
1637         (WebKit::ChunkedUpdateDrawingArea::didReceiveMessage):
1638         * WebProcess/WebPage/ChunkedUpdateDrawingArea.h:
1639         * WebProcess/WebPage/DrawingArea.cpp:
1640         (WebKit::DrawingArea::create):
1641         (WebKit::DrawingArea::DrawingArea):
1642         * WebProcess/WebPage/DrawingArea.h:
1643         * WebProcess/WebPage/DrawingAreaImpl.cpp:
1644         (WebKit::DrawingAreaImpl::create):
1645         (WebKit::DrawingAreaImpl::DrawingAreaImpl):
1646         * WebProcess/WebPage/DrawingAreaImpl.h:
1647         * WebProcess/WebPage/TiledDrawingArea.cpp:
1648         (WebKit::TiledDrawingArea::TiledDrawingArea):
1649         * WebProcess/WebPage/TiledDrawingArea.h:
1650         * WebProcess/WebPage/WebPage.cpp:
1651         (WebKit::WebPage::drawRect):
1652         * WebProcess/WebPage/WebPage.h:
1653
1654 2011-02-26  Vsevolod Vlasov  <vsevik@chromium.org>
1655
1656         Reviewed by Pavel Feldman.
1657
1658         DumpRenderTree should reset frame opener between tests.
1659         https://bugs.webkit.org/show_bug.cgi?id=54874
1660
1661         Added clearOpener method to WKBundleWebFramePrivate.
1662
1663         * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
1664         (WKBundleFrameClearOpener):
1665         * WebProcess/InjectedBundle/API/c/WKBundleFramePrivate.h:
1666
1667 2011-02-26  Yael Aharon  <yael.aharon@nokia.com>
1668
1669         Reviewed by Andreas Kling.
1670
1671         [Qt] Fix the focus in MiniBrowser.
1672         https://bugs.webkit.org/show_bug.cgi?id=55288
1673
1674         Implement basic functionality for focus in QWKPagePrivate.
1675
1676         * UIProcess/API/qt/qwkpage.cpp:
1677         (QWKPagePrivate::isViewWindowActive):
1678         (QWKPagePrivate::isViewFocused):
1679         (QWKPagePrivate::isViewVisible):
1680
1681 2011-02-26  Sheriff Bot  <webkit.review.bot@gmail.com>
1682
1683         Unreviewed, rolling out r79764.
1684         http://trac.webkit.org/changeset/79764
1685         https://bugs.webkit.org/show_bug.cgi?id=55295
1686
1687         "broke Chromium builds" (Requested by rniwa on #webkit).
1688
1689         * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
1690         * WebProcess/InjectedBundle/API/c/WKBundleFramePrivate.h:
1691
1692 2011-02-26  Vsevolod Vlasov  <vsevik@chromium.org>
1693
1694         Reviewed by Pavel Feldman.
1695
1696         DumpRenderTree should reset frame opener between tests.
1697         https://bugs.webkit.org/show_bug.cgi?id=54874
1698
1699         Added clearOpener method to WKBundleWebFramePrivate.
1700
1701         * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
1702         (WKBundleFrameClearOpener):
1703         * WebProcess/InjectedBundle/API/c/WKBundleFramePrivate.h:
1704
1705 2011-02-25  Anders Carlsson  <andersca@apple.com>
1706
1707         Reviewed by Darin Adler.
1708
1709         Plug-in process crashes when using GuardMalloc
1710         https://bugs.webkit.org/show_bug.cgi?id=55279
1711         <rdar://problem/9044618>
1712
1713         Update m_environmentPointer after copying the environment variables.
1714         
1715         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
1716         (WebKit::EnvironmentVariables::copyEnvironmentVariables):
1717
1718 2011-02-25  Darin Adler  <darin@apple.com>
1719
1720         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
1721         (WebKit::ProcessLauncher::launchProcess): Fixed backwards logic from last change.
1722
1723 2011-02-25  Darin Adler  <darin@apple.com>
1724
1725         Reviewed by Mark Rowe.
1726
1727         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
1728         (WebKit::ProcessLauncher::launchProcess): Fixed performance problem in production
1729         builds by only setting DYLD_FRAMEWORK_PATH in engineering configurations.
1730
1731 2011-02-25  Darin Adler  <darin@apple.com>
1732
1733         Reviewed by Anders Carlsson.
1734
1735         <rdar://problem/8036034> WebKit2 should work even if DYLD_FRAMEWORK_PATH is not set
1736
1737         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
1738         (WebKit::EnvironmentVariables::~EnvironmentVariables): Use fastFree, not delete, on
1739         the strings here because they are allocated with fastMalloc, not new.
1740         (WebKit::EnvironmentVariables::set): Use const more.
1741         (WebKit::EnvironmentVariables::get): Ditto.
1742         (WebKit::EnvironmentVariables::appendValue): Ditto.
1743         (WebKit::EnvironmentVariables::valueIfVariableHasName): Ditto. Also fix mistake
1744         where this would match if the name matched only a prefix of the environment variable's
1745         name. We want to match the whole name, so we need to use memcmp, not strncmp.
1746         (WebKit::EnvironmentVariables::createStringForVariable): Use const more.
1747         (WebKit::ProcessLauncher::launchProcess): Use clearer name, frameworkExecutablePath,
1748         for what was called bundlePath before. Append the frameworks path to DYLD_FRAMEWORK_PATH,
1749         ensuring we can pick up other frameworks from the same directory in the web process.
1750         Use a const_cast instead of a C-style cast.
1751
1752 2011-02-25  Chris Fleizach  <cfleizach@apple.com>
1753
1754         Reviewed by Anders Carlsson.
1755
1756         AX: WK2: AXApplication not returning the AXFocusedUIElement within the web area
1757         https://bugs.webkit.org/show_bug.cgi?id=55277
1758
1759         * UIProcess/API/mac/WKView.mm:
1760         (-[WKView accessibilityFocusedUIElement]):
1761
1762 2011-02-25  Alexey Proskuryakov  <ap@apple.com>
1763
1764         Reviewed by Anders Carlsson.
1765
1766         https://bugs.webkit.org/show_bug.cgi?id=55276
1767         WebPage::close() accesses "this" after it is destroyed.
1768
1769         This was making many tests crash with GuardMalloc.
1770
1771         * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::close): Access "this" before it can be
1772         destroyed, not after.
1773
1774 2011-02-25  Balazs Kelemen  <kbalazs@webkit.org>
1775
1776         Unreviewed.
1777         Add missing sources to WebKit2API.pri.
1778
1779         * WebKit2API.pri:
1780
1781 2011-02-25  Anders Carlsson  <andersca@apple.com>
1782
1783         Reviewed by Darin Adler.
1784
1785         A WKView without a window will cause CG errors in the console
1786         https://bugs.webkit.org/show_bug.cgi?id=55264
1787         <rdar://problem/9044281>
1788
1789         Check that the window has a valid window number before trying to get its graphics context.
1790
1791         * UIProcess/API/mac/PageClientImpl.mm:
1792         (WebKit::PageClientImpl::containingWindowGraphicsContext):
1793
1794 2011-02-25  Brian Weinstein  <bweinstein@apple.com>
1795
1796         Reviewed by Brady Eidson and looked over by Jessie Berlin.
1797
1798         WebKit2: Need a way to manage cookies from the web process
1799         https://bugs.webkit.org/show_bug.cgi?id=55086
1800         
1801         Call through to WebCore::CookieJar in our WebCookieManager functions.
1802
1803         * WebProcess/Cookies/WebCookieManager.cpp:
1804         (WebKit::WebCookieManager::getHostnamesWithCookies):
1805         (WebKit::WebCookieManager::deleteCookiesForHostname):
1806         (WebKit::WebCookieManager::deleteAllCookies):
1807
1808 2011-02-25  Anders Carlsson  <andersca@apple.com>
1809
1810         Reviewed by Sam Weinig.
1811
1812         Option-clicking on links doesn't download them due to sandbox violation
1813         https://bugs.webkit.org/show_bug.cgi?id=55250
1814         <rdar://problem/9018359>
1815
1816         The change to make DecidePolicyForNavigationAction sync didn't handle the case when the
1817         decided policy was "Download". Fix this by passing along the download ID back to the web process.
1818
1819         * Platform/CoreIPC/HandleMessage.h:
1820         (CoreIPC::callMemberFunction):
1821         Add new overload.
1822
1823         * UIProcess/WebPageProxy.cpp:
1824         (WebKit::WebPageProxy::WebPageProxy):
1825         Initialize m_syncNavigationActionPolicyDownloadID.
1826
1827         (WebKit::WebPageProxy::receivedPolicyDecision):
1828         Set m_syncNavigationActionPolicyDownloadID to the download ID.
1829
1830         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
1831         Return the m_syncNavigationActionPolicyDownloadID.
1832
1833         * UIProcess/WebPageProxy.h:
1834         * UIProcess/WebPageProxy.messages.in:
1835         Add a DownloadID reply parameter.
1836
1837         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1838         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
1839         Don't pass a zero download ID to didReceivePolicyDecision.
1840
1841 2011-02-25  Amruth Raj  <amruthraj@motorola.com> and Ravi Phaneendra Kasibhatla  <ravi.kasibhatla@motorola.com> and Alejandro G. Castro  <alex@igalia.com>
1842
1843         Reviewed by Martin Robinson.
1844
1845         [GTK] Implement WebContext and NativeKeyboardEvent classes for WebKit2
1846         https://bugs.webkit.org/show_bug.cgi?id=48510
1847
1848         * GNUmakefile.am:
1849         * Shared/NativeWebKeyboardEvent.h: Added the GTK event attribute
1850         and constructors, in our case we need it because we use a pointer
1851         and copy the event.
1852         (WebKit::NativeWebKeyboardEvent::nativeEvent):
1853         * Shared/gtk/NativeWebKeyboardEventGtk.cpp: Added.
1854         (WebKit::NativeWebKeyboardEvent::NativeWebKeyboardEvent): We need
1855         to copy the event in the constructor to avoid two references to
1856         the same event.
1857         * Shared/gtk/WebEventFactory.cpp: Changed the prototype of the
1858         functions to add const, we need it for the NativeWebKeyboardEvent
1859         constructor.
1860         (WebKit::modifiersForEvent):
1861         (WebKit::WebEventFactory::createWebKeyboardEvent):
1862         * UIProcess/gtk/WebContextGtk.cpp: Added. Stubbed implementation
1863         for GTK port. Yet to implement.
1864         (WebKit::WebContext::applicationCacheDirectory):
1865         (WebKit::WebContext::platformInitializeWebProcess):
1866         (WebKit::WebContext::platformDefaultDatabaseDirectory):
1867         * UIProcess/gtk/WebView.cpp:
1868         (WebKit::WebView::handleKeyboardEvent):
1869
1870 2011-02-25  Anders Carlsson  <andersca@apple.com>
1871
1872         Reviewed by Sam Weinig.
1873
1874         Get rid of more old accelerated compositing code
1875         https://bugs.webkit.org/show_bug.cgi?id=55235
1876
1877         * Shared/CoreIPCSupport/DrawingAreaProxyMessageKinds.h:
1878         * UIProcess/ChunkedUpdateDrawingAreaProxy.h:
1879         * UIProcess/DrawingAreaProxy.h:
1880         * UIProcess/DrawingAreaProxyImpl.cpp:
1881         * UIProcess/DrawingAreaProxyImpl.h:
1882         * WebProcess/WebPage/ChunkedUpdateDrawingArea.h:
1883         * WebProcess/WebPage/DrawingArea.h:
1884         * WebProcess/WebPage/DrawingAreaImpl.cpp:
1885         * WebProcess/WebPage/DrawingAreaImpl.h:
1886
1887 2011-02-25  Andras Becsi  <abecsi@webkit.org>
1888
1889         Reviewed by Csaba Osztrogonác.
1890
1891         [Qt] Make the WebKit2 build system less confusing for non-Qt developers
1892         https://bugs.webkit.org/show_bug.cgi?id=55213
1893
1894         * WebKit2API.pri: Added.
1895
1896 2011-02-25  Amruth Raj  <amruthraj@motorola.com> and Ravi Phaneendra Kasibhatla  <ravi.kasibhatla@motorola.com> and Alejandro G. Castro  <alex@igalia.com>
1897
1898         Reviewed by Martin Robinson.
1899
1900         [GTK] Implement WebView and WebKitWebView classes for WebKit2
1901         https://bugs.webkit.org/show_bug.cgi?id=48509
1902
1903         * GNUmakefile.am:
1904         * UIProcess/API/C/gtk/WKView.cpp:
1905         * UIProcess/API/C/gtk/WKView.h: Removed gdkrectangle from
1906         constructor.
1907         * UIProcess/gtk/WebViewWidget.cpp: Added. The GObject interface
1908         for WebView. The GObject is the GtkWidget handle which is used by
1909         WebView class for GTK port.
1910         * UIProcess/gtk/WebViewWidget.h: Added. The GObject interface
1911         declarations for GtkWidget handle for GTK port.
1912         * UIProcess/gtk/WebView.cpp: Added. The native GtkWidget handle
1913         for GTK port which is associated with each WKViewRef.
1914         * UIProcess/gtk/WebView.h: Added. Class which implements the
1915         PageClient interface. It is a wrapper over the native GtkWidget
1916         handle associated with each WKViewRef for GTK port.
1917
1918 2011-02-25  Alejandro G. Castro  <alex@igalia.com>
1919
1920         Fix GTK compilation after r79654.
1921
1922         * GNUmakefile.am:
1923
1924 2011-02-24  Brian Weinstein  <bweinstein@apple.com>
1925
1926         Qt build fix.
1927
1928         * WebKit2.pri:
1929
1930 2011-02-24  Brady Eidson  <beidson@apple.com>
1931
1932         Reviewed by Sam Weinig and looked over by Brian Weinstein.
1933
1934         Part of <rdar://problem/8762095> and https://bugs.webkit.org/show_bug.cgi?id=55172
1935         Need WebKit2 API to view/manage origins with LocalStorage.
1936
1937         Project file stuff:
1938         * GNUmakefile.am:
1939         * WebKit2.pri:
1940         * WebKit2.pro:
1941         * WebKit2.xcodeproj/project.pbxproj:
1942         * win/WebKit2.vcproj:
1943         * win/WebKit2Common.vsprops:
1944         * win/WebKit2Generated.make:
1945
1946         WK2 derived sources and API stuff:
1947         * DerivedSources.make:
1948         * DerivedSources.pro:
1949         * Platform/CoreIPC/MessageID.h:
1950         * Shared/API/c/WKBase.h:
1951         * Shared/APIObject.h:
1952         * UIProcess/API/C/WKAPICast.h:
1953
1954         Add an KeyValueStorageManager to the context and invalidate it at the appropriate times:
1955         * UIProcess/WebContext.cpp:
1956         (WebKit::WebContext::WebContext):
1957         (WebKit::WebContext::~WebContext):
1958         (WebKit::WebContext::disconnectProcess):
1959         (WebKit::WebContext::didReceiveMessage):
1960         * UIProcess/WebContext.h:
1961         (WebKit::WebContext::keyValueStorageManagerProxy):
1962
1963         Add API to get the KeyValueStorageManager for a context:
1964         * UIProcess/API/C/WKContext.cpp:
1965         (WKContextGetKeyValueStorageManager):
1966         * UIProcess/API/C/WKContext.h:
1967
1968         Route messages to the right place:
1969         * UIProcess/WebProcessProxy.cpp:
1970         (WebKit::WebProcessProxy::didReceiveMessage):
1971         * WebProcess/WebProcess.cpp:
1972         (WebKit::WebProcess::didReceiveMessage):
1973
1974         Add the API object, which wraps to WebKeyValueStorageManagerProxy:
1975         * UIProcess/API/C/WKKeyValueStorageManager.cpp: Added.
1976         (WKKeyValueStorageManagerGetTypeID):
1977         (WKKeyValueStorageManagerGetKeyValueStorageOrigins):
1978         (WKKeyValueStorageManagerDeleteEntriesForOrigin):
1979         (WKKeyValueStorageManagerDeleteAllEntries):
1980         * UIProcess/API/C/WKKeyValueStorageManager.h: Added.
1981
1982         The UIProcess implementation of the manager to send messages to the WebProcess and pipe a callback back up to the client:
1983         * UIProcess/WebKeyValueStorageManagerProxy.cpp: Added.
1984         (WebKit::WebKeyValueStorageManagerProxy::create):
1985         (WebKit::WebKeyValueStorageManagerProxy::WebKeyValueStorageManagerProxy):
1986         (WebKit::WebKeyValueStorageManagerProxy::~WebKeyValueStorageManagerProxy):
1987         (WebKit::WebKeyValueStorageManagerProxy::invalidate):
1988         (WebKit::WebKeyValueStorageManagerProxy::didReceiveMessage):
1989         (WebKit::WebKeyValueStorageManagerProxy::getKeyValueStorageOrigins):
1990         (WebKit::WebKeyValueStorageManagerProxy::didGetKeyValueStorageOrigins):
1991         (WebKit::WebKeyValueStorageManagerProxy::deleteEntriesForOrigin):
1992         (WebKit::WebKeyValueStorageManagerProxy::deleteAllEntries):
1993         * UIProcess/WebKeyValueStorageManagerProxy.h: Added.
1994         (WebKit::WebKeyValueStorageManagerProxy::clearContext):
1995         (WebKit::WebKeyValueStorageManagerProxy::type):
1996         * UIProcess/WebKeyValueStorageManagerProxy.messages.in: Added.
1997
1998         The WebProcess implementation to response to UIProcess messages and actually do the dirty-work in WebCore:
1999         * WebProcess/KeyValueStorage: Added.
2000         * WebProcess/KeyValueStorage/WebKeyValueStorageManager.cpp: Added.
2001         (WebKit::WebKeyValueStorageManager::shared):
2002         (WebKit::WebKeyValueStorageManager::WebKeyValueStorageManager):
2003         (WebKit::WebKeyValueStorageManager::didReceiveMessage):
2004         (WebKit::WebKeyValueStorageManager::getKeyValueStorageOrigins):
2005         (WebKit::WebKeyValueStorageManager::deleteEntriesForOrigin):
2006         (WebKit::WebKeyValueStorageManager::deleteAllEntries):
2007         * WebProcess/KeyValueStorage/WebKeyValueStorageManager.h: Added.
2008         * WebProcess/KeyValueStorage/WebKeyValueStorageManager.messages.in: Added.
2009
2010 2011-02-24  Darin Adler  <darin@apple.com>
2011
2012         Reviewed by Anders Carlsson.
2013
2014         WebKit2: Image-based cursors do not work
2015         https://bugs.webkit.org/show_bug.cgi?id=55184
2016
2017         * Shared/ShareableBitmap.h: Added releaseData function
2018         declaration. This is only defined for CG, but we can declare
2019         it without defining it on non-CG platforms without causing problems.
2020
2021         * Shared/WebCoreArgumentCoders.cpp: Added.
2022         (CoreIPC::encodeImage): Added. For use in the Cursor argument coder.
2023         (CoreIPC::decodeImage): Ditto.
2024
2025         * Shared/WebCoreArgumentCoders.h: Added code to the Cursor encoder
2026         and decoder to handle image-based cursors, using the new encodeImage
2027         and decodeImage functions.
2028
2029         * Shared/cg/ShareableBitmapCG.cpp:
2030         (WebKit::ShareableBitmap::releaseData): Added.
2031         (WebKit::ShareableBitmap::createGraphicsContext): Use
2032         CGBitmapContextCreateWithData instead of CGBitmapContextCreate,
2033         to guarantee we outlast the CGBitmapContext we create.
2034         (WebKit::ShareableBitmap::paint): Got rid of unnneeded local variable.
2035
2036         * Shared/cg/WebCoreArgumentCodersCG.cpp: Added.
2037         (CoreIPC::createImage): Added. For use by CoreIPC::decodeImage.
2038
2039         * WebKit2.xcodeproj/project.pbxproj: Added WebCoreArgumentCoders.cpp
2040         and WebCoreArgumentCodersCG.cpp.
2041         * win/WebKit2.vcproj: Ditto.
2042
2043 2011-02-24  Anders Carlsson  <andersca@apple.com>
2044
2045         Reviewed by Dan Bernstein.
2046
2047         Crash when trying to send a sync message on an invalid connection
2048         https://bugs.webkit.org/show_bug.cgi?id=55190
2049         <rdar://problem/9035806>
2050
2051         * Platform/CoreIPC/Connection.cpp:
2052         (CoreIPC::Connection::sendSyncMessage):
2053         Don't try to call a client function if isValid() returns false since the client
2054         will be null in that case.
2055
2056 2011-02-24  Anders Carlsson  <andersca@apple.com>
2057
2058         Reviewed by Dan Bernstein.
2059
2060         Remove the layer backed drawing area
2061         https://bugs.webkit.org/show_bug.cgi?id=55174
2062
2063         * GNUmakefile.am:
2064         * Shared/DrawingAreaInfo.h:
2065         * UIProcess/API/mac/WKView.mm:
2066         * UIProcess/LayerBackedDrawingAreaProxy.cpp: Removed.
2067         * UIProcess/LayerBackedDrawingAreaProxy.h: Removed.
2068         * UIProcess/mac/LayerBackedDrawingAreaProxyMac.mm: Removed.
2069         * UIProcess/win/LayerBackedDrawingAreaProxyWin.cpp: Removed.
2070         * UIProcess/win/WebView.cpp:
2071         * WebKit2.xcodeproj/project.pbxproj:
2072         * WebProcess/WebPage/DrawingArea.cpp:
2073         (WebKit::DrawingArea::create):
2074         * WebProcess/WebPage/LayerBackedDrawingArea.cpp: Removed.
2075         * WebProcess/WebPage/LayerBackedDrawingArea.h: Removed.
2076         * WebProcess/WebPage/mac/LayerBackedDrawingAreaMac.mm: Removed.
2077         * WebProcess/WebPage/win/LayerBackedDrawingAreaWin.cpp: Removed.
2078         * win/WebKit2.vcproj:
2079
2080 2011-02-24  Mike Thole  <mthole@apple.com>
2081
2082         Reviewed by Sam Weinig.
2083
2084         WK2: Add ability to get document node for a WKBundleNodeHandle
2085         https://bugs.webkit.org/post_bug.cgi
2086
2087         * WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp:
2088         (WKBundleNodeHandleCopyDocument):
2089         * WebProcess/InjectedBundle/API/c/WKBundleNodeHandlePrivate.h:
2090         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
2091         (WebKit::InjectedBundleNodeHandle::document):
2092         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h:
2093
2094 2011-02-24  Brady Eidson  <beidson@apple.com>
2095
2096         Reviewed by Adam Roben and looked at by Brian Weinstein.
2097
2098         https://bugs.webkit.org/show_bug.cgi?id=55165
2099         Can call CF API with a null CFArray in WebResourceCacheManager
2100
2101         * WebProcess/ResourceCache/WebResourceCacheManager.cpp:
2102         (WebKit::WebResourceCacheManager::getCacheOrigins): cfURLCacheHostNames() can return a null CFArrayRef, 
2103           so the call to CFArrayGetCount must be null checked.
2104
2105 2011-02-24  Anders Carlsson  <andersca@apple.com>
2106
2107         Reviewed by Simon Fraser.
2108
2109         ASSERTION FAILED: !isInAcceleratedCompositingMode() when entering accelerated compositing early
2110         https://bugs.webkit.org/show_bug.cgi?id=55162
2111         <rdar://problem/9048523>
2112
2113         * WebProcess/WebPage/DrawingAreaImpl.cpp:
2114         (WebKit::DrawingAreaImpl::updateState):
2115         Call setShouldNotifyAfterNextScheduledLayerFlush(false) so the web process process won't send an
2116         EnterAcceleratedCompositingMode message.
2117
2118         (WebKit::DrawingAreaImpl::enterAcceleratedCompositingMode):
2119         setShouldNotifyAfterNextScheduledLayerFlush now takes a boolean.
2120
2121         * WebProcess/WebPage/LayerTreeHost.h:
2122         * WebProcess/WebPage/mac/LayerTreeHostMac.h:
2123         * WebProcess/WebPage/mac/LayerTreeHostMac.mm:
2124         (WebKit::LayerTreeHostMac::setShouldNotifyAfterNextScheduledLayerFlush):
2125         Make this take a boolean.
2126
2127 2011-02-24  Peter Kasting  <pkasting@google.com>
2128
2129         Reviewed by Eric Seidel.
2130
2131         Drop the "U; " encryption level from the User Agent string.
2132         https://bugs.webkit.org/show_bug.cgi?id=54566
2133
2134         * UIProcess/gtk/WebPageProxyGtk.cpp:
2135         (WebKit::WebPageProxy::standardUserAgent):
2136         * UIProcess/mac/WebPageProxyMac.mm:
2137         (WebKit::WebPageProxy::standardUserAgent):
2138         * UIProcess/qt/WebPageProxyQt.cpp:
2139         (WebKit::WebPageProxy::standardUserAgent):
2140         * UIProcess/win/WebPageProxyWin.cpp:
2141         (WebKit::WebPageProxy::standardUserAgent):
2142
2143 2011-02-24  Andrew Wilson  <atwilson@chromium.org>
2144
2145         Unreviewed, rolling out r79570.
2146         http://trac.webkit.org/changeset/79570
2147         https://bugs.webkit.org/show_bug.cgi?id=54874
2148
2149         Breaks chromium build because glue/mocks/mock_web_frame.h/cc
2150         was not updated
2151
2152         * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
2153         * WebProcess/InjectedBundle/API/c/WKBundleFramePrivate.h:
2154
2155 2011-02-23  Brian Weinstein  <bweinstein@apple.com>
2156
2157         Reviewed by Adam Roben and looked over by Jessie Berlin.
2158
2159         Part of WebKit2: Need a way to manage cookies from the web process
2160         https://bugs.webkit.org/show_bug.cgi?id=55086
2161         
2162         This patch adds the plumbing and classes that are needed to manage cookies from the web process.
2163         The functions that the API calls are currently stubs, but will be implemented in a follow-up patch.
2164
2165         Project file changes.
2166         * DerivedSources.make:
2167         * DerivedSources.pro:
2168         * GNUmakefile.am:
2169         * WebKit2.pri:
2170         * WebKit2.pro:
2171         * WebKit2.xcodeproj/project.pbxproj:
2172         * win/WebKit2.vcproj:
2173         * win/WebKit2Common.vsprops:
2174         * win/WebKit2Generated.make:
2175
2176         Add some needed plumbing for WebCookieManager{Proxy}.
2177         * Platform/CoreIPC/MessageID.h:
2178         * Shared/API/c/WKBase.h:
2179         * Shared/APIObject.h:
2180         * UIProcess/API/C/WKAPICast.h:
2181
2182         * UIProcess/API/C/WKContext.cpp:
2183         (WKContextGetCookieManager): Gets the cookie manager proxy.
2184         * UIProcess/API/C/WKContext.h:
2185         * UIProcess/API/C/WKCookieManager.cpp: Added.
2186         (WKCookieManagerGetTypeID):
2187         (WKCookieManagerGetHostnamesWithCookies): Calls through to WebCookieManagerProxy.
2188         (WKCookieManagerDeleteCookiesForHostname): Ditto.
2189         (WKCookieManagerDeleteAllCookies): Ditto.
2190         * UIProcess/API/C/WKCookieManager.h: Added.
2191
2192         * UIProcess/WebProcessProxy.cpp:
2193         (WebKit::WebProcessProxy::didReceiveMessage): Add a case for the cookie manager.
2194         * UIProcess/WebContext.cpp:
2195         (WebKit::WebContext::WebContext): Initialize the cookie manager.
2196         (WebKit::WebContext::~WebContext): Invalidate the cookie manager.
2197         (WebKit::WebContext::disconnectProcess): Ditto.
2198         (WebKit::WebContext::didReceiveMessage): Add a case for the cookie manager.
2199         * UIProcess/WebContext.h:
2200         (WebKit::WebContext::cookieManagerProxy): Returns the cookie manager.
2201         * WebProcess/WebProcess.cpp:
2202         (WebKit::WebProcess::didReceiveMessage): Add a case for the cookie manager.
2203
2204         * UIProcess/WebCookieManagerProxy.cpp: Added.
2205         (WebKit::WebCookieManagerProxy::create):
2206         (WebKit::WebCookieManagerProxy::WebCookieManagerProxy):
2207         (WebKit::WebCookieManagerProxy::~WebCookieManagerProxy):
2208         (WebKit::WebCookieManagerProxy::invalidate):
2209         (WebKit::WebCookieManagerProxy::didReceiveMessage): 
2210         (WebKit::WebCookieManagerProxy::getHostnamesWithCookies): Call through to the web process to get hostnames with cookies.
2211         (WebKit::WebCookieManagerProxy::didGetHostnamesWithCookies): Call the callback we were passed in getHostnamesWithCookies.
2212         (WebKit::WebCookieManagerProxy::deleteCookiesForHostname): Call through to the web process to delete cookies
2213             for the origin.
2214         (WebKit::WebCookieManagerProxy::deleteAllCookies): Call through to the web process to delete all cookies.
2215         * UIProcess/WebCookieManagerProxy.h: Added.
2216         (WebKit::WebCookieManagerProxy::clearContext):
2217         (WebKit::WebCookieManagerProxy::type):
2218         * UIProcess/WebCookieManagerProxy.messages.in: Added.
2219
2220         * WebProcess/Cookies: Added.
2221         * WebProcess/Cookies/WebCookieManager.cpp: Added.
2222         (WebKit::WebCookieManager::shared):
2223         (WebKit::WebCookieManager::WebCookieManager):
2224         (WebKit::WebCookieManager::didReceiveMessage): Call through to didReceiveWebCookieManagerMessage.
2225         (WebKit::WebCookieManager::getHostnamesWithCookies): Build an array from a HashSet (that isn't filled yet), and 
2226             convert that HashSet to a Vector to send to the UI process.
2227         (WebKit::WebCookieManager::deleteCookiesForHostname): Added a stub.
2228         (WebKit::WebCookieManager::deleteAllCookies): Ditto.
2229         * WebProcess/Cookies/WebCookieManager.h: Added.
2230         * WebProcess/Cookies/WebCookieManager.messages.in: Added.
2231
2232 2011-02-24   Amruth Raj  <amruthraj@motorola.com> and Ravi Phaneendra Kasibhatla  <ravi.kasibhatla@motorola.com> and Alejandro G. Castro  <alex@igalia.com>
2233
2234         Reviewed by Martin Robinson.
2235
2236         [GTK] Implement WebEventFactory, WebErrors classes for WebKit2
2237         https://bugs.webkit.org/show_bug.cgi?id=48510
2238
2239         * GNUmakefile.am:
2240         * Shared/gtk/WebEventFactory.cpp: Added. implementation for
2241         WebMouseEvent, WebWheelEvent, WebKeyboardEvent.
2242         * Shared/gtk/WebEventFactory.h: Added.
2243         * WebProcess/WebCoreSupport/gtk/WebErrorsGtk.cpp: Added. Stubbed
2244         implementation for GTK port.
2245
2246 2011-02-24  Vsevolod Vlasov  <vsevik@chromium.org>
2247
2248         Reviewed by Alexey Proskuryakov.
2249
2250         DumpRenderTree should reset frame opener between tests.
2251         https://bugs.webkit.org/show_bug.cgi?id=54874
2252
2253         Added clearOpener method to WKBundleWebFramePrivate.
2254
2255         * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
2256         (WKBundleFrameClearOpener):
2257         * WebProcess/InjectedBundle/API/c/WKBundleFramePrivate.h:
2258
2259 2011-02-24  Benjamin Poulain  <benjamin.poulain@nokia.com>
2260
2261         Reviewed by Eric Seidel.
2262
2263         Support building WebKit with Python 3
2264         https://bugs.webkit.org/show_bug.cgi?id=55038
2265
2266         Update the generator scripts to support Python 3.
2267
2268         * Scripts/generate-message-receiver.py: print is a function in Python 3, write the output to
2269         sys.stdout to be compatible with Python 2 and 3.
2270         * Scripts/generate-messages-header.py:
2271         * Scripts/webkit2/messages.py: dist.iteritems does not exist in Python 3, fallback
2272           to dict.items which is common to Python 2 and 3.
2273
2274 2011-02-24  Andras Becsi  <abecsi@webkit.org>
2275
2276         Reviewed by Laszlo Gombos.
2277
2278         [Qt] MinGW build fails to link
2279         https://bugs.webkit.org/show_bug.cgi?id=55050
2280
2281         Prepend the libraries of subcomponents instead of appending them
2282         to fix the library order according to the dependency of the libraries
2283
2284         * WebKit2.pri:
2285
2286 2011-02-24  Andras Becsi  <abecsi@webkit.org>
2287
2288         Reviewed by Csaba Osztrogonác.
2289
2290         [Qt] REGRESSION(69304): WKNativeEvent.h forwarding header is always regenerated
2291         https://bugs.webkit.org/show_bug.cgi?id=47589
2292
2293         In case of file name clashes only generate forwarding header for the current platform.
2294
2295         * Scripts/generate-forwarding-headers.pl:
2296
2297 2011-02-23  Anders Carlsson  <andersca@apple.com>
2298
2299         Reviewed by Sam Weinig.
2300
2301         Remove some of the old accelerated compositing code
2302         https://bugs.webkit.org/show_bug.cgi?id=55084
2303
2304         * UIProcess/API/mac/PageClientImpl.h:
2305         * UIProcess/API/mac/PageClientImpl.mm:
2306         (WebKit::PageClientImpl::exitAcceleratedCompositingMode):
2307         * UIProcess/API/mac/WKView.mm:
2308         * UIProcess/API/mac/WKViewInternal.h:
2309         * UIProcess/API/qt/qwkpage_p.h:
2310         * UIProcess/PageClient.h:
2311         * UIProcess/WebPageProxy.cpp:
2312         (WebKit::WebPageProxy::exitAcceleratedCompositingMode):
2313         * UIProcess/WebPageProxy.h:
2314         * UIProcess/WebPageProxy.messages.in:
2315         * UIProcess/mac/LayerBackedDrawingAreaProxyMac.mm:
2316         (WebKit::LayerBackedDrawingAreaProxy::attachCompositingContext):
2317         (WebKit::LayerBackedDrawingAreaProxy::detachCompositingContext):
2318         * UIProcess/win/WebView.cpp:
2319         * UIProcess/win/WebView.h:
2320         * WebProcess/WebPage/WebPage.cpp:
2321         (WebKit::WebPage::enterAcceleratedCompositingMode):
2322         (WebKit::WebPage::exitAcceleratedCompositingMode):
2323         * WebProcess/WebPage/WebPage.h:
2324
2325 2011-02-23  Enrica Casucci  <enrica@apple.com>
2326
2327         Reverting an unintentional change that was part of http://trac.webkit.org/changeset/79494.
2328         Unreviewed.
2329
2330         * WebProcess/WebPage/mac/WebPageMac.mm:
2331         (WebKit::WebPage::interceptEditingKeyboardEvent):
2332
2333 2011-02-18  Enrica Casucci  <enrica@apple.com>
2334
2335         Reviewed by Adam Roben.
2336
2337         Mac OS X Services are not available for selected text in WebKit2 windows.
2338         https://bugs.webkit.org/show_bug.cgi?id=54777
2339         <rdar://problem/8666428>
2340         
2341         This patch adds support for Mac OS X Services in WebKit2 windows.
2342         In WKView we now call registerServicesMenuSendTypes providing the
2343         pasteboard types supported by WebKit and we also implement the two
2344         protocol methods required to validate the send type and write the
2345         content to the pasteboard. Unfortunately, AppKit expects the content
2346         to be available in the pasteboard upon return from writeSelectionToPasteboard and
2347         this is the reason why the call to the WebProcess is synchronous.
2348
2349         * Shared/SelectionState.h:
2350         (WebKit::SelectionState::SelectionState): Extended to include
2351         isContentRichlyEditable
2352         * Shared/mac/PasteboardTypes.h:
2353         * Shared/mac/PasteboardTypes.mm:
2354         (WebKit::PasteboardTypes::forSelection): Added.
2355         * UIProcess/API/mac/WKView.mm:
2356         (-[WKView initWithFrame:contextRef:pageGroupRef:]): Added call
2357         to registerServicesMenuSendTypes.
2358         (-[WKView writeSelectionToPasteboard:types:]): Added.
2359         (-[WKView validRequestorForSendType:returnType:]): Added.
2360         * UIProcess/WebPageProxy.cpp:
2361         (WebKit::WebPageProxy::writeSelectionToPasteboard):
2362         * UIProcess/WebPageProxy.h:
2363         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
2364         (WebKit::WebEditorClient::respondToChangedSelection): Modified to
2365         support the new SelectionState value.
2366         * WebProcess/WebPage/WebPage.h:
2367         * WebProcess/WebPage/WebPage.messages.in:
2368         * WebProcess/WebPage/mac/WebPageMac.mm:
2369         (WebKit::WebPage::writeSelectionToPasteboard): Added synchronous
2370         message to write the selected content to the pasteboard.
2371
2372 2011-02-23  Anders Carlsson  <andersca@apple.com>
2373
2374         Reviewed by Sam Weinig.
2375
2376         Add a ShareableBitmap::create overload that takes an existing SharedMemory object
2377         https://bugs.webkit.org/show_bug.cgi?id=55081
2378
2379         * Shared/ShareableBitmap.cpp:
2380         (WebKit::ShareableBitmap::createShareable):
2381         (WebKit::ShareableBitmap::create):
2382         * Shared/ShareableBitmap.h:
2383
2384 2011-02-23  Anders Carlsson  <andersca@apple.com>
2385
2386         Reviewed by Dan Bernstein.
2387
2388         Web Inspector toolbar looks bad in WebKit2
2389         https://bugs.webkit.org/show_bug.cgi?id=55076
2390         <rdar://problem/8866258>
2391
2392         * UIProcess/API/mac/WKView.mm:
2393         (-[WKView mouseDownCanMoveWindow]):
2394         Return NO from mouseDownCanMoveWindow to prevent drags in the (now transparent) inspector WKView
2395         from dragging the window around.
2396
2397         * UIProcess/mac/WebInspectorProxyMac.mm:
2398         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
2399         Call [WKView setDrawsBackground:NO].
2400
2401 2011-02-23  Sam Weinig  <sam@webkit.org>
2402
2403         Reviewed by Anders Carlsson.
2404
2405         Remove WKPageForceRepaintWithInvalidation and instead make WKPageForceRepaint
2406         always dirty the entire page.
2407
2408         * Shared/ForceRepaintFlags.h: Removed.
2409         * UIProcess/API/C/WKPage.cpp:
2410         (WKPageForceRepaint):
2411         * UIProcess/API/C/WKPage.h:
2412         * UIProcess/WebPageProxy.cpp:
2413         (WebKit::WebPageProxy::forceRepaint):
2414         * UIProcess/WebPageProxy.h:
2415         * WebKit2.pro:
2416         * WebKit2.xcodeproj/project.pbxproj:
2417         * WebProcess/WebPage/DrawingAreaImpl.cpp:
2418         (WebKit::DrawingAreaImpl::forceRepaint):
2419         * WebProcess/WebPage/WebPage.cpp:
2420         (WebKit::WebPage::forceRepaint):
2421         * WebProcess/WebPage/WebPage.h:
2422         * WebProcess/WebPage/WebPage.messages.in:
2423         * win/WebKit2.vcproj:
2424
2425 2011-02-23  Anders Carlsson  <andersca@apple.com>
2426
2427         Reviewed by Sam Weinig.
2428
2429         Race condition when creating and destroying pages quickly
2430         https://bugs.webkit.org/show_bug.cgi?id=55061
2431         <rdar://problem/8708435>
2432
2433         When the last page in a web process is closed, the web process would
2434         previously terminate, even if the UI process had created a new page
2435         (the CreateNewPage message just wouldn't have reached the web process yet).
2436
2437         Fix this by adding a ShouldTerminate message that the web process sends when it's
2438         about to terminate. If the UI process has any pending pages, downloads etc. it will
2439         prevent the web process from terminating. Otherwise, it will immmediately disconnect
2440         the WebPageProxy so that creating a page after that will launch a new web process.
2441
2442         * UIProcess/Plugins/WebPluginSiteDataManager.cpp:
2443         (WebKit::WebPluginSiteDataManager::shouldTerminate):
2444         * UIProcess/Plugins/WebPluginSiteDataManager.h:
2445         * UIProcess/WebContext.cpp:
2446         (WebKit::WebContext::shouldTerminate):
2447         (WebKit::WebContext::disconnectProcess):
2448         * UIProcess/WebContext.h:
2449         * UIProcess/WebProcessProxy.cpp:
2450         (WebKit::WebProcessProxy::disconnect):
2451         (WebKit::WebProcessProxy::didReceiveSyncMessage):
2452         (WebKit::WebProcessProxy::didClose):
2453         (WebKit::WebProcessProxy::shouldTerminate):
2454         * UIProcess/WebProcessProxy.h:
2455         * UIProcess/WebProcessProxy.messages.in:
2456         * WebProcess/WebProcess.cpp:
2457         (WebKit::WebProcess::terminateIfPossible):
2458
2459 2011-02-23  Mike Thole  <mthole@apple.com>
2460
2461         Reviewed by Darin Adler.
2462
2463         WKBundleNavigationAction.h should be exposed as a public header
2464         https://bugs.webkit.org/show_bug.cgi?id=55059
2465
2466         * WebKit2.xcodeproj/project.pbxproj:
2467         Changed WKBundleNavigationAction.h from 'project' to 'public'.
2468
2469 2011-02-23  Siddharth Mathur  <siddharth.mathur@nokia.com>
2470
2471         Reviewed by Laszlo Gombos.
2472
2473         [Qt] Make sure Symbian binary UIDs are unique
2474
2475         * WebProcess.pro: Resolve the UID collision with QtTestBrowser.pro
2476         by changing the UID.
2477
2478 2011-02-23  Siddharth Mathur  <siddharth.mathur@nokia.com>
2479
2480         Reviewed by Laszlo Gombos.
2481
2482         [Qt] Fix the Symbian build after r79334
2483         https://bugs.webkit.org/show_bug.cgi?id=55044
2484
2485         * WebKit2.pri: Copy the rules from JavaScriptCore.pri for
2486         defineTest().
2487
2488         Remove addWebKit2LibWholeArchive as it is no longer needed.
2489
2490 2011-02-23  Alejandro G. Castro  <alex@igalia.com>
2491
2492         Unreviewed, fixed GTK WebKit2 compilation after r79366.
2493
2494         * GNUmakefile.am:
2495
2496 2011-02-23  Patrick Gansterer  <paroga@webkit.org>
2497
2498         Reviewed by Darin Adler.
2499
2500         Rename PLATFORM(CF) to USE(CF)
2501         https://bugs.webkit.org/show_bug.cgi?id=53540
2502
2503         * UIProcess/WebBackForwardList.h:
2504         * UIProcess/WebPageProxy.cpp:
2505         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
2506         (WebKit::formatLocalizedString):
2507
2508 2011-02-23  Benjamin Poulain  <benjamin.poulain@nokia.com>
2509
2510         Reviewed by Andreas Kling.
2511
2512         [Qt] [WK2] When the context menu is empty, we should still send the signal QWKPage::showContextMenu()
2513         https://bugs.webkit.org/show_bug.cgi?id=54996
2514
2515         Send the signal QWKPage::showContextMenu() with an empty menu even if the content menu generated
2516         is empty/contain only disabled elements.
2517
2518         * UIProcess/API/qt/qgraphicswkview.cpp:
2519         (QGraphicsWKView::showContextMenu):
2520         * UIProcess/qt/WebContextMenuProxyQt.cpp:
2521         (WebKit::WebContextMenuProxyQt::showContextMenu):
2522
2523 2011-02-22  Dan Bernstein  <mitz@apple.com>
2524
2525         LLVM Compiler build fix.
2526
2527         * Scripts/webkit2/messages.py:
2528         * WebProcess/ApplicationCache/WebApplicationCacheManager.h:
2529
2530 2011-02-22  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
2531
2532         Reviewed by Alexey Proskuryakov.
2533
2534         Drop the language tag part from the User Agent string
2535         https://bugs.webkit.org/show_bug.cgi?id=54560
2536
2537         * UIProcess/gtk/WebPageProxyGtk.cpp:
2538         (WebKit::WebPageProxy::standardUserAgent):
2539
2540         * UIProcess/mac/WebPageProxyMac.mm:
2541         (WebKit::WebPageProxy::standardUserAgent):
2542
2543         * UIProcess/qt/WebPageProxyQt.cpp:
2544         (WebKit::WebPageProxy::standardUserAgent):
2545
2546         * UIProcess/win/WebPageProxyWin.cpp:
2547         (WebKit::WebPageProxy::standardUserAgent): Drop the language tag
2548         part and fix style.
2549
2550 2011-02-22  Sam Weinig  <sam@webkit.org>
2551
2552         Reviewed by Anders Carlsson.
2553
2554         Add WebKit2 API to force a repaint with an invalidation
2555         https://bugs.webkit.org/show_bug.cgi?id=55015
2556
2557         * Shared/ForceRepaintFlags.h: Added.
2558         * UIProcess/API/C/WKPage.cpp:
2559         (WKPageForceRepaint):
2560         (WKPageForceRepaintWithInvalidation):
2561         * UIProcess/API/C/WKPage.h:
2562         Add WKPageForceRepaintWithInvalidation which does the same thing WKPageForceRepaint
2563         but also calls setNeedsDisplay on the entire bounds of the page.
2564
2565         * UIProcess/WebPageProxy.cpp:
2566         (WebKit::WebPageProxy::forceRepaint):
2567         * UIProcess/WebPageProxy.h:
2568         * WebProcess/WebPage/WebPage.cpp:
2569         (WebKit::WebPage::forceRepaint):
2570         * WebProcess/WebPage/WebPage.h:
2571         * WebProcess/WebPage/WebPage.messages.in:
2572         Pipe the flag down to the WebProcess.
2573
2574         * WebKit2.pro:
2575         * WebKit2.xcodeproj/project.pbxproj:
2576         * win/WebKit2.vcproj:
2577         Add ForceRepaintFlags.h.
2578
2579 2011-02-22  Simon Fraser  <simon.fraser@apple.com>
2580
2581         Reviewed by Dan Bernstein.
2582
2583         <rdar://problem/9039670>
2584         
2585         Make sure that we set the accelerateDrawing property on the LayerTreeHosts's
2586         non-composited content layer if the preference is set.
2587
2588         * WebProcess/WebPage/mac/LayerTreeHostMac.mm:
2589         (WebKit::LayerTreeHostMac::LayerTreeHostMac):
2590
2591 2011-02-22  Brady Eidson  <beidson@apple.com>
2592
2593         Fix it Windows-style.
2594
2595         * WebProcess/WebProcess.cpp:
2596         (WebKit::WebProcess::getSitesWithPluginData):
2597         (WebKit::WebProcess::clearPluginSiteData):
2598
2599 2011-02-22  Anders Carlsson  <andersca@apple.com>
2600
2601         Reviewed by Dan Bernstein.
2602
2603         Rename WebProcess::shutdownIfPossible to WebProcess::terminateIfPossible
2604         https://bugs.webkit.org/show_bug.cgi?id=55008
2605
2606         * WebProcess/Downloads/DownloadManager.cpp:
2607         (WebKit::DownloadManager::downloadFinished):
2608         * WebProcess/WebProcess.cpp:
2609         (WebKit::WebProcess::removeWebPage):
2610         (WebKit::WebProcess::terminateIfPossible):
2611         (WebKit::WebProcess::getSitesWithPluginData):
2612         * WebProcess/WebProcess.h:
2613         * WebProcess/gtk/WebProcessGtk.cpp:
2614         (WebKit::WebProcess::platformTerminate):
2615         * WebProcess/mac/WebProcessMac.mm:
2616         (WebKit::WebProcess::platformTerminate):
2617         * WebProcess/qt/WebProcessQt.cpp:
2618         (WebKit::WebProcess::platformTerminate):
2619         * WebProcess/win/WebProcessWin.cpp:
2620         (WebKit::WebProcess::platformTerminate):
2621
2622 2011-02-22  Brady Eidson  <beidson@apple.com>
2623
2624         Windows build-fix attempt.
2625
2626         * win/WebKit2Generated.make:
2627
2628 2011-02-22  Csaba Osztrogonác  <ossy@webkit.org>
2629
2630         Unreviewed.
2631
2632         <rdar://problem/8762042> and  https://bugs.webkit.org/show_bug.cgi?id=54514
2633         API to view and delete Application Cache data by origin.
2634
2635         [Qt][WK2] Buildfix after r79364.
2636
2637         * DerivedSources.pro:
2638         * WebKit2.pri:
2639
2640 2011-02-22  Brady Eidson  <beidson@apple.com>
2641
2642         Reviewed by Anders Carlsson and looked over by Brian Weinstein.
2643
2644         <rdar://problem/8762042> and https://bugs.webkit.org/show_bug.cgi?id=54514
2645         API to view and delete Application Cache data by origin.
2646
2647         I couldn't help myself - I also re-alphabetized WebResourceCacheManager in many places where
2648         it's sorting was wrong due to a last minute name change.
2649
2650         Project file changes:
2651         * GNUmakefile.am:
2652         * win/WebKit2.vcproj:
2653         * win/WebKit2Common.vsprops:
2654         * win/WebKit2Generated.make:
2655         * WebKit2.pro:
2656         * WebKit2.xcodeproj/project.pbxproj:
2657
2658         WK2 build-system and API paperwork:
2659         * DerivedSources.make:
2660         * Platform/CoreIPC/MessageID.h:
2661         * Shared/API/c/WKBase.h:
2662         * Shared/APIObject.h:
2663         * UIProcess/API/C/WKAPICast.h:
2664
2665         Add a helper to perform an ArrayCallback with a Vector of SecurityOriginDatas:
2666         * Shared/SecurityOriginData.cpp:
2667         (WebKit::performAPICallbackWithSecurityOriginDataVector):
2668         * Shared/SecurityOriginData.h:
2669         * UIProcess/WebResourceCacheManagerProxy.cpp:
2670         (WebKit::WebResourceCacheManagerProxy::didGetCacheOrigins): Use performAPICallbackWithSecurityOriginDataVector here.
2671
2672         Add an ApplicationCacheManagerProxy to the context and invalidate it at the appropriate times:
2673         * UIProcess/WebContext.cpp:
2674         (WebKit::WebContext::WebContext):
2675         (WebKit::WebContext::~WebContext):
2676         (WebKit::WebContext::processDidClose):
2677         (WebKit::WebContext::didReceiveMessage): Route messages to the right proxy.
2678         * UIProcess/WebContext.h:
2679         (WebKit::WebContext::applicationCacheManagerProxy):
2680         (WebKit::WebContext::resourceCacheManagerProxy):
2681
2682         Add API to get the ApplicationCacheManager for a context:
2683         * UIProcess/API/C/WKContext.cpp:
2684         (WKContextGetApplicationCacheManager):
2685         (WKContextGetResourceCacheManager):
2686         * UIProcess/API/C/WKContext.h:
2687
2688         Route messages to the right place:
2689         * UIProcess/WebProcessProxy.cpp:
2690         (WebKit::WebProcessProxy::didReceiveMessage):
2691         * WebProcess/WebProcess.cpp:
2692         (WebKit::WebProcess::didReceiveMessage):
2693
2694         Add the API object, which wraps to WebApplicationCacheManagerProxy:
2695         * UIProcess/API/C/WKApplicationCacheManager.cpp: Added.
2696         (WKApplicationCacheManagerGetTypeID):
2697         (WKApplicationCacheManagerGetApplicationCacheOrigins):
2698         (WKApplicationCacheManagerDeleteEntriesForOrigin):
2699         (WKApplicationCacheManagerDeleteAllEntries):
2700         * UIProcess/API/C/WKApplicationCacheManager.h: Added.
2701
2702         The UIProcess implementation of the manager to send messages to the WebProcess and pipe a callback back up to the client:
2703         * UIProcess/WebApplicationCacheManagerProxy.cpp: Added.
2704         (WebKit::WebApplicationCacheManagerProxy::create):
2705         (WebKit::WebApplicationCacheManagerProxy::WebApplicationCacheManagerProxy):
2706         (WebKit::WebApplicationCacheManagerProxy::~WebApplicationCacheManagerProxy):
2707         (WebKit::WebApplicationCacheManagerProxy::invalidate):
2708         (WebKit::WebApplicationCacheManagerProxy::didReceiveMessage):
2709         (WebKit::WebApplicationCacheManagerProxy::getApplicationCacheOrigins):
2710         (WebKit::WebApplicationCacheManagerProxy::didGetApplicationCacheOrigins): Use performAPICallbackWithSecurityOriginDataVector here.
2711         (WebKit::WebApplicationCacheManagerProxy::deleteEntriesForOrigin):
2712         (WebKit::WebApplicationCacheManagerProxy::deleteAllEntries):
2713         * UIProcess/WebApplicationCacheManagerProxy.h: Added.
2714         (WebKit::WebApplicationCacheManagerProxy::clearContext):
2715         (WebKit::WebApplicationCacheManagerProxy::type):
2716         * UIProcess/WebApplicationCacheManagerProxy.messages.in: Added.
2717
2718         The WebProcess implementation to response to UIProcess messages and actually do the dirty-work in WebCore:
2719         * WebProcess/ApplicationCache: Added.
2720         * WebProcess/ApplicationCache/WebApplicationCacheManager.cpp: Added.
2721         (WebKit::WebApplicationCacheManager::shared):
2722         (WebKit::WebApplicationCacheManager::WebApplicationCacheManager):
2723         (WebKit::WebApplicationCacheManager::didReceiveMessage):
2724         (WebKit::WebApplicationCacheManager::getApplicationCacheOrigins):
2725         (WebKit::WebApplicationCacheManager::deleteEntriesForOrigin):
2726         (WebKit::WebApplicationCacheManager::deleteAllEntries):
2727         * WebProcess/ApplicationCache/WebApplicationCacheManager.h: Added.
2728         * WebProcess/ApplicationCache/WebApplicationCacheManager.messages.in: Added.
2729
2730 2011-02-22  Anders Carlsson  <andersca@apple.com>
2731
2732         Reviewed by Sam Weinig.
2733
2734         Get rid of WebProcessManager
2735         https://bugs.webkit.org/show_bug.cgi?id=55001
2736
2737         WebProcessManager had become a stupid map of WebContext > WebProcess relations,
2738         which isn't really useful since the WebContext already knows about its process.
2739
2740         * Shared/WebURLRequest.cpp:
2741         * UIProcess/API/mac/WKView.mm:
2742         * UIProcess/WebContext.cpp:
2743         (WebKit::WebContext::~WebContext):
2744         (WebKit::WebContext::ensureWebProcess):
2745         (WebKit::WebContext::processDidFinishLaunching):
2746         * UIProcess/WebProcessManager.cpp: Removed.
2747         * UIProcess/WebProcessManager.h: Removed.
2748         * UIProcess/WebProcessProxy.cpp:
2749         (WebKit::WebProcessProxy::didClose):
2750         * WebKit2.pro:
2751         * WebKit2.xcodeproj/project.pbxproj:
2752         * win/WebKit2.vcproj:
2753
2754 2011-02-22  Anders Carlsson  <andersca@apple.com>
2755
2756         Reviewed by Darin Adler.
2757
2758         Get rid of WebProcessManager::getAllWebProcessContexts
2759         https://bugs.webkit.org/show_bug.cgi?id=55000
2760
2761         * Shared/WebURLRequest.cpp:
2762         (WebKit::WebURLRequest::setDefaultTimeoutInterval):
2763         Call WebContext::allContexts instead.
2764
2765         * UIProcess/WebContext.cpp:
2766         * UIProcess/WebContext.h:
2767         Add a vector of WebContext objects. Update it when creating and destroying contexts.
2768
2769         * UIProcess/WebProcessManager.cpp:
2770         * UIProcess/WebProcessManager.h:
2771         Remove WebProcessManager::getAllWebProcessContexts.
2772
2773 2011-02-22  Sam Weinig  <sam@webkit.org>
2774
2775         Reviewed by Anders Carlsson.
2776
2777         Re-add early bail out in dispatchDecidePolicyForNavigationAction with prevents
2778         a crash running fast/loader/empty-embed-src-attribute.html. This matches a 
2779         bail out in the default policy delegate in WebKit1.
2780
2781         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2782         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
2783
2784 2011-02-22  Anders Carlsson  <andersca@apple.com>
2785
2786         Reviewed by Dan Bernstein.
2787
2788         Grammar correction from Spelling & Grammar window doesn't work
2789         https://bugs.webkit.org/show_bug.cgi?id=54982
2790         <rdar://problem/8940918>
2791
2792         * UIProcess/API/mac/WKView.mm:
2793         (-[WKView isGrammarCheckingEnabled]):
2794         (-[WKView setGrammarCheckingEnabled:]):
2795         Call down to the text checker.
2796
2797         * UIProcess/TextChecker.h:
2798         Add updateSpellingUIWithGrammarString.
2799
2800         * UIProcess/WebPageProxy.cpp:
2801         (WebKit::WebPageProxy::updateSpellingUIWithGrammarString):
2802         Call TextChecker::updateSpellingUIWithGrammarString.
2803
2804         * UIProcess/WebPageProxy.messages.in:
2805         Add UpdateSpellingUIWithGrammarString message.
2806
2807         * UIProcess/gtk/TextCheckerGtk.cpp:
2808         (WebKit::TextChecker::updateSpellingUIWithGrammarString):
2809         * UIProcess/qt/TextCheckerQt.cpp:
2810         (WebKit::TextChecker::updateSpellingUIWithGrammarString):
2811         * UIProcess/win/TextCheckerWin.cpp:
2812         (WebKit::TextChecker::updateSpellingUIWithGrammarString):
2813         Add stubs.
2814
2815         * UIProcess/mac/TextCheckerMac.mm:
2816         (WebKit::TextChecker::updateSpellingUIWithGrammarString):
2817         Update the spelling panel.
2818
2819         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
2820         (WebKit::WebEditorClient::updateSpellingUIWithGrammarString):
2821         Send an UpdateSpellingUIWithGrammarString message to the UI process.
2822
2823 2011-02-22  Balazs Kelemen  <kbalazs@webkit.org>
2824
2825         Reviewed by Anders Carlsson.
2826
2827         notImplemented() should behave identical in WebCore and WebKit2
2828         https://bugs.webkit.org/show_bug.cgi?id=54449
2829
2830         Use NotImplemented.h from WebCore. Initialize logging channels.
2831         Remove the WebKit2 concept of notImplemented().
2832
2833         * Platform/gtk/SharedMemoryGtk.cpp:
2834         * Platform/gtk/WorkQueueGtk.cpp:
2835         * Platform/qt/WorkQueueQt.cpp:
2836         * Platform/win/WorkQueueWin.cpp:
2837         * Shared/NotImplemented.h: Removed.
2838         * Shared/Plugins/NPIdentifierData.cpp:
2839         * Shared/Plugins/NPRemoteObjectMap.cpp:
2840         * Shared/Plugins/NPVariantData.cpp:
2841         * Shared/cairo/ShareableBitmapCairo.cpp:
2842         * Shared/gtk/ShareableBitmapGtk.cpp:
2843         * Shared/gtk/WebCoreArgumentCodersGtk.cpp:
2844         * Shared/qt/WebCoreArgumentCodersQt.cpp:
2845         * Shared/win/LayerTreeContextWin.cpp:
2846         * UIProcess/API/mac/PageClientImpl.mm:
2847         * UIProcess/API/qt/qwkpage.cpp:
2848         * UIProcess/Launcher/gtk/ThreadLauncherGtk.cpp:
2849         * UIProcess/Launcher/qt/ProcessLauncherQt.cpp:
2850         * UIProcess/Plugins/gtk/PluginInfoStoreGtk.cpp:
2851         * UIProcess/WebContext.cpp:
2852         (WebKit::WebContext::WebContext):
2853         * UIProcess/WebInspectorProxy.cpp:
2854         * UIProcess/gtk/TextCheckerGtk.cpp:
2855         * UIProcess/gtk/WebInspectorGtk.cpp:
2856         * UIProcess/gtk/WebPreferencesGtk.cpp:
2857         * UIProcess/qt/TextCheckerQt.cpp:
2858         * UIProcess/qt/WebInspectorProxyQt.cpp:
2859         * UIProcess/win/TextCheckerWin.cpp:
2860         * UIProcess/win/WebContextMenuProxyWin.cpp:
2861         * WebKit2.pro:
2862         * WebKit2.xcodeproj/project.pbxproj:
2863         * WebProcess/Downloads/cf/DownloadCFNet.cpp:
2864         * WebProcess/Downloads/curl/DownloadCurl.cpp:
2865         * WebProcess/Downloads/mac/DownloadMac.mm:
2866         * WebProcess/Downloads/qt/DownloadQt.cpp:
2867         * WebProcess/InjectedBundle/gtk/InjectedBundleGtk.cpp:
2868         * WebProcess/Plugins/Netscape/JSNPMethod.cpp:
2869         * WebProcess/Plugins/Netscape/NPJSObject.cpp:
2870         * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp:
2871         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
2872         * WebProcess/Plugins/Netscape/gtk/NetscapePluginGtk.cpp:
2873         * WebProcess/Plugins/Netscape/qt/NetscapePluginQt.cpp:
2874         * WebProcess/Plugins/Netscape/win/NetscapePluginWin.cpp:
2875         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2876         * WebProcess/WebCoreSupport/WebContextMenuClient.cpp:
2877         * WebProcess/WebCoreSupport/WebDragClient.cpp:
2878         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
2879         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2880         * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
2881         * WebProcess/WebCoreSupport/WebInspectorFrontendClient.cpp:
2882         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
2883         * WebProcess/WebCoreSupport/gtk/WebContextMenuClientGtk.cpp:
2884         * WebProcess/WebCoreSupport/gtk/WebPopupMenuGtk.cpp:
2885         * WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm:
2886         * WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
2887         * WebProcess/WebCoreSupport/qt/WebContextMenuClientQt.cpp:
2888         * WebProcess/WebPage/gtk/WebInspectorGtk.cpp:
2889         * WebProcess/WebPage/qt/WebInspectorQt.cpp:
2890         * WebProcess/WebProcess.cpp:
2891         (WebKit::WebProcess::WebProcess):
2892         * WebProcess/gtk/WebProcessGtk.cpp:
2893         * config.h:
2894         * win/WebKit2.vcproj:
2895
2896 2011-02-22  Brian Weinstein  <bweinstein@apple.com>
2897
2898         Rubber-stamped by Brady Eidson.
2899
2900         Invalidate the WebResourceCacheManagerProxy in WebContext::processDidClose.
2901
2902         * UIProcess/WebContext.cpp:
2903         (WebKit::WebContext::processDidClose):
2904
2905 2011-02-21  Adam Roben  <aroben@apple.com>
2906
2907         Make DrawingAreaProxyImpl keep track of the most recent state ID it sent to the web process
2908
2909         This will be useful for sending repeated messages for the same state ID to the web process.
2910         We don't do this currently, but will need to if we're asked to paint after we've thrown away
2911         our backing store to save memory.
2912
2913         Fixes <http://webkit.org/b/54916> DrawingAreaProxyImpl should keep track of the state ID it
2914         last sent to the web process
2915
2916         Reviewed by Anders Carlsson.
2917
2918         * UIProcess/DrawingAreaProxyImpl.cpp:
2919         (WebKit::DrawingAreaProxyImpl::DrawingAreaProxyImpl): Initialize m_requestedStateID, and
2920         reordered member initialization to match the new declaration order.
2921         (WebKit::DrawingAreaProxyImpl::didUpdateState): Added an assertion that the stateID we got
2922         from the web process is no newer than the most recent one we requested.
2923         (WebKit::DrawingAreaProxyImpl::sendUpdateState): Changed to increment and send
2924         m_requestedStateID instead of a new global stateID.
2925
2926         * UIProcess/DrawingAreaProxyImpl.h: Added m_requestedStateID, and moved the state IDs before
2927         other data members. Also beefed the comment explaining m_currentStateID.
2928
2929 2011-02-22  Andras Becsi  <abecsi@webkit.org>
2930
2931         Reviewed by Laszlo Gombos.
2932
2933         [Qt] Redesign the build system
2934         https://bugs.webkit.org/show_bug.cgi?id=51339
2935
2936         Part 2.
2937
2938         Build WebCore as a static library, compile the WebKit API and WebKit2 API
2939         in a final step and link to WebKit2, WebCore and JSC libraries to fix
2940         linking issues resulting from stripped away symbols.
2941
2942         * WebKit2.pri: Add include paths.
2943         * WebKit2.pro: Move include paths to WebKit2.pri and move
2944         the API source to WebKit/qt/QtWebKit.pro
2945
2946 2011-02-22  Benjamin Poulain  <benjamin.poulain@nokia.com>
2947
2948         Reviewed by Kenneth Rohde Christiansen.
2949
2950         [Qt] [WK2] Improve the memory handling of the context menu for WebKit 2
2951         https://bugs.webkit.org/show_bug.cgi?id=54902
2952
2953         Refactor the context menu handling of Qt to make it simpler to manage memory.
2954
2955         WebContextMenuProxyQt uses smart pointer for all the references to menu so
2956         there is no need to delete it explicitely.
2957
2958         Passing the QMenu from QWKPage to the client of the signal now uses a QSharedPointer so
2959         the client can choose to handle the memory, but there is no leak if it does not.
2960
2961         * UIProcess/API/qt/qgraphicswkview.cpp:
2962         (QGraphicsWKView::QGraphicsWKView):
2963         (QGraphicsWKView::showContextMenu):
2964         * UIProcess/API/qt/qgraphicswkview.h:
2965         * UIProcess/API/qt/qwkpage.h:
2966         * UIProcess/qt/WebContextMenuProxyQt.cpp:
2967         (WebKit::WebContextMenuProxyQt::showContextMenu):
2968         (WebKit::WebContextMenuProxyQt::createContextMenu):
2969         * UIProcess/qt/WebContextMenuProxyQt.h:
2970
2971 2011-02-22  Philippe Normand  <pnormand@igalia.com>
2972
2973         Reviewed by Xan Lopez.
2974
2975         [GTK] make distcheck fails
2976         https://bugs.webkit.org/show_bug.cgi?id=54943
2977
2978         Removed reference to NotImplemented.h which was removed.
2979
2980         * GNUmakefile.am:
2981
2982 2011-02-22  Kimmo Kinnunen  <kimmo.t.kinnunen@nokia.com>
2983
2984         Reviewed by Kenneth Rohde Christiansen.
2985
2986         [Qt] QtWebProcess should be installed with 'make install'
2987         https://bugs.webkit.org/show_bug.cgi?id=44100
2988
2989         Follow the standard in other project files and allow install
2990         location to be changed with INSTALL_BINS variable.
2991
2992         * WebProcess.pro: Install QtWebProcess.
2993
2994 2011-02-22  Sheriff Bot  <webkit.review.bot@gmail.com>
2995
2996         Unreviewed, rolling out r79296.
2997         http://trac.webkit.org/changeset/79296
2998         https://bugs.webkit.org/show_bug.cgi?id=54941
2999
3000         Breaks compilation on SnowLeapard Intel Release (Requested by
3001         kbalazs_ on #webkit).
3002
3003         * Platform/gtk/SharedMemoryGtk.cpp:
3004         * Platform/gtk/WorkQueueGtk.cpp:
3005         * Platform/qt/WorkQueueQt.cpp:
3006         * Platform/win/WorkQueueWin.cpp:
3007         * Shared/NotImplemented.h: Copied from Source/WebKit2/WebProcess/InjectedBundle/gtk/InjectedBundleGtk.cpp.
3008         * Shared/Plugins/NPIdentifierData.cpp:
3009         * Shared/Plugins/NPRemoteObjectMap.cpp:
3010         * Shared/Plugins/NPVariantData.cpp:
3011         * Shared/cairo/ShareableBitmapCairo.cpp:
3012         * Shared/gtk/ShareableBitmapGtk.cpp:
3013         * Shared/gtk/WebCoreArgumentCodersGtk.cpp:
3014         * Shared/qt/WebCoreArgumentCodersQt.cpp:
3015         * Shared/win/LayerTreeContextWin.cpp:
3016         * UIProcess/API/mac/PageClientImpl.mm:
3017         * UIProcess/API/qt/qwkpage.cpp:
3018         * UIProcess/Launcher/gtk/ThreadLauncherGtk.cpp:
3019         * UIProcess/Launcher/qt/ProcessLauncherQt.cpp:
3020         * UIProcess/Plugins/gtk/PluginInfoStoreGtk.cpp:
3021         * UIProcess/WebContext.cpp:
3022         (WebKit::WebContext::WebContext):
3023         * UIProcess/WebInspectorProxy.cpp:
3024         * UIProcess/gtk/TextCheckerGtk.cpp:
3025         * UIProcess/gtk/WebInspectorGtk.cpp:
3026         * UIProcess/gtk/WebPreferencesGtk.cpp:
3027         * UIProcess/qt/TextCheckerQt.cpp:
3028         * UIProcess/qt/WebInspectorProxyQt.cpp:
3029         * UIProcess/win/TextCheckerWin.cpp:
3030         * UIProcess/win/WebContextMenuProxyWin.cpp:
3031         * WebKit2.pro:
3032         * WebKit2.xcodeproj/project.pbxproj:
3033         * WebProcess/Downloads/cf/DownloadCFNet.cpp:
3034         * WebProcess/Downloads/curl/DownloadCurl.cpp:
3035         * WebProcess/Downloads/mac/DownloadMac.mm:
3036         * WebProcess/Downloads/qt/DownloadQt.cpp:
3037         * WebProcess/InjectedBundle/gtk/InjectedBundleGtk.cpp:
3038         * WebProcess/Plugins/Netscape/JSNPMethod.cpp:
3039         * WebProcess/Plugins/Netscape/NPJSObject.cpp:
3040         * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp:
3041         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
3042         * WebProcess/Plugins/Netscape/gtk/NetscapePluginGtk.cpp:
3043         * WebProcess/Plugins/Netscape/qt/NetscapePluginQt.cpp:
3044         * WebProcess/Plugins/Netscape/win/NetscapePluginWin.cpp:
3045         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3046         * WebProcess/WebCoreSupport/WebContextMenuClient.cpp:
3047         * WebProcess/WebCoreSupport/WebDragClient.cpp:
3048         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
3049         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3050         * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
3051         * WebProcess/WebCoreSupport/WebInspectorFrontendClient.cpp:
3052         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
3053         * WebProcess/WebCoreSupport/gtk/WebContextMenuClientGtk.cpp:
3054         * WebProcess/WebCoreSupport/gtk/WebPopupMenuGtk.cpp:
3055         * WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm:
3056         * WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
3057         * WebProcess/WebCoreSupport/qt/WebContextMenuClientQt.cpp:
3058         * WebProcess/WebPage/gtk/WebInspectorGtk.cpp:
3059         * WebProcess/WebPage/qt/WebInspectorQt.cpp:
3060         * WebProcess/WebProcess.cpp:
3061         (WebKit::WebProcess::WebProcess):
3062         * WebProcess/gtk/WebProcessGtk.cpp:
3063         * config.h:
3064         * win/WebKit2.vcproj:
3065
3066 2011-02-16  Balazs Kelemen  <kbalazs@webkit.org>
3067
3068         Reviewed by Anders Carlsson.
3069
3070         notImplemented() should behave identical in WebCore and WebKit2
3071         https://bugs.webkit.org/show_bug.cgi?id=54449
3072
3073         Use NotImplemented.h from WebCore. Initialize logging channels.
3074         Remove the WebKit2 concept of notImplemented().
3075
3076         * Platform/gtk/SharedMemoryGtk.cpp:
3077         * Platform/gtk/WorkQueueGtk.cpp:
3078         * Platform/qt/WorkQueueQt.cpp:
3079         * Platform/win/WorkQueueWin.cpp:
3080         * Shared/NotImplemented.h: Removed.
3081         * Shared/Plugins/NPIdentifierData.cpp:
3082         * Shared/Plugins/NPRemoteObjectMap.cpp:
3083         * Shared/Plugins/NPVariantData.cpp:
3084         * Shared/cairo/ShareableBitmapCairo.cpp:
3085         * Shared/gtk/ShareableBitmapGtk.cpp:
3086         * Shared/gtk/WebCoreArgumentCodersGtk.cpp:
3087         * Shared/qt/WebCoreArgumentCodersQt.cpp:
3088         * Shared/win/LayerTreeContextWin.cpp:
3089         * UIProcess/API/qt/qwkpage.cpp:
3090         * UIProcess/Launcher/gtk/ThreadLauncherGtk.cpp:
3091         * UIProcess/Launcher/qt/ProcessLauncherQt.cpp:
3092         * UIProcess/Plugins/gtk/PluginInfoStoreGtk.cpp:
3093         * UIProcess/WebContext.cpp:
3094         (WebKit::WebContext::WebContext):
3095         * UIProcess/WebInspectorProxy.cpp:
3096         * UIProcess/gtk/TextCheckerGtk.cpp:
3097         * UIProcess/gtk/WebInspectorGtk.cpp:
3098         * UIProcess/gtk/WebPreferencesGtk.cpp:
3099         * UIProcess/qt/TextCheckerQt.cpp:
3100         * UIProcess/qt/WebInspectorProxyQt.cpp:
3101         * UIProcess/win/TextCheckerWin.cpp:
3102         * UIProcess/win/WebContextMenuProxyWin.cpp:
3103         * WebKit2.pro:
3104         * WebProcess/Downloads/cf/DownloadCFNet.cpp:
3105         * WebProcess/Downloads/curl/DownloadCurl.cpp:
3106         * WebProcess/Downloads/mac/DownloadMac.mm:
3107         * WebProcess/Downloads/qt/DownloadQt.cpp:
3108         * WebProcess/InjectedBundle/gtk/InjectedBundleGtk.cpp:
3109         * WebProcess/Plugins/Netscape/JSNPMethod.cpp:
3110         * WebProcess/Plugins/Netscape/NPJSObject.cpp:
3111         * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp:
3112         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
3113         * WebProcess/Plugins/Netscape/gtk/NetscapePluginGtk.cpp:
3114         * WebProcess/Plugins/Netscape/qt/NetscapePluginQt.cpp:
3115         * WebProcess/Plugins/Netscape/win/NetscapePluginWin.cpp:
3116         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3117         * WebProcess/WebCoreSupport/WebContextMenuClient.cpp:
3118         * WebProcess/WebCoreSupport/WebDragClient.cpp:
3119         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
3120         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3121         * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
3122         * WebProcess/WebCoreSupport/WebInspectorFrontendClient.cpp:
3123         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
3124         * WebProcess/WebCoreSupport/gtk/WebContextMenuClientGtk.cpp:
3125         * WebProcess/WebCoreSupport/gtk/WebPopupMenuGtk.cpp:
3126         * WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm:
3127         * WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
3128         * WebProcess/WebCoreSupport/qt/WebContextMenuClientQt.cpp:
3129         * WebProcess/WebPage/gtk/WebInspectorGtk.cpp:
3130         * WebProcess/WebPage/qt/WebInspectorQt.cpp:
3131         * WebProcess/WebProcess.cpp:
3132         (WebKit::WebProcess::WebProcess):
3133         * WebProcess/gtk/WebProcessGtk.cpp:
3134
3135 2011-02-21  Timothy Hatcher  <timothy@apple.com>
3136
3137         Set and update the window title for the Web Inspector in WebKit2.
3138
3139         https://webkit.org/b/50945
3140         rdar://problem/8762410
3141
3142         Reviewed by Adam Roben.
3143
3144         * UIProcess/WebInspectorProxy.cpp:
3145         (WebKit::WebInspectorProxy::inspectedURLChanged): Added. Call platformInspectedURLChanged.
3146         * UIProcess/WebInspectorProxy.h:
3147         * UIProcess/WebInspectorProxy.messages.in: Added InspectedURLChanged.
3148         * UIProcess/mac/WebInspectorProxyMac.mm:
3149         (WebKit::WebInspectorProxy::platformInspectedURLChanged): Added. Set the window title.
3150         * UIProcess/win/WebInspectorProxyWin.cpp:
3151         (WebKit::WebInspectorProxy::platformInspectedURLChanged): Added. Set the window title.
3152         * UIProcess/gtk/WebInspectorGtk.cpp:
3153         (WebKit::WebInspectorProxy::platformInspectedURLChanged): Added. Not implemented.
3154         * UIProcess/qt/WebInspectorProxyQt.cpp:
3155         (WebKit::WebInspectorProxy::platformInspectedURLChanged): Added. Not implemented.
3156         * WebProcess/WebCoreSupport/WebInspectorFrontendClient.cpp:
3157         (WebKit::WebInspectorFrontendClient::inspectedURLChanged): Call WebInspector::inspectedURLChanged.
3158         * WebProcess/WebPage/WebInspector.cpp:
3159         (WebKit::WebInspector::inspectedURLChanged): Added. Send the InspectedURLChanged message.
3160         * WebProcess/WebPage/WebInspector.h:
3161
3162 2011-02-21  Sam Weinig  <sam@webkit.org>
3163
3164         Reviewed by Anders Carlsson.
3165
3166         Can't paste from 3rd party text editor into WebKit2 window.
3167         <rdar://problem/8978624>
3168
3169         * WebProcess/com.apple.WebProcess.sb:
3170
3171 2011-02-21  Anders Carlsson  <andersca@apple.com>
3172
3173         Reviewed by Dan Bernstein.
3174
3175         Initialize DrawingAreaProxy::m_size
3176         https://bugs.webkit.org/show_bug.cgi?id=54913
3177
3178         This was removed in r76962 since it caused flashes when switching drawing areas due to
3179         entering and exiting composited mode, but since we no longer switch drawing areas we can
3180         put it back.
3181
3182         * UIProcess/DrawingAreaProxy.cpp:
3183         (WebKit::DrawingAreaProxy::DrawingAreaProxy):
3184
3185 2011-02-21  Adam Roben  <aroben@apple.com>
3186
3187         Add some assertions about the state IDs we receive from the web process
3188
3189         Rubber-stamped by Anders Carlsson.
3190
3191         * UIProcess/DrawingAreaProxyImpl.cpp:
3192         (WebKit::DrawingAreaProxyImpl::update):
3193         (WebKit::DrawingAreaProxyImpl::enterAcceleratedCompositingMode):
3194         (WebKit::DrawingAreaProxyImpl::exitAcceleratedCompositingMode):
3195         Assert that the state ID the web process sent us is no newer than our own state ID.
3196
3197 2011-02-21  Adam Roben  <aroben@apple.com>
3198
3199         Rename DrawingArea[Proxy]Impl's "sequence number" concept to "state ID".
3200
3201         As explained in r79251, DrawingAreaProxyImpl has some state that, when it changes, causes
3202         all operations performed before that state change to become invalid. Currently, this state
3203         consists of a single piece of data: the view's size. Eventually it will encompass more data
3204         (e.g., the backing store we're drawing into; when we start throwing away the backing store
3205         to save memory, our state will have changed, and any operations that were intended for the
3206         old backing store will have become invalid). r79251 effectively transformed
3207         DrawingArea[Proxy]Impl's "sequence number," which incremented every time DrawingAreaImpl
3208         sent DrawingAreaProxyImpl a message, to a "state ID," which only increments when the view's
3209         size changes.
3210
3211         This patch is just a set of simple renames to reflect the transformation that r79251
3212         effected. It should not introduce any changes in behavior. The renames are:
3213           - Messages::DrawingArea::SetSize -> UpdateState
3214           - Messages::DrawingAreaProxy::DidSetSize -> DidUpdateState
3215           - DrawingAreaProxyImpl::m_lastDidSetSizeSequenceNumber -> m_currentStateID
3216           - DrawingAreaProxyImpl::m_isWaitingForDidSetSize -> m_isWaitingForDidUpdateState
3217           - DrawingAreaProxyImpl::waitForAndDispatchDidSetSize -> waitForAndDispatchDidUpdateState
3218           - DrawingAreaImpl::m_inSetSize -> m_inUpdateState
3219           - generateSequenceNumber -> generateStateID
3220           - sequenceNumber -> stateID
3221
3222         Fixes <http://webkit.org/b/54911> DrawingArea[Proxy]Impl's "sequence number" concept should
3223         be renamed to "state ID"
3224
3225         Reviewed by Anders Carlsson.
3226
3227         * UIProcess/DrawingAreaProxy.h:
3228         * UIProcess/DrawingAreaProxy.messages.in:
3229         * UIProcess/DrawingAreaProxyImpl.cpp:
3230         * UIProcess/DrawingAreaProxyImpl.h:
3231         * WebProcess/WebPage/DrawingArea.h:
3232         * WebProcess/WebPage/DrawingArea.messages.in:
3233         * WebProcess/WebPage/DrawingAreaImpl.cpp:
3234         * WebProcess/WebPage/DrawingAreaImpl.h:
3235         Performed the renames described above.
3236
3237 2011-02-21  Alexey Proskuryakov  <ap@apple.com>
3238
3239         Reviewed by Adam Roben.
3240
3241         REGRESSION (WebKit2): HTTP requests time out after 60 seconds
3242         https://bugs.webkit.org/show_bug.cgi?id=54755
3243         <rdar://problem/9006592>
3244
3245         * Shared/API/c/WKURLRequest.cpp:
3246         (WKURLRequestSetDefaultTimeoutInterval):
3247         * Shared/API/c/WKURLRequest.h:
3248         Added an API to set a default timeout interval for requests created from URLs. The API
3249         affects both the UI process and requests created internally by the Web process. Requests
3250         created from NSURLRequest or CFURLRequest take timeout from those.
3251
3252         * Shared/WebURLRequest.cpp: (WebKit::WebURLRequest::setDefaultTimeoutInterval):
3253         * Shared/WebURLRequest.h:
3254         Pipe the default timeout interval from WKURLRequest down to actual implementation. Since
3255         WebURLRequest is currently implemented with WebCore::ResourceRequest, it automatically respects
3256         NSURLRequest default timeout interval.
3257
3258         * UIProcess/WebProcessManager.cpp: (WebKit::WebProcessManager::getAllWebProcessContexts):
3259         * UIProcess/WebProcessManager.h:
3260         Added a way to enumerate all contexts running in separate processes.
3261
3262         * Shared/WebProcessCreationParameters.cpp:
3263         (WebKit::WebProcessCreationParameters::WebProcessCreationParameters):
3264         (WebKit::WebProcessCreationParameters::encode):
3265         (WebKit::WebProcessCreationParameters::decode):
3266         * Shared/WebProcessCreationParameters.h:
3267         (WebKit::WebContext::ensureWebProcess):
3268         (WebKit::WebContext::setDefaultRequestTimeoutInterval):
3269         * UIProcess/WebContext.h:
3270         * WebProcess/WebProcess.cpp:
3271         (WebKit::WebProcess::initializeWebProcess):
3272         (WebKit::WebProcess::setDefaultRequestTimeoutInterval):
3273         * WebProcess/WebProcess.h:
3274         * WebProcess/WebProcess.messages.in:
3275         Use UI process default timeout interval in separate process contexts, too.
3276
3277 2011-02-18  Brian Weinstein  <bweinstein@apple.com>
3278
3279         Reviewed by Adam Roben.
3280
3281         WebResourceCacheManager should be responsible for managing the CFURLCache as well
3282         as the WebCore memory cache.
3283         https://bugs.webkit.org/show_bug.cgi?id=54886
3284         Part of <rdar://problem/8971738>
3285
3286         * WebProcess/ResourceCache/WebResourceCacheManager.cpp:
3287         (WebKit::WebResourceCacheManager::getCacheOrigins): Call through to cFURLCacheHostNames, and add
3288             create SecurityOrigin's for them and add them to the set of SecurityOrigins with cache.
3289         (WebKit::WebResourceCacheManager::clearCacheForOrigin): Call through to clear the CFURLCache for
3290             the origin's hostname.
3291         * WebProcess/ResourceCache/WebResourceCacheManager.h:
3292
3293         * WebProcess/ResourceCache/cf: Added.
3294         * WebProcess/ResourceCache/cf/WebResourceCacheManagerCFNet.cpp: Added.
3295         (WebKit::WebResourceCacheManager::cfURLCacheHostNames): Call through to WebKitSystemInterface.
3296         (WebKit::WebResourceCacheManager::clearCFURLCacheForHostNames): Ditto.
3297
3298         * win/WebKit2.vcproj: Added new file.
3299         * WebKit2.xcodeproj/project.pbxproj: Ditto.
3300
3301 2011-02-21  Adam Roben  <aroben@apple.com>
3302
3303         Move control of the sequence number from DrawingAreaImpl to DrawingAreaProxyImpl
3304
3305         DrawingAreaProxyImpl has some state that, when it changes, causes all operations performed
3306         before that state change to become invalid. When painting, we need to have performed at
3307         least one Update for the most recent state; otherwise, we'll be painting old/incorrect bits
3308         into the view.
3309
3310         Currently, this state consists of a single piece of data: the view's size. Whenever the
3311         state (i.e., size) changes, we tell the web process via the SetSize message, and the web
3312         process lets us know that it has updated to match the new state (i.e., size) via the
3313         DidSetSize message.
3314
3315         When it's time to paint, if we're waiting for the web process to update to match our current
3316         state (i.e., size), we block for a little while hoping to receive a DidSetSize message so
3317         that we can paint up-to-date bits into the window. This can cause us to receive messages
3318         out-of-order; the DidSetSize message will be processed immediately, and any messages that
3319         were sent before the DidSetSize message will be processed later. Since the messages from
3320         before the DidSetSize message correspond to an old state (i.e., size), they are no longer
3321         useful (e.g., they contain bits of the page that are drawn at the wrong size/location), so
3322         we discard them.
3323
3324         The way we identify and discard these messages is by keeping track of a sequence number.
3325         Currently, DrawingAreaImpl sends a monotonically-increasing sequence number to
3326         DrawingAreaProxyImpl with every message. Whenever DrawingAreaProxyImpl receives a DidSetSize
3327         message, it records the sequence number that came along with it. If we then later receive
3328         any messages that have a lower sequence number, we know they correspond to an old state
3329         (i.e., size) and can discard them.
3330
3331         This patch moves control of the sequence number to DrawingAreaProxyImpl.
3332         DrawingAreaProxyImpl now sends a monotonically-increasing sequence number in the SetSize
3333         message. DrawingAreaImpl records this sequence number when it receives the SetSize message,
3334         and sends it back to DrawingAreaProxyImpl in every message. Otherwise the logic is the same
3335         as before.
3336
3337         This should cause no changes in behavior, but will allow DrawingAreaProxyImpl to request a
3338         full backing store update (by incrementing the sequence number) at times other than when the
3339         view's size changes (e.g., after it has thrown away its backing store in order to save
3340         memory).
3341
3342         Fixes <http://webkit.org/b/54907> DrawingAreaProxyImpl should tell DrawingAreaImpl what
3343         sequence number to use
3344
3345         Reviewed by Anders Carlsson.
3346
3347         * UIProcess/DrawingAreaProxyImpl.cpp:
3348         (WebKit::generateSequenceNumber): Moved here from DrawingAreaImpl.cpp.
3349         (WebKit::DrawingAreaProxyImpl::sendSetSize): Changed to pass a new sequence number in the
3350         SetSize message.
3351         (WebKit::DrawingAreaProxyImpl::waitForAndDispatchDidSetSize): Added a FIXME about a
3352         potential improvement.
3353
3354         * WebProcess/WebPage/DrawingArea.h:
3355         (WebKit::DrawingArea::setSize): Updated to match the message's new parameters.
3356
3357         * WebProcess/WebPage/DrawingArea.messages.in: Added a sequenceNumber parameter to SetSize.
3358
3359         * WebProcess/WebPage/DrawingAreaImpl.cpp:
3360         (WebKit::DrawingAreaImpl::DrawingAreaImpl): Initialize m_sequenceNumber.
3361         (WebKit::DrawingAreaImpl::setSize): Record the new sequence number from the UI process.
3362
3363         (WebKit::DrawingAreaImpl::layerHostDidFlushLayers):
3364         (WebKit::DrawingAreaImpl::exitAcceleratedCompositingMode):
3365         (WebKit::DrawingAreaImpl::display):
3366         Send m_sequenceNumber, instead of a new sequence number, back to the UI process.
3367
3368         * WebProcess/WebPage/DrawingAreaImpl.h: Added m_sequenceNumber, updated setSize function to
3369         match the base class.
3370
3371 2011-02-21  Gavin Barraclough  <barraclough@apple.com>
3372
3373         Reviewed by Sam Weinig.
3374
3375         Bug 54894 - Make inheritance structure described by ClassInfo match C++ class hierarchy.
3376
3377         The ClassInfo objects describe an inheritance hierarchy, with each ClassInfo instance
3378         containing a pointer to its parent class. These links should reflect the inheritance
3379         hierarchy of C++ classes below JSObject. For the large part it does, but in some cases
3380         entries in the C++ hierarchy are skipped over. This presently likely doesn't matter,
3381         since intervening C++ classes may not have ClassInfo - but would be a potential bug
3382         were ClassInfo were to be added.
3383
3384         * WebProcess/Plugins/Netscape/JSNPObject.cpp:
3385
3386 2011-02-21  Balazs Kelemen  <kbalazs@webkit.org>
3387
3388         Reviewed by Kenneth Rohde Christiansen.
3389
3390         [Qt] Implement WorkQueue::sheduleWorkAfterDelay
3391         https://bugs.webkit.org/show_bug.cgi?id=54878
3392
3393         * Platform/qt/WorkQueueQt.cpp:
3394         (WorkQueue::scheduleWorkAfterDelay):
3395
3396 2011-02-20  Alejandro G. Castro  <alex@igalia.com>
3397
3398         Reviewed by Martin Robinson.
3399
3400         [GTK] Add WebResourceCacheDataManager to the compilation after r78848
3401         https://bugs.webkit.org/show_bug.cgi?id=54732
3402
3403         Added resource cache manager API to GTK+ compilation after r78848.
3404
3405         * GNUmakefile.am:
3406
3407 2011-02-20  Sam Weinig  <sam@webkit.org>
3408
3409         Reviewed by Dan Bernstein.
3410
3411         Crash in WebProcess at com.apple.WebCore: WebCore::Page::goToItem + 46
3412         <rdar://problem/8942726>
3413
3414         * WebProcess/WebPage/WebPage.cpp:
3415         (WebKit::WebPage::goForward):
3416         (WebKit::WebPage::goBack):
3417         (WebKit::WebPage::goToBackForwardItem):
3418         Defend agains null HistoryItems.
3419
3420 2011-02-20  Anders Carlsson  <andersca@apple.com>
3421
3422         Reviewed by Maciej Stachowiak.
3423
3424         Crash when a plug-in requests a javascript: url that destroys the plug-in
3425         https://bugs.webkit.org/show_bug.cgi?id=54837
3426         <rdar://problem/9005475>
3427
3428         * WebProcess/Plugins/PluginProxy.cpp:
3429         (WebKit::PluginProxy::destroy):
3430         Null out m_pluginController.
3431
3432         * WebProcess/Plugins/PluginView.cpp:
3433         (WebKit::PluginView::performJavaScriptURLRequest):
3434         Don't access the frame through m_pluginElement since it will be nulled out
3435         when the plug-in is destroyed.
3436
3437 2011-02-20  Anders Carlsson  <andersca@apple.com>
3438
3439         Reviewed by Sam Weinig.
3440
3441         Fix another crash when a plug-in is destroyed when evaluating JavaScript
3442         https://bugs.webkit.org/show_bug.cgi?id=54834
3443         <rdar://problem/9005475>
3444
3445         This contains three separate fixes:
3446
3447         - In unprotectPluginFromDestruction we can't just destroy the plug-in once
3448           the count reaches zero, because the plug-in might still have code executing
3449           on the stack. To fix this we use a zero-delay timer to defer destruction
3450           of the plug-in.
3451
3452         - Trying to get the NPObject for the window using NPN_GetValue would return
3453           NPERR_NO_ERROR, even if the returned NPObject was null. Fix this to return
3454           NPERR_GENERIC_ERROR instead.
3455
3456         - Protect the plug-in from destruction anytime an NPAPI call that sends a 
3457           synchronous IPC message is made.
3458
3459         * PluginProcess/PluginControllerProxy.cpp:
3460         (WebKit::PluginControllerProxy::PluginControllerProxy):
3461         (WebKit::PluginControllerProxy::destroy):
3462         (WebKit::PluginControllerProxy::unprotectPluginFromDestruction):
3463         * PluginProcess/PluginControllerProxy.h:
3464         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
3465         (WebKit::PluginDestructionProtector::PluginDestructionProtector):
3466         (WebKit::NPN_GetValue):
3467         (WebKit::NPN_Evaluate):
3468         (WebKit::NPN_GetProperty):
3469         (WebKit::NPN_SetProperty):
3470         (WebKit::NPN_RemoveProperty):
3471         (WebKit::NPN_HasProperty):
3472         (WebKit::NPN_HasMethod):
3473         (WebKit::NPN_Enumerate):
3474         (WebKit::NPN_Construct):
3475         (WebKit::NPN_GetValueForURL):
3476         (WebKit::NPN_SetValueForURL):
3477
3478 2011-02-19  Sam Weinig  <sam@webkit.org>
3479
3480         Reviewed by Anders Carlsson.
3481
3482         Add phase in addition to momentumPhase to platform wheel events
3483         Part of <rdar://problem/8945362>
3484
3485         Rename existing phase to momentumPhase.
3486
3487         * Shared/WebEvent.h:
3488         (WebKit::WebWheelEvent::momentumPhase):
3489         * Shared/WebEventConversion.cpp:
3490         (WebKit::WebKit2PlatformWheelEvent::WebKit2PlatformWheelEvent):
3491         * Shared/WebWheelEvent.cpp:
3492         (WebKit::WebWheelEvent::WebWheelEvent):
3493         (WebKit::WebWheelEvent::encode):
3494         (WebKit::WebWheelEvent::decode):
3495         * Shared/mac/WebEventFactory.mm:
3496         (WebKit::phaseForEvent):
3497         (WebKit::momentumPhaseForEvent):
3498         (WebKit::WebEventFactory::createWebWheelEvent):
3499
3500 2011-02-19  Anders Carlsson  <andersca@apple.com>
3501
3502         Reviewed by Dan Bernstein.
3503
3504         Crash when trying to take a snapshot of an uninitialized plug-in
3505         https://bugs.webkit.org/show_bug.cgi?id=54812
3506
3507         * WebProcess/Plugins/PluginView.cpp:
3508         (WebKit::PluginView::notifyWidget):
3509         Don't try to create a snapshot of the plug-in if it hasn't been initialized.
3510
3511 2011-02-18  Gavin Barraclough  <barraclough@apple.com>
3512
3513         Reviewed by Sam Weinig.
3514
3515         Bug 54786 - Devirtualize JSCell::classInfo()
3516
3517         Instead of making a virtual function call, add a pointer to the ClassInfo
3518         onto Structure.
3519
3520         This removes a virtual function call, and paves the way towards removing all
3521         the createStructure methods, and StructureFlags/AnonymousSlotCount properties
3522         (these should be able to move onto ClassInfo).
3523
3524         Calls to Structure::create must now pass a pointer to the ClassInfo for the
3525         structure. All objects now have a ClassInfo pointer, non-object cell types
3526         still do not.
3527
3528         Changes are most mechanical, involving three steps:
3529             * Remove virtual classInfo() methods.
3530             * Add &s_info parameter to calls to Structure::create.
3531             * Rename ClassInfo static members on classes from 'info' to 's_info',
3532               for consistency.
3533
3534         * WebProcess/Plugins/Netscape/JSNPMethod.cpp:
3535         (WebKit::JSNPMethod::JSNPMethod):
3536         * WebProcess/Plugins/Netscape/JSNPMethod.h:
3537         (WebKit::JSNPMethod::createStructure):
3538         * WebProcess/Plugins/Netscape/JSNPObject.cpp:
3539         (WebKit::JSNPObject::JSNPObject):
3540         * WebProcess/Plugins/Netscape/JSNPObject.h:
3541         (WebKit::JSNPObject::createStructure):
3542
3543 2011-02-19  Sam Weinig  <sam@webkit.org>
3544
3545         Reviewed by Anders Carlsson.
3546
3547         Rename performLookupAtCurrentMouseLocation to performDictionaryLookupAtCurrentMouseLocation
3548
3549         * UIProcess/API/mac/WKView.mm:
3550         (-[WKView performDictionaryLookupAtCurrentMouseLocation]):
3551         * UIProcess/API/mac/WKViewPrivate.h:
3552
3553 2011-02-19  Charlie Reis  <creis@chromium.org>
3554
3555         Reviewed by Mihai Parparita.
3556
3557         Ensure loading has stopped in HistoryController::goToItem
3558         https://bugs.webkit.org/show_bug.cgi?id=54517
3559
3560         Add a FrameLoaderClient callback for whether to stop loading before goToItem.
3561
3562         Test: http/tests/navigation/forward-to-fragment-fires-onload.html
3563
3564         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3565         (WebFrameLoaderClient::shouldStopLoadingForHistoryItem): Added.
3566         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
3567
3568 2011-02-18  Sam Weinig  <sam@webkit.org>
3569
3570         Reviewed by Adele Peterson.
3571
3572         Real fix for <rdar://problem/9025723> CrashTracer: [USER] 
3573         1 crash in WebProcess at com.apple.WebKit2: 
3574         WebKit::WebPage::didChangeScrollOffsetForMainFrame + 31
3575
3576         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3577         (WebKit::WebFrameLoaderClient::didChangeScrollOffset):
3578         Add null check for the FrameView. This function can be called when the
3579         FrameView is being torn down during a transition to a new FrameView.
3580
3581         * WebProcess/WebPage/WebPage.cpp:
3582         (WebKit::WebPage::didChangeScrollOffsetForMainFrame):
3583         Revert last attempt.
3584
3585 2011-02-18  Anders Carlsson  <andersca@apple.com>
3586
3587         Reviewed by Sam Weinig.
3588
3589         Hang trying to load nytimes.com with Flash installed
3590         <rdar://problem/9018113> 
3591
3592         * Platform/CoreIPC/Connection.cpp:
3593         (CoreIPC::Connection::sendSyncMessage):
3594         Call beginWaitForSyncReply() before sending the message. Otherwise, in some cases we could
3595         have gotten back a synchronous request before calling beginWaitForSyncReply(), and then we wouldn't
3596         process it correctly. (Which would lead to the hang).
3597
3598 2011-02-18  Simon Fraser  <simon.fraser@apple.com>
3599
3600         Reviewed by Kevin Decker.
3601
3602         <rdar://problem/9021296> Some plug-ins are the wrong size after zooming
3603         
3604         Use the same frame/bounds adjustment that we use for NSView-based
3605         plugins in WebKit2, which allows plug-ins and their snapshots to
3606         render with the correct size after scaling.
3607
3608         * WebProcess/Plugins/PluginView.cpp:
3609         (WebKit::PluginView::setBoundsSize):
3610         (WebKit::PluginView::viewGeometryDidChange):
3611         (WebKit::PluginView::clipRectInWindowCoordinates):
3612         * WebProcess/Plugins/PluginView.h:
3613
3614 2011-02-18  Beth Dakin  <bdakin@apple.com>
3615
3616         Rubber-stamped by Adele Peterson.
3617
3618         Fix for <rdar://problem/9025723> CrashTracer: [USER] 
3619         1 crash in WebProcess at com.apple.WebKit2: 
3620         WebKit::WebPage::didChangeScrollOffsetForMainFrame + 31
3621
3622         Simple null-check.
3623         * WebProcess/WebPage/WebPage.cpp:
3624         (WebKit::WebPage::didChangeScrollOffsetForMainFrame):
3625
3626 2011-02-18  Viatcheslav Ostapenko  <ostapenko.viatcheslav@nokia.com>
3627
3628         Reviewed by Kenneth Rohde Christiansen.
3629
3630         Tiled backing store area is too big.
3631         Error in area calculcation causes size of backing store
3632         up to 8 times bigger than viewport with default multipliers.
3633         https://bugs.webkit.org/show_bug.cgi?id=54587
3634
3635         * UIProcess/TiledDrawingAreaProxy.cpp:
3636         (WebKit::TiledDrawingAreaProxy::calculateKeepRect):
3637         (WebKit::TiledDrawingAreaProxy::calculateCoverRect):
3638
3639 2011-02-18  John Sullivan  <sullivan@apple.com>
3640
3641         Reviewed by Maciej Stachowiak.
3642
3643         <rdar://problem/9026169>
3644         https://bugs.webkit.org/show_bug.cgi?id=54780
3645         pendingAPIRequestURL isn't updated for WKPageGoToBackForwardListItem
3646
3647         * UIProcess/WebPageProxy.cpp:
3648         (WebKit::WebPageProxy::goToBackForwardItem):
3649         Update the pending API URL.
3650
3651 2011-02-18  Anders Carlsson  <andersca@apple.com>
3652
3653         Reviewed by Sam Weinig.
3654
3655         Accelerated content fades in when using a layer backed WKView
3656         <rdar://problem/9021586>
3657
3658         * UIProcess/API/mac/WKView.mm:
3659         (-[WKView _enterAcceleratedCompositingMode:]):
3660         Make a new nested CATransaction and disable animations when adding the layer 
3661         hosting subview. This avoids an implicit fade animation that would otherwise occur.
3662
3663 2011-02-18  Simon Fraser  <simon.fraser@apple.com>
3664
3665         Reviewed by Dan Bernstein.
3666
3667         Plugin snapshot location is wrong for subframes
3668         https://bugs.webkit.org/show_bug.cgi?id=54776
3669         
3670         Only change the CTM to the way that the plugin expects it
3671         when painting the plugin, not when drawing the snapshot.
3672         This fixes the snapshot location when painting flattened
3673         frames.
3674
3675         * WebProcess/Plugins/PluginView.cpp:
3676         (WebKit::PluginView::paint):
3677
3678 2011-02-18  Anders Carlsson  <andersca@apple.com>
3679
3680         Reviewed by Simon Fraser.
3681
3682         Implement NetscapePlugin::pluginComplexTextInputIdentifier
3683         https://bugs.webkit.org/show_bug.cgi?id=54770
3684
3685         * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
3686         (WebKit::NetscapePlugin::pluginComplexTextInputIdentifier):
3687
3688 2011-02-18  Sam Weinig  <sam@webkit.org>
3689
3690         Reviewed by Maciej Stachowiak.
3691
3692         Add the ability to ask the WKPage if the main frame is pinned
3693         to the right or left hand side.
3694         Part of <rdar://problem/9017043>.
3695
3696         * UIProcess/API/C/WKPage.cpp:
3697         (WKPageIsPinnedToLeftSide):
3698         (WKPageIsPinnedToRightSide):
3699         * UIProcess/API/C/WKPage.h:
3700         Add new API calls.
3701
3702         * UIProcess/WebPageProxy.cpp:
3703         (WebKit::WebPageProxy::WebPageProxy):
3704         (WebKit::WebPageProxy::close):
3705         (WebKit::WebPageProxy::processDidCrash):
3706         (WebKit::WebPageProxy::didChangeScrollOffsetPinningForMainFrame):
3707         * UIProcess/WebPageProxy.h:
3708         (WebKit::WebPageProxy::isPinnedToLeftSide):
3709         (WebKit::WebPageProxy::isPinnedToRightSide):
3710         Initialize, reset and update the pinned state.
3711
3712         * UIProcess/WebPageProxy.messages.in:
3713         Add message to update the pinned state.
3714
3715         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3716         (WebKit::WebFrameLoaderClient::didChangeScrollOffset):
3717         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
3718         * WebProcess/WebPage/WebPage.cpp:
3719         (WebKit::WebPage::WebPage):
3720         (WebKit::WebPage::didChangeScrollOffsetForMainFrame):
3721         * WebProcess/WebPage/WebPage.h:
3722         Cache the pinned state, and only update the UIProcess when it
3723         changes.
3724
3725 2011-02-18  Anders Carlsson  <andersca@apple.com>
3726
3727         Reviewed by Simon Fraser.
3728
3729         Fix assertion in SharedMemory::create when trying to snapshot 0x0 plug-in
3730         https://bugs.webkit.org/show_bug.cgi?id=54768
3731
3732         * PluginProcess/PluginControllerProxy.cpp:
3733         (WebKit::PluginControllerProxy::snapshot):
3734         Don't try to create a handle from a null ShareableBitmap.
3735
3736         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
3737         (WebKit::NetscapePlugin::snapshot):
3738         Check for a zero sized plug-in before trying to create a snapshot.
3739
3740 2011-02-18  Anders Carlsson  <andersca@apple.com>
3741
3742         Reviewed by Simon Fraser.
3743
3744         WKView flashes when entering/exiting compositing mode
3745         https://bugs.webkit.org/show_bug.cgi?id=54695
3746         <rdar://problem/9011554>
3747
3748         * UIProcess/API/mac/WKView.mm:
3749         (-[WKView _exitAcceleratedCompositingMode]):
3750         Remove the layer hosting view before clearing out its layer, otherwise we can get
3751         white flashes when exiting accelerated compositing mode.
3752
3753         * WebProcess/WebPage/DrawingAreaImpl.cpp:
3754         When entering accelerated compositing mode, we want to defer sending the message
3755         until we've actually committed the layer tree and pushed all changes over to the
3756         UI process.
3757
3758         (WebKit::DrawingAreaImpl::layerHostDidFlushLayers):
3759         Tell the layer tree host to force a repaint. This will ensure that all layer tree
3760         changes are pushed over to the UI process. When that is done, send the new layer tree
3761         context over to the UI process.
3762
3763         (WebKit::DrawingAreaImpl::setRootCompositingLayer):
3764         When exiting compositing mode in response to a didSetSize, we want to exit accelerated 
3765         compositing mode right away to avoid flashes. This is safe since we've laid out the page
3766         already so we won't end up reentering setRootCompositingLayer.
3767
3768         (WebKit::DrawingAreaImpl::enterAcceleratedCompositingMode):
3769         Tell the layer tree host to notify us when the next layer tree flush happened, so we can
3770         let the UI process know. If we're entering accelerated compositing mode in response to a
3771         SetSize message, the new layer tree context will be passed in the DidSetSize message.
3772
3773         * WebProcess/WebPage/DrawingAreaImpl.h:
3774         Add layerHostDidFlushLayers.
3775
3776         * WebProcess/WebPage/LayerTreeHost.h:
3777         Add setShouldNotifyAfterNextScheduledLayerFlush.
3778
3779         * WebProcess/WebPage/mac/LayerTreeHostMac.h:
3780         Add a m_notifyAfterScheduledLayerFlush flag.
3781
3782         * WebProcess/WebPage/mac/LayerTreeHostMac.mm:
3783         (WebKit::LayerTreeHostMac::LayerTreeHostMac):
3784         Initialize m_notifyAfterScheduledLayerFlush to false.
3785
3786         (WebKit::LayerTreeHostMac::setShouldNotifyAfterNextScheduledLayerFlush):
3787         Set m_notifyAfterScheduledLayerFlush to true.
3788
3789         (WebKit::LayerTreeHostMac::flushPendingLayerChangesRunLoopObserverCallback):
3790         If m_notifyAfterScheduledLayerFlush is true, call DrawingAreaImpl::layerHostDidFlushLayers.
3791
3792 2011-02-18  Alexey Proskuryakov  <ap@apple.com>
3793
3794         Reviewed by Adele Peterson.
3795
3796         REGRESSION (WebKit2): Wrong frame printed on tivofaq.com
3797         https://bugs.webkit.org/show_bug.cgi?id=54677
3798         <rdar://problem/8994133>
3799
3800         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3801         (WebKit::area): Use visible frame bounds.
3802         (WebKit::findLargestFrameInFrameSet): Added a comment explaining what we're up to here.
3803         WebKit2 shouldn't be making policy decisions for the client, but it gets dangerously close
3804         to that. We used to expose the same as WK1 API though.
3805
3806 2011-02-18  Balazs Kelemen  <kbalazs@webkit.org>
3807
3808         Unreviwed.
3809
3810         Remove CleanupHandler since we do not use it anymore.
3811
3812         * Shared/qt/CleanupHandler.cpp: Removed.
3813         * Shared/qt/CleanupHandler.h: Removed.
3814
3815 2011-02-18  Alejandro G. Castro  <alex@igalia.com>
3816
3817         Fix GTK build by fixing signature of platformPaint(), required after r78956.
3818
3819         * WebProcess/Plugins/Netscape/gtk/NetscapePluginGtk.cpp:
3820         (WebKit::NetscapePlugin::platformPaint):
3821
3822 2011-02-17  Dan Bernstein  <mitz@apple.com>
3823
3824         LLVM Compiler build fix.
3825
3826         * UIProcess/WebResourceCacheManagerProxy.h:
3827         * WebProcess/ResourceCache/WebResourceCacheManager.h:
3828
3829 2011-02-17  Simon Fraser  <simon.fraser@apple.com>
3830
3831         Fix Windows and Qt builds by fixing signature of platformPaint().
3832
3833         * WebProcess/Plugins/Netscape/qt/NetscapePluginQt.cpp:
3834         (WebKit::NetscapePlugin::platformPaint):
3835         * WebProcess/Plugins/Netscape/win/NetscapePluginWin.cpp:
3836         (WebKit::NetscapePlugin::platformPaint):
3837
3838 2011-02-17  Simon Fraser  <simon.fraser@apple.com>
3839
3840         Reviewed by Sam Weinig.
3841
3842         WebKit2 snapshots don't show plug-ins
3843         https://bugs.webkit.org/show_bug.cgi?id=54716
3844         
3845         Fix WebKit2 plug-ins to do a software paint for
3846         snapshotting.
3847
3848         * PluginProcess/PluginControllerProxy.h:
3849         * PluginProcess/PluginControllerProxy.cpp:
3850         (WebKit::PluginControllerProxy::snapshot): Respond to the snapshot
3851         message by getting a sharable bitmap from the plugin, and returning
3852         a handle to it in the reply.
3853
3854         * PluginProcess/PluginControllerProxy.messages.in: Add the snapshot
3855         message.
3856         
3857         * Shared/Plugins/PluginQuirks.h:
3858         * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
3859         (WebKit::NetscapePluginModule::determineQuirks): Add a quirk for the
3860         ability to be snapshotted, which we only set for Flash at the moment.
3861         
3862         * WebProcess/Plugins/Netscape/NetscapePlugin.h:
3863         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
3864         (WebKit::NetscapePlugin::snapshot): Create a shareable bitmap, and
3865         paint into it.
3866         (WebKit::NetscapePlugin::supportsSnapshotting): Test the quirk.
3867
3868         * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
3869         (WebKit::NetscapePlugin::platformPaint): Allow the paint to happen
3870         if we're snapshotting, even when using the CoreAnimation drawing
3871         model.
3872         
3873         * WebProcess/Plugins/Plugin.h: New snapshot method.
3874         
3875         * WebProcess/Plugins/PluginProxy.h:
3876         * WebProcess/Plugins/PluginProxy.cpp:
3877         (WebKit::PluginProxy::snapshot): Send a sync message to the plugin process,
3878         asking for a snapshot in a shareble bitmap.
3879         
3880         * WebProcess/Plugins/PluginView.h:
3881         * WebProcess/Plugins/PluginView.cpp:
3882         (WebKit::PluginView::paint): Use the snapshot if we have one, to avoid
3883         calling into the plugin to draw, which may run script.
3884         
3885         (WebKit::PluginView::notifyWidget): Generate the snapshot before
3886         a flattening paint, and throw it away after.
3887
3888 2011-02-17  Jessie Berlin  <jberlin@apple.com>
3889
3890         Reviewed by Adam Roben.
3891
3892         WebKit2: The CFNetwork Cache should be shared between the UI Process and the Web Process on
3893         Windows.
3894         https://bugs.webkit.org/show_bug.cgi?id=54683
3895
3896         * Shared/WebProcessCreationParameters.cpp:
3897         (WebKit::WebProcessCreationParameters::encode):
3898         (WebKit::WebProcessCreationParameters::decode):
3899         * Shared/WebProcessCreationParameters.h:
3900  
3901         * UIProcess/win/WebContextWin.cpp:
3902         (WebKit::WebContext::platformInitializeWebProcess):
3903         Make sure to remove the ending slash, as CFNetwork does not recognize the directory with
3904         that slash.
3905
3906         * WebProcess/win/WebProcessWin.cpp:
3907         (WebKit::WebProcess::platformInitializeWebProcess):
3908         Create a cache using the path, disk capacity, and memory capacity and set it as default.
3909
3910 2011-02-17  Anders Carlsson  <andersca@apple.com>
3911
3912         Reviewed by Sam Weinig.
3913
3914         Web and/or plug-in process crashes when NPN_Evaluate destroys the plug-in
3915         https://bugs.webkit.org/show_bug.cgi?id=54686
3916         <rdar://problem/9013384>
3917
3918         This patch fixes two bugs with a plug-in calling NPN_Evaluate to destroy itself:
3919
3920         - The PluginProxy object would be destroyed in the middle of PluginProxy::evaluate.
3921           This would cause the web process to crash.
3922
3923         - The PluginControllerProxy would call NPP_Destroy while the plug-in was busy running
3924           code. This would cause the plug-in process to crash.
3925
3926         To fix this, we add protectPluginFromDestruction/unprotectPluginFromDestruction to
3927         PluginControllerProxy and use it to defer calling destroy() in the plug-in process,
3928         and defer actually destroying the plug-in in the web process.
3929
3930         https://bugs.webkit.org/show_bug.cgi?id=54171 tracks adding a test for this.
3931
3932         * PluginProcess/PluginControllerProxy.cpp:
3933         (WebKit::PluginControllerProxy::PluginControllerProxy):
3934         (WebKit::PluginControllerProxy::destroy):
3935         (WebKit::PluginControllerProxy::evaluate):
3936         (WebKit::PluginControllerProxy::protectPluginFromDestruction):
3937         (WebKit::PluginControllerProxy::unprotectPluginFromDestruction):
3938         * PluginProcess/PluginControllerProxy.h:
3939         (WebKit::PluginControllerProxy::asPluginController):
3940         * PluginProcess/WebProcessConnection.cpp:
3941         (WebKit::WebProcessConnection::destroyPluginControllerProxy):
3942         (WebKit::WebProcessConnection::didReceiveMessage):
3943         (WebKit::WebProcessConnection::didReceiveSyncMessage):
3944         * PluginProcess/WebProcessConnection.h:
3945         (WebKit::WebProcessConnection::connection):
3946         * WebProcess/Plugins/PluginController.h:
3947         (WebKit::PluginController::PluginDestructionProtector::PluginDestructionProtector):
3948         (WebKit::PluginController::PluginDestructionProtector::~PluginDestructionProtector):
3949         * WebProcess/Plugins/PluginProxy.cpp:
3950         (WebKit::PluginProxy::evaluate):
3951         * WebProcess/Plugins/PluginView.cpp:
3952         (WebKit::PluginView::protectPluginFromDestruction):
3953         (WebKit::PluginView::unprotectPluginFromDestruction):
3954         * WebProcess/Plugins/PluginView.h:
3955
3956 2011-02-17  Sam Weinig  <sam@webkit.org>
3957
3958         Build fix.
3959
3960         * WebProcess/WebPage/mac/WebPageMac.mm:
3961         (WebKit::WebPage::performDictionaryLookupAtLocation):
3962
3963 2011-02-17  Sam Weinig  <sam@webkit.org>
3964
3965         Reviewed by Maciej Stachowiak.
3966
3967         WebKit2: Support Dictionary popup
3968         <rdar://problem/7660670>
3969
3970         * Shared/TextInfo.cpp: Added.
3971         (WebKit::TextInfo::encode):
3972         (WebKit::TextInfo::decode):
3973         * Shared/TextInfo.h: Added.
3974         (WebKit::TextInfo::TextInfo):
3975         Add class to represent the location and style of a run of text.
3976
3977         * UIProcess/PageClient.h:
3978         * UIProcess/API/mac/PageClientImpl.h:
3979         * UIProcess/API/mac/PageClientImpl.mm:
3980         (WebKit::PageClientImpl::didPerformDictionaryLookup):
3981         Invoke the dictionary popup.
3982
3983         * UIProcess/API/mac/WKView.mm:
3984         (-[WKView performLookupAtCurrentMouseLocation]):
3985         Tell the WebProcess to get get the text under the mouse and cause
3986         the dictionary popup to appear.
3987
3988         * UIProcess/API/mac/WKViewPrivate.h:
3989         Add performLookupAtCurrentMouseLocation.
3990
3991         * UIProcess/WebPageProxy.cpp:
3992         (WebKit::WebPageProxy::performDictionaryLookupAtLocation):
3993         (WebKit::WebPageProxy::didPerformDictionaryLookup):
3994         * UIProcess/WebPageProxy.h:
3995         * UIProcess/WebPageProxy.messages.in:
3996         * WebProcess/WebPage/WebPage.cpp:
3997         * WebProcess/WebPage/WebPage.h:
3998         * WebProcess/WebPage/WebPage.messages.in:
3999         Pipe messages through.
4000
4001         * WebProcess/WebPage/mac/WebPageMac.mm:
4002         (WebKit::characterRangeAtPoint): Fix to return PassRefPtr
4003         and not potentially stale pointers.
4004
4005         (WebKit::WebPage::characterIndexForPoint):
4006         Change to use a RefPtr.
4007
4008         (WebKit::WebPage::performDictionaryLookupAtLocation):
4009         Add simple heuristic to get the word at the current point (or the current selection
4010         if it is at that point) and grab the style of the word to send the UIProcess.
4011
4012         * WebKit2.pro:
4013         * WebKit2.xcodeproj/project.pbxproj:
4014         * win/WebKit2.vcproj:
4015         Add new files.
4016
4017 2011-02-17  Brian Weinstein  <bweinstein@apple.com>
4018
4019         Qt build fix.
4020
4021         * WebKit2.pro: Update after renaming of MemoryCache to ResourceCache.
4022
4023 2011-02-17  Brian Weinstein  <bweinstein@apple.com>
4024
4025         Mac build fix.
4026
4027         * WebKit2.xcodeproj/project.pbxproj: Use relative to group instead of absolute paths. Not everyone's home
4028             directory is /Users/brian_weinstein.
4029
4030 2011-02-16  Brian Weinstein  <bweinstein@apple.com>
4031
4032         Reviewed by Brady Eidson.
4033
4034         WebKit2: Need a way to manage the WebCore Cache
4035         https://bugs.webkit.org/show_bug.cgi?id=54501
4036         
4037         Implement a WebKit2 API to manage the WebCore memory cache. This API exposes three functions:
4038         
4039         1) A method to get a list of all security origins that have entries in the WebCore memory cache.
4040         2) A method to remove all entries in the WebCore memory cache from a SecurityOrigin.
4041         3) A method to remove all entries from the WebCore memory cache.
4042
4043         * Platform/CoreIPC/MessageID.h: Add two new MessageClasses.
4044         * Shared/API/c/WKBase.h:
4045         * Shared/APIObject.h: Add a CacheManager type.
4046         * Shared/WebSecurityOrigin.h: Typedef WKCacheManagerRef.
4047         (WebKit::WebSecurityOrigin::createFromString): Creates a WebCore::SecurityOrigin using 
4048             SecurityOrigin::createFromString.
4049         (WebKit::WebSecurityOrigin::toString): Calls through to SecurityOrigin::toString.
4050         * UIProcess/API/C/WKAPICast.h:
4051
4052         * UIProcess/API/C/WKCacheManager.cpp: Added.
4053         (WKCacheManagerGetTypeID): Returns the WebResourceCacheManagerProxy type.
4054         (WKCacheManagerGetCacheOrigins): Calls through to WebResourceCacheManagerProxy::getCacheOrigins.
4055         (callGetCacheOriginsBlockBlockAndDispose):
4056         (WKCacheManagerGetCacheOrigins_b):
4057         (WKCacheManagerDeleteCacheForOrigin): Calls through to WebResourceCacheManagerProxy::deleteCacheForOrigin.
4058         (WKCacheManagerDeleteAllCache): Calls through to WebResourceCacheManagerProxy::deleteAllCache.
4059         * UIProcess/API/C/WKCacheManager.h: Added.
4060
4061         * UIProcess/API/C/WKContext.cpp:
4062         (WKContextGetCacheManager): Calls to get the WebResourceCacheManagerProxy.
4063         * UIProcess/API/C/WKContext.h:
4064
4065         * UIProcess/WebResourceCacheManagerProxy.cpp: Added.
4066         (WebKit::WebResourceCacheManagerProxy::create): Calls through to the constructor.
4067         (WebKit::WebResourceCacheManagerProxy::WebResourceCacheManagerProxy): Initialize the m_webContext variable.
4068         (WebKit::WebResourceCacheManagerProxy::~WebResourceCacheManagerProxy):
4069         (WebKit::WebResourceCacheManagerProxy::invalidate): Invalidate the callback map.
4070         (WebKit::WebResourceCacheManagerProxy::getCacheOrigins): Call through to the web process to get the cache
4071             origins.
4072         (WebKit::WebResourceCacheManagerProxy::didGetCacheOrigins): Call the callback.
4073         (WebKit::WebResourceCacheManagerProxy::deleteCacheForOrigin): Call through to the web process to delete cache
4074             for the given origin. 
4075         (WebKit::WebResourceCacheManagerProxy::deleteAllCache): Call through to the web process to delete all of the cache.
4076         * UIProcess/WebResourceCacheManagerProxy.h: Added.
4077         (WebKit::WebResourceCacheManagerProxy::clearContext):
4078         (WebKit::WebResourceCacheManagerProxy::type):
4079         * UIProcess/WebResourceCacheManagerProxy.messages.in: Added.
4080
4081  &n