[chromium] RateLimiter should hold a reference to its context
authorjamesr@google.com <jamesr@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 16 Mar 2012 00:28:20 +0000 (00:28 +0000)
committerjamesr@google.com <jamesr@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 16 Mar 2012 00:28:20 +0000 (00:28 +0000)
https://bugs.webkit.org/show_bug.cgi?id=80761

Reviewed by Stephen White.

* platform/graphics/chromium/RateLimiter.h:
(RateLimiter):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@110919 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/chromium/RateLimiter.cpp
Source/WebCore/platform/graphics/chromium/RateLimiter.h

index ee0a031..91e70d1 100644 (file)
@@ -1,3 +1,13 @@
+2012-03-15  James Robinson  <jamesr@chromium.org>
+
+        [chromium] RateLimiter should hold a reference to its context
+        https://bugs.webkit.org/show_bug.cgi?id=80761
+
+        Reviewed by Stephen White.
+
+        * platform/graphics/chromium/RateLimiter.h:
+        (RateLimiter):
+
 2012-03-15  Adam Klein  <adamk@chromium.org>
 
         Share code in FormAssociatedElement by resetting the form owner whenever insertedIntoTree is called
index c5e4dd5..571263e 100644 (file)
@@ -49,6 +49,10 @@ RateLimiter::RateLimiter(GraphicsContext3D* context)
     m_contextSupportsRateLimitingExtension = context->getExtensions()->supports("GL_CHROMIUM_rate_limit_offscreen_context");
 }
 
+RateLimiter::~RateLimiter()
+{
+}
+
 void RateLimiter::start()
 {
     if (m_contextSupportsRateLimitingExtension && !m_timer.isActive())
index 2699278..d4e824d 100644 (file)
@@ -28,9 +28,9 @@
 
 #if USE(ACCELERATED_COMPOSITING)
 
-#include "PassRefPtr.h"
 #include "Timer.h"
 #include <wtf/RefCounted.h>
+#include <wtf/RefPtr.h>
 
 namespace WebCore {
 
@@ -40,12 +40,14 @@ class GraphicsContext3D;
 class RateLimiter : public RefCounted<RateLimiter> {
 public:
     static PassRefPtr<RateLimiter> create(GraphicsContext3D*);
+    ~RateLimiter();
+
     void start();
     void stop();
 
 private:
     explicit RateLimiter(GraphicsContext3D*);
-    GraphicsContext3D* m_context;
+    RefPtr<GraphicsContext3D> m_context;
     bool m_contextSupportsRateLimitingExtension;
     Timer<RateLimiter> m_timer;
     void rateLimitContext(Timer<RateLimiter>*);