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

Unified Diff: src/core/SkString.cpp

Issue 72603005: Guard against most unintentionally ephemeral SkAutoFoo instantiations. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: undo autoasciitolc Created 7 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/core/SkRasterClip.h ('k') | src/ports/SkFontHost_win.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkString.cpp
diff --git a/src/core/SkString.cpp b/src/core/SkString.cpp
index 4e5e204e8c0c3369f3cbe59ef9ae6c77c45ee4cc..7b3c265314f9d5048163261a683af8f86d6cd23f 100644
--- a/src/core/SkString.cpp
+++ b/src/core/SkString.cpp
@@ -626,27 +626,6 @@ void SkString::swap(SkString& other) {
///////////////////////////////////////////////////////////////////////////////
-SkAutoUCS2::SkAutoUCS2(const char utf8[]) {
- size_t len = strlen(utf8);
- fUCS2 = (uint16_t*)sk_malloc_throw((len + 1) * sizeof(uint16_t));
-
- uint16_t* dst = fUCS2;
- for (;;) {
- SkUnichar uni = SkUTF8_NextUnichar(&utf8);
- *dst++ = SkToU16(uni);
- if (uni == 0) {
- break;
- }
- }
- fCount = (int)(dst - fUCS2);
-}
-
-SkAutoUCS2::~SkAutoUCS2() {
- sk_free(fUCS2);
-}
-
-///////////////////////////////////////////////////////////////////////////////
-
SkString SkStringPrintf(const char* format, ...) {
SkString formattedOutput;
char buffer[kBufferSize];
« no previous file with comments | « src/core/SkRasterClip.h ('k') | src/ports/SkFontHost_win.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698