diff options
author | Ben Murdoch <benm@google.com> | 2011-06-02 12:07:03 +0100 |
---|---|---|
committer | Ben Murdoch <benm@google.com> | 2011-06-10 10:47:21 +0100 |
commit | 2daae5fd11344eaa88a0d92b0f6d65f8d2255c00 (patch) | |
tree | e4964fbd1cb70599f7718ff03e50ea1dab33890b /Source/WebKit/chromium/src | |
parent | 87bdf0060a247bfbe668342b87e0874182e0ffa9 (diff) | |
download | external_webkit-2daae5fd11344eaa88a0d92b0f6d65f8d2255c00.zip external_webkit-2daae5fd11344eaa88a0d92b0f6d65f8d2255c00.tar.gz external_webkit-2daae5fd11344eaa88a0d92b0f6d65f8d2255c00.tar.bz2 |
Merge WebKit at r84325: Initial merge by git.
Change-Id: Ic1a909300ecc0a13ddc6b4e784371d2ac6e3d59b
Diffstat (limited to 'Source/WebKit/chromium/src')
88 files changed, 1250 insertions, 577 deletions
diff --git a/Source/WebKit/chromium/src/AssertMatchingEnums.cpp b/Source/WebKit/chromium/src/AssertMatchingEnums.cpp index 7baaf8a..533e8ec 100644 --- a/Source/WebKit/chromium/src/AssertMatchingEnums.cpp +++ b/Source/WebKit/chromium/src/AssertMatchingEnums.cpp @@ -38,6 +38,7 @@ #include "AsyncFileSystem.h" #include "DocumentMarker.h" #include "EditorInsertAction.h" +#include "ExceptionCode.h" #include "FileError.h" #include "FileMetadata.h" #include "FontDescription.h" @@ -52,6 +53,7 @@ #include "PasteboardPrivate.h" #include "PlatformCursor.h" #include "Settings.h" +#include "StorageInfo.h" #include "TextAffinity.h" #include "UserContentTypes.h" #include "UserScriptTypes.h" @@ -75,6 +77,8 @@ #include "WebNotificationPresenter.h" #include "WebScrollbar.h" #include "WebSettings.h" +#include "WebStorageQuotaError.h" +#include "WebStorageQuotaType.h" #include "WebTextAffinity.h" #include "WebTextCaseSensitivity.h" #include "WebTextCheckingResult.h" @@ -390,6 +394,7 @@ COMPILE_ASSERT_MATCHING_ENUM(WebIDBFactory::LevelDBBackingStore, IDBFactoryBacke #if ENABLE(FILE_SYSTEM) COMPILE_ASSERT_MATCHING_ENUM(WebFileSystem::TypeTemporary, AsyncFileSystem::Temporary); COMPILE_ASSERT_MATCHING_ENUM(WebFileSystem::TypePersistent, AsyncFileSystem::Persistent); +COMPILE_ASSERT_MATCHING_ENUM(WebFileSystem::TypeExternal, AsyncFileSystem::External); COMPILE_ASSERT_MATCHING_ENUM(WebFileInfo::TypeUnknown, FileMetadata::TypeUnknown); COMPILE_ASSERT_MATCHING_ENUM(WebFileInfo::TypeFile, FileMetadata::TypeFile); COMPILE_ASSERT_MATCHING_ENUM(WebFileInfo::TypeDirectory, FileMetadata::TypeDirectory); @@ -414,6 +419,17 @@ COMPILE_ASSERT_MATCHING_ENUM(WebGeolocationError::ErrorPositionUnavailable, Geol COMPILE_ASSERT_MATCHING_ENUM(WebTextCheckingResult::ErrorSpelling, DocumentMarker::Spelling); COMPILE_ASSERT_MATCHING_ENUM(WebTextCheckingResult::ErrorGrammar, DocumentMarker::Grammar); +#if ENABLE(QUOTA) +COMPILE_ASSERT_MATCHING_ENUM(WebStorageQuotaErrorNotSupported, NOT_SUPPORTED_ERR); +COMPILE_ASSERT_MATCHING_ENUM(WebStorageQuotaErrorAbort, ABORT_ERR); + +COMPILE_ASSERT_MATCHING_ENUM(WebStorageQuotaTypeTemporary, StorageInfo::TEMPORARY); +COMPILE_ASSERT_MATCHING_ENUM(WebStorageQuotaTypePersistent, StorageInfo::PERSISTENT); + +COMPILE_ASSERT_MATCHING_ENUM(WebStorageQuotaErrorNotSupported, NOT_SUPPORTED_ERR); +COMPILE_ASSERT_MATCHING_ENUM(WebStorageQuotaErrorAbort, ABORT_ERR); +#endif + #if OS(DARWIN) COMPILE_ASSERT_MATCHING_ENUM(WebThemeEngine::StateDisabled, PlatformBridge::StateDisabled); COMPILE_ASSERT_MATCHING_ENUM(WebThemeEngine::StateInactive, PlatformBridge::StateInactive); diff --git a/Source/WebKit/chromium/src/AssociatedURLLoader.cpp b/Source/WebKit/chromium/src/AssociatedURLLoader.cpp index 1ca9900..acb7687 100644 --- a/Source/WebKit/chromium/src/AssociatedURLLoader.cpp +++ b/Source/WebKit/chromium/src/AssociatedURLLoader.cpp @@ -124,17 +124,16 @@ void AssociatedURLLoader::ClientAdapter::didReceiveData(const char* data, int da if (!m_client) return; - // FIXME(vsevik): add -1 to params once migrated. - m_client->didReceiveData(m_loader, data, dataLength); + m_client->didReceiveData(m_loader, data, dataLength, -1); m_downloadLength += dataLength; } -void AssociatedURLLoader::ClientAdapter::didReceiveCachedMetadata(const char* data, int lengthReceived) +void AssociatedURLLoader::ClientAdapter::didReceiveCachedMetadata(const char* data, int dataLength) { if (!m_client) return; - m_client->didReceiveCachedMetadata(m_loader, data, lengthReceived); + m_client->didReceiveCachedMetadata(m_loader, data, dataLength); } void AssociatedURLLoader::ClientAdapter::didFinishLoading(unsigned long identifier, double finishTime) @@ -169,7 +168,7 @@ AssociatedURLLoader::AssociatedURLLoader(PassRefPtr<WebFrameImpl> frameImpl) m_options.sniffContent = false; m_options.allowCredentials = true; m_options.forcePreflight = false; - m_options.crossOriginRequestPolicy = AllowCrossOriginRequests; // TODO(bbudge) Default should be DenyCrossOriginRequests, but this would break some tests. + m_options.crossOriginRequestPolicy = WebURLLoaderOptions::CrossOriginRequestPolicyAllow; // FIXME We should deny by default, but this would break some tests. } AssociatedURLLoader::AssociatedURLLoader(PassRefPtr<WebFrameImpl> frameImpl, const WebURLLoaderOptions& options) @@ -189,9 +188,9 @@ AssociatedURLLoader::~AssociatedURLLoader() #define COMPILE_ASSERT_MATCHING_ENUM(webkit_name, webcore_name) \ COMPILE_ASSERT(static_cast<int>(WebKit::webkit_name) == static_cast<int>(WebCore::webcore_name), mismatching_enums) -COMPILE_ASSERT_MATCHING_ENUM(DenyCrossOriginRequests, DenyCrossOriginRequests); -COMPILE_ASSERT_MATCHING_ENUM(UseAccessControl, UseAccessControl); -COMPILE_ASSERT_MATCHING_ENUM(AllowCrossOriginRequests, AllowCrossOriginRequests); +COMPILE_ASSERT_MATCHING_ENUM(WebURLLoaderOptions::CrossOriginRequestPolicyDeny, DenyCrossOriginRequests); +COMPILE_ASSERT_MATCHING_ENUM(WebURLLoaderOptions::CrossOriginRequestPolicyUseAccessControl, UseAccessControl); +COMPILE_ASSERT_MATCHING_ENUM(WebURLLoaderOptions::CrossOriginRequestPolicyAllow, AllowCrossOriginRequests); void AssociatedURLLoader::loadSynchronously(const WebURLRequest& request, WebURLResponse& response, WebURLError& error, WebData& data) { diff --git a/Source/WebKit/chromium/src/AssociatedURLLoader.h b/Source/WebKit/chromium/src/AssociatedURLLoader.h index ed183e5..9458986 100644 --- a/Source/WebKit/chromium/src/AssociatedURLLoader.h +++ b/Source/WebKit/chromium/src/AssociatedURLLoader.h @@ -32,6 +32,7 @@ #define AssociatedURLLoader_h #include "WebURLLoader.h" +#include "WebURLLoaderOptions.h" #include <wtf/Noncopyable.h> #include <wtf/OwnPtr.h> #include <wtf/RefPtr.h> diff --git a/Source/WebKit/chromium/src/ChromeClientImpl.cpp b/Source/WebKit/chromium/src/ChromeClientImpl.cpp index 99302cc..f12bf03 100644 --- a/Source/WebKit/chromium/src/ChromeClientImpl.cpp +++ b/Source/WebKit/chromium/src/ChromeClientImpl.cpp @@ -54,6 +54,7 @@ #include "Node.h" #include "NotificationPresenterImpl.h" #include "Page.h" +#include "PlatformBridge.h" #include "PopupMenuChromium.h" #include "RenderWidget.h" #include "ScriptController.h" @@ -682,6 +683,22 @@ void ChromeClientImpl::chooseIconForFiles(const Vector<String>& filenames, FileC iconCompletion->didLoadIcon(WebData()); } +#if ENABLE(DIRECTORY_UPLOAD) +void ChromeClientImpl::enumerateChosenDirectory(const String& path, FileChooser* fileChooser) +{ + WebViewClient* client = m_webView->client(); + if (!client) + return; + + WebFileChooserCompletionImpl* chooserCompletion = + new WebFileChooserCompletionImpl(fileChooser); + + // If the enumeration can't happen, call the callback with an empty list. + if (!client->enumerateChosenDirectory(path, chooserCompletion)) + chooserCompletion->didChooseFile(WebVector<WebString>()); +} +#endif + void ChromeClientImpl::popupOpened(PopupContainer* popupContainer, const IntRect& bounds, bool handleExternally) @@ -905,4 +922,9 @@ PassRefPtr<SearchPopupMenu> ChromeClientImpl::createSearchPopupMenu(PopupMenuCli return adoptRef(new SearchPopupMenuChromium(client)); } +void ChromeClientImpl::willRunModalDialogDuringPageDismissal(const DialogType& dialogType) const +{ + PlatformBridge::histogramEnumeration("Renderer.ModalDialogsDuringPageDismissal", static_cast<int>(dialogType), static_cast<int>(NumDialogTypes)); +} + } // namespace WebKit diff --git a/Source/WebKit/chromium/src/ChromeClientImpl.h b/Source/WebKit/chromium/src/ChromeClientImpl.h index f3a48ee..6a65522 100644 --- a/Source/WebKit/chromium/src/ChromeClientImpl.h +++ b/Source/WebKit/chromium/src/ChromeClientImpl.h @@ -139,6 +139,9 @@ public: virtual void cancelGeolocationPermissionRequestForFrame(WebCore::Frame*, WebCore::Geolocation*); virtual void runOpenPanel(WebCore::Frame*, PassRefPtr<WebCore::FileChooser>); virtual void chooseIconForFiles(const Vector<WTF::String>&, WebCore::FileChooser*); +#if ENABLE(DIRECTORY_UPLOAD) + virtual void enumerateChosenDirectory(const WTF::String&, WebCore::FileChooser*); +#endif virtual void setCursor(const WebCore::Cursor&); virtual void formStateDidChange(const WebCore::Node*); #if ENABLE(TOUCH_EVENTS) @@ -191,6 +194,8 @@ public: virtual void showContextMenu() { } #endif + virtual void willRunModalDialogDuringPageDismissal(const DialogType&) const; + private: void getPopupMenuInfo(WebCore::PopupContainer*, WebPopupMenuInfo*); void setCursor(const WebCursorInfo&); diff --git a/Source/WebKit/chromium/src/ContextMenuClientImpl.cpp b/Source/WebKit/chromium/src/ContextMenuClientImpl.cpp index 9c137c9..0f82d38 100644 --- a/Source/WebKit/chromium/src/ContextMenuClientImpl.cpp +++ b/Source/WebKit/chromium/src/ContextMenuClientImpl.cpp @@ -61,6 +61,7 @@ #include "WebPlugin.h" #include "WebPluginContainerImpl.h" #include "WebPoint.h" +#include "WebSpellCheckClient.h" #include "WebString.h" #include "WebURL.h" #include "WebURLResponse.h" @@ -206,7 +207,7 @@ PlatformMenuDescription ContextMenuClientImpl::getCustomMenuFromDefaultItems( if (mediaElement->hasVideo()) data.mediaFlags |= WebContextMenuData::MediaHasVideo; if (mediaElement->controls()) - data.mediaFlags |= WebContextMenuData::MediaControls; + data.mediaFlags |= WebContextMenuData::MediaControlRootElement; } else if (r.innerNonSharedNode()->hasTagName(HTMLNames::objectTag) || r.innerNonSharedNode()->hasTagName(HTMLNames::embedTag)) { RenderObject* object = r.innerNonSharedNode()->renderer(); @@ -256,8 +257,17 @@ PlatformMenuDescription ContextMenuClientImpl::getCustomMenuFromDefaultItems( if (m_webView->focusedWebCoreFrame()->editor()->isContinuousSpellCheckingEnabled()) { data.isSpellCheckingEnabled = true; // Spellchecking might be enabled for the field, but could be disabled on the node. - if (m_webView->focusedWebCoreFrame()->editor()->isSpellCheckingEnabledInFocusedNode()) + if (m_webView->focusedWebCoreFrame()->editor()->isSpellCheckingEnabledInFocusedNode()) { data.misspelledWord = selectMisspelledWord(defaultMenu, selectedFrame); + if (m_webView->spellCheckClient()) { + int misspelledOffset, misspelledLength; + m_webView->spellCheckClient()->spellCheck( + data.misspelledWord, misspelledOffset, misspelledLength, + &data.dictionarySuggestions); + if (!misspelledLength) + data.misspelledWord.reset(); + } + } } } diff --git a/Source/WebKit/chromium/src/EditorClientImpl.cpp b/Source/WebKit/chromium/src/EditorClientImpl.cpp index 6f2231d..1141ea4 100644 --- a/Source/WebKit/chromium/src/EditorClientImpl.cpp +++ b/Source/WebKit/chromium/src/EditorClientImpl.cpp @@ -858,7 +858,7 @@ void EditorClientImpl::checkSpellingOfString(const UChar* text, int length, // Check to see if the provided text is spelled correctly. if (isContinuousSpellCheckingEnabled() && m_webView->spellCheckClient()) - m_webView->spellCheckClient()->spellCheck(WebString(text, length), spellLocation, spellLength); + m_webView->spellCheckClient()->spellCheck(WebString(text, length), spellLocation, spellLength, 0); else { spellLocation = 0; spellLength = 0; @@ -872,7 +872,7 @@ void EditorClientImpl::checkSpellingOfString(const UChar* text, int length, *misspellingLength = spellLength; } -void EditorClientImpl::requestCheckingOfString(SpellChecker* sender, int identifier, const String& text) +void EditorClientImpl::requestCheckingOfString(SpellChecker* sender, int identifier, TextCheckingTypeMask, const String& text) { if (m_webView->spellCheckClient()) m_webView->spellCheckClient()->requestCheckingOfText(text, new WebTextCheckingCompletionImpl(identifier, sender)); diff --git a/Source/WebKit/chromium/src/EditorClientImpl.h b/Source/WebKit/chromium/src/EditorClientImpl.h index b81fb56..2ebc6ea 100644 --- a/Source/WebKit/chromium/src/EditorClientImpl.h +++ b/Source/WebKit/chromium/src/EditorClientImpl.h @@ -114,7 +114,7 @@ public: WTF::Vector<WTF::String>& guesses); virtual void willSetInputMethodState(); virtual void setInputMethodState(bool enabled); - virtual void requestCheckingOfString(WebCore::SpellChecker*, int, const WTF::String&); + virtual void requestCheckingOfString(WebCore::SpellChecker*, int, WebCore::TextCheckingTypeMask, const WTF::String&); virtual WebCore::TextCheckerClient* textChecker() { return this; } diff --git a/Source/WebKit/chromium/src/EventListenerWrapper.cpp b/Source/WebKit/chromium/src/EventListenerWrapper.cpp index 6360932..b352d81 100644 --- a/Source/WebKit/chromium/src/EventListenerWrapper.cpp +++ b/Source/WebKit/chromium/src/EventListenerWrapper.cpp @@ -37,6 +37,8 @@ #include "WebDOMEvent.h" #include "WebDOMEventListener.h" +using namespace WebCore; + namespace WebKit { EventListenerWrapper::EventListenerWrapper(WebDOMEventListener* webDOMEventListener) diff --git a/Source/WebKit/chromium/src/EventListenerWrapper.h b/Source/WebKit/chromium/src/EventListenerWrapper.h index 75b6a95..83e1cf1 100644 --- a/Source/WebKit/chromium/src/EventListenerWrapper.h +++ b/Source/WebKit/chromium/src/EventListenerWrapper.h @@ -37,21 +37,19 @@ namespace WebCore { class ScriptExecutionContext; } -using namespace WebCore; - namespace WebKit { class WebDOMEventListener; // FIXME: Remove the DeprecatedEventListenerWrapper class below once Chromium // switched to using WebDOMEvent. -class EventListenerWrapper : public EventListener { +class EventListenerWrapper : public WebCore::EventListener { public: EventListenerWrapper(WebDOMEventListener*); ~EventListenerWrapper(); - virtual bool operator==(const EventListener&); - virtual void handleEvent(ScriptExecutionContext*, Event*); + virtual bool operator==(const WebCore::EventListener&); + virtual void handleEvent(WebCore::ScriptExecutionContext*, WebCore::Event*); void webDOMEventListenerDeleted(); diff --git a/Source/WebKit/chromium/src/Extensions3DChromium.cpp b/Source/WebKit/chromium/src/Extensions3DChromium.cpp index 30101c7..81fa520 100644 --- a/Source/WebKit/chromium/src/Extensions3DChromium.cpp +++ b/Source/WebKit/chromium/src/Extensions3DChromium.cpp @@ -57,6 +57,11 @@ void Extensions3DChromium::ensureEnabled(const String& name) ASSERT(result); } +bool Extensions3DChromium::isEnabled(const String& name) +{ + return m_internal->isExtensionEnabled(name); +} + int Extensions3DChromium::getGraphicsResetStatusARB() { return m_internal->isContextLost() ? static_cast<int>(Extensions3D::UNKNOWN_CONTEXT_RESET_ARB) : static_cast<int>(GraphicsContext3D::NO_ERROR); @@ -97,6 +102,26 @@ void Extensions3DChromium::copyTextureToParentTextureCHROMIUM(unsigned texture, m_internal->copyTextureToParentTextureCHROMIUM(texture, parentTexture); } +void Extensions3DChromium::getParentToChildLatchCHROMIUM(GC3Duint* latchId) +{ + m_internal->getParentToChildLatchCHROMIUM(latchId); +} + +void Extensions3DChromium::getChildToParentLatchCHROMIUM(GC3Duint* latchId) +{ + m_internal->getChildToParentLatchCHROMIUM(latchId); +} + +void Extensions3DChromium::waitLatchCHROMIUM(GC3Duint latchId) +{ + m_internal->waitLatchCHROMIUM(latchId); +} + +void Extensions3DChromium::setLatchCHROMIUM(GC3Duint latchId) +{ + m_internal->setLatchCHROMIUM(latchId); +} + Platform3DObject Extensions3DChromium::createVertexArrayOES() { return 0; diff --git a/Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp b/Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp index 647a70c..d640b65 100644 --- a/Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp +++ b/Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp @@ -380,7 +380,7 @@ void FrameLoaderClientImpl::dispatchDidReceiveResponse(DocumentLoader* loader, void FrameLoaderClientImpl::dispatchDidReceiveContentLength( DocumentLoader* loader, unsigned long identifier, - int lengthReceived) + int dataLength) { } @@ -714,10 +714,18 @@ void FrameLoaderClientImpl::dispatchDidStartProvisionalLoad() // m_expectedClientRedirectDest could be something like // "javascript:history.go(-1)" thus we need to exclude url starts with // "javascript:". See bug: 1080873 - ASSERT(m_expectedClientRedirectDest.protocolIs("javascript") - || m_expectedClientRedirectDest == url); - ds->appendRedirect(m_expectedClientRedirectSrc); - completingClientRedirect = true; + if (m_expectedClientRedirectDest.protocolIs("javascript") + || m_expectedClientRedirectDest == url) { + ds->appendRedirect(m_expectedClientRedirectSrc); + completingClientRedirect = true; + } else { + // Any pending redirect is no longer in progress. This can happen + // if the navigation was canceled with PolicyIgnore, or if the + // redirect was scheduled on the wrong frame (e.g., due to a form + // submission targeted to _blank, as in http://webkit.org/b/44079). + m_expectedClientRedirectSrc = KURL(); + m_expectedClientRedirectDest = KURL(); + } } ds->appendRedirect(url); @@ -734,10 +742,10 @@ void FrameLoaderClientImpl::dispatchDidStartProvisionalLoad() } } -void FrameLoaderClientImpl::dispatchDidReceiveTitle(const String& title) +void FrameLoaderClientImpl::dispatchDidReceiveTitle(const StringWithDirection& title) { if (m_webFrame->client()) - m_webFrame->client()->didReceiveTitle(m_webFrame, title); + m_webFrame->client()->didReceiveTitle(m_webFrame, title.string(), title.direction() == LTR ? WebTextDirectionLeftToRight : WebTextDirectionRightToLeft); } void FrameLoaderClientImpl::dispatchDidChangeIcons() @@ -1328,7 +1336,7 @@ PassRefPtr<DocumentLoader> FrameLoaderClientImpl::createDocumentLoader( return ds.release(); } -void FrameLoaderClientImpl::setTitle(const String& title, const KURL& url) +void FrameLoaderClientImpl::setTitle(const StringWithDirection& title, const KURL& url) { // FIXME: inform consumer of changes to the title. } diff --git a/Source/WebKit/chromium/src/FrameLoaderClientImpl.h b/Source/WebKit/chromium/src/FrameLoaderClientImpl.h index f19c26c..042b462 100644 --- a/Source/WebKit/chromium/src/FrameLoaderClientImpl.h +++ b/Source/WebKit/chromium/src/FrameLoaderClientImpl.h @@ -88,7 +88,7 @@ public: virtual void dispatchDidReceiveAuthenticationChallenge(WebCore::DocumentLoader*, unsigned long identifier, const WebCore::AuthenticationChallenge&); virtual void dispatchDidCancelAuthenticationChallenge(WebCore::DocumentLoader*, unsigned long identifier, const WebCore::AuthenticationChallenge&); virtual void dispatchDidReceiveResponse(WebCore::DocumentLoader*, unsigned long identifier, const WebCore::ResourceResponse&); - virtual void dispatchDidReceiveContentLength(WebCore::DocumentLoader*, unsigned long identifier, int lengthReceived); + virtual void dispatchDidReceiveContentLength(WebCore::DocumentLoader*, unsigned long identifier, int dataLength); virtual void dispatchDidFinishLoading(WebCore::DocumentLoader*, unsigned long identifier); virtual void dispatchDidFailLoading(WebCore::DocumentLoader*, unsigned long identifier, const WebCore::ResourceError&); virtual bool dispatchDidLoadResourceFromMemoryCache(WebCore::DocumentLoader*, const WebCore::ResourceRequest&, const WebCore::ResourceResponse&, int length); @@ -104,7 +104,7 @@ public: virtual void dispatchWillClose(); virtual void dispatchDidReceiveIcon(); virtual void dispatchDidStartProvisionalLoad(); - virtual void dispatchDidReceiveTitle(const WTF::String& title); + virtual void dispatchDidReceiveTitle(const WebCore::StringWithDirection&); virtual void dispatchDidChangeIcons(); virtual void dispatchDidCommitLoad(); virtual void dispatchDidFailProvisionalLoad(const WebCore::ResourceError&); @@ -166,7 +166,7 @@ public: virtual void prepareForDataSourceReplacement(); virtual PassRefPtr<WebCore::DocumentLoader> createDocumentLoader( const WebCore::ResourceRequest&, const WebCore::SubstituteData&); - virtual void setTitle(const WTF::String& title, const WebCore::KURL&); + virtual void setTitle(const WebCore::StringWithDirection&, const WebCore::KURL&); virtual WTF::String userAgent(const WebCore::KURL&); virtual void savePlatformDataToCachedFrame(WebCore::CachedFrame*); virtual void transitionToCommittedFromCachedFrame(WebCore::CachedFrame*); diff --git a/Source/WebKit/chromium/src/GraphicsContext3DChromium.cpp b/Source/WebKit/chromium/src/GraphicsContext3DChromium.cpp index 54c18e3..611103c 100644 --- a/Source/WebKit/chromium/src/GraphicsContext3DChromium.cpp +++ b/Source/WebKit/chromium/src/GraphicsContext3DChromium.cpp @@ -54,7 +54,7 @@ #include <wtf/FastMalloc.h> #include <wtf/text/CString.h> -#if PLATFORM(CG) +#if USE(CG) #include "GraphicsContext.h" #include "WebGLRenderingContext.h" #include <CoreGraphics/CGContext.h> @@ -84,7 +84,7 @@ GraphicsContext3DInternal::GraphicsContext3DInternal() , m_initializedAvailableExtensions(false) , m_layerComposited(false) #if USE(SKIA) -#elif PLATFORM(CG) +#elif USE(CG) , m_renderOutput(0) #else #error Must port to your platform @@ -94,7 +94,7 @@ GraphicsContext3DInternal::GraphicsContext3DInternal() GraphicsContext3DInternal::~GraphicsContext3DInternal() { -#if PLATFORM(CG) +#if USE(CG) if (m_renderOutput) delete[] m_renderOutput; #endif @@ -210,7 +210,7 @@ void GraphicsContext3DInternal::paintRenderingResultsToCanvas(CanvasRenderingCon // Read back the frame buffer. SkAutoLockPixels bitmapLock(*readbackBitmap); pixels = static_cast<unsigned char*>(readbackBitmap->getPixels()); -#elif PLATFORM(CG) +#elif USE(CG) if (m_renderOutput) pixels = m_renderOutput; #else @@ -230,6 +230,7 @@ void GraphicsContext3DInternal::paintRenderingResultsToCanvas(CanvasRenderingCon } #if USE(SKIA) + readbackBitmap->notifyPixelsChanged(); if (m_resizingBitmap.readyToDraw()) { // We need to draw the resizing bitmap into the canvas's backing store. SkCanvas canvas(*canvasBitmap); @@ -237,7 +238,7 @@ void GraphicsContext3DInternal::paintRenderingResultsToCanvas(CanvasRenderingCon dst.set(SkIntToScalar(0), SkIntToScalar(0), SkIntToScalar(canvasBitmap->width()), SkIntToScalar(canvasBitmap->height())); canvas.drawBitmapRect(m_resizingBitmap, 0, dst); } -#elif PLATFORM(CG) +#elif USE(CG) if (m_renderOutput && context->is3d()) { WebGLRenderingContext* webGLContext = static_cast<WebGLRenderingContext*>(context); webGLContext->graphicsContext3D()->paintToCanvas(m_renderOutput, m_impl->width(), m_impl->height(), canvas->width(), canvas->height(), imageBuffer->context()->platformContext()); @@ -277,7 +278,7 @@ void GraphicsContext3DInternal::reshape(int width, int height) m_impl->reshape(width, height); -#if PLATFORM(CG) +#if USE(CG) // Need to reallocate the client-side backing store. // FIXME: make this more efficient. if (m_renderOutput) { @@ -286,7 +287,7 @@ void GraphicsContext3DInternal::reshape(int width, int height) } int rowBytes = width * 4; m_renderOutput = new unsigned char[height * rowBytes]; -#endif // PLATFORM(CG) +#endif // USE(CG) } IntSize GraphicsContext3DInternal::getInternalFramebufferSize() @@ -793,6 +794,13 @@ bool GraphicsContext3DInternal::ensureExtensionEnabled(const String& name) return m_enabledExtensions.contains(mappedName); } +bool GraphicsContext3DInternal::isExtensionEnabled(const String& name) +{ + initializeExtensions(); + String mappedName = mapExtensionName(name); + return m_enabledExtensions.contains(mappedName); +} + DELEGATE_TO_IMPL_4R(mapBufferSubDataCHROMIUM, GC3Denum, GC3Dsizeiptr, GC3Dsizei, GC3Denum, void*) DELEGATE_TO_IMPL_1(unmapBufferSubDataCHROMIUM, const void*) DELEGATE_TO_IMPL_9R(mapTexSubImage2DCHROMIUM, GC3Denum, GC3Dint, GC3Dint, GC3Dint, GC3Dsizei, GC3Dsizei, GC3Denum, GC3Denum, GC3Denum, void*) @@ -800,6 +808,10 @@ DELEGATE_TO_IMPL_1(unmapTexSubImage2DCHROMIUM, const void*) DELEGATE_TO_IMPL_2(copyTextureToParentTextureCHROMIUM, Platform3DObject, Platform3DObject) DELEGATE_TO_IMPL_10(blitFramebufferCHROMIUM, GC3Dint, GC3Dint, GC3Dint, GC3Dint, GC3Dint, GC3Dint, GC3Dint, GC3Dint, GC3Dbitfield, GC3Denum) DELEGATE_TO_IMPL_5(renderbufferStorageMultisampleCHROMIUM, GC3Denum, GC3Dsizei, GC3Denum, GC3Dsizei, GC3Dsizei) +DELEGATE_TO_IMPL_1(getParentToChildLatchCHROMIUM, GC3Duint*) +DELEGATE_TO_IMPL_1(getChildToParentLatchCHROMIUM, GC3Duint*) +DELEGATE_TO_IMPL_1(waitLatchCHROMIUM, GC3Duint) +DELEGATE_TO_IMPL_1(setLatchCHROMIUM, GC3Duint) //---------------------------------------------------------------------- // GraphicsContext3D diff --git a/Source/WebKit/chromium/src/GraphicsContext3DInternal.h b/Source/WebKit/chromium/src/GraphicsContext3DInternal.h index 0af291e..c02491c 100644 --- a/Source/WebKit/chromium/src/GraphicsContext3DInternal.h +++ b/Source/WebKit/chromium/src/GraphicsContext3DInternal.h @@ -251,6 +251,7 @@ public: Extensions3D* getExtensions(); bool supportsExtension(const String& name); bool ensureExtensionEnabled(const String& name); + bool isExtensionEnabled(const String& name); // EXT_texture_format_BGRA8888 bool supportsBGRA(); @@ -270,6 +271,12 @@ public: void blitFramebufferCHROMIUM(GC3Dint srcX0, GC3Dint srcY0, GC3Dint srcX1, GC3Dint srcY1, GC3Dint dstX0, GC3Dint dstY0, GC3Dint dstX1, GC3Dint dstY1, GC3Dbitfield mask, GC3Denum filter); void renderbufferStorageMultisampleCHROMIUM(GC3Denum target, GC3Dsizei samples, GC3Denum internalformat, GC3Dsizei width, GC3Dsizei height); + // Latch support + void getParentToChildLatchCHROMIUM(GC3Duint* latchId); + void getChildToParentLatchCHROMIUM(GC3Duint* latchId); + void waitLatchCHROMIUM(GC3Duint latchId); + void setLatchCHROMIUM(GC3Duint latchId); + private: OwnPtr<WebKit::WebGraphicsContext3D> m_impl; OwnPtr<Extensions3DChromium> m_extensions; @@ -291,7 +298,7 @@ private: SkBitmap m_resizingBitmap; #endif -#if PLATFORM(CG) +#if USE(CG) unsigned char* m_renderOutput; #endif diff --git a/Source/WebKit/chromium/src/IDBCallbacksProxy.cpp b/Source/WebKit/chromium/src/IDBCallbacksProxy.cpp index 727092a..c536c38 100644 --- a/Source/WebKit/chromium/src/IDBCallbacksProxy.cpp +++ b/Source/WebKit/chromium/src/IDBCallbacksProxy.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -29,8 +29,10 @@ #include "config.h" #include "IDBCallbacksProxy.h" +#if ENABLE(INDEXED_DATABASE) + +#include "IDBDatabaseBackendProxy.h" #include "IDBDatabaseError.h" -#include "IDBDatabaseProxy.h" #include "WebIDBCallbacks.h" #include "WebIDBCursorImpl.h" #include "WebIDBDatabaseImpl.h" @@ -39,16 +41,16 @@ #include "WebIDBTransactionImpl.h" #include "WebSerializedScriptValue.h" -#if ENABLE(INDEXED_DATABASE) +using namespace WebCore; -namespace WebCore { +namespace WebKit { -PassRefPtr<IDBCallbacksProxy> IDBCallbacksProxy::create(PassOwnPtr<WebKit::WebIDBCallbacks> callbacks) +PassRefPtr<IDBCallbacksProxy> IDBCallbacksProxy::create(PassOwnPtr<WebIDBCallbacks> callbacks) { return adoptRef(new IDBCallbacksProxy(callbacks)); } -IDBCallbacksProxy::IDBCallbacksProxy(PassOwnPtr<WebKit::WebIDBCallbacks> callbacks) +IDBCallbacksProxy::IDBCallbacksProxy(PassOwnPtr<WebIDBCallbacks> callbacks) : m_callbacks(callbacks) { } @@ -59,32 +61,32 @@ IDBCallbacksProxy::~IDBCallbacksProxy() void IDBCallbacksProxy::onError(PassRefPtr<IDBDatabaseError> idbDatabaseError) { - m_callbacks->onError(WebKit::WebIDBDatabaseError(idbDatabaseError)); + m_callbacks->onError(WebIDBDatabaseError(idbDatabaseError)); } void IDBCallbacksProxy::onSuccess(PassRefPtr<IDBCursorBackendInterface> idbCursorBackend) { - m_callbacks->onSuccess(new WebKit::WebIDBCursorImpl(idbCursorBackend)); + m_callbacks->onSuccess(new WebIDBCursorImpl(idbCursorBackend)); } void IDBCallbacksProxy::onSuccess(PassRefPtr<IDBDatabaseBackendInterface> backend) { - m_callbacks->onSuccess(new WebKit::WebIDBDatabaseImpl(backend)); + m_callbacks->onSuccess(new WebIDBDatabaseImpl(backend)); } void IDBCallbacksProxy::onSuccess(PassRefPtr<IDBKey> idbKey) { - m_callbacks->onSuccess(WebKit::WebIDBKey(idbKey)); + m_callbacks->onSuccess(WebIDBKey(idbKey)); } void IDBCallbacksProxy::onSuccess(PassRefPtr<IDBTransactionBackendInterface> backend) { - m_callbacks->onSuccess(new WebKit::WebIDBTransactionImpl(backend)); + m_callbacks->onSuccess(new WebIDBTransactionImpl(backend)); } void IDBCallbacksProxy::onSuccess(PassRefPtr<SerializedScriptValue> serializedScriptValue) { - m_callbacks->onSuccess(WebKit::WebSerializedScriptValue(serializedScriptValue)); + m_callbacks->onSuccess(WebSerializedScriptValue(serializedScriptValue)); } void IDBCallbacksProxy::onBlocked() @@ -92,6 +94,6 @@ void IDBCallbacksProxy::onBlocked() m_callbacks->onBlocked(); } -} // namespace WebCore +} // namespace WebKit #endif // ENABLE(INDEXED_DATABASE) diff --git a/Source/WebKit/chromium/src/IDBCallbacksProxy.h b/Source/WebKit/chromium/src/IDBCallbacksProxy.h index 6829845..e9f45ff 100644 --- a/Source/WebKit/chromium/src/IDBCallbacksProxy.h +++ b/Source/WebKit/chromium/src/IDBCallbacksProxy.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -29,40 +29,37 @@ #ifndef IDBCallbacksProxy_h #define IDBCallbacksProxy_h +#if ENABLE(INDEXED_DATABASE) + #include "IDBCallbacks.h" #include <wtf/PassOwnPtr.h> #include <wtf/PassRefPtr.h> #include <wtf/RefPtr.h> -#if ENABLE(INDEXED_DATABASE) - namespace WebKit { -class WebIDBCallbacks; -} -namespace WebCore { +class WebIDBCallbacks; -class IDBCallbacksProxy : public IDBCallbacks { +class IDBCallbacksProxy : public WebCore::IDBCallbacks { public: - static PassRefPtr<IDBCallbacksProxy> create(PassOwnPtr<WebKit::WebIDBCallbacks>); + static PassRefPtr<IDBCallbacksProxy> create(PassOwnPtr<WebIDBCallbacks>); virtual ~IDBCallbacksProxy(); - virtual void onError(PassRefPtr<IDBDatabaseError>); - virtual void onSuccess(PassRefPtr<IDBCursorBackendInterface>); - virtual void onSuccess(PassRefPtr<IDBDatabaseBackendInterface>); - virtual void onSuccess(PassRefPtr<IDBKey>); - virtual void onSuccess(PassRefPtr<IDBTransactionBackendInterface>); - virtual void onSuccess(PassRefPtr<SerializedScriptValue>); + virtual void onError(PassRefPtr<WebCore::IDBDatabaseError>); + virtual void onSuccess(PassRefPtr<WebCore::IDBCursorBackendInterface>); + virtual void onSuccess(PassRefPtr<WebCore::IDBDatabaseBackendInterface>); + virtual void onSuccess(PassRefPtr<WebCore::IDBKey>); + virtual void onSuccess(PassRefPtr<WebCore::IDBTransactionBackendInterface>); + virtual void onSuccess(PassRefPtr<WebCore::SerializedScriptValue>); virtual void onBlocked(); private: - IDBCallbacksProxy(PassOwnPtr<WebKit::WebIDBCallbacks>); + IDBCallbacksProxy(PassOwnPtr<WebIDBCallbacks>); - OwnPtr<WebKit::WebIDBCallbacks> m_callbacks; + OwnPtr<WebIDBCallbacks> m_callbacks; }; - -} // namespace WebCore +} // namespace WebKit #endif diff --git a/Source/WebKit/chromium/src/IDBCursorBackendProxy.cpp b/Source/WebKit/chromium/src/IDBCursorBackendProxy.cpp index b3b9ea7..7dab6a2 100644 --- a/Source/WebKit/chromium/src/IDBCursorBackendProxy.cpp +++ b/Source/WebKit/chromium/src/IDBCursorBackendProxy.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -36,14 +36,16 @@ #include "WebIDBKey.h" #include "WebSerializedScriptValue.h" -namespace WebCore { +using namespace WebCore; -PassRefPtr<IDBCursorBackendInterface> IDBCursorBackendProxy::create(PassOwnPtr<WebKit::WebIDBCursor> idbCursor) +namespace WebKit { + +PassRefPtr<IDBCursorBackendInterface> IDBCursorBackendProxy::create(PassOwnPtr<WebIDBCursor> idbCursor) { return adoptRef(new IDBCursorBackendProxy(idbCursor)); } -IDBCursorBackendProxy::IDBCursorBackendProxy(PassOwnPtr<WebKit::WebIDBCursor> idbCursor) +IDBCursorBackendProxy::IDBCursorBackendProxy(PassOwnPtr<WebIDBCursor> idbCursor) : m_idbCursor(idbCursor) { } @@ -87,6 +89,6 @@ void IDBCursorBackendProxy::deleteFunction(PassRefPtr<IDBCallbacks> callbacks, E m_idbCursor->deleteFunction(new WebIDBCallbacksImpl(callbacks), ec); } -} // namespace WebCore +} // namespace WebKit #endif // ENABLE(INDEXED_DATABASE) diff --git a/Source/WebKit/chromium/src/IDBCursorBackendProxy.h b/Source/WebKit/chromium/src/IDBCursorBackendProxy.h index 0c2e1c7..d725360 100644 --- a/Source/WebKit/chromium/src/IDBCursorBackendProxy.h +++ b/Source/WebKit/chromium/src/IDBCursorBackendProxy.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -35,28 +35,28 @@ #include <wtf/PassRefPtr.h> #include <wtf/RefPtr.h> -namespace WebCore { +namespace WebKit { -class IDBCursorBackendProxy : public IDBCursorBackendInterface { +class IDBCursorBackendProxy : public WebCore::IDBCursorBackendInterface { public: - static PassRefPtr<IDBCursorBackendInterface> create(PassOwnPtr<WebKit::WebIDBCursor>); + static PassRefPtr<WebCore::IDBCursorBackendInterface> create(PassOwnPtr<WebIDBCursor>); virtual ~IDBCursorBackendProxy(); virtual unsigned short direction() const; - virtual PassRefPtr<IDBKey> key() const; - virtual PassRefPtr<IDBKey> primaryKey() const; - virtual PassRefPtr<SerializedScriptValue> value() const; - virtual void update(PassRefPtr<SerializedScriptValue>, PassRefPtr<IDBCallbacks>, ExceptionCode&); - virtual void continueFunction(PassRefPtr<IDBKey>, PassRefPtr<IDBCallbacks>, ExceptionCode&); - virtual void deleteFunction(PassRefPtr<IDBCallbacks>, ExceptionCode&); + virtual PassRefPtr<WebCore::IDBKey> key() const; + virtual PassRefPtr<WebCore::IDBKey> primaryKey() const; + virtual PassRefPtr<WebCore::SerializedScriptValue> value() const; + virtual void update(PassRefPtr<WebCore::SerializedScriptValue>, PassRefPtr<WebCore::IDBCallbacks>, WebCore::ExceptionCode&); + virtual void continueFunction(PassRefPtr<WebCore::IDBKey>, PassRefPtr<WebCore::IDBCallbacks>, WebCore::ExceptionCode&); + virtual void deleteFunction(PassRefPtr<WebCore::IDBCallbacks>, WebCore::ExceptionCode&); private: - IDBCursorBackendProxy(PassOwnPtr<WebKit::WebIDBCursor>); + IDBCursorBackendProxy(PassOwnPtr<WebIDBCursor>); - OwnPtr<WebKit::WebIDBCursor> m_idbCursor; + OwnPtr<WebIDBCursor> m_idbCursor; }; -} // namespace WebCore +} // namespace WebKit #endif diff --git a/Source/WebKit/chromium/src/IDBDatabaseProxy.cpp b/Source/WebKit/chromium/src/IDBDatabaseBackendProxy.cpp index 7fe7378..7e5ecc3 100644 --- a/Source/WebKit/chromium/src/IDBDatabaseProxy.cpp +++ b/Source/WebKit/chromium/src/IDBDatabaseBackendProxy.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -24,12 +24,14 @@ */ #include "config.h" -#include "IDBDatabaseProxy.h" +#include "IDBDatabaseBackendProxy.h" + +#if ENABLE(INDEXED_DATABASE) #include "DOMStringList.h" #include "IDBCallbacks.h" #include "IDBDatabaseCallbacks.h" -#include "IDBObjectStoreProxy.h" +#include "IDBObjectStoreBackendProxy.h" #include "IDBTransactionBackendProxy.h" #include "WebDOMStringList.h" #include "WebFrameImpl.h" @@ -40,51 +42,51 @@ #include "WebIDBObjectStore.h" #include "WebIDBTransaction.h" -#if ENABLE(INDEXED_DATABASE) +using namespace WebCore; -namespace WebCore { +namespace WebKit { -PassRefPtr<IDBDatabaseBackendInterface> IDBDatabaseProxy::create(PassOwnPtr<WebKit::WebIDBDatabase> database) +PassRefPtr<IDBDatabaseBackendInterface> IDBDatabaseBackendProxy::create(PassOwnPtr<WebIDBDatabase> database) { - return adoptRef(new IDBDatabaseProxy(database)); + return adoptRef(new IDBDatabaseBackendProxy(database)); } -IDBDatabaseProxy::IDBDatabaseProxy(PassOwnPtr<WebKit::WebIDBDatabase> database) +IDBDatabaseBackendProxy::IDBDatabaseBackendProxy(PassOwnPtr<WebIDBDatabase> database) : m_webIDBDatabase(database) { } -IDBDatabaseProxy::~IDBDatabaseProxy() +IDBDatabaseBackendProxy::~IDBDatabaseBackendProxy() { } -String IDBDatabaseProxy::name() const +String IDBDatabaseBackendProxy::name() const { return m_webIDBDatabase->name(); } -String IDBDatabaseProxy::version() const +String IDBDatabaseBackendProxy::version() const { return m_webIDBDatabase->version(); } -PassRefPtr<DOMStringList> IDBDatabaseProxy::objectStoreNames() const +PassRefPtr<DOMStringList> IDBDatabaseBackendProxy::objectStoreNames() const { return m_webIDBDatabase->objectStoreNames(); } -PassRefPtr<IDBObjectStoreBackendInterface> IDBDatabaseProxy::createObjectStore(const String& name, const String& keyPath, bool autoIncrement, IDBTransactionBackendInterface* transaction, ExceptionCode& ec) +PassRefPtr<IDBObjectStoreBackendInterface> IDBDatabaseBackendProxy::createObjectStore(const String& name, const String& keyPath, bool autoIncrement, IDBTransactionBackendInterface* transaction, ExceptionCode& ec) { // The transaction pointer is guaranteed to be a pointer to a proxy object as, in the renderer, // all implementations of IDB interfaces are proxy objects. IDBTransactionBackendProxy* transactionProxy = static_cast<IDBTransactionBackendProxy*>(transaction); - WebKit::WebIDBObjectStore* objectStore = m_webIDBDatabase->createObjectStore(name, keyPath, autoIncrement, *transactionProxy->getWebIDBTransaction(), ec); + WebIDBObjectStore* objectStore = m_webIDBDatabase->createObjectStore(name, keyPath, autoIncrement, *transactionProxy->getWebIDBTransaction(), ec); if (!objectStore) return 0; - return IDBObjectStoreProxy::create(objectStore); + return IDBObjectStoreBackendProxy::create(objectStore); } -void IDBDatabaseProxy::deleteObjectStore(const String& name, IDBTransactionBackendInterface* transaction, ExceptionCode& ec) +void IDBDatabaseBackendProxy::deleteObjectStore(const String& name, IDBTransactionBackendInterface* transaction, ExceptionCode& ec) { // The transaction pointer is guaranteed to be a pointer to a proxy object as, in the renderer, // all implementations of IDB interfaces are proxy objects. @@ -92,15 +94,15 @@ void IDBDatabaseProxy::deleteObjectStore(const String& name, IDBTransactionBacke m_webIDBDatabase->deleteObjectStore(name, *transactionProxy->getWebIDBTransaction(), ec); } -void IDBDatabaseProxy::setVersion(const String& version, PassRefPtr<IDBCallbacks> callbacks, PassRefPtr<IDBDatabaseCallbacks> databaseCallbacks, ExceptionCode& ec) +void IDBDatabaseBackendProxy::setVersion(const String& version, PassRefPtr<IDBCallbacks> callbacks, PassRefPtr<IDBDatabaseCallbacks> databaseCallbacks, ExceptionCode& ec) { m_webIDBDatabase->setVersion(version, new WebIDBCallbacksImpl(callbacks), ec); } -PassRefPtr<IDBTransactionBackendInterface> IDBDatabaseProxy::transaction(DOMStringList* storeNames, unsigned short mode, ExceptionCode& ec) +PassRefPtr<IDBTransactionBackendInterface> IDBDatabaseBackendProxy::transaction(DOMStringList* storeNames, unsigned short mode, ExceptionCode& ec) { - WebKit::WebDOMStringList names(storeNames); - WebKit::WebIDBTransaction* transaction = m_webIDBDatabase->transaction(names, mode, ec); + WebDOMStringList names(storeNames); + WebIDBTransaction* transaction = m_webIDBDatabase->transaction(names, mode, ec); if (!transaction) { ASSERT(ec); return 0; @@ -108,16 +110,16 @@ PassRefPtr<IDBTransactionBackendInterface> IDBDatabaseProxy::transaction(DOMStri return IDBTransactionBackendProxy::create(transaction); } -void IDBDatabaseProxy::close(PassRefPtr<IDBDatabaseCallbacks>) +void IDBDatabaseBackendProxy::close(PassRefPtr<IDBDatabaseCallbacks>) { m_webIDBDatabase->close(); } -void IDBDatabaseProxy::open(PassRefPtr<IDBDatabaseCallbacks> databaseCallbacks) +void IDBDatabaseBackendProxy::open(PassRefPtr<IDBDatabaseCallbacks> databaseCallbacks) { m_webIDBDatabase->open(new WebIDBDatabaseCallbacksImpl(databaseCallbacks)); } -} // namespace WebCore +} // namespace WebKit #endif // ENABLE(INDEXED_DATABASE) diff --git a/Source/WebKit/chromium/src/IDBDatabaseProxy.h b/Source/WebKit/chromium/src/IDBDatabaseBackendProxy.h index c3e8346..5a5baf2 100644 --- a/Source/WebKit/chromium/src/IDBDatabaseProxy.h +++ b/Source/WebKit/chromium/src/IDBDatabaseBackendProxy.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -23,45 +23,45 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef IDBDatabaseProxy_h -#define IDBDatabaseProxy_h +#ifndef IDBDatabaseBackendProxy_h +#define IDBDatabaseBackendProxy_h + +#if ENABLE(INDEXED_DATABASE) #include "IDBDatabaseBackendInterface.h" #include <wtf/OwnPtr.h> #include <wtf/PassOwnPtr.h> #include <wtf/PassRefPtr.h> -#if ENABLE(INDEXED_DATABASE) - -namespace WebKit { class WebIDBDatabase; } +namespace WebKit { -namespace WebCore { +class WebIDBDatabase; -class IDBDatabaseProxy : public IDBDatabaseBackendInterface { +class IDBDatabaseBackendProxy : public WebCore::IDBDatabaseBackendInterface { public: - static PassRefPtr<IDBDatabaseBackendInterface> create(PassOwnPtr<WebKit::WebIDBDatabase>); - virtual ~IDBDatabaseProxy(); + static PassRefPtr<WebCore::IDBDatabaseBackendInterface> create(PassOwnPtr<WebIDBDatabase>); + virtual ~IDBDatabaseBackendProxy(); virtual String name() const; virtual String version() const; - virtual PassRefPtr<DOMStringList> objectStoreNames() const; + virtual PassRefPtr<WebCore::DOMStringList> objectStoreNames() const; - virtual PassRefPtr<IDBObjectStoreBackendInterface> createObjectStore(const String& name, const String& keyPath, bool autoIncrement, IDBTransactionBackendInterface*, ExceptionCode&); - virtual void deleteObjectStore(const String& name, IDBTransactionBackendInterface*, ExceptionCode&); - virtual void setVersion(const String& version, PassRefPtr<IDBCallbacks>, PassRefPtr<IDBDatabaseCallbacks>, ExceptionCode&); - virtual PassRefPtr<IDBTransactionBackendInterface> transaction(DOMStringList* storeNames, unsigned short mode, ExceptionCode&); - virtual void close(PassRefPtr<IDBDatabaseCallbacks>); + virtual PassRefPtr<WebCore::IDBObjectStoreBackendInterface> createObjectStore(const String& name, const String& keyPath, bool autoIncrement, WebCore::IDBTransactionBackendInterface*, WebCore::ExceptionCode&); + virtual void deleteObjectStore(const String& name, WebCore::IDBTransactionBackendInterface*, WebCore::ExceptionCode&); + virtual void setVersion(const String& version, PassRefPtr<WebCore::IDBCallbacks>, PassRefPtr<WebCore::IDBDatabaseCallbacks>, WebCore::ExceptionCode&); + virtual PassRefPtr<WebCore::IDBTransactionBackendInterface> transaction(WebCore::DOMStringList* storeNames, unsigned short mode, WebCore::ExceptionCode&); + virtual void close(PassRefPtr<WebCore::IDBDatabaseCallbacks>); - virtual void open(PassRefPtr<IDBDatabaseCallbacks>); + virtual void open(PassRefPtr<WebCore::IDBDatabaseCallbacks>); private: - IDBDatabaseProxy(PassOwnPtr<WebKit::WebIDBDatabase>); + IDBDatabaseBackendProxy(PassOwnPtr<WebIDBDatabase>); - OwnPtr<WebKit::WebIDBDatabase> m_webIDBDatabase; + OwnPtr<WebIDBDatabase> m_webIDBDatabase; }; -} // namespace WebCore +} // namespace WebKit #endif -#endif // IDBDatabaseProxy_h +#endif // IDBDatabaseBackendProxy_h diff --git a/Source/WebKit/chromium/src/IDBDatabaseCallbacksProxy.cpp b/Source/WebKit/chromium/src/IDBDatabaseCallbacksProxy.cpp index 28c134f..816faf6 100644 --- a/Source/WebKit/chromium/src/IDBDatabaseCallbacksProxy.cpp +++ b/Source/WebKit/chromium/src/IDBDatabaseCallbacksProxy.cpp @@ -30,14 +30,16 @@ #include "WebIDBDatabaseCallbacks.h" -namespace WebCore { +using namespace WebCore; -PassRefPtr<IDBDatabaseCallbacksProxy> IDBDatabaseCallbacksProxy::create(PassOwnPtr<WebKit::WebIDBDatabaseCallbacks> callbacks) +namespace WebKit { + +PassRefPtr<IDBDatabaseCallbacksProxy> IDBDatabaseCallbacksProxy::create(PassOwnPtr<WebIDBDatabaseCallbacks> callbacks) { return adoptRef(new IDBDatabaseCallbacksProxy(callbacks)); } -IDBDatabaseCallbacksProxy::IDBDatabaseCallbacksProxy(PassOwnPtr<WebKit::WebIDBDatabaseCallbacks> callbacks) +IDBDatabaseCallbacksProxy::IDBDatabaseCallbacksProxy(PassOwnPtr<WebIDBDatabaseCallbacks> callbacks) : m_callbacks(callbacks) { } @@ -51,6 +53,6 @@ void IDBDatabaseCallbacksProxy::onVersionChange(const String& requestedVersion) m_callbacks->onVersionChange(requestedVersion); } -} // namespace WebCore +} // namespace WebKit #endif // ENABLE(INDEXED_DATABASE) diff --git a/Source/WebKit/chromium/src/IDBDatabaseCallbacksProxy.h b/Source/WebKit/chromium/src/IDBDatabaseCallbacksProxy.h index 9fd7a0b..affdce7 100644 --- a/Source/WebKit/chromium/src/IDBDatabaseCallbacksProxy.h +++ b/Source/WebKit/chromium/src/IDBDatabaseCallbacksProxy.h @@ -26,30 +26,29 @@ #ifndef IDBDatabaseCallbacksProxy_h #define IDBDatabaseCallbacksProxy_h -#include "IDBDatabaseCallbacks.h" - #if ENABLE(INDEXED_DATABASE) +#include "IDBDatabaseCallbacks.h" #include <wtf/PassOwnPtr.h> -namespace WebKit { class WebIDBDatabaseCallbacks; } +namespace WebKit { -namespace WebCore { +class WebIDBDatabaseCallbacks; -class IDBDatabaseCallbacksProxy : public IDBDatabaseCallbacks { +class IDBDatabaseCallbacksProxy : public WebCore::IDBDatabaseCallbacks { public: - static PassRefPtr<IDBDatabaseCallbacksProxy> create(PassOwnPtr<WebKit::WebIDBDatabaseCallbacks>); + static PassRefPtr<IDBDatabaseCallbacksProxy> create(PassOwnPtr<WebIDBDatabaseCallbacks>); virtual ~IDBDatabaseCallbacksProxy(); virtual void onVersionChange(const String& requestedVersion); private: - IDBDatabaseCallbacksProxy(PassOwnPtr<WebKit::WebIDBDatabaseCallbacks>); + IDBDatabaseCallbacksProxy(PassOwnPtr<WebIDBDatabaseCallbacks>); - OwnPtr<WebKit::WebIDBDatabaseCallbacks> m_callbacks; + OwnPtr<WebIDBDatabaseCallbacks> m_callbacks; }; -} // namespace WebCore +} // namespace WebKit #endif diff --git a/Source/WebKit/chromium/src/IDBFactoryBackendProxy.cpp b/Source/WebKit/chromium/src/IDBFactoryBackendProxy.cpp index 9e5ccc0..1824eb8 100755 --- a/Source/WebKit/chromium/src/IDBFactoryBackendProxy.cpp +++ b/Source/WebKit/chromium/src/IDBFactoryBackendProxy.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -29,9 +29,11 @@ #include "config.h" #include "IDBFactoryBackendProxy.h" +#if ENABLE(INDEXED_DATABASE) + #include "DOMStringList.h" +#include "IDBDatabaseBackendProxy.h" #include "IDBDatabaseError.h" -#include "IDBDatabaseProxy.h" #include "WebFrameImpl.h" #include "WebIDBCallbacksImpl.h" #include "WebIDBDatabase.h" @@ -41,9 +43,9 @@ #include "WebKitClient.h" #include "WebVector.h" -#if ENABLE(INDEXED_DATABASE) +using namespace WebCore; -namespace WebCore { +namespace WebKit { PassRefPtr<IDBFactoryBackendInterface> IDBFactoryBackendProxy::create() { @@ -51,7 +53,7 @@ PassRefPtr<IDBFactoryBackendInterface> IDBFactoryBackendProxy::create() } IDBFactoryBackendProxy::IDBFactoryBackendProxy() - : m_webIDBFactory(WebKit::webKitClient()->idbFactory()) + : m_webIDBFactory(webKitClient()->idbFactory()) { } @@ -61,10 +63,10 @@ IDBFactoryBackendProxy::~IDBFactoryBackendProxy() void IDBFactoryBackendProxy::open(const String& name, PassRefPtr<IDBCallbacks> callbacks, PassRefPtr<SecurityOrigin> origin, Frame* frame, const String& dataDir, int64_t maximumSize, BackingStoreType backingStoreType) { - WebKit::WebFrame* webFrame = WebKit::WebFrameImpl::fromFrame(frame); - m_webIDBFactory->open(name, new WebIDBCallbacksImpl(callbacks), origin, webFrame, dataDir, maximumSize, static_cast<WebKit::WebIDBFactory::BackingStoreType>(backingStoreType)); + WebFrame* webFrame = WebFrameImpl::fromFrame(frame); + m_webIDBFactory->open(name, new WebIDBCallbacksImpl(callbacks), origin, webFrame, dataDir, maximumSize, static_cast<WebIDBFactory::BackingStoreType>(backingStoreType)); } -} // namespace WebCore +} // namespace WebKit #endif // ENABLE(INDEXED_DATABASE) diff --git a/Source/WebKit/chromium/src/IDBFactoryBackendProxy.h b/Source/WebKit/chromium/src/IDBFactoryBackendProxy.h index 593051e..89ed355 100755 --- a/Source/WebKit/chromium/src/IDBFactoryBackendProxy.h +++ b/Source/WebKit/chromium/src/IDBFactoryBackendProxy.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -29,32 +29,32 @@ #ifndef IDBFactoryBackendProxy_h #define IDBFactoryBackendProxy_h -#include "IDBFactoryBackendInterface.h" - #if ENABLE(INDEXED_DATABASE) -namespace WebKit { class WebIDBFactory; } +#include "IDBFactoryBackendInterface.h" + +namespace WebCore { class DOMStringList; } -namespace WebCore { +namespace WebKit { -class DOMStringList; +class WebIDBFactory; -class IDBFactoryBackendProxy : public IDBFactoryBackendInterface { +class IDBFactoryBackendProxy : public WebCore::IDBFactoryBackendInterface { public: - static PassRefPtr<IDBFactoryBackendInterface> create(); + static PassRefPtr<WebCore::IDBFactoryBackendInterface> create(); virtual ~IDBFactoryBackendProxy(); - PassRefPtr<DOMStringList> databases(void) const; - virtual void open(const String& name, PassRefPtr<IDBCallbacks>, PassRefPtr<SecurityOrigin>, Frame*, const String& dataDir, int64_t maximumSize, BackingStoreType); + PassRefPtr<WebCore::DOMStringList> databases(void) const; + virtual void open(const String& name, PassRefPtr<WebCore::IDBCallbacks>, PassRefPtr<WebCore::SecurityOrigin>, WebCore::Frame*, const String& dataDir, int64_t maximumSize, BackingStoreType); private: IDBFactoryBackendProxy(); // We don't own this pointer (unlike all the other proxy classes which do). - WebKit::WebIDBFactory* m_webIDBFactory; + WebIDBFactory* m_webIDBFactory; }; -} // namespace WebCore +} // namespace WebKit #endif diff --git a/Source/WebKit/chromium/src/IDBIndexBackendProxy.cpp b/Source/WebKit/chromium/src/IDBIndexBackendProxy.cpp index 410750e..556c9b6 100644 --- a/Source/WebKit/chromium/src/IDBIndexBackendProxy.cpp +++ b/Source/WebKit/chromium/src/IDBIndexBackendProxy.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -37,14 +37,16 @@ #include "WebIDBKey.h" #include "WebIDBKeyRange.h" -namespace WebCore { +using namespace WebCore; -PassRefPtr<IDBIndexBackendInterface> IDBIndexBackendProxy::create(PassOwnPtr<WebKit::WebIDBIndex> index) +namespace WebKit { + +PassRefPtr<IDBIndexBackendInterface> IDBIndexBackendProxy::create(PassOwnPtr<WebIDBIndex> index) { return adoptRef(new IDBIndexBackendProxy(index)); } -IDBIndexBackendProxy::IDBIndexBackendProxy(PassOwnPtr<WebKit::WebIDBIndex> index) +IDBIndexBackendProxy::IDBIndexBackendProxy(PassOwnPtr<WebIDBIndex> index) : m_webIDBIndex(index) { } @@ -105,6 +107,6 @@ void IDBIndexBackendProxy::getKey(PassRefPtr<IDBKey> key, PassRefPtr<IDBCallback m_webIDBIndex->getKey(key, new WebIDBCallbacksImpl(callbacks), *transactionProxy->getWebIDBTransaction(), ec); } -} // namespace WebCore +} // namespace WebKit #endif // ENABLE(INDEXED_DATABASE) diff --git a/Source/WebKit/chromium/src/IDBIndexBackendProxy.h b/Source/WebKit/chromium/src/IDBIndexBackendProxy.h index e9de05a..b63640f 100644 --- a/Source/WebKit/chromium/src/IDBIndexBackendProxy.h +++ b/Source/WebKit/chromium/src/IDBIndexBackendProxy.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -26,19 +26,19 @@ #ifndef IDBIndexBackendProxy_h #define IDBIndexBackendProxy_h +#if ENABLE(INDEXED_DATABASE) + #include "IDBIndexBackendInterface.h" #include <wtf/OwnPtr.h> #include <wtf/PassOwnPtr.h> -#if ENABLE(INDEXED_DATABASE) - -namespace WebKit { class WebIDBIndex; } +namespace WebKit { -namespace WebCore { +class WebIDBIndex; -class IDBIndexBackendProxy : public IDBIndexBackendInterface { +class IDBIndexBackendProxy : public WebCore::IDBIndexBackendInterface { public: - static PassRefPtr<IDBIndexBackendInterface> create(PassOwnPtr<WebKit::WebIDBIndex>); + static PassRefPtr<IDBIndexBackendInterface> create(PassOwnPtr<WebIDBIndex>); virtual ~IDBIndexBackendProxy(); virtual String name(); @@ -46,18 +46,18 @@ public: virtual String keyPath(); virtual bool unique(); - virtual void openCursor(PassRefPtr<IDBKeyRange>, unsigned short direction, PassRefPtr<IDBCallbacks>, IDBTransactionBackendInterface*, ExceptionCode&); - virtual void openKeyCursor(PassRefPtr<IDBKeyRange>, unsigned short direction, PassRefPtr<IDBCallbacks>, IDBTransactionBackendInterface*, ExceptionCode&); - virtual void get(PassRefPtr<IDBKey>, PassRefPtr<IDBCallbacks>, IDBTransactionBackendInterface*, ExceptionCode&); - virtual void getKey(PassRefPtr<IDBKey>, PassRefPtr<IDBCallbacks>, IDBTransactionBackendInterface*, ExceptionCode&); + virtual void openCursor(PassRefPtr<WebCore::IDBKeyRange>, unsigned short direction, PassRefPtr<WebCore::IDBCallbacks>, WebCore::IDBTransactionBackendInterface*, WebCore::ExceptionCode&); + virtual void openKeyCursor(PassRefPtr<WebCore::IDBKeyRange>, unsigned short direction, PassRefPtr<WebCore::IDBCallbacks>, WebCore::IDBTransactionBackendInterface*, WebCore::ExceptionCode&); + virtual void get(PassRefPtr<WebCore::IDBKey>, PassRefPtr<WebCore::IDBCallbacks>, WebCore::IDBTransactionBackendInterface*, WebCore::ExceptionCode&); + virtual void getKey(PassRefPtr<WebCore::IDBKey>, PassRefPtr<WebCore::IDBCallbacks>, WebCore::IDBTransactionBackendInterface*, WebCore::ExceptionCode&); private: - IDBIndexBackendProxy(PassOwnPtr<WebKit::WebIDBIndex>); + IDBIndexBackendProxy(PassOwnPtr<WebIDBIndex>); - OwnPtr<WebKit::WebIDBIndex> m_webIDBIndex; + OwnPtr<WebIDBIndex> m_webIDBIndex; }; -} // namespace WebCore +} // namespace WebKit #endif diff --git a/Source/WebKit/chromium/src/IDBObjectStoreProxy.cpp b/Source/WebKit/chromium/src/IDBObjectStoreBackendProxy.cpp index d6871e0..2a0e075 100755 --- a/Source/WebKit/chromium/src/IDBObjectStoreProxy.cpp +++ b/Source/WebKit/chromium/src/IDBObjectStoreBackendProxy.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -24,7 +24,9 @@ */ #include "config.h" -#include "IDBObjectStoreProxy.h" +#include "IDBObjectStoreBackendProxy.h" + +#if ENABLE(INDEXED_DATABASE) #include "DOMStringList.h" #include "IDBCallbacks.h" @@ -39,40 +41,40 @@ #include "WebIDBTransactionImpl.h" #include "WebSerializedScriptValue.h" -#if ENABLE(INDEXED_DATABASE) +using namespace WebCore; -namespace WebCore { +namespace WebKit { -PassRefPtr<IDBObjectStoreBackendInterface> IDBObjectStoreProxy::create(PassOwnPtr<WebKit::WebIDBObjectStore> objectStore) +PassRefPtr<IDBObjectStoreBackendInterface> IDBObjectStoreBackendProxy::create(PassOwnPtr<WebIDBObjectStore> objectStore) { - return adoptRef(new IDBObjectStoreProxy(objectStore)); + return adoptRef(new IDBObjectStoreBackendProxy(objectStore)); } -IDBObjectStoreProxy::IDBObjectStoreProxy(PassOwnPtr<WebKit::WebIDBObjectStore> objectStore) +IDBObjectStoreBackendProxy::IDBObjectStoreBackendProxy(PassOwnPtr<WebIDBObjectStore> objectStore) : m_webIDBObjectStore(objectStore) { } -IDBObjectStoreProxy::~IDBObjectStoreProxy() +IDBObjectStoreBackendProxy::~IDBObjectStoreBackendProxy() { } -String IDBObjectStoreProxy::name() const +String IDBObjectStoreBackendProxy::name() const { return m_webIDBObjectStore->name(); } -String IDBObjectStoreProxy::keyPath() const +String IDBObjectStoreBackendProxy::keyPath() const { return m_webIDBObjectStore->keyPath(); } -PassRefPtr<DOMStringList> IDBObjectStoreProxy::indexNames() const +PassRefPtr<DOMStringList> IDBObjectStoreBackendProxy::indexNames() const { return m_webIDBObjectStore->indexNames(); } -void IDBObjectStoreProxy::get(PassRefPtr<IDBKey> key, PassRefPtr<IDBCallbacks> callbacks, IDBTransactionBackendInterface* transaction, ExceptionCode& ec) +void IDBObjectStoreBackendProxy::get(PassRefPtr<IDBKey> key, PassRefPtr<IDBCallbacks> callbacks, IDBTransactionBackendInterface* transaction, ExceptionCode& ec) { // The transaction pointer is guaranteed to be a pointer to a proxy object as, in the renderer, // all implementations of IDB interfaces are proxy objects. @@ -80,15 +82,15 @@ void IDBObjectStoreProxy::get(PassRefPtr<IDBKey> key, PassRefPtr<IDBCallbacks> c m_webIDBObjectStore->get(key, new WebIDBCallbacksImpl(callbacks), *transactionProxy->getWebIDBTransaction(), ec); } -void IDBObjectStoreProxy::put(PassRefPtr<SerializedScriptValue> value, PassRefPtr<IDBKey> key, PutMode putMode, PassRefPtr<IDBCallbacks> callbacks, IDBTransactionBackendInterface* transaction, ExceptionCode& ec) +void IDBObjectStoreBackendProxy::put(PassRefPtr<SerializedScriptValue> value, PassRefPtr<IDBKey> key, PutMode putMode, PassRefPtr<IDBCallbacks> callbacks, IDBTransactionBackendInterface* transaction, ExceptionCode& ec) { // The transaction pointer is guaranteed to be a pointer to a proxy object as, in the renderer, // all implementations of IDB interfaces are proxy objects. IDBTransactionBackendProxy* transactionProxy = static_cast<IDBTransactionBackendProxy*>(transaction); - m_webIDBObjectStore->put(value, key, static_cast<WebKit::WebIDBObjectStore::PutMode>(putMode), new WebIDBCallbacksImpl(callbacks), *transactionProxy->getWebIDBTransaction(), ec); + m_webIDBObjectStore->put(value, key, static_cast<WebIDBObjectStore::PutMode>(putMode), new WebIDBCallbacksImpl(callbacks), *transactionProxy->getWebIDBTransaction(), ec); } -void IDBObjectStoreProxy::deleteFunction(PassRefPtr<IDBKey> key, PassRefPtr<IDBCallbacks> callbacks, IDBTransactionBackendInterface* transaction, ExceptionCode& ec) +void IDBObjectStoreBackendProxy::deleteFunction(PassRefPtr<IDBKey> key, PassRefPtr<IDBCallbacks> callbacks, IDBTransactionBackendInterface* transaction, ExceptionCode& ec) { // The transaction pointer is guaranteed to be a pointer to a proxy object as, in the renderer, // all implementations of IDB interfaces are proxy objects. @@ -96,7 +98,7 @@ void IDBObjectStoreProxy::deleteFunction(PassRefPtr<IDBKey> key, PassRefPtr<IDBC m_webIDBObjectStore->deleteFunction(key, new WebIDBCallbacksImpl(callbacks), *transactionProxy->getWebIDBTransaction(), ec); } -void IDBObjectStoreProxy::clear(PassRefPtr<IDBCallbacks> callbacks, IDBTransactionBackendInterface* transaction, ExceptionCode& ec) +void IDBObjectStoreBackendProxy::clear(PassRefPtr<IDBCallbacks> callbacks, IDBTransactionBackendInterface* transaction, ExceptionCode& ec) { // The transaction pointer is guaranteed to be a pointer to a proxy object as, in the renderer, // all implementations of IDB interfaces are proxy objects. @@ -104,26 +106,26 @@ void IDBObjectStoreProxy::clear(PassRefPtr<IDBCallbacks> callbacks, IDBTransacti m_webIDBObjectStore->clear(new WebIDBCallbacksImpl(callbacks), *transactionProxy->getWebIDBTransaction(), ec); } -PassRefPtr<IDBIndexBackendInterface> IDBObjectStoreProxy::createIndex(const String& name, const String& keyPath, bool unique, IDBTransactionBackendInterface* transaction, ExceptionCode& ec) +PassRefPtr<IDBIndexBackendInterface> IDBObjectStoreBackendProxy::createIndex(const String& name, const String& keyPath, bool unique, IDBTransactionBackendInterface* transaction, ExceptionCode& ec) { // The transaction pointer is guaranteed to be a pointer to a proxy object as, in the renderer, // all implementations of IDB interfaces are proxy objects. IDBTransactionBackendProxy* transactionProxy = static_cast<IDBTransactionBackendProxy*>(transaction); - WebKit::WebIDBIndex* index = m_webIDBObjectStore->createIndex(name, keyPath, unique, *transactionProxy->getWebIDBTransaction(), ec); + WebIDBIndex* index = m_webIDBObjectStore->createIndex(name, keyPath, unique, *transactionProxy->getWebIDBTransaction(), ec); if (!index) return 0; return IDBIndexBackendProxy::create(index); } -PassRefPtr<IDBIndexBackendInterface> IDBObjectStoreProxy::index(const String& name, ExceptionCode& ec) +PassRefPtr<IDBIndexBackendInterface> IDBObjectStoreBackendProxy::index(const String& name, ExceptionCode& ec) { - WebKit::WebIDBIndex* index = m_webIDBObjectStore->index(name, ec); + WebIDBIndex* index = m_webIDBObjectStore->index(name, ec); if (!index) return 0; return IDBIndexBackendProxy::create(index); } -void IDBObjectStoreProxy::deleteIndex(const String& name, IDBTransactionBackendInterface* transaction, ExceptionCode& ec) +void IDBObjectStoreBackendProxy::deleteIndex(const String& name, IDBTransactionBackendInterface* transaction, ExceptionCode& ec) { // The transaction pointer is guaranteed to be a pointer to a proxy object as, in the renderer, // all implementations of IDB interfaces are proxy objects. @@ -131,7 +133,7 @@ void IDBObjectStoreProxy::deleteIndex(const String& name, IDBTransactionBackendI m_webIDBObjectStore->deleteIndex(name, *transactionProxy->getWebIDBTransaction(), ec); } -void IDBObjectStoreProxy::openCursor(PassRefPtr<IDBKeyRange> range, unsigned short direction, PassRefPtr<IDBCallbacks> callbacks, IDBTransactionBackendInterface* transaction, ExceptionCode& ec) +void IDBObjectStoreBackendProxy::openCursor(PassRefPtr<IDBKeyRange> range, unsigned short direction, PassRefPtr<IDBCallbacks> callbacks, IDBTransactionBackendInterface* transaction, ExceptionCode& ec) { // The transaction pointer is guaranteed to be a pointer to a proxy object as, in the renderer, // all implementations of IDB interfaces are proxy objects. @@ -139,6 +141,6 @@ void IDBObjectStoreProxy::openCursor(PassRefPtr<IDBKeyRange> range, unsigned sho m_webIDBObjectStore->openCursor(range, direction, new WebIDBCallbacksImpl(callbacks), *transactionProxy->getWebIDBTransaction(), ec); } -} // namespace WebCore +} // namespace WebKit #endif // ENABLE(INDEXED_DATABASE) diff --git a/Source/WebKit/chromium/src/IDBObjectStoreBackendProxy.h b/Source/WebKit/chromium/src/IDBObjectStoreBackendProxy.h new file mode 100755 index 0000000..cb0ee32 --- /dev/null +++ b/Source/WebKit/chromium/src/IDBObjectStoreBackendProxy.h @@ -0,0 +1,70 @@ +/* + * Copyright (C) 2011 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. + * + * 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. + */ + +#ifndef IDBObjectStoreBackendProxy_h +#define IDBObjectStoreBackendProxy_h + +#if ENABLE(INDEXED_DATABASE) + +#include "IDBObjectStoreBackendInterface.h" +#include <wtf/OwnPtr.h> +#include <wtf/PassOwnPtr.h> +#include <wtf/PassRefPtr.h> + +namespace WebKit { + +class WebIDBObjectStore; + +class IDBObjectStoreBackendProxy : public WebCore::IDBObjectStoreBackendInterface { +public: + static PassRefPtr<WebCore::IDBObjectStoreBackendInterface> create(PassOwnPtr<WebIDBObjectStore>); + virtual ~IDBObjectStoreBackendProxy(); + + virtual String name() const; + virtual String keyPath() const; + virtual PassRefPtr<WebCore::DOMStringList> indexNames() const; + + virtual void get(PassRefPtr<WebCore::IDBKey>, PassRefPtr<WebCore::IDBCallbacks>, WebCore::IDBTransactionBackendInterface*, WebCore::ExceptionCode&); + virtual void put(PassRefPtr<WebCore::SerializedScriptValue>, PassRefPtr<WebCore::IDBKey>, PutMode, PassRefPtr<WebCore::IDBCallbacks>, WebCore::IDBTransactionBackendInterface*, WebCore::ExceptionCode&); + virtual void deleteFunction(PassRefPtr<WebCore::IDBKey>, PassRefPtr<WebCore::IDBCallbacks>, WebCore::IDBTransactionBackendInterface*, WebCore::ExceptionCode&); + virtual void clear(PassRefPtr<WebCore::IDBCallbacks>, WebCore::IDBTransactionBackendInterface*, WebCore::ExceptionCode&); + + PassRefPtr<WebCore::IDBIndexBackendInterface> createIndex(const String& name, const String& keyPath, bool unique, WebCore::IDBTransactionBackendInterface*, WebCore::ExceptionCode&); + PassRefPtr<WebCore::IDBIndexBackendInterface> index(const String& name, WebCore::ExceptionCode&); + void deleteIndex(const String& name, WebCore::IDBTransactionBackendInterface*, WebCore::ExceptionCode&); + + virtual void openCursor(PassRefPtr<WebCore::IDBKeyRange>, unsigned short direction, PassRefPtr<WebCore::IDBCallbacks>, WebCore::IDBTransactionBackendInterface*, WebCore::ExceptionCode&); + +private: + IDBObjectStoreBackendProxy(PassOwnPtr<WebIDBObjectStore>); + + OwnPtr<WebIDBObjectStore> m_webIDBObjectStore; +}; + +} // namespace WebKit + +#endif + +#endif // IDBObjectStoreBackendProxy_h diff --git a/Source/WebKit/chromium/src/IDBObjectStoreProxy.h b/Source/WebKit/chromium/src/IDBObjectStoreProxy.h deleted file mode 100755 index a6e3748..0000000 --- a/Source/WebKit/chromium/src/IDBObjectStoreProxy.h +++ /dev/null @@ -1,70 +0,0 @@ -/* - * 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. - * - * 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. - */ - -#ifndef IDBObjectStoreProxy_h -#define IDBObjectStoreProxy_h - -#include "IDBObjectStoreBackendInterface.h" -#include <wtf/OwnPtr.h> -#include <wtf/PassOwnPtr.h> -#include <wtf/PassRefPtr.h> - -#if ENABLE(INDEXED_DATABASE) - -namespace WebKit { class WebIDBObjectStore; } - -namespace WebCore { - -class IDBObjectStoreProxy : public IDBObjectStoreBackendInterface { -public: - static PassRefPtr<IDBObjectStoreBackendInterface> create(PassOwnPtr<WebKit::WebIDBObjectStore>); - virtual ~IDBObjectStoreProxy(); - - virtual String name() const; - virtual String keyPath() const; - virtual PassRefPtr<DOMStringList> indexNames() const; - - virtual void get(PassRefPtr<IDBKey>, PassRefPtr<IDBCallbacks>, IDBTransactionBackendInterface*, ExceptionCode&); - virtual void put(PassRefPtr<SerializedScriptValue>, PassRefPtr<IDBKey>, PutMode, PassRefPtr<IDBCallbacks>, IDBTransactionBackendInterface*, ExceptionCode&); - virtual void deleteFunction(PassRefPtr<IDBKey>, PassRefPtr<IDBCallbacks>, IDBTransactionBackendInterface*, ExceptionCode&); - virtual void clear(PassRefPtr<IDBCallbacks>, IDBTransactionBackendInterface*, ExceptionCode&); - - PassRefPtr<IDBIndexBackendInterface> createIndex(const String& name, const String& keyPath, bool unique, IDBTransactionBackendInterface*, ExceptionCode&); - PassRefPtr<IDBIndexBackendInterface> index(const String& name, ExceptionCode&); - void deleteIndex(const String& name, IDBTransactionBackendInterface*, ExceptionCode&); - - virtual void openCursor(PassRefPtr<IDBKeyRange>, unsigned short direction, PassRefPtr<IDBCallbacks>, IDBTransactionBackendInterface*, ExceptionCode&); - -private: - IDBObjectStoreProxy(PassOwnPtr<WebKit::WebIDBObjectStore>); - - OwnPtr<WebKit::WebIDBObjectStore> m_webIDBObjectStore; -}; - -} // namespace WebCore - -#endif - -#endif // IDBObjectStoreProxy_h diff --git a/Source/WebKit/chromium/src/IDBTransactionBackendProxy.cpp b/Source/WebKit/chromium/src/IDBTransactionBackendProxy.cpp index 95c90d5..6d91f48 100644 --- a/Source/WebKit/chromium/src/IDBTransactionBackendProxy.cpp +++ b/Source/WebKit/chromium/src/IDBTransactionBackendProxy.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -28,21 +28,23 @@ #if ENABLE(INDEXED_DATABASE) -#include "IDBObjectStoreProxy.h" +#include "IDBObjectStoreBackendProxy.h" #include "IDBTransactionCallbacks.h" #include "WebIDBDatabaseError.h" #include "WebIDBObjectStore.h" #include "WebIDBTransaction.h" #include "WebIDBTransactionCallbacksImpl.h" -namespace WebCore { +using namespace WebCore; -PassRefPtr<IDBTransactionBackendInterface> IDBTransactionBackendProxy::create(PassOwnPtr<WebKit::WebIDBTransaction> transaction) +namespace WebKit { + +PassRefPtr<IDBTransactionBackendInterface> IDBTransactionBackendProxy::create(PassOwnPtr<WebIDBTransaction> transaction) { return adoptRef(new IDBTransactionBackendProxy(transaction)); } -IDBTransactionBackendProxy::IDBTransactionBackendProxy(PassOwnPtr<WebKit::WebIDBTransaction> transaction) +IDBTransactionBackendProxy::IDBTransactionBackendProxy(PassOwnPtr<WebIDBTransaction> transaction) : m_webIDBTransaction(transaction) { ASSERT(m_webIDBTransaction); @@ -54,10 +56,10 @@ IDBTransactionBackendProxy::~IDBTransactionBackendProxy() PassRefPtr<IDBObjectStoreBackendInterface> IDBTransactionBackendProxy::objectStore(const String& name, ExceptionCode& ec) { - WebKit::WebIDBObjectStore* objectStore = m_webIDBTransaction->objectStore(name, ec); + WebIDBObjectStore* objectStore = m_webIDBTransaction->objectStore(name, ec); if (!objectStore) return 0; - return IDBObjectStoreProxy::create(objectStore); + return IDBObjectStoreBackendProxy::create(objectStore); } unsigned short IDBTransactionBackendProxy::mode() const @@ -88,6 +90,6 @@ void IDBTransactionBackendProxy::setCallbacks(IDBTransactionCallbacks* callbacks m_webIDBTransaction->setCallbacks(new WebIDBTransactionCallbacksImpl(callbacks)); } -} // namespace WebCore +} // namespace WebKit #endif // ENABLE(INDEXED_DATABASE) diff --git a/Source/WebKit/chromium/src/IDBTransactionBackendProxy.h b/Source/WebKit/chromium/src/IDBTransactionBackendProxy.h index 96d7293..103f552 100644 --- a/Source/WebKit/chromium/src/IDBTransactionBackendProxy.h +++ b/Source/WebKit/chromium/src/IDBTransactionBackendProxy.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -26,38 +26,37 @@ #ifndef IDBTransactionBackendProxy_h #define IDBTransactionBackendProxy_h -#include "IDBTransactionBackendInterface.h" - #if ENABLE(INDEXED_DATABASE) +#include "IDBTransactionBackendInterface.h" #include <wtf/OwnPtr.h> #include <wtf/PassOwnPtr.h> -namespace WebKit { class WebIDBTransaction; } +namespace WebKit { -namespace WebCore { +class WebIDBTransaction; -class IDBTransactionBackendProxy : public IDBTransactionBackendInterface { +class IDBTransactionBackendProxy : public WebCore::IDBTransactionBackendInterface { public: - static PassRefPtr<IDBTransactionBackendInterface> create(PassOwnPtr<WebKit::WebIDBTransaction>); + static PassRefPtr<IDBTransactionBackendInterface> create(PassOwnPtr<WebIDBTransaction>); virtual ~IDBTransactionBackendProxy(); - virtual PassRefPtr<IDBObjectStoreBackendInterface> objectStore(const String& name, ExceptionCode&); + virtual PassRefPtr<WebCore::IDBObjectStoreBackendInterface> objectStore(const String& name, WebCore::ExceptionCode&); virtual unsigned short mode() const; virtual void abort(); - virtual bool scheduleTask(PassOwnPtr<ScriptExecutionContext::Task>, PassOwnPtr<ScriptExecutionContext::Task>); + virtual bool scheduleTask(PassOwnPtr<WebCore::ScriptExecutionContext::Task>, PassOwnPtr<WebCore::ScriptExecutionContext::Task>); virtual void didCompleteTaskEvents(); - virtual void setCallbacks(IDBTransactionCallbacks*); + virtual void setCallbacks(WebCore::IDBTransactionCallbacks*); - WebKit::WebIDBTransaction* getWebIDBTransaction() const { return m_webIDBTransaction.get(); } + WebIDBTransaction* getWebIDBTransaction() const { return m_webIDBTransaction.get(); } private: - IDBTransactionBackendProxy(PassOwnPtr<WebKit::WebIDBTransaction>); + IDBTransactionBackendProxy(PassOwnPtr<WebIDBTransaction>); - OwnPtr<WebKit::WebIDBTransaction> m_webIDBTransaction; + OwnPtr<WebIDBTransaction> m_webIDBTransaction; }; -} // namespace WebCore +} // namespace WebKit #endif diff --git a/Source/WebKit/chromium/src/IDBTransactionCallbacksProxy.cpp b/Source/WebKit/chromium/src/IDBTransactionCallbacksProxy.cpp index ebda1dd..83d7e3a 100644 --- a/Source/WebKit/chromium/src/IDBTransactionCallbacksProxy.cpp +++ b/Source/WebKit/chromium/src/IDBTransactionCallbacksProxy.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -29,18 +29,20 @@ #include "config.h" #include "IDBTransactionCallbacksProxy.h" +#if ENABLE(INDEXED_DATABASE) + #include "WebIDBTransactionCallbacks.h" -#if ENABLE(INDEXED_DATABASE) +using namespace WebCore; -namespace WebCore { +namespace WebKit { -PassRefPtr<IDBTransactionCallbacksProxy> IDBTransactionCallbacksProxy::create(PassOwnPtr<WebKit::WebIDBTransactionCallbacks> callbacks) +PassRefPtr<IDBTransactionCallbacksProxy> IDBTransactionCallbacksProxy::create(PassOwnPtr<WebIDBTransactionCallbacks> callbacks) { return adoptRef(new IDBTransactionCallbacksProxy(callbacks)); } -IDBTransactionCallbacksProxy::IDBTransactionCallbacksProxy(PassOwnPtr<WebKit::WebIDBTransactionCallbacks> callbacks) +IDBTransactionCallbacksProxy::IDBTransactionCallbacksProxy(PassOwnPtr<WebIDBTransactionCallbacks> callbacks) : m_callbacks(callbacks) { } @@ -59,6 +61,6 @@ void IDBTransactionCallbacksProxy::onComplete() m_callbacks->onComplete(); } -} // namespace WebCore +} // namespace WebKit #endif // ENABLE(INDEXED_DATABASE) diff --git a/Source/WebKit/chromium/src/IDBTransactionCallbacksProxy.h b/Source/WebKit/chromium/src/IDBTransactionCallbacksProxy.h index 79c32f6..044eecf 100644 --- a/Source/WebKit/chromium/src/IDBTransactionCallbacksProxy.h +++ b/Source/WebKit/chromium/src/IDBTransactionCallbacksProxy.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -29,33 +29,32 @@ #ifndef IDBTransactionCallbacksProxy_h #define IDBTransactionCallbacksProxy_h -#include "IDBTransactionCallbacks.h" - #if ENABLE(INDEXED_DATABASE) +#include "IDBTransactionCallbacks.h" #include <wtf/PassOwnPtr.h> #include <wtf/PassRefPtr.h> -namespace WebKit { class WebIDBTransactionCallbacks; } +namespace WebKit { -namespace WebCore { +class WebIDBTransactionCallbacks; -class IDBTransactionCallbacksProxy : public IDBTransactionCallbacks { +class IDBTransactionCallbacksProxy : public WebCore::IDBTransactionCallbacks { public: - static PassRefPtr<IDBTransactionCallbacksProxy> create(PassOwnPtr<WebKit::WebIDBTransactionCallbacks>); + static PassRefPtr<IDBTransactionCallbacksProxy> create(PassOwnPtr<WebIDBTransactionCallbacks>); virtual ~IDBTransactionCallbacksProxy(); virtual void onAbort(); virtual void onComplete(); private: - IDBTransactionCallbacksProxy(PassOwnPtr<WebKit::WebIDBTransactionCallbacks>); + IDBTransactionCallbacksProxy(PassOwnPtr<WebIDBTransactionCallbacks>); - OwnPtr<WebKit::WebIDBTransactionCallbacks> m_callbacks; + OwnPtr<WebIDBTransactionCallbacks> m_callbacks; }; -} // namespace WebCore +} // namespace WebKit #endif diff --git a/Source/WebKit/chromium/src/PlatformBridge.cpp b/Source/WebKit/chromium/src/PlatformBridge.cpp index d825d24..bbed1ba 100644 --- a/Source/WebKit/chromium/src/PlatformBridge.cpp +++ b/Source/WebKit/chromium/src/PlatformBridge.cpp @@ -61,7 +61,7 @@ #include "WebViewImpl.h" #include "WebWorkerClientImpl.h" -#if PLATFORM(CG) +#if USE(CG) #include <CoreGraphics/CGContext.h> #endif @@ -178,6 +178,12 @@ void PlatformBridge::clipboardReadHTML( *sourceURL = url; } +PassRefPtr<SharedBuffer> PlatformBridge::clipboardReadImage( + PasteboardPrivate::ClipboardBuffer buffer) +{ + return webKitClient()->clipboard()->readImage(static_cast<WebClipboard::Buffer>(buffer)); +} + void PlatformBridge::clipboardWriteSelection(const String& htmlText, const KURL& sourceURL, const String& plainText, diff --git a/Source/WebKit/chromium/src/ResourceHandle.cpp b/Source/WebKit/chromium/src/ResourceHandle.cpp index f88a48a..a11e0c3 100644 --- a/Source/WebKit/chromium/src/ResourceHandle.cpp +++ b/Source/WebKit/chromium/src/ResourceHandle.cpp @@ -72,10 +72,7 @@ public: virtual void didSendData( WebURLLoader*, unsigned long long bytesSent, unsigned long long totalBytesToBeSent); virtual void didReceiveResponse(WebURLLoader*, const WebURLResponse&); - virtual void didReceiveData2(WebURLLoader*, const char* data, int dataLength, int lengthReceived); - - // FIXME(vsevik): remove once not used downstream - virtual void didReceiveData(WebURLLoader*, const char* data, int dataLength); + virtual void didReceiveData(WebURLLoader*, const char* data, int dataLength, int encodedDataLength); virtual void didReceiveCachedMetadata(WebURLLoader*, const char* data, int dataLength); virtual void didFinishLoading(WebURLLoader*, double finishTime); @@ -163,20 +160,14 @@ void ResourceHandleInternal::didReceiveResponse(WebURLLoader*, const WebURLRespo m_client->didReceiveResponse(m_owner, response.toResourceResponse()); } -// FIXME(vsevik): remove once not used -void ResourceHandleInternal::didReceiveData(WebURLLoader* webURLLoader, const char* data, int dataLength) -{ - didReceiveData2(webURLLoader, data, dataLength, -1); -} - -void ResourceHandleInternal::didReceiveData2(WebURLLoader*, const char* data, int dataLength, int lengthReceived) +void ResourceHandleInternal::didReceiveData(WebURLLoader*, const char* data, int dataLength, int encodedDataLength) { ASSERT(m_client); if (m_state != ConnectionStateReceivedResponse && m_state != ConnectionStateReceivingData) CRASH(); m_state = ConnectionStateReceivingData; - m_client->didReceiveData(m_owner, data, dataLength, lengthReceived); + m_client->didReceiveData(m_owner, data, dataLength, encodedDataLength); } void ResourceHandleInternal::didReceiveCachedMetadata(WebURLLoader*, const char* data, int dataLength) diff --git a/Source/WebKit/chromium/src/StorageInfoChromium.cpp b/Source/WebKit/chromium/src/StorageInfoChromium.cpp new file mode 100644 index 0000000..5f58c2c --- /dev/null +++ b/Source/WebKit/chromium/src/StorageInfoChromium.cpp @@ -0,0 +1,99 @@ +/* + * Copyright (C) 2011 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 "StorageInfo.h" + +#if ENABLE(QUOTA) + +#include "DOMCoreException.h" +#include "Document.h" +#include "ScriptExecutionContext.h" +#include "StorageInfoErrorCallback.h" +#include "StorageInfoQuotaCallback.h" +#include "StorageInfoUsageCallback.h" +#include "WebFrameClient.h" +#include "WebFrameImpl.h" +#include "WebStorageQuotaCallbacksImpl.h" +#include "WebStorageQuotaType.h" + +using namespace WebKit; + +namespace WebCore { + +namespace { +void fireStorageInfoErrorCallback(PassRefPtr<StorageInfoErrorCallback> errorCallback, ExceptionCode ec) +{ + ASSERT(errorCallback); + ExceptionCodeDescription description; + getExceptionCodeDescription(ec, description); + errorCallback->handleEvent(DOMCoreException::create(description).get()); +} +} + +void StorageInfo::queryUsageAndQuota(ScriptExecutionContext* context, int storageType, PassRefPtr<StorageInfoUsageCallback> successCallback, PassRefPtr<StorageInfoErrorCallback> errorCallback) +{ + ASSERT(context); + if (storageType != WebStorageQuotaTypeTemporary && storageType != WebStorageQuotaTypePersistent) { + // Unknown storage type is requested. + fireStorageInfoErrorCallback(errorCallback, NOT_SUPPORTED_ERR); + return; + } + if (context->isDocument()) { + Document* document = static_cast<Document*>(context); + WebFrameImpl* webFrame = WebFrameImpl::fromFrame(document->frame()); + webFrame->client()->queryStorageUsageAndQuota(webFrame, static_cast<WebStorageQuotaType>(storageType), new WebStorageQuotaCallbacksImpl(successCallback, errorCallback)); + } else if (errorCallback) { + // FIXME: calling this on worker is not yet supported. + fireStorageInfoErrorCallback(errorCallback, NOT_SUPPORTED_ERR); + } +} + +void StorageInfo::requestQuota(ScriptExecutionContext* context, int storageType, unsigned long long newQuotaInBytes, PassRefPtr<StorageInfoQuotaCallback> successCallback, PassRefPtr<StorageInfoErrorCallback> errorCallback) +{ + ASSERT(context); + if (storageType != WebStorageQuotaTypeTemporary && storageType != WebStorageQuotaTypePersistent) { + // Unknown storage type is requested. + fireStorageInfoErrorCallback(errorCallback, NOT_SUPPORTED_ERR); + return; + } + if (context->isDocument()) { + Document* document = static_cast<Document*>(context); + WebFrameImpl* webFrame = WebFrameImpl::fromFrame(document->frame()); + webFrame->client()->requestStorageQuota(webFrame, static_cast<WebStorageQuotaType>(storageType), newQuotaInBytes, new WebStorageQuotaCallbacksImpl(successCallback, errorCallback)); + } else if (errorCallback) { + // FIXME: calling this on worker is not yet supported. + fireStorageInfoErrorCallback(errorCallback, NOT_SUPPORTED_ERR); + } +} + +} // namespace WebCore + +#endif // ENABLE(QUOTA) diff --git a/Source/WebKit/chromium/src/VideoFrameChromiumImpl.h b/Source/WebKit/chromium/src/VideoFrameChromiumImpl.h index ca7f88b..44a3cc7 100644 --- a/Source/WebKit/chromium/src/VideoFrameChromiumImpl.h +++ b/Source/WebKit/chromium/src/VideoFrameChromiumImpl.h @@ -34,16 +34,14 @@ #include "VideoFrameChromium.h" #include "WebVideoFrame.h" -using namespace WebCore; - namespace WebKit { // A wrapper class for WebKit::WebVideoFrame. Objects can be created in WebKit // and used in WebCore because of the VideoFrameChromium interface. -class VideoFrameChromiumImpl : public VideoFrameChromium { +class VideoFrameChromiumImpl : public WebCore::VideoFrameChromium { public: // Converts a WebCore::VideoFrameChromium to a WebKit::WebVideoFrame. - static WebVideoFrame* toWebVideoFrame(VideoFrameChromium*); + static WebVideoFrame* toWebVideoFrame(WebCore::VideoFrameChromium*); // Creates a VideoFrameChromiumImpl object to wrap the given WebVideoFrame. // The VideoFrameChromiumImpl does not take ownership of the WebVideoFrame @@ -59,7 +57,7 @@ public: virtual int stride(unsigned plane) const; virtual const void* data(unsigned plane) const; virtual unsigned texture(unsigned plane) const; - virtual const IntSize requiredTextureSize(unsigned plane) const; + virtual const WebCore::IntSize requiredTextureSize(unsigned plane) const; virtual bool hasPaddingBytes(unsigned plane) const; private: diff --git a/Source/WebKit/chromium/src/WebDOMEventListener.cpp b/Source/WebKit/chromium/src/WebDOMEventListener.cpp index 93c1640..55d71a7 100644 --- a/Source/WebKit/chromium/src/WebDOMEventListener.cpp +++ b/Source/WebKit/chromium/src/WebDOMEventListener.cpp @@ -33,6 +33,8 @@ #include "WebDOMEventListenerPrivate.h" +using namespace WebCore; + namespace WebKit { WebDOMEventListener::WebDOMEventListener() diff --git a/Source/WebKit/chromium/src/WebDOMEventListenerPrivate.cpp b/Source/WebKit/chromium/src/WebDOMEventListenerPrivate.cpp index 4edbeef..fb05823 100644 --- a/Source/WebKit/chromium/src/WebDOMEventListenerPrivate.cpp +++ b/Source/WebKit/chromium/src/WebDOMEventListenerPrivate.cpp @@ -34,6 +34,8 @@ #include "EventListenerWrapper.h" #include "WebDOMEventListener.h" +using namespace WebCore; + namespace WebKit { WebDOMEventListenerPrivate::WebDOMEventListenerPrivate(WebDOMEventListener* webDOMEventListener) diff --git a/Source/WebKit/chromium/src/WebDOMEventListenerPrivate.h b/Source/WebKit/chromium/src/WebDOMEventListenerPrivate.h index c86f427..2fe443f 100644 --- a/Source/WebKit/chromium/src/WebDOMEventListenerPrivate.h +++ b/Source/WebKit/chromium/src/WebDOMEventListenerPrivate.h @@ -39,8 +39,6 @@ namespace WebCore { class Node; } -using namespace WebCore; - namespace WebKit { class EventListenerWrapper; @@ -52,12 +50,12 @@ public: ~WebDOMEventListenerPrivate(); EventListenerWrapper* createEventListenerWrapper( - const WebString& eventType, bool useCapture, Node* node); + const WebString& eventType, bool useCapture, WebCore::Node*); // Gets the ListenerEventWrapper for a specific node. // Used by WebNode::removeDOMEventListener(). EventListenerWrapper* getEventListenerWrapper( - const WebString& eventType, bool useCapture, Node* node); + const WebString& eventType, bool useCapture, WebCore::Node*); // Called by the WebDOMEventListener when it is about to be deleted. void webDOMEventListenerDeleted(); @@ -68,7 +66,7 @@ public: struct ListenerInfo { ListenerInfo(const WebString& eventType, bool useCapture, EventListenerWrapper* eventListenerWrapper, - Node* node) + WebCore::Node* node) : eventType(eventType) , useCapture(useCapture) , eventListenerWrapper(eventListenerWrapper) @@ -79,7 +77,7 @@ public: WebString eventType; bool useCapture; EventListenerWrapper* eventListenerWrapper; - Node* node; + WebCore::Node* node; }; private: diff --git a/Source/WebKit/chromium/src/WebDataSourceImpl.cpp b/Source/WebKit/chromium/src/WebDataSourceImpl.cpp index 1366a80..3170aff 100644 --- a/Source/WebKit/chromium/src/WebDataSourceImpl.cpp +++ b/Source/WebKit/chromium/src/WebDataSourceImpl.cpp @@ -82,7 +82,8 @@ void WebDataSourceImpl::redirectChain(WebVector<WebURL>& result) const WebString WebDataSourceImpl::pageTitle() const { - return title(); + // FIXME: use direction of title as well. + return title().string(); } WebNavigationType WebDataSourceImpl::navigationType() const diff --git a/Source/WebKit/chromium/src/WebElement.cpp b/Source/WebKit/chromium/src/WebElement.cpp index ee7ec09..66e3e95 100644 --- a/Source/WebKit/chromium/src/WebElement.cpp +++ b/Source/WebKit/chromium/src/WebElement.cpp @@ -92,7 +92,7 @@ WebString WebElement::innerText() const WebNode WebElement::shadowRoot() { - return adoptRef(unwrap<Element>()->shadowRoot()); + return adoptRef(static_cast<Node*>(unwrap<Element>()->shadowRoot())); } WebString WebElement::computeInheritedLanguage() const diff --git a/Source/WebKit/chromium/src/WebFileChooserCompletionImpl.cpp b/Source/WebKit/chromium/src/WebFileChooserCompletionImpl.cpp index ef2409c..d7583c5 100644 --- a/Source/WebKit/chromium/src/WebFileChooserCompletionImpl.cpp +++ b/Source/WebKit/chromium/src/WebFileChooserCompletionImpl.cpp @@ -46,8 +46,7 @@ void WebFileChooserCompletionImpl::didChooseFile(const WebVector<WebString>& fil { if (fileNames.size() == 1) m_fileChooser->chooseFile(fileNames[0]); - else { - // This clause handles a case of file_names.size()==0 too. + else if (fileNames.size() > 0) { Vector<WTF::String> paths; for (size_t i = 0; i < fileNames.size(); ++i) paths.append(fileNames[i]); diff --git a/Source/WebKit/chromium/src/WebFrameImpl.cpp b/Source/WebKit/chromium/src/WebFrameImpl.cpp index fdfb14e..c06087d 100644 --- a/Source/WebKit/chromium/src/WebFrameImpl.cpp +++ b/Source/WebKit/chromium/src/WebFrameImpl.cpp @@ -90,6 +90,7 @@ #include "FrameLoader.h" #include "FrameTree.h" #include "FrameView.h" +#include "HitTestResult.h" #include "HTMLCollection.h" #include "HTMLFormElement.h" #include "HTMLFrameOwnerElement.h" @@ -106,6 +107,7 @@ #include "PluginDocument.h" #include "PrintContext.h" #include "RenderFrame.h" +#include "RenderLayer.h" #include "RenderObject.h" #include "RenderTreeAsText.h" #include "RenderView.h" @@ -140,6 +142,7 @@ #include "WebPerformance.h" #include "WebPlugin.h" #include "WebPluginContainerImpl.h" +#include "WebPoint.h" #include "WebRange.h" #include "WebRect.h" #include "WebScriptSource.h" @@ -161,8 +164,13 @@ #if USE(V8) #include "AsyncFileSystem.h" #include "AsyncFileSystemChromium.h" +#include "DirectoryEntry.h" #include "DOMFileSystem.h" +#include "FileEntry.h" +#include "V8DirectoryEntry.h" #include "V8DOMFileSystem.h" +#include "V8FileEntry.h" +#include "WebFileSystem.h" #endif using namespace WebCore; @@ -473,6 +481,13 @@ WebFrame* WebFrame::frameForCurrentContext() return WebFrameImpl::fromFrame(frame); } +#if WEBKIT_USING_V8 +WebFrame* WebFrame::frameForContext(v8::Handle<v8::Context> context) +{ + return WebFrameImpl::fromFrame(V8Proxy::retrieveFrame(context)); +} +#endif + WebFrame* WebFrame::fromFrameOwnerElement(const WebElement& element) { return WebFrameImpl::fromFrameOwnerElement( @@ -841,12 +856,24 @@ v8::Local<v8::Context> WebFrameImpl::mainWorldScriptContext() const return V8Proxy::mainWorldContext(m_frame); } -v8::Handle<v8::Value> WebFrameImpl::createFileSystem(int type, +v8::Handle<v8::Value> WebFrameImpl::createFileSystem(WebFileSystem::Type type, const WebString& name, const WebString& path) { return toV8(DOMFileSystem::create(frame()->document(), name, AsyncFileSystemChromium::create(static_cast<AsyncFileSystem::Type>(type), path))); } + +v8::Handle<v8::Value> WebFrameImpl::createFileEntry(WebFileSystem::Type type, + const WebString& fileSystemName, + const WebString& fileSystemPath, + const WebString& filePath, + bool isDirectory) +{ + RefPtr<DOMFileSystemBase> fileSystem = DOMFileSystem::create(frame()->document(), fileSystemName, AsyncFileSystemChromium::create(static_cast<AsyncFileSystem::Type>(type), fileSystemPath)); + if (isDirectory) + return toV8(DirectoryEntry::create(fileSystem, filePath)); + return toV8(FileEntry::create(fileSystem, filePath)); +} #endif bool WebFrameImpl::insertStyleText( @@ -1305,6 +1332,39 @@ bool WebFrameImpl::selectWordAroundCaret() return true; } +void WebFrameImpl::selectRange(const WebPoint& start, const WebPoint& end) +{ + VisibleSelection selection(visiblePositionForWindowPoint(start), + visiblePositionForWindowPoint(end)); + + if (frame()->selection()->shouldChangeSelection(selection)) + frame()->selection()->setSelection(selection, CharacterGranularity, + MakeNonDirectionalSelection); +} + +VisiblePosition WebFrameImpl::visiblePositionForWindowPoint(const WebPoint& point) +{ + HitTestRequest::HitTestRequestType hitType = HitTestRequest::MouseMove; + hitType |= HitTestRequest::ReadOnly; + hitType |= HitTestRequest::Active; + HitTestRequest request(hitType); + FrameView* view = frame()->view(); + HitTestResult result(view->windowToContents( + view->convertFromContainingWindow(IntPoint(point.x, point.y)))); + + frame()->document()->renderView()->layer()->hitTest(request, result); + + // Matching the logic in MouseEventWithHitTestResults::targetNode() + Node* node = result.innerNode(); + if (!node) + return VisiblePosition(); + Element* element = node->parentElement(); + if (!node->inDocument() && element && element->inDocument()) + node = element; + + return node->renderer()->positionForPoint(result.localPoint()); +} + int WebFrameImpl::printBegin(const WebSize& pageSize, const WebNode& constrainToNode, int printerDPI, @@ -1366,7 +1426,13 @@ float WebFrameImpl::printPage(int page, WebCanvas* canvas) return 0; } - return m_printContext->spoolPage(GraphicsContextBuilder(canvas).context(), page); + GraphicsContextBuilder builder(canvas); + GraphicsContext& gc = builder.context(); +#if WEBKIT_USING_SKIA + gc.platformContext()->setPrinting(true); +#endif + + return m_printContext->spoolPage(gc, page); } void WebFrameImpl::printEnd() @@ -1482,12 +1548,8 @@ bool WebFrameImpl::find(int identifier, m_activeMatchIndex = m_lastMatchCount - 1; } if (selectionRect) { - WebRect rect = frame()->view()->convertToContainingWindow(currSelectionRect); - rect.x -= frameView()->scrollOffset().width(); - rect.y -= frameView()->scrollOffset().height(); - *selectionRect = rect; - - reportFindInPageSelection(rect, m_activeMatchIndex + 1, identifier); + *selectionRect = frameView()->contentsToWindow(currSelectionRect); + reportFindInPageSelection(*selectionRect, m_activeMatchIndex + 1, identifier); } } } else { @@ -1624,10 +1686,8 @@ void WebFrameImpl::scopeStringMatches(int identifier, m_locatingActiveRect = false; // Notify browser of new location for the selected rectangle. - resultBounds.move(-frameView()->scrollOffset().width(), - -frameView()->scrollOffset().height()); reportFindInPageSelection( - frame()->view()->convertToContainingWindow(resultBounds), + frameView()->contentsToWindow(resultBounds), m_activeMatchIndex + 1, identifier); } diff --git a/Source/WebKit/chromium/src/WebFrameImpl.h b/Source/WebKit/chromium/src/WebFrameImpl.h index 6129de1..572408a 100644 --- a/Source/WebKit/chromium/src/WebFrameImpl.h +++ b/Source/WebKit/chromium/src/WebFrameImpl.h @@ -109,9 +109,14 @@ public: virtual v8::Handle<v8::Value> executeScriptAndReturnValue( const WebScriptSource&); virtual v8::Local<v8::Context> mainWorldScriptContext() const; - virtual v8::Handle<v8::Value> createFileSystem(int type, + virtual v8::Handle<v8::Value> createFileSystem(WebFileSystem::Type, const WebString& name, const WebString& path); + virtual v8::Handle<v8::Value> createFileEntry(WebFileSystem::Type, + const WebString& fileSystemName, + const WebString& fileSystemPath, + const WebString& filePath, + bool isDirectory); #endif virtual bool insertStyleText(const WebString& css, const WebString& id); virtual void reload(bool ignoreCache); @@ -157,6 +162,7 @@ public: virtual WebString selectionAsText() const; virtual WebString selectionAsMarkup() const; virtual bool selectWordAroundCaret(); + virtual void selectRange(const WebPoint& start, const WebPoint& end); virtual int printBegin(const WebSize& pageSize, const WebNode& constrainToNode, int printerDPI, @@ -326,6 +332,9 @@ private: void loadJavaScriptURL(const WebCore::KURL&); + // Returns a hit-tested VisiblePosition for the given point + WebCore::VisiblePosition visiblePositionForWindowPoint(const WebPoint&); + FrameLoaderClientImpl m_frameLoaderClient; WebFrameClient* m_client; diff --git a/Source/WebKit/chromium/src/WebHTTPLoadInfo.cpp b/Source/WebKit/chromium/src/WebHTTPLoadInfo.cpp index 876a489..9cb4aaa 100644 --- a/Source/WebKit/chromium/src/WebHTTPLoadInfo.cpp +++ b/Source/WebKit/chromium/src/WebHTTPLoadInfo.cpp @@ -89,6 +89,18 @@ void WebHTTPLoadInfo::setHTTPStatusText(const WebString& statusText) m_private->httpStatusText = statusText; } +long long WebHTTPLoadInfo::encodedDataLength() const +{ + ASSERT(!m_private.isNull()); + return m_private->encodedDataLength; +} + +void WebHTTPLoadInfo::setEncodedDataLength(long long encodedDataLength) +{ + ASSERT(!m_private.isNull()); + m_private->encodedDataLength = encodedDataLength; +} + static void addHeader(HTTPHeaderMap* map, const WebString& name, const WebString& value) { pair<HTTPHeaderMap::iterator, bool> result = map->add(name, value); @@ -108,4 +120,28 @@ void WebHTTPLoadInfo::addResponseHeader(const WebString& name, const WebString& addHeader(&m_private->responseHeaders, name, value); } +WebString WebHTTPLoadInfo::requestHeadersText() const +{ + ASSERT(!m_private.isNull()); + return m_private->requestHeadersText; +} + +void WebHTTPLoadInfo::setRequestHeadersText(const WebString& headersText) +{ + ASSERT(!m_private.isNull()); + m_private->requestHeadersText = headersText; +} + +WebString WebHTTPLoadInfo::responseHeadersText() const +{ + ASSERT(!m_private.isNull()); + return m_private->responseHeadersText; +} + +void WebHTTPLoadInfo::setResponseHeadersText(const WebString& headersText) +{ + ASSERT(!m_private.isNull()); + m_private->responseHeadersText = headersText; +} + } // namespace WebKit diff --git a/Source/WebKit/chromium/src/WebIDBCallbacksImpl.cpp b/Source/WebKit/chromium/src/WebIDBCallbacksImpl.cpp index ce307a4..24d3f6c 100644 --- a/Source/WebKit/chromium/src/WebIDBCallbacksImpl.cpp +++ b/Source/WebKit/chromium/src/WebIDBCallbacksImpl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -26,10 +26,12 @@ #include "config.h" #include "WebIDBCallbacksImpl.h" +#if ENABLE(INDEXED_DATABASE) + #include "IDBCallbacks.h" #include "IDBCursorBackendProxy.h" +#include "IDBDatabaseBackendProxy.h" #include "IDBDatabaseError.h" -#include "IDBDatabaseProxy.h" #include "IDBKey.h" #include "IDBTransactionBackendProxy.h" #include "WebIDBCallbacks.h" @@ -39,9 +41,9 @@ #include "WebIDBTransaction.h" #include "WebSerializedScriptValue.h" -#if ENABLE(INDEXED_DATABASE) +using namespace WebCore; -namespace WebCore { +namespace WebKit { WebIDBCallbacksImpl::WebIDBCallbacksImpl(PassRefPtr<IDBCallbacks> callbacks) : m_callbacks(callbacks) @@ -52,32 +54,32 @@ WebIDBCallbacksImpl::~WebIDBCallbacksImpl() { } -void WebIDBCallbacksImpl::onError(const WebKit::WebIDBDatabaseError& error) +void WebIDBCallbacksImpl::onError(const WebIDBDatabaseError& error) { m_callbacks->onError(error); } -void WebIDBCallbacksImpl::onSuccess(WebKit::WebIDBCursor* cursor) +void WebIDBCallbacksImpl::onSuccess(WebIDBCursor* cursor) { m_callbacks->onSuccess(IDBCursorBackendProxy::create(cursor)); } -void WebIDBCallbacksImpl::onSuccess(WebKit::WebIDBDatabase* webKitInstance) +void WebIDBCallbacksImpl::onSuccess(WebIDBDatabase* webKitInstance) { - m_callbacks->onSuccess(IDBDatabaseProxy::create(webKitInstance)); + m_callbacks->onSuccess(IDBDatabaseBackendProxy::create(webKitInstance)); } -void WebIDBCallbacksImpl::onSuccess(const WebKit::WebIDBKey& key) +void WebIDBCallbacksImpl::onSuccess(const WebIDBKey& key) { m_callbacks->onSuccess(key); } -void WebIDBCallbacksImpl::onSuccess(WebKit::WebIDBTransaction* webKitInstance) +void WebIDBCallbacksImpl::onSuccess(WebIDBTransaction* webKitInstance) { m_callbacks->onSuccess(IDBTransactionBackendProxy::create(webKitInstance)); } -void WebIDBCallbacksImpl::onSuccess(const WebKit::WebSerializedScriptValue& serializedScriptValue) +void WebIDBCallbacksImpl::onSuccess(const WebSerializedScriptValue& serializedScriptValue) { m_callbacks->onSuccess(serializedScriptValue); } @@ -87,6 +89,6 @@ void WebIDBCallbacksImpl::onBlocked() m_callbacks->onBlocked(); } -} // namespace WebCore +} // namespace WebKit #endif // ENABLE(INDEXED_DATABASE) diff --git a/Source/WebKit/chromium/src/WebIDBCallbacksImpl.h b/Source/WebKit/chromium/src/WebIDBCallbacksImpl.h index 057aa25..c486601 100644 --- a/Source/WebKit/chromium/src/WebIDBCallbacksImpl.h +++ b/Source/WebKit/chromium/src/WebIDBCallbacksImpl.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -26,35 +26,35 @@ #ifndef WebIDBCallbacksImpl_h #define WebIDBCallbacksImpl_h +#if ENABLE(INDEXED_DATABASE) + #include "WebIDBCallbacks.h" #include <wtf/PassRefPtr.h> #include <wtf/RefPtr.h> -#if ENABLE(INDEXED_DATABASE) - -namespace WebCore { +namespace WebCore { class IDBCallbacks; } -class IDBCallbacks; +namespace WebKit { -class WebIDBCallbacksImpl : public WebKit::WebIDBCallbacks { +class WebIDBCallbacksImpl : public WebIDBCallbacks { public: - WebIDBCallbacksImpl(PassRefPtr<IDBCallbacks>); + WebIDBCallbacksImpl(PassRefPtr<WebCore::IDBCallbacks>); virtual ~WebIDBCallbacksImpl(); - virtual void onError(const WebKit::WebIDBDatabaseError&); - virtual void onSuccess(WebKit::WebIDBCursor*); - virtual void onSuccess(WebKit::WebIDBDatabase*); - virtual void onSuccess(const WebKit::WebIDBKey&); - virtual void onSuccess(WebKit::WebIDBTransaction*); - virtual void onSuccess(const WebKit::WebSerializedScriptValue&); + virtual void onError(const WebIDBDatabaseError&); + virtual void onSuccess(WebIDBCursor*); + virtual void onSuccess(WebIDBDatabase*); + virtual void onSuccess(const WebIDBKey&); + virtual void onSuccess(WebIDBTransaction*); + virtual void onSuccess(const WebSerializedScriptValue&); virtual void onBlocked(); private: - RefPtr<IDBCallbacks> m_callbacks; + RefPtr<WebCore::IDBCallbacks> m_callbacks; }; -} // namespace WebCore +} // namespace WebKit -#endif +#endif // ENABLE(INDEXED_DATABASE) #endif // WebIDBCallbacksImpl_h diff --git a/Source/WebKit/chromium/src/WebIDBCursorImpl.cpp b/Source/WebKit/chromium/src/WebIDBCursorImpl.cpp index 86c4f57..6c0012e 100644 --- a/Source/WebKit/chromium/src/WebIDBCursorImpl.cpp +++ b/Source/WebKit/chromium/src/WebIDBCursorImpl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -26,6 +26,8 @@ #include "config.h" #include "WebIDBCursorImpl.h" +#if ENABLE(INDEXED_DATABASE) + #include "IDBAny.h" #include "IDBCallbacksProxy.h" #include "IDBCursorBackendInterface.h" @@ -80,4 +82,6 @@ void WebIDBCursorImpl::deleteFunction(WebIDBCallbacks* callbacks, WebExceptionCo m_idbCursorBackend->deleteFunction(IDBCallbacksProxy::create(callbacks), ec); } -} // namespace WebCore +} // namespace WebKit + +#endif // ENABLE(INDEXED_DATABASE) diff --git a/Source/WebKit/chromium/src/WebIDBCursorImpl.h b/Source/WebKit/chromium/src/WebIDBCursorImpl.h index de17a99..c237920 100644 --- a/Source/WebKit/chromium/src/WebIDBCursorImpl.h +++ b/Source/WebKit/chromium/src/WebIDBCursorImpl.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -26,6 +26,8 @@ #ifndef WebIDBCursorImpl_h #define WebIDBCursorImpl_h +#if ENABLE(INDEXED_DATABASE) + #include "WebCommon.h" #include "WebExceptionCode.h" #include "WebIDBCursor.h" @@ -56,4 +58,6 @@ public: } // namespace WebKit +#endif // ENABLE(INDEXED_DATABASE) + #endif // WebIDBCursorImpl_h diff --git a/Source/WebKit/chromium/src/WebIDBDatabaseCallbacksImpl.cpp b/Source/WebKit/chromium/src/WebIDBDatabaseCallbacksImpl.cpp index 3ca0274..0fec84a 100644 --- a/Source/WebKit/chromium/src/WebIDBDatabaseCallbacksImpl.cpp +++ b/Source/WebKit/chromium/src/WebIDBDatabaseCallbacksImpl.cpp @@ -31,7 +31,9 @@ #include "IDBDatabaseCallbacks.h" #include "WebString.h" -namespace WebCore { +using namespace WebCore; + +namespace WebKit { WebIDBDatabaseCallbacksImpl::WebIDBDatabaseCallbacksImpl(PassRefPtr<IDBDatabaseCallbacks> callbacks) : m_callbacks(callbacks) @@ -42,11 +44,11 @@ WebIDBDatabaseCallbacksImpl::~WebIDBDatabaseCallbacksImpl() { } -void WebIDBDatabaseCallbacksImpl::onVersionChange(const WebKit::WebString& version) +void WebIDBDatabaseCallbacksImpl::onVersionChange(const WebString& version) { m_callbacks->onVersionChange(version); } -} // namespace WebCore +} // namespace WebKit #endif // ENABLE(INDEXED_DATABASE) diff --git a/Source/WebKit/chromium/src/WebIDBDatabaseCallbacksImpl.h b/Source/WebKit/chromium/src/WebIDBDatabaseCallbacksImpl.h index ba3dc5e..d4916af 100644 --- a/Source/WebKit/chromium/src/WebIDBDatabaseCallbacksImpl.h +++ b/Source/WebKit/chromium/src/WebIDBDatabaseCallbacksImpl.h @@ -34,23 +34,23 @@ #include <wtf/PassRefPtr.h> #include <wtf/RefPtr.h> -namespace WebCore { +namespace WebCore { class IDBDatabaseCallbacks; } -class IDBDatabaseCallbacks; +namespace WebKit { -class WebIDBDatabaseCallbacksImpl : public WebKit::WebIDBDatabaseCallbacks { +class WebIDBDatabaseCallbacksImpl : public WebIDBDatabaseCallbacks { public: - WebIDBDatabaseCallbacksImpl(PassRefPtr<IDBDatabaseCallbacks>); + WebIDBDatabaseCallbacksImpl(PassRefPtr<WebCore::IDBDatabaseCallbacks>); virtual ~WebIDBDatabaseCallbacksImpl(); - virtual void onVersionChange(const WebKit::WebString& version); + virtual void onVersionChange(const WebString& version); private: - RefPtr<IDBDatabaseCallbacks> m_callbacks; + RefPtr<WebCore::IDBDatabaseCallbacks> m_callbacks; }; -} // namespace WebCore +} // namespace WebKit -#endif +#endif // ENABLE(INDEXED_DATABASE) #endif // WebIDBDatabaseCallbacksImpl_h diff --git a/Source/WebKit/chromium/src/WebIDBDatabaseError.cpp b/Source/WebKit/chromium/src/WebIDBDatabaseError.cpp index 7413ae6..25e202c 100644 --- a/Source/WebKit/chromium/src/WebIDBDatabaseError.cpp +++ b/Source/WebKit/chromium/src/WebIDBDatabaseError.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2011 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 @@ -31,11 +31,11 @@ #include "config.h" #include "WebIDBDatabaseError.h" +#if ENABLE(INDEXED_DATABASE) + #include "IDBDatabaseError.h" #include "WebString.h" -#if ENABLE(INDEXED_DATABASE) - using namespace WebCore; namespace WebKit { diff --git a/Source/WebKit/chromium/src/WebIDBDatabaseImpl.cpp b/Source/WebKit/chromium/src/WebIDBDatabaseImpl.cpp index 2a97923..92dd5ad 100644 --- a/Source/WebKit/chromium/src/WebIDBDatabaseImpl.cpp +++ b/Source/WebKit/chromium/src/WebIDBDatabaseImpl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -26,6 +26,8 @@ #include "config.h" #include "WebIDBDatabaseImpl.h" +#if ENABLE(INDEXED_DATABASE) + #include "DOMStringList.h" #include "IDBCallbacksProxy.h" #include "IDBDatabaseBackendInterface.h" @@ -36,8 +38,6 @@ #include "WebIDBObjectStoreImpl.h" #include "WebIDBTransactionImpl.h" -#if ENABLE(INDEXED_DATABASE) - using namespace WebCore; namespace WebKit { @@ -112,6 +112,6 @@ void WebIDBDatabaseImpl::open(WebIDBDatabaseCallbacks* callbacks) m_databaseBackend->open(m_databaseCallbacks); } -} // namespace WebCore +} // namespace WebKit #endif // ENABLE(INDEXED_DATABASE) diff --git a/Source/WebKit/chromium/src/WebIDBDatabaseImpl.h b/Source/WebKit/chromium/src/WebIDBDatabaseImpl.h index 0e1d03e..061f5c2 100644 --- a/Source/WebKit/chromium/src/WebIDBDatabaseImpl.h +++ b/Source/WebKit/chromium/src/WebIDBDatabaseImpl.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -26,19 +26,19 @@ #ifndef WebIDBDatabaseImpl_h #define WebIDBDatabaseImpl_h +#if ENABLE(INDEXED_DATABASE) + #include "WebCommon.h" #include "WebExceptionCode.h" #include "WebIDBDatabase.h" #include <wtf/PassRefPtr.h> #include <wtf/RefPtr.h> -namespace WebCore { -class IDBDatabaseBackendInterface; -class IDBDatabaseCallbacksProxy; -} +namespace WebCore { class IDBDatabaseBackendInterface; } namespace WebKit { +class IDBDatabaseCallbacksProxy; class WebIDBDatabaseCallbacks; class WebIDBObjectStore; class WebIDBTransaction; @@ -63,9 +63,11 @@ public: private: WTF::RefPtr<WebCore::IDBDatabaseBackendInterface> m_databaseBackend; - WTF::RefPtr<WebCore::IDBDatabaseCallbacksProxy> m_databaseCallbacks; + WTF::RefPtr<IDBDatabaseCallbacksProxy> m_databaseCallbacks; }; } // namespace WebKit #endif // WebIDBDatabaseImpl_h + +#endif // ENABLE(INDEXED_DATABASE) diff --git a/Source/WebKit/chromium/src/WebIDBFactoryImpl.cpp b/Source/WebKit/chromium/src/WebIDBFactoryImpl.cpp index 3e21af5..793698e 100755 --- a/Source/WebKit/chromium/src/WebIDBFactoryImpl.cpp +++ b/Source/WebKit/chromium/src/WebIDBFactoryImpl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2011 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 @@ -31,6 +31,8 @@ #include "config.h" #include "WebIDBFactoryImpl.h" +#if ENABLE(INDEXED_DATABASE) + #include "DOMStringList.h" #include "IDBCallbacksProxy.h" #include "IDBFactoryBackendImpl.h" @@ -38,8 +40,6 @@ #include "WebIDBDatabaseError.h" #include <wtf/OwnPtr.h> -#if ENABLE(INDEXED_DATABASE) - using namespace WebCore; namespace WebKit { @@ -50,7 +50,7 @@ WebIDBFactory* WebIDBFactory::create() } WebIDBFactoryImpl::WebIDBFactoryImpl() - : m_idbFactoryBackend(WebCore::IDBFactoryBackendImpl::create()) + : m_idbFactoryBackend(IDBFactoryBackendImpl::create()) { } diff --git a/Source/WebKit/chromium/src/WebIDBFactoryImpl.h b/Source/WebKit/chromium/src/WebIDBFactoryImpl.h index 0ffd289..62bd9ed 100755 --- a/Source/WebKit/chromium/src/WebIDBFactoryImpl.h +++ b/Source/WebKit/chromium/src/WebIDBFactoryImpl.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -29,6 +29,8 @@ #ifndef WebIDBFactoryImpl_h #define WebIDBFactoryImpl_h +#if ENABLE(INDEXED_DATABASE) + #include "WebDOMStringList.h" #include "WebIDBFactory.h" #include <wtf/RefPtr.h> @@ -50,4 +52,6 @@ private: } // namespace WebKit +#endif // ENABLE(INDEXED_DATABASE) + #endif // WebIDBFactoryImpl_h diff --git a/Source/WebKit/chromium/src/WebIDBIndexImpl.cpp b/Source/WebKit/chromium/src/WebIDBIndexImpl.cpp index 6e8e1f2..fa33da9 100644 --- a/Source/WebKit/chromium/src/WebIDBIndexImpl.cpp +++ b/Source/WebKit/chromium/src/WebIDBIndexImpl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -26,6 +26,8 @@ #include "config.h" #include "WebIDBIndexImpl.h" +#if ENABLE(INDEXED_DATABASE) + #include "IDBCallbacksProxy.h" #include "IDBIndex.h" #include "IDBKeyRange.h" @@ -33,8 +35,6 @@ #include "WebIDBKey.h" #include "WebIDBKeyRange.h" -#if ENABLE(INDEXED_DATABASE) - using namespace WebCore; namespace WebKit { @@ -88,6 +88,6 @@ void WebIDBIndexImpl::getKey(const WebIDBKey& keyRange, WebIDBCallbacks* callbac m_backend->getKey(keyRange, IDBCallbacksProxy::create(callbacks), transaction.getIDBTransactionBackendInterface(), ec); } -} // namespace WebCore +} // namespace WebKit #endif // ENABLE(INDEXED_DATABASE) diff --git a/Source/WebKit/chromium/src/WebIDBIndexImpl.h b/Source/WebKit/chromium/src/WebIDBIndexImpl.h index f68da7f..b047c2f 100644 --- a/Source/WebKit/chromium/src/WebIDBIndexImpl.h +++ b/Source/WebKit/chromium/src/WebIDBIndexImpl.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -26,6 +26,8 @@ #ifndef WebIDBIndexImpl_h #define WebIDBIndexImpl_h +#if ENABLE(INDEXED_DATABASE) + #include "WebCommon.h" #include "WebIDBIndex.h" #include <wtf/PassRefPtr.h> @@ -57,4 +59,6 @@ private: } // namespace WebKit +#endif // ENABLE(INDEXED_DATABASE) + #endif // WebIDBIndexImpl_h diff --git a/Source/WebKit/chromium/src/WebIDBKey.cpp b/Source/WebKit/chromium/src/WebIDBKey.cpp index a20146e..f20347a 100644 --- a/Source/WebKit/chromium/src/WebIDBKey.cpp +++ b/Source/WebKit/chromium/src/WebIDBKey.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2011 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 @@ -80,7 +80,7 @@ WebIDBKey WebIDBKey::createFromValueAndKeyPath(const WebSerializedScriptValue& s { if (serializedScriptValue.isNull()) return WebIDBKey::createInvalid(); - return WebCore::createIDBKeyFromSerializedValueAndKeyPath(serializedScriptValue, idbKeyPath); + return createIDBKeyFromSerializedValueAndKeyPath(serializedScriptValue, idbKeyPath); } WebSerializedScriptValue WebIDBKey::injectIDBKeyIntoSerializedValue(const WebIDBKey& key, const WebSerializedScriptValue& value, const WebIDBKeyPath& path) diff --git a/Source/WebKit/chromium/src/WebIDBKeyPath.cpp b/Source/WebKit/chromium/src/WebIDBKeyPath.cpp index 9eb33d6..309c0d9 100644 --- a/Source/WebKit/chromium/src/WebIDBKeyPath.cpp +++ b/Source/WebKit/chromium/src/WebIDBKeyPath.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -67,7 +67,7 @@ void WebIDBKeyPath::reset() m_private.reset(0); } -WebIDBKeyPath::operator const WTF::Vector<WebCore::IDBKeyPathElement, 0>&() const +WebIDBKeyPath::operator const WTF::Vector<IDBKeyPathElement, 0>&() const { return *m_private.get(); } diff --git a/Source/WebKit/chromium/src/WebIDBKeyRange.cpp b/Source/WebKit/chromium/src/WebIDBKeyRange.cpp index 517ff00..ea641e9 100644 --- a/Source/WebKit/chromium/src/WebIDBKeyRange.cpp +++ b/Source/WebKit/chromium/src/WebIDBKeyRange.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -26,11 +26,13 @@ #include "config.h" #include "WebIDBKeyRange.h" +#if ENABLE(INDEXED_DATABASE) + #include "IDBKey.h" #include "IDBKeyRange.h" #include "WebIDBKey.h" -using WebCore::IDBKeyRange; +using namespace WebCore; namespace WebKit { @@ -93,3 +95,5 @@ WebIDBKeyRange::operator PassRefPtr<IDBKeyRange>() const } } // namespace WebKit + +#endif // ENABLE(INDEXED_DATABASE) diff --git a/Source/WebKit/chromium/src/WebIDBObjectStoreImpl.cpp b/Source/WebKit/chromium/src/WebIDBObjectStoreImpl.cpp index 56e354d..0a67f36 100755 --- a/Source/WebKit/chromium/src/WebIDBObjectStoreImpl.cpp +++ b/Source/WebKit/chromium/src/WebIDBObjectStoreImpl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -26,6 +26,8 @@ #include "config.h" #include "WebIDBObjectStoreImpl.h" +#if ENABLE(INDEXED_DATABASE) + #include "DOMStringList.h" #include "IDBCallbacksProxy.h" #include "IDBIndexBackendInterface.h" @@ -37,8 +39,6 @@ #include "WebIDBTransaction.h" #include "WebSerializedScriptValue.h" -#if ENABLE(INDEXED_DATABASE) - using namespace WebCore; namespace WebKit { @@ -113,6 +113,6 @@ void WebIDBObjectStoreImpl::openCursor(const WebIDBKeyRange& keyRange, unsigned m_objectStore->openCursor(keyRange, direction, IDBCallbacksProxy::create(callbacks), transaction.getIDBTransactionBackendInterface(), ec); } -} // namespace WebCore +} // namespace WebKit #endif // ENABLE(INDEXED_DATABASE) diff --git a/Source/WebKit/chromium/src/WebIDBObjectStoreImpl.h b/Source/WebKit/chromium/src/WebIDBObjectStoreImpl.h index 3e2dfab..f1093ed 100755 --- a/Source/WebKit/chromium/src/WebIDBObjectStoreImpl.h +++ b/Source/WebKit/chromium/src/WebIDBObjectStoreImpl.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -26,6 +26,8 @@ #ifndef WebIDBObjectStoreImpl_h #define WebIDBObjectStoreImpl_h +#if ENABLE(INDEXED_DATABASE) + #include "WebCommon.h" #include "WebIDBObjectStore.h" #include <wtf/PassRefPtr.h> @@ -64,4 +66,6 @@ public: } // namespace WebKit +#endif // ENABLE(INDEXED_DATABASE) + #endif // WebIDBObjectStoreImpl_h diff --git a/Source/WebKit/chromium/src/WebIDBTransactionCallbacksImpl.cpp b/Source/WebKit/chromium/src/WebIDBTransactionCallbacksImpl.cpp index 848182e..2f16477 100644 --- a/Source/WebKit/chromium/src/WebIDBTransactionCallbacksImpl.cpp +++ b/Source/WebKit/chromium/src/WebIDBTransactionCallbacksImpl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -30,7 +30,9 @@ #include "IDBTransactionCallbacks.h" -namespace WebCore { +using namespace WebCore; + +namespace WebKit { WebIDBTransactionCallbacksImpl::WebIDBTransactionCallbacksImpl(PassRefPtr<IDBTransactionCallbacks> callbacks) : m_callbacks(callbacks) @@ -51,6 +53,6 @@ void WebIDBTransactionCallbacksImpl::onComplete() m_callbacks->onComplete(); } -} // namespace WebCore +} // namespace WebKit #endif // ENABLE(INDEXED_DATABASE) diff --git a/Source/WebKit/chromium/src/WebIDBTransactionCallbacksImpl.h b/Source/WebKit/chromium/src/WebIDBTransactionCallbacksImpl.h index 416ac3c..8acb095 100644 --- a/Source/WebKit/chromium/src/WebIDBTransactionCallbacksImpl.h +++ b/Source/WebKit/chromium/src/WebIDBTransactionCallbacksImpl.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -32,24 +32,24 @@ #include <wtf/PassRefPtr.h> #include <wtf/RefPtr.h> -namespace WebCore { +namespace WebCore { class IDBTransactionCallbacks; } -class IDBTransactionCallbacks; +namespace WebKit { -class WebIDBTransactionCallbacksImpl : public WebKit::WebIDBTransactionCallbacks { +class WebIDBTransactionCallbacksImpl : public WebIDBTransactionCallbacks { public: - WebIDBTransactionCallbacksImpl(PassRefPtr<IDBTransactionCallbacks>); + WebIDBTransactionCallbacksImpl(PassRefPtr<WebCore::IDBTransactionCallbacks>); virtual ~WebIDBTransactionCallbacksImpl(); virtual void onAbort(); virtual void onComplete(); private: - RefPtr<IDBTransactionCallbacks> m_callbacks; + RefPtr<WebCore::IDBTransactionCallbacks> m_callbacks; }; -} // namespace WebCore +} // namespace WebKit -#endif +#endif // ENABLE(INDEXED_DATABASE) #endif // WebIDBTransactionCallbacksImpl_h diff --git a/Source/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp b/Source/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp index abe9cbf..dbea93e 100644 --- a/Source/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp +++ b/Source/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp @@ -189,12 +189,18 @@ void WebMediaPlayerClientImpl::playbackStateChanged() m_mediaPlayer->playbackStateChanged(); } +WebMediaPlayer::Preload WebMediaPlayerClientImpl::preload() const +{ + if (m_mediaPlayer) + return static_cast<WebMediaPlayer::Preload>(m_mediaPlayer->preload()); + return static_cast<WebMediaPlayer::Preload>(m_preload); +} + // MediaPlayerPrivateInterface ------------------------------------------------- void WebMediaPlayerClientImpl::load(const String& url) { - Frame* frame = static_cast<HTMLMediaElement*>( - m_mediaPlayer->mediaPlayerClient())->document()->frame(); + m_url = url; // Video frame object is owned by WebMediaPlayer. Before destroying // WebMediaPlayer all frames need to be released. @@ -203,9 +209,19 @@ void WebMediaPlayerClientImpl::load(const String& url) m_videoLayer->releaseCurrentFrame(); #endif + if (m_preload == MediaPlayer::None) { + m_webMediaPlayer.clear(); + m_delayingLoad = true; + } else + loadInternal(); +} + +void WebMediaPlayerClientImpl::loadInternal() +{ + Frame* frame = static_cast<HTMLMediaElement*>(m_mediaPlayer->mediaPlayerClient())->document()->frame(); m_webMediaPlayer.set(createWebMediaPlayer(this, frame)); if (m_webMediaPlayer.get()) - m_webMediaPlayer->load(KURL(ParsedURLString, url)); + m_webMediaPlayer->load(KURL(ParsedURLString, m_url)); } void WebMediaPlayerClientImpl::cancelLoad() @@ -242,6 +258,12 @@ void WebMediaPlayerClientImpl::pause() m_webMediaPlayer->pause(); } +void WebMediaPlayerClientImpl::prepareToPlay() +{ + if (m_delayingLoad) + startDelayedLoad(); +} + IntSize WebMediaPlayerClientImpl::naturalSize() const { if (m_webMediaPlayer.get()) @@ -438,10 +460,15 @@ void WebMediaPlayerClientImpl::paintCurrentFrameInContext(GraphicsContext* conte } } -void WebMediaPlayerClientImpl::setAutobuffer(bool autoBuffer) +void WebMediaPlayerClientImpl::setPreload(MediaPlayer::Preload preload) { + m_preload = preload; + if (m_webMediaPlayer.get()) - m_webMediaPlayer->setAutoBuffer(autoBuffer); + m_webMediaPlayer->setPreload(static_cast<WebMediaPlayer::Preload>(preload)); + + if (m_delayingLoad && m_preload != MediaPlayer::None) + startDelayedLoad(); } bool WebMediaPlayerClientImpl::hasSingleSecurityOrigin() const @@ -566,8 +593,20 @@ MediaPlayer::SupportsType WebMediaPlayerClientImpl::supportsType(const String& t return MediaPlayer::IsNotSupported; } +void WebMediaPlayerClientImpl::startDelayedLoad() +{ + ASSERT(m_delayingLoad); + ASSERT(!m_webMediaPlayer.get()); + + m_delayingLoad = false; + + loadInternal(); +} + WebMediaPlayerClientImpl::WebMediaPlayerClientImpl() : m_mediaPlayer(0) + , m_delayingLoad(false) + , m_preload(MediaPlayer::MetaData) #if USE(ACCELERATED_COMPOSITING) , m_videoLayer(0) , m_supportsAcceleratedCompositing(false) diff --git a/Source/WebKit/chromium/src/WebMediaPlayerClientImpl.h b/Source/WebKit/chromium/src/WebMediaPlayerClientImpl.h index 22030b3..a08bb3a 100644 --- a/Source/WebKit/chromium/src/WebMediaPlayerClientImpl.h +++ b/Source/WebKit/chromium/src/WebMediaPlayerClientImpl.h @@ -77,6 +77,7 @@ public: virtual void sawUnsupportedTracks(); virtual float volume() const; virtual void playbackStateChanged(); + virtual WebMediaPlayer::Preload preload() const; // MediaPlayerPrivateInterface methods: virtual void load(const WTF::String& url); @@ -87,6 +88,7 @@ public: virtual WebCore::PlatformMedia platformMedia() const; virtual void play(); virtual void pause(); + virtual void prepareToPlay(); virtual bool supportsFullscreen() const; virtual bool supportsSave() const; virtual WebCore::IntSize naturalSize() const; @@ -106,13 +108,13 @@ public: virtual float maxTimeSeekable() const; virtual WTF::PassRefPtr<WebCore::TimeRanges> buffered() const; virtual int dataRate() const; - virtual void setAutobuffer(bool); virtual bool totalBytesKnown() const; virtual unsigned totalBytes() const; virtual unsigned bytesLoaded() const; virtual void setSize(const WebCore::IntSize&); virtual void paint(WebCore::GraphicsContext*, const WebCore::IntRect&); virtual void paintCurrentFrameInContext(WebCore::GraphicsContext*, const WebCore::IntRect&); + virtual void setPreload(WebCore::MediaPlayer::Preload); virtual bool hasSingleSecurityOrigin() const; virtual WebCore::MediaPlayer::MovieLoadType movieLoadType() const; virtual unsigned decodedFrameCount() const; @@ -129,6 +131,8 @@ public: private: WebMediaPlayerClientImpl(); + void startDelayedLoad(); + void loadInternal(); static WebCore::MediaPlayerPrivateInterface* create(WebCore::MediaPlayer*); static void getSupportedTypes(WTF::HashSet<WTF::String>&); @@ -140,6 +144,9 @@ private: WebCore::MediaPlayer* m_mediaPlayer; OwnPtr<WebMediaPlayer> m_webMediaPlayer; + String m_url; + bool m_delayingLoad; + WebCore::MediaPlayer::Preload m_preload; #if USE(ACCELERATED_COMPOSITING) RefPtr<WebCore::VideoLayerChromium> m_videoLayer; bool m_supportsAcceleratedCompositing; diff --git a/Source/WebKit/chromium/src/WebNode.cpp b/Source/WebKit/chromium/src/WebNode.cpp index 68b6f13..cfb8528 100644 --- a/Source/WebKit/chromium/src/WebNode.cpp +++ b/Source/WebKit/chromium/src/WebNode.cpp @@ -152,7 +152,7 @@ bool WebNode::isFocusable() const bool WebNode::isContentEditable() const { - return m_private->rendererIsEditable(); + return m_private->isContentEditable(); } bool WebNode::isElementNode() const diff --git a/Source/WebKit/chromium/src/WebPageSerializerImpl.cpp b/Source/WebKit/chromium/src/WebPageSerializerImpl.cpp index 4b65b9e..280747f 100644 --- a/Source/WebKit/chromium/src/WebPageSerializerImpl.cpp +++ b/Source/WebKit/chromium/src/WebPageSerializerImpl.cpp @@ -295,7 +295,7 @@ void WebPageSerializerImpl::encodeAndFlushBuffer( status); } -void WebPageSerializerImpl::openTagToString(const Element* element, +void WebPageSerializerImpl::openTagToString(Element* element, SerializeDomParam* param) { // FIXME: use StringBuilder instead of String. @@ -328,11 +328,13 @@ void WebPageSerializerImpl::openTagToString(const Element* element, result += attrValue; else { // Get the absolute link - String completeURL = param->document->completeURL(attrValue); + WebFrameImpl* subFrame = WebFrameImpl::fromFrameOwnerElement(element); + String completeURL = subFrame ? subFrame->frame()->document()->url() : + param->document->completeURL(attrValue); // Check whether we have local files for those link. if (m_localLinks.contains(completeURL)) { - if (!m_localDirectoryName.isEmpty()) - result += "./" + m_localDirectoryName + "/"; + if (!param->directoryName.isEmpty()) + result += "./" + param->directoryName + "/"; result += m_localLinks.get(completeURL); } else result += completeURL; @@ -360,7 +362,7 @@ void WebPageSerializerImpl::openTagToString(const Element* element, } // Serialize end tag of an specified element. -void WebPageSerializerImpl::endTagToString(const Element* element, +void WebPageSerializerImpl::endTagToString(Element* element, SerializeDomParam* param) { bool needSkip; @@ -397,18 +399,18 @@ void WebPageSerializerImpl::endTagToString(const Element* element, saveHTMLContentToBuffer(result, param); } -void WebPageSerializerImpl::buildContentForNode(const Node* node, +void WebPageSerializerImpl::buildContentForNode(Node* node, SerializeDomParam* param) { switch (node->nodeType()) { case Node::ELEMENT_NODE: // Process open tag of element. - openTagToString(static_cast<const Element*>(node), param); + openTagToString(static_cast<Element*>(node), param); // Walk through the children nodes and process it. - for (const Node *child = node->firstChild(); child; child = child->nextSibling()) + for (Node *child = node->firstChild(); child; child = child->nextSibling()) buildContentForNode(child, param); // Process end tag of element. - endTagToString(static_cast<const Element*>(node), param); + endTagToString(static_cast<Element*>(node), param); break; case Node::TEXT_NODE: saveHTMLContentToBuffer(createMarkup(node), param); diff --git a/Source/WebKit/chromium/src/WebPageSerializerImpl.h b/Source/WebKit/chromium/src/WebPageSerializerImpl.h index 5ee8805..b53bd66 100644 --- a/Source/WebKit/chromium/src/WebPageSerializerImpl.h +++ b/Source/WebKit/chromium/src/WebPageSerializerImpl.h @@ -174,13 +174,13 @@ private: SerializeDomParam* param, FlushOption); // Serialize open tag of an specified element. - void openTagToString(const WebCore::Element* element, + void openTagToString(WebCore::Element*, SerializeDomParam* param); // Serialize end tag of an specified element. - void endTagToString(const WebCore::Element* element, + void endTagToString(WebCore::Element*, SerializeDomParam* param); // Build content for a specified node - void buildContentForNode(const WebCore::Node* node, + void buildContentForNode(WebCore::Node*, SerializeDomParam* param); }; diff --git a/Source/WebKit/chromium/src/WebPluginContainerImpl.cpp b/Source/WebKit/chromium/src/WebPluginContainerImpl.cpp index 40f8625..150f173 100644 --- a/Source/WebKit/chromium/src/WebPluginContainerImpl.cpp +++ b/Source/WebKit/chromium/src/WebPluginContainerImpl.cpp @@ -480,12 +480,11 @@ void WebPluginContainerImpl::handleMouseEvent(MouseEvent* event) return; if (event->type() == eventNames().mousedownEvent) { - // Ensure that the frame containing the plugin has focus. Frame* containingFrame = parentView->frame(); if (Page* currentPage = containingFrame->page()) - currentPage->focusController()->setFocusedFrame(containingFrame); - // Give focus to our containing HTMLPluginElement. - containingFrame->document()->setFocusedNode(m_element); + currentPage->focusController()->setFocusedNode(m_element, containingFrame); + else + containingFrame->document()->setFocusedNode(m_element); } WebCursorInfo cursorInfo; diff --git a/Source/WebKit/chromium/src/WebPopupMenuImpl.h b/Source/WebKit/chromium/src/WebPopupMenuImpl.h index 7bb9f7e..58a883f 100644 --- a/Source/WebKit/chromium/src/WebPopupMenuImpl.h +++ b/Source/WebKit/chromium/src/WebPopupMenuImpl.h @@ -78,6 +78,7 @@ public: virtual bool confirmComposition(const WebString& text); virtual WebTextInputType textInputType(); virtual WebRect caretOrSelectionBounds(); + virtual bool selectionRange(WebPoint& start, WebPoint& end) const { return false; } virtual void setTextDirection(WebTextDirection direction); virtual bool isAcceleratedCompositingActive() const { return false; } diff --git a/Source/WebKit/chromium/src/WebRuntimeFeatures.cpp b/Source/WebKit/chromium/src/WebRuntimeFeatures.cpp index 256bf56..5d64cc8 100644 --- a/Source/WebKit/chromium/src/WebRuntimeFeatures.cpp +++ b/Source/WebKit/chromium/src/WebRuntimeFeatures.cpp @@ -320,4 +320,20 @@ bool WebRuntimeFeatures::isJavaScriptI18NAPIEnabled() #endif } +void WebRuntimeFeatures::enableQuota(bool enable) +{ +#if ENABLE(QUOTA) + RuntimeEnabledFeatures::setQuotaEnabled(enable); +#endif +} + +bool WebRuntimeFeatures::isQuotaEnabled() +{ +#if ENABLE(QUOTA) + return RuntimeEnabledFeatures::quotaEnabled(); +#else + return false; +#endif +} + } // namespace WebKit diff --git a/Source/WebKit/chromium/src/WebScrollbarImpl.cpp b/Source/WebKit/chromium/src/WebScrollbarImpl.cpp index 57ea92e..41fac66 100644 --- a/Source/WebKit/chromium/src/WebScrollbarImpl.cpp +++ b/Source/WebKit/chromium/src/WebScrollbarImpl.cpp @@ -281,12 +281,16 @@ void WebScrollbarImpl::invalidateScrollbarRect(Scrollbar*, const IntRect& rect) m_client->invalidateScrollbarRect(this, webrect); } +void WebScrollbarImpl::invalidateScrollCornerRect(const IntRect&) +{ +} + bool WebScrollbarImpl::isActive() const { return true; } -bool WebScrollbarImpl::scrollbarCornerPresent() const +bool WebScrollbarImpl::isScrollCornerVisible() const { return false; } diff --git a/Source/WebKit/chromium/src/WebScrollbarImpl.h b/Source/WebKit/chromium/src/WebScrollbarImpl.h index ac120cf..82fdbfd 100644 --- a/Source/WebKit/chromium/src/WebScrollbarImpl.h +++ b/Source/WebKit/chromium/src/WebScrollbarImpl.h @@ -62,8 +62,10 @@ public: virtual int scrollPosition(WebCore::Scrollbar*) const; virtual void setScrollOffset(const WebCore::IntPoint&); virtual void invalidateScrollbarRect(WebCore::Scrollbar*, const WebCore::IntRect&); + virtual void invalidateScrollCornerRect(const WebCore::IntRect&); virtual bool isActive() const; - virtual bool scrollbarCornerPresent() const; + virtual WebCore::IntRect scrollCornerRect() const { return WebCore::IntRect(); } + virtual bool isScrollCornerVisible() const; virtual void getTickmarks(Vector<WebCore::IntRect>&) const; virtual WebCore::Scrollbar* horizontalScrollbar() const; virtual WebCore::Scrollbar* verticalScrollbar() const; diff --git a/Source/WebKit/chromium/src/WebSettingsImpl.cpp b/Source/WebKit/chromium/src/WebSettingsImpl.cpp index 1089af9..c5b60cc 100644 --- a/Source/WebKit/chromium/src/WebSettingsImpl.cpp +++ b/Source/WebKit/chromium/src/WebSettingsImpl.cpp @@ -343,6 +343,11 @@ void WebSettingsImpl::setAcceleratedCompositingForAnimationEnabled(bool enabled) m_settings->setAcceleratedCompositingForAnimationEnabled(enabled); } +void WebSettingsImpl::setAcceleratedDrawingEnabled(bool enabled) +{ + m_settings->setAcceleratedDrawingEnabled(enabled); +} + void WebSettingsImpl::setAccelerated2dCanvasEnabled(bool enabled) { m_settings->setAccelerated2dCanvasEnabled(enabled); @@ -373,6 +378,11 @@ void WebSettingsImpl::setInteractiveFormValidationEnabled(bool enabled) m_settings->setInteractiveFormValidationEnabled(enabled); } +void WebSettingsImpl::setValidationMessageTimerMagnification(int newValue) +{ + m_settings->setValidationMessageTimerMagnification(newValue); +} + void WebSettingsImpl::setMinimumTimerInterval(double interval) { m_settings->setMinDOMTimerInterval(interval); diff --git a/Source/WebKit/chromium/src/WebSettingsImpl.h b/Source/WebKit/chromium/src/WebSettingsImpl.h index d0319f8..57aa804 100644 --- a/Source/WebKit/chromium/src/WebSettingsImpl.h +++ b/Source/WebKit/chromium/src/WebSettingsImpl.h @@ -101,13 +101,15 @@ public: virtual void setAcceleratedCompositingForVideoEnabled(bool); virtual void setAcceleratedCompositingForPluginsEnabled(bool); virtual void setAcceleratedCompositingForCanvasEnabled(bool); - virtual void setAcceleratedCompositingForAnimationEnabled(bool); + virtual void setAcceleratedCompositingForAnimationEnabled(bool); virtual void setAccelerated2dCanvasEnabled(bool); + virtual void setAcceleratedDrawingEnabled(bool); virtual void setMemoryInfoEnabled(bool); virtual void setHyperlinkAuditingEnabled(bool); virtual void setAsynchronousSpellCheckingEnabled(bool); virtual void setCaretBrowsingEnabled(bool); virtual void setInteractiveFormValidationEnabled(bool); + virtual void setValidationMessageTimerMagnification(int); virtual void setMinimumTimerInterval(double); virtual void setFullScreenEnabled(bool); diff --git a/Source/WebKit/chromium/src/WebStorageQuotaCallbacksImpl.cpp b/Source/WebKit/chromium/src/WebStorageQuotaCallbacksImpl.cpp new file mode 100644 index 0000000..75a3a8a --- /dev/null +++ b/Source/WebKit/chromium/src/WebStorageQuotaCallbacksImpl.cpp @@ -0,0 +1,87 @@ +/* + * Copyright (C) 2011 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 "WebStorageQuotaCallbacksImpl.h" + +#if ENABLE(QUOTA) + +#include "DOMCoreException.h" +#include "StorageInfoErrorCallback.h" +#include "StorageInfoQuotaCallback.h" +#include "StorageInfoUsageCallback.h" + +using namespace WebCore; + +namespace WebKit { + +WebStorageQuotaCallbacksImpl::WebStorageQuotaCallbacksImpl(PassRefPtr<WebCore::StorageInfoUsageCallback> usageCallback, PassRefPtr<WebCore::StorageInfoErrorCallback> errorCallback) + : m_usageCallback(usageCallback) + , m_errorCallback(errorCallback) +{ +} + +WebStorageQuotaCallbacksImpl::WebStorageQuotaCallbacksImpl(PassRefPtr<WebCore::StorageInfoQuotaCallback> quotaCallback, PassRefPtr<WebCore::StorageInfoErrorCallback> errorCallback) + : m_quotaCallback(quotaCallback) + , m_errorCallback(errorCallback) +{ +} + +WebStorageQuotaCallbacksImpl::~WebStorageQuotaCallbacksImpl() +{ +} + +void WebStorageQuotaCallbacksImpl::didQueryStorageUsageAndQuota(unsigned long long usageInBytes, unsigned long long quotaInBytes) +{ + if (m_usageCallback) + m_usageCallback->handleEvent(usageInBytes, quotaInBytes); + delete this; +} + +void WebStorageQuotaCallbacksImpl::didGrantStorageQuota(unsigned long long grantedQuotaInBytes) +{ + if (m_quotaCallback) + m_quotaCallback->handleEvent(grantedQuotaInBytes); + delete this; +} + +void WebStorageQuotaCallbacksImpl::didFail(WebStorageQuotaError error) +{ + if (m_errorCallback) { + ExceptionCodeDescription description; + getExceptionCodeDescription(static_cast<ExceptionCode>(error), description); + m_errorCallback->handleEvent(DOMCoreException::create(description).get()); + } + delete this; +} + +} // namespace WebKit + +#endif // ENABLE(QUOTA) diff --git a/Source/WebKit/chromium/src/WebStorageQuotaCallbacksImpl.h b/Source/WebKit/chromium/src/WebStorageQuotaCallbacksImpl.h new file mode 100644 index 0000000..e8209f5 --- /dev/null +++ b/Source/WebKit/chromium/src/WebStorageQuotaCallbacksImpl.h @@ -0,0 +1,67 @@ +/* + * Copyright (C) 2011 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 WebStorageQuotaCallbacksImpl_h +#define WebStorageQuotaCallbacksImpl_h + +#include "WebStorageQuotaCallbacks.h" +#include <wtf/PassOwnPtr.h> +#include <wtf/PassRefPtr.h> +#include <wtf/RefPtr.h> + +namespace WebCore { +class StorageInfoErrorCallback; +class StorageInfoQuotaCallback; +class StorageInfoUsageCallback; +} + +namespace WebKit { + +class WebStorageQuotaCallbacksImpl : public WebStorageQuotaCallbacks { +public: + // The class is self-destructed and thus we have bare constructors. + WebStorageQuotaCallbacksImpl(PassRefPtr<WebCore::StorageInfoUsageCallback>, PassRefPtr<WebCore::StorageInfoErrorCallback>); + WebStorageQuotaCallbacksImpl(PassRefPtr<WebCore::StorageInfoQuotaCallback>, PassRefPtr<WebCore::StorageInfoErrorCallback>); + + virtual ~WebStorageQuotaCallbacksImpl(); + + virtual void didQueryStorageUsageAndQuota(unsigned long long usageInBytes, unsigned long long quotaInBytes); + virtual void didGrantStorageQuota(unsigned long long grantedQuotaInBytes); + virtual void didFail(WebStorageQuotaError); + +private: + RefPtr<WebCore::StorageInfoUsageCallback> m_usageCallback; + RefPtr<WebCore::StorageInfoQuotaCallback> m_quotaCallback; + RefPtr<WebCore::StorageInfoErrorCallback> m_errorCallback; +}; + +} // namespace WebKit + +#endif // WebStorageQuotaCallbacksImpl_h diff --git a/Source/WebKit/chromium/src/WebTextCheckingCompletionImpl.cpp b/Source/WebKit/chromium/src/WebTextCheckingCompletionImpl.cpp index b9e5227..f5a6604 100644 --- a/Source/WebKit/chromium/src/WebTextCheckingCompletionImpl.cpp +++ b/Source/WebKit/chromium/src/WebTextCheckingCompletionImpl.cpp @@ -34,16 +34,31 @@ #include "SpellChecker.h" #include "WebTextCheckingResult.h" #include "WebVector.h" +#include <wtf/Assertions.h> using namespace WebCore; namespace WebKit { -static Vector<SpellCheckingResult> toCoreResults(const WebVector<WebTextCheckingResult>& results) +static TextCheckingType toCoreCheckingType(WebTextCheckingResult::Error error) { - Vector<SpellCheckingResult> coreResults; - for (size_t i = 0; i < results.size(); ++i) - coreResults.append(SpellCheckingResult(static_cast<DocumentMarker::MarkerType>(results[i].error), results[i].position, results[i].length)); + if (error == WebTextCheckingResult::ErrorSpelling) + return TextCheckingTypeSpelling; + ASSERT(error == WebTextCheckingResult::ErrorGrammar); + return TextCheckingTypeGrammar; +} + +static Vector<TextCheckingResult> toCoreResults(const WebVector<WebTextCheckingResult>& results) +{ + Vector<TextCheckingResult> coreResults; + for (size_t i = 0; i < results.size(); ++i) { + TextCheckingResult coreResult; + coreResult.type = toCoreCheckingType(results[i].error); + coreResult.location = results[i].position; + coreResult.length = results[i].length; + coreResults.append(coreResult); + } + return coreResults; } diff --git a/Source/WebKit/chromium/src/WebViewImpl.cpp b/Source/WebKit/chromium/src/WebViewImpl.cpp index 4efa880..2438a94 100644 --- a/Source/WebKit/chromium/src/WebViewImpl.cpp +++ b/Source/WebKit/chromium/src/WebViewImpl.cpp @@ -102,6 +102,7 @@ #include "WebDevToolsAgentPrivate.h" #include "WebDragData.h" #include "WebFrameImpl.h" +#include "WebGraphicsContext3D.h" #include "WebImage.h" #include "WebInputElement.h" #include "WebInputEvent.h" @@ -125,7 +126,7 @@ #include <wtf/CurrentTime.h> #include <wtf/RefPtr.h> -#if PLATFORM(CG) +#if USE(CG) #include <CoreGraphics/CGBitmapContext.h> #include <CoreGraphics/CGContext.h> #endif @@ -620,11 +621,6 @@ bool WebViewImpl::keyEvent(const WebKeyboardEvent& event) } #endif // OS(WINDOWS) || OS(LINUX) || OS(FREEBSD) - // It's not clear if we should continue after detecting a capslock keypress. - // I'll err on the side of continuing, which is the pre-existing behaviour. - if (event.windowsKeyCode == VKEY_CAPITAL) - handler->capsLockStateMayHaveChanged(); - PlatformKeyboardEventBuilder evt(event); if (handler->keyEvent(evt)) { @@ -1043,7 +1039,7 @@ void WebViewImpl::doPixelReadbackToCanvas(WebCanvas* canvas, const IntRect& rect // PlatformGraphicsContext is actually a pointer to PlatformContextSkia GraphicsContext gc(reinterpret_cast<PlatformGraphicsContext*>(&context)); int bitmapHeight = canvas->getDevice()->accessBitmap(false).height(); -#elif PLATFORM(CG) +#elif USE(CG) GraphicsContext gc(canvas); int bitmapHeight = CGBitmapContextGetHeight(reinterpret_cast<CGContextRef>(canvas)); #else @@ -1273,7 +1269,7 @@ void WebViewImpl::setFocus(bool enable) Element* element = static_cast<Element*>(focusedNode); if (element->isTextFormControl()) element->updateFocusAppearance(true); - else if (focusedNode->rendererIsEditable()) { + else if (focusedNode->isContentEditable()) { // updateFocusAppearance() selects all the text of // contentseditable DIVs. So we set the selection explicitly // instead. Note that this has the side effect of moving the @@ -1335,7 +1331,7 @@ bool WebViewImpl::setComposition( PassRefPtr<Range> range = editor->compositionRange(); if (range) { const Node* node = range->startContainer(); - if (!node || !node->rendererIsEditable()) + if (!node || !node->isContentEditable()) return false; } @@ -1384,7 +1380,7 @@ bool WebViewImpl::confirmComposition(const WebString& text) PassRefPtr<Range> range = editor->compositionRange(); if (range) { const Node* node = range->startContainer(); - if (!node || !node->rendererIsEditable()) + if (!node || !node->isContentEditable()) return false; } @@ -1443,22 +1439,53 @@ WebRect WebViewImpl::caretOrSelectionBounds() if (!view) return rect; - const Node* node = controller->start().deprecatedNode(); + const Node* node = controller->base().containerNode(); if (!node || !node->renderer()) return rect; if (controller->isCaret()) rect = view->contentsToWindow(controller->absoluteCaretBounds()); else if (controller->isRange()) { - node = controller->end().deprecatedNode(); - if (!node || !node->renderer()) - return rect; + node = controller->extent().containerNode(); RefPtr<Range> range = controller->toNormalizedRange(); + if (!node || !node->renderer() || !range) + return rect; rect = view->contentsToWindow(focused->editor()->firstRectForRange(range.get())); } return rect; } +bool WebViewImpl::selectionRange(WebPoint& start, WebPoint& end) const +{ + const Frame* frame = focusedWebCoreFrame(); + if (!frame) + return false; + RefPtr<Range> selectedRange = frame->selection()->toNormalizedRange(); + RefPtr<Range> range(Range::create(selectedRange->startContainer()->document(), + selectedRange->startContainer(), + selectedRange->startOffset(), + selectedRange->startContainer(), + selectedRange->startOffset())); + + IntRect rect = frame->editor()->firstRectForRange(range.get()); + start.x = rect.x(); + start.y = rect.y() + rect.height() - 1; + + range = Range::create(selectedRange->endContainer()->document(), + selectedRange->endContainer(), + selectedRange->endOffset(), + selectedRange->endContainer(), + selectedRange->endOffset()); + + rect = frame->editor()->firstRectForRange(range.get()); + end.x = rect.x() + rect.width() - 1; + end.y = rect.y() + rect.height() - 1; + + start = frame->view()->contentsToWindow(start); + end = frame->view()->contentsToWindow(end); + return true; +} + void WebViewImpl::setTextDirection(WebTextDirection direction) { // The Editor::setBaseWritingDirection() function checks if we can change @@ -1793,21 +1820,6 @@ void WebViewImpl::dragSourceSystemDragEnded() } WebDragOperation WebViewImpl::dragTargetDragEnter( - const WebDragData& webDragData, int identity, // FIXME: remove identity from this function signature. - const WebPoint& clientPoint, - const WebPoint& screenPoint, - WebDragOperationsMask operationsAllowed) -{ - ASSERT(!m_currentDragData.get()); - - m_currentDragData = webDragData; - UNUSED_PARAM(identity); - m_operationsAllowed = operationsAllowed; - - return dragTargetDragEnterOrOver(clientPoint, screenPoint, DragEnter); -} - -WebDragOperation WebViewImpl::dragTargetDragEnter( const WebDragData& webDragData, const WebPoint& clientPoint, const WebPoint& screenPoint, @@ -2367,35 +2379,6 @@ private: WebViewImpl* m_webViewImpl; }; -class WebViewImplScrollbarPainter : public TilePaintInterface { - WTF_MAKE_NONCOPYABLE(WebViewImplScrollbarPainter); -public: - static PassOwnPtr<WebViewImplScrollbarPainter> create(WebViewImpl* webViewImpl) - { - return adoptPtr(new WebViewImplScrollbarPainter(webViewImpl)); - } - - virtual void paint(GraphicsContext& context, const IntRect& contentRect) - { - Page* page = m_webViewImpl->page(); - if (!page) - return; - FrameView* view = page->mainFrame()->view(); - - context.translate(static_cast<float>(view->scrollX()), static_cast<float>(view->scrollY())); - IntRect windowRect = view->contentsToWindow(contentRect); - view->paintScrollbars(&context, windowRect); - } - -private: - explicit WebViewImplScrollbarPainter(WebViewImpl* webViewImpl) - : m_webViewImpl(webViewImpl) - { - } - - WebViewImpl* m_webViewImpl; -}; - void WebViewImpl::setIsAcceleratedCompositingActive(bool active) { PlatformBridge::histogramEnumeration("GPU.setIsAcceleratedCompositingActive", active * 2 + m_isAcceleratedCompositingActive, 4); @@ -2425,7 +2408,8 @@ void WebViewImpl::setIsAcceleratedCompositingActive(bool active) context->reshape(std::max(1, m_size.width), std::max(1, m_size.height)); } - m_layerRenderer = LayerRendererChromium::create(context.release(), WebViewImplContentPainter::create(this), WebViewImplScrollbarPainter::create(this)); + + m_layerRenderer = LayerRendererChromium::create(context.release(), WebViewImplContentPainter::create(this)); if (m_layerRenderer) { m_client->didActivateAcceleratedCompositing(true); m_isAcceleratedCompositingActive = true; @@ -2463,10 +2447,13 @@ void WebViewImpl::doComposite() void WebViewImpl::reallocateRenderer() { - RefPtr<GraphicsContext3D> newContext = GraphicsContext3D::create( + RefPtr<GraphicsContext3D> newContext = m_temporaryOnscreenGraphicsContext3D.get(); + WebGraphicsContext3D* webContext = GraphicsContext3DInternal::extractWebGraphicsContext3D(newContext.get()); + if (!newContext || !webContext || webContext->isContextLost()) + newContext = GraphicsContext3D::create( getCompositorContextAttributes(), m_page->chrome(), GraphicsContext3D::RenderDirectlyToHostWindow); // GraphicsContext3D::create might fail and return 0, in that case LayerRendererChromium::create will also return 0. - RefPtr<LayerRendererChromium> layerRenderer = LayerRendererChromium::create(newContext, WebViewImplContentPainter::create(this), WebViewImplScrollbarPainter::create(this)); + RefPtr<LayerRendererChromium> layerRenderer = LayerRendererChromium::create(newContext, WebViewImplContentPainter::create(this)); // Reattach the root layer. Child layers will get reattached as a side effect of updateLayersRecursive. if (layerRenderer) { @@ -2506,18 +2493,20 @@ WebGraphicsContext3D* WebViewImpl::graphicsContext3D() { #if USE(ACCELERATED_COMPOSITING) if (m_page->settings()->acceleratedCompositingEnabled() && allowsAcceleratedCompositing()) { - GraphicsContext3D* context = 0; - if (m_layerRenderer) - context = m_layerRenderer->context(); - else if (m_temporaryOnscreenGraphicsContext3D) - context = m_temporaryOnscreenGraphicsContext3D.get(); - else { - m_temporaryOnscreenGraphicsContext3D = GraphicsContext3D::create(getCompositorContextAttributes(), m_page->chrome(), GraphicsContext3D::RenderDirectlyToHostWindow); - if (m_temporaryOnscreenGraphicsContext3D) - m_temporaryOnscreenGraphicsContext3D->reshape(std::max(1, m_size.width), std::max(1, m_size.height)); - context = m_temporaryOnscreenGraphicsContext3D.get(); + if (m_layerRenderer) { + WebGraphicsContext3D* webContext = GraphicsContext3DInternal::extractWebGraphicsContext3D(m_layerRenderer->context()); + if (webContext && !webContext->isContextLost()) + return webContext; + } + if (m_temporaryOnscreenGraphicsContext3D) { + WebGraphicsContext3D* webContext = GraphicsContext3DInternal::extractWebGraphicsContext3D(m_temporaryOnscreenGraphicsContext3D.get()); + if (webContext && !webContext->isContextLost()) + return webContext; } - return GraphicsContext3DInternal::extractWebGraphicsContext3D(context); + m_temporaryOnscreenGraphicsContext3D = GraphicsContext3D::create(getCompositorContextAttributes(), m_page->chrome(), GraphicsContext3D::RenderDirectlyToHostWindow); + if (m_temporaryOnscreenGraphicsContext3D) + m_temporaryOnscreenGraphicsContext3D->reshape(std::max(1, m_size.width), std::max(1, m_size.height)); + return GraphicsContext3DInternal::extractWebGraphicsContext3D(m_temporaryOnscreenGraphicsContext3D.get()); } #endif return 0; diff --git a/Source/WebKit/chromium/src/WebViewImpl.h b/Source/WebKit/chromium/src/WebViewImpl.h index 66b2908..f10202f 100644 --- a/Source/WebKit/chromium/src/WebViewImpl.h +++ b/Source/WebKit/chromium/src/WebViewImpl.h @@ -109,6 +109,7 @@ public: virtual bool confirmComposition(const WebString& text); virtual WebTextInputType textInputType(); virtual WebRect caretOrSelectionBounds(); + virtual bool selectionRange(WebPoint& start, WebPoint& end) const; virtual void setTextDirection(WebTextDirection direction); virtual bool isAcceleratedCompositingActive() const; @@ -157,11 +158,6 @@ public: WebDragOperation operation); virtual void dragSourceSystemDragEnded(); virtual WebDragOperation dragTargetDragEnter( - const WebDragData&, int identity, // FIXME: remove identity from this function signature. - const WebPoint& clientPoint, - const WebPoint& screenPoint, - WebDragOperationsMask operationsAllowed); - virtual WebDragOperation dragTargetDragEnter( const WebDragData&, const WebPoint& clientPoint, const WebPoint& screenPoint, diff --git a/Source/WebKit/chromium/src/WorkerFileSystemCallbacksBridge.cpp b/Source/WebKit/chromium/src/WorkerFileSystemCallbacksBridge.cpp index d05322f..5147e15 100644 --- a/Source/WebKit/chromium/src/WorkerFileSystemCallbacksBridge.cpp +++ b/Source/WebKit/chromium/src/WorkerFileSystemCallbacksBridge.cpp @@ -45,6 +45,7 @@ #include "WorkerThread.h" #include <wtf/MainThread.h> #include <wtf/Threading.h> +#include <wtf/UnusedParam.h> namespace WebCore { @@ -337,26 +338,14 @@ void WorkerFileSystemCallbacksBridge::didReadDirectoryOnWorkerThread(ScriptExecu bridge->m_callbacksOnWorkerThread->didReadDirectory(entries, hasMore); } -bool WorkerFileSystemCallbacksBridge::derefIfWorkerIsStopped() -{ - WebWorkerBase* worker = 0; - { - MutexLocker locker(m_mutex); - worker = m_worker; - } - if (!worker) { - m_selfRef.clear(); - return true; - } - return false; -} - -void WorkerFileSystemCallbacksBridge::runTaskOnMainThread(WebCore::ScriptExecutionContext* scriptExecutionContext, WorkerFileSystemCallbacksBridge* bridge, PassOwnPtr<WebCore::ScriptExecutionContext::Task> taskToRun) +void WorkerFileSystemCallbacksBridge::runTaskOnMainThread(WebCore::ScriptExecutionContext* scriptExecutionContext, PassRefPtr<WorkerFileSystemCallbacksBridge> bridge, PassOwnPtr<WebCore::ScriptExecutionContext::Task> taskToRun) { ASSERT(isMainThread()); - if (bridge->derefIfWorkerIsStopped()) - return; + + // Every task run will result in one call to mayPostTaskToWorker, which is where this ref is released. + WorkerFileSystemCallbacksBridge* leaked = bridge.leakRef(); + UNUSED_PARAM(leaked); taskToRun->performTask(scriptExecutionContext); } @@ -372,19 +361,22 @@ void WorkerFileSystemCallbacksBridge::runTaskOnWorkerThread(WebCore::ScriptExecu void WorkerFileSystemCallbacksBridge::dispatchTaskToMainThread(PassOwnPtr<WebCore::ScriptExecutionContext::Task> task) { - ASSERT(!m_selfRef); ASSERT(m_worker); ASSERT(m_workerContext->isContextThread()); - m_selfRef = this; - m_worker->dispatchTaskToMainThread(createCallbackTask(&runTaskOnMainThread, this, task)); + m_worker->dispatchTaskToMainThread(createCallbackTask(&runTaskOnMainThread, RefPtr<WorkerFileSystemCallbacksBridge>(this).release(), task)); } void WorkerFileSystemCallbacksBridge::mayPostTaskToWorker(PassOwnPtr<ScriptExecutionContext::Task> task, const String& mode) { ASSERT(isMainThread()); + + // Balancing out the ref() done in runTaskOnMainThread. (Since m_mutex is a member and the deref may result + // in the destruction of WorkerFileSystemCallbacksBridge, the ordering of the RefPtr and the MutexLocker + // is very important, to ensure that the m_mutex is still valid when it gets unlocked.) + RefPtr<WorkerFileSystemCallbacksBridge> bridge = adoptRef(this); MutexLocker locker(m_mutex); if (m_worker) - m_worker->postTaskForModeToWorkerContext(createCallbackTask(&runTaskOnWorkerThread, m_selfRef.release(), task), mode); + m_worker->postTaskForModeToWorkerContext(createCallbackTask(&runTaskOnWorkerThread, bridge, task), mode); } } // namespace WebCore diff --git a/Source/WebKit/chromium/src/WorkerFileSystemCallbacksBridge.h b/Source/WebKit/chromium/src/WorkerFileSystemCallbacksBridge.h index 9a869dc..5af8529 100644 --- a/Source/WebKit/chromium/src/WorkerFileSystemCallbacksBridge.h +++ b/Source/WebKit/chromium/src/WorkerFileSystemCallbacksBridge.h @@ -122,25 +122,18 @@ private: friend class MainThreadFileSystemCallbacks; // Methods that dispatch WebFileSystemCallbacks on the worker threads. - // They release a selfRef of the WorkerFileSystemCallbacksBridge. static void didFailOnWorkerThread(WebCore::ScriptExecutionContext*, WorkerFileSystemCallbacksBridge*, WebFileError); static void didOpenFileSystemOnWorkerThread(WebCore::ScriptExecutionContext*, WorkerFileSystemCallbacksBridge*, const String& name, const String& rootPath); static void didSucceedOnWorkerThread(WebCore::ScriptExecutionContext*, WorkerFileSystemCallbacksBridge*); static void didReadMetadataOnWorkerThread(WebCore::ScriptExecutionContext*, WorkerFileSystemCallbacksBridge*, const WebFileInfo&); static void didReadDirectoryOnWorkerThread(WebCore::ScriptExecutionContext*, WorkerFileSystemCallbacksBridge*, const WebVector<WebFileSystemEntry>&, bool hasMore); - // For early-exist; this deref's selfRef and returns true if the worker is already null. - bool derefIfWorkerIsStopped(); - - static void runTaskOnMainThread(WebCore::ScriptExecutionContext*, WorkerFileSystemCallbacksBridge*, PassOwnPtr<WebCore::ScriptExecutionContext::Task>); + static void runTaskOnMainThread(WebCore::ScriptExecutionContext*, PassRefPtr<WorkerFileSystemCallbacksBridge>, PassOwnPtr<WebCore::ScriptExecutionContext::Task>); static void runTaskOnWorkerThread(WebCore::ScriptExecutionContext*, PassRefPtr<WorkerFileSystemCallbacksBridge>, PassOwnPtr<WebCore::ScriptExecutionContext::Task>); void dispatchTaskToMainThread(PassOwnPtr<WebCore::ScriptExecutionContext::Task>); void mayPostTaskToWorker(PassOwnPtr<WebCore::ScriptExecutionContext::Task>, const String& mode); - // m_selfRef keeps a reference to itself while there's a pending callback on the main thread. - RefPtr<WorkerFileSystemCallbacksBridge> m_selfRef; - Mutex m_mutex; WebWorkerBase* m_worker; WebCore::ScriptExecutionContext* m_workerContext; diff --git a/Source/WebKit/chromium/src/js/DevTools.js b/Source/WebKit/chromium/src/js/DevTools.js index 7a3eb8d..e6b7537 100644 --- a/Source/WebKit/chromium/src/js/DevTools.js +++ b/Source/WebKit/chromium/src/js/DevTools.js @@ -169,6 +169,10 @@ WebInspector.platformExtensionAPI = function(tabId) return tabId; } webInspector.inspectedWindow.__proto__.__defineGetter__("tabId", getTabId); + chrome = window.chrome || {}; + chrome.devTools = chrome.devTools || {}; + for (var property in webInspector) + chrome.devTools[property] = webInspector[property]; } WebInspector.buildPlatformExtensionAPI = function() diff --git a/Source/WebKit/chromium/src/js/Tests.js b/Source/WebKit/chromium/src/js/Tests.js index 1d98656..220cf89 100644 --- a/Source/WebKit/chromium/src/js/Tests.js +++ b/Source/WebKit/chromium/src/js/Tests.js @@ -81,7 +81,6 @@ TestSuite.prototype.assertEquals = function(expected, actual, opt_message) } }; - /** * True assertion tests that value == true. * @param {Object} value Actual object. @@ -522,6 +521,105 @@ TestSuite.prototype.testPauseWhenScriptIsRunning = function() /** + * Tests network size. + */ +TestSuite.prototype.testNetworkSize = function() +{ + var test = this; + + function finishResource(resource, finishTime) + { + test.assertEquals(221, resource.transferSize, "Incorrect total encoded data length"); + test.assertEquals(25, resource.resourceSize, "Incorrect total data length"); + test.releaseControl(); + } + + this.addSniffer(WebInspector.NetworkDispatcher.prototype, "_finishResource", finishResource); + + // Reload inspected page to sniff network events + test.evaluateInConsole_("window.location.reload(true);", function(resultText) {}); + + this.takeControl(); +}; + + +/** + * Tests network sync size. + */ +TestSuite.prototype.testNetworkSyncSize = function() +{ + var test = this; + + function finishResource(resource, finishTime) + { + test.assertEquals(221, resource.transferSize, "Incorrect total encoded data length"); + test.assertEquals(25, resource.resourceSize, "Incorrect total data length"); + test.releaseControl(); + } + + this.addSniffer(WebInspector.NetworkDispatcher.prototype, "_finishResource", finishResource); + + // Send synchronous XHR to sniff network events + test.evaluateInConsole_("var xhr = new XMLHttpRequest(); xhr.open(\"GET\", \"chunked\", false); xhr.send(null);", function() {}); + + this.takeControl(); +}; + + +/** + * Tests network raw headers text. + */ +TestSuite.prototype.testNetworkRawHeadersText = function() +{ + var test = this; + + function finishResource(resource, finishTime) + { + var rawResponseHeadersText = resource.rawResponseHeadersText + if (!rawResponseHeadersText) + test.fail("Failure: resource does not have raw response header text"); + test.assertEquals(166, resource.rawResponseHeadersText.length, "Incorrect raw response header text length"); + test.releaseControl(); + } + + this.addSniffer(WebInspector.NetworkDispatcher.prototype, "_finishResource", finishResource); + + // Reload inspected page to sniff network events + test.evaluateInConsole_("window.location.reload(true);", function(resultText) {}); + + this.takeControl(); +}; + + +/** + * Tests network timing. + */ +TestSuite.prototype.testNetworkTiming = function() +{ + var test = this; + + function finishResource(resource, finishTime) + { + test.assertTrue(resource.timing.receiveHeadersEnd - resource.timing.connectStart >= 100, + "Time between receiveHeadersEnd and connectStart should be >=100ms, but was " + + "receiveHeadersEnd=" + resource.timing.receiveHeadersEnd + ", connectStart=" + resource.timing.connectStart + "."); + test.assertTrue(resource.endTime - resource.startTime >= 0.2, + "Time between endTime and startTime should be >=200ms, but was " + + "endtime=" + resource.endTime + ", startTime=" + resource.startTime + "."); + + test.releaseControl(); + } + + this.addSniffer(WebInspector.NetworkDispatcher.prototype, "_finishResource", finishResource); + + // Reload inspected page to sniff network events + test.evaluateInConsole_("window.location.reload(true);", function(resultText) {}); + + this.takeControl(); +}; + + +/** * Serializes options collection to string. * @param {HTMLOptionsCollection} options * @return {string} |