Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(47)

Side by Side Diff: Source/JavaScriptCore/wtf/ByteArray.h

Issue 8082012: Merge 96151 - Rapidly refreshing a feMorphology[erode] with r=0 can sometimes cause display corru... (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/874/
Patch Set: Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2009 Apple Inc. All Rights Reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 } 63 }
64 64
65 unsigned char get(unsigned index) const 65 unsigned char get(unsigned index) const
66 { 66 {
67 ASSERT(index < m_size); 67 ASSERT(index < m_size);
68 return m_data[index]; 68 return m_data[index];
69 } 69 }
70 70
71 unsigned char* data() { return m_data; } 71 unsigned char* data() { return m_data; }
72 72
73 void clear() { memset(m_data, 0, m_size); }
74
73 void deref() 75 void deref()
74 { 76 {
75 if (derefBase()) { 77 if (derefBase()) {
76 // We allocated with new unsigned char[] in create(), 78 // We allocated with new unsigned char[] in create(),
77 // and then used placement new to construct the object. 79 // and then used placement new to construct the object.
78 this->~ByteArray(); 80 this->~ByteArray();
79 delete[] reinterpret_cast<unsigned char*>(this); 81 delete[] reinterpret_cast<unsigned char*>(this);
80 } 82 }
81 } 83 }
82 84
(...skipping 12 matching lines...) Expand all
95 unsigned char m_data[INT_MAX]; 97 unsigned char m_data[INT_MAX];
96 #else 98 #else
97 unsigned char m_data[]; 99 unsigned char m_data[];
98 #endif 100 #endif
99 }; 101 };
100 } // namespace WTF 102 } // namespace WTF
101 103
102 using WTF::ByteArray; 104 using WTF::ByteArray;
103 105
104 #endif 106 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698