diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-05-11 09:43:24 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-05-11 09:43:24 +0200 |
commit | 1b914638db989aaa98631a1c1e02c7b2d44805d8 (patch) | |
tree | 87f4fd2c7b38db320079a5de8877890d2ca3c485 /Source/WebKit/chromium/src | |
parent | 2cf6c8816a73e0132bd8fa3b509d62d7c51b6e47 (diff) | |
download | qtwebkit-1b914638db989aaa98631a1c1e02c7b2d44805d8.tar.gz |
Imported WebKit commit 9a52e27980f47e8b0d8f8b7cc0fd7b5741bceb92 (http://svn.webkit.org/repository/webkit/trunk@116736)
New snapshot to include QDeclarative* -> QQml* build fixes
Diffstat (limited to 'Source/WebKit/chromium/src')
42 files changed, 290 insertions, 730 deletions
diff --git a/Source/WebKit/chromium/src/AssertMatchingEnums.cpp b/Source/WebKit/chromium/src/AssertMatchingEnums.cpp index 9f39fc372..322f15046 100644 --- a/Source/WebKit/chromium/src/AssertMatchingEnums.cpp +++ b/Source/WebKit/chromium/src/AssertMatchingEnums.cpp @@ -99,12 +99,12 @@ #include "WebTextCheckingResult.h" #include "WebTextCheckingType.h" #include "WebView.h" -#include "platform/WebClipboard.h" -#include "platform/WebFileSystem.h" #include "platform/WebICEOptions.h" #include "platform/WebMediaStreamSource.h" #include "platform/WebPeerConnection00Handler.h" #include "platform/WebPeerConnection00HandlerClient.h" +#include <public/WebClipboard.h> +#include <public/WebFileSystem.h> #include <public/WebFilterOperation.h> #include <public/WebReferrerPolicy.h> #include <wtf/Assertions.h> diff --git a/Source/WebKit/chromium/src/AsyncFileSystemChromium.cpp b/Source/WebKit/chromium/src/AsyncFileSystemChromium.cpp index d2026d330..eb5021003 100644 --- a/Source/WebKit/chromium/src/AsyncFileSystemChromium.cpp +++ b/Source/WebKit/chromium/src/AsyncFileSystemChromium.cpp @@ -44,6 +44,8 @@ #include "WebKit.h" #include "platform/WebFileSystem.h" #include "platform/WebKitPlatformSupport.h" +#include <public/Platform.h> +#include <public/WebFileSystem.h> #include <wtf/text/CString.h> #include <wtf/text/StringBuilder.h> @@ -51,12 +53,6 @@ namespace WebCore { namespace { -// For isolated filesystem. -const char isolatedPathPrefix[] = "isolated"; - -// For external filesystem. -const char externalPathPrefix[] = "external"; - // Specialized callback class for createSnapshotFileAndReadMetadata. class SnapshotFileCallbacks : public AsyncFileSystemCallbacks { public: @@ -101,149 +97,64 @@ bool AsyncFileSystem::isAvailable() return true; } -// static -bool AsyncFileSystem::crackFileSystemURL(const KURL& url, FileSystemType& type, String& filePath) -{ - if (!url.protocolIs("filesystem")) - return false; - - if (url.innerURL()) { - String typeString = url.innerURL()->path().substring(1); - if (typeString == temporaryPathPrefix) - type = FileSystemTypeTemporary; - else if (typeString == persistentPathPrefix) - type = FileSystemTypePersistent; - else if (typeString == externalPathPrefix) - type = FileSystemTypeExternal; - else - return false; - - filePath = decodeURLEscapeSequences(url.path()); - } - return true; -} - -// static -bool AsyncFileSystem::isValidType(FileSystemType type) -{ - return type == FileSystemTypeTemporary || type == FileSystemTypePersistent || type == FileSystemTypeExternal; -} - -AsyncFileSystemChromium::AsyncFileSystemChromium(FileSystemType type, const KURL& rootURL) - : AsyncFileSystem(type) - , m_webFileSystem(WebKit::webKitPlatformSupport()->fileSystem()) - , m_filesystemRootURL(rootURL) +AsyncFileSystemChromium::AsyncFileSystemChromium() + : m_webFileSystem(WebKit::webKitPlatformSupport()->fileSystem()) { ASSERT(m_webFileSystem); } -// static -String AsyncFileSystemChromium::createIsolatedFileSystemName(const String& storageIdentifier, const String& filesystemId) -{ - StringBuilder filesystemName; - filesystemName.append(storageIdentifier); - filesystemName.append(":"); - filesystemName.append(isolatedPathPrefix); - filesystemName.append("_"); - filesystemName.append(filesystemId); - return filesystemName.toString(); -} - -// static -PassOwnPtr<AsyncFileSystem> AsyncFileSystemChromium::createIsolatedFileSystem(const String& originString, const String& filesystemId) -{ - // The rootURL is used in succeeding filesystem requests sent to the - // chromium and is validated each time in the browser process. - StringBuilder rootURL; - rootURL.append("filesystem:"); - rootURL.append(originString); - rootURL.append("/"); - rootURL.append(isolatedPathPrefix); - rootURL.append("/"); - rootURL.append(filesystemId); - rootURL.append("/"); - - return AsyncFileSystemChromium::create(FileSystemTypeIsolated, KURL(ParsedURLString, rootURL.toString())); -} - AsyncFileSystemChromium::~AsyncFileSystemChromium() { } -KURL AsyncFileSystemChromium::toURL(const String& originString, const String& fullPath) const -{ - ASSERT(!originString.isEmpty()); - if (originString == "null") - return KURL(); - - // For now we don't support toURL for isolated filesystem (until we resolve the isolated filesystem lifetime issue). - if (type() == FileSystemTypeIsolated) - return KURL(); - - if (type() == FileSystemTypeExternal) { - // For external filesystem originString could be different from what we have in m_filesystemRootURL. - StringBuilder result; - result.append("filesystem:"); - result.append(originString); - result.append("/"); - result.append(externalPathPrefix); - result.append(encodeWithURLEscapeSequences(fullPath)); - return KURL(ParsedURLString, result.toString()); - } - - // For regular types we can just call virtualPathToFileSystemURL which appends the fullPath to the m_filesystemRootURL that should look like 'filesystem:<origin>/<typePrefix>'. - ASSERT(SecurityOrigin::create(m_filesystemRootURL)->toString() == originString); - return KURL(ParsedURLString, virtualPathToFileSystemURL(fullPath)); -} - -void AsyncFileSystemChromium::move(const String& sourcePath, const String& destinationPath, PassOwnPtr<AsyncFileSystemCallbacks> callbacks) +void AsyncFileSystemChromium::move(const KURL& sourcePath, const KURL& destinationPath, PassOwnPtr<AsyncFileSystemCallbacks> callbacks) { - m_webFileSystem->move(virtualPathToFileSystemURL(sourcePath), virtualPathToFileSystemURL(destinationPath), new WebKit::WebFileSystemCallbacksImpl(callbacks)); + m_webFileSystem->move(sourcePath, destinationPath, new WebKit::WebFileSystemCallbacksImpl(callbacks)); } -void AsyncFileSystemChromium::copy(const String& sourcePath, const String& destinationPath, PassOwnPtr<AsyncFileSystemCallbacks> callbacks) +void AsyncFileSystemChromium::copy(const KURL& sourcePath, const KURL& destinationPath, PassOwnPtr<AsyncFileSystemCallbacks> callbacks) { - m_webFileSystem->copy(virtualPathToFileSystemURL(sourcePath), virtualPathToFileSystemURL(destinationPath), new WebKit::WebFileSystemCallbacksImpl(callbacks)); + m_webFileSystem->copy(sourcePath, destinationPath, new WebKit::WebFileSystemCallbacksImpl(callbacks)); } -void AsyncFileSystemChromium::remove(const String& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks) +void AsyncFileSystemChromium::remove(const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks) { - m_webFileSystem->remove(virtualPathToFileSystemURL(path), new WebKit::WebFileSystemCallbacksImpl(callbacks)); + m_webFileSystem->remove(path, new WebKit::WebFileSystemCallbacksImpl(callbacks)); } -void AsyncFileSystemChromium::removeRecursively(const String& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks) +void AsyncFileSystemChromium::removeRecursively(const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks) { - m_webFileSystem->removeRecursively(virtualPathToFileSystemURL(path), new WebKit::WebFileSystemCallbacksImpl(callbacks)); + m_webFileSystem->removeRecursively(path, new WebKit::WebFileSystemCallbacksImpl(callbacks)); } -void AsyncFileSystemChromium::readMetadata(const String& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks) +void AsyncFileSystemChromium::readMetadata(const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks) { - m_webFileSystem->readMetadata(virtualPathToFileSystemURL(path), new WebKit::WebFileSystemCallbacksImpl(callbacks)); + m_webFileSystem->readMetadata(path, new WebKit::WebFileSystemCallbacksImpl(callbacks)); } -void AsyncFileSystemChromium::createFile(const String& path, bool exclusive, PassOwnPtr<AsyncFileSystemCallbacks> callbacks) +void AsyncFileSystemChromium::createFile(const KURL& path, bool exclusive, PassOwnPtr<AsyncFileSystemCallbacks> callbacks) { - m_webFileSystem->createFile(virtualPathToFileSystemURL(path), exclusive, new WebKit::WebFileSystemCallbacksImpl(callbacks)); + m_webFileSystem->createFile(path, exclusive, new WebKit::WebFileSystemCallbacksImpl(callbacks)); } -void AsyncFileSystemChromium::createDirectory(const String& path, bool exclusive, PassOwnPtr<AsyncFileSystemCallbacks> callbacks) +void AsyncFileSystemChromium::createDirectory(const KURL& path, bool exclusive, PassOwnPtr<AsyncFileSystemCallbacks> callbacks) { - m_webFileSystem->createDirectory(virtualPathToFileSystemURL(path), exclusive, new WebKit::WebFileSystemCallbacksImpl(callbacks)); + m_webFileSystem->createDirectory(path, exclusive, new WebKit::WebFileSystemCallbacksImpl(callbacks)); } -void AsyncFileSystemChromium::fileExists(const String& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks) +void AsyncFileSystemChromium::fileExists(const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks) { - m_webFileSystem->fileExists(virtualPathToFileSystemURL(path), new WebKit::WebFileSystemCallbacksImpl(callbacks)); + m_webFileSystem->fileExists(path, new WebKit::WebFileSystemCallbacksImpl(callbacks)); } -void AsyncFileSystemChromium::directoryExists(const String& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks) +void AsyncFileSystemChromium::directoryExists(const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks) { - m_webFileSystem->directoryExists(virtualPathToFileSystemURL(path), new WebKit::WebFileSystemCallbacksImpl(callbacks)); + m_webFileSystem->directoryExists(path, new WebKit::WebFileSystemCallbacksImpl(callbacks)); } -void AsyncFileSystemChromium::readDirectory(const String& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks) +void AsyncFileSystemChromium::readDirectory(const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks) { - m_webFileSystem->readDirectory(virtualPathToFileSystemURL(path), new WebKit::WebFileSystemCallbacksImpl(callbacks)); + m_webFileSystem->readDirectory(path, new WebKit::WebFileSystemCallbacksImpl(callbacks)); } class FileWriterHelperCallbacks : public WebKit::WebFileSystemCallbacks { @@ -300,28 +211,17 @@ private: OwnPtr<WebCore::AsyncFileSystemCallbacks> m_callbacks; }; -void AsyncFileSystemChromium::createWriter(AsyncFileWriterClient* client, const String& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks) +void AsyncFileSystemChromium::createWriter(AsyncFileWriterClient* client, const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks) { - KURL pathAsURL = virtualPathToFileSystemURL(path); - m_webFileSystem->readMetadata(pathAsURL, new FileWriterHelperCallbacks(client, pathAsURL, m_webFileSystem, callbacks)); + m_webFileSystem->readMetadata(path, new FileWriterHelperCallbacks(client, path, m_webFileSystem, callbacks)); } -void AsyncFileSystemChromium::createSnapshotFileAndReadMetadata(const String& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks) +void AsyncFileSystemChromium::createSnapshotFileAndReadMetadata(const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks) { - KURL pathAsURL = virtualPathToFileSystemURL(path); KURL internalBlobURL = BlobURL::createInternalURL(); // This will create a snapshot file and register the file to a blob using the given internalBlobURL. - m_webFileSystem->createSnapshotFileAndReadMetadata(internalBlobURL, pathAsURL, new WebKit::WebFileSystemCallbacksImpl(createSnapshotFileCallback(internalBlobURL, callbacks))); -} - -KURL AsyncFileSystemChromium::virtualPathToFileSystemURL(const String& virtualPath) const -{ - ASSERT(!m_filesystemRootURL.isEmpty()); - KURL url = m_filesystemRootURL; - // Remove the extra leading slash. - url.setPath(url.path() + encodeWithURLEscapeSequences(virtualPath.substring(1))); - return url; + m_webFileSystem->createSnapshotFileAndReadMetadata(internalBlobURL, path, new WebKit::WebFileSystemCallbacksImpl(createSnapshotFileCallback(internalBlobURL, callbacks))); } PassOwnPtr<AsyncFileSystemCallbacks> AsyncFileSystemChromium::createSnapshotFileCallback(const KURL& internalBlobURL, PassOwnPtr<AsyncFileSystemCallbacks> callbacks) const diff --git a/Source/WebKit/chromium/src/AsyncFileSystemChromium.h b/Source/WebKit/chromium/src/AsyncFileSystemChromium.h index e827855a0..7e1af3278 100644 --- a/Source/WebKit/chromium/src/AsyncFileSystemChromium.h +++ b/Source/WebKit/chromium/src/AsyncFileSystemChromium.h @@ -43,45 +43,35 @@ class WebFileSystem; namespace WebCore { class AsyncFileSystemCallbacks; -class KURL; class AsyncFileSystemChromium : public AsyncFileSystem { public: - static PassOwnPtr<AsyncFileSystem> create(FileSystemType type, const KURL& rootURL) + static PassOwnPtr<AsyncFileSystem> create() { - return adoptPtr(new AsyncFileSystemChromium(type, rootURL)); + return adoptPtr(new AsyncFileSystemChromium()); } - static String createIsolatedFileSystemName(const String& storageIdentifier, const String& filesystemId); - static PassOwnPtr<AsyncFileSystem> createIsolatedFileSystem(const String& originString, const String& filesystemId); - virtual ~AsyncFileSystemChromium(); - virtual KURL toURL(const String& originString, const String& fullPath) const; - virtual void move(const String& sourcePath, const String& destinationPath, PassOwnPtr<AsyncFileSystemCallbacks>); - virtual void copy(const String& sourcePath, const String& destinationPath, PassOwnPtr<AsyncFileSystemCallbacks>); - virtual void remove(const String& path, PassOwnPtr<AsyncFileSystemCallbacks>); - virtual void removeRecursively(const String& path, PassOwnPtr<AsyncFileSystemCallbacks>); - virtual void readMetadata(const String& path, PassOwnPtr<AsyncFileSystemCallbacks>); - virtual void createFile(const String& path, bool exclusive, PassOwnPtr<AsyncFileSystemCallbacks>); - virtual void createDirectory(const String& path, bool exclusive, PassOwnPtr<AsyncFileSystemCallbacks>); - virtual void fileExists(const String& path, PassOwnPtr<AsyncFileSystemCallbacks>); - virtual void directoryExists(const String& path, PassOwnPtr<AsyncFileSystemCallbacks>); - virtual void readDirectory(const String& path, PassOwnPtr<AsyncFileSystemCallbacks>); - virtual void createWriter(AsyncFileWriterClient* client, const String& path, PassOwnPtr<AsyncFileSystemCallbacks>); - virtual void createSnapshotFileAndReadMetadata(const String& path, PassOwnPtr<AsyncFileSystemCallbacks>); + virtual void move(const KURL& sourcePath, const KURL& destinationPath, PassOwnPtr<AsyncFileSystemCallbacks>); + virtual void copy(const KURL& sourcePath, const KURL& destinationPath, PassOwnPtr<AsyncFileSystemCallbacks>); + virtual void remove(const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks>); + virtual void removeRecursively(const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks>); + virtual void readMetadata(const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks>); + virtual void createFile(const KURL& path, bool exclusive, PassOwnPtr<AsyncFileSystemCallbacks>); + virtual void createDirectory(const KURL& path, bool exclusive, PassOwnPtr<AsyncFileSystemCallbacks>); + virtual void fileExists(const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks>); + virtual void directoryExists(const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks>); + virtual void readDirectory(const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks>); + virtual void createWriter(AsyncFileWriterClient*, const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks>); + virtual void createSnapshotFileAndReadMetadata(const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks>); protected: - AsyncFileSystemChromium(FileSystemType, const KURL& rootURL); + AsyncFileSystemChromium(); PassOwnPtr<AsyncFileSystemCallbacks> createSnapshotFileCallback(const KURL& internalBlobURL, PassOwnPtr<AsyncFileSystemCallbacks>) const; WebKit::WebFileSystem* m_webFileSystem; - - // Converts a given absolute virtual path to a full origin-qualified FileSystem URL. - KURL virtualPathToFileSystemURL(const String& virtualPath) const; - - KURL m_filesystemRootURL; }; } // namespace WebCore diff --git a/Source/WebKit/chromium/src/ChromeClientImpl.cpp b/Source/WebKit/chromium/src/ChromeClientImpl.cpp index fac80d993..8808e5d6a 100644 --- a/Source/WebKit/chromium/src/ChromeClientImpl.cpp +++ b/Source/WebKit/chromium/src/ChromeClientImpl.cpp @@ -738,6 +738,11 @@ void ChromeClientImpl::runOpenPanel(Frame* frame, PassRefPtr<FileChooser> fileCh params.selectedFiles = fileChooser->settings().selectedFiles; if (params.selectedFiles.size() > 0) params.initialValue = params.selectedFiles[0]; +#if ENABLE(MEDIA_CAPTURE) + params.capture = fileChooser->settings().capture; +#else + params.capture = WebString(); +#endif WebFileChooserCompletionImpl* chooserCompletion = new WebFileChooserCompletionImpl(fileChooser); diff --git a/Source/WebKit/chromium/src/ContextMenuClientImpl.cpp b/Source/WebKit/chromium/src/ContextMenuClientImpl.cpp index 4491ea1ca..d35eb0e6c 100644 --- a/Source/WebKit/chromium/src/ContextMenuClientImpl.cpp +++ b/Source/WebKit/chromium/src/ContextMenuClientImpl.cpp @@ -279,18 +279,20 @@ PlatformMenuDescription ContextMenuClientImpl::getCustomMenuFromDefaultItems( // a mouse on a word, Chrome just needs to find a spelling marker on the word instread of spellchecking it. if (selectedFrame->settings() && selectedFrame->settings()->asynchronousSpellCheckingEnabled()) { RefPtr<Range> range = selectedFrame->selection()->toNormalizedRange(); - Vector<DocumentMarker*> markers = selectedFrame->document()->markers()->markersInRange(range.get(), DocumentMarker::Spelling); - if (!markers.isEmpty()) { - Vector<String> suggestions; - for (size_t i = 0; i < markers.size(); ++i) { - if (!markers[i]->description().isEmpty()) { - Vector<String> descriptions; - markers[i]->description().split('\n', descriptions); - suggestions.append(descriptions); + if (range.get()) { + Vector<DocumentMarker*> markers = selectedFrame->document()->markers()->markersInRange(range.get(), DocumentMarker::Spelling); + if (!markers.isEmpty()) { + Vector<String> suggestions; + for (size_t i = 0; i < markers.size(); ++i) { + if (!markers[i]->description().isEmpty()) { + Vector<String> descriptions; + markers[i]->description().split('\n', descriptions); + suggestions.append(descriptions); + } } + data.dictionarySuggestions = suggestions; + data.misspelledWord = selectMisspelledWord(defaultMenu, selectedFrame); } - data.dictionarySuggestions = suggestions; - data.misspelledWord = selectMisspelledWord(defaultMenu, selectedFrame); } } else if (m_webView->focusedWebCoreFrame()->editor()->isContinuousSpellCheckingEnabled()) { data.isSpellCheckingEnabled = true; diff --git a/Source/WebKit/chromium/src/DragClientImpl.cpp b/Source/WebKit/chromium/src/DragClientImpl.cpp index f4b9e160d..afa570611 100644 --- a/Source/WebKit/chromium/src/DragClientImpl.cpp +++ b/Source/WebKit/chromium/src/DragClientImpl.cpp @@ -36,11 +36,12 @@ #include "Frame.h" #include "NativeImageSkia.h" #include "platform/WebCommon.h" -#include "platform/WebDragData.h" #include "platform/WebImage.h" #include "WebViewClient.h" #include "WebViewImpl.h" +#include <public/WebDragData.h> + using namespace WebCore; namespace WebKit { @@ -88,11 +89,7 @@ void DragClientImpl::startDrag(DragImageRef dragImage, WebPoint offsetPoint(offsetSize.width(), offsetSize.height()); m_webView->startDragging( dragData, static_cast<WebDragOperationsMask>(dragOperationMask), -#if WEBKIT_USING_SKIA dragImage ? WebImage(*dragImage) : WebImage(), -#else - dragImage ? WebImage(dragImage) : WebImage(), -#endif offsetPoint); } diff --git a/Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp b/Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp index abe1e98b4..d0602a9a0 100644 --- a/Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp +++ b/Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp @@ -68,6 +68,7 @@ #include "WebFrameClient.h" #include "WebFrameImpl.h" #include "WebIntentRequest.h" +#include "WebIntentServiceInfo.h" #include "WebKit.h" #include "WebNode.h" #include "WebPermissionClient.h" @@ -634,8 +635,14 @@ void FrameLoaderClientImpl::dispatchDidNavigateWithinPage() // didStopLoading only when loader is completed so that we don't fire // them for fragment redirection that happens in window.onload handler. // See https://bugs.webkit.org/show_bug.cgi?id=31838 - bool loaderCompleted = - !webView->page()->mainFrame()->loader()->activeDocumentLoader()->isLoadingInAPISense(); + // + // FIXME: Although FrameLoader::loadInSameDocument which invokes this + // method does not have a provisional document loader, we're seeing crashes + // where the FrameLoader is in provisional state, and thus + // activeDocumentLoader returns 0. Lacking any understanding of how this + // can happen, we do this check here to avoid crashing. + FrameLoader* loader = webView->page()->mainFrame()->loader(); + bool loaderCompleted = !(loader->activeDocumentLoader() && loader->activeDocumentLoader()->isLoadingInAPISense()); // Generate didStartLoading if loader is completed. if (webView->client() && loaderCompleted) @@ -1376,6 +1383,10 @@ void FrameLoaderClientImpl::setTitle(const StringWithDirection& title, const KUR String FrameLoaderClientImpl::userAgent(const KURL& url) { + WebString override; + if (m_webFrame->client()->userAgent(WebURL(url), &override)) + return override; + return WebKit::Platform::current()->userAgent(url); } @@ -1591,10 +1602,28 @@ bool FrameLoaderClientImpl::willCheckAndDispatchMessageEvent( if (!m_webFrame->client()) return false; + WebFrame* source = 0; + if (event && event->source() && event->source()->document()) + source = WebFrameImpl::fromFrame(event->source()->document()->frame()); return m_webFrame->client()->willCheckAndDispatchMessageEvent( - m_webFrame, WebSecurityOrigin(target), WebDOMMessageEvent(event)); + source, WebSecurityOrigin(target), WebDOMMessageEvent(event)); } +#if ENABLE(WEB_INTENTS_TAG) +void FrameLoaderClientImpl::registerIntentService( + const String& action, + const String& type, + const KURL& href, + const String& title, + const String& disposition) { + if (!m_webFrame->client()) + return; + + WebIntentServiceInfo service(action, type, href, title, disposition); + m_webFrame->client()->registerIntentService(m_webFrame, service); +} +#endif + #if ENABLE(WEB_INTENTS) void FrameLoaderClientImpl::dispatchIntent(PassRefPtr<WebCore::IntentRequest> intentRequest) { diff --git a/Source/WebKit/chromium/src/FrameLoaderClientImpl.h b/Source/WebKit/chromium/src/FrameLoaderClientImpl.h index df7e0f123..ecb20a2fb 100644 --- a/Source/WebKit/chromium/src/FrameLoaderClientImpl.h +++ b/Source/WebKit/chromium/src/FrameLoaderClientImpl.h @@ -205,6 +205,13 @@ public: virtual PassRefPtr<WebCore::FrameNetworkingContext> createNetworkingContext(); virtual bool willCheckAndDispatchMessageEvent(WebCore::SecurityOrigin* target, WebCore::MessageEvent*) const; +#if ENABLE(WEB_INTENTS_TAG) + virtual void registerIntentService(const String& action, + const String& type, + const WebCore::KURL& href, + const String& title, + const String& disposition); +#endif #if ENABLE(WEB_INTENTS) virtual void dispatchIntent(PassRefPtr<WebCore::IntentRequest>) OVERRIDE; #endif diff --git a/Source/WebKit/chromium/src/LocalFileSystemChromium.cpp b/Source/WebKit/chromium/src/LocalFileSystemChromium.cpp index 5f6d52750..6fded29ff 100644 --- a/Source/WebKit/chromium/src/LocalFileSystemChromium.cpp +++ b/Source/WebKit/chromium/src/LocalFileSystemChromium.cpp @@ -41,7 +41,6 @@ #include "FileSystemType.h" #include "PlatformString.h" #include "WebFileError.h" -#include "platform/WebFileSystem.h" #include "WebFileSystemCallbacksImpl.h" #include "WebFrameClient.h" #include "WebFrameImpl.h" @@ -51,6 +50,7 @@ #include "WorkerContext.h" #include "WorkerFileSystemCallbacksBridge.h" #include "WorkerThread.h" +#include <public/WebFileSystem.h> #include <wtf/Threading.h> using namespace WebKit; @@ -194,7 +194,7 @@ static void openFileSystemHelper(ScriptExecutionContext* context, FileSystemType if (webView->permissionClient() && !webView->permissionClient()->allowFileSystem(webFrame)) allowed = false; else - webFrame->client()->openFileSystem(webFrame, static_cast<WebFileSystem::Type>(type), size, create == CreateIfNotPresent, new WebFileSystemCallbacksImpl(callbacks, type)); + webFrame->client()->openFileSystem(webFrame, static_cast<WebFileSystem::Type>(type), size, create == CreateIfNotPresent, new WebFileSystemCallbacksImpl(callbacks)); } else { #if ENABLE(WORKERS) WorkerContext* workerContext = static_cast<WorkerContext*>(context); @@ -203,7 +203,7 @@ static void openFileSystemHelper(ScriptExecutionContext* context, FileSystemType if (!allowFileSystemForWorker(webWorker->commonClient())) allowed = false; else - openFileSystemForWorker(webWorker->commonClient(), static_cast<WebFileSystem::Type>(type), size, create == CreateIfNotPresent, new WebFileSystemCallbacksImpl(callbacks, type, context, synchronousType), synchronousType); + openFileSystemForWorker(webWorker->commonClient(), static_cast<WebFileSystem::Type>(type), size, create == CreateIfNotPresent, new WebFileSystemCallbacksImpl(callbacks, context, synchronousType), synchronousType); #else ASSERT_NOT_REACHED(); diff --git a/Source/WebKit/chromium/src/LocalizedStrings.cpp b/Source/WebKit/chromium/src/LocalizedStrings.cpp index 6af49515f..75b3a2847 100644 --- a/Source/WebKit/chromium/src/LocalizedStrings.cpp +++ b/Source/WebKit/chromium/src/LocalizedStrings.cpp @@ -215,6 +215,12 @@ String crashedPluginText() return String("Plug-in Failure"); } +String insecurePluginVersionText() +{ + notImplemented(); + return String(); +} + String multipleFileUploadText(unsigned numberOfFiles) { return query(WebLocalizedString::MultipleFileUploadText, String::number(numberOfFiles)); diff --git a/Source/WebKit/chromium/src/PageOverlay.cpp b/Source/WebKit/chromium/src/PageOverlay.cpp index 5f16d29c2..b5d157a4b 100644 --- a/Source/WebKit/chromium/src/PageOverlay.cpp +++ b/Source/WebKit/chromium/src/PageOverlay.cpp @@ -46,11 +46,7 @@ namespace { WebCanvas* ToWebCanvas(GraphicsContext* gc) { -#if WEBKIT_USING_SKIA return gc->platformContext()->canvas(); -#elif WEBKIT_USING_CG - return gc->platformContext(); -#endif } } // namespace diff --git a/Source/WebKit/chromium/src/PageWidgetDelegate.cpp b/Source/WebKit/chromium/src/PageWidgetDelegate.cpp index 058bae024..cb9e95fc3 100644 --- a/Source/WebKit/chromium/src/PageWidgetDelegate.cpp +++ b/Source/WebKit/chromium/src/PageWidgetDelegate.cpp @@ -59,7 +59,8 @@ void PageWidgetDelegate::animate(Page* page, double monotonicFrameBeginTime) FrameView* view = mainFrameView(page); if (!view) return; - view->serviceScriptedAnimations(monotonicFrameBeginTime); + double timeShift = currentTime() - monotonicallyIncreasingTime(); + view->serviceScriptedAnimations(convertSecondsToDOMTimeStamp(monotonicFrameBeginTime + timeShift)); #endif } @@ -152,6 +153,7 @@ bool PageWidgetDelegate::handleInputEvent(Page* page, PageWidgetEventHandler& ha case WebInputEvent::GestureTap: case WebInputEvent::GestureTapDown: case WebInputEvent::GestureDoubleTap: + case WebInputEvent::GestureLongPress: return handler.handleGestureEvent(*static_cast<const WebGestureEvent*>(&event)); #endif diff --git a/Source/WebKit/chromium/src/PlatformSupport.cpp b/Source/WebKit/chromium/src/PlatformSupport.cpp index de9810dbd..717455688 100644 --- a/Source/WebKit/chromium/src/PlatformSupport.cpp +++ b/Source/WebKit/chromium/src/PlatformSupport.cpp @@ -50,7 +50,6 @@ #include "WebWorkerClientImpl.h" #include "WebWorkerRunLoop.h" #include "platform/WebAudioBus.h" -#include "platform/WebClipboard.h" #include "platform/WebCookie.h" #include "platform/WebCookieJar.h" #include "platform/WebData.h" @@ -81,9 +80,7 @@ #include "platform/android/WebThemeEngine.h" #endif -#if WEBKIT_USING_SKIA #include "NativeImageSkia.h" -#endif #include "AsyncFileSystemChromium.h" #include "BitmapImage.h" @@ -101,6 +98,7 @@ #include "Worker.h" #include "WorkerContextProxy.h" +#include <public/WebClipboard.h> #include <public/WebMimeRegistry.h> #include <wtf/Assertions.h> @@ -224,11 +222,7 @@ void PlatformSupport::clipboardWriteImage(NativeImagePtr image, const KURL& sourceURL, const String& title) { -#if WEBKIT_USING_SKIA WebImage webImage(image->bitmap()); -#else - WebImage webImage(image); -#endif webKitPlatformSupport()->clipboard()->writeImage(webImage, sourceURL, title); } @@ -404,14 +398,9 @@ int PlatformSupport::writeToFile(PlatformFileHandle handle, const char* data, in } #if ENABLE(FILE_SYSTEM) -String PlatformSupport::createIsolatedFileSystemName(const String& storageIdentifier, const String& filesystemId) +PassOwnPtr<AsyncFileSystem> PlatformSupport::createAsyncFileSystem() { - return AsyncFileSystemChromium::createIsolatedFileSystemName(storageIdentifier, filesystemId); -} - -PassOwnPtr<AsyncFileSystem> PlatformSupport::createIsolatedFileSystem(const String& originString, const String& filesystemId) -{ - return AsyncFileSystemChromium::createIsolatedFileSystem(originString, filesystemId); + return AsyncFileSystemChromium::create(); } #endif @@ -558,17 +547,6 @@ NPObject* PlatformSupport::pluginScriptableObject(Widget* widget) // Resources ------------------------------------------------------------------ -PassRefPtr<Image> PlatformSupport::loadPlatformImageResource(const char* name) -{ - const WebData& resource = webKitPlatformSupport()->loadResource(name); - if (resource.isEmpty()) - return Image::nullImage(); - - RefPtr<Image> image = BitmapImage::create(); - image->setData(resource, true); - return image; -} - #if ENABLE(WEB_AUDIO) PassOwnPtr<AudioBus> PlatformSupport::decodeAudioFileData(const char* data, size_t size, double sampleRate) @@ -688,11 +666,7 @@ void PlatformSupport::paintScrollbarThumb( webThemeScrollbarInfo.visibleSize = scrollbarInfo.visibleSize; webThemeScrollbarInfo.totalSize = scrollbarInfo.totalSize; -#if WEBKIT_USING_SKIA WebKit::WebCanvas* webCanvas = gc->platformContext()->canvas(); -#else - WebKit::WebCanvas* webCanvas = gc->platformContext(); -#endif webKitPlatformSupport()->themeEngine()->paintScrollbarThumb( webCanvas, static_cast<WebThemeEngine::State>(state), @@ -811,28 +785,6 @@ void PlatformSupport::paintThemePart( #endif -// Trace Event ---------------------------------------------------------------- - -const unsigned char* PlatformSupport::getTraceCategoryEnabledFlag(const char* categoryName) -{ - return webKitPlatformSupport()->getTraceCategoryEnabledFlag(categoryName); -} -int PlatformSupport::addTraceEvent(char phase, - const unsigned char* categoryEnabledFlag, - const char* name, - unsigned long long id, - int numArgs, - const char** argNames, - const unsigned char* argTypes, - const unsigned long long* argValues, - int thresholdBeginId, - long long threshold, - unsigned char flags) -{ - return webKitPlatformSupport()->addTraceEvent( - phase, categoryEnabledFlag, name, id, numArgs, argNames, argTypes, argValues, thresholdBeginId, threshold, flags); -} - // Visited Links -------------------------------------------------------------- LinkHash PlatformSupport::visitedLinkHash(const UChar* url, unsigned length) diff --git a/Source/WebKit/chromium/src/StorageAreaProxy.cpp b/Source/WebKit/chromium/src/StorageAreaProxy.cpp index 11eb7cec3..00cc4433b 100644 --- a/Source/WebKit/chromium/src/StorageAreaProxy.cpp +++ b/Source/WebKit/chromium/src/StorageAreaProxy.cpp @@ -80,42 +80,29 @@ String StorageAreaProxy::getItem(const String& key, Frame* frame) const return String(); } -String StorageAreaProxy::setItem(const String& key, const String& value, ExceptionCode& ec, Frame* frame) +void StorageAreaProxy::setItem(const String& key, const String& value, ExceptionCode& ec, Frame* frame) { - WebKit::WebStorageArea::Result result = WebKit::WebStorageArea::ResultOK; - WebKit::WebString oldValue; if (!canAccessStorage(frame)) ec = QUOTA_EXCEEDED_ERR; else { - m_storageArea->setItem(key, value, frame->document()->url(), result, oldValue); + WebKit::WebStorageArea::Result result = WebKit::WebStorageArea::ResultOK; + m_storageArea->setItem(key, value, frame->document()->url(), result); ec = (result == WebKit::WebStorageArea::ResultOK) ? 0 : QUOTA_EXCEEDED_ERR; - String oldValueString = oldValue; - if (oldValueString != value && result == WebKit::WebStorageArea::ResultOK) - storageEvent(key, oldValue, value, m_storageType, frame->document()->securityOrigin(), frame); } - return oldValue; } -String StorageAreaProxy::removeItem(const String& key, Frame* frame) +void StorageAreaProxy::removeItem(const String& key, Frame* frame) { if (!canAccessStorage(frame)) - return String(); - WebKit::WebString oldValue; - m_storageArea->removeItem(key, frame->document()->url(), oldValue); - if (!oldValue.isNull()) - storageEvent(key, oldValue, String(), m_storageType, frame->document()->securityOrigin(), frame); - return oldValue; + return; + m_storageArea->removeItem(key, frame->document()->url()); } -bool StorageAreaProxy::clear(Frame* frame) +void StorageAreaProxy::clear(Frame* frame) { if (!canAccessStorage(frame)) - return false; - bool clearedSomething; - m_storageArea->clear(frame->document()->url(), clearedSomething); - if (clearedSomething) - storageEvent(String(), String(), String(), m_storageType, frame->document()->securityOrigin(), frame); - return clearedSomething; + return; + m_storageArea->clear(frame->document()->url()); } bool StorageAreaProxy::contains(const String& key, Frame* frame) const @@ -123,54 +110,6 @@ bool StorageAreaProxy::contains(const String& key, Frame* frame) const return !getItem(key, frame).isNull(); } -// FIXME: remove this method and the calls to it from our setters after multi-side patch landing is done. -// Copied from WebCore/storage/StorageEventDispatcher.cpp out of necessity. It's probably best to keep it current. -void StorageAreaProxy::storageEvent(const String& key, const String& oldValue, const String& newValue, StorageType storageType, SecurityOrigin* securityOrigin, Frame* sourceFrame) -{ - Page* page = sourceFrame->page(); - if (!page) - return; - - // We need to copy all relevant frames from every page to a vector since sending the event to one frame might mutate the frame tree - // of any given page in the group or mutate the page group itself. - Vector<RefPtr<Frame> > frames; - if (storageType == SessionStorage) { - // Send events only to our page. - for (Frame* frame = page->mainFrame(); frame; frame = frame->tree()->traverseNext()) { - if (sourceFrame != frame && frame->document()->securityOrigin()->equal(securityOrigin)) - frames.append(frame); - } - - for (unsigned i = 0; i < frames.size(); ++i) { - // FIXME: maybe only raise if the window has an onstorage listener - // attached to avoid creating the Storage instance. - ExceptionCode ec = 0; - Storage* storage = frames[i]->domWindow()->sessionStorage(ec); - if (!ec) - frames[i]->document()->enqueueWindowEvent(StorageEvent::create(eventNames().storageEvent, key, oldValue, newValue, sourceFrame->document()->url(), storage)); - } - } else { - // Send events to every page. - const HashSet<Page*>& pages = page->group().pages(); - HashSet<Page*>::const_iterator end = pages.end(); - for (HashSet<Page*>::const_iterator it = pages.begin(); it != end; ++it) { - for (Frame* frame = (*it)->mainFrame(); frame; frame = frame->tree()->traverseNext()) { - if (sourceFrame != frame && frame->document()->securityOrigin()->equal(securityOrigin)) - frames.append(frame); - } - } - - for (unsigned i = 0; i < frames.size(); ++i) { - // FIXME: maybe only raise if the window has an onstorage listener - // attached to avoid creating the Storage instance. - ExceptionCode ec = 0; - Storage* storage = frames[i]->domWindow()->localStorage(ec); - if (!ec) - frames[i]->document()->enqueueWindowEvent(StorageEvent::create(eventNames().storageEvent, key, oldValue, newValue, sourceFrame->document()->url(), storage)); - } - } -} - bool StorageAreaProxy::canAccessStorage(Frame* frame) const { if (!frame->page()) @@ -180,18 +119,10 @@ bool StorageAreaProxy::canAccessStorage(Frame* frame) const return !webView->permissionClient() || webView->permissionClient()->allowStorage(webFrame, m_storageType == LocalStorage); } -void StorageAreaProxy::dispatchLocalStorageEvent(const String& pageGroupName, const String& key, const String& oldValue, const String& newValue, +void StorageAreaProxy::dispatchLocalStorageEvent(PageGroup* pageGroup, const String& key, const String& oldValue, const String& newValue, SecurityOrigin* securityOrigin, const KURL& pageURL, WebKit::WebStorageArea* sourceAreaInstance, bool originatedInProcess) { - // FIXME: Multi-sided patch engineering alert ! - // step 1: this method gets defined and implemented in webkit/webcore with the early return. - // step 2: this method starts getting called by chromium still with the early return. - // step 3: This class's setters are modified to no longer raise SessionStorage - // events for inprocess changes and this early return is removed. - if (originatedInProcess) - return; - - const HashSet<Page*>& pages = PageGroup::pageGroup(pageGroupName)->pages(); + const HashSet<Page*>& pages = pageGroup->pages(); for (HashSet<Page*>::const_iterator it = pages.begin(); it != pages.end(); ++it) { for (Frame* frame = (*it)->mainFrame(); frame; frame = frame->tree()->traverseNext()) { if (frame->document()->securityOrigin()->equal(securityOrigin) && !isEventSource(frame->domWindow()->optionalLocalStorage(), sourceAreaInstance)) { @@ -205,9 +136,9 @@ void StorageAreaProxy::dispatchLocalStorageEvent(const String& pageGroupName, co } } -static Page* findPageWithSessionStorageNamespace(const String& pageGroupName, const WebKit::WebStorageNamespace& sessionNamespace) +static Page* findPageWithSessionStorageNamespace(PageGroup* pageGroup, const WebKit::WebStorageNamespace& sessionNamespace) { - const HashSet<Page*>& pages = PageGroup::pageGroup(pageGroupName)->pages(); + const HashSet<Page*>& pages = pageGroup->pages(); for (HashSet<Page*>::const_iterator it = pages.begin(); it != pages.end(); ++it) { const bool createIfNeeded = true; StorageNamespaceProxy* proxy = static_cast<StorageNamespaceProxy*>((*it)->sessionStorage(createIfNeeded)); @@ -217,19 +148,11 @@ static Page* findPageWithSessionStorageNamespace(const String& pageGroupName, co return 0; } -void StorageAreaProxy::dispatchSessionStorageEvent(const String& pageGroupName, const String& key, const String& oldValue, const String& newValue, +void StorageAreaProxy::dispatchSessionStorageEvent(PageGroup* pageGroup, const String& key, const String& oldValue, const String& newValue, SecurityOrigin* securityOrigin, const KURL& pageURL, const WebKit::WebStorageNamespace& sessionNamespace, WebKit::WebStorageArea* sourceAreaInstance, bool originatedInProcess) { - // FIXME: Multi-sided patch engineering alert ! - // step 1: this method gets defined and implemented in webkit/webcore with the early return. - // step 2: this method starts getting called by chromium still with the early return. - // step 3: This class's setters are modified to no longer raise SessionStorage - // events for inprocess changes and this early return is removed. - if (originatedInProcess) - return; - - Page* page = findPageWithSessionStorageNamespace(pageGroupName, sessionNamespace); + Page* page = findPageWithSessionStorageNamespace(pageGroup, sessionNamespace); if (!page) return; diff --git a/Source/WebKit/chromium/src/StorageAreaProxy.h b/Source/WebKit/chromium/src/StorageAreaProxy.h index ab2357470..83f2eae17 100644 --- a/Source/WebKit/chromium/src/StorageAreaProxy.h +++ b/Source/WebKit/chromium/src/StorageAreaProxy.h @@ -38,6 +38,7 @@ namespace WebCore { class Frame; class KURL; class Page; +class PageGroup; class SecurityOrigin; class Storage; @@ -50,23 +51,22 @@ public: virtual unsigned length(Frame* sourceFrame) const; virtual String key(unsigned index, Frame* sourceFrame) const; virtual String getItem(const String& key, Frame* sourceFrame) const; - virtual String setItem(const String& key, const String& value, ExceptionCode& ec, Frame* sourceFrame); - virtual String removeItem(const String& key, Frame* sourceFrame); - virtual bool clear(Frame* sourceFrame); + virtual void setItem(const String& key, const String& value, ExceptionCode&, Frame* sourceFrame); + virtual void removeItem(const String& key, Frame* sourceFrame); + virtual void clear(Frame* sourceFrame); virtual bool contains(const String& key, Frame* sourceFrame) const; virtual bool disabledByPrivateBrowsingInFrame(const Frame*) const { return false; } static void dispatchLocalStorageEvent( - const String& pageGroupName, const String& key, const String& oldValue, const String& newValue, + PageGroup*, const String& key, const String& oldValue, const String& newValue, SecurityOrigin*, const KURL& pageURL, WebKit::WebStorageArea* sourceAreaInstance, bool originatedInProcess); static void dispatchSessionStorageEvent( - const String& pageGroupName, const String& key, const String& oldValue, const String& newValue, + PageGroup*, const String& key, const String& oldValue, const String& newValue, SecurityOrigin*, const KURL& pageURL, const WebKit::WebStorageNamespace&, WebKit::WebStorageArea* sourceAreaInstance, bool originatedInProcess); private: - void storageEvent(const String& key, const String& oldValue, const String& newValue, StorageType, SecurityOrigin*, Frame* sourceFrame); bool canAccessStorage(Frame*) const; static bool isEventSource(Storage*, WebKit::WebStorageArea* sourceAreaInstance); diff --git a/Source/WebKit/chromium/src/StorageEventDispatcherImpl.cpp b/Source/WebKit/chromium/src/StorageEventDispatcherImpl.cpp deleted file mode 100644 index e948b597c..000000000 --- a/Source/WebKit/chromium/src/StorageEventDispatcherImpl.cpp +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright (C) 2009 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 "StorageEventDispatcherImpl.h" - -#include "DOMWindow.h" -#include "Document.h" -#include "EventNames.h" -#include "Frame.h" -#include "KURL.h" -#include "Page.h" -#include "PageGroup.h" -#include "SecurityOrigin.h" -#include "StorageEvent.h" - -// FIXME: delete this almost obsolete file soon - -namespace WebCore { - -StorageEventDispatcherImpl::StorageEventDispatcherImpl(const String& groupName) - : m_pageGroup(PageGroup::pageGroup(groupName)) -{ - ASSERT(m_pageGroup); -} - -void StorageEventDispatcherImpl::dispatchStorageEvent(const String& key, const String& oldValue, - const String& newValue, SecurityOrigin* securityOrigin, - const KURL& url, StorageType storageType) -{ - // FIXME: Implement - if (storageType == SessionStorage) - return; - - // We need to copy all relevant frames from every page to a vector since sending the event to one frame might mutate the frame tree - // of any given page in the group or mutate the page group itself. - Vector<RefPtr<Frame> > frames; - - const HashSet<Page*>& pages = m_pageGroup->pages(); - HashSet<Page*>::const_iterator end = pages.end(); - for (HashSet<Page*>::const_iterator it = pages.begin(); it != end; ++it) { - for (Frame* frame = (*it)->mainFrame(); frame; frame = frame->tree()->traverseNext()) { - if (frame->document()->securityOrigin()->equal(securityOrigin)) - frames.append(frame); - } - } - - for (unsigned i = 0; i < frames.size(); ++i) { - ExceptionCode ec = 0; - Storage* storage = frames[i]->domWindow()->localStorage(ec); - if (!ec) - frames[i]->document()->dispatchWindowEvent(StorageEvent::create(eventNames().storageEvent, key, oldValue, newValue, url, storage)); - } -} - -} // namespace WebCore diff --git a/Source/WebKit/chromium/src/StorageEventDispatcherImpl.h b/Source/WebKit/chromium/src/StorageEventDispatcherImpl.h deleted file mode 100644 index d3433851f..000000000 --- a/Source/WebKit/chromium/src/StorageEventDispatcherImpl.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (C) 2009 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 StorageEventDispatcherImpl_h -#define StorageEventDispatcherImpl_h - -#include "PlatformString.h" -#include "StorageArea.h" - -namespace WebCore { - -class KURL; -class PageGroup; -class SecurityOrigin; - -class StorageEventDispatcherImpl { -public: - StorageEventDispatcherImpl(const String& groupName); - - void dispatchStorageEvent(const String& key, const String& oldValue, - const String& newValue, SecurityOrigin*, - const KURL&, StorageType); - -private: - PageGroup* m_pageGroup; -}; - -} // namespace WebCore - -#endif // StorageEventDispatcherImpl_h diff --git a/Source/WebKit/chromium/src/WebContentLayerImpl.cpp b/Source/WebKit/chromium/src/WebContentLayerImpl.cpp index 4f64d5471..4d476095d 100644 --- a/Source/WebKit/chromium/src/WebContentLayerImpl.cpp +++ b/Source/WebKit/chromium/src/WebContentLayerImpl.cpp @@ -30,9 +30,7 @@ #include "platform/WebRect.h" #include "GraphicsContext.h" #include "platform/WebCanvas.h" -#if WEBKIT_USING_SKIA #include "PlatformContextSkia.h" -#endif using namespace WebCore; @@ -64,11 +62,7 @@ void WebContentLayerImpl::paintContents(GraphicsContext& gc, const IntRect& clip { if (!m_contentClient) return; -#if WEBKIT_USING_SKIA WebCanvas* canvas = gc.platformContext()->canvas(); -#elif WEBKIT_USING_CG - WebCanvas* canvas = gc.platformContext(); -#endif m_contentClient->paintContents(canvas, WebRect(clip)); } diff --git a/Source/WebKit/chromium/src/WebDragData.cpp b/Source/WebKit/chromium/src/WebDragData.cpp index 61d86a388..f9846efd8 100644 --- a/Source/WebKit/chromium/src/WebDragData.cpp +++ b/Source/WebKit/chromium/src/WebDragData.cpp @@ -29,7 +29,6 @@ */ #include "config.h" -#include "platform/WebDragData.h" #include "ChromiumDataObject.h" #include "ClipboardMimeTypes.h" @@ -40,6 +39,7 @@ #include "platform/WebURL.h" #include "platform/WebVector.h" +#include <public/WebDragData.h> #include <wtf/HashMap.h> #include <wtf/PassRefPtr.h> diff --git a/Source/WebKit/chromium/src/WebFileSystemCallbacksImpl.cpp b/Source/WebKit/chromium/src/WebFileSystemCallbacksImpl.cpp index c110e7c22..06809e54b 100644 --- a/Source/WebKit/chromium/src/WebFileSystemCallbacksImpl.cpp +++ b/Source/WebKit/chromium/src/WebFileSystemCallbacksImpl.cpp @@ -37,19 +37,18 @@ #include "FileMetadata.h" #include "ScriptExecutionContext.h" #include "WebFileInfo.h" -#include "platform/WebFileSystem.h" #include "WebFileSystemEntry.h" #include "platform/WebString.h" #include "WorkerAsyncFileSystemChromium.h" +#include <public/WebFileSystem.h> #include <wtf/Vector.h> using namespace WebCore; namespace WebKit { -WebFileSystemCallbacksImpl::WebFileSystemCallbacksImpl(PassOwnPtr<AsyncFileSystemCallbacks> callbacks, FileSystemType type, WebCore::ScriptExecutionContext* context, FileSystemSynchronousType synchronousType) +WebFileSystemCallbacksImpl::WebFileSystemCallbacksImpl(PassOwnPtr<AsyncFileSystemCallbacks> callbacks, ScriptExecutionContext* context, FileSystemSynchronousType synchronousType) : m_callbacks(callbacks) - , m_type(type) , m_context(context) , m_synchronousType(synchronousType) { @@ -92,11 +91,11 @@ void WebFileSystemCallbacksImpl::didOpenFileSystem(const WebString& name, const #if ENABLE(WORKERS) if (m_context && m_context->isWorkerContext()) { - m_callbacks->didOpenFileSystem(name, WorkerAsyncFileSystemChromium::create(m_context, m_type, rootURL, m_synchronousType)); + m_callbacks->didOpenFileSystem(name, rootURL, WorkerAsyncFileSystemChromium::create(m_context, m_synchronousType)); return; } #endif - m_callbacks->didOpenFileSystem(name, AsyncFileSystemChromium::create(m_type, rootURL)); + m_callbacks->didOpenFileSystem(name, rootURL, AsyncFileSystemChromium::create()); } void WebFileSystemCallbacksImpl::didFail(WebFileError error) diff --git a/Source/WebKit/chromium/src/WebFileSystemCallbacksImpl.h b/Source/WebKit/chromium/src/WebFileSystemCallbacksImpl.h index 76e8cdf8f..e5f04081f 100644 --- a/Source/WebKit/chromium/src/WebFileSystemCallbacksImpl.h +++ b/Source/WebKit/chromium/src/WebFileSystemCallbacksImpl.h @@ -33,8 +33,8 @@ #include "FileSystemType.h" #include "WebFileSystemCallbacks.h" -#include "platform/WebFileSystem.h" #include "platform/WebVector.h" +#include <public/WebFileSystem.h> #include <wtf/OwnPtr.h> #include <wtf/PassOwnPtr.h> @@ -52,7 +52,7 @@ class WebURL; class WebFileSystemCallbacksImpl : public WebFileSystemCallbacks { public: - WebFileSystemCallbacksImpl(PassOwnPtr<WebCore::AsyncFileSystemCallbacks>, WebCore::FileSystemType = WebCore::FileSystemTypeTemporary, WebCore::ScriptExecutionContext* = 0, WebCore::FileSystemSynchronousType = WebCore::AsynchronousFileSystem); + WebFileSystemCallbacksImpl(PassOwnPtr<WebCore::AsyncFileSystemCallbacks>, WebCore::ScriptExecutionContext* = 0, WebCore::FileSystemSynchronousType = WebCore::AsynchronousFileSystem); virtual ~WebFileSystemCallbacksImpl(); virtual void didSucceed(); @@ -64,9 +64,6 @@ public: private: OwnPtr<WebCore::AsyncFileSystemCallbacks> m_callbacks; - // Used for openFileSystem callbacks. - WebCore::FileSystemType m_type; - // Used for worker's openFileSystem callbacks. WebCore::ScriptExecutionContext* m_context; WebCore::FileSystemSynchronousType m_synchronousType; diff --git a/Source/WebKit/chromium/src/WebFontImpl.cpp b/Source/WebKit/chromium/src/WebFontImpl.cpp index f6cf39dbe..8a05aed84 100644 --- a/Source/WebKit/chromium/src/WebFontImpl.cpp +++ b/Source/WebKit/chromium/src/WebFontImpl.cpp @@ -99,12 +99,7 @@ void WebFontImpl::drawText(WebCanvas* canvas, const WebTextRun& run, const WebFl GraphicsContextBuilder builder(canvas); GraphicsContext& gc = builder.context(); -#if WEBKIT_USING_SKIA gc.platformContext()->setDrawingToImageBuffer(!canvasIsOpaque); -#elif WEBKIT_USING_CG - // FIXME hook canvasIsOpaque up to the platform-specific indicators for - // whether subpixel AA can be used for this draw. -#endif gc.save(); gc.setFillColor(color, ColorSpaceDeviceRGB); diff --git a/Source/WebKit/chromium/src/WebFrameImpl.cpp b/Source/WebKit/chromium/src/WebFrameImpl.cpp index d0e6fe238..6cccb9316 100644 --- a/Source/WebKit/chromium/src/WebFrameImpl.cpp +++ b/Source/WebKit/chromium/src/WebFrameImpl.cpp @@ -122,6 +122,7 @@ #include "ResourceHandle.h" #include "ResourceRequest.h" #include "SchemeRegistry.h" +#include "ScriptCallStack.h" #include "ScriptController.h" #include "ScriptSourceCode.h" #include "ScriptValue.h" @@ -178,7 +179,7 @@ #include "V8DirectoryEntry.h" #include "V8DOMFileSystem.h" #include "V8FileEntry.h" -#include "platform/WebFileSystem.h" +#include <public/WebFileSystem.h> #endif using namespace WebCore; @@ -595,11 +596,6 @@ WebVector<WebIconURL> WebFrameImpl::iconURLs(int iconTypes) const return WebVector<WebIconURL>(); } -WebReferrerPolicy WebFrameImpl::referrerPolicy() const -{ - return static_cast<WebReferrerPolicy>(m_frame->document()->referrerPolicy()); -} - WebSize WebFrameImpl::scrollOffset() const { FrameView* view = frameView(); @@ -939,7 +935,7 @@ 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<FileSystemType>(type), KURL(ParsedURLString, path.utf8().data())))); + return toV8(DOMFileSystem::create(frame()->document(), name, static_cast<WebCore::FileSystemType>(type), KURL(ParsedURLString, path.utf8().data()), AsyncFileSystemChromium::create())); } v8::Handle<v8::Value> WebFrameImpl::createFileEntry(WebFileSystem::Type type, @@ -948,7 +944,7 @@ v8::Handle<v8::Value> WebFrameImpl::createFileEntry(WebFileSystem::Type type, const WebString& filePath, bool isDirectory) { - RefPtr<DOMFileSystemBase> fileSystem = DOMFileSystem::create(frame()->document(), fileSystemName, AsyncFileSystemChromium::create(static_cast<FileSystemType>(type), KURL(ParsedURLString, fileSystemPath.utf8().data()))); + RefPtr<DOMFileSystemBase> fileSystem = DOMFileSystem::create(frame()->document(), fileSystemName, static_cast<WebCore::FileSystemType>(type), KURL(ParsedURLString, fileSystemPath.utf8().data()), AsyncFileSystemChromium::create()); if (isDirectory) return toV8(DirectoryEntry::create(fileSystem, filePath)); return toV8(FileEntry::create(fileSystem, filePath)); @@ -1497,9 +1493,7 @@ float WebFrameImpl::printPage(int page, WebCanvas* canvas) GraphicsContextBuilder builder(canvas); GraphicsContext& gc = builder.context(); -#if WEBKIT_USING_SKIA gc.platformContext()->setPrinting(true); -#endif return m_printContext->spoolPage(gc, page); } @@ -1865,6 +1859,14 @@ void WebFrameImpl::handleIntentFailure(int intentIdentifier, const WebString& re { } +void WebFrameImpl::sendOrientationChangeEvent(int orientation) +{ +#if ENABLE(ORIENTATION_EVENTS) + if (m_frame) + m_frame->sendOrientationChangeEvent(orientation); +#endif +} + void WebFrameImpl::addEventListener(const WebString& eventType, WebDOMEventListener* listener, bool useCapture) { DOMWindow* window = m_frame->domWindow(); @@ -1890,6 +1892,13 @@ bool WebFrameImpl::dispatchEvent(const WebDOMEvent& event) return m_frame->domWindow()->dispatchEvent(event); } +void WebFrameImpl::dispatchMessageEventWithOriginCheck(const WebSecurityOrigin& intendedTargetOrigin, const WebDOMEvent& event) +{ + ASSERT(!event.isNull()); + // Pass an empty call stack, since we don't have the one from the other process. + m_frame->domWindow()->dispatchMessageEventWithOriginCheck(intendedTargetOrigin.get(), event, 0); +} + WebString WebFrameImpl::contentAsText(size_t maxChars) const { if (!m_frame) @@ -1960,9 +1969,7 @@ void WebFrameImpl::printPagesWithBoundaries(WebCanvas* canvas, const WebSize& pa GraphicsContextBuilder builder(canvas); GraphicsContext& graphicsContext = builder.context(); -#if WEBKIT_USING_SKIA graphicsContext.platformContext()->setPrinting(true); -#endif m_printContext->spoolAllPagesWithBoundaries(graphicsContext, FloatSize(pageSizeInPixels.width, pageSizeInPixels.height)); diff --git a/Source/WebKit/chromium/src/WebFrameImpl.h b/Source/WebKit/chromium/src/WebFrameImpl.h index c3acc1afb..389946d05 100644 --- a/Source/WebKit/chromium/src/WebFrameImpl.h +++ b/Source/WebKit/chromium/src/WebFrameImpl.h @@ -72,7 +72,6 @@ public: virtual void setName(const WebString&); virtual long long identifier() const; virtual WebVector<WebIconURL> iconURLs(int iconTypes) const; - virtual WebReferrerPolicy referrerPolicy() const; virtual WebSize scrollOffset() const; virtual void setScrollOffset(const WebSize&); virtual WebSize minimumScrollOffset() const; @@ -208,11 +207,16 @@ public: virtual void handleIntentResult(int, const WebString&); virtual void handleIntentFailure(int, const WebString&); + virtual void sendOrientationChangeEvent(int orientation); + virtual void addEventListener(const WebString& eventType, WebDOMEventListener*, bool useCapture); virtual void removeEventListener(const WebString& eventType, WebDOMEventListener*, bool useCapture); virtual bool dispatchEvent(const WebDOMEvent&); + virtual void dispatchMessageEventWithOriginCheck( + const WebSecurityOrigin& intendedTargetOrigin, + const WebDOMEvent&); virtual WebString contentAsText(size_t maxChars) const; virtual WebString contentAsMarkup() const; diff --git a/Source/WebKit/chromium/src/WebGraphicsContext3D.cpp b/Source/WebKit/chromium/src/WebGraphicsContext3D.cpp index 51fbfb70d..f9e051852 100644 --- a/Source/WebKit/chromium/src/WebGraphicsContext3D.cpp +++ b/Source/WebKit/chromium/src/WebGraphicsContext3D.cpp @@ -30,8 +30,6 @@ namespace WebKit { -#if WEBKIT_USING_SKIA - namespace { void bindWebGraphicsContext3DGLContextCallback(const GrGLInterface* interface) { @@ -49,6 +47,4 @@ GrGLInterface* WebGraphicsContext3D::createGrGLInterface() return interface; } -#endif - } // namespace WebKit diff --git a/Source/WebKit/chromium/src/WebImageCG.cpp b/Source/WebKit/chromium/src/WebImageCG.cpp index 0f2c0c473..242a68304 100644 --- a/Source/WebKit/chromium/src/WebImageCG.cpp +++ b/Source/WebKit/chromium/src/WebImageCG.cpp @@ -29,7 +29,6 @@ */ #include "config.h" -#include "platform/WebImage.h" #include "Image.h" #include "ImageSource.h" @@ -40,6 +39,7 @@ #include <CoreGraphics/CGImage.h> +#include <public/WebImage.h> #include <wtf/PassRefPtr.h> #include <wtf/RetainPtr.h> diff --git a/Source/WebKit/chromium/src/WebImageDecoder.cpp b/Source/WebKit/chromium/src/WebImageDecoder.cpp index 0588314ec..ad0a67e51 100644 --- a/Source/WebKit/chromium/src/WebImageDecoder.cpp +++ b/Source/WebKit/chromium/src/WebImageDecoder.cpp @@ -35,13 +35,12 @@ #include "ICOImageDecoder.h" #include "SharedBuffer.h" #include "platform/WebData.h" -#include "platform/WebImage.h" #include "platform/WebSize.h" -#if WEBKIT_USING_SKIA +#include <public/WebImage.h> + #include <wtf/OwnPtr.h> #include <wtf/PassOwnPtr.h> -#endif #include <wtf/PassRefPtr.h> @@ -111,13 +110,8 @@ WebImage WebImageDecoder::getFrameAtIndex(int index = 0) const ImageFrame* const frameBuffer = m_private->frameBufferAtIndex(index); if (!frameBuffer) return WebImage(); -#if WEBKIT_USING_SKIA OwnPtr<NativeImageSkia> image = adoptPtr(frameBuffer->asNewNativeImage()); return WebImage(image->bitmap()); -#elif WEBKIT_USING_CG - // FIXME: Implement CG side of this. - return WebImage(frameBuffer->asNewNativeImage()); -#endif } } // namespace WebKit diff --git a/Source/WebKit/chromium/src/WebImageSkia.cpp b/Source/WebKit/chromium/src/WebImageSkia.cpp index 9755f3802..36dabac3e 100644 --- a/Source/WebKit/chromium/src/WebImageSkia.cpp +++ b/Source/WebKit/chromium/src/WebImageSkia.cpp @@ -29,7 +29,6 @@ */ #include "config.h" -#include "platform/WebImage.h" #include "Image.h" #include "ImageSource.h" @@ -39,6 +38,7 @@ #include "platform/WebData.h" #include "platform/WebSize.h" +#include <public/WebImage.h> #include <wtf/OwnPtr.h> #include <wtf/PassOwnPtr.h> #include <wtf/PassRefPtr.h> diff --git a/Source/WebKit/chromium/src/WebPluginContainerImpl.cpp b/Source/WebKit/chromium/src/WebPluginContainerImpl.cpp index a4a585b96..6ee01efdd 100644 --- a/Source/WebKit/chromium/src/WebPluginContainerImpl.cpp +++ b/Source/WebKit/chromium/src/WebPluginContainerImpl.cpp @@ -34,14 +34,12 @@ #include "Chrome.h" #include "ChromeClientImpl.h" #include "ScrollbarGroup.h" -#include "platform/WebClipboard.h" #include "WebCursorInfo.h" #include "WebDataSourceImpl.h" #include "WebElement.h" #include "WebInputEvent.h" #include "WebInputEventConversion.h" #include "WebKit.h" -#include "platform/WebKitPlatformSupport.h" #include "WebPlugin.h" #include "platform/WebRect.h" #include "platform/WebString.h" @@ -75,14 +73,14 @@ #include "ScrollbarTheme.h" #include "UserGestureIndicator.h" #include "WheelEvent.h" +#include <public/Platform.h> +#include <public/WebClipboard.h> #if ENABLE(GESTURE_EVENTS) #include "PlatformGestureEvent.h" #endif -#if WEBKIT_USING_SKIA #include "PlatformContextSkia.h" -#endif using namespace WebCore; @@ -126,11 +124,7 @@ void WebPluginContainerImpl::paint(GraphicsContext* gc, const IntRect& damageRec IntPoint origin = view->windowToContents(IntPoint(0, 0)); gc->translate(static_cast<float>(origin.x()), static_cast<float>(origin.y())); -#if WEBKIT_USING_SKIA WebCanvas* canvas = gc->platformContext()->canvas(); -#elif WEBKIT_USING_CG - WebCanvas* canvas = gc->platformContext(); -#endif IntRect windowRect = IntRect(view->contentsToWindow(damageRect.location()), damageRect.size()); @@ -259,11 +253,7 @@ bool WebPluginContainerImpl::printPage(int pageNumber, WebCore::GraphicsContext* gc) { gc->save(); -#if WEBKIT_USING_SKIA WebCanvas* canvas = gc->platformContext()->canvas(); -#elif WEBKIT_USING_CG - WebCanvas* canvas = gc->platformContext(); -#endif bool ret = m_webPlugin->printPage(pageNumber, canvas); gc->restore(); return ret; @@ -279,7 +269,7 @@ void WebPluginContainerImpl::copy() if (!m_webPlugin->hasSelection()) return; - webKitPlatformSupport()->clipboard()->writeHTML(m_webPlugin->selectionAsMarkup(), WebURL(), m_webPlugin->selectionAsText(), false); + WebKit::Platform::current()->clipboard()->writeHTML(m_webPlugin->selectionAsMarkup(), WebURL(), m_webPlugin->selectionAsText(), false); } WebElement WebPluginContainerImpl::element() @@ -714,9 +704,8 @@ WebCore::IntRect WebPluginContainerImpl::windowClipRect() const if (m_element->renderer()->document()->renderer()) { // Take our element and get the clip rect from the enclosing layer and // frame view. - RenderLayer* layer = m_element->renderer()->enclosingLayer(); clipRect.intersect( - m_element->document()->view()->windowClipRectForLayer(layer, true)); + m_element->document()->view()->windowClipRectForFrameOwner(m_element, true)); } return clipRect; diff --git a/Source/WebKit/chromium/src/WebStorageEventDispatcherImpl.cpp b/Source/WebKit/chromium/src/WebStorageEventDispatcherImpl.cpp index c8036aa74..cd77cb46b 100644 --- a/Source/WebKit/chromium/src/WebStorageEventDispatcherImpl.cpp +++ b/Source/WebKit/chromium/src/WebStorageEventDispatcherImpl.cpp @@ -29,18 +29,19 @@ */ #include "config.h" -#include "WebStorageEventDispatcherImpl.h" +#include "WebStorageEventDispatcher.h" #include "KURL.h" #include "SecurityOrigin.h" #include "StorageAreaProxy.h" +#include "WebViewImpl.h" #include "platform/WebURL.h" #include <wtf/PassOwnPtr.h> -namespace WebKit { +// FIXME: move this file to WebStorageEventDispatcher.cpp -extern const char* pageGroupName; +namespace WebKit { void WebStorageEventDispatcher::dispatchLocalStorageEvent( const WebString& key, const WebString& oldValue, @@ -50,7 +51,7 @@ void WebStorageEventDispatcher::dispatchLocalStorageEvent( { RefPtr<WebCore::SecurityOrigin> securityOrigin = WebCore::SecurityOrigin::create(origin); WebCore::StorageAreaProxy::dispatchLocalStorageEvent( - pageGroupName, key, oldValue, newValue, securityOrigin.get(), pageURL, + WebViewImpl::defaultPageGroup(), key, oldValue, newValue, securityOrigin.get(), pageURL, sourceAreaInstance, originatedInProcess); } @@ -62,31 +63,8 @@ void WebStorageEventDispatcher::dispatchSessionStorageEvent( { RefPtr<WebCore::SecurityOrigin> securityOrigin = WebCore::SecurityOrigin::create(origin); WebCore::StorageAreaProxy::dispatchSessionStorageEvent( - pageGroupName, key, oldValue, newValue, securityOrigin.get(), pageURL, + WebViewImpl::defaultPageGroup(), key, oldValue, newValue, securityOrigin.get(), pageURL, sessionNamespace, sourceAreaInstance, originatedInProcess); } - -// FIXME: remove the WebStorageEventDispatcherImpl class soon. - -WebStorageEventDispatcher* WebStorageEventDispatcher::create() -{ - return new WebStorageEventDispatcherImpl(); -} - -WebStorageEventDispatcherImpl::WebStorageEventDispatcherImpl() - : m_eventDispatcher(adoptPtr(new WebCore::StorageEventDispatcherImpl(pageGroupName))) -{ - ASSERT(m_eventDispatcher); -} - -void WebStorageEventDispatcherImpl::dispatchStorageEvent(const WebString& key, const WebString& oldValue, - const WebString& newValue, const WebString& origin, - const WebURL& pageURL, bool isLocalStorage) -{ - WebCore::StorageType storageType = isLocalStorage ? WebCore::LocalStorage : WebCore::SessionStorage; - RefPtr<WebCore::SecurityOrigin> securityOrigin = WebCore::SecurityOrigin::createFromString(origin); - m_eventDispatcher->dispatchStorageEvent(key, oldValue, newValue, securityOrigin.get(), pageURL, storageType); -} - } // namespace WebKit diff --git a/Source/WebKit/chromium/src/WebStorageEventDispatcherImpl.h b/Source/WebKit/chromium/src/WebStorageEventDispatcherImpl.h deleted file mode 100644 index b03c6b7a6..000000000 --- a/Source/WebKit/chromium/src/WebStorageEventDispatcherImpl.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (C) 2009 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 WebStorageEventDispatcherImpl_h -#define WebStorageEventDispatcherImpl_h - -#include "StorageEventDispatcherImpl.h" -#include "WebStorageEventDispatcher.h" -#include <wtf/OwnPtr.h> - -namespace WebKit { - -// DEPRECATED - to be removed when removing the instance methods in the public api. -class WebStorageEventDispatcherImpl : public WebStorageEventDispatcher { -public: - WebStorageEventDispatcherImpl(); - virtual void dispatchStorageEvent(const WebString& key, const WebString& oldValue, - const WebString& newValue, const WebString& origin, - const WebURL&, bool isLocalStorage); -private: - OwnPtr<WebCore::StorageEventDispatcherImpl> m_eventDispatcher; -}; - -} // namespace WebKit - -#endif // WebStorageEventDispatcherImpl_h diff --git a/Source/WebKit/chromium/src/WebTextRun.cpp b/Source/WebKit/chromium/src/WebTextRun.cpp index d2652405c..e8037d24b 100644 --- a/Source/WebKit/chromium/src/WebTextRun.cpp +++ b/Source/WebKit/chromium/src/WebTextRun.cpp @@ -39,7 +39,7 @@ namespace WebKit { WebTextRun::operator WebCore::TextRun() const { - return TextRun(text, false, 0, 0, TextRun::AllowTrailingExpansion, rtl ? RTL : LTR, directionalOverride); + return TextRun(text, 0, 0, TextRun::AllowTrailingExpansion, rtl ? RTL : LTR, directionalOverride); } } // namespace WebKit diff --git a/Source/WebKit/chromium/src/WebUserMediaRequest.cpp b/Source/WebKit/chromium/src/WebUserMediaRequest.cpp index dcd270385..c9c0eccb3 100644 --- a/Source/WebKit/chromium/src/WebUserMediaRequest.cpp +++ b/Source/WebKit/chromium/src/WebUserMediaRequest.cpp @@ -36,11 +36,13 @@ #include "Document.h" #include "Frame.h" +#include "MediaStreamDescriptor.h" #include "MediaStreamSource.h" #include "Page.h" #include "SecurityOrigin.h" #include "UserMediaRequest.h" #include "WebSecurityOrigin.h" +#include "platform/WebMediaStreamDescriptor.h" #include "platform/WebMediaStreamSource.h" #include "platform/WebString.h" #include "platform/WebVector.h" @@ -95,6 +97,15 @@ void WebUserMediaRequest::requestSucceeded(const WebVector<WebMediaStreamSource> m_private->succeed(audio, video); } +void WebUserMediaRequest::requestSucceeded(const WebMediaStreamDescriptor& streamDescriptor) +{ + ASSERT(!streamDescriptor.isNull()); + if (m_private.isNull()) + return; + + m_private->succeed(streamDescriptor); +} + void WebUserMediaRequest::requestFailed() { m_private->fail(); @@ -109,10 +120,7 @@ bool WebUserMediaRequest::equals(const WebUserMediaRequest& other) const void WebUserMediaRequest::assign(const WebUserMediaRequest& other) { - UserMediaRequest* p = other.m_private.get(); - if (p) - p->ref(); - m_private = p; + m_private = other.m_private; } WebUserMediaRequest::operator UserMediaRequest*() const diff --git a/Source/WebKit/chromium/src/WebViewImpl.cpp b/Source/WebKit/chromium/src/WebViewImpl.cpp index 4318dc79d..626da8a21 100644 --- a/Source/WebKit/chromium/src/WebViewImpl.cpp +++ b/Source/WebKit/chromium/src/WebViewImpl.cpp @@ -143,14 +143,14 @@ #include "WheelEvent.h" #include "cc/CCProxy.h" #include "painting/GraphicsContextBuilder.h" -#include "platform/WebDragData.h" -#include "platform/WebImage.h" #include "platform/WebKitPlatformSupport.h" #include "platform/WebString.h" #include "platform/WebVector.h" #include <public/Platform.h> +#include <public/WebDragData.h> #include <public/WebFloatPoint.h> #include <public/WebGraphicsContext3D.h> +#include <public/WebImage.h> #include <public/WebLayer.h> #include <public/WebLayerTreeView.h> #include <public/WebPoint.h> @@ -658,12 +658,22 @@ bool WebViewImpl::handleGestureEvent(const WebGestureEvent& event) } return gestureHandled; } + case WebInputEvent::GestureLongPress: { + if (!mainFrameImpl() || !mainFrameImpl()->frameView()) + return false; + + m_page->contextMenuController()->clearContextMenu(); + m_contextMenuAllowed = true; + PlatformGestureEventBuilder platformEvent(mainFrameImpl()->frameView(), event); + bool handled = mainFrameImpl()->frame()->eventHandler()->sendContextMenuEventForGesture(platformEvent); + m_contextMenuAllowed = false; + return handled; + } case WebInputEvent::GestureScrollBegin: case WebInputEvent::GestureScrollEnd: case WebInputEvent::GestureScrollUpdate: case WebInputEvent::GestureTapDown: case WebInputEvent::GestureDoubleTap: - case WebInputEvent::GestureLongPress: case WebInputEvent::GesturePinchBegin: case WebInputEvent::GesturePinchEnd: case WebInputEvent::GesturePinchUpdate: { @@ -1251,6 +1261,11 @@ WebViewImpl* WebViewImpl::fromPage(Page* page) return static_cast<WebViewImpl*>(chromeClient->webView()); } +PageGroup* WebViewImpl::defaultPageGroup() +{ + return PageGroup::pageGroup(pageGroupName); +} + // WebWidget ------------------------------------------------------------------ void WebViewImpl::close() @@ -1432,6 +1447,13 @@ void WebViewImpl::updateAnimations(double monotonicFrameBeginTime) #if ENABLE(REQUEST_ANIMATION_FRAME) TRACE_EVENT("WebViewImpl::updateAnimations", this, 0); + WebFrameImpl* webframe = mainFrameImpl(); + if (!webframe) + return; + FrameView* view = webframe->frameView(); + if (!view) + return; + // Create synthetic wheel events as necessary for fling. if (m_gestureAnimation) { if (m_gestureAnimation->animate(monotonicFrameBeginTime)) @@ -1440,9 +1462,6 @@ void WebViewImpl::updateAnimations(double monotonicFrameBeginTime) m_gestureAnimation.clear(); } - if (!m_page) - return; - PageWidgetDelegate::animate(m_page.get(), monotonicFrameBeginTime); #endif } @@ -1872,8 +1891,21 @@ WebTextInputType WebViewImpl::textInputType() return WebTextInputTypeTelephone; if (input->isURLField()) return WebTextInputTypeURL; + if (input->isDateField()) + return WebTextInputTypeDate; + if (input->isDateTimeField()) + return WebTextInputTypeDateTime; + if (input->isDateTimeLocalField()) + return WebTextInputTypeDateTimeLocal; + if (input->isMonthField()) + return WebTextInputTypeMonth; + if (input->isTimeField()) + return WebTextInputTypeTime; + if (input->isWeekField()) + return WebTextInputTypeWeek; if (input->isTextField()) return WebTextInputTypeText; + return WebTextInputTypeNone; } diff --git a/Source/WebKit/chromium/src/WebViewImpl.h b/Source/WebKit/chromium/src/WebViewImpl.h index 9383ba28d..9b44fb68d 100644 --- a/Source/WebKit/chromium/src/WebViewImpl.h +++ b/Source/WebKit/chromium/src/WebViewImpl.h @@ -69,6 +69,7 @@ class HistoryItem; class HitTestResult; class KeyboardEvent; class Page; +class PageGroup; class PagePopup; class PagePopupClient; class PlatformGestureCurveTarget; @@ -300,6 +301,12 @@ public: static WebViewImpl* fromPage(WebCore::Page*); + // A pageGroup identifies a namespace of pages. Page groups are used on PLATFORM(MAC) + // for some programs that use HTML views to display things that don't seem like + // web pages to the user (so shouldn't have visited link coloring). We only use + // one page group. + static WebCore::PageGroup* defaultPageGroup(); + WebViewClient* client() { return m_client; diff --git a/Source/WebKit/chromium/src/WebWorkerClientImpl.h b/Source/WebKit/chromium/src/WebWorkerClientImpl.h index 2a865488d..f6779083b 100644 --- a/Source/WebKit/chromium/src/WebWorkerClientImpl.h +++ b/Source/WebKit/chromium/src/WebWorkerClientImpl.h @@ -39,8 +39,8 @@ #include "WorkerMessagingProxy.h" #include "WorkerObjectProxy.h" -#include "platform/WebFileSystem.h" #include "WebWorkerBase.h" +#include <public/WebFileSystem.h> #include <wtf/OwnPtr.h> #include <wtf/PassOwnPtr.h> #include <wtf/RefPtr.h> diff --git a/Source/WebKit/chromium/src/WorkerAsyncFileSystemChromium.cpp b/Source/WebKit/chromium/src/WorkerAsyncFileSystemChromium.cpp index bcbca5651..09021ef44 100644 --- a/Source/WebKit/chromium/src/WorkerAsyncFileSystemChromium.cpp +++ b/Source/WebKit/chromium/src/WorkerAsyncFileSystemChromium.cpp @@ -38,7 +38,6 @@ #include "FileMetadata.h" #include "FileSystem.h" #include "NotImplemented.h" -#include "platform/WebFileSystem.h" #include "WebFileSystemCallbacksImpl.h" #include "WebFileWriter.h" #include "WebKit.h" @@ -49,6 +48,7 @@ #include "WorkerFileSystemCallbacksBridge.h" #include "WorkerScriptController.h" #include "WorkerThread.h" +#include <public/WebFileSystem.h> #include <wtf/text/CString.h> using namespace WebKit; @@ -57,9 +57,8 @@ namespace WebCore { static const char fileSystemOperationsMode[] = "fileSystemOperationsMode"; -WorkerAsyncFileSystemChromium::WorkerAsyncFileSystemChromium(ScriptExecutionContext* context, FileSystemType type, const WebKit::WebURL& rootURL, FileSystemSynchronousType synchronousType) - : AsyncFileSystemChromium(type, rootURL) - , m_scriptExecutionContext(context) +WorkerAsyncFileSystemChromium::WorkerAsyncFileSystemChromium(ScriptExecutionContext* context, FileSystemSynchronousType synchronousType) + : m_scriptExecutionContext(context) , m_workerContext(static_cast<WorkerContext*>(context)) , m_synchronousType(synchronousType) { @@ -86,54 +85,54 @@ bool WorkerAsyncFileSystemChromium::waitForOperationToComplete() return true; } -void WorkerAsyncFileSystemChromium::move(const String& sourcePath, const String& destinationPath, PassOwnPtr<AsyncFileSystemCallbacks> callbacks) +void WorkerAsyncFileSystemChromium::move(const KURL& sourcePath, const KURL& destinationPath, PassOwnPtr<AsyncFileSystemCallbacks> callbacks) { - createWorkerFileSystemCallbacksBridge(callbacks)->postMoveToMainThread(m_webFileSystem, virtualPathToFileSystemURL(sourcePath), virtualPathToFileSystemURL(destinationPath), m_modeForCurrentOperation); + createWorkerFileSystemCallbacksBridge(callbacks)->postMoveToMainThread(m_webFileSystem, sourcePath, destinationPath, m_modeForCurrentOperation); } -void WorkerAsyncFileSystemChromium::copy(const String& sourcePath, const String& destinationPath, PassOwnPtr<AsyncFileSystemCallbacks> callbacks) +void WorkerAsyncFileSystemChromium::copy(const KURL& sourcePath, const KURL& destinationPath, PassOwnPtr<AsyncFileSystemCallbacks> callbacks) { - createWorkerFileSystemCallbacksBridge(callbacks)->postCopyToMainThread(m_webFileSystem, virtualPathToFileSystemURL(sourcePath), virtualPathToFileSystemURL(destinationPath), m_modeForCurrentOperation); + createWorkerFileSystemCallbacksBridge(callbacks)->postCopyToMainThread(m_webFileSystem, sourcePath, destinationPath, m_modeForCurrentOperation); } -void WorkerAsyncFileSystemChromium::remove(const String& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks) +void WorkerAsyncFileSystemChromium::remove(const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks) { - createWorkerFileSystemCallbacksBridge(callbacks)->postRemoveToMainThread(m_webFileSystem, virtualPathToFileSystemURL(path), m_modeForCurrentOperation); + createWorkerFileSystemCallbacksBridge(callbacks)->postRemoveToMainThread(m_webFileSystem, path, m_modeForCurrentOperation); } -void WorkerAsyncFileSystemChromium::removeRecursively(const String& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks) +void WorkerAsyncFileSystemChromium::removeRecursively(const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks) { - createWorkerFileSystemCallbacksBridge(callbacks)->postRemoveRecursivelyToMainThread(m_webFileSystem, virtualPathToFileSystemURL(path), m_modeForCurrentOperation); + createWorkerFileSystemCallbacksBridge(callbacks)->postRemoveRecursivelyToMainThread(m_webFileSystem, path, m_modeForCurrentOperation); } -void WorkerAsyncFileSystemChromium::readMetadata(const String& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks) +void WorkerAsyncFileSystemChromium::readMetadata(const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks) { - createWorkerFileSystemCallbacksBridge(callbacks)->postReadMetadataToMainThread(m_webFileSystem, virtualPathToFileSystemURL(path), m_modeForCurrentOperation); + createWorkerFileSystemCallbacksBridge(callbacks)->postReadMetadataToMainThread(m_webFileSystem, path, m_modeForCurrentOperation); } -void WorkerAsyncFileSystemChromium::createFile(const String& path, bool exclusive, PassOwnPtr<AsyncFileSystemCallbacks> callbacks) +void WorkerAsyncFileSystemChromium::createFile(const KURL& path, bool exclusive, PassOwnPtr<AsyncFileSystemCallbacks> callbacks) { - createWorkerFileSystemCallbacksBridge(callbacks)->postCreateFileToMainThread(m_webFileSystem, virtualPathToFileSystemURL(path), exclusive, m_modeForCurrentOperation); + createWorkerFileSystemCallbacksBridge(callbacks)->postCreateFileToMainThread(m_webFileSystem, path, exclusive, m_modeForCurrentOperation); } -void WorkerAsyncFileSystemChromium::createDirectory(const String& path, bool exclusive, PassOwnPtr<AsyncFileSystemCallbacks> callbacks) +void WorkerAsyncFileSystemChromium::createDirectory(const KURL& path, bool exclusive, PassOwnPtr<AsyncFileSystemCallbacks> callbacks) { - createWorkerFileSystemCallbacksBridge(callbacks)->postCreateDirectoryToMainThread(m_webFileSystem, virtualPathToFileSystemURL(path), exclusive, m_modeForCurrentOperation); + createWorkerFileSystemCallbacksBridge(callbacks)->postCreateDirectoryToMainThread(m_webFileSystem, path, exclusive, m_modeForCurrentOperation); } -void WorkerAsyncFileSystemChromium::fileExists(const String& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks) +void WorkerAsyncFileSystemChromium::fileExists(const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks) { - createWorkerFileSystemCallbacksBridge(callbacks)->postFileExistsToMainThread(m_webFileSystem, virtualPathToFileSystemURL(path), m_modeForCurrentOperation); + createWorkerFileSystemCallbacksBridge(callbacks)->postFileExistsToMainThread(m_webFileSystem, path, m_modeForCurrentOperation); } -void WorkerAsyncFileSystemChromium::directoryExists(const String& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks) +void WorkerAsyncFileSystemChromium::directoryExists(const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks) { - createWorkerFileSystemCallbacksBridge(callbacks)->postDirectoryExistsToMainThread(m_webFileSystem, virtualPathToFileSystemURL(path), m_modeForCurrentOperation); + createWorkerFileSystemCallbacksBridge(callbacks)->postDirectoryExistsToMainThread(m_webFileSystem, path, m_modeForCurrentOperation); } -void WorkerAsyncFileSystemChromium::readDirectory(const String& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks) +void WorkerAsyncFileSystemChromium::readDirectory(const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks) { - createWorkerFileSystemCallbacksBridge(callbacks)->postReadDirectoryToMainThread(m_webFileSystem, virtualPathToFileSystemURL(path), m_modeForCurrentOperation); + createWorkerFileSystemCallbacksBridge(callbacks)->postReadDirectoryToMainThread(m_webFileSystem, path, m_modeForCurrentOperation); } class WorkerFileWriterHelperCallbacks : public AsyncFileSystemCallbacks { @@ -143,11 +142,6 @@ public: return adoptPtr(new WorkerFileWriterHelperCallbacks(client, path, webFileSystem, callbacks, workerContext)); } - virtual void didSucceed() - { - ASSERT_NOT_REACHED(); - } - virtual void didReadMetadata(const FileMetadata& metadata) { ASSERT(m_callbacks); @@ -159,27 +153,6 @@ public: } } - virtual void didReadDirectoryEntry(const String& name, bool isDirectory) - { - ASSERT_NOT_REACHED(); - } - - virtual void didReadDirectoryEntries(bool hasMore) - { - ASSERT_NOT_REACHED(); - } - - virtual void didOpenFileSystem(const String&, PassOwnPtr<AsyncFileSystem>) - { - ASSERT_NOT_REACHED(); - } - - // Called when an AsyncFileWrter has been created successfully. - virtual void didCreateFileWriter(PassOwnPtr<AsyncFileWriter>, long long) - { - ASSERT_NOT_REACHED(); - } - virtual void didFail(int code) { ASSERT(m_callbacks); @@ -203,18 +176,16 @@ private: WorkerContext* m_workerContext; }; -void WorkerAsyncFileSystemChromium::createWriter(AsyncFileWriterClient* client, const String& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks) +void WorkerAsyncFileSystemChromium::createWriter(AsyncFileWriterClient* client, const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks) { - KURL pathAsURL = virtualPathToFileSystemURL(path); - createWorkerFileSystemCallbacksBridge(WorkerFileWriterHelperCallbacks::create(client, pathAsURL, m_webFileSystem, callbacks, m_workerContext))->postReadMetadataToMainThread(m_webFileSystem, pathAsURL, m_modeForCurrentOperation); + createWorkerFileSystemCallbacksBridge(WorkerFileWriterHelperCallbacks::create(client, path, m_webFileSystem, callbacks, m_workerContext))->postReadMetadataToMainThread(m_webFileSystem, path, m_modeForCurrentOperation); } -void WorkerAsyncFileSystemChromium::createSnapshotFileAndReadMetadata(const String& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks) +void WorkerAsyncFileSystemChromium::createSnapshotFileAndReadMetadata(const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks) { - KURL pathAsURL = virtualPathToFileSystemURL(path); KURL internalBlobURL = BlobURL::createInternalURL(); - createWorkerFileSystemCallbacksBridge(createSnapshotFileCallback(internalBlobURL, callbacks))->postCreateSnapshotFileToMainThread(m_webFileSystem, internalBlobURL, pathAsURL, m_modeForCurrentOperation); + createWorkerFileSystemCallbacksBridge(createSnapshotFileCallback(internalBlobURL, callbacks))->postCreateSnapshotFileToMainThread(m_webFileSystem, internalBlobURL, path, m_modeForCurrentOperation); } PassRefPtr<WorkerFileSystemCallbacksBridge> WorkerAsyncFileSystemChromium::createWorkerFileSystemCallbacksBridge(PassOwnPtr<AsyncFileSystemCallbacks> callbacks) diff --git a/Source/WebKit/chromium/src/WorkerAsyncFileSystemChromium.h b/Source/WebKit/chromium/src/WorkerAsyncFileSystemChromium.h index 2618c48b9..6727d1e47 100644 --- a/Source/WebKit/chromium/src/WorkerAsyncFileSystemChromium.h +++ b/Source/WebKit/chromium/src/WorkerAsyncFileSystemChromium.h @@ -53,9 +53,9 @@ class WorkerContext; class WorkerAsyncFileSystemChromium : public AsyncFileSystemChromium { public: - static PassOwnPtr<AsyncFileSystem> create(ScriptExecutionContext* context, FileSystemType type, const WebKit::WebURL& rootURL, FileSystemSynchronousType synchronousType) + static PassOwnPtr<AsyncFileSystem> create(ScriptExecutionContext* context, FileSystemSynchronousType synchronousType) { - return adoptPtr(new WorkerAsyncFileSystemChromium(context, type, rootURL, synchronousType)); + return adoptPtr(new WorkerAsyncFileSystemChromium(context, synchronousType)); } virtual ~WorkerAsyncFileSystemChromium(); @@ -63,21 +63,21 @@ public: // Runs one pending operation (to wait for completion in the sync-mode). virtual bool waitForOperationToComplete(); - virtual void move(const String& sourcePath, const String& destinationPath, PassOwnPtr<AsyncFileSystemCallbacks>); - virtual void copy(const String& sourcePath, const String& destinationPath, PassOwnPtr<AsyncFileSystemCallbacks>); - virtual void remove(const String& path, PassOwnPtr<AsyncFileSystemCallbacks>); - virtual void removeRecursively(const String& path, PassOwnPtr<AsyncFileSystemCallbacks>); - virtual void readMetadata(const String& path, PassOwnPtr<AsyncFileSystemCallbacks>); - virtual void createFile(const String& path, bool exclusive, PassOwnPtr<AsyncFileSystemCallbacks>); - virtual void createDirectory(const String& path, bool exclusive, PassOwnPtr<AsyncFileSystemCallbacks>); - virtual void fileExists(const String& path, PassOwnPtr<AsyncFileSystemCallbacks>); - virtual void directoryExists(const String& path, PassOwnPtr<AsyncFileSystemCallbacks>); - virtual void readDirectory(const String& path, PassOwnPtr<AsyncFileSystemCallbacks>); - virtual void createWriter(AsyncFileWriterClient* client, const String& path, PassOwnPtr<AsyncFileSystemCallbacks>); - virtual void createSnapshotFileAndReadMetadata(const String& path, PassOwnPtr<AsyncFileSystemCallbacks>); + virtual void move(const KURL& sourcePath, const KURL& destinationPath, PassOwnPtr<AsyncFileSystemCallbacks>); + virtual void copy(const KURL& sourcePath, const KURL& destinationPath, PassOwnPtr<AsyncFileSystemCallbacks>); + virtual void remove(const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks>); + virtual void removeRecursively(const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks>); + virtual void readMetadata(const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks>); + virtual void createFile(const KURL& path, bool exclusive, PassOwnPtr<AsyncFileSystemCallbacks>); + virtual void createDirectory(const KURL& path, bool exclusive, PassOwnPtr<AsyncFileSystemCallbacks>); + virtual void fileExists(const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks>); + virtual void directoryExists(const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks>); + virtual void readDirectory(const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks>); + virtual void createWriter(AsyncFileWriterClient*, const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks>); + virtual void createSnapshotFileAndReadMetadata(const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks>); private: - WorkerAsyncFileSystemChromium(ScriptExecutionContext*, FileSystemType, const WebKit::WebURL& rootURL, FileSystemSynchronousType); + WorkerAsyncFileSystemChromium(ScriptExecutionContext*, FileSystemSynchronousType); PassRefPtr<WebKit::WorkerFileSystemCallbacksBridge> createWorkerFileSystemCallbacksBridge(PassOwnPtr<AsyncFileSystemCallbacks>); diff --git a/Source/WebKit/chromium/src/WorkerAsyncFileWriterChromium.cpp b/Source/WebKit/chromium/src/WorkerAsyncFileWriterChromium.cpp index 054ecbb1f..6d62098a6 100644 --- a/Source/WebKit/chromium/src/WorkerAsyncFileWriterChromium.cpp +++ b/Source/WebKit/chromium/src/WorkerAsyncFileWriterChromium.cpp @@ -36,7 +36,6 @@ #include "AsyncFileSystem.h" #include "Blob.h" #include "ScriptExecutionContext.h" -#include "platform/WebFileSystem.h" #include "WebFileWriter.h" #include "platform/WebURL.h" #include "WebWorkerBase.h" @@ -44,6 +43,7 @@ #include "WorkerFileWriterCallbacksBridge.h" #include "WorkerLoaderProxy.h" #include "WorkerThread.h" +#include <public/WebFileSystem.h> #include <wtf/Assertions.h> using namespace WebKit; diff --git a/Source/WebKit/chromium/src/WorkerFileSystemCallbacksBridge.h b/Source/WebKit/chromium/src/WorkerFileSystemCallbacksBridge.h index e496de2ef..fa70dd261 100644 --- a/Source/WebKit/chromium/src/WorkerFileSystemCallbacksBridge.h +++ b/Source/WebKit/chromium/src/WorkerFileSystemCallbacksBridge.h @@ -36,8 +36,8 @@ #include "PlatformString.h" #include "ScriptExecutionContext.h" #include "WebFileError.h" -#include "platform/WebFileSystem.h" #include "platform/WebVector.h" +#include <public/WebFileSystem.h> #include <wtf/PassOwnPtr.h> #include <wtf/PassRefPtr.h> #include <wtf/Threading.h> diff --git a/Source/WebKit/chromium/src/WorkerFileWriterCallbacksBridge.cpp b/Source/WebKit/chromium/src/WorkerFileWriterCallbacksBridge.cpp index 26a0ae34f..3ffb178c5 100644 --- a/Source/WebKit/chromium/src/WorkerFileWriterCallbacksBridge.cpp +++ b/Source/WebKit/chromium/src/WorkerFileWriterCallbacksBridge.cpp @@ -36,14 +36,14 @@ #include "AsyncFileWriterClient.h" #include "CrossThreadTask.h" #include "platform/WebCString.h" -#include "platform/WebFileSystem.h" #include "WebFileWriter.h" #include "WebKit.h" -#include "platform/WebKitPlatformSupport.h" #include "WebWorkerBase.h" #include "WorkerContext.h" #include "WorkerLoaderProxy.h" #include "WorkerThread.h" +#include <public/Platform.h> +#include <public/WebFileSystem.h> #include <wtf/MainThread.h> #include <wtf/Threading.h> @@ -104,7 +104,7 @@ void WorkerFileWriterCallbacksBridge::abortOnMainThread(ScriptExecutionContext*, void WorkerFileWriterCallbacksBridge::initOnMainThread(ScriptExecutionContext*, PassRefPtr<WorkerFileWriterCallbacksBridge> bridge, const KURL& path) { ASSERT(!bridge->m_writer); - bridge->m_writer = adoptPtr(webKitPlatformSupport()->fileSystem()->createFileWriter(path, bridge.get())); + bridge->m_writer = adoptPtr(WebKit::Platform::current()->fileSystem()->createFileWriter(path, bridge.get())); } void WorkerFileWriterCallbacksBridge::shutdownOnMainThread(ScriptExecutionContext*, PassRefPtr<WorkerFileWriterCallbacksBridge> bridge) diff --git a/Source/WebKit/chromium/src/painting/GraphicsContextBuilder.h b/Source/WebKit/chromium/src/painting/GraphicsContextBuilder.h index 5ffae8ebc..79708b396 100644 --- a/Source/WebKit/chromium/src/painting/GraphicsContextBuilder.h +++ b/Source/WebKit/chromium/src/painting/GraphicsContextBuilder.h @@ -33,33 +33,10 @@ #include "GraphicsContext.h" -#if WEBKIT_USING_CG -#include "LocalCurrentGraphicsContext.h" -#elif WEBKIT_USING_SKIA #include "PlatformContextSkia.h" -#endif namespace WebKit { -#if WEBKIT_USING_CG - -class GraphicsContextBuilder { -public: - GraphicsContextBuilder(WebCanvas* canvas) - : m_graphicsContext(canvas) - , m_localContext(&m_graphicsContext) - { - } - - WebCore::GraphicsContext& context() { return m_graphicsContext; } - -private: - WebCore::GraphicsContext m_graphicsContext; - WebCore::LocalCurrentGraphicsContext m_localContext; -}; - -#elif WEBKIT_USING_SKIA - class GraphicsContextBuilder { public: GraphicsContextBuilder(WebCanvas* canvas) @@ -75,10 +52,6 @@ private: WebCore::GraphicsContext m_graphicsContext; }; -#else -#error "Need to define GraphicsContextBuilder!" -#endif - } // namespace WebKit #endif |