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

Side by Side Diff: third_party/WebKit/Source/wtf/text/StringConcatenate.cpp

Issue 1859513002: Revert of Replace all occurrences of RELEASE_ASSERT in wtf with CHECK. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: [rebase: remove BitArray.h diff] Created 4 years, 8 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 2014 The Chromium Authors. All rights reserved. 2 * Copyright 2014 The Chromium Authors. All rights reserved.
3 * Use of this source code is governed by a BSD-style license that can be 3 * Use of this source code is governed by a BSD-style license that can be
4 * found in the LICENSE file. 4 * found in the LICENSE file.
5 */ 5 */
6 6
7 #include "wtf/text/StringConcatenate.h" 7 #include "wtf/text/StringConcatenate.h"
8 8
9 // This macro is helpful for testing how many intermediate Strings are created w hile evaluating an 9 // This macro is helpful for testing how many intermediate Strings are created w hile evaluating an
10 // expression containing operator+. 10 // expression containing operator+.
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 StringImpl::copyChars(destination, m_buffer, m_length); 42 StringImpl::copyChars(destination, m_buffer, m_length);
43 } 43 }
44 44
45 WTF::StringTypeAdapter<const UChar*>::StringTypeAdapter(const UChar* buffer) 45 WTF::StringTypeAdapter<const UChar*>::StringTypeAdapter(const UChar* buffer)
46 : m_buffer(buffer) 46 : m_buffer(buffer)
47 { 47 {
48 size_t len = 0; 48 size_t len = 0;
49 while (m_buffer[len] != UChar(0)) 49 while (m_buffer[len] != UChar(0))
50 ++len; 50 ++len;
51 51
52 CHECK_LE(len, std::numeric_limits<unsigned>::max()); 52 RELEASE_ASSERT(len <= std::numeric_limits<unsigned>::max());
53 53
54 m_length = len; 54 m_length = len;
55 } 55 }
56 56
57 void WTF::StringTypeAdapter<const UChar*>::writeTo(UChar* destination) 57 void WTF::StringTypeAdapter<const UChar*>::writeTo(UChar* destination)
58 { 58 {
59 memcpy(destination, m_buffer, m_length * sizeof(UChar)); 59 memcpy(destination, m_buffer, m_length * sizeof(UChar));
60 } 60 }
61 61
62 WTF::StringTypeAdapter<const char*>::StringTypeAdapter(const char* buffer) 62 WTF::StringTypeAdapter<const char*>::StringTypeAdapter(const char* buffer)
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 destination[i] = data[i]; 140 destination[i] = data[i];
141 } else { 141 } else {
142 const UChar* data = m_buffer.characters16(); 142 const UChar* data = m_buffer.characters16();
143 for (unsigned i = 0; i < length; ++i) 143 for (unsigned i = 0; i < length; ++i)
144 destination[i] = data[i]; 144 destination[i] = data[i];
145 } 145 }
146 146
147 WTF_STRINGTYPEADAPTER_COPIED_WTF_STRING(); 147 WTF_STRINGTYPEADAPTER_COPIED_WTF_STRING();
148 } 148 }
149 149
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/wtf/text/StringConcatenate.h ('k') | third_party/WebKit/Source/wtf/text/StringImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698