Revision: 9027
Author: [email protected]
Date: Mon Oct 11 11:02:47 2010
Log: 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
http://code.google.com/p/google-web-toolkit/source/detail?r=9027
Added:
/trunk/plugins/npapi/npn_bindings.cpp
/trunk/plugins/npapi/prebuilt/gwt-dev-plugin/Linux_x86-gcc3
/trunk/plugins/npapi/prebuilt/gwt-dev-plugin/Linux_x86-gcc3/libGwtDevPlugin.so
/trunk/plugins/npapi/prebuilt/gwt-dev-plugin/Linux_x86_64-gcc3
/trunk/plugins/npapi/prebuilt/gwt-dev-plugin/Linux_x86_64-gcc3/libGwtDevPlugin.so
Deleted:
/trunk/plugins/npapi/npn_bindings.cc
Modified:
/trunk/plugins/common/HashMap.h
/trunk/plugins/common/Value.h
/trunk/plugins/npapi/LocalObjectTable.h
/trunk/plugins/npapi/Makefile
/trunk/plugins/npapi/ScriptableInstance.cpp
/trunk/plugins/npapi/VisualStudio/npapi-plugin.vcproj
/trunk/plugins/npapi/main.cpp
/trunk/plugins/npapi/manifest-template.json
/trunk/plugins/npapi/mozincludes.h
/trunk/plugins/npapi/prebuilt/gwt-dev-plugin/manifest.json
/trunk/plugins/npapi/prebuilt/gwt-dev-plugin.crx
=======================================
--- /dev/null
+++ /trunk/plugins/npapi/npn_bindings.cpp Mon Oct 11 11:02:47 2010
@@ -0,0 +1,381 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: NPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Netscape Public License
+ * Version 1.1 (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.mozilla.org/NPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS"
basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is mozilla.org code.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable
instead
+ * of those above. If you wish to allow use of your version of this file
only
+ * under the terms of either the GPL or the LGPL, and not to allow others
to
+ * use your version of this file under the terms of the NPL, indicate your
+ * decision by deleting the provisions above and replace them with the
notice
+ * and other provisions required by the GPL or the LGPL. If you do not
delete
+ * the provisions above, a recipient may use your version of this file
under
+ * the terms of any one of the NPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+////////////////////////////////////////////////////////////
+//
+// Implementation of Netscape entry points (NPN_*), which are the functions
+// the plugin calls to talk to the browser.
+//
+
+#include "Debug.h"
+
+// Sun's cstring doesn't declare memcpy
+#include <string.h>
+//#include <cstring>
+
+#include "mozincludes.h"
+//#include "gears/base/common/base_class.h"
+//#include "gears/base/common/thread_locals.h"
+//#include "gears/base/npapi/module.h"
+
+#ifndef HIBYTE
+#define HIBYTE(x) ((((uint32)(x)) & 0xff00) >> 8)
+#endif
+
+#ifndef LOBYTE
+#define LOBYTE(W) ((W) & 0xFF)
+#endif
+
+static NPNetscapeFuncs npn_funcs;
+
+void SetNPNFuncs(NPNetscapeFuncs* npnFuncs) {
+ // Since we can't rely on the pointer remaining valid, we need to
+ // copy the function pointers.
+ int size = sizeof(NPNetscapeFuncs);
+ if (size > npnFuncs->size) {
+ Debug::log(Debug::Warning) << "*** Warning: NPNetscapeFuncs supplied
by "
+ "browser is smaller than expected: " << npnFuncs->size << " vs "
<< size
+ << Debug::flush;
+ size = npnFuncs->size;
+ }
+ memcpy(&npn_funcs, npnFuncs, size);
+}
+
+const NPNetscapeFuncs &GetNPNFuncs() {
+ return npn_funcs;
+}
+
+void NPN_Version(int* plugin_major, int* plugin_minor,
+ int* netscape_major, int* netscape_minor)
+{
+ const NPNetscapeFuncs &funcs = GetNPNFuncs();
+ *plugin_major = NP_VERSION_MAJOR;
+ *plugin_minor = NP_VERSION_MINOR;
+ *netscape_major = HIBYTE(funcs.version);
+ *netscape_minor = LOBYTE(funcs.version);
+}
+
+NPError NPN_GetURLNotify(NPP instance, const char *url, const char *target,
+ void* notifyData)
+{
+ const NPNetscapeFuncs &funcs = GetNPNFuncs();
+ int navMinorVers = funcs.version & 0xFF;
+ NPError rv = NPERR_NO_ERROR;
+
+ if (navMinorVers >= NPVERS_HAS_NOTIFICATION)
+ rv = funcs.geturlnotify(instance, url, target, notifyData);
+ else
+ rv = NPERR_INCOMPATIBLE_VERSION_ERROR;
+
+ return rv;
+}
+
+NPError NPN_GetURL(NPP instance, const char *url, const char *target)
+{
+ NPError rv = GetNPNFuncs().geturl(instance, url, target);
+ return rv;
+}
+
+NPError NPN_PostURLNotify(NPP instance, const char* url, const char*
window,
+ uint32 len, const char* buf, NPBool file,
+ void* notifyData)
+{
+ const NPNetscapeFuncs &funcs = GetNPNFuncs();
+ int navMinorVers = funcs.version & 0xFF;
+ NPError rv = NPERR_NO_ERROR;
+
+ if (navMinorVers >= NPVERS_HAS_NOTIFICATION) {
+ rv = funcs.posturlnotify(instance, url, window, len, buf, file,
notifyData);
+ } else {
+ rv = NPERR_INCOMPATIBLE_VERSION_ERROR;
+ }
+
+ return rv;
+}
+
+NPError NPN_PostURL(NPP instance, const char* url, const char* window,
+ uint32 len, const char* buf, NPBool file)
+{
+ NPError rv = GetNPNFuncs().posturl(instance, url, window, len, buf,
file);
+ return rv;
+}
+
+NPError NPN_RequestRead(NPStream* stream, NPByteRange* rangeList)
+{
+ NPError rv = GetNPNFuncs().requestread(stream, rangeList);
+ return rv;
+}
+
+NPError NPN_NewStream(NPP instance, NPMIMEType type, const char* target,
+ NPStream** stream)
+{
+ const NPNetscapeFuncs &funcs = GetNPNFuncs();
+ int navMinorVersion = funcs.version & 0xFF;
+
+ NPError rv = NPERR_NO_ERROR;
+
+ if ( navMinorVersion >= NPVERS_HAS_STREAMOUTPUT )
+ rv = funcs.newstream(instance, type, target, stream);
+ else
+ rv = NPERR_INCOMPATIBLE_VERSION_ERROR;
+
+ return rv;
+}
+
+int32 NPN_Write(NPP instance, NPStream *stream, int32 len, void *buffer)
+{
+ const NPNetscapeFuncs &funcs = GetNPNFuncs();
+ int navMinorVersion = funcs.version & 0xFF;
+ int32 rv = 0;
+
+ if ( navMinorVersion >= NPVERS_HAS_STREAMOUTPUT )
+ rv = funcs.write(instance, stream, len, buffer);
+ else
+ rv = -1;
+
+ return rv;
+}
+
+NPError NPN_DestroyStream(NPP instance, NPStream* stream, NPError reason)
+{
+ const NPNetscapeFuncs &funcs = GetNPNFuncs();
+ int navMinorVersion = funcs.version & 0xFF;
+ NPError rv = NPERR_NO_ERROR;
+
+ if ( navMinorVersion >= NPVERS_HAS_STREAMOUTPUT )
+ rv = funcs.destroystream(instance, stream, reason);
+ else
+ rv = NPERR_INCOMPATIBLE_VERSION_ERROR;
+
+ return rv;
+}
+
+void NPN_Status(NPP instance, const char *message)
+{
+ GetNPNFuncs().status(instance, message);
+}
+
+const char* NPN_UserAgent(NPP instance)
+{
+ const char * rv = NULL;
+ rv = GetNPNFuncs().uagent(instance);
+ return rv;
+}
+
+void* NPN_MemAlloc(uint32 size)
+{
+ void * rv = NULL;
+ rv = GetNPNFuncs().memalloc(size);
+ return rv;
+}
+
+void NPN_MemFree(void* ptr)
+{
+ GetNPNFuncs().memfree(ptr);
+}
+
+uint32 NPN_MemFlush(uint32 size)
+{
+ uint32 rv = GetNPNFuncs().memflush(size);
+ return rv;
+}
+
+void NPN_ReloadPlugins(NPBool reloadPages)
+{
+ GetNPNFuncs().reloadplugins(reloadPages);
+}
+
+NPError NPN_GetValue(NPP instance, NPNVariable variable, void *value)
+{
+ NPError rv = GetNPNFuncs().getvalue(instance, variable, value);
+ return rv;
+}
+
+NPError NPN_SetValue(NPP instance, NPPVariable variable, void *value)
+{
+ NPError rv = GetNPNFuncs().setvalue(instance, variable, value);
+ return rv;
+}
+
+void NPN_InvalidateRect(NPP instance, NPRect *invalidRect)
+{
+ GetNPNFuncs().invalidaterect(instance, invalidRect);
+}
+
+void NPN_InvalidateRegion(NPP instance, NPRegion invalidRegion)
+{
+ GetNPNFuncs().invalidateregion(instance, invalidRegion);
+}
+
+void NPN_ForceRedraw(NPP instance)
+{
+ GetNPNFuncs().forceredraw(instance);
+}
+
+NPIdentifier NPN_GetStringIdentifier(const NPUTF8 *name)
+{
+ return GetNPNFuncs().getstringidentifier(name);
+}
+
+void NPN_GetStringIdentifiers(const NPUTF8 **names, int32_t nameCount,
+ NPIdentifier *identifiers)
+{
+ return GetNPNFuncs().getstringidentifiers(names, nameCount, identifiers);
+}
+
+NPIdentifier NPN_GetIntIdentifier(int32_t intid)
+{
+ return GetNPNFuncs().getintidentifier(intid);
+}
+
+bool NPN_IdentifierIsString(NPIdentifier identifier)
+{
+ return GetNPNFuncs().identifierisstring(identifier);
+}
+
+NPUTF8 *NPN_UTF8FromIdentifier(NPIdentifier identifier)
+{
+ return GetNPNFuncs().utf8fromidentifier(identifier);
+}
+
+// On WebKit under OSX, the intfromidentifier field of the structure isn't
+// filled in (see WebNetscapePluginPackage.m#526 in WebKit source tree).
+// At this time this function isn't called from our code, so for now
comment it
+// out.
+//
+int32_t NPN_IntFromIdentifier(NPIdentifier identifier)
+{
+ return GetNPNFuncs().intfromidentifier(identifier);
+}
+
+NPObject *NPN_CreateObject(NPP npp, NPClass *aClass)
+{
+ return GetNPNFuncs().createobject(npp, aClass);
+}
+
+NPObject *NPN_RetainObject(NPObject *obj)
+{
+ return GetNPNFuncs().retainobject(obj);
+}
+
+void NPN_ReleaseObject(NPObject *obj)
+{
+ return GetNPNFuncs().releaseobject(obj);
+}
+
+bool NPN_Invoke(NPP npp, NPObject* obj, NPIdentifier methodName,
+ const NPVariant *args, uint32_t argCount, NPVariant
*result)
+{
+ return GetNPNFuncs().invoke(npp, obj, methodName, args, argCount,
result);
+}
+
+bool NPN_InvokeDefault(NPP npp, NPObject* obj, const NPVariant *args,
+ uint32_t argCount, NPVariant *result)
+{
+ return GetNPNFuncs().invokeDefault(npp, obj, args, argCount, result);
+}
+
+bool NPN_Evaluate(NPP npp, NPObject* obj, NPString *script,
+ NPVariant *result)
+{
+ return GetNPNFuncs().evaluate(npp, obj, script, result);
+}
+
+bool NPN_GetProperty(NPP npp, NPObject* obj, NPIdentifier propertyName,
+ NPVariant *result)
+{
+// Workaround for bug in WebKit: GetProperty() fails when attempting to
+// read a null value from an array, however it fills in the variant
structure
+// correctly.
+// The workaround is to chek if GetProprety() touches the variant
structure,
+// if so, we assume it succeeded.
+#ifdef BROWSER_WEBKIT
+ result->type = static_cast<NPVariantType>(-1);
+
+ bool ret = GetNPNFuncs().getproperty(npp, obj, propertyName, result);
+
+ if (result->type != -1 && !ret) {
+ ret = true;
+ }
+ return ret;
+#else
+ return GetNPNFuncs().getproperty(npp, obj, propertyName, result);
+#endif
+}
+
+bool NPN_SetProperty(NPP npp, NPObject* obj, NPIdentifier propertyName,
+ const NPVariant *value)
+{
+ return GetNPNFuncs().setproperty(npp, obj, propertyName, value);
+}
+
+bool NPN_RemoveProperty(NPP npp, NPObject* obj, NPIdentifier propertyName)
+{
+ return GetNPNFuncs().removeproperty(npp, obj, propertyName);
+}
+
+#ifdef BROWSER_WEBKIT
+// This field of NPN functions isn't filled in by WebKit on OSX.
+#else
+bool NPN_HasProperty(NPP npp, NPObject* obj, NPIdentifier propertyName)
+{
+ return GetNPNFuncs().hasproperty(npp, obj, propertyName);
+}
+#endif
+
+#ifdef BROWSER_WEBKIT
+// This field of NPN functions isn't filled in by WebKit on OSX.
+#else
+bool NPN_HasMethod(NPP npp, NPObject* obj, NPIdentifier methodName)
+{
+ return GetNPNFuncs().hasmethod(npp, obj, methodName);
+}
+#endif
+
+void NPN_ReleaseVariantValue(NPVariant *variant)
+{
+ GetNPNFuncs().releasevariantvalue(variant);
+}
+
+#ifdef BROWSER_WEBKIT
+// This function is buggy in WebKit, see
+// http://bugs.webkit.org/show_bug.cgi?id=16829
+#else
+void NPN_SetException(NPObject* obj, const NPUTF8 *message)
+{
+ GetNPNFuncs().setexception(obj, message);
+}
+#endif
=======================================
--- /dev/null
+++
/trunk/plugins/npapi/prebuilt/gwt-dev-plugin/Linux_x86-gcc3/libGwtDevPlugin.so
Mon Oct 11 11:02:47 2010
File is too large to display a diff.
=======================================
--- /dev/null
+++
/trunk/plugins/npapi/prebuilt/gwt-dev-plugin/Linux_x86_64-gcc3/libGwtDevPlugin.so
Mon Oct 11 11:02:47 2010
File is too large to display a diff.
=======================================
--- /trunk/plugins/npapi/npn_bindings.cc Mon Aug 3 08:30:11 2009
+++ /dev/null
@@ -1,381 +0,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: NPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Netscape Public License
- * Version 1.1 (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.mozilla.org/NPL/
- *
- * Software distributed under the License is distributed on an "AS IS"
basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is mozilla.org code.
- *
- * The Initial Developer of the Original Code is
- * Netscape Communications Corporation.
- * Portions created by the Initial Developer are Copyright (C) 1998
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable
instead
- * of those above. If you wish to allow use of your version of this file
only
- * under the terms of either the GPL or the LGPL, and not to allow others
to
- * use your version of this file under the terms of the NPL, indicate your
- * decision by deleting the provisions above and replace them with the
notice
- * and other provisions required by the GPL or the LGPL. If you do not
delete
- * the provisions above, a recipient may use your version of this file
under
- * the terms of any one of the NPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-////////////////////////////////////////////////////////////
-//
-// Implementation of Netscape entry points (NPN_*), which are the functions
-// the plugin calls to talk to the browser.
-//
-
-#include "Debug.h"
-
-// Sun's cstring doesn't declare memcpy
-#include <string.h>
-//#include <cstring>
-
-#include "mozincludes.h"
-//#include "gears/base/common/base_class.h"
-//#include "gears/base/common/thread_locals.h"
-//#include "gears/base/npapi/module.h"
-
-#ifndef HIBYTE
-#define HIBYTE(x) ((((uint32)(x)) & 0xff00) >> 8)
-#endif
-
-#ifndef LOBYTE
-#define LOBYTE(W) ((W) & 0xFF)
-#endif
-
-static NPNetscapeFuncs npn_funcs;
-
-void SetNPNFuncs(NPNetscapeFuncs* npnFuncs) {
- // Since we can't rely on the pointer remaining valid, we need to
- // copy the function pointers.
- int size = sizeof(NPNetscapeFuncs);
- if (size > npnFuncs->size) {
- Debug::log(Debug::Warning) << "*** Warning: NPNetscapeFuncs supplied
by "
- "browser is smaller than expected: " << npnFuncs->size << " vs "
<< size
- << Debug::flush;
- size = npnFuncs->size;
- }
- memcpy(&npn_funcs, npnFuncs, size);
-}
-
-const NPNetscapeFuncs &GetNPNFuncs() {
- return npn_funcs;
-}
-
-void NPN_Version(int* plugin_major, int* plugin_minor,
- int* netscape_major, int* netscape_minor)
-{
- const NPNetscapeFuncs &funcs = GetNPNFuncs();
- *plugin_major = NP_VERSION_MAJOR;
- *plugin_minor = NP_VERSION_MINOR;
- *netscape_major = HIBYTE(funcs.version);
- *netscape_minor = LOBYTE(funcs.version);
-}
-
-NPError NPN_GetURLNotify(NPP instance, const char *url, const char *target,
- void* notifyData)
-{
- const NPNetscapeFuncs &funcs = GetNPNFuncs();
- int navMinorVers = funcs.version & 0xFF;
- NPError rv = NPERR_NO_ERROR;
-
- if (navMinorVers >= NPVERS_HAS_NOTIFICATION)
- rv = funcs.geturlnotify(instance, url, target, notifyData);
- else
- rv = NPERR_INCOMPATIBLE_VERSION_ERROR;
-
- return rv;
-}
-
-NPError NPN_GetURL(NPP instance, const char *url, const char *target)
-{
- NPError rv = GetNPNFuncs().geturl(instance, url, target);
- return rv;
-}
-
-NPError NPN_PostURLNotify(NPP instance, const char* url, const char*
window,
- uint32 len, const char* buf, NPBool file,
- void* notifyData)
-{
- const NPNetscapeFuncs &funcs = GetNPNFuncs();
- int navMinorVers = funcs.version & 0xFF;
- NPError rv = NPERR_NO_ERROR;
-
- if (navMinorVers >= NPVERS_HAS_NOTIFICATION) {
- rv = funcs.posturlnotify(instance, url, window, len, buf, file,
notifyData);
- } else {
- rv = NPERR_INCOMPATIBLE_VERSION_ERROR;
- }
-
- return rv;
-}
-
-NPError NPN_PostURL(NPP instance, const char* url, const char* window,
- uint32 len, const char* buf, NPBool file)
-{
- NPError rv = GetNPNFuncs().posturl(instance, url, window, len, buf,
file);
- return rv;
-}
-
-NPError NPN_RequestRead(NPStream* stream, NPByteRange* rangeList)
-{
- NPError rv = GetNPNFuncs().requestread(stream, rangeList);
- return rv;
-}
-
-NPError NPN_NewStream(NPP instance, NPMIMEType type, const char* target,
- NPStream** stream)
-{
- const NPNetscapeFuncs &funcs = GetNPNFuncs();
- int navMinorVersion = funcs.version & 0xFF;
-
- NPError rv = NPERR_NO_ERROR;
-
- if ( navMinorVersion >= NPVERS_HAS_STREAMOUTPUT )
- rv = funcs.newstream(instance, type, target, stream);
- else
- rv = NPERR_INCOMPATIBLE_VERSION_ERROR;
-
- return rv;
-}
-
-int32 NPN_Write(NPP instance, NPStream *stream, int32 len, void *buffer)
-{
- const NPNetscapeFuncs &funcs = GetNPNFuncs();
- int navMinorVersion = funcs.version & 0xFF;
- int32 rv = 0;
-
- if ( navMinorVersion >= NPVERS_HAS_STREAMOUTPUT )
- rv = funcs.write(instance, stream, len, buffer);
- else
- rv = -1;
-
- return rv;
-}
-
-NPError NPN_DestroyStream(NPP instance, NPStream* stream, NPError reason)
-{
- const NPNetscapeFuncs &funcs = GetNPNFuncs();
- int navMinorVersion = funcs.version & 0xFF;
- NPError rv = NPERR_NO_ERROR;
-
- if ( navMinorVersion >= NPVERS_HAS_STREAMOUTPUT )
- rv = funcs.destroystream(instance, stream, reason);
- else
- rv = NPERR_INCOMPATIBLE_VERSION_ERROR;
-
- return rv;
-}
-
-void NPN_Status(NPP instance, const char *message)
-{
- GetNPNFuncs().status(instance, message);
-}
-
-const char* NPN_UserAgent(NPP instance)
-{
- const char * rv = NULL;
- rv = GetNPNFuncs().uagent(instance);
- return rv;
-}
-
-void* NPN_MemAlloc(uint32 size)
-{
- void * rv = NULL;
- rv = GetNPNFuncs().memalloc(size);
- return rv;
-}
-
-void NPN_MemFree(void* ptr)
-{
- GetNPNFuncs().memfree(ptr);
-}
-
-uint32 NPN_MemFlush(uint32 size)
-{
- uint32 rv = GetNPNFuncs().memflush(size);
- return rv;
-}
-
-void NPN_ReloadPlugins(NPBool reloadPages)
-{
- GetNPNFuncs().reloadplugins(reloadPages);
-}
-
-NPError NPN_GetValue(NPP instance, NPNVariable variable, void *value)
-{
- NPError rv = GetNPNFuncs().getvalue(instance, variable, value);
- return rv;
-}
-
-NPError NPN_SetValue(NPP instance, NPPVariable variable, void *value)
-{
- NPError rv = GetNPNFuncs().setvalue(instance, variable, value);
- return rv;
-}
-
-void NPN_InvalidateRect(NPP instance, NPRect *invalidRect)
-{
- GetNPNFuncs().invalidaterect(instance, invalidRect);
-}
-
-void NPN_InvalidateRegion(NPP instance, NPRegion invalidRegion)
-{
- GetNPNFuncs().invalidateregion(instance, invalidRegion);
-}
-
-void NPN_ForceRedraw(NPP instance)
-{
- GetNPNFuncs().forceredraw(instance);
-}
-
-NPIdentifier NPN_GetStringIdentifier(const NPUTF8 *name)
-{
- return GetNPNFuncs().getstringidentifier(name);
-}
-
-void NPN_GetStringIdentifiers(const NPUTF8 **names, int32_t nameCount,
- NPIdentifier *identifiers)
-{
- return GetNPNFuncs().getstringidentifiers(names, nameCount, identifiers);
-}
-
-NPIdentifier NPN_GetIntIdentifier(int32_t intid)
-{
- return GetNPNFuncs().getintidentifier(intid);
-}
-
-bool NPN_IdentifierIsString(NPIdentifier identifier)
-{
- return GetNPNFuncs().identifierisstring(identifier);
-}
-
-NPUTF8 *NPN_UTF8FromIdentifier(NPIdentifier identifier)
-{
- return GetNPNFuncs().utf8fromidentifier(identifier);
-}
-
-// On WebKit under OSX, the intfromidentifier field of the structure isn't
-// filled in (see WebNetscapePluginPackage.m#526 in WebKit source tree).
-// At this time this function isn't called from our code, so for now
comment it
-// out.
-//
-int32_t NPN_IntFromIdentifier(NPIdentifier identifier)
-{
- return GetNPNFuncs().intfromidentifier(identifier);
-}
-
-NPObject *NPN_CreateObject(NPP npp, NPClass *aClass)
-{
- return GetNPNFuncs().createobject(npp, aClass);
-}
-
-NPObject *NPN_RetainObject(NPObject *obj)
-{
- return GetNPNFuncs().retainobject(obj);
-}
-
-void NPN_ReleaseObject(NPObject *obj)
-{
- return GetNPNFuncs().releaseobject(obj);
-}
-
-bool NPN_Invoke(NPP npp, NPObject* obj, NPIdentifier methodName,
- const NPVariant *args, uint32_t argCount, NPVariant
*result)
-{
- return GetNPNFuncs().invoke(npp, obj, methodName, args, argCount,
result);
-}
-
-bool NPN_InvokeDefault(NPP npp, NPObject* obj, const NPVariant *args,
- uint32_t argCount, NPVariant *result)
-{
- return GetNPNFuncs().invokeDefault(npp, obj, args, argCount, result);
-}
-
-bool NPN_Evaluate(NPP npp, NPObject* obj, NPString *script,
- NPVariant *result)
-{
- return GetNPNFuncs().evaluate(npp, obj, script, result);
-}
-
-bool NPN_GetProperty(NPP npp, NPObject* obj, NPIdentifier propertyName,
- NPVariant *result)
-{
-// Workaround for bug in WebKit: GetProperty() fails when attempting to
-// read a null value from an array, however it fills in the variant
structure
-// correctly.
-// The workaround is to chek if GetProprety() touches the variant
structure,
-// if so, we assume it succeeded.
-#ifdef BROWSER_WEBKIT
- result->type = static_cast<NPVariantType>(-1);
-
- bool ret = GetNPNFuncs().getproperty(npp, obj, propertyName, result);
-
- if (result->type != -1 && !ret) {
- ret = true;
- }
- return ret;
-#else
- return GetNPNFuncs().getproperty(npp, obj, propertyName, result);
-#endif
-}
-
-bool NPN_SetProperty(NPP npp, NPObject* obj, NPIdentifier propertyName,
- const NPVariant *value)
-{
- return GetNPNFuncs().setproperty(npp, obj, propertyName, value);
-}
-
-bool NPN_RemoveProperty(NPP npp, NPObject* obj, NPIdentifier propertyName)
-{
- return GetNPNFuncs().removeproperty(npp, obj, propertyName);
-}
-
-#ifdef BROWSER_WEBKIT
-// This field of NPN functions isn't filled in by WebKit on OSX.
-#else
-bool NPN_HasProperty(NPP npp, NPObject* obj, NPIdentifier propertyName)
-{
- return GetNPNFuncs().hasproperty(npp, obj, propertyName);
-}
-#endif
-
-#ifdef BROWSER_WEBKIT
-// This field of NPN functions isn't filled in by WebKit on OSX.
-#else
-bool NPN_HasMethod(NPP npp, NPObject* obj, NPIdentifier methodName)
-{
- return GetNPNFuncs().hasmethod(npp, obj, methodName);
-}
-#endif
-
-void NPN_ReleaseVariantValue(NPVariant *variant)
-{
- GetNPNFuncs().releasevariantvalue(variant);
-}
-
-#ifdef BROWSER_WEBKIT
-// This function is buggy in WebKit, see
-// http://bugs.webkit.org/show_bug.cgi?id=16829
-#else
-void NPN_SetException(NPObject* obj, const NPUTF8 *message)
-{
- GetNPNFuncs().setexception(obj, message);
-}
-#endif
=======================================
--- /trunk/plugins/common/HashMap.h Mon Aug 3 08:30:11 2009
+++ /trunk/plugins/common/HashMap.h Mon Oct 11 11:02:47 2010
@@ -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
=======================================
--- /trunk/plugins/common/Value.h Mon Nov 30 14:41:59 2009
+++ /trunk/plugins/common/Value.h Mon Oct 11 11:02:47 2010
@@ -243,6 +243,12 @@
type = DOUBLE;
value.doubleValue = val;
}
+
+ void setDouble(const double* val) {
+ clearOldValue();
+ type = DOUBLE;
+ value.doubleValue = *val;
+ }
void setFloat(float val) {
clearOldValue();
=======================================
--- /trunk/plugins/npapi/LocalObjectTable.h Mon Nov 23 13:18:40 2009
+++ /trunk/plugins/npapi/LocalObjectTable.h Mon Oct 11 11:02:47 2010
@@ -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;
=======================================
--- /trunk/plugins/npapi/Makefile Tue Nov 10 16:59:43 2009
+++ /trunk/plugins/npapi/Makefile Mon Oct 11 11:02:47 2010
@@ -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)
-
-INSTDIR := extension/platform/Linux_$(ARCH)-gcc3/plugins
-
-HDRS= LocalObjectTable.h NPVariantWrapper.h Plugin.h ScriptableInstance.h
mozincludes.h \
- JavaObject.h ScriptableInstance.h
-
-COMMON= ../common/libcommon$(FLAG32BIT).a
-OBJS= main.o Plugin.o LocalObjectTable.o JavaObject.o npn_bindings.o \
- ScriptableInstance.o
-
-SRCS= main.cpp Plugin.cpp LocalObjectTable.cpp JavaObject.cpp \
- npn_bindings.cc ScriptableInstance.cpp
-
-VERSION ?= 0.9.$(shell ./getversion).$(shell date +%Y%m%d)
-
-all:: versioned-files
-
-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
-
-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/*'
-
-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
-
-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
-
-extension: prebuilt/extension
- -rm -rf extension
- cp -r --preserve=mode $< $@
-
-$(INSTDIR):
- -mkdir -p $@
-
-extension/META-INF/zigbert.sf: $(INSTDIR)/liboophm.so
- signtool -d certdb -k 'GWT Plugin' -x .svn extension/
-
-extension/install.rdf: install-template.rdf version
- sed s/GWT_OOPHM_VERSION/`cat version`/ install-template.rdf >$@
-
-version: computeversion $(HDRS) $(SRCS) $(COMMON)
- ./computeversion >$@
-
-$(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
+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
+
+
+export FLAG32BIT
+
+CFLAGS += -DBROWSER_NPAPI -fshort-wchar
+CXXFLAGS = $(CXXONLYFLAGS) $(CFLAGS)
+DIR = $(shell pwd)
+
+DEPEND = g++ -MM -MT'$$(OBJ_OUTDIR)/$(patsubst %.cpp,%.o,$(src))' \
+ -I. -I../common $(src)
+
+COMMON = ../common/libcommon$(FLAG32BIT).a
+
+OBJ_OUTDIR = build/$(TARGET_PLATFORM)
+EXTENSION_OUTDIR = prebuilt/gwt-dev-plugin
+PLATFORM_DIR = $(EXTENSION_OUTDIR)/$(TARGET_PLATFORM)
+
+INSTALLER_CRX = prebuilt/gwt-dev-plugin.crx
+DLL = $(OBJ_OUTDIR)/libGwtDevPlugin$(DLL_SUFFIX)
+
+#DLLFLAGS +=
+
+#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
+
+$(DLL): $(OBJS) $(COMMON)
+ $(CXX) -m$(FLAG32BIT) -o $@ $(OBJS) $(COMMON) $(DLLFLAGS)
+ @mkdir -p $(PLATFORM_DIR)
+ cp $(DLL) $(PLATFORM_DIR)/
+
+$(OBJ_OUTDIR)/%.o: %.cpp
+ $(CXX) $(CXXFLAGS) -c -o $@ -I. -I../common $<
+
+common $(COMMON):
+ (cd ../common && $(MAKE))
+
+clean:
+ rm -rf build
+
+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
+
+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
=======================================
--- /trunk/plugins/npapi/ScriptableInstance.cpp Mon Jun 7 12:20:31 2010
+++ /trunk/plugins/npapi/ScriptableInstance.cpp Mon Oct 11 11:02:47 2010
@@ -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 @@
}
}
}
-
=======================================
--- /trunk/plugins/npapi/VisualStudio/npapi-plugin.vcproj Mon Jun 7
12:20:31 2010
+++ /trunk/plugins/npapi/VisualStudio/npapi-plugin.vcproj Mon Oct 11
11:02:47 2010
@@ -387,7 +387,7 @@
>
</File>
<File
- RelativePath="..\npn_bindings.cc"
+ RelativePath="..\npn_bindings.cpp"
>
</File>
<File
=======================================
--- /trunk/plugins/npapi/main.cpp Mon Jun 7 12:20:31 2010
+++ /trunk/plugins/npapi/main.cpp Mon Oct 11 11:02:47 2010
@@ -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;
}
=======================================
--- /trunk/plugins/npapi/manifest-template.json Tue Nov 10 16:59:43 2009
+++ /trunk/plugins/npapi/manifest-template.json Mon Oct 11 11:02:47 2010
@@ -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 }
]
}
=======================================
--- /trunk/plugins/npapi/mozincludes.h Mon Aug 3 08:30:11 2009
+++ /trunk/plugins/npapi/mozincludes.h Mon Oct 11 11:02:47 2010
@@ -33,7 +33,7 @@
STRINGN_TO_NPVARIANT(GetNPStringUTF8Characters(npstr), \
GetNPStringUTF8Length(npstr), var)
-#ifdef LINUX
+#ifdef linux
#define OSCALL /**/
#define WINAPI /**/
#define DLLEXP /**/
=======================================
--- /trunk/plugins/npapi/prebuilt/gwt-dev-plugin/manifest.json Tue Dec 8
10:41:45 2009
+++ /trunk/plugins/npapi/prebuilt/gwt-dev-plugin/manifest.json Mon Oct 11
11:02:47 2010
@@ -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 }
]
}
=======================================
--- /trunk/plugins/npapi/prebuilt/gwt-dev-plugin.crx Mon Nov 23 16:38:01
2009
+++ /trunk/plugins/npapi/prebuilt/gwt-dev-plugin.crx Mon Oct 11 11:02:47
2010
Binary file, no diff available.
--
http://groups.google.com/group/Google-Web-Toolkit-Contributors