Revision: 6101 Author: [email protected] Date: Wed Sep 9 08:52:07 2009 Log: Rename VS project, attempt (unsucessfully) to get a stable identity from NPObjects passed from Chrome, fix inconsistent line endings.
http://code.google.com/p/google-web-toolkit/source/detail?r=6101 Added: /trunk/plugins/npapi/VisualStudio/npapi-plugin.sln /trunk/plugins/npapi/VisualStudio/npapi-plugin.vcproj Deleted: /trunk/plugins/npapi/VisualStudio/firefox-plugin.sln /trunk/plugins/npapi/VisualStudio/firefox-plugin.vcproj Modified: /trunk/plugins/npapi/LocalObjectTable.cpp /trunk/plugins/npapi/LocalObjectTable.h /trunk/plugins/npapi/ScriptableInstance.cpp ======================================= --- /dev/null +++ /trunk/plugins/npapi/VisualStudio/npapi-plugin.sln Wed Sep 9 08:52:07 2009 @@ -0,0 +1,26 @@ + +Microsoft Visual Studio Solution File, Format Version 9.00 +# Visual C++ Express 2005 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "npapi-plugin", "npapi-plugin.vcproj", "{6BF0C2CE-CB0C-421B-A67C-1E448371D24A}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Debug|Win64 = Debug|Win64 + Release|Win32 = Release|Win32 + Release|Win64 = Release|Win64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {6BF0C2CE-CB0C-421B-A67C-1E448371D24A}.Debug|Win32.ActiveCfg = Debug| Win32 + {6BF0C2CE-CB0C-421B-A67C-1E448371D24A}.Debug|Win32.Build.0 = Debug|Win32 + {6BF0C2CE-CB0C-421B-A67C-1E448371D24A}.Debug|Win64.ActiveCfg = Debug| Win32 + {6BF0C2CE-CB0C-421B-A67C-1E448371D24A}.Debug|Win64.Build.0 = Debug|Win32 + {6BF0C2CE-CB0C-421B-A67C-1E448371D24A}.Release|Win32.ActiveCfg = Release| Win32 + {6BF0C2CE-CB0C-421B-A67C-1E448371D24A}.Release|Win32.Build.0 = Release| Win32 + {6BF0C2CE-CB0C-421B-A67C-1E448371D24A}.Release|Win64.ActiveCfg = Release| Win32 + {6BF0C2CE-CB0C-421B-A67C-1E448371D24A}.Release|Win64.Build.0 = Release| Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal ======================================= --- /dev/null +++ /trunk/plugins/npapi/VisualStudio/npapi-plugin.vcproj Wed Sep 9 08:52:07 2009 @@ -0,0 +1,449 @@ +<?xml version="1.0" encoding="UTF-8"?> +<VisualStudioProject + ProjectType="Visual C++" + Version="8.00" + Name="npapi-plugin" + ProjectGUID="{6BF0C2CE-CB0C-421B-A67C-1E448371D24A}" + RootNamespace="npapi-plugin" + Keyword="Win32Proj" + > + <Platforms> + <Platform + Name="Win32" + /> + </Platforms> + <ToolFiles> + </ToolFiles> + <Configurations> + <Configuration + Name="Debug|Win32" + OutputDirectory="Debug" + IntermediateDirectory="Debug" + ConfigurationType="2" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + Optimization="0" + AdditionalIncludeDirectories=""$(ProjectDir)\..\..\common"" + PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;FIREFOXPLUGIN_EXPORTS" + MinimalRebuild="true" + BasicRuntimeChecks="3" + RuntimeLibrary="3" + UsePrecompiledHeader="0" + WarningLevel="3" + Detect64BitPortabilityProblems="true" + DebugInformationFormat="3" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + ResourceOutputFileName="$(IntDir)/$(TargetName).res" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLinkerTool" + AdditionalDependencies="ws2_32.lib" + ShowProgress="2" + OutputFile="$(ProjectDir)\..\prebuilt\WINNT_x86-msvc\npOOPHM.dll" + LinkIncremental="1" + ModuleDefinitionFile="$(ProjectDir)\..\npOOPHM.def" + GenerateDebugInformation="true" + ProgramDatabaseFile="$(IntDir)\$(TargetName).pdb" + SubSystem="2" + ImportLibrary="$(IntDir)\$(TargetName).lib" + TargetMachine="1" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCManifestTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCAppVerifierTool" + /> + <Tool + Name="VCWebDeploymentTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + <Configuration + Name="Release|Win32" + OutputDirectory="Release" + IntermediateDirectory="Release" + ConfigurationType="2" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + Optimization="3" + EnableIntrinsicFunctions="true" + AdditionalIncludeDirectories=""..\..\common"" + PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;FIREFOXPLUGIN_EXPORTS" + ExceptionHandling="1" + RuntimeLibrary="2" + UsePrecompiledHeader="0" + WarningLevel="3" + Detect64BitPortabilityProblems="false" + DebugInformationFormat="3" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLinkerTool" + AdditionalDependencies="ws2_32.lib" + ShowProgress="2" + OutputFile="..\extension\platform\WINNT_x86-msvc\plugins\npOOPHM.dll" + LinkIncremental="0" + AdditionalLibraryDirectories="" + ModuleDefinitionFile="..\npOOPHM.def" + GenerateDebugInformation="true" + ProgramDatabaseFile="$(IntDir)\$(TargetName).pdb" + SubSystem="2" + OptimizeReferences="2" + EnableCOMDATFolding="2" + ImportLibrary="$(IntDir)\$(TargetName).lib" + TargetMachine="1" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCManifestTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCAppVerifierTool" + /> + <Tool + Name="VCWebDeploymentTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + </Configurations> + <References> + </References> + <Files> + <Filter + Name="Header Files" + Filter="h;hpp;hxx;hm;inl;inc;xsd" + UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}" + > + <File + RelativePath="..\..\common\AllowedConnections.h" + > + </File> + <File + RelativePath="..\..\common\BrowserChannel.h" + > + </File> + <File + RelativePath="..\..\common\CheckVersionsMessage.h" + > + </File> + <File + RelativePath="..\..\common\ChooseTransportMessage.h" + > + </File> + <File + RelativePath="..\..\common\Debug.h" + > + </File> + <File + RelativePath="..\..\common\DebugLevel.h" + > + </File> + <File + RelativePath="..\..\common\FatalErrorMessage.h" + > + </File> + <File + RelativePath="..\..\common\FreeValueMessage.h" + > + </File> + <File + RelativePath="..\..\common\HashMap.h" + > + </File> + <File + RelativePath="..\..\common\HostChannel.h" + > + </File> + <File + RelativePath="..\..\common\InvokeMessage.h" + > + </File> + <File + RelativePath="..\..\common\InvokeSpecialMessage.h" + > + </File> + <File + RelativePath="..\JavaObject.h" + > + </File> + <File + RelativePath="..\..\common\LoadJsniMessage.h" + > + </File> + <File + RelativePath="..\..\common\LoadModuleMessage.h" + > + </File> + <File + RelativePath="..\LocalObjectTable.h" + > + </File> + <File + RelativePath="..\..\common\Message.h" + > + </File> + <File + RelativePath="..\mozincludes.h" + > + </File> + <File + RelativePath="..\npapi\npapi.h" + > + </File> + <File + RelativePath="..\npapi\nphostapi.h" + > + </File> + <File + RelativePath="..\NPObjectWrapper.h" + > + </File> + <File + RelativePath="..\npapi\npruntime.h" + > + </File> + <File + RelativePath="..\NPVariantWrapper.h" + > + </File> + <File + RelativePath="..\..\common\Platform.h" + > + </File> + <File + RelativePath="..\Plugin.h" + > + </File> + <File + RelativePath="..\..\common\ProtocolVersionMessage.h" + > + </File> + <File + RelativePath="..\..\common\QuitMessage.h" + > + </File> + <File + RelativePath="..\resource.h" + > + </File> + <File + RelativePath="..\..\common\ReturnMessage.h" + > + </File> + <File + RelativePath="..\..\common\scoped_ptr\scoped_ptr.h" + > + </File> + <File + RelativePath="..\ScriptableInstance.h" + > + </File> + <File + RelativePath="..\..\common\ServerMethods.h" + > + </File> + <File + RelativePath="..\..\common\SessionHandler.h" + > + </File> + <File + RelativePath="..\..\common\Socket.h" + > + </File> + <File + RelativePath="..\..\common\SwitchTransportMessage.h" + > + </File> + <File + RelativePath="..\..\common\Value.h" + > + </File> + </Filter> + <Filter + Name="Resource Files" + Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx" + UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}" + > + <File + RelativePath="..\npOOPHM.rc" + > + </File> + </Filter> + <Filter + Name="Source Files" + Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx" + UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}" + > + <File + RelativePath="..\..\common\AllowedConnections.cpp" + > + </File> + <File + RelativePath="..\..\common\CheckVersionsMessage.cpp" + > + </File> + <File + RelativePath="..\..\common\ChooseTransportMessage.cpp" + > + </File> + <File + RelativePath="..\..\common\Debug.cpp" + > + </File> + <File + RelativePath="..\..\common\FatalErrorMessage.cpp" + > + </File> + <File + RelativePath="..\..\common\FreeValueMessage.cpp" + > + </File> + <File + RelativePath="..\..\common\HostChannel.cpp" + > + </File> + <File + RelativePath="..\..\common\InvokeMessage.cpp" + > + </File> + <File + RelativePath="..\..\common\InvokeSpecialMessage.cpp" + > + </File> + <File + RelativePath="..\JavaObject.cpp" + > + </File> + <File + RelativePath="..\..\common\LoadJsniMessage.cpp" + > + </File> + <File + RelativePath="..\..\common\LoadModuleMessage.cpp" + > + </File> + <File + RelativePath="..\LocalObjectTable.cpp" + > + </File> + <File + RelativePath="..\main.cpp" + > + </File> + <File + RelativePath="..\npn_bindings.cc" + > + </File> + <File + RelativePath="..\npOOPHM.def" + > + </File> + <File + RelativePath="..\Plugin.cpp" + > + </File> + <File + RelativePath="..\..\common\ProtocolVersionMessage.cpp" + > + </File> + <File + RelativePath="..\..\common\ReturnMessage.cpp" + > + </File> + <File + RelativePath="..\ScriptableInstance.cpp" + > + </File> + <File + RelativePath="..\..\common\ServerMethods.cpp" + > + </File> + <File + RelativePath="..\..\common\Socket.cpp" + > + </File> + <File + RelativePath="..\..\common\SwitchTransportMessage.cpp" + > + </File> + </Filter> + </Files> + <Globals> + </Globals> +</VisualStudioProject> ======================================= --- /trunk/plugins/npapi/VisualStudio/firefox-plugin.sln Mon Aug 3 08:30:11 2009 +++ /dev/null @@ -1,26 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual C++ Express 2005 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "firefox-plugin", "firefox-plugin.vcproj", "{6BF0C2CE-CB0C-421B-A67C-1E448371D24A}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Debug|Win64 = Debug|Win64 - Release|Win32 = Release|Win32 - Release|Win64 = Release|Win64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {6BF0C2CE-CB0C-421B-A67C-1E448371D24A}.Debug|Win32.ActiveCfg = Debug| Win32 - {6BF0C2CE-CB0C-421B-A67C-1E448371D24A}.Debug|Win32.Build.0 = Debug|Win32 - {6BF0C2CE-CB0C-421B-A67C-1E448371D24A}.Debug|Win64.ActiveCfg = Debug| Win32 - {6BF0C2CE-CB0C-421B-A67C-1E448371D24A}.Debug|Win64.Build.0 = Debug|Win32 - {6BF0C2CE-CB0C-421B-A67C-1E448371D24A}.Release|Win32.ActiveCfg = Release| Win32 - {6BF0C2CE-CB0C-421B-A67C-1E448371D24A}.Release|Win32.Build.0 = Release| Win32 - {6BF0C2CE-CB0C-421B-A67C-1E448371D24A}.Release|Win64.ActiveCfg = Release| Win32 - {6BF0C2CE-CB0C-421B-A67C-1E448371D24A}.Release|Win64.Build.0 = Release| Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal ======================================= --- /trunk/plugins/npapi/VisualStudio/firefox-plugin.vcproj Fri Sep 4 16:37:06 2009 +++ /dev/null @@ -1,449 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<VisualStudioProject - ProjectType="Visual C++" - Version="8.00" - Name="firefox-plugin" - ProjectGUID="{6BF0C2CE-CB0C-421B-A67C-1E448371D24A}" - RootNamespace="firefox-plugin" - Keyword="Win32Proj" - > - <Platforms> - <Platform - Name="Win32" - /> - </Platforms> - <ToolFiles> - </ToolFiles> - <Configurations> - <Configuration - Name="Debug|Win32" - OutputDirectory="Debug" - IntermediateDirectory="Debug" - ConfigurationType="2" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="0" - AdditionalIncludeDirectories=""$(ProjectDir)\..\..\common"" - PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;FIREFOXPLUGIN_EXPORTS;GWT_DEBUGLEVEL=Warning" - MinimalRebuild="true" - BasicRuntimeChecks="3" - RuntimeLibrary="3" - UsePrecompiledHeader="0" - WarningLevel="3" - Detect64BitPortabilityProblems="true" - DebugInformationFormat="3" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - ResourceOutputFileName="$(IntDir)/$(TargetName).res" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - AdditionalDependencies="ws2_32.lib" - ShowProgress="2" - OutputFile="$(ProjectDir)\..\prebuilt\WINNT_x86-msvc\npOOPHM.dll" - LinkIncremental="1" - ModuleDefinitionFile="$(ProjectDir)\..\npOOPHM.def" - GenerateDebugInformation="true" - ProgramDatabaseFile="$(IntDir)\$(TargetName).pdb" - SubSystem="2" - ImportLibrary="$(IntDir)\$(TargetName).lib" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCWebDeploymentTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - <Configuration - Name="Release|Win32" - OutputDirectory="Release" - IntermediateDirectory="Release" - ConfigurationType="2" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="3" - EnableIntrinsicFunctions="true" - AdditionalIncludeDirectories=""..\..\common"" - PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;FIREFOXPLUGIN_EXPORTS;GWT_DEBUGLEVEL=Warning" - ExceptionHandling="1" - RuntimeLibrary="2" - UsePrecompiledHeader="0" - WarningLevel="3" - Detect64BitPortabilityProblems="false" - DebugInformationFormat="3" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - AdditionalDependencies="ws2_32.lib" - ShowProgress="2" - OutputFile="..\extension\platform\WINNT_x86-msvc\plugins\npOOPHM.dll" - LinkIncremental="0" - AdditionalLibraryDirectories="" - ModuleDefinitionFile="..\npOOPHM.def" - GenerateDebugInformation="true" - ProgramDatabaseFile="$(IntDir)\$(TargetName).pdb" - SubSystem="2" - OptimizeReferences="2" - EnableCOMDATFolding="2" - ImportLibrary="$(IntDir)\$(TargetName).lib" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCWebDeploymentTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - </Configurations> - <References> - </References> - <Files> - <Filter - Name="Header Files" - Filter="h;hpp;hxx;hm;inl;inc;xsd" - UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}" - > - <File - RelativePath="..\..\common\AllowedConnections.h" - > - </File> - <File - RelativePath="..\..\common\BrowserChannel.h" - > - </File> - <File - RelativePath="..\..\common\CheckVersionsMessage.h" - > - </File> - <File - RelativePath="..\..\common\ChooseTransportMessage.h" - > - </File> - <File - RelativePath="..\..\common\Debug.h" - > - </File> - <File - RelativePath="..\..\common\DebugLevel.h" - > - </File> - <File - RelativePath="..\..\common\FatalErrorMessage.h" - > - </File> - <File - RelativePath="..\..\common\FreeValueMessage.h" - > - </File> - <File - RelativePath="..\..\common\HashMap.h" - > - </File> - <File - RelativePath="..\..\common\HostChannel.h" - > - </File> - <File - RelativePath="..\..\common\InvokeMessage.h" - > - </File> - <File - RelativePath="..\..\common\InvokeSpecialMessage.h" - > - </File> - <File - RelativePath="..\JavaObject.h" - > - </File> - <File - RelativePath="..\..\common\LoadJsniMessage.h" - > - </File> - <File - RelativePath="..\..\common\LoadModuleMessage.h" - > - </File> - <File - RelativePath="..\LocalObjectTable.h" - > - </File> - <File - RelativePath="..\..\common\Message.h" - > - </File> - <File - RelativePath="..\mozincludes.h" - > - </File> - <File - RelativePath="..\npapi\npapi.h" - > - </File> - <File - RelativePath="..\npapi\nphostapi.h" - > - </File> - <File - RelativePath="..\NPObjectWrapper.h" - > - </File> - <File - RelativePath="..\npapi\npruntime.h" - > - </File> - <File - RelativePath="..\NPVariantWrapper.h" - > - </File> - <File - RelativePath="..\..\common\Platform.h" - > - </File> - <File - RelativePath="..\Plugin.h" - > - </File> - <File - RelativePath="..\..\common\ProtocolVersionMessage.h" - > - </File> - <File - RelativePath="..\..\common\QuitMessage.h" - > - </File> - <File - RelativePath="..\resource.h" - > - </File> - <File - RelativePath="..\..\common\ReturnMessage.h" - > - </File> - <File - RelativePath="..\..\common\scoped_ptr\scoped_ptr.h" - > - </File> - <File - RelativePath="..\ScriptableInstance.h" - > - </File> - <File - RelativePath="..\..\common\ServerMethods.h" - > - </File> - <File - RelativePath="..\..\common\SessionHandler.h" - > - </File> - <File - RelativePath="..\..\common\Socket.h" - > - </File> - <File - RelativePath="..\..\common\SwitchTransportMessage.h" - > - </File> - <File - RelativePath="..\..\common\Value.h" - > - </File> - </Filter> - <Filter - Name="Resource Files" - Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx" - UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}" - > - <File - RelativePath="..\npOOPHM.rc" - > - </File> - </Filter> - <Filter - Name="Source Files" - Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx" - UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}" - > - <File - RelativePath="..\..\common\AllowedConnections.cpp" - > - </File> - <File - RelativePath="..\..\common\CheckVersionsMessage.cpp" - > - </File> - <File - RelativePath="..\..\common\ChooseTransportMessage.cpp" - > - </File> - <File - RelativePath="..\..\common\Debug.cpp" - > - </File> - <File - RelativePath="..\..\common\FatalErrorMessage.cpp" - > - </File> - <File - RelativePath="..\..\common\FreeValueMessage.cpp" - > - </File> - <File - RelativePath="..\..\common\HostChannel.cpp" - > - </File> - <File - RelativePath="..\..\common\InvokeMessage.cpp" - > - </File> - <File - RelativePath="..\..\common\InvokeSpecialMessage.cpp" - > - </File> - <File - RelativePath="..\JavaObject.cpp" - > - </File> - <File - RelativePath="..\..\common\LoadJsniMessage.cpp" - > - </File> - <File - RelativePath="..\..\common\LoadModuleMessage.cpp" - > - </File> - <File - RelativePath="..\LocalObjectTable.cpp" - > - </File> - <File - RelativePath="..\main.cpp" - > - </File> - <File - RelativePath="..\npn_bindings.cc" - > - </File> - <File - RelativePath="..\npOOPHM.def" - > - </File> - <File - RelativePath="..\Plugin.cpp" - > - </File> - <File - RelativePath="..\..\common\ProtocolVersionMessage.cpp" - > - </File> - <File - RelativePath="..\..\common\ReturnMessage.cpp" - > - </File> - <File - RelativePath="..\ScriptableInstance.cpp" - > - </File> - <File - RelativePath="..\..\common\ServerMethods.cpp" - > - </File> - <File - RelativePath="..\..\common\Socket.cpp" - > - </File> - <File - RelativePath="..\..\common\SwitchTransportMessage.cpp" - > - </File> - </Filter> - </Files> - <Globals> - </Globals> -</VisualStudioProject> ======================================= --- /trunk/plugins/npapi/LocalObjectTable.cpp Tue Sep 8 16:09:51 2009 +++ /trunk/plugins/npapi/LocalObjectTable.cpp Wed Sep 9 08:52:07 2009 @@ -1,6 +1,24 @@ #include "mozincludes.h" #include "LocalObjectTable.h" +// Mirrors of NPObjectWrapper and NPObjectProxy from Chrome +// TODO(jat): this is very fragile and may break if Chrome changes +struct ChromeNPObjectProxy { + // IPC::Channel::Listener and IPC::Message::Sender are pure interfaces, so we don't need to + // account for any data fields from their inheritance + void* channel_; // scoped_refptr keeps only a single pointer + void* unknown; // looks like another pointer before route id + int route_id_; + intptr_t npobject_ptr_; +}; + +struct ChromeNPObjectWrapper { + NPObject object; + ChromeNPObjectProxy* proxy; +}; + +NPClass* LocalObjectTable::wrappedObjectClass = 0; + LocalObjectTable::~LocalObjectTable() { if (!dontFree) { freeAll(); @@ -8,14 +26,12 @@ } void* LocalObjectTable::getIdentityFrom(NPObject* obj) { - void** rawPtr = reinterpret_cast<void**>(reinterpret_cast<char*>(obj) + sizeof(NPClass*) - + sizeof(uint32_t)); - Debug::log(Debug::Info) << "getIdentity(obj=" << (void*)obj << "): class=" << (void*)obj->_class - << ", bytes:"; - for (int i = 0; i< 4; ++i) { - Debug::log(Debug::Info) << " " << rawPtr[i]; - } - Debug::log(Debug::Info) << Debug::flush; - return obj; -} - + void* id = obj; + if (obj->_class == wrappedObjectClass) { + ChromeNPObjectWrapper* wrapper = reinterpret_cast<ChromeNPObjectWrapper*>(obj); + ChromeNPObjectProxy* proxy = wrapper->proxy; + id = reinterpret_cast<void*>(proxy->npobject_ptr_); + Debug::log(Debug::Info) << "Mapped obj=" << (void*)obj << " to " << id << Debug::flush; + } + return id; +} ======================================= --- /trunk/plugins/npapi/LocalObjectTable.h Tue Sep 8 16:09:51 2009 +++ /trunk/plugins/npapi/LocalObjectTable.h Wed Sep 9 08:52:07 2009 @@ -32,6 +32,7 @@ std::vector<NPObject*> objects; std::map<void*, int> objectIndex; bool dontFree; + static NPClass* wrappedObjectClass; bool isFree(int id) { // low bit is set for free pointers, object pointers can't be odd @@ -62,6 +63,10 @@ virtual ~LocalObjectTable(); + static void setWrappedObjectClass(NPClass* clazz) { + wrappedObjectClass = clazz; + } + int add(NPObject* obj) { void* objId = getIdentityFrom(obj); int id = findIndex(objId); ======================================= --- /trunk/plugins/npapi/ScriptableInstance.cpp Fri Sep 4 16:37:06 2009 +++ /trunk/plugins/npapi/ScriptableInstance.cpp Wed Sep 9 08:52:07 2009 @@ -259,6 +259,7 @@ // replace our window object with that passed by the caller window = NPVariantProxy::getAsObject(args[0]); NPN_RetainObject(window); + LocalObjectTable::setWrappedObjectClass(window->_class); BOOLEAN_TO_NPVARIANT(true, *result); result->type = NPVariantType_Bool; } --~--~---------~--~----~------------~-------~--~----~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~----------~----~----~----~------~----~------~--~---
