[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.15.1-1414-gc69ee75

jhoneycutt at apple.com jhoneycutt at apple.com
Thu Oct 29 20:34:08 UTC 2009


The following commit has been merged in the webkit-1.1 branch:
commit 45f50cee128680ea7109822394ede1098c374e59
Author: jhoneycutt at apple.com <jhoneycutt at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Sep 25 06:53:11 2009 +0000

    Add a mechanism for automatically halting plug-ins.
    
    Reviewed by Oliver Hunt and Alice Liu.
    
    WebCore:
    
    * GNUmakefile.am:
    
    * WebCore.base.exp:
    Update export of Page constructor.
    
    * WebCore.gypi:
    
    * WebCore.pro:
    
    * WebCore.vcproj/WebCore.vcproj:
    Add PluginHalter.{h,cpp}, PluginHalterClient.h, and
    HaltablePlugin.h.
    
    * WebCore.xcodeproj/project.pbxproj:
    Add files to Mac project.
    
    * loader/EmptyClients.h:
    Added an empty PluginHalterClient.
    (WebCore::EmptyPluginHalterClient::shouldHaltPlugin):
    Return false.
    
    * page/PluginHalter.cpp: Added.
    (WebCore::PluginHalter::PluginHalter):
    (WebCore::PluginHalter::didStartPlugin):
    Add the object to the plug-in set. If this is the only item in the set,
    set m_oldestStartTime to this object's time, and start the timer.
    (WebCore::PluginHalter::didStopPlugin):
    Remove the plug-in from the set.
    (WebCore::PluginHalter::timerFired):
    Find the cut-off time as the current time minus the allowed run time;
    plug-ins older than this may be halted. Iterate over the plug-ins. Find
    the object with the oldest start time that is too young to be halted;
    we'll use its start time to set the timer's next fire time. For all
    plug-ins that are candidates to be halted, call the
    PluginHalterClient's shouldHaltPlugin(). If this function returns true,
    call the plug-in's halt() function. Remove these objects from the set
    of tracked plug-ins. Call startTimerIfNecessary() to restart the timer.
    (WebCore::PluginHalter::startTimerIfNecessary):
    If the timer is set to fire, or the set of tracked plug-ins is empty,
    return early. Set the timer to fire after the oldest plug-in has run
    for the allowed run time.
    
    * page/PluginHalter.h: Added.
    (WebCore::PluginHalter::setPluginAllowedRunTime):
    
    * page/PluginHalterClient.h: Added.
    (WebCore::PluginHalterClient::~PluginHalterClient)
    
    * page/Page.cpp:
    (WebCore::Page::Page):
    Initialize m_pluginHalterClient. Call pluginHalterEnabledStateChanged()
    to create the PluginHalter if necessary.
    (WebCore::Page::pluginHalterEnabledStateChanged):
    If plug-in halting is enabled, create the PluginHalter. If it is
    disabled, clear it.
    (WebCore::Page::pluginAllowedRunTimeChanged):
    If there is a plug-in halter, call its setPluginAllowedRunTime().
    (WebCore::Page::didStartPlugin):
    If there is a plug-in halter, call its didStartPlugin().
    (WebCore::Page::didStopPlugin):
    If there is a plug-in halter, call its didStopPlugin().
    
    * page/Page.h:
    Add a parameter to the Page constructor for the PluginHalterClient.
    Added declarations for didStartPlugin() and didStopPlugin(), which are
    called when HaltablePlugins are added to or removed from the page. Adds
    pluginAllowedRunTimeChanged() and pluginHalterEnabledStateChanged() to
    notify the Page when these settings are changed. Added members to hold
    the PluginHalter and the PluginHalterClient.
    
    * page/Settings.cpp:
    (WebCore::Settings::Settings):
    (WebCore::Settings::setPluginHalterEnabled):
    If the enabled state has changed, call the Page's
    pluginHalterEnabledStateChanged().
    (WebCore::Settings::setPluginAllowedRunTime):
    Call the Page's pluginAllowedRunTimeChanged().
    
    * page/Settings.h:
    (WebCore::Settings::pluginHalterEnabled):
    (WebCore::Settings::pluginAllowedRunTime):
    
    * page/HaltablePlugin.h: Added. Defines an interface for plug-ins that
    can be automatically halted.
    (WebCore::HaltablePlugin::~HaltablePlugin)
    
    * svg/graphics/SVGImage.cpp:
    (WebCore::SVGImage::dataChanged):
    Pass a dummy PluginHalterClient.
    
    WebKit/gtk/:
    
    * webkit/webkitwebview.cpp:
    (webkit_web_view_init):
    Pass 0 for new Page constructor argument.
    
    WebKit/mac/:
    
    * WebView/WebView.mm:
    (-[WebView _commonInitializationWithFrameName:groupName:usesDocumentViews:]):
    Pass 0 for new Page constructor argument.
    
    WebKit/qt/:
    
    * Api/qwebpage.cpp:
    (QWebPagePrivate::QWebPagePrivate):
    Pass 0 for new Page constructor argument.
    
    WebKit/win:
    
    * Interfaces/IWebPluginHalterDelegate.idl: Added. Defines an interface
    for a delegate that determines whether plug-ins should be halted.
    
    * Interfaces/IWebPreferencesPrivate.idl:
    Declare functions to get and set the enabled state of the plug-in
    halter and the plug-in allowed run time.
    
    * Interfaces/IWebViewPrivate.idl:
    Declare functions to get and set the IWebPluginHalterDelegate.
    
    * Interfaces/WebKit.idl:
    
    * WebCoreSupport/WebPluginHalterClient.cpp: Added.
    (WebPluginHalterClient::WebPluginHalterClient):
    (WebPluginHalterClient::shouldHaltPlugin):
    Get the IWebPluginHalterDelegate for the WebView. Create a WebKit
    DOMNode for the WebCore Node. Call the delegate's shouldHaltPlugin().
    If the call fails, return false. Otherwise, return the result of the
    call.
    
    * WebCoreSupport/WebPluginHalterClient.h: Added.
    
    * WebKit.vcproj/Interfaces.vcproj:
    Add IWebPluginHalterDelegate.idl.
    
    * WebKit.vcproj/WebKit.vcproj:
    Add WebPluginHalterClient.{h,cpp}.
    
    * WebPreferenceKeysPrivate.h:
    Define WebKitPluginHalterEnabledPreferenceKey and
    WebKitPluginAllowedRunTimePreferenceKey.
    
    * WebPreferences.cpp:
    (WebPreferences::initializeDefaultSettings):
    Leave plug-in halting disabled by default. Set the default value for
    the plug-in allowed run time to the max value of an unsigned int.
    (WebPreferences::setPluginHalterEnabled):
    (WebPreferences::pluginHalterEnabled):
    (WebPreferences::setPluginAllowedRunTime):
    (WebPreferences::pluginAllowedRunTime):
    
    * WebPreferences.h:
    
    * WebView.cpp:
    (WebView::close):
    Clear the IWebPluginHalterDelegate.
    (WebView::initWithFrame):
    Pass a WebPluginHalterClient when creating the Page.
    (WebView::notifyPreferencesChanged):
    Set the new settings when the preferences changed notification is
    received.
    (WebView::setPluginHalterDelegate):
    (WebView::pluginHalterDelegate):
    
    * WebView.h:
    Declare overrides of setPluginHalterDelegate() and
    pluginHalterDelegate(). Added a member to track the
    IWebPluginHalterDelegate.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@48748 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 3102cb2..73313e0 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,99 @@
+2009-09-24  Jon Honeycutt  <jhoneycutt at apple.com>
+
+        Add a mechanism for automatically halting plug-ins.
+
+        Reviewed by Oliver Hunt and Alice Liu.
+
+        * GNUmakefile.am:
+
+        * WebCore.base.exp:
+        Update export of Page constructor.
+
+        * WebCore.gypi:
+
+        * WebCore.pro:
+
+        * WebCore.vcproj/WebCore.vcproj:
+        Add PluginHalter.{h,cpp}, PluginHalterClient.h, and
+        HaltablePlugin.h.
+
+        * WebCore.xcodeproj/project.pbxproj:
+        Add files to Mac project.
+
+        * loader/EmptyClients.h:
+        Added an empty PluginHalterClient.
+        (WebCore::EmptyPluginHalterClient::shouldHaltPlugin):
+        Return false.
+
+        * page/PluginHalter.cpp: Added.
+        (WebCore::PluginHalter::PluginHalter):
+        (WebCore::PluginHalter::didStartPlugin):
+        Add the object to the plug-in set. If this is the only item in the set,
+        set m_oldestStartTime to this object's time, and start the timer.
+        (WebCore::PluginHalter::didStopPlugin):
+        Remove the plug-in from the set.
+        (WebCore::PluginHalter::timerFired):
+        Find the cut-off time as the current time minus the allowed run time;
+        plug-ins older than this may be halted. Iterate over the plug-ins. Find
+        the object with the oldest start time that is too young to be halted;
+        we'll use its start time to set the timer's next fire time. For all
+        plug-ins that are candidates to be halted, call the
+        PluginHalterClient's shouldHaltPlugin(). If this function returns true,
+        call the plug-in's halt() function. Remove these objects from the set
+        of tracked plug-ins. Call startTimerIfNecessary() to restart the timer.
+        (WebCore::PluginHalter::startTimerIfNecessary):
+        If the timer is set to fire, or the set of tracked plug-ins is empty,
+        return early. Set the timer to fire after the oldest plug-in has run
+        for the allowed run time.
+
+        * page/PluginHalter.h: Added.
+        (WebCore::PluginHalter::setPluginAllowedRunTime):
+
+        * page/PluginHalterClient.h: Added.
+        (WebCore::PluginHalterClient::~PluginHalterClient):
+
+        * page/Page.cpp:
+        (WebCore::Page::Page):
+        Initialize m_pluginHalterClient. Call pluginHalterEnabledStateChanged()
+        to create the PluginHalter if necessary.
+        (WebCore::Page::pluginHalterEnabledStateChanged):
+        If plug-in halting is enabled, create the PluginHalter. If it is
+        disabled, clear it.
+        (WebCore::Page::pluginAllowedRunTimeChanged):
+        If there is a plug-in halter, call its setPluginAllowedRunTime().
+        (WebCore::Page::didStartPlugin):
+        If there is a plug-in halter, call its didStartPlugin().
+        (WebCore::Page::didStopPlugin):
+        If there is a plug-in halter, call its didStopPlugin().
+
+        * page/Page.h:
+        Add a parameter to the Page constructor for the PluginHalterClient.
+        Added declarations for didStartPlugin() and didStopPlugin(), which are
+        called when HaltablePlugins are added to or removed from the page. Adds
+        pluginAllowedRunTimeChanged() and pluginHalterEnabledStateChanged() to
+        notify the Page when these settings are changed. Added members to hold
+        the PluginHalter and the PluginHalterClient.
+
+        * page/Settings.cpp:
+        (WebCore::Settings::Settings):
+        (WebCore::Settings::setPluginHalterEnabled):
+        If the enabled state has changed, call the Page's
+        pluginHalterEnabledStateChanged().
+        (WebCore::Settings::setPluginAllowedRunTime):
+        Call the Page's pluginAllowedRunTimeChanged().
+
+        * page/Settings.h:
+        (WebCore::Settings::pluginHalterEnabled):
+        (WebCore::Settings::pluginAllowedRunTime):
+
+        * page/HaltablePlugin.h: Added. Defines an interface for plug-ins that
+        can be automatically halted.
+        (WebCore::HaltablePlugin::~HaltablePlugin):
+
+        * svg/graphics/SVGImage.cpp:
+        (WebCore::SVGImage::dataChanged):
+        Pass a dummy PluginHalterClient.
+
 2009-09-24  Simon Fraser  <simon.fraser at apple.com>
 
         Reviewed by Dan Bernstein.
diff --git a/WebCore/GNUmakefile.am b/WebCore/GNUmakefile.am
index f633b8f..ee3a0d4 100644
--- a/WebCore/GNUmakefile.am
+++ b/WebCore/GNUmakefile.am
@@ -1314,6 +1314,7 @@ webcore_sources += \
 	WebCore/page/Geolocation.cpp \
 	WebCore/page/Geolocation.h \
 	WebCore/page/Geoposition.h \
+	WebCore/page/HaltablePlugin.h \
 	WebCore/page/History.cpp \
 	WebCore/page/History.h \
 	WebCore/page/Location.cpp \
@@ -1332,6 +1333,9 @@ webcore_sources += \
 	WebCore/page/PageGroup.h \
   WebCore/page/PageGroupLoadDeferrer.cpp \
   WebCore/page/PageGroupLoadDeferrer.h \
+	WebCore/page/PluginHalter.cpp \
+	WebCore/page/PluginHalter.h \
+	WebCore/page/PluginHalterClient.h \
 	WebCore/page/PositionCallback.h \
 	WebCore/page/PositionError.h \
 	WebCore/page/PositionErrorCallback.h \
diff --git a/WebCore/WebCore.base.exp b/WebCore/WebCore.base.exp
index c37d6bf..a229b06 100644
--- a/WebCore/WebCore.base.exp
+++ b/WebCore/WebCore.base.exp
@@ -487,7 +487,7 @@ __ZN7WebCore4Page6goBackEv
 __ZN7WebCore4Page8goToItemEPNS_11HistoryItemENS_13FrameLoadTypeE
 __ZN7WebCore4Page9goForwardEv
 __ZN7WebCore4Page9initGroupEv
-__ZN7WebCore4PageC1EPNS_12ChromeClientEPNS_17ContextMenuClientEPNS_12EditorClientEPNS_10DragClientEPNS_15InspectorClientE
+__ZN7WebCore4PageC1EPNS_12ChromeClientEPNS_17ContextMenuClientEPNS_12EditorClientEPNS_10DragClientEPNS_15InspectorClientEPNS_18PluginHalterClientE
 __ZN7WebCore4PageD1Ev
 __ZN7WebCore4coreEP20NSURLProtectionSpace
 __ZN7WebCore5Cache11setDisabledEb
diff --git a/WebCore/WebCore.gypi b/WebCore/WebCore.gypi
index 758d99d..1bef8cf 100644
--- a/WebCore/WebCore.gypi
+++ b/WebCore/WebCore.gypi
@@ -1667,6 +1667,7 @@
             'page/Geolocation.cpp',
             'page/Geolocation.h',
             'page/Geoposition.h',
+            'page/HaltablePlugin.h',
             'page/History.cpp',
             'page/History.h',
             'page/Location.cpp',
@@ -1685,6 +1686,9 @@
             'page/PageGroup.h',
             'page/PageGroupLoadDeferrer.cpp',
             'page/PageGroupLoadDeferrer.h',
+            'page/PluginHalter.cpp',
+            'page/PluginHalter.h',
+            'page/PluginHalterClient.h',
             'page/PositionCallback.h',
             'page/PositionError.h',
             'page/PositionErrorCallback.h',
diff --git a/WebCore/WebCore.pro b/WebCore/WebCore.pro
index 3782592..c16c6d1 100644
--- a/WebCore/WebCore.pro
+++ b/WebCore/WebCore.pro
@@ -1137,6 +1137,7 @@ SOURCES += \
     page/Page.cpp \
     page/PageGroup.cpp \
     page/PageGroupLoadDeferrer.cpp \
+    page/PluginHalter.cpp \
     page/PrintContext.cpp \
     page/SecurityOrigin.cpp \
     page/Screen.cpp \
@@ -1811,6 +1812,7 @@ HEADERS += \
     page/FrameView.h \
     page/Geolocation.h \
     page/Geoposition.h \
+    page/HaltablePlugin.h \
     page/History.h \
     page/Location.h \
     page/MouseEventWithHitTestResults.h \
@@ -1819,6 +1821,8 @@ HEADERS += \
     page/PageGroup.h \
     page/PageGroupLoadDeferrer.h \
     page/Page.h \
+    page/PluginHalter.h \
+    page/PluginHalterClient.h \
     page/PrintContext.h \
     page/Screen.h \
     page/SecurityOrigin.h \
diff --git a/WebCore/WebCore.vcproj/WebCore.vcproj b/WebCore/WebCore.vcproj/WebCore.vcproj
index 21f8ad3..6cb0b7e 100644
--- a/WebCore/WebCore.vcproj/WebCore.vcproj
+++ b/WebCore/WebCore.vcproj/WebCore.vcproj
@@ -16933,6 +16933,10 @@
 				>
 			</File>
 			<File
+				RelativePath="..\page\HaltablePlugin.h"
+				>
+			</File>
+			<File
 				RelativePath="..\page\History.cpp"
 				>
 			</File>
@@ -17021,6 +17025,18 @@
 				>
 			</File>
 			<File
+				RelativePath="..\page\PluginHalter.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\page\PluginHalter.h"
+				>
+			</File>
+			<File
+				RelativePath="..\page\PluginHalterClient.h"
+				>
+			</File>
+			<File
 				RelativePath="..\page\PositionCallback.h"
 				>
 			</File>
diff --git a/WebCore/WebCore.xcodeproj/project.pbxproj b/WebCore/WebCore.xcodeproj/project.pbxproj
index 6cf8775..5113f68 100644
--- a/WebCore/WebCore.xcodeproj/project.pbxproj
+++ b/WebCore/WebCore.xcodeproj/project.pbxproj
@@ -1194,6 +1194,10 @@
 		75793ED50D0CE85B007FC0AC /* DOMMessageEventInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 75793ED20D0CE85B007FC0AC /* DOMMessageEventInternal.h */; };
 		75A94A03104B74FB0006673C /* TimelineItem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 75A94A01104B74FB0006673C /* TimelineItem.cpp */; };
 		75A94A04104B74FB0006673C /* TimelineItem.h in Headers */ = {isa = PBXBuildFile; fileRef = 75A94A02104B74FB0006673C /* TimelineItem.h */; };
+		7693BAD2106C2DCA007B0823 /* HaltablePlugin.h in Headers */ = {isa = PBXBuildFile; fileRef = 7693BACE106C2DCA007B0823 /* HaltablePlugin.h */; };
+		7693BAD3106C2DCA007B0823 /* PluginHalter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7693BACF106C2DCA007B0823 /* PluginHalter.cpp */; };
+		7693BAD4106C2DCA007B0823 /* PluginHalter.h in Headers */ = {isa = PBXBuildFile; fileRef = 7693BAD0106C2DCA007B0823 /* PluginHalter.h */; };
+		7693BAD5106C2DCA007B0823 /* PluginHalterClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 7693BAD1106C2DCA007B0823 /* PluginHalterClient.h */; };
 		7A1E88F5101CC384000C4DF5 /* ScriptArray.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7A1E88F3101CC384000C4DF5 /* ScriptArray.cpp */; };
 		7A1E88F6101CC384000C4DF5 /* ScriptArray.h in Headers */ = {isa = PBXBuildFile; fileRef = 7A1E88F4101CC384000C4DF5 /* ScriptArray.h */; };
 		7A24587B1021EAF4000A00AA /* InspectorDOMAgent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7A2458791021EAF4000A00AA /* InspectorDOMAgent.cpp */; };
@@ -6432,6 +6436,10 @@
 		75793ED20D0CE85B007FC0AC /* DOMMessageEventInternal.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DOMMessageEventInternal.h; sourceTree = "<group>"; };
 		75A94A01104B74FB0006673C /* TimelineItem.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TimelineItem.cpp; sourceTree = "<group>"; };
 		75A94A02104B74FB0006673C /* TimelineItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TimelineItem.h; sourceTree = "<group>"; };
+		7693BACE106C2DCA007B0823 /* HaltablePlugin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HaltablePlugin.h; sourceTree = "<group>"; };
+		7693BACF106C2DCA007B0823 /* PluginHalter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PluginHalter.cpp; sourceTree = "<group>"; };
+		7693BAD0106C2DCA007B0823 /* PluginHalter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PluginHalter.h; sourceTree = "<group>"; };
+		7693BAD1106C2DCA007B0823 /* PluginHalterClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PluginHalterClient.h; sourceTree = "<group>"; };
 		7A1E88F3101CC384000C4DF5 /* ScriptArray.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScriptArray.cpp; sourceTree = "<group>"; };
 		7A1E88F4101CC384000C4DF5 /* ScriptArray.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptArray.h; sourceTree = "<group>"; };
 		7A2458791021EAF4000A00AA /* InspectorDOMAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorDOMAgent.cpp; sourceTree = "<group>"; };
@@ -11046,6 +11054,7 @@
 				FE80D7B90E9C1F25000D6F75 /* Geolocation.idl */,
 				FE80D7BB0E9C1F25000D6F75 /* Geoposition.h */,
 				FE80D7BC0E9C1F25000D6F75 /* Geoposition.idl */,
+				7693BACE106C2DCA007B0823 /* HaltablePlugin.h */,
 				BC94D1500C275C8B006BC617 /* History.cpp */,
 				BC94D1510C275C8B006BC617 /* History.h */,
 				BC94D1520C275C8B006BC617 /* History.idl */,
@@ -11067,6 +11076,9 @@
 				9302B0BE0D79F82C00C7EE83 /* PageGroup.h */,
 				7A674BD90F9EBF4E006CF099 /* PageGroupLoadDeferrer.cpp */,
 				7A674BDA0F9EBF4E006CF099 /* PageGroupLoadDeferrer.h */,
+				7693BACF106C2DCA007B0823 /* PluginHalter.cpp */,
+				7693BAD0106C2DCA007B0823 /* PluginHalter.h */,
+				7693BAD1106C2DCA007B0823 /* PluginHalterClient.h */,
 				FE80D7BD0E9C1F25000D6F75 /* PositionCallback.h */,
 				FE80D7BF0E9C1F25000D6F75 /* PositionError.h */,
 				FE80D7C00E9C1F25000D6F75 /* PositionError.idl */,
@@ -17880,6 +17892,9 @@
 				FABE72F71059C1EB00D999DD /* MathMLInlineContainerElement.h in Headers */,
 				FABE72F91059C1EB00D999DD /* MathMLMathElement.h in Headers */,
 				37202199106213C600F25C4B /* FontSmoothingMode.h in Headers */,
+				7693BAD2106C2DCA007B0823 /* HaltablePlugin.h in Headers */,
+				7693BAD4106C2DCA007B0823 /* PluginHalter.h in Headers */,
+				7693BAD5106C2DCA007B0823 /* PluginHalterClient.h in Headers */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -19991,6 +20006,7 @@
 				BCCE58AC1061E8CF008FB35A /* JSDatabaseCustom.cpp in Sources */,
 				BCCE58AF1061E90C008FB35A /* JSDocumentFragmentCustom.cpp in Sources */,
 				14CD8D82106B529000A46D23 /* JSSharedWorkerCustom.cpp in Sources */,
+				7693BAD3106C2DCA007B0823 /* PluginHalter.cpp in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
diff --git a/WebCore/loader/EmptyClients.h b/WebCore/loader/EmptyClients.h
index 41b6ebc..14d36f1 100644
--- a/WebCore/loader/EmptyClients.h
+++ b/WebCore/loader/EmptyClients.h
@@ -39,6 +39,7 @@
 #include "FormState.h"
 #include "FrameLoaderClient.h"
 #include "InspectorClient.h"
+#include "PluginHalterClient.h"
 #include "ResourceError.h"
 #include "SharedBuffer.h"
 
@@ -483,6 +484,12 @@ public:
     virtual void inspectorWindowObjectCleared() { }
 };
 
+class EmptyPluginHalterClient : public PluginHalterClient
+{
+public:
+    virtual bool shouldHaltPlugin(Node*) const { return false; }
+};
+
 }
 
 #endif // EmptyClients_h
diff --git a/WebCore/page/HaltablePlugin.h b/WebCore/page/HaltablePlugin.h
new file mode 100644
index 0000000..a5fe0f4
--- /dev/null
+++ b/WebCore/page/HaltablePlugin.h
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2009 Apple Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#ifndef HaltablePlugin_h
+#define HaltablePlugin_h
+
+namespace WebCore {
+
+class Node;
+
+class HaltablePlugin {
+public:
+    virtual ~HaltablePlugin() { }
+
+    virtual void halt() = 0;
+    virtual void restart() = 0;
+    virtual Node* node() const = 0;
+};
+
+} // namespace WebCore
+
+#endif // HaltablePlugin_h
diff --git a/WebCore/page/Page.cpp b/WebCore/page/Page.cpp
index 182d22c..2d0c91c 100644
--- a/WebCore/page/Page.cpp
+++ b/WebCore/page/Page.cpp
@@ -49,6 +49,7 @@
 #include "NetworkStateNotifier.h"
 #include "PageGroup.h"
 #include "PluginData.h"
+#include "PluginHalter.h"
 #include "ProgressTracker.h"
 #include "RenderWidget.h"
 #include "RenderTheme.h"
@@ -99,7 +100,7 @@ static void networkStateChanged()
         frames[i]->document()->dispatchWindowEvent(Event::create(eventName, false, false));
 }
 
-Page::Page(ChromeClient* chromeClient, ContextMenuClient* contextMenuClient, EditorClient* editorClient, DragClient* dragClient, InspectorClient* inspectorClient)
+Page::Page(ChromeClient* chromeClient, ContextMenuClient* contextMenuClient, EditorClient* editorClient, DragClient* dragClient, InspectorClient* inspectorClient, PluginHalterClient* pluginHalterClient)
     : m_chrome(new Chrome(this, chromeClient))
     , m_dragCaretController(new SelectionController(0, true))
 #if ENABLE(DRAG_SUPPORT)
@@ -135,6 +136,7 @@ Page::Page(ChromeClient* chromeClient, ContextMenuClient* contextMenuClient, Edi
     , m_customHTMLTokenizerTimeDelay(-1)
     , m_customHTMLTokenizerChunkSize(-1)
     , m_canStartPlugins(true)
+    , m_pluginHalterClient(pluginHalterClient)
 {
 #if !ENABLE(CONTEXT_MENUS)
     UNUSED_PARAM(contextMenuClient);
@@ -154,6 +156,8 @@ Page::Page(ChromeClient* chromeClient, ContextMenuClient* contextMenuClient, Edi
     ASSERT(!allPages->contains(this));
     allPages->add(this);
 
+    pluginHalterEnabledStateChanged();
+
 #if ENABLE(JAVASCRIPT_DEBUGGER)
     JavaScriptDebugServer::shared().pageCreated(this);
 #endif
@@ -679,4 +683,32 @@ InspectorTimelineAgent* Page::inspectorTimelineAgent() const
 }
 #endif
 
+void Page::pluginHalterEnabledStateChanged()
+{
+    if (m_settings->pluginHalterEnabled()) {
+        ASSERT(!m_pluginHalter);
+        m_pluginHalter.set(new PluginHalter(m_pluginHalterClient));
+        m_pluginHalter->setPluginAllowedRunTime(m_settings->pluginAllowedRunTime());
+    } else
+        m_pluginHalter = 0;
+}
+
+void Page::pluginAllowedRunTimeChanged()
+{
+    if (m_pluginHalter)
+        m_pluginHalter->setPluginAllowedRunTime(m_settings->pluginAllowedRunTime());
+}
+
+void Page::didStartPlugin(HaltablePlugin* obj)
+{
+    if (m_pluginHalter)
+        m_pluginHalter->didStartPlugin(obj);
+}
+
+void Page::didStopPlugin(HaltablePlugin* obj)
+{
+    if (m_pluginHalter)
+        m_pluginHalter->didStopPlugin(obj);
+}
+
 } // namespace WebCore
diff --git a/WebCore/page/Page.h b/WebCore/page/Page.h
index d3f7ddb..602d99b 100644
--- a/WebCore/page/Page.h
+++ b/WebCore/page/Page.h
@@ -54,12 +54,15 @@ namespace WebCore {
     class EditorClient;
     class FocusController;
     class Frame;
+    class HaltablePlugin;
     class InspectorClient;
     class InspectorController;
     class InspectorTimelineAgent;
     class Node;
     class PageGroup;
     class PluginData;
+    class PluginHalter;
+    class PluginHalterClient;
     class PluginView;
     class ProgressTracker;
     class RenderTheme;
@@ -82,7 +85,7 @@ namespace WebCore {
     public:
         static void setNeedsReapplyStyles();
 
-        Page(ChromeClient*, ContextMenuClient*, EditorClient*, DragClient*, InspectorClient*);
+        Page(ChromeClient*, ContextMenuClient*, EditorClient*, DragClient*, InspectorClient*, PluginHalterClient*);
         ~Page();
 
         RenderTheme* theme() const { return m_theme.get(); };
@@ -181,6 +184,11 @@ namespace WebCore {
         void userStyleSheetLocationChanged();
         const String& userStyleSheet() const;
 
+        void didStartPlugin(HaltablePlugin*);
+        void didStopPlugin(HaltablePlugin*);
+        void pluginAllowedRunTimeChanged();
+        void pluginHalterEnabledStateChanged();
+
         static void setDebuggerForAllPages(JSC::Debugger*);
         void setDebugger(JSC::Debugger*);
         JSC::Debugger* debugger() const { return m_debugger; }
@@ -284,6 +292,9 @@ namespace WebCore {
         bool m_canStartPlugins;
         HashSet<PluginView*> m_unstartedPlugins;
 
+        OwnPtr<PluginHalter> m_pluginHalter;
+        PluginHalterClient* m_pluginHalterClient;
+
 #if ENABLE(DOM_STORAGE)
         RefPtr<StorageNamespace> m_sessionStorage;
 #endif
diff --git a/WebCore/page/PluginHalter.cpp b/WebCore/page/PluginHalter.cpp
new file mode 100644
index 0000000..8025337
--- /dev/null
+++ b/WebCore/page/PluginHalter.cpp
@@ -0,0 +1,112 @@
+/*
+ * Copyright (C) 2009 Apple Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#include "config.h"
+
+#include "PluginHalter.h"
+
+#include "HaltablePlugin.h"
+#include "PluginHalterClient.h"
+#include <wtf/CurrentTime.h>
+#include <wtf/Vector.h>
+
+using namespace std;
+
+namespace WebCore {
+
+PluginHalter::PluginHalter(PluginHalterClient* client)
+    : m_client(client)
+    , m_timer(this, &PluginHalter::timerFired)
+    , m_pluginAllowedRunTime(numeric_limits<unsigned>::max())
+{
+    ASSERT_ARG(client, client);
+}
+
+void PluginHalter::didStartPlugin(HaltablePlugin* obj)
+{
+    ASSERT_ARG(obj, obj);
+    ASSERT_ARG(obj, !m_plugins.contains(obj));
+
+    double currentTime = WTF::currentTime();
+
+    m_plugins.add(obj, currentTime);
+
+    if (m_plugins.size() == 1)
+        m_oldestStartTime = currentTime;
+
+    startTimerIfNecessary();
+}
+
+void PluginHalter::didStopPlugin(HaltablePlugin* obj)
+{
+    m_plugins.remove(obj);
+}
+
+void PluginHalter::timerFired(Timer<PluginHalter>*)
+{
+    if (m_plugins.isEmpty())
+        return;
+
+    Vector<HaltablePlugin*> plugins;
+    copyKeysToVector(m_plugins, plugins);
+
+    // Plug-ins older than this are candidates to be halted.
+    double pluginCutOffTime = WTF::currentTime() - m_pluginAllowedRunTime;
+
+    m_oldestStartTime = numeric_limits<double>::max();
+
+    for (size_t i = 0; i < plugins.size(); ++i) {
+        double thisStartTime = m_plugins.get(plugins[i]);
+        if (thisStartTime > pluginCutOffTime) {
+            // This plug-in is too young to be halted. We find the oldest
+            // plug-in that is not old enough to be halted and use it to set
+            // the timer's next fire time.
+            if (thisStartTime < m_oldestStartTime)
+                m_oldestStartTime = thisStartTime;
+            continue;
+        }
+
+        if (m_client->shouldHaltPlugin(plugins[i]->node()))
+            plugins[i]->halt();
+
+        m_plugins.remove(plugins[i]);
+    }
+
+    startTimerIfNecessary();
+}
+
+void PluginHalter::startTimerIfNecessary()
+{
+    if (m_timer.isActive())
+        return;
+
+    if (m_plugins.isEmpty())
+        return;
+
+    double nextFireInterval = static_cast<double>(m_pluginAllowedRunTime) - (currentTime() - m_oldestStartTime);
+    m_timer.startOneShot(nextFireInterval < 0 ? 0 : nextFireInterval);
+}
+
+} // namespace WebCore
diff --git a/WebCore/page/PluginHalter.h b/WebCore/page/PluginHalter.h
new file mode 100644
index 0000000..26f5101
--- /dev/null
+++ b/WebCore/page/PluginHalter.h
@@ -0,0 +1,59 @@
+/*
+ * Copyright (C) 2009 Apple Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#ifndef PluginHalter_h
+#define PluginHalter_h
+
+#include "Timer.h"
+#include <wtf/HashMap.h>
+
+namespace WebCore {
+
+class HaltablePlugin;
+class PluginHalterClient;
+
+class PluginHalter {
+public:
+    PluginHalter(PluginHalterClient*);
+
+    void didStartPlugin(HaltablePlugin*);
+    void didStopPlugin(HaltablePlugin*);
+
+    void setPluginAllowedRunTime(unsigned runTime) { m_pluginAllowedRunTime = runTime; }
+
+private:
+    void timerFired(Timer<PluginHalter>*);
+    void startTimerIfNecessary();
+
+    PluginHalterClient* m_client;
+    Timer<PluginHalter> m_timer;
+    unsigned m_pluginAllowedRunTime;
+    double m_oldestStartTime;
+    HashMap<HaltablePlugin*, double> m_plugins;
+};
+
+} // namespace WebCore
+
+#endif // PluginHalter_h
diff --git a/WebCore/page/PluginHalterClient.h b/WebCore/page/PluginHalterClient.h
new file mode 100644
index 0000000..7ea460a
--- /dev/null
+++ b/WebCore/page/PluginHalterClient.h
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2009 Apple Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#ifndef PluginHalterClient_h
+#define PluginHalterClient_h
+
+namespace WebCore {
+
+class Node;
+
+class PluginHalterClient {
+public:
+    virtual ~PluginHalterClient() { }
+
+    virtual bool shouldHaltPlugin(Node*) const = 0;
+};
+
+} // namespace WebCore
+
+#endif // PluginHalterClient_h
diff --git a/WebCore/page/Settings.cpp b/WebCore/page/Settings.cpp
index 2f3afed..708d595 100644
--- a/WebCore/page/Settings.cpp
+++ b/WebCore/page/Settings.cpp
@@ -61,6 +61,7 @@ Settings::Settings(Page* page)
     , m_defaultFontSize(0)
     , m_defaultFixedFontSize(0)
     , m_maximumDecodedImageSize(numeric_limits<size_t>::max())
+    , m_pluginAllowedRunTime(numeric_limits<unsigned>::max())
     , m_isJavaEnabled(false)
     , m_loadsImagesAutomatically(false)
     , m_privateBrowsingEnabled(false)
@@ -115,6 +116,7 @@ Settings::Settings(Page* page)
     , m_xssAuditorEnabled(false)
     , m_acceleratedCompositingEnabled(true)
     , m_experimentalNotificationsEnabled(false)
+    , m_pluginHalterEnabled(false)
 {
     // A Frame may not have been created yet, so we initialize the AtomicString 
     // hash before trying to use it.
@@ -503,6 +505,22 @@ void Settings::setExperimentalNotificationsEnabled(bool enabled)
     m_experimentalNotificationsEnabled = enabled;
 }
 
+void Settings::setPluginHalterEnabled(bool enabled)
+{
+    if (m_pluginHalterEnabled == enabled)
+        return;
+
+    m_pluginHalterEnabled = enabled;
+
+    m_page->pluginHalterEnabledStateChanged();
+}
+
+void Settings::setPluginAllowedRunTime(unsigned runTime)
+{
+    m_pluginAllowedRunTime = runTime;
+    m_page->pluginAllowedRunTimeChanged();
+}
+
 #if PLATFORM(WIN) || (PLATFORM(WIN_OS) && PLATFORM(WX))
 void Settings::setShouldUseHighResolutionTimers(bool shouldUseHighResolutionTimers)
 {
diff --git a/WebCore/page/Settings.h b/WebCore/page/Settings.h
index 3fdf95b..b3daf19 100644
--- a/WebCore/page/Settings.h
+++ b/WebCore/page/Settings.h
@@ -261,6 +261,12 @@ namespace WebCore {
         static bool shouldUseHighResolutionTimers() { return gShouldUseHighResolutionTimers; }
 #endif
 
+        void setPluginHalterEnabled(bool);
+        bool pluginHalterEnabled() const { return m_pluginHalterEnabled; }
+
+        void setPluginAllowedRunTime(unsigned);
+        unsigned pluginAllowedRunTime() const { return m_pluginAllowedRunTime; }
+
     private:
         Page* m_page;
         
@@ -281,6 +287,7 @@ namespace WebCore {
         int m_defaultFontSize;
         int m_defaultFixedFontSize;
         size_t m_maximumDecodedImageSize;
+        unsigned m_pluginAllowedRunTime;
         bool m_isJavaEnabled : 1;
         bool m_loadsImagesAutomatically : 1;
         bool m_privateBrowsingEnabled : 1;
@@ -326,6 +333,7 @@ namespace WebCore {
         bool m_xssAuditorEnabled : 1;
         bool m_acceleratedCompositingEnabled : 1;
         bool m_experimentalNotificationsEnabled : 1;
+        bool m_pluginHalterEnabled : 1;
 
 #if USE(SAFARI_THEME)
         static bool gShouldPaintNativeControls;
diff --git a/WebCore/svg/graphics/SVGImage.cpp b/WebCore/svg/graphics/SVGImage.cpp
index e301c86..bb68b82 100644
--- a/WebCore/svg/graphics/SVGImage.cpp
+++ b/WebCore/svg/graphics/SVGImage.cpp
@@ -239,13 +239,14 @@ bool SVGImage::dataChanged(bool allDataReceived)
         static DragClient* dummyDragClient = 0;
 #endif
         static InspectorClient* dummyInspectorClient = new EmptyInspectorClient;
+        static PluginHalterClient* dummyPluginHalterClient = new EmptyPluginHalterClient;
 
         m_chromeClient.set(new SVGImageChromeClient(this));
         
         // FIXME: If this SVG ends up loading itself, we might leak the world.
         // THe comment said that the Cache code does not know about CachedImages
         // holding Frames and won't know to break the cycle. But 
-        m_page.set(new Page(m_chromeClient.get(), dummyContextMenuClient, dummyEditorClient, dummyDragClient, dummyInspectorClient));
+        m_page.set(new Page(m_chromeClient.get(), dummyContextMenuClient, dummyEditorClient, dummyDragClient, dummyInspectorClient, dummyPluginHalterClient));
         m_page->settings()->setJavaScriptEnabled(false);
         m_page->settings()->setPluginsEnabled(false);
 
diff --git a/WebKit/gtk/ChangeLog b/WebKit/gtk/ChangeLog
index ed38818..d662e20 100644
--- a/WebKit/gtk/ChangeLog
+++ b/WebKit/gtk/ChangeLog
@@ -1,3 +1,11 @@
+2009-09-24  Jon Honeycutt  <jhoneycutt at apple.com>
+
+        Reviewed by Alice Liu.
+
+        * webkit/webkitwebview.cpp:
+        (webkit_web_view_init):
+        Pass 0 for new Page constructor argument.
+
 2009-09-24  Xan Lopez  <xlopez at igalia.com>
 
         Reviewed by Gustavo Noronha and Jan Alonzo.
diff --git a/WebKit/gtk/webkit/webkitwebview.cpp b/WebKit/gtk/webkit/webkitwebview.cpp
index 0428ddb..988d01f 100644
--- a/WebKit/gtk/webkit/webkitwebview.cpp
+++ b/WebKit/gtk/webkit/webkitwebview.cpp
@@ -2533,7 +2533,7 @@ static void webkit_web_view_init(WebKitWebView* webView)
     priv->imContext = gtk_im_multicontext_new();
 
     WebKit::InspectorClient* inspectorClient = new WebKit::InspectorClient(webView);
-    priv->corePage = new Page(new WebKit::ChromeClient(webView), new WebKit::ContextMenuClient(webView), new WebKit::EditorClient(webView), new WebKit::DragClient(webView), inspectorClient);
+    priv->corePage = new Page(new WebKit::ChromeClient(webView), new WebKit::ContextMenuClient(webView), new WebKit::EditorClient(webView), new WebKit::DragClient(webView), inspectorClient, 0);
 
     // We also add a simple wrapper class to provide the public
     // interface for the Web Inspector.
diff --git a/WebKit/mac/ChangeLog b/WebKit/mac/ChangeLog
index 20e6a9d..7f97f0c 100644
--- a/WebKit/mac/ChangeLog
+++ b/WebKit/mac/ChangeLog
@@ -1,3 +1,11 @@
+2009-09-24  Jon Honeycutt  <jhoneycutt at apple.com>
+
+        Reviewed by Alice Liu.
+
+        * WebView/WebView.mm:
+        (-[WebView _commonInitializationWithFrameName:groupName:usesDocumentViews:]):
+        Pass 0 for new Page constructor argument.
+
 2009-09-14  John Gregg  <johnnyg at google.com>
 
         Reviewed by Eric Seidel.
diff --git a/WebKit/mac/WebView/WebView.mm b/WebKit/mac/WebView/WebView.mm
index 0fab365..7d445eb 100644
--- a/WebKit/mac/WebView/WebView.mm
+++ b/WebKit/mac/WebView/WebView.mm
@@ -619,7 +619,7 @@ static bool runningTigerMail()
         didOneTimeInitialization = true;
     }
 
-    _private->page = new Page(new WebChromeClient(self), new WebContextMenuClient(self), new WebEditorClient(self), new WebDragClient(self), new WebInspectorClient(self));
+    _private->page = new Page(new WebChromeClient(self), new WebContextMenuClient(self), new WebEditorClient(self), new WebDragClient(self), new WebInspectorClient(self), 0);
 
     _private->page->settings()->setLocalStorageDatabasePath([[self preferences] _localStorageDatabasePath]);
 
diff --git a/WebKit/qt/Api/qwebpage.cpp b/WebKit/qt/Api/qwebpage.cpp
index a6942a4..aad718b 100644
--- a/WebKit/qt/Api/qwebpage.cpp
+++ b/WebKit/qt/Api/qwebpage.cpp
@@ -271,7 +271,7 @@ QWebPagePrivate::QWebPagePrivate(QWebPage *qq)
     contextMenuClient = new ContextMenuClientQt();
     editorClient = new EditorClientQt(q);
     page = new Page(chromeClient, contextMenuClient, editorClient,
-                    new DragClientQt(q), new InspectorClientQt(q));
+                    new DragClientQt(q), new InspectorClientQt(q), 0);
 
     // ### should be configurable
     page->settings()->setDefaultTextEncodingName("iso-8859-1");
diff --git a/WebKit/qt/ChangeLog b/WebKit/qt/ChangeLog
index 7020ec0..bfd0537 100644
--- a/WebKit/qt/ChangeLog
+++ b/WebKit/qt/ChangeLog
@@ -1,3 +1,11 @@
+2009-09-24  Jon Honeycutt  <jhoneycutt at apple.com>
+
+        Reviewed by Alice Liu.
+
+        * Api/qwebpage.cpp:
+        (QWebPagePrivate::QWebPagePrivate):
+        Pass 0 for new Page constructor argument.
+
 2009-09-24  Martin Smith  <msmith at trolltech.com>
 
         Reviewed by Simon Hausmann.
diff --git a/WebKit/win/ChangeLog b/WebKit/win/ChangeLog
index 1551499..34adfff 100644
--- a/WebKit/win/ChangeLog
+++ b/WebKit/win/ChangeLog
@@ -1,3 +1,68 @@
+2009-09-24  Jon Honeycutt  <jhoneycutt at apple.com>
+
+        Add a mechanism for automatically halting plug-ins.
+
+        Reviewed by Oliver Hunt.
+
+        * Interfaces/IWebPluginHalterDelegate.idl: Added. Defines an interface
+        for a delegate that determines whether plug-ins should be halted.
+
+        * Interfaces/IWebPreferencesPrivate.idl:
+        Declare functions to get and set the enabled state of the plug-in
+        halter and the plug-in allowed run time.
+
+        * Interfaces/IWebViewPrivate.idl:
+        Declare functions to get and set the IWebPluginHalterDelegate.
+
+        * Interfaces/WebKit.idl:
+
+        * WebCoreSupport/WebPluginHalterClient.cpp: Added.
+        (WebPluginHalterClient::WebPluginHalterClient):
+        (WebPluginHalterClient::shouldHaltPlugin):
+        Get the IWebPluginHalterDelegate for the WebView. Create a WebKit
+        DOMNode for the WebCore Node. Call the delegate's shouldHaltPlugin().
+        If the call fails, return false. Otherwise, return the result of the
+        call.
+
+        * WebCoreSupport/WebPluginHalterClient.h: Added.
+
+        * WebKit.vcproj/Interfaces.vcproj:
+        Add IWebPluginHalterDelegate.idl.
+
+        * WebKit.vcproj/WebKit.vcproj:
+        Add WebPluginHalterClient.{h,cpp}.
+
+        * WebPreferenceKeysPrivate.h:
+        Define WebKitPluginHalterEnabledPreferenceKey and
+        WebKitPluginAllowedRunTimePreferenceKey.
+
+        * WebPreferences.cpp:
+        (WebPreferences::initializeDefaultSettings):
+        Leave plug-in halting disabled by default. Set the default value for
+        the plug-in allowed run time to the max value of an unsigned int.
+        (WebPreferences::setPluginHalterEnabled):
+        (WebPreferences::pluginHalterEnabled):
+        (WebPreferences::setPluginAllowedRunTime):
+        (WebPreferences::pluginAllowedRunTime):
+
+        * WebPreferences.h:
+
+        * WebView.cpp:
+        (WebView::close):
+        Clear the IWebPluginHalterDelegate.
+        (WebView::initWithFrame):
+        Pass a WebPluginHalterClient when creating the Page.
+        (WebView::notifyPreferencesChanged):
+        Set the new settings when the preferences changed notification is
+        received.
+        (WebView::setPluginHalterDelegate):
+        (WebView::pluginHalterDelegate):
+
+        * WebView.h:
+        Declare overrides of setPluginHalterDelegate() and
+        pluginHalterDelegate(). Added a member to track the
+        IWebPluginHalterDelegate.
+
 2009-09-14  John Gregg  <johnnyg at google.com>
 
         Reviewed by Eric Seidel.
diff --git a/WebKit/win/Interfaces/IWebPluginHalterDelegate.idl b/WebKit/win/Interfaces/IWebPluginHalterDelegate.idl
new file mode 100644
index 0000000..f79e304
--- /dev/null
+++ b/WebKit/win/Interfaces/IWebPluginHalterDelegate.idl
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2009 Apple Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#ifndef DO_NO_IMPORTS
+import "oaidl.idl";
+import "ocidl.idl";
+#endif
+
+interface IDOMNode;
+interface IWebView;
+
+[
+    object,
+    oleautomation,
+    uuid(2e0e5d9e-ffc9-4185-aa15-e66868d548ee),
+    pointer_default(unique)
+]
+interface IWebPluginHalterDelegate : IUnknown
+{
+    HRESULT shouldHaltPlugin([in] IWebView* webView, [in] IDOMNode*, [out, retval] BOOL* result);
+}
diff --git a/WebKit/win/Interfaces/IWebPreferencesPrivate.idl b/WebKit/win/Interfaces/IWebPreferencesPrivate.idl
index 8796109..e26d042 100644
--- a/WebKit/win/Interfaces/IWebPreferencesPrivate.idl
+++ b/WebKit/win/Interfaces/IWebPreferencesPrivate.idl
@@ -88,4 +88,10 @@ interface IWebPreferencesPrivate : IUnknown
     // Used to set preference specified by a test via LayoutTestController.overridePreference(..).
     // Used by DumpRenderTree.
     HRESULT setPreferenceForTest([in] BSTR key, [in] BSTR value);
+
+    HRESULT setPluginHalterEnabled([in] BOOL enabled);
+    HRESULT pluginHalterEnabled([out, retval] BOOL* enabled);
+
+    HRESULT setPluginAllowedRunTime([in] UINT allowedRunTime);
+    HRESULT pluginAllowedRunTime([out, retval] UINT* allowedRunTime);
 }
diff --git a/WebKit/win/Interfaces/IWebViewPrivate.idl b/WebKit/win/Interfaces/IWebViewPrivate.idl
index 4f1c7a5..dc4e8a7 100644
--- a/WebKit/win/Interfaces/IWebViewPrivate.idl
+++ b/WebKit/win/Interfaces/IWebViewPrivate.idl
@@ -38,6 +38,7 @@ interface IEnumTextMatches;
 interface IWebFormDelegate;
 interface IWebFrameLoadDelegatePrivate;
 interface IWebInspector;
+interface IWebPluginHalterDelegate;
 interface IWebURLRequest;
 interface IWebView;
 
@@ -184,4 +185,7 @@ interface IWebViewPrivate : IUnknown
     HRESULT addUserStyleSheetToGroup([in] BSTR groupName, [in] unsigned worldID, [in] BSTR source, [in] BSTR url, [in] unsigned patternsCount, [in, size_is(patternsCount)] BSTR* patterns);
     HRESULT removeUserContentFromGroup([in] BSTR groupName, [in] unsigned worldID);
     HRESULT removeAllUserContentFromGroup([in] BSTR groupName);
+
+    HRESULT setPluginHalterDelegate([in] IWebPluginHalterDelegate* d);
+    HRESULT pluginHalterDelegate([retval, out] IWebPluginHalterDelegate** d);
 }
diff --git a/WebKit/win/Interfaces/WebKit.idl b/WebKit/win/Interfaces/WebKit.idl
index 96009b8..a24f315 100644
--- a/WebKit/win/Interfaces/WebKit.idl
+++ b/WebKit/win/Interfaces/WebKit.idl
@@ -102,6 +102,7 @@ import "ocidl.idl";
 #include "IWebNotification.idl"
 #include "IWebNotificationCenter.idl"
 #include "IWebNotificationObserver.idl"
+#include "IWebPluginHalterDelegate.idl"
 #include "IWebPolicyDelegate.idl"
 #include "IWebPolicyDelegatePrivate.idl"
 #include "IWebPreferences.idl"
diff --git a/WebKit/win/WebCoreSupport/WebPluginHalterClient.cpp b/WebKit/win/WebCoreSupport/WebPluginHalterClient.cpp
new file mode 100644
index 0000000..aef313b
--- /dev/null
+++ b/WebKit/win/WebCoreSupport/WebPluginHalterClient.cpp
@@ -0,0 +1,58 @@
+/*
+ * Copyright (C) 2009 Apple Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#include "config.h"
+
+#include "WebPluginHalterClient.h"
+
+#include "DOMCoreClasses.h"
+#include "WebView.h"
+#include <WebCore/Node.h>
+#include <wtf/Assertions.h>
+
+using WebCore::Node;
+
+WebPluginHalterClient::WebPluginHalterClient(WebView* webView)
+    : m_webView(webView)
+{
+    ASSERT_ARG(webView, webView);
+}
+
+bool WebPluginHalterClient::shouldHaltPlugin(WebCore::Node* n) const
+{
+    ASSERT_ARG(n, n);
+
+    IWebPluginHalterDelegate* d;
+    if (FAILED(m_webView->pluginHalterDelegate(&d)) || !d)
+        return false;
+
+    COMPtr<IDOMNode> domNode(AdoptCOM, DOMNode::createInstance(n));
+
+    BOOL shouldHalt;
+    if (FAILED(d->shouldHaltPlugin(m_webView, domNode.get(), &shouldHalt)))
+        return false;
+
+    return shouldHalt;
+}
diff --git a/WebKit/win/WebCoreSupport/WebPluginHalterClient.h b/WebKit/win/WebCoreSupport/WebPluginHalterClient.h
new file mode 100644
index 0000000..1752444
--- /dev/null
+++ b/WebKit/win/WebCoreSupport/WebPluginHalterClient.h
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2009 Apple Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#ifndef WebPluginHalterClient_h
+#define WebPluginHalterClient_h
+
+#include <WebCore/PluginHalterClient.h>
+
+namespace WebCore {
+    class Node;
+}
+
+class WebView;
+
+class WebPluginHalterClient : public WebCore::PluginHalterClient {
+public:
+    WebPluginHalterClient(WebView* webView);
+
+    virtual bool shouldHaltPlugin(WebCore::Node* n) const;
+
+private:
+    WebView* m_webView;
+};
+
+#endif // WebPluginHalterClient_h
diff --git a/WebKit/win/WebKit.vcproj/Interfaces.vcproj b/WebKit/win/WebKit.vcproj/Interfaces.vcproj
index 86fb61f..61f5303 100644
--- a/WebKit/win/WebKit.vcproj/Interfaces.vcproj
+++ b/WebKit/win/WebKit.vcproj/Interfaces.vcproj
@@ -1084,6 +1084,26 @@
 			</FileConfiguration>
 		</File>
 		<File
+			RelativePath="..\Interfaces\IWebPluginHalterDelegate.idl"
+			>
+			<FileConfiguration
+				Name="Debug|Win32"
+				ExcludedFromBuild="true"
+				>
+				<Tool
+					Name="VCMIDLTool"
+				/>
+			</FileConfiguration>
+			<FileConfiguration
+				Name="Release|Win32"
+				ExcludedFromBuild="true"
+				>
+				<Tool
+					Name="VCMIDLTool"
+				/>
+			</FileConfiguration>
+		</File>
+		<File
 			RelativePath="..\Interfaces\IWebPolicyDelegate.idl"
 			>
 			<FileConfiguration
diff --git a/WebKit/win/WebKit.vcproj/WebKit.vcproj b/WebKit/win/WebKit.vcproj/WebKit.vcproj
index c7b67cf..8e19377 100644
--- a/WebKit/win/WebKit.vcproj/WebKit.vcproj
+++ b/WebKit/win/WebKit.vcproj/WebKit.vcproj
@@ -2122,6 +2122,14 @@
 				RelativePath="..\WebCoreSupport\WebInspectorDelegate.h"
 				>
 			</File>
+			<File
+				RelativePath="..\WebCoreSupport\WebPluginHalterClient.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\WebCoreSupport\WebPluginHalterClient.h"
+				>
+			</File>
 		</Filter>
 		<File
 			RelativePath="..\WebKitPrefix.cpp"
diff --git a/WebKit/win/WebPreferenceKeysPrivate.h b/WebKit/win/WebPreferenceKeysPrivate.h
index bf20648..7171cf0 100644
--- a/WebKit/win/WebPreferenceKeysPrivate.h
+++ b/WebKit/win/WebPreferenceKeysPrivate.h
@@ -127,3 +127,7 @@
 #define WebKitXSSAuditorEnabledPreferenceKey "WebKitXSSAuditorEnabled"
 
 #define WebKitUseHighResolutionTimersPreferenceKey "WebKitUseHighResolutionTimers"
+
+#define WebKitPluginHalterEnabledPreferenceKey "WebKitPluginHalterEnabled"
+
+#define WebKitPluginAllowedRunTimePreferenceKey "WebKitPluginAllowedRunTime"
diff --git a/WebKit/win/WebPreferences.cpp b/WebKit/win/WebPreferences.cpp
index c85487f..e1ba407 100644
--- a/WebKit/win/WebPreferences.cpp
+++ b/WebKit/win/WebPreferences.cpp
@@ -42,6 +42,7 @@
 #pragma warning( pop )
 
 #include <CoreFoundation/CoreFoundation.h>
+#include <limits>
 #include <shlobj.h>
 #include <shfolder.h>
 #include <tchar.h>
@@ -54,6 +55,7 @@
 #endif
 
 using namespace WebCore;
+using std::numeric_limits;
 
 static const String& oldPreferencesPath()
 {
@@ -250,6 +252,11 @@ void WebPreferences::initializeDefaultSettings()
 
     CFDictionaryAddValue(defaults, CFSTR(WebKitUseHighResolutionTimersPreferenceKey), kCFBooleanTrue);
 
+    CFDictionaryAddValue(defaults, CFSTR(WebKitPluginHalterEnabledPreferenceKey), kCFBooleanFalse);
+
+    RetainPtr<CFStringRef> pluginAllowedRunTime(AdoptCF, CFStringCreateWithFormat(0, 0, CFSTR("%u"), numeric_limits<unsigned>::max()));
+    CFDictionaryAddValue(defaults, CFSTR(WebKitPluginAllowedRunTimePreferenceKey), pluginAllowedRunTime.get());
+
     defaultSettings = defaults;
 }
 
@@ -1328,6 +1335,31 @@ HRESULT STDMETHODCALLTYPE WebPreferences::shouldUseHighResolutionTimers(BOOL* us
     return S_OK;
 }
 
+
+HRESULT STDMETHODCALLTYPE WebPreferences::setPluginHalterEnabled(BOOL enabled)
+{
+    setBoolValue(CFSTR(WebKitPluginHalterEnabledPreferenceKey), enabled);
+    return S_OK;
+}
+
+HRESULT STDMETHODCALLTYPE WebPreferences::pluginHalterEnabled(BOOL* enabled)
+{
+    *enabled = boolValueForKey(CFSTR(WebKitPluginHalterEnabledPreferenceKey));
+    return S_OK;
+}
+
+HRESULT WebPreferences::setPluginAllowedRunTime(UINT allowedRunTime)
+{
+    setIntegerValue(CFSTR(WebKitPluginAllowedRunTimePreferenceKey), allowedRunTime);
+    return S_OK;
+}
+
+HRESULT WebPreferences::pluginAllowedRunTime(UINT* allowedRunTime)
+{
+    *allowedRunTime = integerValueForKey(CFSTR(WebKitPluginAllowedRunTimePreferenceKey));
+    return S_OK;
+}
+
 HRESULT WebPreferences::setPreferenceForTest(BSTR key, BSTR value)
 {
     if (!SysStringLen(key) || !SysStringLen(value))
diff --git a/WebKit/win/WebPreferences.h b/WebKit/win/WebPreferences.h
index a0f9be5..b534277 100644
--- a/WebKit/win/WebPreferences.h
+++ b/WebKit/win/WebPreferences.h
@@ -374,6 +374,18 @@ public:
     virtual HRESULT STDMETHODCALLTYPE shouldUseHighResolutionTimers(
     /* [retval][out] */ BOOL* useHighResolutionTimers);
 
+    virtual HRESULT STDMETHODCALLTYPE setPluginHalterEnabled(
+    /* [in] */ BOOL enabled);
+
+    virtual HRESULT STDMETHODCALLTYPE pluginHalterEnabled(
+    /* [retval][out] */ BOOL* enabled);
+
+    virtual HRESULT STDMETHODCALLTYPE setPluginAllowedRunTime(
+    /* [in] */ UINT allowedRunTime);
+
+    virtual HRESULT STDMETHODCALLTYPE pluginAllowedRunTime(
+    /* [retval][out] */ UINT* allowedRunTime);
+
     virtual HRESULT STDMETHODCALLTYPE setPreferenceForTest(
     /* [in] */ BSTR key,
     /* [in] */ BSTR value);
diff --git a/WebKit/win/WebView.cpp b/WebKit/win/WebView.cpp
index 0f5a2c1..817e358 100644
--- a/WebKit/win/WebView.cpp
+++ b/WebKit/win/WebView.cpp
@@ -50,6 +50,7 @@
 #include "WebKitSystemBits.h"
 #include "WebMutableURLRequest.h"
 #include "WebNotificationCenter.h"
+#include "WebPluginHalterClient.h"
 #include "WebPreferences.h"
 #include "WindowsTouch.h"
 #pragma warning( push, 0 )
@@ -642,6 +643,7 @@ HRESULT STDMETHODCALLTYPE WebView::close()
     setResourceLoadDelegate(0);
     setUIDelegate(0);
     setFormDelegate(0);
+    setPluginHalterDelegate(0);
 
     if (m_webInspector)
         m_webInspector->webViewClosed();
@@ -2355,7 +2357,7 @@ HRESULT STDMETHODCALLTYPE WebView::initWithFrame(
     if (SUCCEEDED(m_preferences->shouldUseHighResolutionTimers(&useHighResolutionTimer)))
         Settings::setShouldUseHighResolutionTimers(useHighResolutionTimer);
 
-    m_page = new Page(new WebChromeClient(this), new WebContextMenuClient(this), new WebEditorClient(this), new WebDragClient(this), new WebInspectorClient(this));
+    m_page = new Page(new WebChromeClient(this), new WebContextMenuClient(this), new WebEditorClient(this), new WebDragClient(this), new WebInspectorClient(this), new WebPluginHalterClient(this));
 
     BSTR localStoragePath;
     if (SUCCEEDED(m_preferences->localStorageDatabasePath(&localStoragePath))) {
@@ -4434,6 +4436,17 @@ HRESULT WebView::notifyPreferencesChanged(IWebNotification* notification)
         return hr;
     settings->setShouldUseHighResolutionTimers(enabled);
 
+    hr = prefsPrivate->pluginHalterEnabled(&enabled);
+    if (FAILED(hr))
+        return hr;
+    settings->setPluginHalterEnabled(enabled);
+
+    UINT runTime;
+    hr = prefsPrivate->pluginAllowedRunTime(&runTime);
+    if (FAILED(hr))
+        return hr;
+    settings->setPluginAllowedRunTime(runTime);
+
     if (!m_closeWindowTimer.isActive())
         m_mainFrame->invalidate(); // FIXME
 
@@ -5492,6 +5505,24 @@ void WebView::downloadURL(const KURL& url)
     download->start();
 }
 
+
+HRESULT STDMETHODCALLTYPE WebView::setPluginHalterDelegate(IWebPluginHalterDelegate* d)
+{
+    m_pluginHalterDelegate = d;
+    return S_OK;
+}
+
+HRESULT STDMETHODCALLTYPE WebView::pluginHalterDelegate(IWebPluginHalterDelegate** d)
+{
+    if (!d)
+        return E_POINTER;
+
+    if (!m_pluginHalterDelegate)
+        return E_FAIL;
+
+    return m_pluginHalterDelegate.copyRefTo(d);
+}
+
 class EnumTextMatches : public IEnumTextMatches
 {
     long m_ref;
diff --git a/WebKit/win/WebView.h b/WebKit/win/WebView.h
index 510e70a..09c8360 100644
--- a/WebKit/win/WebView.h
+++ b/WebKit/win/WebView.h
@@ -745,6 +745,9 @@ public:
     virtual HRESULT STDMETHODCALLTYPE removeUserContentFromGroup(BSTR groupName, unsigned worldID);
     virtual HRESULT STDMETHODCALLTYPE removeAllUserContentFromGroup(BSTR groupName);
 
+    virtual HRESULT STDMETHODCALLTYPE setPluginHalterDelegate(IWebPluginHalterDelegate*);
+    virtual HRESULT STDMETHODCALLTYPE pluginHalterDelegate(IWebPluginHalterDelegate**);
+
     // WebView
     bool shouldUseEmbeddedView(const WebCore::String& mimeType) const;
 
@@ -892,6 +895,7 @@ protected:
     COMPtr<IWebDownloadDelegate> m_downloadDelegate;
     COMPtr<WebPreferences> m_preferences;
     COMPtr<WebInspector> m_webInspector;
+    COMPtr<IWebPluginHalterDelegate> m_pluginHalterDelegate;
 
     bool m_userAgentOverridden;
     bool m_useBackForwardList;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list