Changeset 69970 in webkit


Ignore:
Timestamp:
Oct 18, 2010 10:23:53 AM (14 years ago)
Author:
Darin Adler
Message:

2010-10-18 Darin Adler <Darin Adler>

Reviewed by Anders Carlsson.

Make a nullptr that works with OwnPtr and RefPtr
https://bugs.webkit.org/show_bug.cgi?id=47756

  • wtf/NullPtr.h: Added.
  • wtf/OwnArrayPtr.h: Add an overload of = taking nullptr.
  • wtf/OwnPtr.h: Ditto.
  • wtf/PassOwnArrayPtr.h: Ditto.
  • wtf/PassOwnPtr.h: Ditto.
  • wtf/PassRefPtr.h: Ditto.
  • wtf/RefPtr.h: Ditto.
  • wtf/RetainPtr.h: Ditto.
Location:
trunk/JavaScriptCore
Files:
1 added
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/ChangeLog

    r69965 r69970  
     12010-10-18  Darin Adler  <darin@apple.com>
     2
     3        Reviewed by Anders Carlsson.
     4
     5        Make a nullptr that works with OwnPtr and RefPtr
     6        https://bugs.webkit.org/show_bug.cgi?id=47756
     7
     8        * JavaScriptCore.xcodeproj/project.pbxproj: Added NullPtr.h.
     9
     10        * wtf/NullPtr.h: Added.
     11
     12        * wtf/OwnArrayPtr.h: Add an overload of = taking nullptr.
     13        * wtf/OwnPtr.h: Ditto.
     14        * wtf/PassOwnArrayPtr.h: Ditto.
     15        * wtf/PassOwnPtr.h: Ditto.
     16        * wtf/PassRefPtr.h: Ditto.
     17        * wtf/RefPtr.h: Ditto.
     18        * wtf/RetainPtr.h: Ditto.
     19
    1202010-10-18  Oliver Hunt  <oliver@apple.com>
    221
  • trunk/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj

    r69928 r69970  
    278278                933040040E6A749400786E6A /* SmallStrings.h in Headers */ = {isa = PBXBuildFile; fileRef = 93303FEA0E6A72C000786E6A /* SmallStrings.h */; settings = {ATTRIBUTES = (Private, ); }; };
    279279                9330402C0E6A764000786E6A /* SmallStrings.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93303FE80E6A72B500786E6A /* SmallStrings.cpp */; };
     280                933F5CDC1269229B0049191E /* NullPtr.h in Headers */ = {isa = PBXBuildFile; fileRef = 933F5CDB126922690049191E /* NullPtr.h */; settings = {ATTRIBUTES = (Private, ); }; };
    280281                937013480CA97E0E00FA14D3 /* pcre_ucp_searchfuncs.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 937013470CA97E0E00FA14D3 /* pcre_ucp_searchfuncs.cpp */; settings = {COMPILER_FLAGS = "-Wno-sign-compare"; }; };
    281282                93E26BD408B1514100F85226 /* pcre_xclass.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93E26BD308B1514100F85226 /* pcre_xclass.cpp */; };
     
    892893                933A349A038AE7C6008635CE /* Identifier.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = Identifier.h; sourceTree = "<group>"; tabWidth = 8; };
    893894                933A349D038AE80F008635CE /* Identifier.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Identifier.cpp; sourceTree = "<group>"; tabWidth = 8; };
     895                933F5CDB126922690049191E /* NullPtr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NullPtr.h; sourceTree = "<group>"; };
    894896                935AF46909E9D9DB00ACD1D8 /* Forward.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Forward.h; sourceTree = "<group>"; };
    895897                935AF46B09E9D9DB00ACD1D8 /* UnusedParam.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UnusedParam.h; sourceTree = "<group>"; };
     
    15181520                                9303F5690991190000AD71B8 /* Noncopyable.h */,
    15191521                                C0A2723F0E509F1E00E96E15 /* NotFound.h */,
     1522                                933F5CDB126922690049191E /* NullPtr.h */,
    15201523                                9303F5A409911A5800AD71B8 /* OwnArrayPtr.h */,
    15211524                                BCFBE697122561D200309E9D /* OwnArrayPtrCommon.h */,
     
    23432346                                90213E3E123A40C200D422F3 /* MemoryStatistics.h in Headers */,
    23442347                                A730B6121250068F009D25B1 /* StrictEvalActivation.h in Headers */,
     2348                                933F5CDC1269229B0049191E /* NullPtr.h in Headers */,
    23452349                        );
    23462350                        runOnlyForDeploymentPostprocessing = 0;
  • trunk/JavaScriptCore/wtf/Noncopyable.h

    r68419 r69970  
    11/*
    2  *  Copyright (C) 2006 Apple Computer, Inc.
     2 *  Copyright (C) 2006, 2010 Apple Inc. All rights reserved.
    33 *
    44 *  This library is free software; you can redistribute it and/or
  • trunk/JavaScriptCore/wtf/OwnArrayPtr.h

    r66139 r69970  
    2424#include "Assertions.h"
    2525#include "Noncopyable.h"
     26#include "NullPtr.h"
    2627#include "OwnArrayPtrCommon.h"
    2728#include <algorithm>
     
    7475
    7576    OwnArrayPtr& operator=(const PassOwnArrayPtr<T>&);
     77    OwnArrayPtr& operator=(std::nullptr_t) { clear(); return *this; }
    7678    template<typename U> OwnArrayPtr& operator=(const PassOwnArrayPtr<U>&);
    7779
  • trunk/JavaScriptCore/wtf/OwnPtr.h

    r63093 r69970  
    2424#include "Assertions.h"
    2525#include "Noncopyable.h"
     26#include "NullPtr.h"
    2627#include "OwnPtrCommon.h"
    2728#include "TypeTraits.h"
     
    7374
    7475        OwnPtr& operator=(const PassOwnPtr<T>&);
     76        OwnPtr& operator=(std::nullptr_t) { clear(); return *this; }
    7577        template<typename U> OwnPtr& operator=(const PassOwnPtr<U>&);
    7678
  • trunk/JavaScriptCore/wtf/PassOwnArrayPtr.h

    r66139 r69970  
    2828
    2929#include "Assertions.h"
     30#include "NullPtr.h"
    3031#include "OwnArrayPtrCommon.h"
    3132#include "TypeTraits.h"
     
    7374
    7475    PassOwnArrayPtr& operator=(const PassOwnArrayPtr<T>&);
     76    PassOwnArrayPtr& operator=(std::nullptr_t) { clear(); return *this; }
    7577    template<typename U> PassOwnArrayPtr& operator=(const PassOwnArrayPtr<U>&);
    7678
  • trunk/JavaScriptCore/wtf/PassOwnPtr.h

    r63093 r69970  
    2828
    2929#include "Assertions.h"
     30#include "NullPtr.h"
    3031#include "OwnPtrCommon.h"
    3132#include "TypeTraits.h"
     
    7273
    7374        PassOwnPtr& operator=(const PassOwnPtr<T>&);
     75        PassOwnPtr& operator=(std::nullptr_t) { clear(); return *this; }
    7476        template<typename U> PassOwnPtr& operator=(const PassOwnPtr<U>&);
    7577
  • trunk/JavaScriptCore/wtf/PassRefPtr.h

    r67972 r69970  
    2323
    2424#include "AlwaysInline.h"
     25#include "NullPtr.h"
    2526
    2627namespace WTF {
     
    9192        PassRefPtr& operator=(T*);
    9293        PassRefPtr& operator=(const PassRefPtr&);
     94        PassRefPtr& operator=(std::nullptr_t) { clear(); return *this; }
    9395        template<typename U> PassRefPtr& operator=(const PassRefPtr<U>&);
    9496        template<typename U> PassRefPtr& operator=(const RefPtr<U>&);
  • trunk/JavaScriptCore/wtf/RefPtr.h

    r65130 r69970  
    2525
    2626#include <algorithm>
    27 #include "AlwaysInline.h"
    2827#include "FastAllocBase.h"
    2928#include "PassRefPtr.h"
     
    7675        RefPtr& operator=(const PassRefPtr<T>&);
    7776        RefPtr& operator=(const NonNullPassRefPtr<T>&);
     77        RefPtr& operator=(std::nullptr_t) { clear(); return *this; }
    7878        template<typename U> RefPtr& operator=(const RefPtr<U>&);
    7979        template<typename U> RefPtr& operator=(const PassRefPtr<U>&);
  • trunk/JavaScriptCore/wtf/RetainPtr.h

    r65130 r69970  
    2323
    2424#include "HashTraits.h"
     25#include "NullPtr.h"
    2526#include "TypeTraits.h"
    2627#include <algorithm>
     
    8788        RetainPtr& operator=(PtrType);
    8889        template<typename U> RetainPtr& operator=(U*);
     90        RetainPtr& operator=(std::nullptr_t) { clear(); return *this; }
    8991
    9092        void adoptCF(PtrType);
Note: See TracChangeset for help on using the changeset viewer.