Fix V8 build.
diff --git a/Android.v8.mk b/Android.v8.mk
index 17e85c3..f6845d2 100644
--- a/Android.v8.mk
+++ b/Android.v8.mk
@@ -73,6 +73,12 @@
 LOCAL_CFLAGS += -include "WebCorePrefixAndroid.h"
 LOCAL_CFLAGS += -fvisibility=hidden
 
+ifeq ($(ENABLE_VIDEO),true)
+LOCAL_CFLAGS += -DENABLE_VIDEO=1
+else
+LOCAL_CFLAGS += -DENABLE_VIDEO=0
+endif
+
 ifeq ($(TARGET_ARCH),arm)
 LOCAL_CFLAGS += -Darm
 endif
@@ -201,9 +207,10 @@
 ifneq ($(TARGET_SIMULATOR),true)
 LOCAL_SHARED_LIBRARIES += libdl
 endif
+LOCAL_SHARED_LIBRARIES += libv8
 
 # Build the list of static libraries
-LOCAL_STATIC_LIBRARIES := libxml2 libv8
+LOCAL_STATIC_LIBRARIES := libxml2
 
 # Redefine LOCAL_SRC_FILES to be all the WebKit source files
 LOCAL_SRC_FILES := $(WEBKIT_SRC_FILES)
diff --git a/JavaScriptCore/Android.v8.wtf.mk b/JavaScriptCore/Android.v8.wtf.mk
index 3a6ea6e..6207319 100644
--- a/JavaScriptCore/Android.v8.wtf.mk
+++ b/JavaScriptCore/Android.v8.wtf.mk
@@ -10,6 +10,7 @@
 	wtf/Assertions.cpp \
 	wtf/ByteArray.cpp \
 	wtf/CurrentTime.cpp \
+	wtf/DateMath.cpp \
 	wtf/FastMalloc.cpp \
 	wtf/HashTable.cpp \
 	wtf/MainThread.cpp \
@@ -39,4 +40,4 @@
 $(intermediates)/pcre/pcre_tables.o : $(CHARTABLES)
 
 # We do not add $(CHARTABLES) to LOCAL_GENERATED_SOURCES because the chartables.c file
-# is explicitly #included in pcre_tables.cpp.
\ No newline at end of file
+# is explicitly #included in pcre_tables.cpp.
diff --git a/V8Binding/Android.libv8.mk b/V8Binding/Android.libv8.mk
index c83b046..74a9688 100644
--- a/V8Binding/Android.libv8.mk
+++ b/V8Binding/Android.libv8.mk
@@ -6,7 +6,7 @@
 
 # Set up the target identity
 LOCAL_MODULE := libv8
-LOCAL_MODULE_CLASS := STATIC_LIBRARIES
+LOCAL_MODULE_CLASS := SHARED_LIBRARIES
 intermediates := $(call local-intermediates-dir)
 
 LOCAL_CPP_EXTENSION := .cc
@@ -78,36 +78,36 @@
 
 ifeq ($(TARGET_ARCH),arm)
   LOCAL_SRC_FILES += \
-		src/assembler-arm.cc \
-		src/builtins-arm.cc \
-		src/codegen-arm.cc \
-		src/cpu-arm.cc \
-		src/disasm-arm.cc \
-		src/frames-arm.cc \
-		src/ic-arm.cc \
-		src/jump-target-arm.cc \
-		src/macro-assembler-arm.cc \
-		src/regexp-macro-assembler-arm.cc \
-		src/register-allocator-arm.cc \
-		src/stub-cache-arm.cc \
-		src/virtual-frame-arm.cc
+		src/arm/assembler-arm.cc \
+		src/arm/builtins-arm.cc \
+		src/arm/codegen-arm.cc \
+		src/arm/cpu-arm.cc \
+		src/arm/disasm-arm.cc \
+		src/arm/frames-arm.cc \
+		src/arm/ic-arm.cc \
+		src/arm/jump-target-arm.cc \
+		src/arm/macro-assembler-arm.cc \
+		src/arm/regexp-macro-assembler-arm.cc \
+		src/arm/register-allocator-arm.cc \
+		src/arm/stub-cache-arm.cc \
+		src/arm/virtual-frame-arm.cc
 endif
 
 ifeq ($(TARGET_ARCH),x86)
   LOCAL_SRC_FILES += \
-	  src/assembler-ia32.cc \
-		src/builtins-ia32.cc \
-		src/codegen-ia32.cc \
-		src/cpu-ia32.cc \
-		src/disasm-ia32.cc \
-		src/frames-ia32.cc \
-		src/ic-ia32.cc \
-		src/jump-target-ia32.cc \
-		src/macro-assembler-ia32.cc \
-		src/regexp-macro-assembler-ia32.cc \
-		src/register-allocator-ia32.cc \
-		src/stub-cache-ia32.cc \
-		src/virtual-frame-ia32.cc
+	  src/ia32/assembler-ia32.cc \
+		src/ia32/builtins-ia32.cc \
+		src/ia32/codegen-ia32.cc \
+		src/ia32/cpu-ia32.cc \
+		src/ia32/disasm-ia32.cc \
+		src/ia32/frames-ia32.cc \
+		src/ia32/ic-ia32.cc \
+		src/ia32/jump-target-ia32.cc \
+		src/ia32/macro-assembler-ia32.cc \
+		src/ia32/regexp-macro-assembler-ia32.cc \
+		src/ia32/register-allocator-ia32.cc \
+		src/ia32/stub-cache-ia32.cc \
+		src/ia32/virtual-frame-ia32.cc
 endif
 
 ifeq ($(TARGET_OS),linux)
@@ -147,7 +147,7 @@
 
 # Generate libraries.cc
 GEN1 := $(intermediates)/libraries.cc $(intermediates)/libraries-empty.cc
-$(GEN1): SCRIPT := $(LOCAL_PATH)/tools/js2c.py
+$(GEN1): SCRIPT := $(LOCAL_PATH)/v8/tools/js2c.py
 $(GEN1): $(LOCAL_JS_LIBRARY_FILES)
 	@echo "Generating libraries.cc"
 	@mkdir -p $(dir $@)
@@ -163,9 +163,13 @@
 	-fno-exceptions
 
 ifeq ($(TARGET_ARCH),arm)
-	LOCAL_CFLAGS += -DARM
+	LOCAL_CFLAGS += -DARM -DV8_TARGET_ARCH_ARM
+endif
+
+ifeq ($(TARGET_ARCH),x86)
+	LOCAL_CLFAGS += -DV8_TARGET_ARCH_IA32
 endif
 
 LOCAL_C_INCLUDES += $(LOCAL_PATH)/v8/src
 
-include $(BUILD_STATIC_LIBRARY)
+include $(BUILD_SHARED_LIBRARY)
diff --git a/V8Binding/Android.v8shell.mk b/V8Binding/Android.v8shell.mk
index 46cf4ee..c57d4de 100644
--- a/V8Binding/Android.v8shell.mk
+++ b/V8Binding/Android.v8shell.mk
@@ -6,7 +6,7 @@
 
 LOCAL_CPP_EXTENSION := .cc
 
-LOCAL_STATIC_LIBRARIES := libv8
+LOCAL_SHARED_LIBRARIES := libv8
 
 LOCAL_C_INCLUDES += $(LOCAL_PATH)/v8/include
 
diff --git a/V8Binding/V8Binding.derived.mk b/V8Binding/V8Binding.derived.mk
index 65f1838..c7a1ee0 100644
--- a/V8Binding/V8Binding.derived.mk
+++ b/V8Binding/V8Binding.derived.mk
@@ -44,7 +44,7 @@
 	bindings/v8/V8AbstractEventListener.cpp \
 	bindings/v8/V8Collection.cpp \
 	bindings/v8/V8DOMMap.cpp \
-	bindgins/v8/V8EventListener.cpp \
+	bindings/v8/V8EventListenerList.cpp \
 	bindings/v8/V8LazyEventListener.cpp \
 	bindings/v8/V8NodeFilterCondition.cpp \
 	bindings/v8/V8ObjectEventListener.cpp \
@@ -83,7 +83,7 @@
 	bindings/v8/custom/V8HTMLFrameElementCustom.cpp \
 	bindings/v8/custom/V8HTMLFrameSetElementCustom.cpp \
 	bindings/v8/custom/V8HTMLIFrameElementCustom.cpp \
-	bindings/v8/custom/V8HTMLImageElementCustom.cpp \
+	bindings/v8/custom/V8HTMLImageElementConstructor.cpp \
 	bindings/v8/custom/V8HTMLInputElementCustom.cpp \
 	bindings/v8/custom/V8HTMLOptionElementConstructor.cpp \
 	bindings/v8/custom/V8HTMLOptionsCollectionCustom.cpp \
@@ -158,6 +158,12 @@
 
 FEATURE_DEFINES := ANDROID_ORIENTATION_SUPPORT ENABLE_TOUCH_EVENTS=1 V8_BINDING ENABLE_DATABASE=1 ENABLE_OFFLINE_WEB_APPLICATIONS=1
 
+ifeq ($(ENABLE_VIDEO), true)
+  FEATURE_DEFINES += ENaBLE_VIDEO=1
+else
+  FEATURE_DEFINES += ENABLE_VIDEO=0
+endif
+
 GEN := \
     $(intermediates)/css/V8CSSCharsetRule.h \
     $(intermediates)/css/V8CSSFontFaceRule.h \
@@ -591,7 +597,7 @@
     $(intermediates)/html/V8UndetectableHTMLCollection.h
 
 $(GEN): PRIVATE_CUSTOM_TOOL = SOURCE_ROOT=$(WEBCORE_PATH) perl -I$(v8binding_dir)/scripts -I$(WEBCORE_PATH)/bindings/scripts $(v8binding_dir)/scripts/generate-bindings.pl --defines "$(FEATURE_DEFINES) LANGUAGE_JAVASCRIPT" --generator V8 --include dom --include html --outputdir $(dir $@) $<
-$(GEN): $(intermediates)/html/V8%.h : $(v8binding_dir)/v8/%.idl $(js_binding_scripts)
+$(GEN): $(intermediates)/html/V8%.h : $(v8binding_dir)/binding/%.idl $(js_binding_scripts)
 	$(transform-generated-source)
 LOCAL_GENERATED_SOURCES += $(GEN) $(GEN:%.h=%.cpp)
 
diff --git a/V8Binding/npapi/npapi.h b/V8Binding/npapi/npapi.h
index 43b701b..3022984 100644
--- a/V8Binding/npapi/npapi.h
+++ b/V8Binding/npapi/npapi.h
@@ -494,6 +494,8 @@
             uint16 keyCode;
         } key;
         struct {
+            CGContextRef context;
+
             double x;
             double y;
             double width;
@@ -557,6 +559,19 @@
 typedef void * NPMenu;
 #endif
 
+typedef enum {
+    NPCoordinateSpacePlugin = 1,
+    NPCoordinateSpaceWindow,
+    NPCoordinateSpaceFlippedWindow,
+    NPCoordinateSpaceScreen,
+    NPCoordinateSpaceFlippedScreen
+
+#ifdef ANDROID
+    , NPCoordinateSpaceToForce32Bits = 0x7FFFFFFF
+#endif
+    
+} NPCoordinateSpace;
+
 #if defined(XP_MAC) || defined(XP_MACOSX)
 
 #ifndef NP_NO_CARBON
@@ -842,10 +857,14 @@
 void        NPN_PushPopupsEnabledState(NPP instance, NPBool enabled);
 void        NPN_PopPopupsEnabledState(NPP instance);
 void        NPN_PluginThreadAsyncCall(NPP instance, void (*func) (void *), void *userData);
+NPError     NPN_GetValueForURL(NPP instance, NPNURLVariable variable, const char* url, char** value, uint32* len);
+NPError     NPN_SetValueForURL(NPP instance, NPNURLVariable variable, const char* url, const char* value, uint32 len);
+NPError     NPN_GetAuthenticationInfo(NPP instance, const char* protocol, const char* host, int32 port, const char* scheme, const char *realm, char** username, uint32* ulen, char** password, uint32* plen);
 uint32      NPN_ScheduleTimer(NPP instance, uint32 interval, NPBool repeat, void (*timerFunc)(NPP npp, uint32 timerID));
 void        NPN_UnscheduleTimer(NPP instance, uint32 timerID);
 NPError     NPN_PopUpContextMenu(NPP instance, NPMenu* menu);
-
+NPBool      NPN_ConvertPoint(NPP instance, double sourceX, double sourceY, NPCoordinateSpace sourceSpace, double *destX, double *destY, NPCoordinateSpace destSpace);
+    
 #ifdef __cplusplus
 }  /* end extern "C" */
 #endif
diff --git a/V8Binding/scripts/CodeGeneratorV8.pm b/V8Binding/scripts/CodeGeneratorV8.pm
index 37a9f74..7a2f930 100644
--- a/V8Binding/scripts/CodeGeneratorV8.pm
+++ b/V8Binding/scripts/CodeGeneratorV8.pm
@@ -1037,6 +1037,13 @@
 
     my $commentInfo = "Attribute '$attrName' (Type: '" . $attribute->type .
                       "' ExtAttr: '" . join(' ', keys(%{$attrExt})) . "')";
+
+    my $conditional = $attrExt->{"Conditional"};
+    if ($conditional) {
+        my $conditionalString = "ENABLE(" . join(") && ENABLE(", split(/&/, $conditional)) . ")";
+        push(@implContent, "#if ${conditionalString}\n");
+    }
+
     push(@implContent, <<END);
   // $commentInfo
   { "$attrName",
@@ -1047,6 +1054,11 @@
     static_cast<v8::PropertyAttribute>($propAttr),
     $on_proto },
 END
+
+    if ($conditional) {
+        push(@implContent, "#endif\n");
+    }
+
     }
 }
 
diff --git a/WebCore/Android.mk b/WebCore/Android.mk
index ffb4a82..c6be03c 100644
--- a/WebCore/Android.mk
+++ b/WebCore/Android.mk
@@ -961,9 +961,9 @@
 	storage/LocalStorageTask.cpp \
 	storage/LocalStorageThread.cpp \
 	storage/OriginQuotaManager.cpp \
+	storage/OriginUsageRecord.cpp \
 	storage/SessionStorage.cpp \
 	storage/SessionStorageArea.cpp \
-	storage/OriginUsageRecord.cpp \
 	storage/SQLResultSet.cpp \
 	storage/SQLResultSetRowList.cpp \
 	storage/SQLStatement.cpp \
diff --git a/WebCore/Android.v8.mk b/WebCore/Android.v8.mk
index d9f55c0..c68a3ee 100644
--- a/WebCore/Android.v8.mk
+++ b/WebCore/Android.v8.mk
@@ -523,6 +523,7 @@
 	platform/android/SearchPopupMenuAndroid.cpp \
 	platform/android/SharedTimerAndroid.cpp \
 	platform/android/SoundAndroid.cpp \
+	platform/android/SSLKeyGeneratorAndroid.cpp \
 	platform/android/SystemTimeAndroid.cpp \
 	platform/android/TemporaryLinkStubs.cpp \
 	platform/android/WidgetAndroid.cpp \
@@ -816,12 +817,22 @@
 	storage/DatabaseTask.cpp \
 	storage/DatabaseThread.cpp \
 	storage/DatabaseTracker.cpp \
+	storage/LocalStorage.cpp \
+	storage/LocalStorageArea.cpp \
+	storage/LocalStorageTask.cpp \
+	storage/LocalStorageThread.cpp \
 	storage/OriginQuotaManager.cpp \
 	storage/OriginUsageRecord.cpp \
+	storage/SessionStorage.cpp \
+	storage/SessionStorageArea.cpp \
 	storage/SQLResultSet.cpp \
 	storage/SQLResultSetRowList.cpp \
 	storage/SQLStatement.cpp \
 	storage/SQLTransaction.cpp \
+	storage/Storage.cpp \
+	storage/StorageArea.cpp \
+	storage/StorageEvent.cpp \
+	storage/StorageMap.cpp \
     
 ifeq ($(ENABLE_SVG), true)
 LOCAL_SRC_FILES := $(LOCAL_SRC_FILES) \
diff --git a/WebCore/bindings/v8/ScriptController.cpp b/WebCore/bindings/v8/ScriptController.cpp
index 9ecf3ab..833c99f 100644
--- a/WebCore/bindings/v8/ScriptController.cpp
+++ b/WebCore/bindings/v8/ScriptController.cpp
@@ -32,7 +32,12 @@
 #include "config.h"
 #include "ScriptController.h"
 
+#if PLATFORM(CHROMIUM)
 #include "ChromiumBridge.h"
+#elif PLATFORM(ANDROID)
+#include "PluginView.h"
+#endif
+
 #include "CString.h"
 #include "Document.h"
 #include "DOMWindow.h"
@@ -261,6 +266,7 @@
 {
     ASSERT(widget);
 
+#if PLATFORM(CHROMIUM)
     if (widget->isFrameView())
         return 0;
 
@@ -268,6 +274,16 @@
     if (!npObject)
         return 0;
 
+#elif PLATFORM(ANDROID)
+    if (!widget->isPluginView())
+        return 0;
+
+    PluginView* pluginView = static_cast<PluginView*>(widget);
+    NPObject* npObject = pluginView->getNPObject();
+    if (!npObject)
+        return 0;
+#endif
+
     // Frame Memory Management for NPObjects
     // -------------------------------------
     // NPObjects are treated differently than other objects wrapped by JS.
diff --git a/WebCore/bindings/v8/ScriptObject.cpp b/WebCore/bindings/v8/ScriptObject.cpp
index dd44acb..59316f0 100644
--- a/WebCore/bindings/v8/ScriptObject.cpp
+++ b/WebCore/bindings/v8/ScriptObject.cpp
@@ -119,7 +119,9 @@
 bool ScriptGlobalObject::set(ScriptState* scriptState, const char* name, InspectorController* value)
 {
     ScriptScope scope(scriptState);
+#if !PLATFORM(ANDROID)
     scope.global()->Set(v8::String::New(name), V8Proxy::ToV8Object(V8ClassIndex::INSPECTORCONTROLLER, value));
+#endif
     return scope.success();
 }
 
diff --git a/WebCore/bindings/v8/V8DOMMap.cpp b/WebCore/bindings/v8/V8DOMMap.cpp
index 60ce32b..4645c02 100644
--- a/WebCore/bindings/v8/V8DOMMap.cpp
+++ b/WebCore/bindings/v8/V8DOMMap.cpp
@@ -277,8 +277,10 @@
     InternalDOMWrapperMap<Node> m_staticDomNodeMap;
     InternalDOMWrapperMap<void> m_staticDomObjectMap;
     InternalDOMWrapperMap<void> m_staticActiveDomObjectMap;
+#if ENABLE(SVG)
     InternalDOMWrapperMap<SVGElementInstance> m_staticDomSvgElementInstanceMap;
     InternalDOMWrapperMap<void> m_staticDomSvgObjectWithContextMap;
+#endif
 };
 
 DEFINE_STATIC_LOCAL(WTF::ThreadSpecific<NonMainThreadSpecificDOMData>, threadSpecificDOMData, ());
diff --git a/WebCore/page/Coordinates.idl b/WebCore/page/Coordinates.idl
index f6c82b5..2bdd5e9 100644
--- a/WebCore/page/Coordinates.idl
+++ b/WebCore/page/Coordinates.idl
@@ -28,11 +28,13 @@
     interface Coordinates {
         readonly attribute double latitude;
         readonly attribute double longitude;
-        readonly attribute [Custom] double altitude;
         readonly attribute double accuracy;
+#if !defined(V8_BINDING)        
+        readonly attribute [Custom] double altitude;
         readonly attribute [Custom] double altitudeAccuracy;
         readonly attribute [Custom] double heading;
         readonly attribute [Custom] double speed;
+#endif
 
 #if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT
         [DontEnum] DOMString toString();
diff --git a/WebCore/storage/SessionStorageArea.cpp b/WebCore/storage/SessionStorageArea.cpp
index 168c493..7fb6ca8 100644
--- a/WebCore/storage/SessionStorageArea.cpp
+++ b/WebCore/storage/SessionStorageArea.cpp
@@ -28,6 +28,7 @@
 
 #if ENABLE(DOM_STORAGE)
 
+#include "DOMWindow.h"
 #include "EventNames.h"
 #include "Frame.h"
 #include "FrameTree.h"
diff --git a/WebKit/android/jni/WebCoreFrameBridge.cpp b/WebKit/android/jni/WebCoreFrameBridge.cpp
index 3e55693..317848d 100644
--- a/WebKit/android/jni/WebCoreFrameBridge.cpp
+++ b/WebKit/android/jni/WebCoreFrameBridge.cpp
@@ -1055,7 +1055,7 @@
     if (pFrame) {
         const char* name = JSC::Bindings::getCharactersFromJStringInEnv(env, interfaceName);
         NPObject* obj = JSC::Bindings::JavaInstanceToNPObject(new JSC::Bindings::JavaInstance(javascriptObj));
-        pFrame->script()->BindToWindowObject(pFrame, name, obj);
+        pFrame->script()->bindToWindowObject(pFrame, name, obj);
         // JavaInstanceToNPObject calls NPN_RetainObject on the
         // returned one (see CreateV8ObjectForNPObject in V8NPObject.cpp).
         // BindToWindowObject also increases obj's ref count and decrease