Add Chrome/Linux support for the Developer Plugin.  Note that this does not support asking the user to allow non-localhost connections or storing that whitelist, and Mac support will be added later though much of the Makefile work is also relevant there.  Also, the MissingPlugins page is not updated in this patch because we want to get more mileage on this before giving it out to everyone, and we should probably fix non-localhost connections first as well.

Patch by: jat
Review by: conroy


git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@9027 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/plugins/common/HashMap.h b/plugins/common/HashMap.h
index c76b220..ebf634a 100644
--- a/plugins/common/HashMap.h
+++ b/plugins/common/HashMap.h
@@ -19,10 +19,10 @@
 // Portability wrapper for hash maps, since they aren't part of the standard C++ library
 
 #ifdef __GNUC__
-#if 0
+#ifdef CXX_TR1
 // future support
 #include <unordered_map>
-#define hash_map unordered_map
+#define hash_map std::tr1::unordered_map
 
 namespace HashFunctions = std;
 #else
diff --git a/plugins/common/Value.h b/plugins/common/Value.h
index bcea639..d19b0b5 100644
--- a/plugins/common/Value.h
+++ b/plugins/common/Value.h
@@ -244,6 +244,12 @@
     value.doubleValue = val;
   }
 
+  void setDouble(const double* val) {
+    clearOldValue();
+    type = DOUBLE;
+    value.doubleValue = *val;
+  }
+
   void setFloat(float val) {
     clearOldValue();
     type = FLOAT;
diff --git a/plugins/npapi/LocalObjectTable.h b/plugins/npapi/LocalObjectTable.h
index 1fa69c2..acfbf2f 100644
--- a/plugins/npapi/LocalObjectTable.h
+++ b/plugins/npapi/LocalObjectTable.h
@@ -53,7 +53,7 @@
   }
 
   void set(int id, NPObject* obj) {
-    Debug::log(Debug::Info) << "LocalObjectTable::set(id=" << id << ",obj=" << (void*)obj
+    Debug::log(Debug::Spam) << "LocalObjectTable::set(id=" << id << ",obj=" << (void*)obj
         << ")" << Debug::flush;
     objects[id] = obj;
     // keep track that we hold a reference in the table
@@ -61,7 +61,7 @@
   }
 
   void free(int id) {
-    Debug::log(Debug::Info) << "LocalObjectTable::free(id=" << id << ")" << Debug::flush;
+    Debug::log(Debug::Spam) << "LocalObjectTable::free(id=" << id << ")" << Debug::flush;
     ObjectMap::iterator it = objects.find(id);
     if (it == objects.end()) {
       Debug::log(Debug::Error) << "Freeing freed object slot " << id << Debug::flush;
diff --git a/plugins/npapi/Makefile b/plugins/npapi/Makefile
index 04b0c05..385f6ae 100644
--- a/plugins/npapi/Makefile
+++ b/plugins/npapi/Makefile
@@ -1,136 +1,207 @@
+# Copyright 2010 Google Inc.
+# 
+# Licensed under the Apache License, Version 2.0 (the "License"); you may not
+# use this file except in compliance with the License. You may obtain a copy of
+# the License at
+# 
+# http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations under
+# the License.
+
 include ../config.mk
 
-INC=-I. -I../common -Inpapi
-CFLAGS=-Wall -g -O2 -fPIC $(INC) -rdynamic -m$(FLAG32BIT) -DLINUX -DBROWSER_NPAPI
-CXXFLAGS=$(CFLAGS)
+ifeq ($(OS),mac)
+RUN_PATH_FLAG = -executable_path
+DLL_SUFFIX = .dylib
+DLLFLAGS = -bundle $(ALLARCHCFLAGS)
+CFLAGS += $(ALLARCHCFLAGS)
+CXXFLAGS += $(ALLARCHCFLAGS)
+# Mac puts multiple architectures into the same files
+TARGET_PLATFORM = Darwin-gcc3
+else
+ifeq ($(OS),linux)
+RUN_PATH_FLAG = -rpath-link
+DLL_SUFFIX = .so
+DLLFLAGS = -shared -m$(FLAG32BIT)
+TARGET_PLATFORM = Linux_$(ARCH)-gcc3
+else
+ifeq ($(OS),sun)
+TARGET_PLATFORM = SunOS_$(ARCH)-sunc
+RUN_PATH_FLAG = -rpath-link
+DLLFLAGS=
+endif
+endif
+endif
 
-INSTDIR := extension/platform/Linux_$(ARCH)-gcc3/plugins
 
-HDRS= LocalObjectTable.h NPVariantWrapper.h Plugin.h ScriptableInstance.h mozincludes.h \
-	JavaObject.h ScriptableInstance.h
+export FLAG32BIT
 
-COMMON= ../common/libcommon$(FLAG32BIT).a
-OBJS=	main.o Plugin.o LocalObjectTable.o JavaObject.o npn_bindings.o \
-	ScriptableInstance.o
+CFLAGS += -DBROWSER_NPAPI -fshort-wchar
+CXXFLAGS = $(CXXONLYFLAGS) $(CFLAGS)
+DIR = $(shell pwd)
 
-SRCS=	main.cpp Plugin.cpp LocalObjectTable.cpp JavaObject.cpp \
-	npn_bindings.cc ScriptableInstance.cpp
+DEPEND = g++ -MM -MT'$$(OBJ_OUTDIR)/$(patsubst %.cpp,%.o,$(src))' \
+  -I. -I../common $(src)
 
-VERSION ?= 0.9.$(shell ./getversion).$(shell date +%Y%m%d)
+COMMON            = ../common/libcommon$(FLAG32BIT).a
 
-all:: versioned-files
+OBJ_OUTDIR        = build/$(TARGET_PLATFORM)
+EXTENSION_OUTDIR  = prebuilt/gwt-dev-plugin
+PLATFORM_DIR      = $(EXTENSION_OUTDIR)/$(TARGET_PLATFORM)
 
-signable: prebuilt/gwt-dev-plugin/manifest.json
-	-rm -rf signable
-	mkdir signable
-	cd prebuilt; find gwt-dev-plugin -path */.svn -prune -o -print | cpio -pmdua ../signable
+INSTALLER_CRX     = prebuilt/gwt-dev-plugin.crx
+DLL               = $(OBJ_OUTDIR)/libGwtDevPlugin$(DLL_SUFFIX)
 
-oophm.xpi: extension $(INSTDIR)/liboophm.so liboophm.so extension/install.rdf
-	-rm -f oophm.xpi
-	cd extension; zip -r -D -9 -o ../$@ * -x '*/.svn/*' -x 'META-INF/*'
+#DLLFLAGS += 
 
-oophm-signed.xpi: $(INSTDIR)/liboophm.so extension/install.rdf \
-  extension/META-INF/zigbert.sf
-	-rm -f $@
-	cd extension; zip -9 ../$@ META-INF/zigbert.rsa; zip -r -D -9 -o ../$@ * -x '*/.svn/*' -x META-INF/zigbert.rsa
+#VERSION ?= 0.9.$(shell ./getversion).$(shell date +%Y%m%d%H%M%S)
+VERSION ?= 0.9.$(shell ./getversion)
+
+.PHONY: default all crx lib common clean depend install install-platform \
+	versioned-files
+
+default:: lib versioned-files
+
+all:: common lib install-platform crx
+
+lib:: $(OBJ_OUTDIR) $(EXTENSION_OUTDIR) $(DLL)
+crx:: $(EXTENSION_OUTDIR) $(INSTALLER_CRX)
+
+linuxplatforms:
+	$(MAKE) lib ARCH=x86
+	$(MAKE) lib ARCH=x86_64
+
+macplatforms:
+	$(MAKE) lib
+
+HDRS =	\
+	LocalObjectTable.h \
+	NPVariantWrapper.h \
+	Plugin.h \
+	ScriptableInstance.h \
+	mozincludes.h \
+	JavaObject.h
+
+SRCS =	\
+	main.cpp \
+	Plugin.cpp \
+	LocalObjectTable.cpp \
+	JavaObject.cpp \
+	npn_bindings.cpp \
+	ScriptableInstance.cpp
+
+OBJS = $(patsubst %.cpp,$(OBJ_OUTDIR)/%.o,$(SRCS))
+
+$(OBJS): $(OBJ_OUTDIR)
+
+$(OBJ_OUTDIR)::
+	@mkdir -p $@
+
+$(INSTALLER_CRX): $(EXTENSION_OUTDIR) versioned-files
+	@mkdir -p $(EXTENSION_OUTDIR)/components
+	#(cd prebuilt/extension; find . \( -name .svn -prune \) -o -print | cpio -pmdua ../../$(EXTENSION_OUTDIR))
+	-rm $(INSTALLER_CRX)
+	(cd $(EXTENSION_OUTDIR) && zip -r -D -9 $(DIR)/$(INSTALLER_CRX) * -x '*/.svn/*' -x 'META-INF/*')
 
 versioned-files::
 	sed -e s/GWT_DEV_PLUGIN_VERSION/$(VERSION)/ manifest-template.json >prebuilt/gwt-dev-plugin/manifest.json
-	sed -e s/GWT_DEV_PLUGIN_VERSION/$(VERSION)/ updates-template.xml >prebuilt/updates.xml
+	#sed -e s/GWT_DEV_PLUGIN_VERSION/$(VERSION)/ updates-template.xml >prebuilt/updates.xml
 
-extension: prebuilt/extension
-	-rm -rf extension
-	cp -r --preserve=mode $< $@
+$(DLL): $(OBJS) $(COMMON)
+	$(CXX) -m$(FLAG32BIT) -o $@ $(OBJS) $(COMMON) $(DLLFLAGS) 
+	@mkdir -p $(PLATFORM_DIR)
+	cp $(DLL) $(PLATFORM_DIR)/
 
-$(INSTDIR):
-	-mkdir -p $@
+$(OBJ_OUTDIR)/%.o: %.cpp
+	$(CXX) $(CXXFLAGS) -c -o $@ -I. -I../common $<
 
-extension/META-INF/zigbert.sf: $(INSTDIR)/liboophm.so
-	signtool -d certdb -k 'GWT Plugin' -x .svn extension/
+common $(COMMON):
+	(cd ../common && $(MAKE))
 
-extension/install.rdf: install-template.rdf version
-	sed s/GWT_OOPHM_VERSION/`cat version`/ install-template.rdf >$@
+clean:
+	rm -rf build
 
-version: computeversion $(HDRS) $(SRCS) $(COMMON)
-	./computeversion >$@
+install-platform:
+	@-mkdir -p $(PLATFORM_DIR)
+	-cp $(DLL) $(PLATFORM_DIR)/
+ifeq ($(OS),mac)
+	@-mkdir -p $(subst $(EXTENSION_OUTDIR),prebuilt/extension-$(BROWSER),$(subst x86,ppc,$(PLATFORM_DIR)))/components
+	-cp $(DLL) $(subst $(EXTENSION_OUTDIR),prebuilt/extension-$(BROWSER),$(subst x86,ppc,$(PLATFORM_DIR)))/components
+endif
 
-$(INSTDIR)/liboophm.so: liboophm.so
-	cp $< $@
-
-liboophm.so: $(OBJS) $(COMMON) $(INSTDIR)
-	g++ -m$(FLAG32BIT) -shared -o $@ $(OBJS) $(COMMON)
-
-$(COMMON): common
-	cd ../common; make
-
-$(OBJS): 
-
-.PHONY: all realclean clean depend common install install-platform versioned-files
-
-install:: oophm.xpi
-	-cp --preserve=mode $< prebuilt
-
-install-platform:: liboophm.so
-	-mkdir -p $(subst extension,prebuilt/extension,$(INSTDIR))
-	-cp --preserve=mode $< $(subst extension,prebuilt/extension,$(INSTDIR))
-
-realclean:: clean
-
-clean::
-	-rm -f $(OBJS)
-	-rm -f extension/platform/*/plugins/*.{so,dll}
-
-depend::
-	g++ -MM $(CFLAGS) $(SRCS) >>Makefile
+depend: $(OBJ_OUTDIR)
+	($(foreach src,$(SRCS),$(DEPEND)) true) >>Makefile
 #	makedepend -- $(CFLAGS) -- $(SRCS)
 
 # DO NOT DELETE
-main.o: main.cpp ../common/Debug.h ../common/Platform.h \
-  ../common/DebugLevel.h mozincludes.h npapi/npapi.h npapi/nphostapi.h \
-  npapi/npapi.h npapi/npruntime.h npapi/npapi.h npapi/npruntime.h \
-  NPObjectWrapper.h Plugin.h ScriptableInstance.h ../common/HostChannel.h ../common/Message.h \
-  ../common/ReturnMessage.h ../common/BrowserChannel.h ../common/Value.h \
-  ../common/Debug.h ../common/SessionHandler.h \
-  ../common/LoadModuleMessage.h ../common/HostChannel.h \
-  LocalObjectTable.h ../common/SessionHandler.h \
-  ../common/scoped_ptr/scoped_ptr.h ../common/AllowedConnections.h
-Plugin.o: Plugin.cpp Plugin.h ScriptableInstance.h ../common/Debug.h ../common/Platform.h \
-  ../common/DebugLevel.h mozincludes.h npapi/npapi.h npapi/nphostapi.h \
-  npapi/npapi.h npapi/npruntime.h npapi/npapi.h npapi/npruntime.h \
-  NPObjectWrapper.h ../common/HostChannel.h ../common/Message.h \
-  ../common/ReturnMessage.h ../common/BrowserChannel.h ../common/Value.h \
-  ../common/Debug.h ../common/SessionHandler.h ../common/AllowedConnections.h \
-  ../common/LoadModuleMessage.h ../common/HostChannel.h \
-  LocalObjectTable.h ../common/SessionHandler.h ../common/InvokeMessage.h \
-  ../common/ReturnMessage.h ../common/ServerMethods.h \
-  ../common/scoped_ptr/scoped_ptr.h NPVariantWrapper.h \
-  ../common/Platform.h ../common/Value.h JavaObject.h ../common/HashMap.h
-ScriptableInstance.o: ScriptableInstance.cpp Plugin.h ScriptableInstance.h ../common/Debug.h \
-  ../common/Platform.h \
-  ../common/DebugLevel.h mozincludes.h npapi/npapi.h npapi/nphostapi.h \
-  npapi/npapi.h npapi/npruntime.h npapi/npapi.h npapi/npruntime.h \
-  NPObjectWrapper.h ../common/HostChannel.h ../common/Message.h \
-  ../common/ReturnMessage.h ../common/BrowserChannel.h ../common/Value.h \
-  ../common/Debug.h ../common/SessionHandler.h ../common/AllowedConnections.h \
-  ../common/LoadModuleMessage.h ../common/HostChannel.h \
-  LocalObjectTable.h ../common/SessionHandler.h ../common/InvokeMessage.h \
-  ../common/ReturnMessage.h ../common/ServerMethods.h \
-  ../common/scoped_ptr/scoped_ptr.h NPVariantWrapper.h \
-  ../common/Platform.h ../common/Value.h JavaObject.h ../common/HashMap.h
-LocalObjectTable.o: LocalObjectTable.cpp mozincludes.h npapi/npapi.h \
-  npapi/nphostapi.h npapi/npapi.h npapi/npruntime.h npapi/npapi.h \
-  npapi/npruntime.h NPObjectWrapper.h LocalObjectTable.h \
-  ../common/Debug.h ../common/Platform.h ../common/DebugLevel.h
-JavaObject.o: JavaObject.cpp JavaObject.h mozincludes.h npapi/npapi.h \
-  npapi/nphostapi.h npapi/npapi.h npapi/npruntime.h npapi/npapi.h \
-  npapi/npruntime.h NPObjectWrapper.h Plugin.h ScriptableInstance.h ../common/Debug.h \
-  ../common/Platform.h ../common/DebugLevel.h ../common/HostChannel.h \
-  ../common/Message.h ../common/ReturnMessage.h ../common/AllowedConnections.h \
-  ../common/BrowserChannel.h ../common/Value.h ../common/Debug.h \
-  ../common/SessionHandler.h ../common/LoadModuleMessage.h \
-  ../common/HostChannel.h LocalObjectTable.h ../common/SessionHandler.h \
-  ../common/HashMap.h NPVariantWrapper.h ../common/Platform.h \
-  ../common/Value.h
-npn_bindings.o: npn_bindings.cc mozincludes.h npapi/npapi.h \
-  npapi/nphostapi.h npapi/npapi.h npapi/npruntime.h npapi/npapi.h \
-  npapi/npruntime.h NPObjectWrapper.h
+$(OBJ_OUTDIR)/main.o $(OBJ_OUTDIR)/Plugin.o \
+ $(OBJ_OUTDIR)/LocalObjectTable.o $(OBJ_OUTDIR)/JavaObject.o \
+ $(OBJ_OUTDIR)/npn_bindings.cpp $(OBJ_OUTDIR)/ScriptableInstance.o: \
+ main.cpp ../common/Debug.h ../common/Platform.h ../common/DebugLevel.h \
+ mozincludes.h npapi/npapi.h npapi/nphostapi.h npapi/npapi.h \
+ npapi/npruntime.h npapi/npruntime.h NPObjectWrapper.h Plugin.h \
+ ../common/HostChannel.h ../common/Debug.h ../common/ByteOrder.h \
+ ../common/Socket.h ../common/Message.h ../common/ReturnMessage.h \
+ ../common/BrowserChannel.h ../common/Value.h ../common/SessionHandler.h \
+ ../common/LoadModuleMessage.h ../common/HostChannel.h LocalObjectTable.h \
+ ../common/SessionHandler.h ../common/HashMap.h ScriptableInstance.h \
+ ../common/scoped_ptr/scoped_ptr.h
+$(OBJ_OUTDIR)/main.o $(OBJ_OUTDIR)/Plugin.o \
+ $(OBJ_OUTDIR)/LocalObjectTable.o $(OBJ_OUTDIR)/JavaObject.o \
+ $(OBJ_OUTDIR)/npn_bindings.cpp $(OBJ_OUTDIR)/ScriptableInstance.o: \
+ Plugin.cpp Plugin.h ../common/Debug.h ../common/Platform.h \
+ ../common/DebugLevel.h mozincludes.h npapi/npapi.h npapi/nphostapi.h \
+ npapi/npapi.h npapi/npruntime.h npapi/npruntime.h NPObjectWrapper.h \
+ ../common/HostChannel.h ../common/Debug.h ../common/ByteOrder.h \
+ ../common/Socket.h ../common/Message.h ../common/ReturnMessage.h \
+ ../common/BrowserChannel.h ../common/Value.h ../common/SessionHandler.h \
+ ../common/LoadModuleMessage.h ../common/HostChannel.h LocalObjectTable.h \
+ ../common/SessionHandler.h ../common/HashMap.h ScriptableInstance.h \
+ ../common/InvokeMessage.h ../common/ReturnMessage.h \
+ ../common/ServerMethods.h ../common/scoped_ptr/scoped_ptr.h \
+ NPVariantWrapper.h ../common/Platform.h ../common/Value.h JavaObject.h
+$(OBJ_OUTDIR)/main.o $(OBJ_OUTDIR)/Plugin.o \
+ $(OBJ_OUTDIR)/LocalObjectTable.o $(OBJ_OUTDIR)/JavaObject.o \
+ $(OBJ_OUTDIR)/npn_bindings.cpp $(OBJ_OUTDIR)/ScriptableInstance.o: \
+ LocalObjectTable.cpp mozincludes.h npapi/npapi.h npapi/nphostapi.h \
+ npapi/npapi.h npapi/npruntime.h npapi/npruntime.h NPObjectWrapper.h \
+ LocalObjectTable.h ../common/Debug.h ../common/Platform.h \
+ ../common/DebugLevel.h
+$(OBJ_OUTDIR)/main.o $(OBJ_OUTDIR)/Plugin.o \
+ $(OBJ_OUTDIR)/LocalObjectTable.o $(OBJ_OUTDIR)/JavaObject.o \
+ $(OBJ_OUTDIR)/npn_bindings.cpp $(OBJ_OUTDIR)/ScriptableInstance.o: \
+ JavaObject.cpp ../common/Debug.h ../common/Platform.h \
+ ../common/DebugLevel.h JavaObject.h mozincludes.h npapi/npapi.h \
+ npapi/nphostapi.h npapi/npapi.h npapi/npruntime.h npapi/npruntime.h \
+ NPObjectWrapper.h Plugin.h ../common/HostChannel.h ../common/Debug.h \
+ ../common/ByteOrder.h ../common/Socket.h ../common/Message.h \
+ ../common/ReturnMessage.h ../common/BrowserChannel.h ../common/Value.h \
+ ../common/SessionHandler.h ../common/LoadModuleMessage.h \
+ ../common/HostChannel.h LocalObjectTable.h ../common/SessionHandler.h \
+ ../common/HashMap.h ScriptableInstance.h NPVariantWrapper.h \
+ ../common/Platform.h ../common/Value.h
+$(OBJ_OUTDIR)/main.o $(OBJ_OUTDIR)/Plugin.o \
+ $(OBJ_OUTDIR)/LocalObjectTable.o $(OBJ_OUTDIR)/JavaObject.o \
+ $(OBJ_OUTDIR)/npn_bindings.cpp $(OBJ_OUTDIR)/ScriptableInstance.o: \
+ npn_bindings.cpp ../common/Debug.h ../common/Platform.h \
+ ../common/DebugLevel.h mozincludes.h npapi/npapi.h npapi/nphostapi.h \
+ npapi/npapi.h npapi/npruntime.h npapi/npruntime.h NPObjectWrapper.h
+$(OBJ_OUTDIR)/main.o $(OBJ_OUTDIR)/Plugin.o \
+ $(OBJ_OUTDIR)/LocalObjectTable.o $(OBJ_OUTDIR)/JavaObject.o \
+ $(OBJ_OUTDIR)/npn_bindings.cpp $(OBJ_OUTDIR)/ScriptableInstance.o: \
+ ScriptableInstance.cpp ScriptableInstance.h ../common/Debug.h \
+ ../common/Platform.h ../common/DebugLevel.h mozincludes.h npapi/npapi.h \
+ npapi/nphostapi.h npapi/npapi.h npapi/npruntime.h npapi/npruntime.h \
+ NPObjectWrapper.h ../common/HostChannel.h ../common/Debug.h \
+ ../common/ByteOrder.h ../common/Socket.h ../common/Message.h \
+ ../common/ReturnMessage.h ../common/BrowserChannel.h ../common/Value.h \
+ ../common/SessionHandler.h ../common/LoadModuleMessage.h \
+ ../common/HostChannel.h LocalObjectTable.h ../common/SessionHandler.h \
+ ../common/HashMap.h ../common/InvokeMessage.h ../common/ReturnMessage.h \
+ ../common/ServerMethods.h ../common/AllowedConnections.h \
+ ../common/scoped_ptr/scoped_ptr.h NPVariantWrapper.h \
+ ../common/Platform.h ../common/Value.h Plugin.h JavaObject.h
diff --git a/plugins/npapi/ScriptableInstance.cpp b/plugins/npapi/ScriptableInstance.cpp
index cad66ef..8b85d75 100644
--- a/plugins/npapi/ScriptableInstance.cpp
+++ b/plugins/npapi/ScriptableInstance.cpp
@@ -21,8 +21,10 @@
 #include "ReturnMessage.h"
 #include "ServerMethods.h"
 #include "AllowedConnections.h"
+#ifdef _WINDOWS
 #include "Preferences.h"
 #include "AllowDialog.h"
+#endif
 
 #include "mozincludes.h"
 #include "scoped_ptr/scoped_ptr.h"
@@ -272,15 +274,24 @@
       << ")" << Debug::flush;
   const std::string urlStr = convertToString(url);
 
+#ifdef _WINDOWS
+  // TODO: platform-independent preferences storage
   Preferences::loadAccessList();
+#endif
   bool allowed = false;
   if (!AllowedConnections::matchesRule(urlStr, &allowed)) {
+#ifdef _WINDOWS
+    // TODO: platform-independent allow-connection dialog
     bool remember = false;
     allowed = AllowDialog::askUserToAllow(&remember);
     if (remember) {
       std::string host = AllowedConnections::getHostFromUrl(urlStr);
       Preferences::addNewRule(host, !allowed);
     }
+#elif 0
+    // WARNING: BIG SECURITY HOLE IF ENABLED!
+    allowed = true;
+#endif
   }
   if (!allowed) {
     BOOLEAN_TO_NPVARIANT(false, *result);
@@ -674,4 +685,3 @@
     }
   }
 }
-
diff --git a/plugins/npapi/VisualStudio/npapi-plugin.vcproj b/plugins/npapi/VisualStudio/npapi-plugin.vcproj
index 81c2578..74b9075 100755
--- a/plugins/npapi/VisualStudio/npapi-plugin.vcproj
+++ b/plugins/npapi/VisualStudio/npapi-plugin.vcproj
@@ -387,7 +387,7 @@
 				>
 			</File>
 			<File
-				RelativePath="..\npn_bindings.cc"
+				RelativePath="..\npn_bindings.cpp"
 				>
 			</File>
 			<File
diff --git a/plugins/npapi/main.cpp b/plugins/npapi/main.cpp
index 7106a02..557fe62 100644
--- a/plugins/npapi/main.cpp
+++ b/plugins/npapi/main.cpp
@@ -17,9 +17,11 @@
 #include "Plugin.h"
 #include "ScriptableInstance.h"
 #include "scoped_ptr/scoped_ptr.h"
-#include "AllowDialog.h"
 
 #ifdef _WINDOWS
+// TODO: add platform-independent permission dialog
+#include "AllowDialog.h"
+
 #include <windows.h>
 
 BOOL APIENTRY DllMain(HMODULE hModule, DWORD ulReasonForCall, LPVOID lpReserved) {
@@ -90,7 +92,7 @@
 
 #ifdef __APPLE_CC__
   int main(NPNetscapeFuncs* browserFuncs, NPPluginFuncs* pluginFuncs, NPP_ShutdownUPP* shutdownUPP) {
-    printf("main (gwt-hosted-mode/c++)\n");
+    printf("main (gwt-dev-plugin/c++)\n");
     if (shutdownUPP == NULL) {
       return NPERR_INVALID_FUNCTABLE_ERROR;
     }
diff --git a/plugins/npapi/manifest-template.json b/plugins/npapi/manifest-template.json
index 2a257ab..d54ddd8 100644
--- a/plugins/npapi/manifest-template.json
+++ b/plugins/npapi/manifest-template.json
@@ -18,6 +18,8 @@
     }
   ],
   "plugins": [
-    { "path": "WINNT_x86-msvc/npGwtDevPlugin.dll", "public": true }
+    { "path": "WINNT_x86-msvc/npGwtDevPlugin.dll", "public": true },
+    { "path": "Linux_x86-gcc3/libGwtDevPlugin.so", "public": true },
+    { "path": "Linux_x86_64-gcc3/libGwtDevPlugin.so", "public": true }
   ]
 }
diff --git a/plugins/npapi/mozincludes.h b/plugins/npapi/mozincludes.h
index 3b455ff..302b2eb 100644
--- a/plugins/npapi/mozincludes.h
+++ b/plugins/npapi/mozincludes.h
@@ -33,7 +33,7 @@
   STRINGN_TO_NPVARIANT(GetNPStringUTF8Characters(npstr), \
                        GetNPStringUTF8Length(npstr), var)
 
-#ifdef LINUX
+#ifdef linux
 #define OSCALL /**/
 #define WINAPI /**/
 #define DLLEXP /**/
diff --git a/plugins/npapi/npn_bindings.cc b/plugins/npapi/npn_bindings.cpp
similarity index 100%
rename from plugins/npapi/npn_bindings.cc
rename to plugins/npapi/npn_bindings.cpp
diff --git a/plugins/npapi/prebuilt/gwt-dev-plugin.crx b/plugins/npapi/prebuilt/gwt-dev-plugin.crx
index 8f236b7..cc6c39e 100644
--- a/plugins/npapi/prebuilt/gwt-dev-plugin.crx
+++ b/plugins/npapi/prebuilt/gwt-dev-plugin.crx
Binary files differ
diff --git a/plugins/npapi/prebuilt/gwt-dev-plugin/Linux_x86-gcc3/libGwtDevPlugin.so b/plugins/npapi/prebuilt/gwt-dev-plugin/Linux_x86-gcc3/libGwtDevPlugin.so
new file mode 100755
index 0000000..6f77d12
--- /dev/null
+++ b/plugins/npapi/prebuilt/gwt-dev-plugin/Linux_x86-gcc3/libGwtDevPlugin.so
Binary files differ
diff --git a/plugins/npapi/prebuilt/gwt-dev-plugin/Linux_x86_64-gcc3/libGwtDevPlugin.so b/plugins/npapi/prebuilt/gwt-dev-plugin/Linux_x86_64-gcc3/libGwtDevPlugin.so
new file mode 100755
index 0000000..7fde13d
--- /dev/null
+++ b/plugins/npapi/prebuilt/gwt-dev-plugin/Linux_x86_64-gcc3/libGwtDevPlugin.so
Binary files differ
diff --git a/plugins/npapi/prebuilt/gwt-dev-plugin/manifest.json b/plugins/npapi/prebuilt/gwt-dev-plugin/manifest.json
index c50b730..145d70e 100644
--- a/plugins/npapi/prebuilt/gwt-dev-plugin/manifest.json
+++ b/plugins/npapi/prebuilt/gwt-dev-plugin/manifest.json
@@ -1,6 +1,6 @@
 {
   "name": "GWT Developer Plugin",
-  "version": "1.0.7263",
+  "version": "1.0.8980",
   "description": "A plugin to enable debugging with GWT's Development Mode",
   "update_url": "https://dl-ssl.google.com/gwt/plugins/chrome/updates.xml",
   "icons": {
@@ -18,6 +18,8 @@
     }
   ],
   "plugins": [
-    { "path": "WINNT_x86-msvc/npGwtDevPlugin.dll", "public": true }
+    { "path": "WINNT_x86-msvc/npGwtDevPlugin.dll", "public": true },
+    { "path": "Linux_x86-gcc3/libGwtDevPlugin.so", "public": true },
+    { "path": "Linux_x86_64-gcc3/libGwtDevPlugin.so", "public": true }
   ]
 }