diff --git a/Android.mk b/Android.mk
index ecff19e..3d59ea7 100644
--- a/Android.mk
+++ b/Android.mk
@@ -298,7 +298,6 @@
 	libicuuc \
 	libicui18n \
 	libmedia \
-	libmedia_native \
 	libnativehelper \
 	libskia \
 	libsqlite \
diff --git a/Source/WebCore/Android.mk b/Source/WebCore/Android.mk
index 10eb822..c2bbd42 100644
--- a/Source/WebCore/Android.mk
+++ b/Source/WebCore/Android.mk
@@ -699,8 +699,7 @@
 	platform/graphics/android/rendering/TilesProfiler.cpp \
 	platform/graphics/android/rendering/TransferQueue.cpp \
 	\
-	platform/graphics/android/utils/ClassTracker.cpp \
-	platform/graphics/android/utils/LinearAllocator.cpp
+	platform/graphics/android/utils/ClassTracker.cpp
 
 ifeq ($(ENABLE_SVG), true)
 LOCAL_SRC_FILES := $(LOCAL_SRC_FILES) \
diff --git a/Source/WebCore/platform/graphics/android/context/GraphicsOperation.cpp b/Source/WebCore/platform/graphics/android/context/GraphicsOperation.cpp
index ab6e676..d24ce35 100644
--- a/Source/WebCore/platform/graphics/android/context/GraphicsOperation.cpp
+++ b/Source/WebCore/platform/graphics/android/context/GraphicsOperation.cpp
@@ -28,12 +28,12 @@
 #include "GraphicsOperation.h"
 
 #include "AndroidLog.h"
-#include "LinearAllocator.h"
+#include <utils/LinearAllocator.h>
 
 namespace WebCore {
 namespace GraphicsOperation {
 
-void* Operation::operator new(size_t size, LinearAllocator* allocator)
+void* Operation::operator new(size_t size, android::LinearAllocator* allocator)
 {
     return allocator->alloc(size);
 }
diff --git a/Source/WebCore/platform/graphics/android/context/GraphicsOperation.h b/Source/WebCore/platform/graphics/android/context/GraphicsOperation.h
index edcdc35..c3f54d6 100644
--- a/Source/WebCore/platform/graphics/android/context/GraphicsOperation.h
+++ b/Source/WebCore/platform/graphics/android/context/GraphicsOperation.h
@@ -50,10 +50,13 @@
 #define TYPE(x)
 #endif
 
+namespace android {
+class LinearAllocator;
+}
+
 namespace WebCore {
 
 class CanvasState;
-class LinearAllocator;
 
 namespace GraphicsOperation {
 
@@ -64,7 +67,7 @@
         , m_canvasState(0)
     {}
 
-    void* operator new(size_t size, LinearAllocator* allocator);
+    void* operator new(size_t size, android::LinearAllocator* allocator);
 
     // Purposely not implemented - use a LinearAllocator please
     void* operator new(size_t size);
diff --git a/Source/WebCore/platform/graphics/android/context/PlatformGraphicsContextRecording.cpp b/Source/WebCore/platform/graphics/android/context/PlatformGraphicsContextRecording.cpp
index 10bf363..d296b75 100644
--- a/Source/WebCore/platform/graphics/android/context/PlatformGraphicsContextRecording.cpp
+++ b/Source/WebCore/platform/graphics/android/context/PlatformGraphicsContextRecording.cpp
@@ -35,7 +35,6 @@
 #include "Font.h"
 #include "GraphicsContext.h"
 #include "GraphicsOperation.h"
-#include "LinearAllocator.h"
 #include "PlatformGraphicsContextSkia.h"
 #include "RTree.h"
 #include "SkDevice.h"
@@ -44,6 +43,8 @@
 #include "wtf/HashSet.h"
 #include "wtf/StringHasher.h"
 
+#include <utils/LinearAllocator.h>
+
 #define NEW_OP(X) new (heap()) GraphicsOperation::X
 
 #define USE_CLIPPING_PAINTER true
@@ -194,7 +195,7 @@
         return m_isTransparencyLayer;
     }
 
-    void* operator new(size_t size, LinearAllocator* la) {
+    void* operator new(size_t size, android::LinearAllocator* la) {
         return la->alloc(size);
     }
 
@@ -210,7 +211,7 @@
     // Careful, ordering matters here. Ordering is first constructed == last destroyed,
     // so we have to make sure our Heap is the first thing listed so that it is
     // the last thing destroyed.
-    LinearAllocator m_heap;
+    android::LinearAllocator m_heap;
 public:
     RecordingImpl()
         : m_tree(&m_heap)
@@ -287,7 +288,7 @@
         toState->playback(context, fromId, toId);
     }
 
-    LinearAllocator* heap() { return &m_heap; }
+    android::LinearAllocator* heap() { return &m_heap; }
 
     RTree::RTree m_tree;
     int m_nodeCount;
@@ -1080,7 +1081,7 @@
     mRecordingStateStack.last().mCanvasState->adoptAndAppend(data);
 }
 
-LinearAllocator* PlatformGraphicsContextRecording::heap()
+android::LinearAllocator* PlatformGraphicsContextRecording::heap()
 {
     return mRecording->recording()->heap();
 }
diff --git a/Source/WebCore/platform/graphics/android/context/PlatformGraphicsContextRecording.h b/Source/WebCore/platform/graphics/android/context/PlatformGraphicsContextRecording.h
index eefd270..1a703cf 100644
--- a/Source/WebCore/platform/graphics/android/context/PlatformGraphicsContextRecording.h
+++ b/Source/WebCore/platform/graphics/android/context/PlatformGraphicsContextRecording.h
@@ -31,13 +31,16 @@
 #include "RecordingContextCanvasProxy.h"
 #include "SkRefCnt.h"
 
+namespace android {
+class LinearAllocator;
+}
+
 namespace WebCore {
 namespace GraphicsOperation {
 class Operation;
 }
 
 class CanvasState;
-class LinearAllocator;
 class RecordingImpl;
 class PlatformGraphicsContextSkia;
 class RecordingData;
@@ -161,7 +164,7 @@
     void popMatrix();
     IntRect calculateFinalBounds(FloatRect bounds);
     IntRect calculateCoveredBounds(FloatRect bounds);
-    LinearAllocator* heap();
+    android::LinearAllocator* heap();
 
     SkPicture* mPicture;
     SkMatrix* mCurrentMatrix;
diff --git a/Source/WebCore/platform/graphics/android/context/RTree.cpp b/Source/WebCore/platform/graphics/android/context/RTree.cpp
index 2e24c34..1e11f58 100644
--- a/Source/WebCore/platform/graphics/android/context/RTree.cpp
+++ b/Source/WebCore/platform/graphics/android/context/RTree.cpp
@@ -31,11 +31,11 @@
 #include "RTree.h"
 
 #include "AndroidLog.h"
-#include "LinearAllocator.h"
+#include <utils/LinearAllocator.h>
 
 namespace WebCore {
 
-void* RecordingData::operator new(size_t size, LinearAllocator* allocator)
+void* RecordingData::operator new(size_t size, android::LinearAllocator* allocator)
 {
     return allocator->alloc(size);
 }
@@ -132,7 +132,7 @@
 //
 //////////////////////////////////////////////////////////////////////
 
-RTree::RTree(WebCore::LinearAllocator* allocator, int M)
+RTree::RTree(android::LinearAllocator* allocator, int M)
     : m_allocator(allocator)
 {
     m_maxChildren = M;
diff --git a/Source/WebCore/platform/graphics/android/context/RTree.h b/Source/WebCore/platform/graphics/android/context/RTree.h
index 50962ef..8d9a359 100644
--- a/Source/WebCore/platform/graphics/android/context/RTree.h
+++ b/Source/WebCore/platform/graphics/android/context/RTree.h
@@ -30,9 +30,11 @@
 #include "IntRect.h"
 #include "GraphicsOperation.h"
 
-namespace WebCore {
-
+namespace android {
 class LinearAllocator;
+}
+
+namespace WebCore {
 
 class RecordingData {
 public:
@@ -47,7 +49,7 @@
     size_t m_orderBy;
     GraphicsOperation::Operation* m_operation;
 
-    void* operator new(size_t size, LinearAllocator* allocator);
+    void* operator new(size_t size, android::LinearAllocator* allocator);
 
     // Purposely not implemented - use a LinearAllocator please
     void* operator new(size_t size);
@@ -64,7 +66,7 @@
 class RTree {
 public:
     // M -- max number of children per node
-    RTree(WebCore::LinearAllocator* allocator, int M = 10);
+    RTree(android::LinearAllocator* allocator, int M = 10);
     ~RTree();
 
     void insert(WebCore::IntRect& bounds, WebCore::RecordingData* payload);
@@ -84,7 +86,7 @@
     unsigned m_maxChildren;
     ElementList* m_listA;
     ElementList* m_listB;
-    WebCore::LinearAllocator* m_allocator;
+    android::LinearAllocator* m_allocator;
 
     friend class Node;
 };
diff --git a/Source/WebCore/platform/graphics/android/utils/LinearAllocator.cpp b/Source/WebCore/platform/graphics/android/utils/LinearAllocator.cpp
deleted file mode 100644
index 636c30c..0000000
--- a/Source/WebCore/platform/graphics/android/utils/LinearAllocator.cpp
+++ /dev/null
@@ -1,233 +0,0 @@
-/*
- * Copyright 2012, The Android Open Source Project
- *
- * 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.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``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.
- */
-
-#define LOG_TAG "LinearAllocator"
-#define LOG_NDEBUG 1
-
-#include "config.h"
-#include "LinearAllocator.h"
-
-#include "AndroidLog.h"
-
-namespace WebCore {
-
-// The ideal size of a page allocation (these need to be multiples of 4)
-#define INITIAL_PAGE_SIZE ((size_t)4096) // 4kb
-#define MAX_PAGE_SIZE ((size_t)131072) // 128kb
-
-// The maximum amount of wasted space we can have per page
-// Allocations exceeding this will have their own dedicated page
-// If this is too low, we will malloc too much
-// Too high, and we may waste too much space
-// Must be smaller than INITIAL_PAGE_SIZE
-#define MAX_WASTE_SIZE ((size_t)1024)
-
-#if CPU(MIPS)
-#define ALIGN_SZ (sizeof(double))
-#else
-#define ALIGN_SZ (sizeof(int))
-#endif
-
-#define ALIGN(x) ((x + ALIGN_SZ - 1 ) & ~(ALIGN_SZ - 1))
-#define ALIGN_PTR(p) ((void*)(ALIGN((unsigned int)p)))
-
-#if LOG_NDEBUG
-#define ADD_ALLOCATION(size)
-#define RM_ALLOCATION(size)
-#else
-#include <utils/Thread.h>
-static size_t s_totalAllocations = 0;
-static double s_lastLogged = 0;
-static android::Mutex s_mutex;
-
-static void _logUsageLocked() {
-    double now = currentTimeMS();
-    if (now - s_lastLogged > 5) {
-        s_lastLogged = now;
-        ALOGV("Total memory usage: %d kb", s_totalAllocations / 1024);
-    }
-}
-
-static void _addAllocation(size_t size) {
-    android::AutoMutex lock(s_mutex);
-    s_totalAllocations += size;
-    _logUsageLocked();
-}
-
-#define ADD_ALLOCATION(size) _addAllocation(size);
-#define RM_ALLOCATION(size) _addAllocation(-size);
-#endif
-
-class LinearAllocator::Page {
-public:
-    Page* next() { return m_nextPage; }
-    void setNext(Page* next) { m_nextPage = next; }
-
-    Page()
-        : m_nextPage(0)
-    {}
-
-    void* start()
-    {
-        return (void*) (((unsigned)this) + sizeof(LinearAllocator::Page));
-    }
-
-    void* end(int pageSize)
-    {
-        return (void*) (((unsigned)start()) + pageSize);
-    }
-
-private:
-    Page(const Page& other) {}
-    Page* m_nextPage;
-};
-
-LinearAllocator::LinearAllocator()
-    : m_pageSize(INITIAL_PAGE_SIZE)
-    , m_maxAllocSize(MAX_WASTE_SIZE)
-    , m_next(0)
-    , m_currentPage(0)
-    , m_pages(0)
-    , m_totalAllocated(0)
-    , m_wastedSpace(0)
-    , m_pageCount(0)
-    , m_dedicatedPageCount(0)
-{
-}
-
-LinearAllocator::~LinearAllocator(void)
-{
-    Page* p = m_pages;
-    while (p) {
-        Page* next = p->next();
-        delete p;
-        RM_ALLOCATION(m_pageSize);
-        p = next;
-    }
-}
-
-void* LinearAllocator::start(Page* p)
-{
-    return ALIGN_PTR(((char*)p) + sizeof(Page));
-}
-
-void* LinearAllocator::end(Page* p)
-{
-    return ((char*)p) + m_pageSize;
-}
-
-bool LinearAllocator::fitsInCurrentPage(size_t size)
-{
-    return m_next && ((char*)m_next + size) <= end(m_currentPage);
-}
-
-void LinearAllocator::ensureNext(size_t size)
-{
-    if (fitsInCurrentPage(size))
-        return;
-    if (m_currentPage && m_pageSize < MAX_PAGE_SIZE) {
-        m_pageSize = std::min(MAX_PAGE_SIZE, m_pageSize * 2);
-        m_pageSize = ALIGN(m_pageSize);
-    }
-    m_wastedSpace += m_pageSize;
-    Page* p = newPage(m_pageSize);
-    if (m_currentPage)
-        m_currentPage->setNext(p);
-    m_currentPage = p;
-    if (!m_pages)
-        m_pages = m_currentPage;
-    m_next = start(m_currentPage);
-}
-
-void* LinearAllocator::alloc(size_t size)
-{
-    size = ALIGN(size);
-    if (size > m_maxAllocSize && !fitsInCurrentPage(size)) {
-        ALOGV("Exceeded max size %d > %d", size, m_maxAllocSize);
-        // Allocation is too large, create a dedicated page for the allocation
-        Page* page = newPage(size);
-        m_dedicatedPageCount++;
-        page->setNext(m_pages);
-        m_pages = page;
-        if (!m_currentPage)
-            m_currentPage = m_pages;
-        return start(page);
-    }
-    ensureNext(size);
-    void* ptr = m_next;
-    m_next = ((char*)m_next) + size;
-    m_wastedSpace -= size;
-    return ptr;
-}
-
-void LinearAllocator::rewindIfLastAlloc(void* ptr, size_t allocSize)
-{
-    // Don't bother rewinding across pages
-    allocSize = ALIGN(allocSize);
-    if (ptr >= start(m_currentPage) && ptr < end(m_currentPage)
-            && ptr == ((char*)m_next - allocSize)) {
-        m_totalAllocated -= allocSize;
-        m_wastedSpace += allocSize;
-        m_next = ptr;
-    }
-}
-
-LinearAllocator::Page* LinearAllocator::newPage(size_t pageSize)
-{
-    pageSize = ALIGN(pageSize + sizeof(LinearAllocator::Page));
-    ADD_ALLOCATION(pageSize);
-    m_totalAllocated += pageSize;
-    m_pageCount++;
-    void* buf = malloc(pageSize);
-    return new (buf) Page();
-}
-
-static const char* toSize(size_t value, float& result)
-{
-    if (value < 2000) {
-        result = value;
-        return "B";
-    }
-    if (value < 2000000) {
-        result = value / 1024.0f;
-        return "KB";
-    }
-    result = value / 1048576.0f;
-    return "MB";
-}
-
-void LinearAllocator::dumpMemoryStats(const char* prefix)
-{
-    float prettySize;
-    const char* prettySuffix;
-    prettySuffix = toSize(m_totalAllocated, prettySize);
-    ALOGD("%sTotal allocated: %.2f%s", prefix, prettySize, prettySuffix);
-    prettySuffix = toSize(m_wastedSpace, prettySize);
-    ALOGD("%sWasted space: %.2f%s (%.1f%%)", prefix, prettySize, prettySuffix,
-          (float) m_wastedSpace / (float) m_totalAllocated * 100.0f);
-    ALOGD("%sPages %d (dedicated %d)", prefix, m_pageCount, m_dedicatedPageCount);
-}
-
-} // namespace WebCore
diff --git a/Source/WebCore/platform/graphics/android/utils/LinearAllocator.h b/Source/WebCore/platform/graphics/android/utils/LinearAllocator.h
deleted file mode 100644
index 8cabf7c..0000000
--- a/Source/WebCore/platform/graphics/android/utils/LinearAllocator.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright 2012, The Android Open Source Project
- *
- * 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.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``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 LinearAllocator_h
-#define LinearAllocator_h
-
-namespace WebCore {
-
-class LinearAllocator
-{
-public:
-    LinearAllocator();
-    ~LinearAllocator();
-
-    void* alloc(size_t size);
-    void rewindIfLastAlloc(void* ptr, size_t allocSize);
-
-    void dumpMemoryStats(const char* prefix = "");
-
-private:
-    LinearAllocator(const LinearAllocator& other);
-
-    class Page;
-
-    Page* newPage(size_t pageSize);
-    bool fitsInCurrentPage(size_t size);
-    void ensureNext(size_t size);
-    void* start(Page *p);
-    void* end(Page* p);
-
-    size_t m_pageSize;
-    size_t m_maxAllocSize;
-    void* m_next;
-    Page* m_currentPage;
-    Page* m_pages;
-
-    // Memory usage tracking
-    size_t m_totalAllocated;
-    size_t m_wastedSpace;
-    size_t m_pageCount;
-    size_t m_dedicatedPageCount;
-};
-
-} // namespace WebCore
-
-#endif // LinearAllocator_h
diff --git a/Source/WebKit/Android.mk b/Source/WebKit/Android.mk
index 07634b6..d440899 100644
--- a/Source/WebKit/Android.mk
+++ b/Source/WebKit/Android.mk
@@ -58,7 +58,6 @@
 	android/content/PhoneEmailDetector.cpp \
 	\
 	android/jni/AndroidHitTestResult.cpp \
-	android/jni/CacheManager.cpp \
 	android/jni/CookieManager.cpp \
 	android/jni/DeviceMotionAndOrientationManager.cpp \
 	android/jni/DeviceMotionClientImpl.cpp \
diff --git a/Source/WebKit/android/jni/CacheManager.cpp b/Source/WebKit/android/jni/CacheManager.cpp
deleted file mode 100644
index b34776d..0000000
--- a/Source/WebKit/android/jni/CacheManager.cpp
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- * Copyright 2011, The Android Open Source Project
- *
- * 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.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``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 "ChromiumIncludes.h"
-#include "WebCache.h"
-#include "WebCoreJni.h"
-
-#include <JNIHelp.h>
-#include <platform/FileSystem.h>
-#include <platform/text/Base64.h>
-#include <wtf/text/CString.h>
-#include <wtf/text/WTFString.h>
-
-using namespace WebCore;
-using namespace base;
-using namespace disk_cache;
-using namespace net;
-using namespace std;
-
-namespace android {
-
-// JNI for android.webkit.CacheManager
-static const char* javaCacheManagerClass = "android/webkit/CacheManager";
-
-static void setStringField(JNIEnv* env, const jobject& object, const jfieldID& field, const String& str)
-{
-    jstring jstr = wtfStringToJstring(env, str);
-    env->SetObjectField(object, field, jstr);
-    env->DeleteLocalRef(jstr);
-}
-
-static void setFieldFromHeaderIfPresent(CacheResult* result, const char* header, JNIEnv* env, const jobject& object, const jfieldID& field, bool allowEmptyString)
-{
-  String value;
-  if (result->firstResponseHeader(header, &value, allowEmptyString))
-      setStringField(env, object, field, value);
-}
-
-static String getCacheFileBaseDir(JNIEnv* env)
-{
-    static String baseDir;
-    if (baseDir.isEmpty()) {
-        jclass cacheManagerClass = env->FindClass("android/webkit/CacheManager");
-        jmethodID getCacheFileBaseDirMethod = env->GetStaticMethodID(cacheManagerClass, "getCacheFileBaseDir", "()Ljava/io/File;");
-        jclass fileClass = env->FindClass("java/io/File");
-        jmethodID getPathMethod = env->GetMethodID(fileClass, "getPath", "()Ljava/lang/String;");
-        jobject fileObject = env->CallStaticObjectMethod(cacheManagerClass, getCacheFileBaseDirMethod);
-        baseDir = jstringToWtfString(env, static_cast<jstring>(env->CallObjectMethod(fileObject, getPathMethod)));
-    }
-    return baseDir;
-}
-
-static jobject getCacheResult(JNIEnv* env, jobject, jstring url)
-{
-    // This is called on the UI thread.
-    scoped_refptr<CacheResult> result = WebCache::get(false /*privateBrowsing*/)->getCacheResult(jstringToWtfString(env, url));
-    if (!result)
-        return 0;
-
-    // We create and populate a file with the cache entry. This allows us to
-    // replicate the behaviour of the Android HTTP stack in the Java
-    // CacheManager, which opens the cache file and provides an input stream to
-    // the file as part of the Java CacheResult object!
-    String urlWtfString = jstringToWtfString(env, url);
-    Vector<char> encodedUrl;
-    base64Encode(urlWtfString.utf8().data(), urlWtfString.length(), encodedUrl, false /*insertLFs*/);
-    encodedUrl.append('\0');
-    String filePath = pathByAppendingComponent(getCacheFileBaseDir(env), encodedUrl.data());
-    if (!result->writeToFile(filePath))
-        return 0;
-
-    jclass cacheResultClass = env->FindClass("android/webkit/CacheManager$CacheResult");
-    jmethodID constructor = env->GetMethodID(cacheResultClass, "<init>", "()V");
-    // We only bother with the fields that are made accessible through the public API.
-    jfieldID contentdispositionField = env->GetFieldID(cacheResultClass, "contentdisposition", "Ljava/lang/String;");
-    jfieldID contentLengthField = env->GetFieldID(cacheResultClass, "contentLength", "J");
-    jfieldID etagField = env->GetFieldID(cacheResultClass, "etag", "Ljava/lang/String;");
-    jfieldID encodingField = env->GetFieldID(cacheResultClass, "encoding", "Ljava/lang/String;");
-    jfieldID expiresField = env->GetFieldID(cacheResultClass, "expires", "J");
-    jfieldID expiresStringField = env->GetFieldID(cacheResultClass, "expiresString", "Ljava/lang/String;");
-    jfieldID httpStatusCodeField = env->GetFieldID(cacheResultClass, "httpStatusCode", "I");
-    jfieldID lastModifiedField = env->GetFieldID(cacheResultClass, "lastModified", "Ljava/lang/String;");
-    jfieldID localPathField = env->GetFieldID(cacheResultClass, "localPath", "Ljava/lang/String;");
-    jfieldID locationField = env->GetFieldID(cacheResultClass, "location", "Ljava/lang/String;");
-    jfieldID mimeTypeField = env->GetFieldID(cacheResultClass, "mimeType", "Ljava/lang/String;");
-
-    jobject javaResult = env->NewObject(cacheResultClass, constructor);
-    setFieldFromHeaderIfPresent(result.get(), "content-disposition", env, javaResult, contentdispositionField, true);
-    env->SetLongField(javaResult, contentLengthField, result->contentSize());
-    setFieldFromHeaderIfPresent(result.get(), "etag", env, javaResult, etagField, false);
-    setStringField(env, javaResult, encodingField, "TODO"); // TODO: Where does the Android stack set this?
-    env->SetLongField(javaResult, expiresField, result->expires());
-    env->SetIntField(javaResult, httpStatusCodeField, result->responseCode());
-    setFieldFromHeaderIfPresent(result.get(), "last-modified", env, javaResult, lastModifiedField, false);
-    setStringField(env, javaResult, localPathField, encodedUrl.data());
-    setFieldFromHeaderIfPresent(result.get(), "location", env, javaResult, locationField, false);
-    setStringField(env, javaResult, mimeTypeField, result->mimeType());
-
-    return javaResult;
-}
-
-static JNINativeMethod gCacheManagerMethods[] = {
-    { "nativeGetCacheResult", "(Ljava/lang/String;)Landroid/webkit/CacheManager$CacheResult;", (void*) getCacheResult },
-};
-
-int registerCacheManager(JNIEnv* env)
-{
-#ifndef NDEBUG
-    jclass cacheManager = env->FindClass(javaCacheManagerClass);
-    ALOG_ASSERT(cacheManager, "Unable to find class");
-    env->DeleteLocalRef(cacheManager);
-#endif
-    return jniRegisterNativeMethods(env, javaCacheManagerClass, gCacheManagerMethods, NELEM(gCacheManagerMethods));
-}
-
-} // namespace android
diff --git a/Source/WebKit/android/jni/WebCoreJniOnLoad.cpp b/Source/WebKit/android/jni/WebCoreJniOnLoad.cpp
index ec052f1..d4b1ddb 100644
--- a/Source/WebKit/android/jni/WebCoreJniOnLoad.cpp
+++ b/Source/WebKit/android/jni/WebCoreJniOnLoad.cpp
@@ -91,7 +91,6 @@
 #endif
 extern int registerDeviceMotionAndOrientationManager(JNIEnv*);
 extern int registerCookieManager(JNIEnv*);
-extern int registerCacheManager(JNIEnv*);
 
 }
 
@@ -120,7 +119,6 @@
 #endif
     { "DeviceMotionAndOrientationManager", android::registerDeviceMotionAndOrientationManager },
     { "CookieManager", android::registerCookieManager },
-    { "CacheManager", android::registerCacheManager },
 };
 
 EXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved)
diff --git a/Source/WebKit/android/plugins/ANPSoundInterface.cpp b/Source/WebKit/android/plugins/ANPSoundInterface.cpp
index 929832b..0ea9b07 100644
--- a/Source/WebKit/android/plugins/ANPSoundInterface.cpp
+++ b/Source/WebKit/android/plugins/ANPSoundInterface.cpp
@@ -36,6 +36,7 @@
     void*                mUser;
     ANPAudioCallbackProc mProc;
     android::AudioTrack* mTrack;
+    int                  mChannelCount;
 };
 
 static ANPSampleFormat toANPFormat(audio_format_t fm) {
@@ -70,8 +71,8 @@
             
             src = reinterpret_cast<android::AudioTrack::Buffer*>(info);
             dst.bufferData      = src->raw;
-            dst.channelCount    = src->channelCount;
-            dst.format          = toANPFormat((audio_format_t) src->format);
+            dst.channelCount    = track->mChannelCount;
+            dst.format          = toANPFormat(AUDIO_FORMAT_PCM_16_BIT);
             dst.size            = src->size;
             track->mProc(kMoreData_ANPAudioEvent, track->mUser, &dst);
             // return the updated size field
@@ -106,6 +107,7 @@
                                             callbackProc,
                                             track,
                                             0);
+    track->mChannelCount = channelCount;
     
     if (track->mTrack->initCheck() != 0) {  // failure
         delete track->mTrack;
