Changeset 65217 in webkit


Ignore:
Timestamp:
Aug 11, 2010 10:50:10 PM (14 years ago)
Author:
tonyg@chromium.org
Message:

2010-08-11 Tony Gentilcore <tonyg@chromium.org>

Reviewed by Adam Barth.

Make PendingScript copyable so that it can be stored in containers
https://bugs.webkit.org/show_bug.cgi?id=43875

This will be useful for storing PendingScripts in a Vector or Deque for
async and defer scripts.

No new tests because no functional changes.

  • dom/PendingScript.h: (WebCore::PendingScript::PendingScript): (WebCore::PendingScript::operator=):
Location:
trunk/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r65215 r65217  
     12010-08-11  Tony Gentilcore  <tonyg@chromium.org>
     2
     3        Reviewed by Adam Barth.
     4
     5        Make PendingScript copyable so that it can be stored in containers
     6        https://bugs.webkit.org/show_bug.cgi?id=43875
     7
     8        This will be useful for storing PendingScripts in a Vector or Deque for
     9        async and defer scripts.
     10
     11        No new tests because no functional changes.
     12
     13        * dom/PendingScript.h:
     14        (WebCore::PendingScript::PendingScript):
     15        (WebCore::PendingScript::operator=):
     16
    1172010-08-11  Victoria Kirst  <vrk@google.com>
    218
  • trunk/WebCore/dom/PendingScript.h

    r64857 r65217  
    2929#include "CachedResourceClient.h"
    3030#include "CachedResourceHandle.h"
    31 #include <wtf/Noncopyable.h>
    3231#include <wtf/PassRefPtr.h>
    3332
     
    4241// from purging its data buffer. This class holds a dummy client open for its
    4342// lifetime in order to guarantee that the data buffer will not be purged.
    44 class PendingScript : public Noncopyable, CachedResourceClient {
     43class PendingScript : public CachedResourceClient {
    4544public:
    4645    PendingScript()
     
    5049    }
    5150
     51    PendingScript(const PendingScript& other)
     52        : CachedResourceClient(other)
     53        , m_startingLineNumber(other.m_startingLineNumber)
     54        , m_watchingForLoad(other.m_watchingForLoad)
     55        , m_element(other.m_element)
     56    {
     57        setCachedScript(other.cachedScript());
     58    }
     59
    5260    ~PendingScript();
     61
     62    PendingScript& operator=(const PendingScript& other)
     63    {
     64        if (this == &other)
     65            return *this;
     66
     67        m_startingLineNumber = other.m_startingLineNumber;
     68        m_watchingForLoad = other.m_watchingForLoad;
     69        m_element = other.m_element;
     70        setCachedScript(other.cachedScript());
     71
     72        return *this;
     73    }
    5374
    5475    // FIXME: No setter means this is never set to anything other than 0.
Note: See TracChangeset for help on using the changeset viewer.