diff options
Diffstat (limited to 'WebKit/chromium')
78 files changed, 1758 insertions, 282 deletions
diff --git a/WebKit/chromium/ChangeLog b/WebKit/chromium/ChangeLog index 68129b0..6efc8e5 100644 --- a/WebKit/chromium/ChangeLog +++ b/WebKit/chromium/ChangeLog @@ -1,3 +1,640 @@ +2010-05-16 Mike Belshe <mbelshe@chromium.org> + + Reviewed by Dimitri Glazkov. + + Add a flag to the ResourceResponse for tracking if a request was + fetched via the TLS/Next-Protocol-Negotiation mechanism. + + Also cleaned up the style in ResourceResponse to group the flags + together (and alphabetically) and hopefully improve readability of + the file. + + https://bugs.webkit.org/show_bug.cgi?id=39078 + + * public/WebURLResponse.h: + * src/WebURLResponse.cpp: + (WebKit::WebURLResponse::wasNpnNegotiated): + (WebKit::WebURLResponse::setWasNpnNegotiated): + +2010-05-16 Eric Seidel <eric@webkit.org> + + Unreviewed, rolling out r59571. + http://trac.webkit.org/changeset/59571 + https://bugs.webkit.org/show_bug.cgi?id=39054 + + Broke Cr Win, but we didn't notice immediately due to + https://bugs.webkit.org/show_bug.cgi?id=38926. It's possible + that this didn't actually break Cr Win, but rather that bug + 38926 necessitates a clean compile after this and sucessive + checkins only produced a partial recompile and thus failed to + build. + + * DEPS: + * WebKit.gyp: + * features.gypi: + +2010-05-16 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r59574. + http://trac.webkit.org/changeset/59574 + https://bugs.webkit.org/show_bug.cgi?id=39176 + + Supposedly broke cr-win, but the errors seems somewhat + unrelated (Requested by abarth on #webkit). + + * public/WebURLResponse.h: + * src/WebURLResponse.cpp: + +2010-05-16 Mike Belshe <mbelshe@chromium.org> + + Reviewed by Dimitri Glazkov. + + Add a flag to the ResourceResponse for tracking if a request was + fetched via the TLS/Next-Protocol-Negotiation mechanism. + + Also cleaned up the style in ResourceResponse to group the flags + together (and alphabetically) and hopefully improve readability of + the file. + + https://bugs.webkit.org/show_bug.cgi?id=39078 + + * public/WebURLResponse.h: + * src/WebURLResponse.cpp: + (WebKit::WebURLResponse::wasNpnNegotiated): + (WebKit::WebURLResponse::setWasNpnNegotiated): + +2010-05-16 Kent Tamura <tkent@chromium.org> + + Reviewed by Dimitri Glazkov. + + [DRT/Chromium] Fix repaint, WebGL, textarea tests + https://bugs.webkit.org/show_bug.cgi?id=39054 + + * DEPS: Update to Chromium r47248 to use a fix for CommandLine assertion + and textAreaResizeCorner.png + * WebKit.gyp: Add textAreaResizeCorner.png as a Mac resource + * features.gypi: Enable ENABLE_3D_CANVAS. + +2010-05-15 Darin Fisher <darin@chromium.org> + + Reviewed by Adam Barth. + + [chromium] Expose element accessor on WebPluginContainer + https://bugs.webkit.org/show_bug.cgi?id=39152 + + * public/WebPluginContainer.h: + * src/WebPluginContainerImpl.cpp: + (WebKit::WebPluginContainerImpl::element): + * src/WebPluginContainerImpl.h: + +2010-05-15 Jochen Eisinger <jochen@chromium.org> + + Reviewed by Dmitry Titov. + + Implement canEstablishDatabase call for workers. + https://bugs.webkit.org/show_bug.cgi?id=38742 + + * public/WebCommonWorkerClient.h: + * src/DatabaseObserver.cpp: + (WebCore::DatabaseObserver::canEstablishDatabase): + * src/WebWorkerBase.cpp: + (WebKit::WebWorkerBase::allowDatabase): + (WebKit::WebWorkerBase::allowDatabaseTask): + (WebKit::WebWorkerBase::AllowDatabaseMainThreadBridge::AllowDatabaseMainThreadBridge): + (WebKit::WebWorkerBase::AllowDatabaseMainThreadBridge::cancel): + (WebKit::WebWorkerBase::AllowDatabaseMainThreadBridge::result): + (WebKit::WebWorkerBase::AllowDatabaseMainThreadBridge::signalCompleted): + (WebKit::WebWorkerBase::AllowDatabaseMainThreadBridge::didComplete): + * src/WebWorkerBase.h: + * src/WebWorkerClientImpl.h: + (WebKit::WebWorkerClientImpl::allowDatabase): + +2010-05-15 Jay Civelli <jcivelli@chromium.org> + + Reviewed by Darin Fisher. + + [chromium] Adding a notification on WebViewClient when a new + node gets focused. + https://bugs.webkit.org/show_bug.cgi?id=38508 + + * public/WebViewClient.h: + (WebKit::WebViewClient::focusedNodeChanged): + * src/ChromeClientImpl.cpp: + (WebKit::ChromeClientImpl::focusedNodeChanged): + +2010-05-15 Evan Stade <estade@chromium.org> + + Reviewed by Adam Barth. + + [chromium] "Check spelling in this field" context menu item always checked + https://bugs.webkit.org/show_bug.cgi?id=39018 + + Initialize all POD members of WebContextMenuData in a default + constructor. + + No tests because this code would need some major refactoring to unit + test, and AFAICT it's not testable via layout tests. See note at top + of getCustomMenuFromDefaultItems. + + * public/WebContextMenuData.h: + (WebKit::WebContextMenuData::WebContextMenuData): + * src/ContextMenuClientImpl.cpp: + (WebKit::ContextMenuClientImpl::getCustomMenuFromDefaultItems): + +2010-05-14 Darin Fisher <darin@chromium.org> + + Reviewed by Dimitri Glazkov. + + [chromium] Remove temporary relative include paths + https://bugs.webkit.org/show_bug.cgi?id=38776 + + * public/WebPasswordAutocompleteListener.h: + * src/FrameLoaderClientImpl.h: + * src/PlatformMessagePortChannel.h: + * src/WebAnimationControllerImpl.h: + * src/WebBindings.cpp: + * src/WebDataSourceImpl.h: + * src/WebDevToolsAgentPrivate.h: + * src/WebFileChooserCompletionImpl.h: + * src/WebFrameImpl.h: + * src/WebInputEventConversion.h: + * src/WebPluginContainerImpl.h: + * src/WebPluginLoadObserver.h: + * src/WebPopupMenuImpl.h: + * src/WebSettingsImpl.h: + * src/WebViewImpl.h: + * src/WebWorkerClientImpl.h: + * src/WrappedResourceRequest.h: + * src/WrappedResourceResponse.h: + +2010-05-14 Anton Muhin <antonm@chromium.org> + + Reviewed by Darin Fisher. + + [Chromium] Consider implementing addOriginAccessWhitelistEntry method + https://bugs.webkit.org/show_bug.cgi?id=37578 + + Remove deprecated methods. + + * public/WebSecurityPolicy.h: + * src/WebSecurityPolicy.cpp: + +2010-05-14 Kenneth Russell <kbr@google.com> + + Reviewed by Darin Adler. + + Rename WebGLArray types to TypedArray types + https://bugs.webkit.org/show_bug.cgi?id=39091 + + Extended functionality of do-webcore-rename script and used it to + rename the WebGLArray types to the TypedArray naming convention. + The only source files which were touched by hand, and which are + being manually reviewed, are: + WebCore/page/DOMWindow.idl + WebCore/bindings/generic/RuntimeEnabledFeatures.h (script's changes undone) + WebKit/WebCore/bindings/js/JSDOMWindowCustom.cpp + WebKit/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp + These only needed to be touched to update the aliases between the + WebGLArray and TypedArray names introduced in bug 39036. (It was + not feasible to have do-webcore-rename handle this as it would + introduce circular renamings.) These aliases will be removed in + roughly a month once existing WebGL content has been updated. + + No new tests; covered under existing WebGL tests. Updated + constructed-objects-prototypes and prototype-inheritance-2 tests. + Ran all layout tests in Safari and all WebGL tests in Chromium. + + * src/GraphicsContext3D.cpp: + (WebCore::GraphicsContext3DInternal::bufferData): + (WebCore::GraphicsContext3DInternal::bufferSubData): + +2010-05-14 Jochen Eisinger <jochen@chromium.org> + + Reviewed by Eric Seidel. + + Make ImageDiff depend on webkit (again). + https://bugs.webkit.org/show_bug.cgi?id=39000 + + * WebKit.gyp: + +2010-05-14 James Simonsen <simonjam+webkit@google.com> + + Reviewed by Darin Fisher. + + [chromium] Expose volume through WebMediaPlayerClient + https://bugs.webkit.org/show_bug.cgi?id=38947 + + * public/WebMediaPlayerClient.h: + * src/WebMediaPlayerClientImpl.cpp: + (WebKit::WebMediaPlayerClientImpl::volume): + * src/WebMediaPlayerClientImpl.h: + +2010-05-14 Tony Gentilcore <tonyg@chromium.org> + + Reviewed by Darin Fisher. + + [chromium] Update chromium port to send/receive cached metadata + https://bugs.webkit.org/show_bug.cgi?id=38665 + + * public/WebKitClient.h: + (WebKit::WebKitClient::cacheMetadata): + * public/WebURLLoaderClient.h: + (WebKit::WebURLLoaderClient::didReceiveCachedMetadata): + * public/WebURLResponse.h: + * src/ChromiumBridge.cpp: + (WebCore::ChromiumBridge::cacheMetadata): + * src/ResourceHandle.cpp: + (WebCore::ResourceHandleInternal::didReceiveCachedMetadata): + (WebCore::ResourceHandle::cacheMetadata): + * src/WebURLResponse.cpp: + (WebKit::WebURLResponse::responseTime): + (WebKit::WebURLResponse::setResponseTime): + +2010-05-13 Tony Chang <tony@chromium.org> + + Reviewed by Kent Tamura. + + [chromium] enable DRT build in chromium (for the last time) + https://bugs.webkit.org/show_bug.cgi?id=39109 + + * WebKit.gyp: + +2010-05-13 Pavel Feldman <pfeldman@chromium.org> + + Reviewed by Yury Semikhatsky. + + Web Inspector: main inspector toolbar takes noticeable time to expand. + + https://bugs.webkit.org/show_bug.cgi?id=39013 + + * src/js/DevTools.js: + (devtools.domContentLoaded): + +2010-05-12 Hans Wennborg <hans@chromium.org> + + Reviewed by Jeremy Orlow. + + [Chromium] Remove transitional functions from WebStorageNamespace and WebViewClient. + https://bugs.webkit.org/show_bug.cgi?id=38985 + + These functions are no longer called as of Chromium revision 47020. + This is part of resolving http://crbug.com/42740 + + * public/WebStorageNamespace.h: + * public/WebViewClient.h: + (WebKit::WebViewClient::createSessionStorageNamespace): + +2010-05-12 Tony Chang <tony@chromium.org> + + Reviewed by Kent Tamura. + + [chromium] disable DRT in chromium again + https://bugs.webkit.org/show_bug.cgi?id=39049 + + * WebKit.gyp: + +2010-05-12 John Abd-El-Malek <jam@chromium.org> + + Reviewed by Darin Fisher. + + [chromium] Disable WebScrollbarImpl's scrollbar if it's not needed + https://bugs.webkit.org/show_bug.cgi?id=39025 + + * src/WebScrollbarImpl.cpp: + (WebKit::WebScrollbarImpl::setLocation): + (WebKit::WebScrollbarImpl::setDocumentSize): + +2010-05-12 Dumitru Daniliuc <dumi@chromium.org> + + Reviewed by Dimitri Glazkov. + + Removing the unnecessary dirfd parameter. + https://bugs.webkit.org/show_bug.cgi?id=38869 + + * public/WebKitClient.h: + (WebKit::WebKitClient::databaseOpenFile): + * src/ChromiumBridge.cpp: + (WebCore::ChromiumBridge::databaseOpenFile): + +2010-05-12 Jeremy Orlow <jorlow@chromium.org> + + Reviewed by Steve Block. + + [Chromium] Pass the origin parameter for WebIndexedDatabase::open + https://bugs.webkit.org/show_bug.cgi?id=38983 + + * public/WebIndexedDatabase.h: + * src/IndexedDatabaseProxy.cpp: + (WebCore::IndexedDatabaseProxy::open): + * src/WebIndexedDatabaseImpl.cpp: + (WebKit::WebIndexedDatabaseImpl::open): + * src/WebIndexedDatabaseImpl.h: + +2010-05-10 yael aharon <yael.aharon@nokia.com> + + Reviewed by Darin Adler. + + Support control attribute of HTMLLabelElement + https://bugs.webkit.org/show_bug.cgi?id=38688 + + Renamed HTMLLabelElement::correspondingControl to HTMLLabelElement::control + + * src/WebLabelElement.cpp: + (WebKit::WebLabelElement::correspondingControl): + +2010-05-12 MORITA Hajime <morrita@google.com> + + Reviewed by Kent Tamura. + + [Chromium] Support HTML5 <progress> element on Windows. + https://bugs.webkit.org/show_bug.cgi?id=37308 + + Extended ChromiumBridge to handle progress bar painting, + and added delegations to it. + + No new tests. Test cases should be shared with existing ones for + progress element. Expectaions will be added after PROGRESS_TAG is + enabled on Chromium tree. + + * public/WebThemeEngine.h: + (WebKit::WebThemeEngine::paintProgressBar): + * src/ChromiumBridge.cpp: + (WebCore::ChromiumBridge::paintProgressBar): + +2010-05-12 Marcus Bulach <bulach@chromium.org> + + Reviewed by Steve Block. + + Attaches the geolocation bridge later on startUpdating(). + This prevents a page requesting permission when it has just accessed navigator.geolocation (without calling navigator.geolocation.getCurrentPosition/watchPosition). + Note: when Geolocation::haveSuitableCachedPosition(), WebGeolocationServiceBridgeImpl::startUpdating() is not called, + so we attach the bridge if needed at requestGeolocationPermissionForFrame(). + https://bugs.webkit.org/show_bug.cgi?id=38323 + http://crbug.com/42789 + + * src/ChromeClientImpl.cpp: + (WebKit::ChromeClientImpl::requestGeolocationPermissionForFrame): + * src/WebGeolocationServiceBridgeImpl.cpp: + (WebKit::WebGeolocationServiceBridgeImpl::attachBridgeIfNeeded): + (WebKit::WebGeolocationServiceBridgeImpl::setLastPosition): + +2010-05-12 Tony Chang <tony@chromium.org> + + Reviewed by Kent Tamura. + + [chromium] add DRT back to the chromium build + https://bugs.webkit.org/show_bug.cgi?id=38978 + + * WebKit.gyp: + +2010-05-11 Kent Tamura <tkent@chromium.org> + + Reviewed by Dimitri Glazkov. + + [DRT/Chromium] Apply recent changes of test_shell to DRT + https://bugs.webkit.org/show_bug.cgi?id=38895 + + * DEPS: Update Chromium revision to use the recent webkit_support change. + * WebKit.gyp: Add JavaScriptCore/wtf to 'include' section. + * src/WebGraphicsContext3D.cpp: + Remove ENABLE(3D_CANVAS) to provide an empty implementation of + WebGraphicsContext3D::createDefault(). + +2010-05-11 Avi Drissman <avi@chromium.org> + + Reviewed by Darin Fisher. + + [Chromium] Pipe RTL info into WebPopupMenuInfo + https://bugs.webkit.org/show_bug.cgi?id=38749 + + * public/WebPopupMenuInfo.h: + * src/ChromeClientImpl.cpp: + (WebKit::ChromeClientImpl::getPopupMenuInfo): + +2010-05-11 David Holloway <dhollowa@chromium.org> + + Reviewed by Darin Fisher. + + [chromium] Add size method to WebInputElement class, providing same data + as HTMLInputElement::size(). During form AutoFill Chromium needs to + access the input element's size attribute in aid of form matching and + filling heuristics. + + https://bugs.webkit.org/show_bug.cgi?id=38825 + + * public/WebInputElement.h: + * src/WebInputElement.cpp: + (WebKit::WebInputElement::size): + +2010-05-11 Nate Chapin <japhet@chromium.org> + + Reviewed by Adam Barth. + + Crash fix in WebPageSerializerImpl::serialize(). + + https://bugs.webkit.org/show_bug.cgi?id=38543 + + The relevant test is a test_shell_test in src.chromium.org, because neither + DRT nor the Chromium webkit unit tests can currently cover the serializer + functionality. + + * src/WebPageSerializerImpl.cpp: + (WebKit::WebPageSerializerImpl::serialize): Check each frame's url before using it, + since they are not guaranteed to be valid (e.g., if the frame was treated as a download). + +2010-05-11 Jian Li <jianli@chromium.org> + + Reviewed by Dmitry Titov. + + Expose FileReader interface. + https://bugs.webkit.org/show_bug.cgi?id=38609 + + * features.gypi: turn on building FileReader for Chromium. + +2010-05-10 Tony Chang <tony@chromium.org> + + Reviewed by Kent Tamura. + + [chromium] don't build DRT in chromium checkouts due to a circular gyp dependency + https://bugs.webkit.org/show_bug.cgi?id=38889 + + * WebKit.gyp: + +2010-05-10 John Abd-El-Malek <jam@chromium.org> + + Reviewed by Darin Fisher. + + [chromium] Add WebKitScrollbar interface to allow Chromium code to reuse the scrollbar code + https://bugs.webkit.org/show_bug.cgi?id=38854 + + * public/WebScrollbar.h: Added. + (WebKit::WebScrollbar::): + (WebKit::WebScrollbar::~WebScrollbar): + * public/WebScrollbarClient.h: Added. + * public/WebThemeEngine.h: + * src/AssertMatchingEnums.cpp: + * src/WebScrollbarImpl.cpp: Added. + (WebKit::WebScrollbar::create): + (WebKit::WebScrollbar::defaultThickness): + (WebKit::WebScrollbarImpl::WebScrollbarImpl): + (WebKit::WebScrollbarImpl::~WebScrollbarImpl): + (WebKit::WebScrollbarImpl::setLocation): + (WebKit::WebScrollbarImpl::value): + (WebKit::WebScrollbarImpl::setValue): + (WebKit::WebScrollbarImpl::setDocumentSize): + (WebKit::WebScrollbarImpl::scroll): + (WebKit::WebScrollbarImpl::paint): + (WebKit::WebScrollbarImpl::handleInputEvent): + (WebKit::WebScrollbarImpl::onMouseDown): + (WebKit::WebScrollbarImpl::onMouseUp): + (WebKit::WebScrollbarImpl::onMouseMove): + (WebKit::WebScrollbarImpl::onMouseLeave): + (WebKit::WebScrollbarImpl::onMouseWheel): + (WebKit::WebScrollbarImpl::onKeyDown): + (WebKit::WebScrollbarImpl::valueChanged): + (WebKit::WebScrollbarImpl::invalidateScrollbarRect): + (WebKit::WebScrollbarImpl::isActive): + (WebKit::WebScrollbarImpl::scrollbarCornerPresent): + (WebKit::WebScrollbarImpl::getTickmarks): + * src/WebScrollbarImpl.h: Added. + * src/WebViewImpl.cpp: + (WebKit::WebViewImpl::scrollViewWithKeyboard): + (WebKit::WebViewImpl::mapKeyCodeForScroll): + * src/WebViewImpl.h: + +2010-05-10 Tony Gentilcore <tonyg@chromium.org> + + Reviewed by Adam Barth. + + Provide mechanism to cache metadata for a resource + https://bugs.webkit.org/show_bug.cgi?id=37874 + + * src/ResourceHandle.cpp: + (WebCore::ResourceHandle::cacheMetadata): + +2010-05-10 Hans Wennborg <hans@chromium.org> + + Reviewed by Jeremy Orlow. + + [Chromium] Add quota parameter to WebViewClient::createSessionStorageNamespace() + https://bugs.webkit.org/show_bug.cgi?id=38750 + + Put a per-origin quota on session storage since it is using memory in + the browser process, and should not be allowed to grow arbitrarily + large. See also http://trac.webkit.org/changeset/58828. + + * public/WebStorageNamespace.h: + * public/WebViewClient.h: + (WebKit::WebViewClient::createSessionStorageNamespace): + * src/StorageNamespaceProxy.cpp: + (WebCore::StorageNamespace::sessionStorageNamespace): + + +2010-05-10 Jeremy Orlow <jorlow@chromium.org> + + Reviewed by Nate Chapin. + + Change IndexedDB to use events instead of callbacks + https://bugs.webkit.org/show_bug.cgi?id=38594 + + Change the glue here to match the changes I made in WebCore. + + * WebKit.gyp: + * public/WebIDBCallbacks.h: + * public/WebIndexedDatabase.h: + * src/IDBCallbacksProxy.cpp: Added. + (WebCore::IDBCallbacksProxy::IDBCallbacksProxy): + (WebCore::IDBCallbacksProxy::~IDBCallbacksProxy): + (WebCore::IDBCallbacksProxy::onError): + (WebCore::IDBCallbacksProxy::onSuccess): + * src/IDBCallbacksProxy.h: + * src/IndexedDatabaseProxy.cpp: + (WebCore::IndexedDatabaseProxy::open): + * src/IndexedDatabaseProxy.h: + * src/WebIndexedDatabaseImpl.cpp: + (WebKit::WebIndexedDatabaseImpl::open): + * src/WebIndexedDatabaseImpl.h: + +2010-05-08 Jens Alfke <snej@chromium.org> + + Reviewed by Darin Fisher. + + [chromium] WebFrame::registerPasswordListener shouldn't assert on duplicate listener. + https://bugs.webkit.org/show_bug.cgi?id=38765 + + * public/WebFrame.h: + (WebKit::WebFrameImpl::registerPasswordListener): Changed return type to bool. Updated comment. + * src/WebFrameImpl.cpp: + (WebKit::WebFrameImpl::registerPasswordListener): Return false instead of asserting. + * src/WebFrameImpl.h: + (WebKit::WebFrameImpl::registerPasswordListener): Changed return type to bool. + +2010-05-08 Michael Nordman <michaeln@google.com> + + Reviewed by Dmitry Titov. + + Add an additional parameter to the WebSharedWorker::startWorkerContext method + to indicate which appcache the shared worker script resource was loaded from, + and provide that value when calling out to chrome via this interface. + https://bugs.webkit.org/show_bug.cgi?id=38605 + + I'm keeping the old method around until patches can land in both repositories + that make the old method obsolete and unneeded. There's a FIXME for that. + + Also somewhat related but independent change to propagate the runtime enabled + flag thru to the page settings instance used by the 'shadow page'. + + * public/WebSharedWorker.h: Add the new param (but keep the old interface around for now too) + (WebKit::WebSharedWorker::startWorkerContext): + * src/SharedWorkerRepository.cpp: Provide the value when calling out to chrome. + (WebCore::SharedWorkerScriptLoader::notifyFinished): + * src/WebSharedWorkerImpl.cpp: + (WebKit::WebSharedWorkerImpl::startWorkerContext): + * src/WebSharedWorkerImpl.h: + * src/WebWorkerBase.cpp: Propagate runtime enabled flag thru to the page settings. + (WebKit::WebWorkerBase::initializeLoader): + +2010-05-07 Darin Fisher <darin@chromium.org> + + Fix build bustage. Update to Chromium code that avoids a bad + dependency from net/ on chrome/. + + * DEPS: + +2010-05-07 Darin Fisher <darin@chromium.org> + + Fix build bustage. Update to Chromium code that no longer uses + deprecated methods. + + * DEPS: + +2010-05-07 Darin Fisher <darin@chromium.org> + + Reviewed by Dimitri Glazkov. + + [chromium] clear out more deprecated methods that are no longer used + https://bugs.webkit.org/show_bug.cgi?id=38702 + + * public/WebFrame.h: + * public/WebNode.h: + * src/WebFrameImpl.cpp: + * src/WebFrameImpl.h: + * src/WebNode.cpp: + +2010-05-07 Finnur Thorarinsson <finnur.webkit@gmail.com> + + Reviewed by Dimitri Glazkov. + + [chromium]: Fixing Find in page crash on sites.google.com + https://bugs.webkit.org/show_bug.cgi?id=38591 + + setMarkerActive should not try to set a collapsed marker as + active. This can happen when you Edit a Sites page after doing + a Find operation and then you press FindNext. + + * src/WebFrameImpl.cpp: + (WebKit::WebFrameImpl::setMarkerActive): + 2010-05-06 Kent Tamura <tkent@chromium.org> Reviewed by Dimitri Glazkov. diff --git a/WebKit/chromium/DEPS b/WebKit/chromium/DEPS index 07401d7..9e34fe4 100644 --- a/WebKit/chromium/DEPS +++ b/WebKit/chromium/DEPS @@ -32,7 +32,7 @@ vars = { 'chromium_svn': 'http://src.chromium.org/svn/trunk/src', - 'chromium_rev': '45932', + 'chromium_rev': '46899', 'pthreads-win32_rev': '26716', } @@ -132,6 +132,9 @@ deps = { 'third_party/npapi': Var('chromium_svn')+'/third_party/npapi@'+Var('chromium_rev'), + 'third_party/ppapi': + From('chromium_deps', 'src/third_party/ppapi'), + 'third_party/ots': From('chromium_deps', 'src/third_party/ots'), diff --git a/WebKit/chromium/WebKit.gyp b/WebKit/chromium/WebKit.gyp index b3a926e..8ac5a90 100644 --- a/WebKit/chromium/WebKit.gyp +++ b/WebKit/chromium/WebKit.gyp @@ -31,6 +31,7 @@ { 'includes': [ 'features.gypi', + '../../WebKitTools/DumpRenderTree/DumpRenderTree.gypi', ], 'variables': { 'webkit_target_type': 'static_library', @@ -45,11 +46,6 @@ # WebKit is checked out in src/chromium/third_party/WebKit 'chromium_src_dir': '../../../..', }], - # We can't turn on warnings on Windows and Linux until we upstream the - # WebKit API. - ['OS=="mac"', { - 'chromium_code': 1, - }], ], }, 'targets': [ @@ -180,6 +176,8 @@ 'public/WebRect.h', 'public/WebRegularExpression.h', 'public/WebRuntimeFeatures.h', + 'public/WebScrollbar.h', + 'public/WebScrollbarClient.h', 'public/WebScreenInfo.h', 'public/WebScriptController.h', 'public/WebScriptSource.h', @@ -261,6 +259,7 @@ 'src/gtk/WebFontInfo.cpp', 'src/gtk/WebFontInfo.h', 'src/gtk/WebInputEventFactory.cpp', + 'src/IDBCallbacksProxy.cpp', 'src/IDBCallbacksProxy.h', 'src/IDBDatabaseProxy.cpp', 'src/IDBDatabaseProxy.h', @@ -382,6 +381,8 @@ 'src/WebRegularExpression.cpp', 'src/WebRuntimeFeatures.cpp', 'src/WebScriptController.cpp', + 'src/WebScrollbarImpl.cpp', + 'src/WebScrollbarImpl.h', 'src/WebSearchableFormData.cpp', 'src/WebSecurityOrigin.cpp', 'src/WebSecurityPolicy.cpp', @@ -443,6 +444,11 @@ 'sources/': [ ['exclude', 'Skia\\.cpp$'], ], + 'variables': { + # FIXME: Turn on warnings on other platforms and for + # other targets. + 'chromium_code': 1, + } }, { # else: OS!="mac" 'sources/': [ ['exclude', '/mac/'], @@ -526,7 +532,119 @@ }], ], }, + { + 'target_name': 'ImageDiff', + 'type': 'executable', + 'dependencies': [ + 'webkit', + '../../JavaScriptCore/JavaScriptCore.gyp/JavaScriptCore.gyp:wtf', + '<(chromium_src_dir)/gfx/gfx.gyp:gfx', + ], + 'include_dirs': [ + '../../JavaScriptCore', + '<(DEPTH)', + ], + 'sources': [ + '../../WebKitTools/DumpRenderTree/chromium/ImageDiff.cpp', + ], + }, + { + 'target_name': 'DumpRenderTree', + 'type': 'executable', + 'mac_bundle': 1, + 'dependencies': [ + 'webkit', + '../../JavaScriptCore/JavaScriptCore.gyp/JavaScriptCore.gyp:wtf_config', + '<(chromium_src_dir)/third_party/icu/icu.gyp:icuuc', + '<(chromium_src_dir)/webkit/support/webkit_support.gyp:webkit_support', + ], + 'include_dirs': [ + '.', + '../../JavaScriptCore', + '../../JavaScriptCore/wtf', # wtf/text/*.h refers headers in wtf/ without wtf/. + '<(DEPTH)', + ], + 'defines': [ + # Technically not a unit test but require functions available only to + # unit tests. + 'UNIT_TEST', + ], + 'sources': [ + '<@(drt_files)', + ], + 'conditions': [ + ['OS=="mac"', { + 'dependencies': ['LayoutTestHelper'], + + 'mac_bundle_resources': [ + '../../WebKitTools/DumpRenderTree/qt/fonts/AHEM____.TTF', + '../../WebKitTools/DumpRenderTree/fonts/WebKitWeightWatcher100.ttf', + '../../WebKitTools/DumpRenderTree/fonts/WebKitWeightWatcher200.ttf', + '../../WebKitTools/DumpRenderTree/fonts/WebKitWeightWatcher300.ttf', + '../../WebKitTools/DumpRenderTree/fonts/WebKitWeightWatcher400.ttf', + '../../WebKitTools/DumpRenderTree/fonts/WebKitWeightWatcher500.ttf', + '../../WebKitTools/DumpRenderTree/fonts/WebKitWeightWatcher600.ttf', + '../../WebKitTools/DumpRenderTree/fonts/WebKitWeightWatcher700.ttf', + '../../WebKitTools/DumpRenderTree/fonts/WebKitWeightWatcher800.ttf', + '../../WebKitTools/DumpRenderTree/fonts/WebKitWeightWatcher900.ttf', + ], + 'actions': [ + { + 'action_name': 'repack_locale', + 'variables': { + 'repack_path': '<(chromium_src_dir)/tools/data_pack/repack.py', + 'pak_inputs': [ + '<(SHARED_INTERMEDIATE_DIR)/webkit/webkit_chromium_resources.pak', + '<(SHARED_INTERMEDIATE_DIR)/webkit/webkit_strings_en-US.pak', + '<(SHARED_INTERMEDIATE_DIR)/webkit/webkit_resources.pak', + ]}, + 'inputs': [ + '<(repack_path)', + '<@(pak_inputs)', + ], + 'outputs': [ + '<(INTERMEDIATE_DIR)/repack/DumpRenderTree.pak', + ], + 'action': ['python', '<(repack_path)', '<@(_outputs)', '<@(pak_inputs)'], + 'process_outputs_as_mac_bundle_resources': 1, + }, + ], # actions + }], + ['OS!="linux" and OS!="freebsd" and OS!="openbsd"', { + 'sources/': [ + ['exclude', '(Gtk|Linux)\\.cpp$'] + ] + }], + ['OS!="win"', { + 'sources/': [ + ['exclude', 'Win\\.cpp$'], + ] + }], + ['OS!="mac"', { + 'sources/': [ + # .mm is already excluded by common.gypi + ['exclude', 'Mac\\.cpp$'], + ] + }], + ], + }, ], # targets + 'conditions': [ + ['OS=="mac"', { + 'targets': [ + { + 'target_name': 'LayoutTestHelper', + 'type': 'executable', + 'sources': ['../../WebKitTools/DumpRenderTree/chromium/LayoutTestHelper.mm'], + 'link_settings': { + 'libraries': [ + '$(SDKROOT)/System/Library/Frameworks/AppKit.framework', + ], + }, + }, + ], + }], + ], # conditions } # Local Variables: diff --git a/WebKit/chromium/features.gypi b/WebKit/chromium/features.gypi index 7146685..87a6e09 100644 --- a/WebKit/chromium/features.gypi +++ b/WebKit/chromium/features.gypi @@ -47,7 +47,7 @@ 'ENABLE_OFFLINE_WEB_APPLICATIONS=1', 'ENABLE_DASHBOARD_SUPPORT=0', 'ENABLE_DOM_STORAGE=1', - 'ENABLE_FILE_READER=0', + 'ENABLE_FILE_READER=1', 'ENABLE_FILE_WRITER=0', 'ENABLE_GEOLOCATION=1', 'ENABLE_JAVASCRIPT_DEBUGGER=1', diff --git a/WebKit/chromium/gyp_webkit b/WebKit/chromium/gyp_webkit index 812ed27..1ca6133 100755 --- a/WebKit/chromium/gyp_webkit +++ b/WebKit/chromium/gyp_webkit @@ -91,8 +91,7 @@ if __name__ == '__main__': '--depth=./', # gyp files to execute. - 'WebKit.gyp', - '../../WebKitTools/DumpRenderTree/DumpRenderTree.gyp/DumpRenderTree.gyp']) + 'WebKit.gyp']) print 'Updating webkit projects from gyp files...' sys.stdout.flush() diff --git a/WebKit/chromium/public/WebCommonWorkerClient.h b/WebKit/chromium/public/WebCommonWorkerClient.h index 13603cb..cea6471 100644 --- a/WebKit/chromium/public/WebCommonWorkerClient.h +++ b/WebKit/chromium/public/WebCommonWorkerClient.h @@ -35,6 +35,7 @@ namespace WebKit { class WebApplicationCacheHost; class WebApplicationCacheHostClient; +class WebFrame; class WebNotificationPresenter; class WebString; class WebWorker; @@ -79,6 +80,9 @@ public: // Called on the main webkit thread in the worker process during initialization. virtual WebApplicationCacheHost* createApplicationCacheHost(WebApplicationCacheHostClient*) = 0; + // Called on the main webkit thread before opening a web database. + virtual bool allowDatabase(WebFrame*, const WebString& name, const WebString& displayName, unsigned long estimatedSize) = 0; + protected: ~WebCommonWorkerClient() { } }; diff --git a/WebKit/chromium/public/WebContextMenuData.h b/WebKit/chromium/public/WebContextMenuData.h index 25036d4..8ed1f1b 100644 --- a/WebKit/chromium/public/WebContextMenuData.h +++ b/WebKit/chromium/public/WebContextMenuData.h @@ -134,6 +134,17 @@ struct WebContextMenuData { // Custom context menu items provided by the WebCore internals. WebVector<WebMenuItemInfo> customItems; + + WebContextMenuData() + : mediaType(MediaTypeNone) + , isImageBlocked(false) + , mediaFlags(MediaNone) + , isSpellCheckingEnabled(false) + , isEditable(false) + , writingDirectionDefault(CheckableMenuItemDisabled) + , writingDirectionLeftToRight(CheckableMenuItemEnabled) + , writingDirectionRightToLeft(CheckableMenuItemEnabled) + , editFlags(0) { } }; } // namespace WebKit diff --git a/WebKit/chromium/public/WebFrame.h b/WebKit/chromium/public/WebFrame.h index f112446..772db75 100644 --- a/WebKit/chromium/public/WebFrame.h +++ b/WebKit/chromium/public/WebFrame.h @@ -462,21 +462,16 @@ public: // Registers a listener for the specified user name input element. The // listener will receive notifications for blur and when autocomplete // should be triggered. - // The WebFrame becomes the owner of the passed listener. - virtual void registerPasswordListener( + // An element can have only one listener. If a listener already exists, + // this method returns false and does not add the new one. + // Either way, the WebFrame becomes the owner of the passed listener. + virtual bool registerPasswordListener( WebInputElement, WebPasswordAutocompleteListener*) = 0; // Utility ------------------------------------------------------------- - // Given a relative URL, returns an absolute URL by resolving the URL - // relative to the base URL of the frame's document. This uses the - // same algorithm that WebKit uses to resolve hyperlinks found in a - // HTML document. - // Deprecated. Use document().completeURL() instead. - virtual WebURL completeURL(const WebString&) const = 0; - // Returns the contents of this frame as a string. If the text is // longer than maxChars, it will be clipped to that length. WARNING: // This function may be slow depending on the number of characters diff --git a/WebKit/chromium/public/WebIDBCallbacks.h b/WebKit/chromium/public/WebIDBCallbacks.h index 9e85aa8..610f7d4 100644 --- a/WebKit/chromium/public/WebIDBCallbacks.h +++ b/WebKit/chromium/public/WebIDBCallbacks.h @@ -33,22 +33,19 @@ namespace WebKit { +class WebIDBDatabase; class WebIDBDatabaseError; +class WebSerializedScriptValue; -// Every IndexedDB method takes in a pair of callbacks for error/success which -// implement this class. Either 0 or 1 of these methods will be called and the -// callback class may be deleted any time after the callback is called. -template <typename ResultType> class WebIDBCallbacks { public: virtual ~WebIDBCallbacks() { } - // If the method was a success, this method is called with the result. The - // result is a pointer that the callback takes ownership of. - virtual void onSuccess(ResultType*) = 0; - - // Called in the event of an error. + // For classes that follow the PImpl pattern, pass a const reference. + // For the rest, pass ownership to the callee via a pointer. virtual void onError(const WebIDBDatabaseError&) = 0; + virtual void onSuccess(WebIDBDatabase*) = 0; + virtual void onSuccess(const WebSerializedScriptValue&) = 0; }; } // namespace WebKit diff --git a/WebKit/chromium/public/WebIndexedDatabase.h b/WebKit/chromium/public/WebIndexedDatabase.h index bb75170..8861456 100644 --- a/WebKit/chromium/public/WebIndexedDatabase.h +++ b/WebKit/chromium/public/WebIndexedDatabase.h @@ -47,7 +47,8 @@ public: virtual ~WebIndexedDatabase() { } - virtual void open(const WebString& name, const WebString& description, bool modifyDatabase, WebIDBCallbacks<WebIDBDatabase>*, WebFrame*, int& exceptionCode) = 0; + // The WebKit implementation of open ignores the WebFrame* parameter. + virtual void open(const WebString& name, const WebString& description, bool modifyDatabase, WebIDBCallbacks*, const WebString& origin, WebFrame*, int& exceptionCode) = 0; }; } // namespace WebKit diff --git a/WebKit/chromium/public/WebInputElement.h b/WebKit/chromium/public/WebInputElement.h index a7a71b0..0de96a7 100644 --- a/WebKit/chromium/public/WebInputElement.h +++ b/WebKit/chromium/public/WebInputElement.h @@ -85,6 +85,7 @@ namespace WebKit { WEBKIT_API int maxLength() const; WEBKIT_API bool isActivatedSubmit() const; WEBKIT_API void setActivatedSubmit(bool); + WEBKIT_API int size() const; WEBKIT_API void setValue(const WebString& value); WEBKIT_API WebString value() const; WEBKIT_API void setAutofilled(bool); diff --git a/WebKit/chromium/public/WebKitClient.h b/WebKit/chromium/public/WebKitClient.h index 97d25a8..584679d 100644 --- a/WebKit/chromium/public/WebKitClient.h +++ b/WebKit/chromium/public/WebKitClient.h @@ -135,7 +135,7 @@ public: // Opens a database file; dirHandle should be 0 if the caller does not need // a handle to the directory containing this file virtual FileHandle databaseOpenFile( - const WebString& vfsFileName, int desiredFlags, FileHandle* dirHandle) { return FileHandle(); } + const WebString& vfsFileName, int desiredFlags) { return FileHandle(); } // Deletes a database file and returns the error code virtual int databaseDeleteFile(const WebString& vfsFileName, bool syncDir) { return 0; } @@ -192,6 +192,9 @@ public: // Returns the User-Agent string that should be used for the given URL. virtual WebString userAgent(const WebURL&) { return WebString(); } + // A suggestion to cache this metadata in association with this URL. + virtual void cacheMetadata(const WebURL&, double responseTime, const char* data, size_t dataSize) { } + // Plugins ------------------------------------------------------------- diff --git a/WebKit/chromium/public/WebMediaPlayerClient.h b/WebKit/chromium/public/WebMediaPlayerClient.h index 47ce64e..7e5dd68 100644 --- a/WebKit/chromium/public/WebMediaPlayerClient.h +++ b/WebKit/chromium/public/WebMediaPlayerClient.h @@ -48,6 +48,7 @@ public: virtual void rateChanged() = 0; virtual void sizeChanged() = 0; virtual void sawUnsupportedTracks() = 0; + virtual float volume() const = 0; protected: ~WebMediaPlayerClient() { } diff --git a/WebKit/chromium/public/WebNode.h b/WebKit/chromium/public/WebNode.h index 792ede5..c7aa8ef 100644 --- a/WebKit/chromium/public/WebNode.h +++ b/WebKit/chromium/public/WebNode.h @@ -84,8 +84,6 @@ public: WEBKIT_API WebString nodeName() const; WEBKIT_API WebString nodeValue() const; WEBKIT_API bool setNodeValue(const WebString&); - // Deprecated. Use document().frame() instead. - WEBKIT_API WebFrame* frame() const; WEBKIT_API WebDocument document() const; WEBKIT_API WebNode firstChild() const; WEBKIT_API WebNode lastChild() const; @@ -106,22 +104,6 @@ public: // Note: This method only works properly after layout has occurred. WEBKIT_API bool hasNonEmptyBoundingBox() const; - // Deprecated. Use to() instead. - template<typename T> T toElement() - { - T res; - res.WebNode::assign(*this); - return res; - } - - // Deprecated. Use toConst() instead. - template<typename T> const T toConstElement() const - { - T res; - res.WebNode::assign(*this); - return res; - } - template<typename T> T to() { T res; diff --git a/WebKit/chromium/public/WebPasswordAutocompleteListener.h b/WebKit/chromium/public/WebPasswordAutocompleteListener.h index db6589d..fdc8476 100644 --- a/WebKit/chromium/public/WebPasswordAutocompleteListener.h +++ b/WebKit/chromium/public/WebPasswordAutocompleteListener.h @@ -49,5 +49,4 @@ public: } // namespace WebKit - #endif diff --git a/WebKit/chromium/public/WebPluginContainer.h b/WebKit/chromium/public/WebPluginContainer.h index 41e304e..7b23f08 100644 --- a/WebKit/chromium/public/WebPluginContainer.h +++ b/WebKit/chromium/public/WebPluginContainer.h @@ -35,6 +35,7 @@ struct NPObject; namespace WebKit { +class WebElement; class WebString; class WebURL; class WebURLRequest; @@ -42,6 +43,9 @@ struct WebRect; class WebPluginContainer { public: + // Returns the element containing this plugin. + virtual WebElement element() = 0; + virtual void invalidate() = 0; virtual void invalidateRect(const WebRect&) = 0; diff --git a/WebKit/chromium/public/WebPopupMenuInfo.h b/WebKit/chromium/public/WebPopupMenuInfo.h index 7eb132e..7cf1b63 100644 --- a/WebKit/chromium/public/WebPopupMenuInfo.h +++ b/WebKit/chromium/public/WebPopupMenuInfo.h @@ -44,6 +44,7 @@ struct WebPopupMenuInfo { int itemFontSize; int selectedIndex; WebVector<WebMenuItemInfo> items; + bool rightAligned; }; } // namespace WebKit diff --git a/WebKit/chromium/public/WebScrollbar.h b/WebKit/chromium/public/WebScrollbar.h new file mode 100644 index 0000000..6941f4d --- /dev/null +++ b/WebKit/chromium/public/WebScrollbar.h @@ -0,0 +1,98 @@ +/* + * Copyright (C) 2010 Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef WebScrollbar_h +#define WebScrollbar_h + +#include "WebCanvas.h" +#include "WebCommon.h" + +namespace WebKit { + +class WebInputEvent; +class WebScrollbarClient; +struct WebRect; + +class WebScrollbar { +public: + enum Orientation { + Horizontal, + Vertical + }; + + enum ScrollDirection { + ScrollBackward, + ScrollForward + }; + + enum ScrollGranularity { + ScrollByLine, + ScrollByPage, + ScrollByDocument, + ScrollByPixel + }; + + // Creates a WebScrollbar. + WEBKIT_API static WebScrollbar* create(WebScrollbarClient*, Orientation); + + virtual ~WebScrollbar() {} + + // Gets the thickness of the scrollbar in pixels. + WEBKIT_API static int defaultThickness(); + + // Sets the rectangle of the scrollbar. + virtual void setLocation(const WebRect&) = 0; + + // Gets the current value (i.e. position inside the region). + virtual int value() const = 0; + + // Sets the current value. + virtual void setValue(int position) = 0; + + // Sets the size of the scrollable region in pixels. i.e. if a document is + // 800x10000 pixels and the viewport is 1000x1000 pixels, then setLocation + // for the vertical scrollbar would have passed in a rectangle like: + // (800 - defaultThickness(), 0) (defaultThickness() x 10000) + // and setDocumentSize(10000) + virtual void setDocumentSize(int size) = 0; + + // Scroll back or forward with the given granularity. + virtual void scroll(ScrollDirection, ScrollGranularity, float multiplier) = 0; + + // Paint the given rectangle. + virtual void paint(WebCanvas*, const WebRect&) = 0; + + // Returns true iff the given event was used. + virtual bool handleInputEvent(const WebInputEvent&) = 0; +}; + +} // namespace WebKit + +#endif diff --git a/WebKit/chromium/public/WebScrollbarClient.h b/WebKit/chromium/public/WebScrollbarClient.h new file mode 100644 index 0000000..d1825c8 --- /dev/null +++ b/WebKit/chromium/public/WebScrollbarClient.h @@ -0,0 +1,49 @@ +/* + * Copyright (C) 2010 Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef WebScrollbarClient_h +#define WebScrollbarClient_h + +namespace WebKit { + +class WebScrollbar; +struct WebRect; +template <typename T> class WebVector; + +class WebScrollbarClient { +public: + virtual void valueChanged(WebScrollbar*) = 0; + virtual void invalidateScrollbarRect(WebScrollbar*, const WebRect&) = 0; + virtual void getTickmarks(WebScrollbar*, WebVector<WebRect>*) const = 0; +}; + +} // namespace WebKit + +#endif diff --git a/WebKit/chromium/public/WebSecurityPolicy.h b/WebKit/chromium/public/WebSecurityPolicy.h index ac0031d..f15dd75 100644 --- a/WebKit/chromium/public/WebSecurityPolicy.h +++ b/WebKit/chromium/public/WebSecurityPolicy.h @@ -62,12 +62,6 @@ public: const WebURL& sourceOrigin, const WebString& destinationProtocol, const WebString& destinationHost, bool allowDestinationSubdomains); WEBKIT_API static void resetOriginAccessWhitelists(); - // DEPRECATED: Phase on of renaming to addOriginAccessWhitelistEntry. - WEBKIT_API static void whiteListAccessFromOrigin( - const WebURL& sourceOrigin, const WebString& destinationProtocol, - const WebString& destinationHost, bool allowDestinationSubdomains); - // DEPRECATED: Phase on of renaming to resetOriginAccessWhitelists.. - WEBKIT_API static void resetOriginAccessWhiteLists(); // Returns whether the url should be allowed to see the referrer // based on their respective protocols. diff --git a/WebKit/chromium/public/WebSharedWorker.h b/WebKit/chromium/public/WebSharedWorker.h index 4ac7639..01c8391 100644 --- a/WebKit/chromium/public/WebSharedWorker.h +++ b/WebKit/chromium/public/WebSharedWorker.h @@ -60,7 +60,18 @@ public: virtual void startWorkerContext(const WebURL& scriptURL, const WebString& name, const WebString& userAgent, - const WebString& sourceCode) = 0; + const WebString& sourceCode, + long long scriptResourceAppCacheID) = 0; + + // FIXME(michaeln): Remove this after the roll and adjusting to it. + virtual void startWorkerContext(const WebURL& scriptURL, + const WebString& name, + const WebString& userAgent, + const WebString& sourceCode) + { + startWorkerContext(scriptURL, name, userAgent, sourceCode, 0); + } + class ConnectListener { public: // Invoked once the connect event has been sent so the caller can free this object. diff --git a/WebKit/chromium/public/WebStorageNamespace.h b/WebKit/chromium/public/WebStorageNamespace.h index 4b648d4..51d4e0b 100644 --- a/WebKit/chromium/public/WebStorageNamespace.h +++ b/WebKit/chromium/public/WebStorageNamespace.h @@ -49,10 +49,14 @@ public: // object when you're finished. WEBKIT_API static WebStorageNamespace* createLocalStorageNamespace(const WebString& backingDirectoryPath, unsigned quota); WEBKIT_API static WebStorageNamespace* createSessionStorageNamespace(unsigned quota); - WEBKIT_API static WebStorageNamespace* createSessionStorageNamespace() - { - return createSessionStorageNamespace(noQuota); - } + + // The quota for each storage area. Suggested by the spec. + static const unsigned m_localStorageQuota = 5 * 1024 * 1024; + + // Since SessionStorage memory is allocated in the browser process, we place a + // per-origin quota on it. Like LocalStorage there are known attacks against + // this, so it's more of a sanity check than a real security measure. + static const unsigned m_sessionStorageQuota = 5 * 1024 * 1024; static const unsigned noQuota = UINT_MAX; diff --git a/WebKit/chromium/public/WebThemeEngine.h b/WebKit/chromium/public/WebThemeEngine.h index 1fccb0e..606de09 100644 --- a/WebKit/chromium/public/WebThemeEngine.h +++ b/WebKit/chromium/public/WebThemeEngine.h @@ -75,45 +75,12 @@ public: virtual void paintTrackbar( WebCanvas*, int part, int state, int classicState, const WebRect&) = 0; -#endif - - // WebThemeEngine was originally used only on Windows, hence its platform- - // specific parameters. This is new cross-platform theming API, and we'll - // switch the code to using these APIs on all platforms instead. - enum Part { - PartScrollbarDownArrow, - PartScrollbarLeftArrow, - PartScrollbarRightArrow, - PartScrollbarUpArrow, - PartScrollbarHorizontalThumb, - PartScrollbarVerticalThumb, - PartScrollbarHoriztonalTrack, - PartScrollbarVerticalTrack, - }; - - enum State { - StateDisabled, - StateHot, - StateHover, - StateNormal, - StatePressed, - }; - struct ScrollbarTrackExtraParams { - int alignX; - int alignY; - }; + virtual void paintProgressBar( + WebCanvas*, const WebRect& barRect, + int valuePart, const WebRect& valueRect) {} - union ExtraParams { - ScrollbarTrackExtraParams scrollbarTrack; - }; - - // Gets the size of the given theme component. For variable sized items - // like vertical scrollbar tracks, the width will be the required width of - // the track while the height will be the minimum height. - virtual void getSize(Part, WebSize*) {} - virtual void paint( - WebCanvas*, Part, State, const WebRect&, const ExtraParams&) {} +#endif }; } // namespace WebKit diff --git a/WebKit/chromium/public/WebURLLoaderClient.h b/WebKit/chromium/public/WebURLLoaderClient.h index 03b2c54..a66b153 100644 --- a/WebKit/chromium/public/WebURLLoaderClient.h +++ b/WebKit/chromium/public/WebURLLoaderClient.h @@ -56,6 +56,9 @@ public: // Called when a chunk of response data is received. virtual void didReceiveData(WebURLLoader*, const char* data, int dataLength) = 0; + // Called when a chunk of renderer-generated metadata is received from the cache. + virtual void didReceiveCachedMetadata(WebURLLoader*, const char* data, int dataLength) { } + // Called when the load completes successfully. virtual void didFinishLoading(WebURLLoader*) = 0; diff --git a/WebKit/chromium/public/WebURLResponse.h b/WebKit/chromium/public/WebURLResponse.h index 3acacf8..b3c084c 100644 --- a/WebKit/chromium/public/WebURLResponse.h +++ b/WebKit/chromium/public/WebURLResponse.h @@ -72,6 +72,9 @@ public: WEBKIT_API WebURL url() const; WEBKIT_API void setURL(const WebURL&); + WEBKIT_API double responseTime() const; + WEBKIT_API void setResponseTime(double); + WEBKIT_API WebString mimeType() const; WEBKIT_API void setMIMEType(const WebString&); @@ -123,6 +126,11 @@ public: WEBKIT_API bool wasFetchedViaSPDY() const; WEBKIT_API void setWasFetchedViaSPDY(bool); + // Flag whether this request was loaded after the TLS/Next-Protocol-Negotiation was used. + // This is related to SPDY. + WEBKIT_API bool wasNpnNegotiated() const; + WEBKIT_API void setWasNpnNegotiated(bool); + // Flag whether this request is part of a multipart response. WEBKIT_API bool isMultipartPayload() const; WEBKIT_API void setIsMultipartPayload(bool); diff --git a/WebKit/chromium/public/WebViewClient.h b/WebKit/chromium/public/WebViewClient.h index 98e0485..9478df9 100644 --- a/WebKit/chromium/public/WebViewClient.h +++ b/WebKit/chromium/public/WebViewClient.h @@ -81,7 +81,7 @@ public: virtual WebWidget* createPopupMenu(const WebPopupMenuInfo&) { return 0; } // Create a session storage namespace object associated with this WebView. - virtual WebStorageNamespace* createSessionStorageNamespace() { return 0; } + virtual WebStorageNamespace* createSessionStorageNamespace(unsigned quota) { return 0; } // Misc ---------------------------------------------------------------- @@ -234,6 +234,9 @@ public: virtual void focusNext() { } virtual void focusPrevious() { } + // Called when a new node gets focused. + virtual void focusedNodeChanged(const WebNode&) { } + // Session history ----------------------------------------------------- diff --git a/WebKit/chromium/src/AssertMatchingEnums.cpp b/WebKit/chromium/src/AssertMatchingEnums.cpp index 1d2948f..e7aeb49 100644 --- a/WebKit/chromium/src/AssertMatchingEnums.cpp +++ b/WebKit/chromium/src/AssertMatchingEnums.cpp @@ -51,6 +51,7 @@ #include "WebInputElement.h" #include "WebMediaPlayer.h" #include "WebNotificationPresenter.h" +#include "WebScrollbar.h" #include "WebTextAffinity.h" #include "WebTextCaseSensitivity.h" #include <wtf/Assertions.h> @@ -291,6 +292,14 @@ COMPILE_ASSERT_MATCHING_ENUM(WebNotificationPresenter::PermissionNotAllowed, Not COMPILE_ASSERT_MATCHING_ENUM(WebNotificationPresenter::PermissionDenied, NotificationPresenter::PermissionDenied); #endif +COMPILE_ASSERT_MATCHING_ENUM(WebScrollbar::Horizontal, HorizontalScrollbar); +COMPILE_ASSERT_MATCHING_ENUM(WebScrollbar::Vertical, VerticalScrollbar); + +COMPILE_ASSERT_MATCHING_ENUM(WebScrollbar::ScrollByLine, ScrollByLine); +COMPILE_ASSERT_MATCHING_ENUM(WebScrollbar::ScrollByPage, ScrollByPage); +COMPILE_ASSERT_MATCHING_ENUM(WebScrollbar::ScrollByDocument, ScrollByDocument); +COMPILE_ASSERT_MATCHING_ENUM(WebScrollbar::ScrollByPixel, ScrollByPixel); + COMPILE_ASSERT_MATCHING_ENUM(WebTextAffinityUpstream, UPSTREAM); COMPILE_ASSERT_MATCHING_ENUM(WebTextAffinityDownstream, DOWNSTREAM); diff --git a/WebKit/chromium/src/ChromeClientImpl.cpp b/WebKit/chromium/src/ChromeClientImpl.cpp index 74f0bd8..1a366bc 100644 --- a/WebKit/chromium/src/ChromeClientImpl.cpp +++ b/WebKit/chromium/src/ChromeClientImpl.cpp @@ -66,6 +66,7 @@ #include "WebFrameImpl.h" #include "WebInputEvent.h" #include "WebKit.h" +#include "WebNode.h" #include "WebPopupMenuImpl.h" #include "WebPopupMenuInfo.h" #include "WebPopupType.h" @@ -214,6 +215,8 @@ void ChromeClientImpl::takeFocus(FocusDirection direction) void ChromeClientImpl::focusedNodeChanged(Node* node) { + m_webView->client()->focusedNodeChanged(WebNode(node)); + WebURL focus_url; if (node && node->isLink()) { // This HitTestResult hack is the easiest way to get a link URL out of a @@ -689,6 +692,7 @@ void ChromeClientImpl::getPopupMenuInfo(PopupContainer* popupContainer, info->itemFontSize = popupContainer->menuItemFontSize(); info->selectedIndex = popupContainer->selectedIndex(); info->items.swap(outputItems); + info->rightAligned = popupContainer->menuStyle().textDirection() == RTL; } void ChromeClientImpl::didChangeAccessibilityObjectState(AccessibilityObject* obj) @@ -708,6 +712,7 @@ NotificationPresenter* ChromeClientImpl::notificationPresenter() const void ChromeClientImpl::requestGeolocationPermissionForFrame(Frame* frame, Geolocation* geolocation) { GeolocationServiceChromium* geolocationService = static_cast<GeolocationServiceChromium*>(geolocation->getGeolocationService()); + geolocationService->geolocationServiceBridge()->attachBridgeIfNeeded(); m_webView->client()->geolocationService()->requestPermissionForFrame(geolocationService->geolocationServiceBridge()->getBridgeId(), frame->document()->url()); } diff --git a/WebKit/chromium/src/ChromiumBridge.cpp b/WebKit/chromium/src/ChromiumBridge.cpp index a0e8d3b..d188016 100644 --- a/WebKit/chromium/src/ChromiumBridge.cpp +++ b/WebKit/chromium/src/ChromiumBridge.cpp @@ -132,6 +132,13 @@ static WebCookieJar* getCookieJar(const Document* document) return cookieJar; } +// Cache ---------------------------------------------------------------------- + +void ChromiumBridge::cacheMetadata(const KURL& url, double responseTime, const Vector<char>& data) +{ + webKitClient()->cacheMetadata(url, responseTime, data.data(), data.size()); +} + // Clipboard ------------------------------------------------------------------ bool ChromiumBridge::clipboardIsFormatAvailable( @@ -432,9 +439,9 @@ GeolocationServiceBridge* ChromiumBridge::createGeolocationServiceBridge(Geoloca // HTML5 DB ------------------------------------------------------------------- #if ENABLE(DATABASE) -PlatformFileHandle ChromiumBridge::databaseOpenFile(const String& vfsFileName, int desiredFlags, PlatformFileHandle* dirHandle) +PlatformFileHandle ChromiumBridge::databaseOpenFile(const String& vfsFileName, int desiredFlags) { - return webKitClient()->databaseOpenFile(WebString(vfsFileName), desiredFlags, dirHandle); + return webKitClient()->databaseOpenFile(WebString(vfsFileName), desiredFlags); } int ChromiumBridge::databaseDeleteFile(const String& vfsFileName, bool syncDir) @@ -672,6 +679,13 @@ void ChromiumBridge::paintTrackbar( gc->platformContext()->canvas(), part, state, classicState, rect); } +void ChromiumBridge::paintProgressBar( + GraphicsContext* gc, const IntRect& barRect, int valuePart, const IntRect& valueRect) +{ + webKitClient()->themeEngine()->paintProgressBar( + gc->platformContext()->canvas(), barRect, valuePart, valueRect); +} + #endif // Trace Event ---------------------------------------------------------------- diff --git a/WebKit/chromium/src/ContextMenuClientImpl.cpp b/WebKit/chromium/src/ContextMenuClientImpl.cpp index bee4310..b6005f9 100644 --- a/WebKit/chromium/src/ContextMenuClientImpl.cpp +++ b/WebKit/chromium/src/ContextMenuClientImpl.cpp @@ -151,9 +151,6 @@ PlatformMenuDescription ContextMenuClientImpl::getCustomMenuFromDefaultItems( // all else. data.linkURL = r.absoluteLinkURL(); - data.mediaType = WebContextMenuData::MediaTypeNone; - data.mediaFlags = WebContextMenuData::MediaNone; - if (!r.absoluteImageURL().isEmpty()) { data.srcURL = r.absoluteImageURL(); data.mediaType = WebContextMenuData::MediaTypeImage; @@ -202,7 +199,6 @@ PlatformMenuDescription ContextMenuClientImpl::getCustomMenuFromDefaultItems( if (r.isSelected()) data.selectedText = selectedFrame->selectedText().stripWhiteSpace(); - data.isEditable = false; if (r.isContentEditable()) { data.isEditable = true; if (m_webView->focusedWebCoreFrame()->editor()->isContinuousSpellCheckingEnabled()) { @@ -212,11 +208,6 @@ PlatformMenuDescription ContextMenuClientImpl::getCustomMenuFromDefaultItems( } #if OS(DARWIN) - // Writing direction context menu. - data.writingDirectionDefault = WebContextMenuData::CheckableMenuItemDisabled; - data.writingDirectionLeftToRight = WebContextMenuData::CheckableMenuItemEnabled; - data.writingDirectionRightToLeft = WebContextMenuData::CheckableMenuItemEnabled; - ExceptionCode ec = 0; RefPtr<CSSStyleDeclaration> style = selectedFrame->document()->createCSSStyleDeclaration(); style->setProperty(CSSPropertyDirection, "ltr", false, ec); diff --git a/WebKit/chromium/src/DatabaseObserver.cpp b/WebKit/chromium/src/DatabaseObserver.cpp index 6a2e2a7..1c5117c 100644 --- a/WebKit/chromium/src/DatabaseObserver.cpp +++ b/WebKit/chromium/src/DatabaseObserver.cpp @@ -50,12 +50,16 @@ namespace WebCore { bool DatabaseObserver::canEstablishDatabase(ScriptExecutionContext* scriptExecutionContext, const String& name, const String& displayName, unsigned long estimatedSize) { ASSERT(scriptExecutionContext->isContextThread()); - // FIXME: add support for the case scriptExecutionContext()->isWorker() once workers implement web databases. - ASSERT(scriptExecutionContext->isDocument()); + ASSERT(scriptExecutionContext->isDocument() || scriptExecutionContext->isWorkerContext()); if (scriptExecutionContext->isDocument()) { Document* document = static_cast<Document*>(scriptExecutionContext); WebFrameImpl* webFrame = WebFrameImpl::fromFrame(document->frame()); return webFrame->client()->allowDatabase(webFrame, name, displayName, estimatedSize); + } else { + WorkerContext* workerContext = static_cast<WorkerContext*>(scriptExecutionContext); + WorkerLoaderProxy* workerLoaderProxy = &workerContext->thread()->workerLoaderProxy(); + WebWorkerBase* webWorker = static_cast<WebWorkerBase*>(workerLoaderProxy); + return webWorker->allowDatabase(0, name, displayName, estimatedSize); } return true; diff --git a/WebKit/chromium/src/FrameLoaderClientImpl.h b/WebKit/chromium/src/FrameLoaderClientImpl.h index c163f62..25be623 100644 --- a/WebKit/chromium/src/FrameLoaderClientImpl.h +++ b/WebKit/chromium/src/FrameLoaderClientImpl.h @@ -31,14 +31,12 @@ #ifndef FrameLoaderClientImpl_h #define FrameLoaderClientImpl_h -// FIXME: remove this relative path once consumers from glue are removed. -#include "../public/WebNavigationPolicy.h" #include "FrameLoaderClient.h" #include "KURL.h" +#include "WebNavigationPolicy.h" #include <wtf/PassOwnPtr.h> #include <wtf/RefPtr.h> - namespace WebKit { class WebFrameImpl; diff --git a/WebKit/chromium/src/GraphicsContext3D.cpp b/WebKit/chromium/src/GraphicsContext3D.cpp index e51f433..7c5635b 100644 --- a/WebKit/chromium/src/GraphicsContext3D.cpp +++ b/WebKit/chromium/src/GraphicsContext3D.cpp @@ -40,16 +40,16 @@ #include "ImageBuffer.h" #include "ImageData.h" #include "WebGLBuffer.h" -#include "WebGLByteArray.h" -#include "WebGLFloatArray.h" +#include "Int8Array.h" +#include "FloatArray.h" #include "WebGLFramebuffer.h" -#include "WebGLIntArray.h" +#include "Int32Array.h" #include "WebGLProgram.h" #include "WebGLRenderbuffer.h" #include "WebGLRenderingContext.h" #include "WebGLShader.h" #include "WebGLTexture.h" -#include "WebGLUnsignedByteArray.h" +#include "Uint8Array.h" #include "WebGraphicsContext3D.h" #include "WebGraphicsContext3DDefaultImpl.h" #include "WebKit.h" @@ -130,8 +130,8 @@ public: void blendFuncSeparate(unsigned long srcRGB, unsigned long dstRGB, unsigned long srcAlpha, unsigned long dstAlpha); void bufferData(unsigned long target, int size, unsigned long usage); - void bufferData(unsigned long target, WebGLArray* data, unsigned long usage); - void bufferSubData(unsigned long target, long offset, WebGLArray* data); + void bufferData(unsigned long target, ArrayBufferView* data, unsigned long usage); + void bufferSubData(unsigned long target, long offset, ArrayBufferView* data); unsigned long checkFramebufferStatus(unsigned long target); void clear(unsigned long mask); @@ -673,12 +673,12 @@ void GraphicsContext3DInternal::bufferData(unsigned long target, int size, unsig m_impl->bufferData(target, size, 0, usage); } -void GraphicsContext3DInternal::bufferData(unsigned long target, WebGLArray* array, unsigned long usage) +void GraphicsContext3DInternal::bufferData(unsigned long target, ArrayBufferView* array, unsigned long usage) { m_impl->bufferData(target, array->byteLength(), array->baseAddress(), usage); } -void GraphicsContext3DInternal::bufferSubData(unsigned long target, long offset, WebGLArray* array) +void GraphicsContext3DInternal::bufferSubData(unsigned long target, long offset, ArrayBufferView* array) { m_impl->bufferSubData(target, offset, array->byteLength(), array->baseAddress()); } @@ -1104,8 +1104,8 @@ DELEGATE_TO_INTERNAL_2(blendFunc, unsigned long, unsigned long) DELEGATE_TO_INTERNAL_4(blendFuncSeparate, unsigned long, unsigned long, unsigned long, unsigned long) DELEGATE_TO_INTERNAL_3(bufferData, unsigned long, int, unsigned long) -DELEGATE_TO_INTERNAL_3(bufferData, unsigned long, WebGLArray*, unsigned long) -DELEGATE_TO_INTERNAL_3(bufferSubData, unsigned long, long, WebGLArray*) +DELEGATE_TO_INTERNAL_3(bufferData, unsigned long, ArrayBufferView*, unsigned long) +DELEGATE_TO_INTERNAL_3(bufferSubData, unsigned long, long, ArrayBufferView*) DELEGATE_TO_INTERNAL_1R(checkFramebufferStatus, unsigned long, unsigned long) DELEGATE_TO_INTERNAL_1(clear, unsigned long) diff --git a/WebKit/chromium/src/IDBCallbacksProxy.cpp b/WebKit/chromium/src/IDBCallbacksProxy.cpp new file mode 100644 index 0000000..0346b58 --- /dev/null +++ b/WebKit/chromium/src/IDBCallbacksProxy.cpp @@ -0,0 +1,74 @@ +/* + * Copyright (C) 2010 Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "config.h" +#include "IDBCallbacksProxy.h" + +#include "IDBCallbacks.h" +#include "IDBDatabaseError.h" +#include "IDBDatabaseProxy.h" +#include "WebIDBCallbacks.h" +#include "WebIDBDatabase.h" +#include "WebIDBDatabaseError.h" +#include "WebSerializedScriptValue.h" + +#if ENABLE(INDEXED_DATABASE) + +namespace WebCore { + +IDBCallbacksProxy::IDBCallbacksProxy(PassRefPtr<IDBCallbacks> callbacks) + : m_callbacks(callbacks) +{ +} + +IDBCallbacksProxy::~IDBCallbacksProxy() +{ +} + +void IDBCallbacksProxy::onError(const WebKit::WebIDBDatabaseError& error) +{ + m_callbacks->onError(error); + m_callbacks.clear(); +} + +void IDBCallbacksProxy::onSuccess(WebKit::WebIDBDatabase* webKitInstance) +{ + m_callbacks->onSuccess(IDBDatabaseProxy::create(webKitInstance)); + m_callbacks.clear(); +} + +void IDBCallbacksProxy::onSuccess(const WebKit::WebSerializedScriptValue& serializedScriptValue) +{ + m_callbacks->onSuccess(serializedScriptValue); + m_callbacks.clear(); +} + +} // namespace WebCore + +#endif // ENABLE(INDEXED_DATABASE) + diff --git a/WebKit/chromium/src/IDBCallbacksProxy.h b/WebKit/chromium/src/IDBCallbacksProxy.h index e803c96..692b0a3 100644 --- a/WebKit/chromium/src/IDBCallbacksProxy.h +++ b/WebKit/chromium/src/IDBCallbacksProxy.h @@ -29,40 +29,33 @@ #ifndef IDBCallbacksProxy_h #define IDBCallbacksProxy_h -#include "IDBCallbacks.h" -#include "IDBDatabaseError.h" #include "WebIDBCallbacks.h" -#include "WebIDBDatabaseError.h" #include <wtf/PassRefPtr.h> #include <wtf/RefPtr.h> #if ENABLE(INDEXED_DATABASE) -namespace WebCore { +namespace WebKit { +class WebIDBDatabase; +class WebIDBDatabaseError; +class WebSerializedScriptValue; +} -template <typename WebKitClass, typename WebCoreClass, typename WebCoreProxy> -class IDBCallbacksProxy : public WebKit::WebIDBCallbacks<WebKitClass> { -public: - IDBCallbacksProxy(PassRefPtr<IDBCallbacks<WebCoreClass> > callbacks) - : m_callbacks(callbacks) { } +namespace WebCore { - virtual ~IDBCallbacksProxy() { } +class IDBCallbacks; - virtual void onSuccess(WebKitClass* webKitInstance) - { - RefPtr<WebCoreClass> proxy = WebCoreProxy::create(webKitInstance); - m_callbacks->onSuccess(proxy); - m_callbacks.clear(); - } +class IDBCallbacksProxy : public WebKit::WebIDBCallbacks { +public: + IDBCallbacksProxy(PassRefPtr<IDBCallbacks> callbacks); + virtual ~IDBCallbacksProxy(); - virtual void onError(const WebKit::WebIDBDatabaseError& error) - { - m_callbacks->onError(error); - m_callbacks.clear(); - } + virtual void onError(const WebKit::WebIDBDatabaseError& error); + virtual void onSuccess(WebKit::WebIDBDatabase* webKitInstance); + virtual void onSuccess(const WebKit::WebSerializedScriptValue& serializedScriptValue); private: - PassRefPtr<IDBCallbacks<WebCoreClass> > m_callbacks; + RefPtr<IDBCallbacks> m_callbacks; }; diff --git a/WebKit/chromium/src/IndexedDatabaseProxy.cpp b/WebKit/chromium/src/IndexedDatabaseProxy.cpp index 9069b46..a4bd0b1 100644 --- a/WebKit/chromium/src/IndexedDatabaseProxy.cpp +++ b/WebKit/chromium/src/IndexedDatabaseProxy.cpp @@ -29,9 +29,12 @@ #include "config.h" #include "IndexedDatabaseProxy.h" +#include "Document.h" +#include "Frame.h" #include "IDBCallbacksProxy.h" #include "IDBDatabaseError.h" #include "IDBDatabaseProxy.h" +#include "SecurityOrigin.h" #include "WebFrameImpl.h" #include "WebIDBDatabase.h" #include "WebIDBDatabaseError.h" @@ -57,11 +60,12 @@ IndexedDatabaseProxy::~IndexedDatabaseProxy() { } -void IndexedDatabaseProxy::open(const String& name, const String& description, bool modifyDatabase, PassRefPtr<IDBDatabaseCallbacks> callbacks, Frame* frame, ExceptionCode& ec) +void IndexedDatabaseProxy::open(const String& name, const String& description, bool modifyDatabase, PassRefPtr<IDBCallbacks> callbacks, Frame* frame, ExceptionCode& ec) { + if (!frame || !frame->document()) + return; WebKit::WebFrame* webFrame = WebKit::WebFrameImpl::fromFrame(frame); - typedef IDBCallbacksProxy<WebKit::WebIDBDatabase, IDBDatabase, IDBDatabaseProxy> CallbacksProxy; - m_webIndexedDatabase->open(name, description, modifyDatabase, new CallbacksProxy(callbacks), webFrame, ec); + m_webIndexedDatabase->open(name, description, modifyDatabase, new IDBCallbacksProxy(callbacks), frame->document()->securityOrigin()->toString(), webFrame, ec); } } // namespace WebCore diff --git a/WebKit/chromium/src/IndexedDatabaseProxy.h b/WebKit/chromium/src/IndexedDatabaseProxy.h index d0f55b6..0c8674a 100644 --- a/WebKit/chromium/src/IndexedDatabaseProxy.h +++ b/WebKit/chromium/src/IndexedDatabaseProxy.h @@ -42,7 +42,7 @@ public: static PassRefPtr<IndexedDatabase> create(); virtual ~IndexedDatabaseProxy(); - virtual void open(const String& name, const String& description, bool modifyDatabase, PassRefPtr<IDBDatabaseCallbacks>, Frame*, ExceptionCode&); + virtual void open(const String& name, const String& description, bool modifyDatabase, PassRefPtr<IDBCallbacks>, Frame*, ExceptionCode&); private: IndexedDatabaseProxy(); diff --git a/WebKit/chromium/src/PlatformMessagePortChannel.h b/WebKit/chromium/src/PlatformMessagePortChannel.h index 05e8397..5416145 100644 --- a/WebKit/chromium/src/PlatformMessagePortChannel.h +++ b/WebKit/chromium/src/PlatformMessagePortChannel.h @@ -31,12 +31,9 @@ #ifndef PlatformMessagePortChannel_h #define PlatformMessagePortChannel_h -// FIXME: This relative path is a temporary hack to support using this -// header from webkit/glue. -#include "../public/WebMessagePortChannelClient.h" +#include "WebMessagePortChannelClient.h" #include "MessagePortChannel.h" - #include <wtf/PassRefPtr.h> #include <wtf/Threading.h> diff --git a/WebKit/chromium/src/ResourceHandle.cpp b/WebKit/chromium/src/ResourceHandle.cpp index 39270e7..a13400d 100644 --- a/WebKit/chromium/src/ResourceHandle.cpp +++ b/WebKit/chromium/src/ResourceHandle.cpp @@ -31,6 +31,7 @@ #include "config.h" #include "ResourceHandle.h" +#include "ChromiumBridge.h" #include "ResourceHandleClient.h" #include "ResourceRequest.h" #include "SharedBuffer.h" @@ -72,6 +73,7 @@ public: WebURLLoader*, unsigned long long bytesSent, unsigned long long totalBytesToBeSent); virtual void didReceiveResponse(WebURLLoader*, const WebURLResponse&); virtual void didReceiveData(WebURLLoader*, const char* data, int dataLength); + virtual void didReceiveCachedMetadata(WebURLLoader*, const char* data, int dataLength); virtual void didFinishLoading(WebURLLoader*); virtual void didFail(WebURLLoader*, const WebURLError&); @@ -171,6 +173,15 @@ void ResourceHandleInternal::didReceiveData( m_client->didReceiveData(m_owner, data, dataLength, dataLength); } +void ResourceHandleInternal::didReceiveCachedMetadata(WebURLLoader*, const char* data, int dataLength) +{ + ASSERT(m_client); + if (m_state != ConnectionStateReceivedResponse && m_state != ConnectionStateReceivingData) + CRASH(); + + m_client->didReceiveCachedMetadata(m_owner, data, dataLength); +} + void ResourceHandleInternal::didFinishLoading(WebURLLoader*) { ASSERT(m_client); @@ -311,4 +322,10 @@ bool ResourceHandle::willLoadFromCache(ResourceRequest& request, Frame*) return true; } +// static +void ResourceHandle::cacheMetadata(const ResourceResponse& response, const Vector<char>& data) +{ + ChromiumBridge::cacheMetadata(response.url(), response.responseTime(), data); +} + } // namespace WebCore diff --git a/WebKit/chromium/src/SharedWorkerRepository.cpp b/WebKit/chromium/src/SharedWorkerRepository.cpp index a2b513f..2c4e918 100644 --- a/WebKit/chromium/src/SharedWorkerRepository.cpp +++ b/WebKit/chromium/src/SharedWorkerRepository.cpp @@ -72,6 +72,7 @@ public: , m_port(port) , m_scriptLoader(ResourceRequestBase::TargetIsSharedWorker) , m_loading(false) + , m_responseAppCacheID(0) { } @@ -81,6 +82,7 @@ public: private: // WorkerScriptLoaderClient callback + virtual void didReceiveResponse(const ResourceResponse&); virtual void notifyFinished(); virtual void connected(); @@ -96,6 +98,7 @@ private: OwnPtr<MessagePortChannel> m_port; WorkerScriptLoader m_scriptLoader; bool m_loading; + long long m_responseAppCacheID; }; static Vector<SharedWorkerScriptLoader*>& pendingLoaders() @@ -148,6 +151,11 @@ static WebMessagePortChannel* getWebPort(PassOwnPtr<MessagePortChannel> port) return webPort; } +void SharedWorkerScriptLoader::didReceiveResponse(const ResourceResponse& response) +{ + m_responseAppCacheID = response.appCacheID(); +} + void SharedWorkerScriptLoader::notifyFinished() { if (m_scriptLoader.failed()) { @@ -159,7 +167,7 @@ void SharedWorkerScriptLoader::notifyFinished() inspector->scriptImported(m_scriptLoader.identifier(), m_scriptLoader.script()); #endif // Pass the script off to the worker, then send a connect event. - m_webWorker->startWorkerContext(m_url, m_name, m_worker->scriptExecutionContext()->userAgent(m_url), m_scriptLoader.script()); + m_webWorker->startWorkerContext(m_url, m_name, m_worker->scriptExecutionContext()->userAgent(m_url), m_scriptLoader.script(), m_responseAppCacheID); sendConnect(); } } diff --git a/WebKit/chromium/src/StorageNamespaceProxy.cpp b/WebKit/chromium/src/StorageNamespaceProxy.cpp index 252bc14..ec0dbce 100644 --- a/WebKit/chromium/src/StorageNamespaceProxy.cpp +++ b/WebKit/chromium/src/StorageNamespaceProxy.cpp @@ -51,7 +51,7 @@ PassRefPtr<StorageNamespace> StorageNamespace::sessionStorageNamespace(Page* pag { WebKit::ChromeClientImpl* chromeClientImpl = static_cast<WebKit::ChromeClientImpl*>(page->chrome()->client()); WebKit::WebViewClient* webViewClient = chromeClientImpl->webView()->client(); - return adoptRef(new StorageNamespaceProxy(webViewClient->createSessionStorageNamespace(), SessionStorage)); + return adoptRef(new StorageNamespaceProxy(webViewClient->createSessionStorageNamespace(quota), SessionStorage)); } StorageNamespaceProxy::StorageNamespaceProxy(WebKit::WebStorageNamespace* storageNamespace, StorageType storageType) diff --git a/WebKit/chromium/src/WebAnimationControllerImpl.h b/WebKit/chromium/src/WebAnimationControllerImpl.h index 8b0676e..66dfe98 100644 --- a/WebKit/chromium/src/WebAnimationControllerImpl.h +++ b/WebKit/chromium/src/WebAnimationControllerImpl.h @@ -31,9 +31,7 @@ #ifndef WebAnimationControllerImpl_h #define WebAnimationControllerImpl_h -// FIXME: This relative path is a temporary hack to support using this -// header from webkit/glue. -#include "../public/WebAnimationController.h" +#include "WebAnimationController.h" namespace WebCore { class AnimationController; diff --git a/WebKit/chromium/src/WebBindings.cpp b/WebKit/chromium/src/WebBindings.cpp index 41619d6..99e82a7 100644 --- a/WebKit/chromium/src/WebBindings.cpp +++ b/WebKit/chromium/src/WebBindings.cpp @@ -34,9 +34,6 @@ #include "npruntime_impl.h" #include "npruntime_priv.h" -#include "../public/WebDragData.h" -#include "../public/WebRange.h" - #if USE(V8) #include "ChromiumDataObject.h" #include "ClipboardChromium.h" @@ -53,6 +50,8 @@ #elif USE(JSC) #include "bridge/c/c_utility.h" #endif +#include "WebDragData.h" +#include "WebRange.h" #if USE(JAVASCRIPTCORE_BINDINGS) using JSC::Bindings::PrivateIdentifier; diff --git a/WebKit/chromium/src/WebDataSourceImpl.h b/WebKit/chromium/src/WebDataSourceImpl.h index f868e95..be32217 100644 --- a/WebKit/chromium/src/WebDataSourceImpl.h +++ b/WebKit/chromium/src/WebDataSourceImpl.h @@ -31,17 +31,12 @@ #ifndef WebDataSourceImpl_h #define WebDataSourceImpl_h -// FIXME: This relative path is a temporary hack to support using this -// header from webkit/glue. -#include "../public/WebDataSource.h" - #include "DocumentLoader.h" #include "KURL.h" - +#include "WebDataSource.h" #include "WebPluginLoadObserver.h" #include "WrappedResourceRequest.h" #include "WrappedResourceResponse.h" - #include <wtf/OwnPtr.h> #include <wtf/PassOwnPtr.h> #include <wtf/Vector.h> diff --git a/WebKit/chromium/src/WebDevToolsAgentPrivate.h b/WebKit/chromium/src/WebDevToolsAgentPrivate.h index 0c1c67e..446f647 100644 --- a/WebKit/chromium/src/WebDevToolsAgentPrivate.h +++ b/WebKit/chromium/src/WebDevToolsAgentPrivate.h @@ -31,9 +31,7 @@ #ifndef WebDevToolsAgentPrivate_h #define WebDevToolsAgentPrivate_h -// FIXME: This relative path is a temporary hack to support using this -// header from webkit/glue. -#include "../public/WebDevToolsAgent.h" +#include "WebDevToolsAgent.h" namespace WebKit { class WebFrameImpl; diff --git a/WebKit/chromium/src/WebFileChooserCompletionImpl.h b/WebKit/chromium/src/WebFileChooserCompletionImpl.h index fe759e0..147d1f7 100644 --- a/WebKit/chromium/src/WebFileChooserCompletionImpl.h +++ b/WebKit/chromium/src/WebFileChooserCompletionImpl.h @@ -31,14 +31,11 @@ #ifndef WebFileChooserCompletionImpl_h #define WebFileChooserCompletionImpl_h -// FIXME: These relative paths are a temporary hack to support using this -// header from webkit/glue. -#include "../public/WebFileChooserCompletion.h" -#include "../public/WebString.h" -#include "../public/WebVector.h" +#include "WebFileChooserCompletion.h" +#include "WebString.h" +#include "WebVector.h" #include "FileChooser.h" - #include <wtf/PassRefPtr.h> using WebKit::WebFileChooserCompletion; diff --git a/WebKit/chromium/src/WebFrameImpl.cpp b/WebKit/chromium/src/WebFrameImpl.cpp index 7b6c8ce..b678459 100644 --- a/WebKit/chromium/src/WebFrameImpl.cpp +++ b/WebKit/chromium/src/WebFrameImpl.cpp @@ -1608,14 +1608,6 @@ void WebFrameImpl::resetMatchCount() m_framesScopingCount = 0; } -WebURL WebFrameImpl::completeURL(const WebString& url) const -{ - if (!m_frame || !m_frame->document()) - return WebURL(); - - return m_frame->document()->completeURL(url); -} - WebString WebFrameImpl::contentAsText(size_t maxChars) const { if (!m_frame) @@ -1942,13 +1934,16 @@ void WebFrameImpl::setCanHaveScrollbars(bool canHaveScrollbars) m_frame->view()->setCanHaveScrollbars(canHaveScrollbars); } -void WebFrameImpl::registerPasswordListener( +bool WebFrameImpl::registerPasswordListener( WebInputElement inputElement, WebPasswordAutocompleteListener* listener) { RefPtr<HTMLInputElement> element = inputElement.operator PassRefPtr<HTMLInputElement>(); - ASSERT(m_passwordListeners.find(element) == m_passwordListeners.end()); - m_passwordListeners.set(element, listener); + if (!m_passwordListeners.add(element, listener).second) { + delete listener; + return false; + } + return true; } WebPasswordAutocompleteListener* WebFrameImpl::getPasswordListener( @@ -2030,7 +2025,8 @@ void WebFrameImpl::addMarker(Range* range, bool activeMatch) void WebFrameImpl::setMarkerActive(Range* range, bool active) { - if (!range) + WebCore::ExceptionCode ec; + if (!range || range->collapsed(ec)) return; frame()->document()->setMarkersActive(range, active); diff --git a/WebKit/chromium/src/WebFrameImpl.h b/WebKit/chromium/src/WebFrameImpl.h index 08d3cc2..a8b272f 100644 --- a/WebKit/chromium/src/WebFrameImpl.h +++ b/WebKit/chromium/src/WebFrameImpl.h @@ -31,16 +31,15 @@ #ifndef WebFrameImpl_h #define WebFrameImpl_h -// FIXME: remove this relative path once consumers from glue are removed. -#include "../public/WebFrame.h" +#include "WebAnimationControllerImpl.h" +#include "WebFrame.h" + #include "Frame.h" #include "FrameLoaderClientImpl.h" #include "PlatformString.h" #include <wtf/OwnPtr.h> #include <wtf/RefCounted.h> -#include "WebAnimationControllerImpl.h" - namespace WebCore { class GraphicsContext; class HistoryItem; @@ -160,10 +159,9 @@ public: virtual void cancelPendingScopingEffort(); virtual void increaseMatchCount(int count, int identifier); virtual void resetMatchCount(); - virtual void registerPasswordListener( + virtual bool registerPasswordListener( WebInputElement, WebPasswordAutocompleteListener*); - virtual WebURL completeURL(const WebString& url) const; virtual WebString contentAsText(size_t maxChars) const; virtual WebString contentAsMarkup() const; virtual WebString renderTreeAsText() const; diff --git a/WebKit/chromium/src/WebGeolocationServiceBridgeImpl.cpp b/WebKit/chromium/src/WebGeolocationServiceBridgeImpl.cpp index 07f09da..265ef4f 100644 --- a/WebKit/chromium/src/WebGeolocationServiceBridgeImpl.cpp +++ b/WebKit/chromium/src/WebGeolocationServiceBridgeImpl.cpp @@ -73,6 +73,7 @@ public: virtual void suspend(); virtual void resume(); virtual int getBridgeId() const; + virtual void attachBridgeIfNeeded(); // WebGeolocationServiceBridge virtual void setIsAllowed(bool allowed); @@ -94,12 +95,8 @@ GeolocationServiceBridge* createGeolocationServiceBridgeImpl(GeolocationServiceC WebGeolocationServiceBridgeImpl::WebGeolocationServiceBridgeImpl(GeolocationServiceChromium* geolocationServiceChromium) : m_GeolocationServiceChromium(geolocationServiceChromium) + , m_bridgeId(0) { - // We need to attach ourselves here: Geolocation calls requestPermissionForFrame() - // directly, and we need to be attached so that the embedder can call - // our setIsAllowed(). - m_bridgeId = getWebViewClient()->geolocationService()->attachBridge(this); - ASSERT(m_bridgeId); } WebGeolocationServiceBridgeImpl::~WebGeolocationServiceBridgeImpl() @@ -116,8 +113,7 @@ WebGeolocationServiceBridgeImpl::~WebGeolocationServiceBridgeImpl() bool WebGeolocationServiceBridgeImpl::startUpdating(PositionOptions* positionOptions) { - if (!m_bridgeId) - m_bridgeId = getWebViewClient()->geolocationService()->attachBridge(this); + attachBridgeIfNeeded(); getWebViewClient()->geolocationService()->startUpdating(m_bridgeId, m_GeolocationServiceChromium->frame()->document()->url(), positionOptions->enableHighAccuracy()); return true; } @@ -148,6 +144,12 @@ int WebGeolocationServiceBridgeImpl::getBridgeId() const return m_bridgeId; } +void WebGeolocationServiceBridgeImpl::attachBridgeIfNeeded() +{ + if (!m_bridgeId) + m_bridgeId = getWebViewClient()->geolocationService()->attachBridge(this); +} + void WebGeolocationServiceBridgeImpl::setIsAllowed(bool allowed) { m_GeolocationServiceChromium->setIsAllowed(allowed); diff --git a/WebKit/chromium/src/WebGraphicsContext3D.cpp b/WebKit/chromium/src/WebGraphicsContext3D.cpp index bc23703..ce6f55d 100644 --- a/WebKit/chromium/src/WebGraphicsContext3D.cpp +++ b/WebKit/chromium/src/WebGraphicsContext3D.cpp @@ -31,8 +31,6 @@ #include "config.h" #include "WebGraphicsContext3D.h" -#if ENABLE(3D_CANVAS) - #include "WebGraphicsContext3DDefaultImpl.h" namespace WebKit { @@ -47,5 +45,3 @@ WebGraphicsContext3D* WebGraphicsContext3D::createDefault() } } // namespace WebKit - -#endif // ENABLE(3D_CANVAS) diff --git a/WebKit/chromium/src/WebIndexedDatabaseImpl.cpp b/WebKit/chromium/src/WebIndexedDatabaseImpl.cpp index 6a6327b..4820cfb 100644 --- a/WebKit/chromium/src/WebIndexedDatabaseImpl.cpp +++ b/WebKit/chromium/src/WebIndexedDatabaseImpl.cpp @@ -47,9 +47,9 @@ WebIndexedDatabaseImpl::~WebIndexedDatabaseImpl() { } -void WebIndexedDatabaseImpl::open(const WebString& name, const WebString& description, bool modifyDatabase, WebIDBCallbacks<WebIDBDatabase>* callbacksPtr, WebFrame*, int& exceptionCode) +void WebIndexedDatabaseImpl::open(const WebString& name, const WebString& description, bool modifyDatabase, WebIDBCallbacks* callbacksPtr, const WebString& origin, WebFrame*, int& exceptionCode) { - OwnPtr<WebIDBCallbacks<WebIDBDatabase>*> callbacks(callbacksPtr); + OwnPtr<WebIDBCallbacks> callbacks(callbacksPtr); callbacks->onError(WebIDBDatabaseError(0, "Not implemented")); // FIXME: Implement for realz. } diff --git a/WebKit/chromium/src/WebIndexedDatabaseImpl.h b/WebKit/chromium/src/WebIndexedDatabaseImpl.h index b4b8c99..0402ede 100644 --- a/WebKit/chromium/src/WebIndexedDatabaseImpl.h +++ b/WebKit/chromium/src/WebIndexedDatabaseImpl.h @@ -37,7 +37,7 @@ class WebIndexedDatabaseImpl : public WebIndexedDatabase { public: virtual ~WebIndexedDatabaseImpl(); - virtual void open(const WebString& name, const WebString& description, bool modifyDatabase, WebIDBCallbacks<WebIDBDatabase>*, WebFrame*, int& exceptionCode); + virtual void open(const WebString& name, const WebString& description, bool modifyDatabase, WebIDBCallbacks*, const WebString& origin, WebFrame*, int& exceptionCode); }; } // namespace WebKit diff --git a/WebKit/chromium/src/WebInputElement.cpp b/WebKit/chromium/src/WebInputElement.cpp index 2f65ad2..68bb91e 100644 --- a/WebKit/chromium/src/WebInputElement.cpp +++ b/WebKit/chromium/src/WebInputElement.cpp @@ -70,6 +70,11 @@ void WebInputElement::setActivatedSubmit(bool activated) unwrap<HTMLInputElement>()->setActivatedSubmit(activated); } +int WebInputElement::size() const +{ + return constUnwrap<HTMLInputElement>()->size(); +} + void WebInputElement::setValue(const WebString& value) { unwrap<HTMLInputElement>()->setValue(value); diff --git a/WebKit/chromium/src/WebInputEventConversion.h b/WebKit/chromium/src/WebInputEventConversion.h index 3018973..dc5db35 100644 --- a/WebKit/chromium/src/WebInputEventConversion.h +++ b/WebKit/chromium/src/WebInputEventConversion.h @@ -31,9 +31,7 @@ #ifndef WebInputEventConversion_h #define WebInputEventConversion_h -// FIXME: This relative path is a temporary hack to support using this -// header from webkit/glue. -#include "../public/WebInputEvent.h" +#include "WebInputEvent.h" #include "PlatformKeyboardEvent.h" #include "PlatformMouseEvent.h" diff --git a/WebKit/chromium/src/WebLabelElement.cpp b/WebKit/chromium/src/WebLabelElement.cpp index 9546986..ef2c698 100644 --- a/WebKit/chromium/src/WebLabelElement.cpp +++ b/WebKit/chromium/src/WebLabelElement.cpp @@ -42,7 +42,7 @@ namespace WebKit { WebElement WebLabelElement::correspondingControl() { - return WebElement(unwrap<HTMLLabelElement>()->correspondingControl()); + return WebElement(unwrap<HTMLLabelElement>()->control()); } WebLabelElement::WebLabelElement(const PassRefPtr<HTMLLabelElement>& elem) diff --git a/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp b/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp index d7dbade..03051c3 100644 --- a/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp +++ b/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp @@ -133,6 +133,13 @@ void WebMediaPlayerClientImpl::sawUnsupportedTracks() m_mediaPlayer->mediaPlayerClient()->mediaPlayerSawUnsupportedTracks(m_mediaPlayer); } +float WebMediaPlayerClientImpl::volume() const +{ + if (m_mediaPlayer) + return m_mediaPlayer->volume(); + return 0.0f; +} + // MediaPlayerPrivateInterface ------------------------------------------------- void WebMediaPlayerClientImpl::load(const String& url) diff --git a/WebKit/chromium/src/WebMediaPlayerClientImpl.h b/WebKit/chromium/src/WebMediaPlayerClientImpl.h index 4adbed2..57c93b7 100644 --- a/WebKit/chromium/src/WebMediaPlayerClientImpl.h +++ b/WebKit/chromium/src/WebMediaPlayerClientImpl.h @@ -61,6 +61,7 @@ public: virtual void rateChanged(); virtual void sizeChanged(); virtual void sawUnsupportedTracks(); + virtual float volume() const; // MediaPlayerPrivateInterface methods: virtual void load(const WebCore::String& url); diff --git a/WebKit/chromium/src/WebNode.cpp b/WebKit/chromium/src/WebNode.cpp index 90bbb34..31ad70f 100644 --- a/WebKit/chromium/src/WebNode.cpp +++ b/WebKit/chromium/src/WebNode.cpp @@ -94,11 +94,6 @@ bool WebNode::setNodeValue(const WebString& value) return !exceptionCode; } -WebFrame* WebNode::frame() const -{ - return WebFrameImpl::fromFrame(m_private->document()->frame()); -} - WebDocument WebNode::document() const { return WebDocument(m_private->document()); diff --git a/WebKit/chromium/src/WebPageSerializerImpl.cpp b/WebKit/chromium/src/WebPageSerializerImpl.cpp index 008e0c7..e65af85 100644 --- a/WebKit/chromium/src/WebPageSerializerImpl.cpp +++ b/WebKit/chromium/src/WebPageSerializerImpl.cpp @@ -510,7 +510,7 @@ bool WebPageSerializerImpl::serialize() const KURL& currentFrameURL = currentFrame->frame()->loader()->url(); // Check whether we have done this document. - if (m_localLinks.contains(currentFrameURL.string())) { + if (currentFrameURL.isValid() && m_localLinks.contains(currentFrameURL.string())) { // A new document, we will serialize it. didSerialization = true; // Get target encoding for current document. diff --git a/WebKit/chromium/src/WebPluginContainerImpl.cpp b/WebKit/chromium/src/WebPluginContainerImpl.cpp index b207a25..5807a79 100644 --- a/WebKit/chromium/src/WebPluginContainerImpl.cpp +++ b/WebKit/chromium/src/WebPluginContainerImpl.cpp @@ -35,6 +35,7 @@ #include "ChromeClientImpl.h" #include "WebCursorInfo.h" #include "WebDataSourceImpl.h" +#include "WebElement.h" #include "WebInputEvent.h" #include "WebInputEventConversion.h" #include "WebKit.h" @@ -239,6 +240,11 @@ void WebPluginContainerImpl::printEnd() return m_webPlugin->printEnd(); } +WebElement WebPluginContainerImpl::element() +{ + return WebElement(m_element); +} + void WebPluginContainerImpl::invalidate() { Widget::invalidate(); diff --git a/WebKit/chromium/src/WebPluginContainerImpl.h b/WebKit/chromium/src/WebPluginContainerImpl.h index 4163ee5..ad2fa95 100644 --- a/WebKit/chromium/src/WebPluginContainerImpl.h +++ b/WebKit/chromium/src/WebPluginContainerImpl.h @@ -31,9 +31,7 @@ #ifndef WebPluginContainerImpl_h #define WebPluginContainerImpl_h -// FIXME: This relative path is a temporary hack to support using this -// header from webkit/glue. -#include "../public/WebPluginContainer.h" +#include "WebPluginContainer.h" #include "Widget.h" #include <wtf/PassRefPtr.h> @@ -77,6 +75,7 @@ public: virtual void widgetPositionsUpdated(); // WebPluginContainer methods + virtual WebElement element(); virtual void invalidate(); virtual void invalidateRect(const WebRect&); virtual void reportGeometry(); diff --git a/WebKit/chromium/src/WebPluginLoadObserver.h b/WebKit/chromium/src/WebPluginLoadObserver.h index 097d08d..7bd06eb 100644 --- a/WebKit/chromium/src/WebPluginLoadObserver.h +++ b/WebKit/chromium/src/WebPluginLoadObserver.h @@ -31,7 +31,7 @@ #ifndef WebPluginLoadObserver_h #define WebPluginLoadObserver_h -#include "../public/WebURL.h" +#include "WebURL.h" namespace WebKit { diff --git a/WebKit/chromium/src/WebPopupMenuImpl.h b/WebKit/chromium/src/WebPopupMenuImpl.h index ca50b81..a2602b0 100644 --- a/WebKit/chromium/src/WebPopupMenuImpl.h +++ b/WebKit/chromium/src/WebPopupMenuImpl.h @@ -31,14 +31,10 @@ #ifndef WebPopupMenuImpl_h #define WebPopupMenuImpl_h -// FIXME: Add this to FramelessScrollViewClient.h -namespace WebCore { class FramelessScrollView; } - #include "FramelessScrollViewClient.h" -// FIXME: remove the relative paths once glue/ consumers are removed. -#include "../public/WebPoint.h" -#include "../public/WebPopupMenu.h" -#include "../public/WebSize.h" +#include "WebPoint.h" +#include "WebPopupMenu.h" +#include "WebSize.h" #include <wtf/RefCounted.h> namespace WebCore { diff --git a/WebKit/chromium/src/WebScrollbarImpl.cpp b/WebKit/chromium/src/WebScrollbarImpl.cpp new file mode 100644 index 0000000..8bf5340 --- /dev/null +++ b/WebKit/chromium/src/WebScrollbarImpl.cpp @@ -0,0 +1,297 @@ +/* + * Copyright (C) 2010 Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "config.h" +#include "WebScrollbarImpl.h" + +#include "GraphicsContext.h" +#include "KeyboardCodes.h" +#include "PlatformContextSkia.h" +#include "Scrollbar.h" +#include "ScrollbarTheme.h" +#include "ScrollTypes.h" +#include "WebCanvas.h" +#include "WebInputEvent.h" +#include "WebInputEventConversion.h" +#include "WebRect.h" +#include "WebScrollbarClient.h" +#include "WebVector.h" +#include "WebViewImpl.h" + +using namespace std; +using namespace WebCore; + +namespace WebKit { + +WebScrollbar* WebScrollbar::create(WebScrollbarClient* client, Orientation orientation) +{ + return new WebScrollbarImpl(client, orientation); +} + +int WebScrollbar::defaultThickness() +{ + return ScrollbarTheme::nativeTheme()->scrollbarThickness(); +} + +WebScrollbarImpl::WebScrollbarImpl(WebScrollbarClient* client, Orientation orientation) + : m_client(client) +{ + m_scrollbar = Scrollbar::createNativeScrollbar( + static_cast<ScrollbarClient*>(this), + static_cast<ScrollbarOrientation>(orientation), + RegularScrollbar); +} + +WebScrollbarImpl::~WebScrollbarImpl() +{ +} + +void WebScrollbarImpl::setLocation(const WebRect& rect) +{ + WebCore::IntRect oldRect = m_scrollbar->frameRect(); + m_scrollbar->setFrameRect(rect); + if (WebRect(oldRect) != rect) + m_scrollbar->invalidate(); + + int length = m_scrollbar->orientation() == HorizontalScrollbar ? m_scrollbar->width() : m_scrollbar->height(); + int pageStep = max(max<int>(length * Scrollbar::minFractionToStepWhenPaging(), length - Scrollbar::maxOverlapBetweenPages()), 1); + m_scrollbar->setSteps(Scrollbar::pixelsPerLineStep(), pageStep); + m_scrollbar->setEnabled(m_scrollbar->totalSize() > length); + m_scrollbar->setProportion(length, m_scrollbar->totalSize()); +} + +int WebScrollbarImpl::value() const +{ + return m_scrollbar->value(); +} + +void WebScrollbarImpl::setValue(int position) +{ + m_scrollbar->setValue(position); +} + +void WebScrollbarImpl::setDocumentSize(int size) +{ + int length = m_scrollbar->orientation() == HorizontalScrollbar ? m_scrollbar->width() : m_scrollbar->height(); + m_scrollbar->setEnabled(size > length); + m_scrollbar->setProportion(length, size); +} + +void WebScrollbarImpl::scroll(ScrollDirection direction, ScrollGranularity granularity, float multiplier) +{ + WebCore::ScrollDirection dir; + bool horizontal = m_scrollbar->orientation() == HorizontalScrollbar; + if (direction == ScrollForward) + dir = horizontal ? ScrollRight : ScrollDown; + else + dir = horizontal ? ScrollLeft : ScrollUp; + m_scrollbar->scroll(dir, static_cast<WebCore::ScrollGranularity>(granularity), multiplier); +} + +void WebScrollbarImpl::paint(WebCanvas* canvas, const WebRect& rect) +{ +#if WEBKIT_USING_CG + GraphicsContext gc(canvas); +#elif WEBKIT_USING_SKIA + PlatformContextSkia context(canvas); + + // PlatformGraphicsContext is actually a pointer to PlatformContextSkia + GraphicsContext gc(reinterpret_cast<PlatformGraphicsContext*>(&context)); +#else + notImplemented(); +#endif + + m_scrollbar->paint(&gc, rect); +} + +bool WebScrollbarImpl::handleInputEvent(const WebInputEvent& event) +{ + switch (event.type) { + case WebInputEvent::MouseDown: + return onMouseDown(event); + case WebInputEvent::MouseUp: + return onMouseUp(event); + case WebInputEvent::MouseMove: + return onMouseMove(event); + case WebInputEvent::MouseLeave: + return onMouseLeave(event); + case WebInputEvent::MouseWheel: + return onMouseWheel(event); + case WebInputEvent::KeyDown: + return onKeyDown(event); + case WebInputEvent::Undefined: + case WebInputEvent::MouseEnter: + case WebInputEvent::RawKeyDown: + case WebInputEvent::KeyUp: + case WebInputEvent::Char: + case WebInputEvent::TouchStart: + case WebInputEvent::TouchMove: + case WebInputEvent::TouchEnd: + case WebInputEvent::TouchCancel: + default: + break; + } + return false; +} + +bool WebScrollbarImpl::onMouseDown(const WebInputEvent& event) +{ + WebMouseEvent mousedown = *static_cast<const WebMouseEvent*>(&event); + if (!m_scrollbar->frameRect().contains(mousedown.x, mousedown.y)) + return false; + + mousedown.x -= m_scrollbar->x(); + mousedown.y -= m_scrollbar->y(); + m_scrollbar->mouseDown(PlatformMouseEventBuilder(m_scrollbar.get(), mousedown)); + return true; + } + +bool WebScrollbarImpl::onMouseUp(const WebInputEvent& event) +{ + if (m_scrollbar->pressedPart() == NoPart) + return false; + + return m_scrollbar->mouseUp(); +} + +bool WebScrollbarImpl::onMouseMove(const WebInputEvent& event) +{ + WebMouseEvent mousemove = *static_cast<const WebMouseEvent*>(&event); + if (m_scrollbar->frameRect().contains(mousemove.x, mousemove.y) + || m_scrollbar->pressedPart() != NoPart) { + mousemove.x -= m_scrollbar->x(); + mousemove.y -= m_scrollbar->y(); + return m_scrollbar->mouseMoved(PlatformMouseEventBuilder(m_scrollbar.get(), mousemove)); + } + + if (m_scrollbar->hoveredPart() != NoPart) + m_scrollbar->mouseExited(); + return false; +} + +bool WebScrollbarImpl::onMouseLeave(const WebInputEvent& event) +{ + if (m_scrollbar->hoveredPart() == NoPart) + return false; + + return m_scrollbar->mouseExited(); +} + +bool WebScrollbarImpl::onMouseWheel(const WebInputEvent& event) +{ + // Same logic as in Scrollview.cpp. If we can move at all, we'll accept the event. + WebMouseWheelEvent mousewheel = *static_cast<const WebMouseWheelEvent*>(&event); + int maxScrollDelta = m_scrollbar->maximum() - m_scrollbar->value(); + float delta = m_scrollbar->orientation() == HorizontalScrollbar ? mousewheel.deltaX : mousewheel.deltaY; + if ((delta < 0 && maxScrollDelta > 0) || (delta > 0 && m_scrollbar->value() > 0)) { + if (mousewheel.scrollByPage) { + ASSERT(m_scrollbar->orientation() == VerticalScrollbar); + bool negative = delta < 0; + delta = max(max<int>(m_scrollbar->visibleSize() * Scrollbar::minFractionToStepWhenPaging(), m_scrollbar->visibleSize() - Scrollbar::maxOverlapBetweenPages()), 1); + if (negative) + delta *= -1; + } + m_scrollbar->setValue(m_scrollbar->value() - delta); + return true; + } + + return false; + } + +bool WebScrollbarImpl::onKeyDown(const WebInputEvent& event) +{ + WebKeyboardEvent keyboard = *static_cast<const WebKeyboardEvent*>(&event); + int keyCode; + // We have to duplicate this logic from WebViewImpl because there it uses + // Char and RawKeyDown events, which don't exist at this point. + if (keyboard.windowsKeyCode == VKEY_SPACE) + keyCode = ((keyboard.modifiers & WebInputEvent::ShiftKey) ? VKEY_PRIOR : VKEY_NEXT); + else { + if (keyboard.modifiers == WebInputEvent::ControlKey) { + // Match FF behavior in the sense that Ctrl+home/end are the only Ctrl + // key combinations which affect scrolling. Safari is buggy in the + // sense that it scrolls the page for all Ctrl+scrolling key + // combinations. For e.g. Ctrl+pgup/pgdn/up/down, etc. + switch (keyboard.windowsKeyCode) { + case VKEY_HOME: + case VKEY_END: + break; + default: + return false; + } + } + + if (keyboard.isSystemKey || (keyboard.modifiers & WebInputEvent::ShiftKey)) + return false; + + keyCode = keyboard.windowsKeyCode; + } + WebCore::ScrollDirection scrollDirection; + WebCore::ScrollGranularity scrollGranularity; + if (WebViewImpl::mapKeyCodeForScroll(keyCode, &scrollDirection, &scrollGranularity)) { + // Will return false if scroll direction wasn't compatible with this scrollbar. + return m_scrollbar->scroll(scrollDirection, scrollGranularity); + } + return false; +} + +void WebScrollbarImpl::valueChanged(WebCore::Scrollbar*) +{ + m_client->valueChanged(this); +} + +void WebScrollbarImpl::invalidateScrollbarRect(WebCore::Scrollbar*, const WebCore::IntRect& rect) +{ + WebRect webrect(rect); + webrect.x += m_scrollbar->x(); + webrect.y += m_scrollbar->y(); + m_client->invalidateScrollbarRect(this, webrect); +} + +bool WebScrollbarImpl::isActive() const +{ + return true; +} + +bool WebScrollbarImpl::scrollbarCornerPresent() const +{ + return false; +} + +void WebScrollbarImpl::getTickmarks(Vector<WebCore::IntRect>& tickmarks) const +{ + WebVector<WebRect> ticks; + m_client->getTickmarks(const_cast<WebScrollbarImpl*>(this), &ticks); + tickmarks.resize(ticks.size()); + for (size_t i = 0; i < ticks.size(); ++i) + tickmarks[i] = ticks[i]; +} + +} // namespace WebKit diff --git a/WebKit/chromium/src/WebScrollbarImpl.h b/WebKit/chromium/src/WebScrollbarImpl.h new file mode 100644 index 0000000..a041ccc --- /dev/null +++ b/WebKit/chromium/src/WebScrollbarImpl.h @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2010 Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef WebScrollbarImpl_h +#define WebScrollbarImpl_h + +#include "ScrollbarClient.h" +#include "WebScrollbar.h" + +#include <wtf/RefPtr.h> + +namespace WebCore { +class Scrollbar; +} + +namespace WebKit { + +class WebScrollbarImpl : public WebScrollbar, + public WebCore::ScrollbarClient { +public: + WebScrollbarImpl(WebScrollbarClient*, Orientation orientation); + ~WebScrollbarImpl(); + + // WebKit::WebScrollbar methods + virtual void setLocation(const WebRect&); + virtual int value() const; + virtual void setValue(int position); + virtual void setDocumentSize(int size); + virtual void scroll(ScrollDirection, ScrollGranularity, float multiplier); + virtual void paint(WebCanvas*, const WebRect&); + virtual bool handleInputEvent(const WebInputEvent&); + + // WebCore::ScrollbarClient methods + virtual void valueChanged(WebCore::Scrollbar*); + virtual void invalidateScrollbarRect(WebCore::Scrollbar*, const WebCore::IntRect&); + virtual bool isActive() const; + virtual bool scrollbarCornerPresent() const; + virtual void getTickmarks(Vector<WebCore::IntRect>&) const; + +private: + bool onMouseDown(const WebInputEvent& event); + bool onMouseUp(const WebInputEvent& event); + bool onMouseMove(const WebInputEvent& event); + bool onMouseLeave(const WebInputEvent& event); + bool onMouseWheel(const WebInputEvent& event); + bool onKeyDown(const WebInputEvent& event); + + WebScrollbarClient* m_client; + + RefPtr<WebCore::Scrollbar> m_scrollbar; +}; + +} // namespace WebKit + +#endif diff --git a/WebKit/chromium/src/WebSecurityPolicy.cpp b/WebKit/chromium/src/WebSecurityPolicy.cpp index cb7ded0..4b2b557 100644 --- a/WebKit/chromium/src/WebSecurityPolicy.cpp +++ b/WebKit/chromium/src/WebSecurityPolicy.cpp @@ -83,22 +83,6 @@ void WebSecurityPolicy::resetOriginAccessWhitelists() SecurityOrigin::resetOriginAccessWhitelists(); } -// To be removed when Chromium's test_shell has proper references. -void WebSecurityPolicy::whiteListAccessFromOrigin(const WebURL& sourceOrigin, - const WebString& destinationProtocol, - const WebString& destinationHost, - bool allowDestinationSubdomains) -{ - addOriginAccessWhitelistEntry(sourceOrigin, - destinationProtocol, destinationHost, - allowDestinationSubdomains); -} - -void WebSecurityPolicy::resetOriginAccessWhiteLists() -{ - resetOriginAccessWhitelists(); -} - bool WebSecurityPolicy::shouldHideReferrer(const WebURL& url, const WebString& referrer) { return SecurityOrigin::shouldHideReferrer(url, referrer); diff --git a/WebKit/chromium/src/WebSettingsImpl.h b/WebKit/chromium/src/WebSettingsImpl.h index 54c660b..fdc03f0 100644 --- a/WebKit/chromium/src/WebSettingsImpl.h +++ b/WebKit/chromium/src/WebSettingsImpl.h @@ -31,8 +31,7 @@ #ifndef WebSettingsImpl_h #define WebSettingsImpl_h -// TODO(jorlow): Remove this hack once WebView is free of glue. -#include "../public/WebSettings.h" +#include "WebSettings.h" namespace WebCore { class Settings; diff --git a/WebKit/chromium/src/WebSharedWorkerImpl.cpp b/WebKit/chromium/src/WebSharedWorkerImpl.cpp index 4547336..91636d9 100644 --- a/WebKit/chromium/src/WebSharedWorkerImpl.cpp +++ b/WebKit/chromium/src/WebSharedWorkerImpl.cpp @@ -92,7 +92,7 @@ void WebSharedWorkerImpl::connectTask(ScriptExecutionContext* context, WebShared workerContext->toSharedWorkerContext()->dispatchEvent(createConnectEvent(port)); } -void WebSharedWorkerImpl::startWorkerContext(const WebURL& url, const WebString& name, const WebString& userAgent, const WebString& sourceCode) +void WebSharedWorkerImpl::startWorkerContext(const WebURL& url, const WebString& name, const WebString& userAgent, const WebString& sourceCode, long long) { initializeLoader(url); setWorkerThread(SharedWorkerThread::create(name, url, userAgent, sourceCode, *this, *this)); diff --git a/WebKit/chromium/src/WebSharedWorkerImpl.h b/WebKit/chromium/src/WebSharedWorkerImpl.h index 7c10d76..b591c7b 100644 --- a/WebKit/chromium/src/WebSharedWorkerImpl.h +++ b/WebKit/chromium/src/WebSharedWorkerImpl.h @@ -51,7 +51,7 @@ public: // WebSharedWorker methods: virtual bool isStarted(); - virtual void startWorkerContext(const WebURL&, const WebString& name, const WebString& userAgent, const WebString& sourceCode); + virtual void startWorkerContext(const WebURL&, const WebString& name, const WebString& userAgent, const WebString& sourceCode, long long); virtual void connect(WebMessagePortChannel*, ConnectListener*); virtual void terminateWorkerContext(); virtual void clientDestroyed(); diff --git a/WebKit/chromium/src/WebURLResponse.cpp b/WebKit/chromium/src/WebURLResponse.cpp index 3b0600c..1aba54e 100644 --- a/WebKit/chromium/src/WebURLResponse.cpp +++ b/WebKit/chromium/src/WebURLResponse.cpp @@ -93,6 +93,16 @@ void WebURLResponse::setURL(const WebURL& url) m_private->m_resourceResponse->setURL(url); } +double WebURLResponse::responseTime() const +{ + return m_private->m_resourceResponse->responseTime(); +} + +void WebURLResponse::setResponseTime(double responseTime) +{ + m_private->m_resourceResponse->setResponseTime(responseTime); +} + WebString WebURLResponse::mimeType() const { return m_private->m_resourceResponse->mimeType(); @@ -267,6 +277,16 @@ void WebURLResponse::setWasFetchedViaSPDY(bool value) m_private->m_resourceResponse->setWasFetchedViaSPDY(value); } +bool WebURLResponse::wasNpnNegotiated() const +{ + return m_private->m_resourceResponse->wasNpnNegotiated(); +} + +void WebURLResponse::setWasNpnNegotiated(bool value) +{ + m_private->m_resourceResponse->setWasNpnNegotiated(value); +} + bool WebURLResponse::isMultipartPayload() const { return m_private->m_resourceResponse->isMultipartPayload(); diff --git a/WebKit/chromium/src/WebViewImpl.cpp b/WebKit/chromium/src/WebViewImpl.cpp index 81a4ff3..94cf36c 100644 --- a/WebKit/chromium/src/WebViewImpl.cpp +++ b/WebKit/chromium/src/WebViewImpl.cpp @@ -780,45 +780,53 @@ bool WebViewImpl::scrollViewWithKeyboard(int keyCode, int modifiers) { ScrollDirection scrollDirection; ScrollGranularity scrollGranularity; + if (!mapKeyCodeForScroll(keyCode, &scrollDirection, &scrollGranularity)) + return false; + return propagateScroll(scrollDirection, scrollGranularity); +} +bool WebViewImpl::mapKeyCodeForScroll(int keyCode, + WebCore::ScrollDirection* scrollDirection, + WebCore::ScrollGranularity* scrollGranularity) +{ switch (keyCode) { case VKEY_LEFT: - scrollDirection = ScrollLeft; - scrollGranularity = ScrollByLine; + *scrollDirection = ScrollLeft; + *scrollGranularity = ScrollByLine; break; case VKEY_RIGHT: - scrollDirection = ScrollRight; - scrollGranularity = ScrollByLine; + *scrollDirection = ScrollRight; + *scrollGranularity = ScrollByLine; break; case VKEY_UP: - scrollDirection = ScrollUp; - scrollGranularity = ScrollByLine; + *scrollDirection = ScrollUp; + *scrollGranularity = ScrollByLine; break; case VKEY_DOWN: - scrollDirection = ScrollDown; - scrollGranularity = ScrollByLine; + *scrollDirection = ScrollDown; + *scrollGranularity = ScrollByLine; break; case VKEY_HOME: - scrollDirection = ScrollUp; - scrollGranularity = ScrollByDocument; + *scrollDirection = ScrollUp; + *scrollGranularity = ScrollByDocument; break; case VKEY_END: - scrollDirection = ScrollDown; - scrollGranularity = ScrollByDocument; + *scrollDirection = ScrollDown; + *scrollGranularity = ScrollByDocument; break; case VKEY_PRIOR: // page up - scrollDirection = ScrollUp; - scrollGranularity = ScrollByPage; + *scrollDirection = ScrollUp; + *scrollGranularity = ScrollByPage; break; case VKEY_NEXT: // page down - scrollDirection = ScrollDown; - scrollGranularity = ScrollByPage; + *scrollDirection = ScrollDown; + *scrollGranularity = ScrollByPage; break; default: return false; } - return propagateScroll(scrollDirection, scrollGranularity); + return true; } void WebViewImpl::hideSelectPopup() diff --git a/WebKit/chromium/src/WebViewImpl.h b/WebKit/chromium/src/WebViewImpl.h index 0bed223..b561e49 100644 --- a/WebKit/chromium/src/WebViewImpl.h +++ b/WebKit/chromium/src/WebViewImpl.h @@ -31,12 +31,11 @@ #ifndef WebViewImpl_h #define WebViewImpl_h -// FIXME: Remove these relative paths once consumers from glue are removed. -#include "../public/WebNavigationPolicy.h" -#include "../public/WebPoint.h" -#include "../public/WebSize.h" -#include "../public/WebString.h" -#include "../public/WebView.h" +#include "WebNavigationPolicy.h" +#include "WebPoint.h" +#include "WebSize.h" +#include "WebString.h" +#include "WebView.h" #include "BackForwardListClientImpl.h" #include "ChromeClientImpl.h" @@ -47,7 +46,6 @@ #include "InspectorClientImpl.h" #include "LayerRendererChromium.h" #include "NotificationPresenterImpl.h" - #include <wtf/OwnPtr.h> #include <wtf/RefCounted.h> @@ -312,6 +310,11 @@ public: WebCore::PopupContainer* selectPopup() const { return m_selectPopup.get(); } + // Returns true if the event leads to scrolling. + static bool mapKeyCodeForScroll(int keyCode, + WebCore::ScrollDirection* scrollDirection, + WebCore::ScrollGranularity* scrollGranularity); + private: friend class WebView; // So WebView::Create can call our constructor friend class WTF::RefCounted<WebViewImpl>; diff --git a/WebKit/chromium/src/WebWorkerBase.cpp b/WebKit/chromium/src/WebWorkerBase.cpp index 8e26560..1fedeb2 100644 --- a/WebKit/chromium/src/WebWorkerBase.cpp +++ b/WebKit/chromium/src/WebWorkerBase.cpp @@ -31,6 +31,7 @@ #include "config.h" #include "WebWorkerBase.h" +#include "DatabaseTask.h" #include "GenericWorkerTask.h" #include "MessagePortChannel.h" #include "PlatformMessagePortChannel.h" @@ -39,9 +40,12 @@ #include "WebFrameClient.h" #include "WebFrameImpl.h" #include "WebMessagePortChannel.h" +#include "WebRuntimeFeatures.h" +#include "WebSettings.h" #include "WebView.h" #include "WebWorkerClient.h" +#include "WorkerScriptController.h" #include "WorkerThread.h" #include <wtf/MainThread.h> @@ -51,6 +55,67 @@ namespace WebKit { #if ENABLE(WORKERS) +static const char allowDatabaseMode[] = "allowDatabaseMode"; + +namespace { + +// This class is used to route the result of the WebWorkerBase::allowDatabase +// call back to the worker context. +class AllowDatabaseMainThreadBridge : public ThreadSafeShared<AllowDatabaseMainThreadBridge> { +public: + static PassRefPtr<AllowDatabaseMainThreadBridge> create(WebWorkerBase* worker, const WebCore::String& mode, WebCommonWorkerClient* commonClient, WebFrame* frame, const WebCore::String& name, const WebCore::String& displayName, unsigned long estimatedSize) + { + return adoptRef(new AllowDatabaseMainThreadBridge(worker, mode, commonClient, frame, name, displayName, estimatedSize)); + } + + // These methods are invoked on the worker context. + void cancel() + { + MutexLocker locker(m_mutex); + m_worker = 0; + } + + bool result() + { + return m_result; + } + + // This method is invoked on the main thread. + void signalCompleted(bool result) + { + MutexLocker locker(m_mutex); + if (m_worker) + m_worker->postTaskForModeToWorkerContext(createCallbackTask(&didComplete, this, result), m_mode); + } + +private: + AllowDatabaseMainThreadBridge(WebWorkerBase* worker, const WebCore::String& mode, WebCommonWorkerClient* commonClient, WebFrame* frame, const WebCore::String& name, const WebCore::String& displayName, unsigned long estimatedSize) + : m_worker(worker) + , m_mode(mode) + { + worker->dispatchTaskToMainThread(createCallbackTask(&allowDatabaseTask, commonClient, frame, String(name), String(displayName), estimatedSize, this)); + } + + static void allowDatabaseTask(WebCore::ScriptExecutionContext* context, WebCommonWorkerClient* commonClient, WebFrame* frame, const WebCore::String name, const WebCore::String displayName, unsigned long estimatedSize, PassRefPtr<AllowDatabaseMainThreadBridge> bridge) + { + if (!commonClient) + bridge->signalCompleted(false); + else + bridge->signalCompleted(commonClient->allowDatabase(frame, name, displayName, estimatedSize)); + } + + static void didComplete(WebCore::ScriptExecutionContext* context, PassRefPtr<AllowDatabaseMainThreadBridge> bridge, bool result) + { + bridge->m_result = result; + } + + bool m_result; + Mutex m_mutex; + WebWorkerBase* m_worker; + WebCore::String m_mode; +}; +} + // This function is called on the main thread to force to initialize some static // values used in WebKit before any worker thread is started. This is because in // our worker processs, we do not run any WebKit code in main thread and thus @@ -101,6 +166,7 @@ void WebWorkerBase::initializeLoader(const WebURL& url) // infrastructure. ASSERT(!m_webView); m_webView = WebView::create(0); + m_webView->settings()->setOfflineWebApplicationCacheEnabled(WebRuntimeFeatures::isApplicationCacheEnabled()); m_webView->initializeMainFrame(this); WebFrameImpl* webFrame = static_cast<WebFrameImpl*>(m_webView->mainFrame()); @@ -144,6 +210,27 @@ WebApplicationCacheHost* WebWorkerBase::createApplicationCacheHost(WebFrame*, We return 0; } +bool WebWorkerBase::allowDatabase(WebFrame*, const WebString& name, const WebString& displayName, unsigned long estimatedSize) +{ + WorkerRunLoop& runLoop = m_workerThread->runLoop(); + WorkerScriptController* controller = WorkerScriptController::controllerForContext(); + WorkerContext* workerContext = controller->workerContext(); + + // Create a unique mode just for this synchronous call. + String mode = allowDatabaseMode; + mode.append(String::number(runLoop.createUniqueId())); + + RefPtr<AllowDatabaseMainThreadBridge> bridge = AllowDatabaseMainThreadBridge::create(this, mode, commonClient(), m_webView->mainFrame(), String(name), String(displayName), estimatedSize); + + // Either the bridge returns, or the queue gets terminated. + if (runLoop.runInMode(workerContext, mode) == MessageQueueTerminated) { + bridge->cancel(); + return false; + } + + return bridge->result(); +} + // WorkerObjectProxy ----------------------------------------------------------- void WebWorkerBase::postMessageToWorkerObject(PassRefPtr<SerializedScriptValue> message, diff --git a/WebKit/chromium/src/WebWorkerBase.h b/WebKit/chromium/src/WebWorkerBase.h index a470ee4..15e8013 100644 --- a/WebKit/chromium/src/WebWorkerBase.h +++ b/WebKit/chromium/src/WebWorkerBase.h @@ -88,6 +88,9 @@ public: virtual void didCreateDataSource(WebFrame*, WebDataSource*); virtual WebApplicationCacheHost* createApplicationCacheHost(WebFrame*, WebApplicationCacheHostClient*); + // Controls whether access to Web Databases is allowed for this worker. + virtual bool allowDatabase(WebFrame*, const WebString& name, const WebString& displayName, unsigned long estimatedSize); + // Executes the given task on the main thread. static void dispatchTaskToMainThread(PassOwnPtr<WebCore::ScriptExecutionContext::Task>); diff --git a/WebKit/chromium/src/WebWorkerClientImpl.h b/WebKit/chromium/src/WebWorkerClientImpl.h index 907499a..758c376 100644 --- a/WebKit/chromium/src/WebWorkerClientImpl.h +++ b/WebKit/chromium/src/WebWorkerClientImpl.h @@ -33,8 +33,7 @@ #if ENABLE(WORKERS) -// FIXME: fix to just "WebWorkerClient.h" once nobody in glue depends on us. -#include "../public/WebWorkerClient.h" +#include "WebWorkerClient.h" #include "WorkerContextProxy.h" #include <wtf/PassOwnPtr.h> @@ -95,6 +94,11 @@ public: return 0; } virtual WebApplicationCacheHost* createApplicationCacheHost(WebApplicationCacheHostClient*) { return 0; } + virtual bool allowDatabase(WebFrame*, const WebString& name, const WebString& displayName, unsigned long estimatedSize) + { + ASSERT_NOT_REACHED(); + return true; + } private: virtual ~WebWorkerClientImpl(); diff --git a/WebKit/chromium/src/WrappedResourceRequest.h b/WebKit/chromium/src/WrappedResourceRequest.h index 97311db..3057387 100644 --- a/WebKit/chromium/src/WrappedResourceRequest.h +++ b/WebKit/chromium/src/WrappedResourceRequest.h @@ -31,9 +31,7 @@ #ifndef WrappedResourceRequest_h #define WrappedResourceRequest_h -// FIXME: This relative path is a temporary hack to support using this -// header from webkit/glue. -#include "../public/WebURLRequest.h" +#include "WebURLRequest.h" #include "WebURLRequestPrivate.h" namespace WebKit { diff --git a/WebKit/chromium/src/WrappedResourceResponse.h b/WebKit/chromium/src/WrappedResourceResponse.h index af4f88f..927582d 100644 --- a/WebKit/chromium/src/WrappedResourceResponse.h +++ b/WebKit/chromium/src/WrappedResourceResponse.h @@ -31,9 +31,7 @@ #ifndef WrappedResourceResponse_h #define WrappedResourceResponse_h -// FIXME: This relative path is a temporary hack to support using this -// header from webkit/glue. -#include "../public/WebURLResponse.h" +#include "WebURLResponse.h" #include "WebURLResponsePrivate.h" namespace WebKit { diff --git a/WebKit/chromium/src/js/DevTools.js b/WebKit/chromium/src/js/DevTools.js index 59b88db..6e9c090 100644 --- a/WebKit/chromium/src/js/DevTools.js +++ b/WebKit/chromium/src/js/DevTools.js @@ -200,7 +200,7 @@ devtools.domContentLoaded = function() var pair = params[i].split("="); paramsObject[pair[0]] = pair[1]; } - WebInspector.setAttachedWindow(paramsObject.docked); + WebInspector.setAttachedWindow(paramsObject.docked === "true"); if (paramsObject.toolbar_color && paramsObject.text_color) WebInspector.setToolbarColors(paramsObject.toolbar_color, paramsObject.text_color); } |