Changeset 104318 in webkit


Ignore:
Timestamp:
Jan 6, 2012 12:20:24 PM (12 years ago)
Author:
caio.oliveira@openbossa.org
Message:

Use HashMap<OwnPtr> for SourceProviderCache items
https://bugs.webkit.org/show_bug.cgi?id=75346

Reviewed by Daniel Bates.

  • parser/Parser.cpp:
  • parser/SourceProviderCache.cpp:

(JSC::SourceProviderCache::clear):
(JSC::SourceProviderCache::add):

  • parser/SourceProviderCache.h:
Location:
trunk/Source/JavaScriptCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r104315 r104318  
     12012-01-06  Caio Marcelo de Oliveira Filho  <caio.oliveira@openbossa.org>
     2
     3        Use HashMap<OwnPtr> for SourceProviderCache items
     4        https://bugs.webkit.org/show_bug.cgi?id=75346
     5
     6        Reviewed by Daniel Bates.
     7
     8        * parser/Parser.cpp:
     9        * parser/SourceProviderCache.cpp:
     10        (JSC::SourceProviderCache::clear):
     11        (JSC::SourceProviderCache::add):
     12        * parser/SourceProviderCache.h:
     13
    1142012-01-06  Sam Weinig  <sam@webkit.org>
    215
  • trunk/Source/JavaScriptCore/parser/Parser.cpp

    r102931 r104318  
    3131#include "NodeInfo.h"
    3232#include "SourceProvider.h"
    33 #include "SourceProviderCacheItem.h"
    3433#include <utility>
    3534#include <wtf/HashFunctions.h>
  • trunk/Source/JavaScriptCore/parser/SourceProviderCache.cpp

    r95901 r104318  
    2727#include "SourceProviderCache.h"
    2828
    29 #include "SourceProviderCacheItem.h"
    30 
    3129namespace JSC {
    3230
     
    3836void SourceProviderCache::clear()
    3937{
    40     deleteAllValues(m_map);
    4138    m_map.clear();
    4239    m_contentByteSize = 0;
     
    5047void SourceProviderCache::add(int sourcePosition, PassOwnPtr<SourceProviderCacheItem> item, unsigned size)
    5148{
    52     m_map.add(sourcePosition, item.leakPtr());
     49    m_map.add(sourcePosition, item);
    5350    m_contentByteSize += size;
    5451}
  • trunk/Source/JavaScriptCore/parser/SourceProviderCache.h

    r99436 r104318  
    2727#define SourceProviderCache_h
    2828
     29#include "SourceProviderCacheItem.h"
    2930#include <wtf/HashMap.h>
     31#include <wtf/OwnPtr.h>
    3032#include <wtf/PassOwnPtr.h>
    3133
    3234namespace JSC {
    33 
    34 class SourceProviderCacheItem;
    3535
    3636class SourceProviderCache {
     
    4545
    4646private:
    47     HashMap<int, SourceProviderCacheItem*> m_map;
     47    HashMap<int, OwnPtr<SourceProviderCacheItem> > m_map;
    4848    unsigned m_contentByteSize;
    4949};
Note: See TracChangeset for help on using the changeset viewer.