Changeset 62677 in webkit
- Timestamp:
- Jul 7, 2010 9:53:49 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 34 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/API/JSCallbackObject.h
r60708 r62677 1 1 /* 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.2 * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved. 3 3 * Copyright (C) 2007 Eric Seidel <eric@webkit.org> 4 4 * … … 31 31 #include "JSValueRef.h" 32 32 #include "JSObject.h" 33 #include <wtf/PassOwnPtr.h> 33 34 34 35 namespace JSC { … … 57 58 { 58 59 if (!m_privateProperties) 59 m_privateProperties .set(new JSPrivatePropertyMap);60 m_privateProperties = adoptPtr(new JSPrivatePropertyMap); 60 61 m_privateProperties->setPrivateProperty(propertyName, value); 61 62 } -
trunk/JavaScriptCore/API/JSCallbackObjectFunctions.h
r60762 r62677 53 53 JSCallbackObject<Base>::JSCallbackObject(ExecState* exec, JSGlobalObject* globalObject, NonNullPassRefPtr<Structure> structure, JSClassRef jsClass, void* data) 54 54 : Base(globalObject, structure) 55 , m_callbackObjectData( new JSCallbackObjectData(data, jsClass))55 , m_callbackObjectData(adoptPtr(new JSCallbackObjectData(data, jsClass))) 56 56 { 57 57 init(exec); … … 63 63 JSCallbackObject<Base>::JSCallbackObject(JSClassRef jsClass, NonNullPassRefPtr<Structure> structure) 64 64 : Base(structure) 65 , m_callbackObjectData( new JSCallbackObjectData(0, jsClass))65 , m_callbackObjectData(adoptPtr(new JSCallbackObjectData(0, jsClass))) 66 66 { 67 67 ASSERT(Base::isGlobalObject()); -
trunk/JavaScriptCore/ChangeLog
r62674 r62677 1 2010-07-07 Darin Adler <darin@apple.com> 2 3 Reviewed by Adam Barth. 4 5 More OwnPtr work 6 https://bugs.webkit.org/show_bug.cgi?id=41727 7 8 * API/JSCallbackObject.h: 9 (JSC::JSCallbackObjectData::setPrivateProperty): Use adoptPtr. 10 * API/JSCallbackObjectFunctions.h: 11 (JSC::JSCallbackObject::JSCallbackObject): Ditto. 12 * bytecode/CodeBlock.cpp: 13 (JSC::CodeBlock::CodeBlock): Ditto. 14 * bytecode/CodeBlock.h: 15 (JSC::CodeBlock::createRareDataIfNecessary): Ditto. 16 * parser/Nodes.cpp: 17 (JSC::ScopeNode::ScopeNode): Ditto. 18 * parser/ParserArena.cpp: 19 (JSC::ParserArena::ParserArena): Ditto. 20 * runtime/Arguments.h: 21 (JSC::Arguments::Arguments): Ditto. 22 * runtime/Executable.cpp: 23 (JSC::EvalExecutable::compile): Ditto. 24 (JSC::ProgramExecutable::compile): Ditto. 25 (JSC::FunctionExecutable::compileForCall): Ditto. 26 (JSC::FunctionExecutable::compileForConstruct): Ditto. 27 (JSC::FunctionExecutable::reparseExceptionInfo): Ditto. 28 (JSC::EvalExecutable::reparseExceptionInfo): Ditto. 29 * runtime/JSArray.cpp: 30 (JSC::JSArray::sort): Ditto. 31 * runtime/RegExpConstructor.cpp: 32 (JSC::RegExpConstructor::RegExpConstructor): Ditto. 33 * runtime/RegExpObject.cpp: 34 (JSC::RegExpObject::RegExpObject): Ditto. 35 * runtime/SmallStrings.cpp: 36 (JSC::SmallStrings::createSingleCharacterString): Ditto. 37 (JSC::SmallStrings::singleCharacterStringRep): Ditto. 38 39 * wtf/unicode/icu/CollatorICU.cpp: 40 (WTF::Collator::userDefault): Use adoptPtr. 41 * yarr/RegexInterpreter.cpp: 42 (JSC::Yarr::ByteCompiler::ByteCompiler): Ditto. 43 (JSC::Yarr::ByteCompiler::compile): Ditto. 44 (JSC::Yarr::ByteCompiler::regexBegin): Ditto. 45 (JSC::Yarr::byteCompileRegex): Ditto. 46 * yarr/RegexInterpreter.h: 47 (JSC::Yarr::BytecodePattern::BytecodePattern): Ditto. 48 1 49 2010-07-07 Darin Adler <darin@apple.com> 2 50 -
trunk/JavaScriptCore/bytecode/CodeBlock.cpp
r62612 r62677 1363 1363 , m_sourceOffset(sourceOffset) 1364 1364 , m_symbolTable(symTab) 1365 , m_exceptionInfo( new ExceptionInfo)1365 , m_exceptionInfo(adoptPtr(new ExceptionInfo)) 1366 1366 { 1367 1367 ASSERT(m_source); -
trunk/JavaScriptCore/bytecode/CodeBlock.h
r62612 r62677 531 531 { 532 532 if (!m_rareData) 533 m_rareData .set(new RareData);533 m_rareData = adoptPtr(new RareData); 534 534 } 535 535 -
trunk/JavaScriptCore/parser/Nodes.cpp
r51882 r62677 99 99 : StatementNode(globalData) 100 100 , ParserArenaRefCounted(globalData) 101 , m_data( new ScopeNodeData(globalData->parser->arena(), children, varStack, funcStack, numConstants))101 , m_data(adoptPtr(new ScopeNodeData(globalData->parser->arena(), children, varStack, funcStack, numConstants))) 102 102 , m_features(features) 103 103 , m_source(source) -
trunk/JavaScriptCore/parser/ParserArena.cpp
r47664 r62677 1 1 /* 2 * Copyright (C) 2009 Apple Inc. All rights reserved.2 * Copyright (C) 2009, 2010 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 28 28 29 29 #include "Nodes.h" 30 #include <wtf/PassOwnPtr.h> 30 31 31 32 namespace JSC { … … 34 35 : m_freeableMemory(0) 35 36 , m_freeablePoolEnd(0) 36 , m_identifierArena( new IdentifierArena)37 , m_identifierArena(adoptPtr(new IdentifierArena)) 37 38 { 38 39 } -
trunk/JavaScriptCore/runtime/Arguments.h
r62432 r62677 140 140 inline Arguments::Arguments(CallFrame* callFrame) 141 141 : JSObject(callFrame->lexicalGlobalObject()->argumentsStructure()) 142 , d( new ArgumentsData)142 , d(adoptPtr(new ArgumentsData)) 143 143 { 144 144 JSFunction* callee; … … 177 177 inline Arguments::Arguments(CallFrame* callFrame, NoParametersType) 178 178 : JSObject(callFrame->lexicalGlobalObject()->argumentsStructure()) 179 , d( new ArgumentsData)179 , d(adoptPtr(new ArgumentsData)) 180 180 { 181 181 ASSERT(!asFunction(callFrame->callee())->jsExecutable()->parameterCount()); -
trunk/JavaScriptCore/runtime/Executable.cpp
r62612 r62677 78 78 ASSERT(!m_evalCodeBlock); 79 79 m_evalCodeBlock = new EvalCodeBlock(this, globalObject, source().provider(), scopeChain.localDepth()); 80 OwnPtr<BytecodeGenerator> generator( new BytecodeGenerator(evalNode.get(), globalObject->debugger(), scopeChain, m_evalCodeBlock->symbolTable(), m_evalCodeBlock));80 OwnPtr<BytecodeGenerator> generator(adoptPtr(new BytecodeGenerator(evalNode.get(), globalObject->debugger(), scopeChain, m_evalCodeBlock->symbolTable(), m_evalCodeBlock))); 81 81 generator->generate(); 82 82 … … 113 113 ASSERT(!m_programCodeBlock); 114 114 m_programCodeBlock = new ProgramCodeBlock(this, GlobalCode, globalObject, source().provider()); 115 OwnPtr<BytecodeGenerator> generator( new BytecodeGenerator(programNode.get(), globalObject->debugger(), scopeChain, &globalObject->symbolTable(), m_programCodeBlock));115 OwnPtr<BytecodeGenerator> generator(adoptPtr(new BytecodeGenerator(programNode.get(), globalObject->debugger(), scopeChain, &globalObject->symbolTable(), m_programCodeBlock))); 116 116 generator->generate(); 117 117 … … 136 136 ASSERT(!m_codeBlockForCall); 137 137 m_codeBlockForCall = new FunctionCodeBlock(this, FunctionCode, source().provider(), source().startOffset(), false); 138 OwnPtr<BytecodeGenerator> generator( new BytecodeGenerator(body.get(), globalObject->debugger(), scopeChain, m_codeBlockForCall->symbolTable(), m_codeBlockForCall));138 OwnPtr<BytecodeGenerator> generator(adoptPtr(new BytecodeGenerator(body.get(), globalObject->debugger(), scopeChain, m_codeBlockForCall->symbolTable(), m_codeBlockForCall))); 139 139 generator->generate(); 140 140 m_numParametersForCall = m_codeBlockForCall->m_numParameters; … … 163 163 ASSERT(!m_codeBlockForConstruct); 164 164 m_codeBlockForConstruct = new FunctionCodeBlock(this, FunctionCode, source().provider(), source().startOffset(), true); 165 OwnPtr<BytecodeGenerator> generator( new BytecodeGenerator(body.get(), globalObject->debugger(), scopeChain, m_codeBlockForConstruct->symbolTable(), m_codeBlockForConstruct));165 OwnPtr<BytecodeGenerator> generator(adoptPtr(new BytecodeGenerator(body.get(), globalObject->debugger(), scopeChain, m_codeBlockForConstruct->symbolTable(), m_codeBlockForConstruct))); 166 166 generator->generate(); 167 167 m_numParametersForConstruct = m_codeBlockForConstruct->m_numParameters; … … 254 254 JSGlobalObject* globalObject = scopeChain.globalObject(); 255 255 256 OwnPtr<CodeBlock> newCodeBlock( new FunctionCodeBlock(this, FunctionCode, source().provider(), source().startOffset(), codeBlock->m_isConstructor));256 OwnPtr<CodeBlock> newCodeBlock(adoptPtr(new FunctionCodeBlock(this, FunctionCode, source().provider(), source().startOffset(), codeBlock->m_isConstructor))); 257 257 globalData->functionCodeBlockBeingReparsed = newCodeBlock.get(); 258 258 259 OwnPtr<BytecodeGenerator> generator( new BytecodeGenerator(newFunctionBody.get(), globalObject->debugger(), scopeChain, newCodeBlock->symbolTable(), newCodeBlock.get()));259 OwnPtr<BytecodeGenerator> generator(adoptPtr(new BytecodeGenerator(newFunctionBody.get(), globalObject->debugger(), scopeChain, newCodeBlock->symbolTable(), newCodeBlock.get()))); 260 260 generator->setRegeneratingForExceptionInfo(static_cast<FunctionCodeBlock*>(codeBlock)); 261 261 generator->generate(); … … 287 287 JSGlobalObject* globalObject = scopeChain.globalObject(); 288 288 289 OwnPtr<EvalCodeBlock> newCodeBlock( new EvalCodeBlock(this, globalObject, source().provider(), scopeChain.localDepth()));290 291 OwnPtr<BytecodeGenerator> generator( new BytecodeGenerator(newEvalBody.get(), globalObject->debugger(), scopeChain, newCodeBlock->symbolTable(), newCodeBlock.get()));289 OwnPtr<EvalCodeBlock> newCodeBlock(adoptPtr(new EvalCodeBlock(this, globalObject, source().provider(), scopeChain.localDepth()))); 290 291 OwnPtr<BytecodeGenerator> generator(adoptPtr(new BytecodeGenerator(newEvalBody.get(), globalObject->debugger(), scopeChain, newCodeBlock->symbolTable(), newCodeBlock.get()))); 292 292 generator->setRegeneratingForExceptionInfo(static_cast<EvalCodeBlock*>(codeBlock)); 293 293 generator->generate(); -
trunk/JavaScriptCore/runtime/JSArray.cpp
r62432 r62677 848 848 849 849 if (callType == CallTypeJS) 850 tree.abstractor().m_cachedCall .set(new CachedCall(exec, asFunction(compareFunction), 2, exec->exceptionSlot()));850 tree.abstractor().m_cachedCall = adoptPtr(new CachedCall(exec, asFunction(compareFunction), 2, exec->exceptionSlot())); 851 851 852 852 if (!tree.abstractor().m_nodes.begin()) { -
trunk/JavaScriptCore/runtime/RegExpConstructor.cpp
r61623 r62677 96 96 RegExpConstructor::RegExpConstructor(ExecState* exec, JSGlobalObject* globalObject, NonNullPassRefPtr<Structure> structure, RegExpPrototype* regExpPrototype) 97 97 : InternalFunction(&exec->globalData(), globalObject, structure, Identifier(exec, "RegExp")) 98 , d( new RegExpConstructorPrivate)98 , d(adoptPtr(new RegExpConstructorPrivate)) 99 99 { 100 100 // ECMA 15.10.5.1 RegExp.prototype -
trunk/JavaScriptCore/runtime/RegExpObject.cpp
r60762 r62677 62 62 RegExpObject::RegExpObject(JSGlobalObject* globalObject, NonNullPassRefPtr<Structure> structure, NonNullPassRefPtr<RegExp> regExp) 63 63 : JSObjectWithGlobalObject(globalObject, structure) 64 , d( new RegExpObjectData(regExp, 0))64 , d(adoptPtr(new RegExpObjectData(regExp, 0))) 65 65 { 66 66 } -
trunk/JavaScriptCore/runtime/SmallStrings.cpp
r58026 r62677 1 1 /* 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved.2 * Copyright (C) 2008, 2010 Apple Inc. All Rights Reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 29 29 #include "JSGlobalObject.h" 30 30 #include "JSString.h" 31 32 31 #include <wtf/Noncopyable.h> 32 #include <wtf/PassOwnPtr.h> 33 33 34 34 namespace JSC { 35 35 36 static const unsigned numCharactersToStore = 0x100; 36 37 … … 127 128 { 128 129 if (!m_storage) 129 m_storage .set(new SmallStringsStorage);130 m_storage = adoptPtr(new SmallStringsStorage); 130 131 ASSERT(!m_singleCharacterStrings[character]); 131 132 m_singleCharacterStrings[character] = new (globalData) JSString(globalData, m_storage->rep(character), JSString::HasOtherOwner); … … 135 136 { 136 137 if (!m_storage) 137 m_storage .set(new SmallStringsStorage);138 m_storage = adoptPtr(new SmallStringsStorage); 138 139 return m_storage->rep(character); 139 140 } -
trunk/JavaScriptCore/wtf/unicode/icu/CollatorICU.cpp
r55120 r62677 70 70 #endif 71 71 char buf[256]; 72 if (collationOrder) { 73 CFStringGetCString(collationOrder, buf, sizeof(buf), kCFStringEncodingASCII); 74 return new Collator(buf); 75 } else 76 return new Collator(""); 72 if (!collationOrder) 73 return adoptPtr(new Collator("")); 74 CFStringGetCString(collationOrder, buf, sizeof(buf), kCFStringEncodingASCII); 75 return adoptPtr(new Collator(buf)); 77 76 #else 78 return new Collator(0);77 return adoptPtr(new Collator(0)); 79 78 #endif 80 79 } -
trunk/JavaScriptCore/yarr/RegexInterpreter.cpp
r62386 r62677 1236 1236 : m_pattern(pattern) 1237 1237 { 1238 m_bodyDisjunction = 0;1239 1238 m_currentAlternativeIndex = 0; 1240 1239 } 1241 1240 1242 BytecodePattern*compile()1241 PassOwnPtr<BytecodePattern> compile() 1243 1242 { 1244 1243 regexBegin(m_pattern.m_numSubpatterns, m_pattern.m_body->m_callFrameSize); … … 1246 1245 regexEnd(); 1247 1246 1248 return new BytecodePattern(m_bodyDisjunction, m_allParenthesesInfo, m_pattern);1247 return adoptPtr(new BytecodePattern(m_bodyDisjunction.release(), m_allParenthesesInfo, m_pattern)); 1249 1248 } 1250 1249 … … 1449 1448 void regexBegin(unsigned numSubpatterns, unsigned callFrameSize) 1450 1449 { 1451 m_bodyDisjunction = new ByteDisjunction(numSubpatterns, callFrameSize);1450 m_bodyDisjunction = adoptPtr(new ByteDisjunction(numSubpatterns, callFrameSize)); 1452 1451 m_bodyDisjunction->terms.append(ByteTerm::BodyAlternativeBegin()); 1453 1452 m_bodyDisjunction->terms[0].frameLocation = 0; … … 1569 1568 private: 1570 1569 RegexPattern& m_pattern; 1571 ByteDisjunction*m_bodyDisjunction;1570 OwnPtr<ByteDisjunction> m_bodyDisjunction; 1572 1571 unsigned m_currentAlternativeIndex; 1573 1572 Vector<ParenthesesStackEntry> m_parenthesesStack; … … 1576 1575 1577 1576 1578 BytecodePattern*byteCompileRegex(const UString& patternString, unsigned& numSubpatterns, const char*& error, bool ignoreCase, bool multiline)1577 PassOwnPtr<BytecodePattern> byteCompileRegex(const UString& patternString, unsigned& numSubpatterns, const char*& error, bool ignoreCase, bool multiline) 1579 1578 { 1580 1579 RegexPattern pattern(ignoreCase, multiline); 1581 1580 1582 1581 if ((error = compileRegex(patternString, pattern))) 1583 return 0;1582 return PassOwnPtr<BytecodePattern>(); 1584 1583 1585 1584 numSubpatterns = pattern.m_numSubpatterns; -
trunk/JavaScriptCore/yarr/RegexInterpreter.h
r55633 r62677 1 1 /* 2 * Copyright (C) 2009 Apple Inc. All rights reserved.2 * Copyright (C) 2009, 2010 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 31 31 #include "RegexParser.h" 32 32 #include "RegexPattern.h" 33 #include <wtf/PassOwnPtr.h> 33 34 #include <wtf/unicode/Unicode.h> 34 35 … … 293 294 294 295 struct BytecodePattern : FastAllocBase { 295 BytecodePattern( ByteDisjunction*body, Vector<ByteDisjunction*> allParenthesesInfo, RegexPattern& pattern)296 BytecodePattern(PassOwnPtr<ByteDisjunction> body, Vector<ByteDisjunction*> allParenthesesInfo, RegexPattern& pattern) 296 297 : m_body(body) 297 298 , m_ignoreCase(pattern.m_ignoreCase) … … 326 327 }; 327 328 328 BytecodePattern*byteCompileRegex(const UString& pattern, unsigned& numSubpatterns, const char*& error, bool ignoreCase = false, bool multiline = false);329 PassOwnPtr<BytecodePattern> byteCompileRegex(const UString& pattern, unsigned& numSubpatterns, const char*& error, bool ignoreCase = false, bool multiline = false); 329 330 int interpretRegex(BytecodePattern* v_regex, const UChar* input, unsigned start, unsigned length, int* output); 330 331 -
trunk/WebCore/ChangeLog
r62676 r62677 1 2010-07-06 Darin Adler <darin@apple.com> 2 3 Reviewed by Adam Barth. 4 5 More OwnPtr work, including making clear set the pointer to 0 before deletion 6 https://bugs.webkit.org/show_bug.cgi?id=41727 7 8 * WebCore.exp.in: Updated. 9 10 * css/CSSSelector.h: 11 (WebCore::CSSSelector::RareData::RareData): Use adoptPtr. 12 (WebCore::CSSSelector::createRareData): Ditto. 13 * dom/SpaceSplitString.h: 14 (WebCore::SpaceSplitString::SpaceSplitString): Ditto. 15 (WebCore::SpaceSplitString::set): Ditto. 16 * history/CachedFrame.cpp: 17 (WebCore::CachedFrame::CachedFrame): Ditto. 18 (WebCore::CachedFrame::setCachedFramePlatformData): Ditto. 19 20 * history/CachedFrame.h: Use PassOwnPtr. 21 22 * loader/appcache/ApplicationCacheGroup.cpp: 23 (WebCore::CallCacheListenerTask::create): Use adoptPtr. 24 * loader/appcache/ApplicationCacheStorage.cpp: 25 (WebCore::ApplicationCacheStorage::storeCopyOfCache): Ditto. 26 * platform/PurgeableBuffer.h: 27 (WebCore::PurgeableBuffer::create): Ditto. 28 * platform/graphics/GlyphMetricsMap.h: 29 (WebCore::::locatePageSlowCase): Ditto. 30 * platform/graphics/GraphicsLayer.h: 31 (WebCore::AnimationValue::AnimationValue): Ditto. 32 (WebCore::TransformAnimationValue::TransformAnimationValue): Ditto. 33 * platform/graphics/MediaPlayer.h: 34 (WebCore::MediaPlayer::create): Ditto. 35 * platform/graphics/SimpleFontData.h: 36 (WebCore::SimpleFontData::boundsForGlyph): Ditto. 37 * platform/mac/PurgeableBufferMac.cpp: 38 (WebCore::PurgeableBuffer::create): Ditto. 39 * rendering/InlineFlowBox.h: 40 (WebCore::InlineFlowBox::setHorizontalOverflowPositions): Ditto. 41 (WebCore::InlineFlowBox::setVerticalOverflowPositions): Ditto. 42 * rendering/RootInlineBox.h: 43 (WebCore::RootInlineBox::floats): Ditto. 44 * rendering/style/RenderStyle.h: 45 (WebCore::InheritedFlags::inheritAnimations): Ditto. 46 (WebCore::InheritedFlags::inheritTransitions): Ditto. 47 48 * rendering/style/SVGRenderStyleDefs.h: Use PassOwnPtr. 49 1 50 2010-07-07 Sam Weinig <sam@webkit.org> 2 51 -
trunk/WebCore/WebCore.exp.in
r62676 r62677 143 143 __ZN7WebCore11BitmapImageC1EP7CGImagePNS_13ImageObserverE 144 144 __ZN7WebCore11CachedFrame23cachedFramePlatformDataEv 145 __ZN7WebCore11CachedFrame26setCachedFramePlatformDataE PNS_23CachedFramePlatformDataE145 __ZN7WebCore11CachedFrame26setCachedFramePlatformDataEN3WTF10PassOwnPtrINS_23CachedFramePlatformDataEEE 146 146 __ZN7WebCore11EditCommand7reapplyEv 147 147 __ZN7WebCore11EditCommand7unapplyEv -
trunk/WebCore/css/CSSSelector.h
r61752 r62677 27 27 #include <wtf/Noncopyable.h> 28 28 #include <wtf/OwnPtr.h> 29 #include <wtf/PassOwnPtr.h> 29 30 30 31 namespace WebCore { … … 284 285 285 286 struct RareData : Noncopyable { 286 RareData( CSSSelector*tagHistory)287 RareData(PassOwnPtr<CSSSelector> tagHistory) 287 288 : m_a(0) 288 289 , m_b(0) 289 290 , m_tagHistory(tagHistory) 290 , m_simpleSelector(0)291 291 , m_attribute(anyQName()) 292 292 , m_argument(nullAtom) … … 309 309 if (m_hasRareData) 310 310 return; 311 m_data.m_rareData = new RareData( m_data.m_tagHistory);311 m_data.m_rareData = new RareData(adoptPtr(m_data.m_tagHistory)); 312 312 m_hasRareData = true; 313 313 } -
trunk/WebCore/dom/SpaceSplitString.h
r51902 r62677 1 1 /* 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.2 * Copyright (C) 2007, 2008, 2010 Apple Inc. All rights reserved. 3 3 * 4 4 * This library is free software; you can redistribute it and/or … … 24 24 #include "AtomicString.h" 25 25 #include <wtf/OwnPtr.h> 26 #include <wtf/PassOwnPtr.h> 26 27 #include <wtf/Vector.h> 27 28 … … 65 66 public: 66 67 SpaceSplitString() { } 67 SpaceSplitString(const String& string, bool shouldFoldCase) : m_data( new SpaceSplitStringData(string, shouldFoldCase)) { }68 SpaceSplitString(const String& string, bool shouldFoldCase) : m_data(adoptPtr(new SpaceSplitStringData(string, shouldFoldCase))) { } 68 69 69 void set(const String& string, bool shouldFoldCase) { m_data .set(new SpaceSplitStringData(string, shouldFoldCase)); }70 void set(const String& string, bool shouldFoldCase) { m_data = adoptPtr(new SpaceSplitStringData(string, shouldFoldCase)); } 70 71 void clear() { m_data.clear(); } 71 72 -
trunk/WebCore/history/CachedFrame.cpp
r61801 r62677 125 125 // Active DOM objects must be suspended before we cached the frame script data 126 126 m_document->suspendActiveDOMObjects(); 127 m_cachedFrameScriptData .set(new ScriptCachedFrameData(frame));127 m_cachedFrameScriptData = adoptPtr(new ScriptCachedFrameData(frame)); 128 128 129 129 // Custom scrollbar renderers will get reattached when the document comes out of the page cache … … 233 233 } 234 234 235 void CachedFrame::setCachedFramePlatformData( CachedFramePlatformData*data)236 { 237 m_cachedFramePlatformData .set(data);235 void CachedFrame::setCachedFramePlatformData(PassOwnPtr<CachedFramePlatformData> data) 236 { 237 m_cachedFramePlatformData = data; 238 238 } 239 239 -
trunk/WebCore/history/CachedFrame.h
r53274 r62677 1 1 /* 2 * Copyright (C) 2009 Apple Inc. All rights reserved.2 * Copyright (C) 2009, 2010 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 29 29 #include "KURL.h" 30 30 #include "ScriptCachedFrameData.h" 31 #include <wtf/PassOwnPtr.h> 31 32 #include <wtf/RefPtr.h> 32 33 … … 76 77 void destroy(); 77 78 78 void setCachedFramePlatformData( CachedFramePlatformData* data);79 void setCachedFramePlatformData(PassOwnPtr<CachedFramePlatformData>); 79 80 CachedFramePlatformData* cachedFramePlatformData(); 80 81 -
trunk/WebCore/loader/appcache/ApplicationCacheGroup.cpp
r62505 r62677 1028 1028 static PassOwnPtr<CallCacheListenerTask> create(PassRefPtr<DocumentLoader> loader, ApplicationCacheHost::EventID eventID) 1029 1029 { 1030 return new CallCacheListenerTask(loader, eventID);1030 return adoptPtr(new CallCacheListenerTask(loader, eventID)); 1031 1031 } 1032 1032 -
trunk/WebCore/loader/appcache/ApplicationCacheStorage.cpp
r60729 r62677 1000 1000 1001 1001 // Now create a new cache group. 1002 OwnPtr<ApplicationCacheGroup> groupCopy( new ApplicationCacheGroup(cache->group()->manifestURL(), true));1002 OwnPtr<ApplicationCacheGroup> groupCopy(adoptPtr(new ApplicationCacheGroup(cache->group()->manifestURL(), true))); 1003 1003 1004 1004 groupCopy->setNewestCache(cacheCopy); -
trunk/WebCore/platform/PurgeableBuffer.h
r52791 r62677 1 1 /* 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved.2 * Copyright (C) 2008, 2010 Apple Inc. All Rights Reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 28 28 29 29 #include <wtf/Noncopyable.h> 30 #include <wtf/PassOwnPtr.h> 30 31 #include <wtf/Vector.h> 31 32 … … 34 35 class PurgeableBuffer : public Noncopyable { 35 36 public: 36 static P urgeableBuffer*create(const char* data, size_t);37 static P urgeableBuffer* create(const Vector<char>& v) { return create(v.data(), v.size()); }37 static PassOwnPtr<PurgeableBuffer> create(const char* data, size_t); 38 static PassOwnPtr<PurgeableBuffer> create(const Vector<char>& vector) { return create(vector.data(), vector.size()); } 38 39 39 40 ~PurgeableBuffer(); … … 64 65 65 66 #if !OS(DARWIN) || defined(BUILDING_ON_TIGER) || PLATFORM(QT) || PLATFORM(GTK) 66 inline P urgeableBuffer* PurgeableBuffer::create(const char*, size_t) { return 0; }67 inline PassOwnPtr<PurgeableBuffer> PurgeableBuffer::create(const char*, size_t) { return PassOwnPtr<PurgeableBuffer>(); } 67 68 inline PurgeableBuffer::~PurgeableBuffer() { } 68 69 inline const char* PurgeableBuffer::data() const { return 0; } -
trunk/WebCore/platform/graphics/GlyphMetricsMap.h
r62367 r62677 114 114 return page; 115 115 } else 116 m_pages .set(new HashMap<int, GlyphMetricsPage*>);116 m_pages = adoptPtr(new HashMap<int, GlyphMetricsPage*>); 117 117 page = new GlyphMetricsPage; 118 118 m_pages->set(pageNumber, page); -
trunk/WebCore/platform/graphics/GraphicsLayer.h
r62286 r62677 95 95 AnimationValue(float keyTime, const TimingFunction* timingFunction = 0) 96 96 : m_keyTime(keyTime) 97 , m_timingFunction(0)98 97 { 99 98 if (timingFunction) 100 m_timingFunction .set(new TimingFunction(*timingFunction));99 m_timingFunction = adoptPtr(new TimingFunction(*timingFunction)); 101 100 } 102 101 … … 133 132 { 134 133 if (value) 135 m_value .set(new TransformOperations(*value));134 m_value = adoptPtr(new TransformOperations(*value)); 136 135 } 137 136 -
trunk/WebCore/platform/graphics/MediaPlayer.h
r59915 r62677 145 145 static PassOwnPtr<MediaPlayer> create(MediaPlayerClient* client) 146 146 { 147 return new MediaPlayer(client);147 return adoptPtr(new MediaPlayer(client)); 148 148 } 149 149 virtual ~MediaPlayer(); -
trunk/WebCore/platform/graphics/SimpleFontData.h
r59577 r62677 32 32 #include "TypesettingFeatures.h" 33 33 #include <wtf/OwnPtr.h> 34 #include <wtf/PassOwnPtr.h> 34 35 35 36 #if USE(ATSUI) … … 265 266 bounds = platformBoundsForGlyph(glyph); 266 267 if (!m_glyphToBoundsMap) 267 m_glyphToBoundsMap .set(new GlyphMetricsMap<FloatRect>());268 m_glyphToBoundsMap = adoptPtr(new GlyphMetricsMap<FloatRect>); 268 269 m_glyphToBoundsMap->setMetricsForGlyph(glyph, bounds); 269 270 return bounds; -
trunk/WebCore/platform/mac/PurgeableBufferMac.cpp
r55483 r62677 51 51 } 52 52 53 P urgeableBuffer*PurgeableBuffer::create(const char* data, size_t size)53 PassOwnPtr<PurgeableBuffer> PurgeableBuffer::create(const char* data, size_t size) 54 54 { 55 55 if (size < minPurgeableBufferSize) 56 return 0;56 return PassOwnPtr<PurgeableBuffer>(); 57 57 58 58 vm_address_t buffer = 0; … … 61 61 ASSERT(ret == KERN_SUCCESS); 62 62 if (ret != KERN_SUCCESS) 63 return 0;63 return PassOwnPtr<PurgeableBuffer>(); 64 64 65 65 ret = vm_copy(mach_task_self(), reinterpret_cast<vm_address_t>(data), size, buffer); … … 68 68 if (ret != KERN_SUCCESS) { 69 69 vm_deallocate(mach_task_self(), buffer, size); 70 return 0;70 return PassOwnPtr<PurgeableBuffer>(); 71 71 } 72 72 73 return new PurgeableBuffer(reinterpret_cast<char*>(buffer), size);73 return adoptPtr(new PurgeableBuffer(reinterpret_cast<char*>(buffer), size)); 74 74 } 75 75 -
trunk/WebCore/rendering/InlineFlowBox.h
r62104 r62677 194 194 if (leftLayoutOverflow == m_x && rightLayoutOverflow == m_x + m_width && leftVisualOverflow == m_x && rightVisualOverflow == m_x + m_width) 195 195 return; 196 m_overflow .set(new RenderOverflow(IntRect(m_x, m_y, m_width, m_renderer->style(m_firstLine)->font().height())));196 m_overflow = adoptPtr(new RenderOverflow(IntRect(m_x, m_y, m_width, m_renderer->style(m_firstLine)->font().height()))); 197 197 } 198 198 … … 208 208 if (topLayoutOverflow == m_y && bottomLayoutOverflow == m_y + boxHeight && topVisualOverflow == m_y && bottomVisualOverflow == m_y + boxHeight) 209 209 return; 210 m_overflow .set(new RenderOverflow(IntRect(m_x, m_y, m_width, boxHeight)));210 m_overflow = adoptPtr(new RenderOverflow(IntRect(m_x, m_y, m_width, boxHeight))); 211 211 } 212 212 -
trunk/WebCore/rendering/RootInlineBox.h
r62104 r62677 119 119 ASSERT(!isDirty()); 120 120 if (!m_floats) 121 m_floats .set(new Vector<RenderBox*>());121 m_floats= adoptPtr(new Vector<RenderBox*>); 122 122 return *m_floats; 123 123 } -
trunk/WebCore/rendering/style/RenderStyle.h
r62035 r62677 1026 1026 } 1027 1027 1028 void inheritAnimations(const AnimationList* parent) { rareNonInheritedData.access()->m_animations .set(parent ? new AnimationList(*parent) : 0); }1029 void inheritTransitions(const AnimationList* parent) { rareNonInheritedData.access()->m_transitions .set(parent ? new AnimationList(*parent) : 0); }1028 void inheritAnimations(const AnimationList* parent) { rareNonInheritedData.access()->m_animations = parent ? adoptPtr(new AnimationList(*parent)) : PassOwnPtr<AnimationList>(); } 1029 void inheritTransitions(const AnimationList* parent) { rareNonInheritedData.access()->m_transitions = parent ? adoptPtr(new AnimationList(*parent)) : PassOwnPtr<AnimationList>(); } 1030 1030 void adjustAnimations(); 1031 1031 void adjustTransitions(); -
trunk/WebCore/rendering/style/SVGRenderStyleDefs.h
r60885 r62677 30 30 31 31 #if ENABLE(SVG) 32 32 33 #include "Color.h" 33 34 #include "PlatformString.h" 34 35 #include "ShadowData.h" 35 36 #include <wtf/OwnPtr.h> 37 #include <wtf/PassOwnPtr.h> 36 38 #include <wtf/RefCounted.h> 37 39 #include <wtf/RefPtr.h> … … 68 70 #define SVG_RS_DEFINE_ATTRIBUTE_DATAREF_WITH_INITIAL_OWNPTR(Data, Group, Variable, Type, Name, Initial) \ 69 71 Data* Name() const { return Group->Variable.get(); } \ 70 void set##Type( Data*obj) { \71 Group.access()->Variable .set(obj); \72 void set##Type(PassOwnPtr<Data> obj) { \ 73 Group.access()->Variable = obj; \ 72 74 } \ 73 75 static Data* initial##Type() { return Initial; } … … 301 303 302 304 #endif // ENABLE(SVG) 305 303 306 #endif // SVGRenderStyleDefs_h
Note: See TracChangeset
for help on using the changeset viewer.