Diff
Modified: branches/subpixellayout/Source/_javascript_Core/runtime/StringPrototype.cpp (105913 => 105914)
--- branches/subpixellayout/Source/_javascript_Core/runtime/StringPrototype.cpp 2012-01-25 20:27:13 UTC (rev 105913)
+++ branches/subpixellayout/Source/_javascript_Core/runtime/StringPrototype.cpp 2012-01-25 20:28:13 UTC (rev 105914)
@@ -816,8 +816,6 @@
reg = RegExp::create(exec->globalData(), a0.isUndefined() ? UString("") : a0.toString(exec)->value(exec), NoFlags);
if (!reg->isValid())
return throwVMError(exec, createSyntaxError(exec, reg->errorMessage()));
- if (!reg->isValid())
- return throwVMError(exec, createSyntaxError(exec, reg->errorMessage()));
}
RegExpConstructor* regExpConstructor = exec->lexicalGlobalObject()->regExpConstructor();
int pos;
@@ -870,8 +868,6 @@
reg = RegExp::create(exec->globalData(), a0.isUndefined() ? UString("") : a0.toString(exec)->value(exec), NoFlags);
if (!reg->isValid())
return throwVMError(exec, createSyntaxError(exec, reg->errorMessage()));
- if (!reg->isValid())
- return throwVMError(exec, createSyntaxError(exec, reg->errorMessage()));
}
RegExpConstructor* regExpConstructor = exec->lexicalGlobalObject()->regExpConstructor();
int pos;
Modified: branches/subpixellayout/Source/_javascript_Core/wtf/Uint8ClampedArray.h (105913 => 105914)
--- branches/subpixellayout/Source/_javascript_Core/wtf/Uint8ClampedArray.h 2012-01-25 20:27:13 UTC (rev 105913)
+++ branches/subpixellayout/Source/_javascript_Core/wtf/Uint8ClampedArray.h 2012-01-25 20:28:13 UTC (rev 105914)
@@ -51,6 +51,9 @@
unsigned length);
// Make constructor visible to superclass.
friend class TypedArrayBase<unsigned char>;
+
+ // Overridden from ArrayBufferView.
+ virtual bool isUnsignedByteClampedArray() const { return true; }
};
PassRefPtr<Uint8ClampedArray> Uint8ClampedArray::create(unsigned length)
Deleted: branches/subpixellayout/Source/WebCore/dom/DataTransferItemList.cpp (105913 => 105914)
--- branches/subpixellayout/Source/WebCore/dom/DataTransferItemList.cpp 2012-01-25 20:27:13 UTC (rev 105913)
+++ branches/subpixellayout/Source/WebCore/dom/DataTransferItemList.cpp 2012-01-25 20:28:13 UTC (rev 105914)
@@ -1,112 +0,0 @@
-/*
- * Copyright (C) 2011 Google Inc. All rights reserved.
- * Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies)
- *
- * 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 "DataTransferItemList.h"
-
-#include "DataTransferItem.h"
-#include "ExceptionCode.h"
-
-#if ENABLE(DATA_TRANSFER_ITEMS)
-
-namespace WebCore {
-
-DataTransferItemList::DataTransferItemList(PassRefPtr<Clipboard> clipboard, ScriptExecutionContext* context)
- : m_owner(clipboard)
- , m_context(context)
-{
-}
-
-size_t DataTransferItemList::length()
-{
- if (m_owner->policy() == ClipboardNumb)
- return 0;
-
- return m_items.size();
-}
-
-PassRefPtr<DataTransferItem> DataTransferItemList::item(unsigned long index)
-{
- if (m_owner->policy() == ClipboardNumb || index >= length())
- return 0;
-
- return m_items[index];
-}
-
-void DataTransferItemList::deleteItem(unsigned long index, ExceptionCode& ec)
-{
- if (m_owner->policy() != ClipboardWritable) {
- ec = INVALID_STATE_ERR;
- return;
- }
-
- if (index >= length())
- return;
-
- m_items.remove(index);
-}
-
-void DataTransferItemList::clear()
-{
- if (m_owner->policy() != ClipboardWritable)
- return;
-
- m_items.clear();
-
-}
-
-void DataTransferItemList::add(const String& data, const String& type, ExceptionCode& ec)
-{
- if (m_owner->policy() != ClipboardWritable)
- return;
-
- // Only one 'string' item with a given type is allowed in the collection.
- for (size_t i = 0; i < m_items.size(); ++i) {
- if (m_items[i]->type() == type && m_items[i]->kind() == DataTransferItem::kindString) {
- ec = NOT_SUPPORTED_ERR;
- return;
- }
- }
-
- m_items.append(DataTransferItem::create(m_owner, m_context, data, type));
-}
-
-void DataTransferItemList::add(PassRefPtr<File> file)
-{
- if (m_owner->policy() != ClipboardWritable || !file)
- return;
-
- m_items.append(DataTransferItem::create(m_owner, m_context, file));
-}
-
-}
-
-#endif
Modified: branches/subpixellayout/Source/WebCore/fileapi/DOMFileSystemBase.cpp (105913 => 105914)
--- branches/subpixellayout/Source/WebCore/fileapi/DOMFileSystemBase.cpp 2012-01-25 20:27:13 UTC (rev 105913)
+++ branches/subpixellayout/Source/WebCore/fileapi/DOMFileSystemBase.cpp 2012-01-25 20:28:13 UTC (rev 105914)
@@ -50,10 +50,41 @@
namespace WebCore {
-// static
+const char DOMFileSystemBase::kPersistentPathPrefix[] = "persistent";
+const size_t DOMFileSystemBase::kPersistentPathPrefixLength = sizeof(DOMFileSystemBase::kPersistentPathPrefix) - 1;
+const char DOMFileSystemBase::kTemporaryPathPrefix[] = "temporary";
+const size_t DOMFileSystemBase::kTemporaryPathPrefixLength = sizeof(DOMFileSystemBase::kTemporaryPathPrefix) - 1;
+const char DOMFileSystemBase::kExternalPathPrefix[] = "external";
+const size_t DOMFileSystemBase::kExternalPathPrefixLength = sizeof(DOMFileSystemBase::kExternalPathPrefix) - 1;
+
bool DOMFileSystemBase::crackFileSystemURL(const KURL& url, AsyncFileSystem::Type& type, String& filePath)
{
- return AsyncFileSystem::crackFileSystemURL(url, type, filePath);
+ if (!url.protocolIs("filesystem"))
+ return false;
+
+ KURL originURL(ParsedURLString, url.path());
+ String path = decodeURLEscapeSequences(originURL.path());
+ if (path.isEmpty() || path[0] != '/')
+ return false;
+ path = path.substring(1);
+
+ if (path.startsWith(kTemporaryPathPrefix)) {
+ type = AsyncFileSystem::Temporary;
+ path = path.substring(kTemporaryPathPrefixLength);
+ } else if (path.startsWith(kPersistentPathPrefix)) {
+ type = AsyncFileSystem::Persistent;
+ path = path.substring(kPersistentPathPrefixLength);
+ } else if (path.startsWith(kExternalPathPrefix)) {
+ type = AsyncFileSystem::External;
+ path = path.substring(kExternalPathPrefixLength);
+ } else
+ return false;
+
+ if (path.isEmpty() || path[0] != '/')
+ return false;
+
+ filePath.swap(path);
+ return true;
}
DOMFileSystemBase::DOMFileSystemBase(ScriptExecutionContext* context, const String& name, PassOwnPtr<AsyncFileSystem> asyncFileSystem)
Modified: branches/subpixellayout/Source/WebCore/fileapi/DOMFileSystemBase.h (105913 => 105914)
--- branches/subpixellayout/Source/WebCore/fileapi/DOMFileSystemBase.h 2012-01-25 20:27:13 UTC (rev 105913)
+++ branches/subpixellayout/Source/WebCore/fileapi/DOMFileSystemBase.h 2012-01-25 20:28:13 UTC (rev 105914)
@@ -62,6 +62,12 @@
}
virtual ~DOMFileSystemBase();
+ static const char kPersistentPathPrefix[];
+ static const size_t kPersistentPathPrefixLength;
+ static const char kTemporaryPathPrefix[];
+ static const size_t kTemporaryPathPrefixLength;
+ static const char kExternalPathPrefix[];
+ static const size_t kExternalPathPrefixLength;
static bool crackFileSystemURL(const KURL&, AsyncFileSystem::Type&, String& filePath);
const String& name() const { return m_name; }
Modified: branches/subpixellayout/Source/WebCore/fileapi/EntryBase.cpp (105913 => 105914)
--- branches/subpixellayout/Source/WebCore/fileapi/EntryBase.cpp 2012-01-25 20:27:13 UTC (rev 105913)
+++ branches/subpixellayout/Source/WebCore/fileapi/EntryBase.cpp 2012-01-25 20:28:13 UTC (rev 105914)
@@ -39,6 +39,7 @@
#include "PlatformString.h"
#include "SecurityOrigin.h"
#include <wtf/PassRefPtr.h>
+#include <wtf/text/StringBuilder.h>
namespace WebCore {
@@ -55,7 +56,27 @@
String EntryBase::toURL()
{
- return m_fileSystem->asyncFileSystem()->toURL(m_fileSystem->securityOrigin()->toString(), m_fullPath);
+ String originString = m_fileSystem->securityOrigin()->toString();
+ ASSERT(!originString.isEmpty());
+ if (originString == "null")
+ return String();
+ StringBuilder result;
+ result.append("filesystem:");
+ result.append(originString);
+ result.append("/");
+ switch (m_fileSystem->asyncFileSystem()->type()) {
+ case AsyncFileSystem::Temporary:
+ result.append(DOMFileSystemBase::kTemporaryPathPrefix);
+ break;
+ case AsyncFileSystem::Persistent:
+ result.append(DOMFileSystemBase::kPersistentPathPrefix);
+ break;
+ case AsyncFileSystem::External:
+ result.append(DOMFileSystemBase::kExternalPathPrefix);
+ break;
+ }
+ result.append(m_fullPath);
+ return result.toString();
}
} // namespace WebCore
Modified: branches/subpixellayout/Source/WebCore/fileapi/FileWriter.cpp (105913 => 105914)
--- branches/subpixellayout/Source/WebCore/fileapi/FileWriter.cpp 2012-01-25 20:27:13 UTC (rev 105913)
+++ branches/subpixellayout/Source/WebCore/fileapi/FileWriter.cpp 2012-01-25 20:28:13 UTC (rev 105914)
@@ -43,7 +43,7 @@
namespace WebCore {
-static const int maxRecursionDepth = 3;
+static const int kMaxRecursionDepth = 3;
FileWriter::FileWriter(ScriptExecutionContext* context)
: ActiveDOMObject(context, this)
@@ -103,7 +103,7 @@
setError(FileError::TYPE_MISMATCH_ERR, ec);
return;
}
- if (m_recursionDepth > maxRecursionDepth) {
+ if (m_recursionDepth > kMaxRecursionDepth) {
setError(FileError::SECURITY_ERR, ec);
return;
}
@@ -141,7 +141,7 @@
setError(FileError::INVALID_STATE_ERR, ec);
return;
}
- if (m_recursionDepth > maxRecursionDepth) {
+ if (m_recursionDepth > kMaxRecursionDepth) {
setError(FileError::SECURITY_ERR, ec);
return;
}
Modified: branches/subpixellayout/Source/WebCore/page/DOMWindow.cpp (105913 => 105914)
--- branches/subpixellayout/Source/WebCore/page/DOMWindow.cpp 2012-01-25 20:27:13 UTC (rev 105913)
+++ branches/subpixellayout/Source/WebCore/page/DOMWindow.cpp 2012-01-25 20:28:13 UTC (rev 105914)
@@ -772,7 +772,7 @@
}
AsyncFileSystem::Type fileSystemType = static_cast<AsyncFileSystem::Type>(type);
- if (fileSystemType != AsyncFileSystem::Temporary && fileSystemType != AsyncFileSystem::Persistent) {
+ if (fileSystemType != AsyncFileSystem::Temporary && fileSystemType != AsyncFileSystem::Persistent && fileSystemType != AsyncFileSystem::External) {
DOMFileSystem::scheduleCallback(document, errorCallback, FileError::create(FileError::INVALID_MODIFICATION_ERR));
return;
}
@@ -806,6 +806,8 @@
LocalFileSystem::localFileSystem().readFileSystem(document, type, ResolveURICallbacks::create(successCallback, errorCallback, document, filePath));
}
+COMPILE_ASSERT(static_cast<int>(DOMWindow::EXTERNAL) == static_cast<int>(AsyncFileSystem::External), enum_mismatch);
+
COMPILE_ASSERT(static_cast<int>(DOMWindow::TEMPORARY) == static_cast<int>(AsyncFileSystem::Temporary), enum_mismatch);
COMPILE_ASSERT(static_cast<int>(DOMWindow::PERSISTENT) == static_cast<int>(AsyncFileSystem::Persistent), enum_mismatch);
Modified: branches/subpixellayout/Source/WebCore/page/DOMWindow.h (105913 => 105914)
--- branches/subpixellayout/Source/WebCore/page/DOMWindow.h 2012-01-25 20:27:13 UTC (rev 105913)
+++ branches/subpixellayout/Source/WebCore/page/DOMWindow.h 2012-01-25 20:28:13 UTC (rev 105914)
@@ -366,6 +366,7 @@
enum FileSystemType {
TEMPORARY,
PERSISTENT,
+ EXTERNAL,
};
void webkitRequestFileSystem(int type, long long size, PassRefPtr<FileSystemCallback>, PassRefPtr<ErrorCallback>);
void webkitResolveLocalFileSystemURL(const String&, PassRefPtr<EntryCallback>, PassRefPtr<ErrorCallback>);
Modified: branches/subpixellayout/Source/WebCore/platform/AsyncFileSystem.cpp (105913 => 105914)
--- branches/subpixellayout/Source/WebCore/platform/AsyncFileSystem.cpp 2012-01-25 20:27:13 UTC (rev 105913)
+++ branches/subpixellayout/Source/WebCore/platform/AsyncFileSystem.cpp 2012-01-25 20:28:13 UTC (rev 105914)
@@ -36,60 +36,9 @@
#include "AsyncFileSystemCallbacks.h"
#include "FileSystem.h"
#include "NotImplemented.h"
-#include <wtf/text/StringBuilder.h>
namespace WebCore {
-const char AsyncFileSystem::persistentPathPrefix[] = "persistent";
-const size_t AsyncFileSystem::persistentPathPrefixLength = sizeof(AsyncFileSystem::persistentPathPrefix) - 1;
-const char AsyncFileSystem::temporaryPathPrefix[] = "temporary";
-const size_t AsyncFileSystem::temporaryPathPrefixLength = sizeof(AsyncFileSystem::temporaryPathPrefix) - 1;
-
-bool AsyncFileSystem::crackFileSystemURL(const KURL& url, AsyncFileSystem::Type& type, String& filePath)
-{
- if (!url.protocolIs("filesystem"))
- return false;
-
- KURL originURL(ParsedURLString, url.path());
- String path = decodeURLEscapeSequences(originURL.path());
- if (path.isEmpty() || path[0] != '/')
- return false;
- path = path.substring(1);
-
- if (path.startsWith(temporaryPathPrefix)) {
- type = Temporary;
- path = path.substring(temporaryPathPrefixLength);
- } else if (path.startsWith(persistentPathPrefix)) {
- type = Persistent;
- path = path.substring(persistentPathPrefixLength);
- } else
- return false;
-
- if (path.isEmpty() || path[0] != '/')
- return false;
-
- filePath.swap(path);
- return true;
-}
-
-String AsyncFileSystem::toURL(const String& originString, const String& fullPath)
-{
- StringBuilder result;
- result.append("filesystem:");
- result.append(originString);
- result.append("/");
- switch (type()) {
- case Temporary:
- result.append(temporaryPathPrefix);
- break;
- case Persistent:
- result.append(persistentPathPrefix);
- break;
- }
- result.append(fullPath);
- return result.toString();
-}
-
#if !PLATFORM(CHROMIUM)
bool AsyncFileSystem::isAvailable()
{
Modified: branches/subpixellayout/Source/WebCore/platform/AsyncFileSystem.h (105913 => 105914)
--- branches/subpixellayout/Source/WebCore/platform/AsyncFileSystem.h 2012-01-25 20:27:13 UTC (rev 105913)
+++ branches/subpixellayout/Source/WebCore/platform/AsyncFileSystem.h 2012-01-25 20:28:13 UTC (rev 105914)
@@ -54,6 +54,7 @@
enum Type {
Temporary,
Persistent,
+ External,
};
virtual void stop() { }
@@ -61,18 +62,6 @@
static bool isAvailable();
- // Path prefixes that are used in the filesystem URLs (that can be obtained by toURL()).
- // http://www.w3.org/TR/file-system-api/#widl-Entry-toURL
- static const char persistentPathPrefix[];
- static const size_t persistentPathPrefixLength;
- static const char temporaryPathPrefix[];
- static const size_t temporaryPathPrefixLength;
-
- static bool crackFileSystemURL(const KURL&, AsyncFileSystem::Type&, String& filePath);
-
- // Returns the filesystem URL for the given originString and fullPath.
- virtual String toURL(const String& originString, const String& fullPath);
-
// Subclass must implement this if it supports synchronous operations.
// This should return false if there are no pending operations.
virtual bool waitForOperationToComplete() { return false; }
Modified: branches/subpixellayout/Source/WebCore/platform/RunLoop.cpp (105913 => 105914)
--- branches/subpixellayout/Source/WebCore/platform/RunLoop.cpp 2012-01-25 20:27:13 UTC (rev 105913)
+++ branches/subpixellayout/Source/WebCore/platform/RunLoop.cpp 2012-01-25 20:28:13 UTC (rev 105914)
@@ -30,6 +30,8 @@
namespace WebCore {
+#if !PLATFORM(MAC)
+
static RunLoop* s_mainRunLoop;
void RunLoop::initializeMainRunLoop()
@@ -51,6 +53,8 @@
return s_mainRunLoop;
}
+#endif
+
void RunLoop::performWork()
{
Vector<Function<void()> > functionQueue;
Modified: branches/subpixellayout/Source/WebCore/platform/RunLoop.h (105913 => 105914)
--- branches/subpixellayout/Source/WebCore/platform/RunLoop.h 2012-01-25 20:27:13 UTC (rev 105913)
+++ branches/subpixellayout/Source/WebCore/platform/RunLoop.h 2012-01-25 20:28:13 UTC (rev 105914)
@@ -47,7 +47,8 @@
class RunLoop {
public:
- // Must be called from the main thread.
+ // Must be called from the main thread (except for the Mac platform, where it
+ // can be called from any thread).
static void initializeMainRunLoop();
static RunLoop* current();
@@ -141,6 +142,7 @@
typedef HashMap<uint64_t, TimerBase*> TimerMap;
TimerMap m_activeTimers;
#elif PLATFORM(MAC)
+ RunLoop(CFRunLoopRef);
static void performWork(void*);
CFRunLoopRef m_runLoop;
CFRunLoopSourceRef m_runLoopSource;
Modified: branches/subpixellayout/Source/WebCore/platform/graphics/chromium/cc/CCCanvasDrawQuad.cpp (105913 => 105914)
--- branches/subpixellayout/Source/WebCore/platform/graphics/chromium/cc/CCCanvasDrawQuad.cpp 2012-01-25 20:27:13 UTC (rev 105913)
+++ branches/subpixellayout/Source/WebCore/platform/graphics/chromium/cc/CCCanvasDrawQuad.cpp 2012-01-25 20:28:13 UTC (rev 105914)
@@ -29,16 +29,17 @@
namespace WebCore {
-PassOwnPtr<CCCanvasDrawQuad> CCCanvasDrawQuad::create(const CCSharedQuadState* sharedQuadState, const IntRect& quadRect, CCLayerImpl* layer)
+PassOwnPtr<CCCanvasDrawQuad> CCCanvasDrawQuad::create(const CCSharedQuadState* sharedQuadState, const IntRect& quadRect, unsigned textureId, bool hasAlpha, bool premultipliedAlpha)
{
- return adoptPtr(new CCCanvasDrawQuad(sharedQuadState, quadRect, layer));
+ return adoptPtr(new CCCanvasDrawQuad(sharedQuadState, quadRect, textureId, hasAlpha, premultipliedAlpha));
}
-CCCanvasDrawQuad::CCCanvasDrawQuad(const CCSharedQuadState* sharedQuadState, const IntRect& quadRect, CCLayerImpl* layer)
+CCCanvasDrawQuad::CCCanvasDrawQuad(const CCSharedQuadState* sharedQuadState, const IntRect& quadRect, unsigned textureId, bool hasAlpha, bool premultipliedAlpha)
: CCDrawQuad(sharedQuadState, CCDrawQuad::CanvasContent, quadRect)
- , m_layer(layer)
+ , m_textureId(textureId)
+ , m_hasAlpha(hasAlpha)
+ , m_premultipliedAlpha(premultipliedAlpha)
{
- ASSERT(m_layer);
}
}
Modified: branches/subpixellayout/Source/WebCore/platform/graphics/chromium/cc/CCCanvasDrawQuad.h (105913 => 105914)
--- branches/subpixellayout/Source/WebCore/platform/graphics/chromium/cc/CCCanvasDrawQuad.h 2012-01-25 20:27:13 UTC (rev 105913)
+++ branches/subpixellayout/Source/WebCore/platform/graphics/chromium/cc/CCCanvasDrawQuad.h 2012-01-25 20:28:13 UTC (rev 105914)
@@ -35,14 +35,18 @@
class CCCanvasDrawQuad : public CCDrawQuad {
WTF_MAKE_NONCOPYABLE(CCCanvasDrawQuad);
public:
- static PassOwnPtr<CCCanvasDrawQuad> create(const CCSharedQuadState*, const IntRect&, CCLayerImpl*);
+ static PassOwnPtr<CCCanvasDrawQuad> create(const CCSharedQuadState*, const IntRect&, unsigned texture_id, bool hasAlpha, bool premultipliedAlpha);
- CCLayerImpl* layer() const { return m_layer; }
+ unsigned textureId() const { return m_textureId; }
+ bool hasAlpha() const { return m_hasAlpha; }
+ bool premultipliedAlpha() const { return m_premultipliedAlpha; }
private:
- CCCanvasDrawQuad(const CCSharedQuadState*, const IntRect&, CCLayerImpl*);
-
- CCLayerImpl* m_layer;
+ CCCanvasDrawQuad(const CCSharedQuadState*, const IntRect&, unsigned texture_id, bool hasAlpha, bool premultipliedAlpha);
+
+ unsigned m_textureId;
+ bool m_hasAlpha;
+ bool m_premultipliedAlpha;
};
}
Modified: branches/subpixellayout/Source/WebCore/platform/mac/RunLoopMac.mm (105913 => 105914)
--- branches/subpixellayout/Source/WebCore/platform/mac/RunLoopMac.mm 2012-01-25 20:27:13 UTC (rev 105913)
+++ branches/subpixellayout/Source/WebCore/platform/mac/RunLoopMac.mm 2012-01-25 20:28:13 UTC (rev 105914)
@@ -26,8 +26,35 @@
#import "config.h"
#import "RunLoop.h"
+#import <dispatch/dispatch.h>
+
namespace WebCore {
+static RunLoop* s_mainRunLoop;
+
+void RunLoop::initializeMainRunLoop()
+{
+ static dispatch_once_t onceToken;
+ dispatch_once(&onceToken, ^{
+ s_mainRunLoop = new RunLoop(CFRunLoopGetMain());
+ });
+}
+
+RunLoop* RunLoop::current()
+{
+ if (pthread_main_np())
+ return RunLoop::main();
+
+ DEFINE_STATIC_LOCAL(WTF::ThreadSpecific<RunLoop>, runLoopData, ());
+ return &*runLoopData;
+}
+
+RunLoop* RunLoop::main()
+{
+ ASSERT(s_mainRunLoop);
+ return s_mainRunLoop;
+}
+
void RunLoop::performWork(void* context)
{
// Wrap main thread in an Autorelease pool. Sending messages can call
@@ -49,6 +76,15 @@
CFRunLoopAddSource(m_runLoop, m_runLoopSource, kCFRunLoopCommonModes);
}
+RunLoop::RunLoop(CFRunLoopRef runLoop)
+ : m_runLoop(runLoop)
+ , m_nestingLevel(0)
+{
+ CFRunLoopSourceContext context = { 0, this, 0, 0, 0, 0, 0, 0, 0, performWork };
+ m_runLoopSource = CFRunLoopSourceCreate(kCFAllocatorDefault, 0, &context);
+ CFRunLoopAddSource(m_runLoop, m_runLoopSource, kCFRunLoopCommonModes);
+}
+
RunLoop::~RunLoop()
{
// FIXME: Tear down the work item queue here.
Modified: branches/subpixellayout/Source/WebKit/chromium/public/WebSharedWorker.h (105913 => 105914)
--- branches/subpixellayout/Source/WebKit/chromium/public/WebSharedWorker.h 2012-01-25 20:27:13 UTC (rev 105913)
+++ branches/subpixellayout/Source/WebKit/chromium/public/WebSharedWorker.h 2012-01-25 20:28:13 UTC (rev 105914)
@@ -58,8 +58,6 @@
// FIXME(atwilson): Remove this when we move the initial script loading into the worker process.
virtual bool isStarted() = 0;
- // API is transitioning from first form to the second. This function must stay virtual for now to prevent breaking chrome on webkit roll.
- // DEPRECATED
virtual void startWorkerContext(const WebURL& scriptURL,
const WebString& name,
const WebString& userAgent,
@@ -68,18 +66,6 @@
WebContentSecurityPolicyType,
long long scriptResourceAppCacheID) = 0;
- // Chromium will need to fallback to this method to avoid breaking during the next webkit roll.
- // It will become a pure virtual method once the chromium side is updated.
- virtual void startWorkerContext(const WebURL& scriptURL,
- const WebString& name,
- const WebString& userAgent,
- const WebString& sourceCode,
- const WebString& contentSecurityPolicy,
- WebContentSecurityPolicyType,
- long long scriptResourceAppCacheID) {
- startWorkerContext(scriptURL, name, userAgent, sourceCode, scriptResourceAppCacheID);
- }
-
class ConnectListener {
public:
// Invoked once the connect event has been sent so the caller can free this object.
Modified: branches/subpixellayout/Source/WebKit/chromium/public/platform/WebFileSystem.h (105913 => 105914)
--- branches/subpixellayout/Source/WebKit/chromium/public/platform/WebFileSystem.h 2012-01-25 20:27:13 UTC (rev 105913)
+++ branches/subpixellayout/Source/WebKit/chromium/public/platform/WebFileSystem.h 2012-01-25 20:28:13 UTC (rev 105914)
@@ -46,8 +46,6 @@
enum Type {
TypeTemporary,
TypePersistent,
-
- // Chrome specific filesystem type (used by chromeos).
TypeExternal,
};
Modified: branches/subpixellayout/Source/WebKit/chromium/src/AssertMatchingEnums.cpp (105913 => 105914)
--- branches/subpixellayout/Source/WebKit/chromium/src/AssertMatchingEnums.cpp 2012-01-25 20:27:13 UTC (rev 105913)
+++ branches/subpixellayout/Source/WebKit/chromium/src/AssertMatchingEnums.cpp 2012-01-25 20:28:13 UTC (rev 105914)
@@ -433,6 +433,7 @@
#if ENABLE(FILE_SYSTEM)
COMPILE_ASSERT_MATCHING_ENUM(WebFileSystem::TypeTemporary, AsyncFileSystem::Temporary);
COMPILE_ASSERT_MATCHING_ENUM(WebFileSystem::TypePersistent, AsyncFileSystem::Persistent);
+COMPILE_ASSERT_MATCHING_ENUM(WebFileSystem::TypeExternal, AsyncFileSystem::External);
COMPILE_ASSERT_MATCHING_ENUM(WebFileInfo::TypeUnknown, FileMetadata::TypeUnknown);
COMPILE_ASSERT_MATCHING_ENUM(WebFileInfo::TypeFile, FileMetadata::TypeFile);
COMPILE_ASSERT_MATCHING_ENUM(WebFileInfo::TypeDirectory, FileMetadata::TypeDirectory);
Modified: branches/subpixellayout/Source/WebKit/chromium/src/AsyncFileSystemChromium.cpp (105913 => 105914)
--- branches/subpixellayout/Source/WebKit/chromium/src/AsyncFileSystemChromium.cpp 2012-01-25 20:27:13 UTC (rev 105913)
+++ branches/subpixellayout/Source/WebKit/chromium/src/AsyncFileSystemChromium.cpp 2012-01-25 20:28:13 UTC (rev 105914)
@@ -34,7 +34,6 @@
#include "AsyncFileSystemCallbacks.h"
#include "AsyncFileWriterChromium.h"
-#include "SecurityOrigin.h"
#include "WebFileInfo.h"
#include "WebFileSystemCallbacksImpl.h"
#include "WebFileWriter.h"
@@ -45,14 +44,6 @@
namespace WebCore {
-namespace {
-
-// Chrome-specific FileSystem type.
-const char externalPathPrefix[] = "external";
-const size_t externalPathPrefixLength = sizeof(externalPathPrefix) - 1;
-
-}
-
bool AsyncFileSystem::isAvailable()
{
return true;
@@ -70,17 +61,6 @@
{
}
-String AsyncFileSystemChromium::toURL(const String& originString, const String& fullPath)
-{
- ASSERT(!m_filesystemRootURL.isEmpty());
- ASSERT(SecurityOrigin::create(m_filesystemRootURL)->toString() == originString);
-
- KURL url = ""
- // Remove the extra leading slash.
- url.setPath(url.path() + encodeWithURLEscapeSequences(fullPath.substring(1)));
- return url;
-}
-
void AsyncFileSystemChromium::move(const String& sourcePath, const String& destinationPath, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
{
m_webFileSystem->move(virtualPathToFileSystemURL(sourcePath), virtualPathToFileSystemURL(destinationPath), new WebKit::WebFileSystemCallbacksImpl(callbacks));
Modified: branches/subpixellayout/Source/WebKit/chromium/src/AsyncFileSystemChromium.h (105913 => 105914)
--- branches/subpixellayout/Source/WebKit/chromium/src/AsyncFileSystemChromium.h 2012-01-25 20:27:13 UTC (rev 105913)
+++ branches/subpixellayout/Source/WebKit/chromium/src/AsyncFileSystemChromium.h 2012-01-25 20:28:13 UTC (rev 105914)
@@ -54,7 +54,6 @@
virtual ~AsyncFileSystemChromium();
- virtual String toURL(const String& originString, const String& fullPath);
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>);