Changeset 66968 in webkit for trunk/JavaScriptCore


Ignore:
Timestamp:
Sep 8, 2010, 4:08:08 AM (15 years ago)
Author:
[email protected]
Message:

2010-08-30 Maciej Stachowiak <[email protected]>

Reviewed by Darin Adler.

Handle MediaQueryExp memory management exclusively with smart pointers
https://bugs.webkit.org/show_bug.cgi?id=44874


Implemented a non-copying sort function to make it possible to sort a Vector
of OwnPtrs (which cannot be copied). This is required for the above.

  • wtf/NonCopyingSort.h: Added. (WTF::nonCopyingSort): It's secretly heapsort. (WTF::heapSort): heapsort implementation. (WTF::siftDown): Helper function for heapsort. (WTF::heapify): ditto

Adjust build systems.


2010-08-30 Maciej Stachowiak <[email protected]>

Reviewed by Darin Adler.

Handle MediaQueryExp memory management exclusively with smart pointers
https://bugs.webkit.org/show_bug.cgi?id=44874

Gace MediaQueryExp a create function, made the constructor private, and followed
the implications. The one tricky bit was using a non-copying sort to sort
the Vector<OwnPtr<MediaQueryExp> > in the MediaQuery constructor.


  • ForwardingHeaders/wtf/NonCopyingSort.h: Added.
  • css/CSSGrammar.y:
  • css/CSSParser.cpp: (WebCore::CSSParser::~CSSParser): (WebCore::CSSParser::createFloatingMediaQueryExp): (WebCore::CSSParser::createFloatingMediaQueryExpList): (WebCore::CSSParser::sinkFloatingMediaQueryExpList): (WebCore::CSSParser::createFloatingMediaQuery):
  • css/CSSParser.h:
  • css/MediaList.cpp:
  • css/MediaQuery.cpp: (WebCore::expressionCompare): (WebCore::MediaQuery::MediaQuery): (WebCore::MediaQuery::~MediaQuery):
  • css/MediaQuery.h: (WebCore::MediaQuery::expressions):
  • css/MediaQueryEvaluator.cpp: (WebCore::MediaQueryEvaluator::eval):
  • css/MediaQueryExp.h: (WebCore::MediaQueryExp::create):
Location:
trunk/JavaScriptCore
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/ChangeLog

    r66962 r66968  
     12010-08-30  Maciej Stachowiak  <[email protected]>
     2
     3        Reviewed by Darin Adler.
     4
     5        Handle MediaQueryExp memory management exclusively with smart pointers
     6        https://bugs.webkit.org/show_bug.cgi?id=44874
     7       
     8        Implemented a non-copying sort function to make it possible to sort a Vector
     9        of OwnPtrs (which cannot be copied). This is required for the above.
     10
     11        * wtf/NonCopyingSort.h: Added.
     12        (WTF::nonCopyingSort): It's secretly heapsort.
     13        (WTF::heapSort): heapsort implementation.
     14        (WTF::siftDown): Helper function for heapsort.
     15        (WTF::heapify): ditto
     16
     17        Adjust build systems.
     18       
     19        * GNUmakefile.am:
     20        * JavaScriptCore.gypi:
     21        * JavaScriptCore.vcproj/WTF/WTF.vcproj:
     22        * JavaScriptCore.xcodeproj/project.pbxproj:
     23
    1242010-09-08  Zoltan Herczeg  <[email protected]>
    225
  • trunk/JavaScriptCore/GNUmakefile.am

    r66738 r66968  
    464464        JavaScriptCore/wtf/MD5.h \
    465465        JavaScriptCore/wtf/MessageQueue.h \
     466        JavaScriptCore/wtf/NonCopyingSort.h \
    466467        JavaScriptCore/wtf/Noncopyable.h \
    467468        JavaScriptCore/wtf/NotFound.h \
  • trunk/JavaScriptCore/JavaScriptCore.gypi

    r65077 r66968  
    395395            'wtf/MathExtras.h',
    396396            'wtf/MessageQueue.h',
     397            'wtf/NonCopyingSort.h',
    397398            'wtf/Noncopyable.h',
    398399            'wtf/NotFound.h',
  • trunk/JavaScriptCore/JavaScriptCore.vcproj/WTF/WTF.vcproj

    r66139 r66968  
    406406                </File>
    407407                <File
     408                        RelativePath="..\..\wtf\NonCopyingSort.h"
     409                        >
     410                </File>
     411                <File
    408412                        RelativePath="..\..\wtf\Noncopyable.h"
    409413                        >
  • trunk/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj

    r66703 r66968  
    189189                655EB29B10CE2581001A990E /* NodesCodegen.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 655EB29A10CE2581001A990E /* NodesCodegen.cpp */; };
    190190                65DFC93308EA173A00F7300B /* HashTable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 65DFC92D08EA173A00F7300B /* HashTable.cpp */; };
     191                65E1A3DF122B894500B26097 /* NonCopyingSort.h in Headers */ = {isa = PBXBuildFile; fileRef = 65E1A2F4122B880D00B26097 /* NonCopyingSort.h */; settings = {ATTRIBUTES = (Private, ); }; };
    191192                65FDE49C0BDD1D4A00E80111 /* Assertions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 65E217B808E7EECC0023E5F6 /* Assertions.cpp */; settings = {COMPILER_FLAGS = "-Wno-missing-format-attribute"; }; };
    192193                7E4EE7090EBB7963005934AA /* StructureChain.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E4EE7080EBB7963005934AA /* StructureChain.h */; settings = {ATTRIBUTES = (Private, ); }; };
     
    776777                65DFC92E08EA173A00F7300B /* HashTable.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = HashTable.h; sourceTree = "<group>"; tabWidth = 8; };
    777778                65DFC92F08EA173A00F7300B /* HashTraits.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = HashTraits.h; sourceTree = "<group>"; tabWidth = 8; };
     779                65E1A2F4122B880D00B26097 /* NonCopyingSort.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NonCopyingSort.h; sourceTree = "<group>"; };
    778780                65E217B708E7EECC0023E5F6 /* Assertions.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = Assertions.h; sourceTree = "<group>"; tabWidth = 8; };
    779781                65E217B808E7EECC0023E5F6 /* Assertions.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Assertions.cpp; sourceTree = "<group>"; tabWidth = 8; };
     
    14931495                                511FC4CA117EE2A800425272 /* MD5.h */,
    14941496                                E1EE798B0D6CA53D00FEA3BA /* MessageQueue.h */,
     1497                                65E1A2F4122B880D00B26097 /* NonCopyingSort.h */,
    14951498                                9303F5690991190000AD71B8 /* Noncopyable.h */,
    14961499                                C0A2723F0E509F1E00E96E15 /* NotFound.h */,
     
    21672170                                7EFF00640EC05A9A00AA7C93 /* NodeInfo.h in Headers */,
    21682171                                BC18C43F0E16F5CD00B34460 /* Nodes.h in Headers */,
     2172                                65E1A3DF122B894500B26097 /* NonCopyingSort.h in Headers */,
    21692173                                BC18C4400E16F5CD00B34460 /* Noncopyable.h in Headers */,
    21702174                                C0A272630E50A06300E96E15 /* NotFound.h in Headers */,
Note: See TracChangeset for help on using the changeset viewer.