/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla 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/MPL/
*
* 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):
* Sean Echevarria <sean@beatnik.com>
* Håkan Waara <hwaara@chello.se>
* Josh Aas <josh@mozilla.com>
*
* 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 MPL, 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 MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
/* nsPluginHost.cpp - top-level plugin management code */
#include "nscore.h"
#include "nsPluginHost.h"
#include <stdio.h>
#include "prio.h"
#include "prmem.h"
#include "nsIComponentManager.h"
#include "nsNPAPIPlugin.h"
#include "nsNPAPIPluginStreamListener.h"
#include "nsIPlugin.h"
#include "nsNPAPIPluginInstance.h"
#include "nsIPluginStreamListener.h"
#include "nsIHTTPHeaderListener.h"
#include "nsIHttpHeaderVisitor.h"
#include "nsIObserverService.h"
#include "nsIHttpProtocolHandler.h"
#include "nsIHttpChannel.h"
#include "nsIHttpChannelInternal.h"
#include "nsIUploadChannel.h"
#include "nsIByteRangeRequest.h"
#include "nsIStreamListener.h"
#include "nsIInputStream.h"
#include "nsIOutputStream.h"
#include "nsIURL.h"
#include "nsXPIDLString.h"
#include "nsReadableUtils.h"
#include "nsIProtocolProxyService.h"
#include "nsIStreamConverterService.h"
#include "nsIFile.h"
#include "nsIInputStream.h"
#include "nsIIOService.h"
#include "nsIURL.h"
#include "nsIChannel.h"
#include "nsISeekableStream.h"
#include "nsNetUtil.h"
#include "nsIProgressEventSink.h"
#include "nsIDocument.h"
#include "nsICachingChannel.h"
#include "nsHashtable.h"
#include "nsIProxyInfo.h"
#include "nsPluginLogging.h"
#include "nsIPrefBranch2.h"
#include "nsIScriptChannel.h"
#include "nsPrintfCString.h"
#include "nsIBlocklistService.h"
#include "nsVersionComparator.h"
#include "nsIPrivateBrowsingService.h"
#include "nsIObjectLoadingContent.h"
#include "nsIWritablePropertyBag2.h"
#include "nsPluginStreamListenerPeer.h"
#include "nsEnumeratorUtils.h"
#include "nsXPCOM.h"
#include "nsXPCOMCID.h"
#include "nsISupportsPrimitives.h"
#include "nsIXULRuntime.h"
// for the dialog
#include "nsIStringBundle.h"
#include "nsIWindowWatcher.h"
#include "nsPIDOMWindow.h"
#include "nsIScriptGlobalObject.h"
#include "nsIScriptGlobalObjectOwner.h"
#include "nsIPrincipal.h"
#include "nsNetCID.h"
#include "nsIDOMPlugin.h"
#include "nsIDOMMimeType.h"
#include "nsMimeTypes.h"
#include "prprf.h"
#include "nsThreadUtils.h"
#include "nsIInputStreamTee.h"
#include "nsIInterfaceInfoManager.h"
#include "xptinfo.h"
#include "nsIMIMEService.h"
#include "nsCExternalHandlerService.h"
#include "nsILocalFile.h"
#include "nsIFileChannel.h"
#include "nsPluginSafety.h"
#include "nsICharsetConverterManager.h"
#include "nsIPlatformCharset.h"
#include "nsIDirectoryService.h"
#include "nsDirectoryServiceDefs.h"
#include "nsXULAppAPI.h"
#include "nsAppDirectoryServiceDefs.h"
#include "nsIFile.h"
#include "nsPluginDirServiceProvider.h"
#include "nsInt64.h"
#include "nsPluginError.h"
#include "nsUnicharUtils.h"
#include "nsPluginManifestLineReader.h"
#include "nsIWeakReferenceUtils.h"
#include "nsIDOMElement.h"
#include "nsIDOMHTMLObjectElement.h"
#include "nsIDOMHTMLEmbedElement.h"
#include "nsIPresShell.h"
#include "nsIWebNavigation.h"
#include "nsISupportsArray.h"
#include "nsIDocShell.h"
#include "nsPluginNativeWindow.h"
#include "nsIScriptSecurityManager.h"
#include "nsIContentPolicy.h"
#include "nsContentPolicyUtils.h"
#include "nsContentErrors.h"
#include "mozilla/TimeStamp.h"
#if defined(XP_WIN)
#include "nsIWindowMediator.h"
#include "nsIBaseWindow.h"
#include "windows.h"
#include "winbase.h"
#endif
using namespace mozilla;
using mozilla::TimeStamp;
// Null out a strong ref to a linked list iteratively to avoid
// exhausting the stack (bug 486349).
#define NS_ITERATIVE_UNREF_LIST(type_, list_, mNext_) \
{ \
while (list_) { \
type_ temp = list_->mNext_; \
list_->mNext_ = nsnull; \
list_ = temp; \
} \
}
// this is the name of the directory which will be created
// to cache temporary files.
#define kPluginTmpDirName NS_LITERAL_CSTRING("plugtmp")
// Version of cached plugin info
// 0.01 first implementation
// 0.02 added caching of CanUnload to fix bug 105935
// 0.03 changed name, description and mime desc from string to bytes, bug 108246
// 0.04 added new mime entry point on Mac, bug 113464
// 0.05 added new entry point check for the default plugin, bug 132430
// 0.06 strip off suffixes in mime description strings, bug 53895
// 0.07 changed nsIRegistry to flat file support for caching plugins info
// 0.08 mime entry point on MachO, bug 137535
// 0.09 the file encoding is changed to UTF-8, bug 420285
// 0.10 added plugin versions on appropriate platforms, bug 427743
// 0.11 file name and full path fields now store expected values on all platforms, bug 488181
// 0.12 force refresh due to quicktime pdf claim fix, bug 611197
// 0.13 add architecture and list of invalid plugins, bug 616271
// 0.14 force refresh due to locale comparison fix, bug 611296
// 0.15 force refresh due to bug in reading Java plist MIME data, bug 638171
// The current plugin registry version (and the maximum version we know how to read)
static const char *kPluginRegistryVersion = "0.15";
// The minimum registry version we know how to read
static const char *kMinimumRegistryVersion = "0.9";
static NS_DEFINE_IID(kIPluginTagInfoIID, NS_IPLUGINTAGINFO_IID);
static const char kDirectoryServiceContractID[] = "@mozilla.org/file/directory_service;1";
// Registry keys for caching plugin info
static const char kPluginsRootKey[] = "software/plugins";
static const char kPluginsNameKey[] = "name";
static const char kPluginsDescKey[] = "description";
static const char kPluginsFilenameKey[] = "filename";
static const char kPluginsFullpathKey[] = "fullpath";
static const char kPluginsModTimeKey[] = "lastModTimeStamp";
static const char kPluginsCanUnload[] = "canUnload";
static const char kPluginsVersionKey[] = "version";
static const char kPluginsMimeTypeKey[] = "mimetype";
static const char kPluginsMimeDescKey[] = "description";
static const char kPluginsMimeExtKey[] = "extension";
#define kPluginRegistryFilename NS_LITERAL_CSTRING("pluginreg.dat")
#ifdef
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
npruntime包含NPAPIsdk.rar (74个子文件)
resource.h 631B
plugin.h 2KB
npruntime.vcproj 5KB
nprt.def 130B
np_entry.cpp 7KB
ScriptAccess.h 1KB
stdafx.h 270B
ScriptAccess.cpp 5KB
nprt.rc 2KB
npruntime2008.sln 883B
plugin
base
public
nsPluginLogging.h 5KB
nsIPluginHost.idl 14KB
nsIPluginStreamInfo.idl 2KB
nptypes.h 4KB
nsIPluginInputStream.idl 2KB
npfunctions.h 16KB
nsIPluginStreamListener.idl 5KB
nsPluginsCID.h 2KB
npruntime.h 16KB
nsIPluginTagInfo.idl 5KB
nsIPluginDocument.idl 2KB
nsIPluginInstanceOwner.idl 5KB
nsIPluginInstance.idl 10KB
nsPluginNativeWindow.h 4KB
nsIPluginTag.idl 2KB
nsIHTTPHeaderListener.idl 3KB
npapi.h 28KB
nsIPlugin.idl 2KB
nspluginroot.idl 3KB
Makefile.in 2KB
nsPluginError.h 2KB
src
nsNPAPIPluginStreamListener.cpp 28KB
nsNPAPIPlugin.cpp 72KB
nsPluginStreamListenerPeer.h 6KB
nsPluginModule.cpp 2KB
nsPluginHost.cpp 134KB
nsPluginNativeWindowQt.cpp 4KB
nsPluginsDirBeOS.cpp 9KB
nsPluginTags.h 5KB
nsPluginsDirOS2.cpp 8KB
nsPluginNativeWindowOS2.cpp 17KB
nsJSNPRuntime.h 4KB
nsPluginsDirDarwin.cpp 22KB
nsNPAPIPlugin.h 11KB
nsPluginsDirWin.cpp 11KB
nsNPAPIPluginInstance.h 7KB
nsPluginNativeWindowWin.cpp 25KB
nsPluginDirServiceProvider.h 3KB
nsPluginManifestLineReader.h 4KB
nsPluginDirServiceProvider.cpp 20KB
nsPluginsDirUtils.h 5KB
nsPluginsDirUnix.cpp 14KB
nsPluginNativeWindow.cpp 3KB
nsPluginTags.cpp 18KB
PluginPRLibrary.h 6KB
nsPluginNativeWindowGtk2.cpp 15KB
Makefile.in 4KB
nsPluginStreamListenerPeer.cpp 45KB
nsNPAPIPluginStreamListener.h 7KB
nsNPAPIPluginInstance.cpp 36KB
nsPluginHost.h 12KB
PluginPRLibrary.cpp 8KB
nsPluginsDir.h 4KB
nsPluginSafety.h 5KB
nsJSNPRuntime.cpp 58KB
ScriptObject.cpp 582B
npp_gate.cpp 7KB
ScriptObject.h 450B
NPString.cpp 710B
npn_gate.cpp 8KB
plugin.cpp 24KB
NPString.h 335B
3c78da2e-dda0-4d85-ba3a-298b429a5f17.jpg 414KB
Codeproject.html 3KB
共 74 条
- 1
yeah2000
- 粉丝: 72
- 资源: 55
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
- 3
- 4
- 5
- 6
前往页