Changeset 90911 in webkit
- Timestamp:
- Jul 13, 2011 6:31:23 AM (13 years ago)
- Location:
- trunk/Source
- Files:
-
- 1 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r90877 r90911 1 2011-07-13 MORITA Hajime <morrita@google.com> 2 3 Refactoring: Ignored ExceptionCode value should be less annoying. 4 https://bugs.webkit.org/show_bug.cgi?id=63688 5 6 Added ASSERT_AT macro. 7 8 Reviewed by Darin Adler. 9 10 * wtf/Assertions.h: 11 1 12 2011-07-12 Filip Pizlo <fpizlo@apple.com> 2 13 -
trunk/Source/JavaScriptCore/wtf/Assertions.h
r86499 r90911 236 236 237 237 #define ASSERT(assertion) ((void)0) 238 #define ASSERT_AT(assertion, file, line, function) ((void)0) 238 239 #define ASSERT_NOT_REACHED() ((void)0) 239 240 … … 251 252 if (!(assertion)) { \ 252 253 WTFReportAssertionFailure(__FILE__, __LINE__, WTF_PRETTY_FUNCTION, #assertion); \ 254 CRASH(); \ 255 } \ 256 while (0) 257 258 #define ASSERT_AT(assertion, file, line, function) do \ 259 if (!(assertion)) { \ 260 WTFReportAssertionFailure(file, line, function, #assertion); \ 253 261 CRASH(); \ 254 262 } \ -
trunk/Source/WebCore/ChangeLog
r90908 r90911 1 2011-07-13 MORITA Hajime <morrita@google.com> 2 3 Refactoring: Ignored ExceptionCode value should be less annoying. 4 https://bugs.webkit.org/show_bug.cgi?id=63688 5 6 - Introduced ExceptionCodePlaceholder class for the default parameter of ExceptionCode. 7 - Introduced ASSERT_NO_EXCEPTION to check ExceptionCode not set to non-zero after the call. 8 - Adopted ASSERT_NO_EXCEPTION in Range.cpp 9 10 No new tests. No behaviour change. 11 12 Reviewed by Darin Adler. 13 14 * GNUmakefile.list.am: 15 * WebCore.gypi: 16 * WebCore.xcodeproj/project.pbxproj: 17 * dom/ExceptionCodePlaceholder.h: Added. 18 (WebCore::ExceptionCodePlaceholder::ExceptionCodePlaceholder): 19 (WebCore::ExceptionCodePlaceholder::operator ExceptionCode& ): 20 (WebCore::IgnorableExceptionCode::IgnorableExceptionCode): 21 (WebCore::CheckedExceptionCode::CheckedExceptionCode): 22 (WebCore::CheckedExceptionCode::~CheckedExceptionCode): 23 * dom/Range.cpp: 24 (WebCore::Range::Range): 25 (WebCore::Range::editingStartPosition): 26 * dom/Range.h: 27 1 28 2011-07-13 Nikolas Zimmermann <nzimmermann@rim.com> 2 29 -
trunk/Source/WebCore/GNUmakefile.list.am
r90849 r90911 1177 1177 Source/WebCore/dom/FragmentScriptingPermission.h \ 1178 1178 Source/WebCore/dom/IgnoreDestructiveWriteCountIncrementer.h \ 1179 Source/WebCore/dom/ExceptionCodePlaceholder.h \ 1179 1180 Source/WebCore/dom/IconURL.cpp \ 1180 1181 Source/WebCore/dom/IconURL.h \ -
trunk/Source/WebCore/WebCore.gypi
r90872 r90911 539 539 'dom/Node.h', 540 540 'dom/NodeList.h', 541 'dom/NeverThrown.h', 541 542 'dom/PendingScript.h', 542 543 'dom/Position.h', … … 2508 2509 'dom/HashChangeEvent.h', 2509 2510 'dom/IgnoreDestructiveWriteCountIncrementer.h', 2511 'dom/ExceptionCodePlaceholder.h', 2510 2512 'dom/IconURL.cpp', 2511 2513 'dom/IconURL.h', -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r90872 r90911 3286 3286 A73F95FE12C97BFE0031AAF9 /* RoundedRect.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A73F95FC12C97BFE0031AAF9 /* RoundedRect.cpp */; }; 3287 3287 A73F95FF12C97BFE0031AAF9 /* RoundedRect.h in Headers */ = {isa = PBXBuildFile; fileRef = A73F95FD12C97BFE0031AAF9 /* RoundedRect.h */; settings = {ATTRIBUTES = (Private, ); }; }; 3288 A74BB76B13BDA86300FF7BF0 /* ExceptionCodePlaceholder.h in Headers */ = {isa = PBXBuildFile; fileRef = A74BB76A13BDA86300FF7BF0 /* ExceptionCodePlaceholder.h */; settings = {ATTRIBUTES = (Private, ); }; }; 3288 3289 A74C2D3C13811E0D00F83572 /* ShadowContentElement.h in Headers */ = {isa = PBXBuildFile; fileRef = A74C2D3B13811E0D00F83572 /* ShadowContentElement.h */; settings = {ATTRIBUTES = (Private, ); }; }; 3289 3290 A75E497610752ACB00C9B896 /* SerializedScriptValue.h in Headers */ = {isa = PBXBuildFile; fileRef = A75E497410752ACB00C9B896 /* SerializedScriptValue.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 9803 9804 A73F95FC12C97BFE0031AAF9 /* RoundedRect.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RoundedRect.cpp; sourceTree = "<group>"; }; 9804 9805 A73F95FD12C97BFE0031AAF9 /* RoundedRect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RoundedRect.h; sourceTree = "<group>"; }; 9806 A74BB76A13BDA86300FF7BF0 /* ExceptionCodePlaceholder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ExceptionCodePlaceholder.h; sourceTree = "<group>"; }; 9805 9807 A74C2D3B13811E0D00F83572 /* ShadowContentElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ShadowContentElement.h; sourceTree = "<group>"; }; 9806 9808 A75E497410752ACB00C9B896 /* SerializedScriptValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SerializedScriptValue.h; sourceTree = "<group>"; }; … … 19622 19624 93831B560D087D6000E5C984 /* ExceptionCode.cpp */, 19623 19625 935FBCF109BA143B00E230B1 /* ExceptionCode.h */, 19626 A74BB76A13BDA86300FF7BF0 /* ExceptionCodePlaceholder.h */, 19624 19627 B12D233513560282002A28D4 /* ExclusiveTrackList.cpp */, 19625 19628 B12D233613560282002A28D4 /* ExclusiveTrackList.h */, … … 21116 21119 BC60D8F30D2A11E000B9918F /* ExceptionBase.h in Headers */, 21117 21120 935FBCF209BA143B00E230B1 /* ExceptionCode.h in Headers */, 21121 A74BB76B13BDA86300FF7BF0 /* ExceptionCodePlaceholder.h in Headers */, 21118 21122 148AFDA50AF58360008CC700 /* ExceptionHandlers.h in Headers */, 21119 21123 B12D233F13560282002A28D4 /* ExclusiveTrackList.h in Headers */, -
trunk/Source/WebCore/dom/Range.cpp
r90130 r90911 89 89 // Simply setting the containers and offsets directly would not do any of the checking 90 90 // that setStart and setEnd do, so we call those functions. 91 ExceptionCode ec = 0; 92 setStart(startContainer, startOffset, ec); 93 ASSERT(!ec); 94 setEnd(endContainer, endOffset, ec); 95 ASSERT(!ec); 91 setStart(startContainer, startOffset); 92 setEnd(endContainer, endOffset); 96 93 } 97 94 … … 1596 1593 return Position(); 1597 1594 1598 ExceptionCode ec = 0;1599 1595 // if the selection is a caret, just return the position, since the style 1600 1596 // behind us is relevant 1601 if (collapsed( ec))1597 if (collapsed()) 1602 1598 return visiblePosition.deepEquivalent(); 1603 1599 -
trunk/Source/WebCore/dom/Range.h
r86135 r90911 26 26 #define Range_h 27 27 28 #include "ExceptionCodePlaceholder.h" 28 29 #include "FloatRect.h" 29 30 #include "IntRect.h" … … 62 63 Node* endContainer(ExceptionCode&) const; 63 64 int endOffset(ExceptionCode&) const; 64 bool collapsed(ExceptionCode& ) const;65 bool collapsed(ExceptionCode& = ASSERT_NO_EXCEPTION) const; 65 66 66 67 Node* commonAncestorContainer(ExceptionCode&) const; 67 68 static Node* commonAncestorContainer(Node* containerA, Node* containerB); 68 void setStart(PassRefPtr<Node> container, int offset, ExceptionCode& );69 void setEnd(PassRefPtr<Node> container, int offset, ExceptionCode& );69 void setStart(PassRefPtr<Node> container, int offset, ExceptionCode& = ASSERT_NO_EXCEPTION); 70 void setEnd(PassRefPtr<Node> container, int offset, ExceptionCode& = ASSERT_NO_EXCEPTION); 70 71 void collapse(bool toStart, ExceptionCode&); 71 72 bool isPointInRange(Node* refNode, int offset, ExceptionCode&);
Note: See TracChangeset
for help on using the changeset viewer.