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

Unified Diff: ui/base/resource/resource_bundle.cc

Issue 7890060: This broke lots of layout tests on OSX. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/base/resource/data_pack_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/resource/resource_bundle.cc
===================================================================
--- ui/base/resource/resource_bundle.cc (revision 101223)
+++ ui/base/resource/resource_bundle.cc (working copy)
@@ -11,7 +11,6 @@
#include "base/stl_util.h"
#include "base/string_piece.h"
#include "base/synchronization/lock.h"
-#include "base/utf_string_conversions.h"
#include "build/build_config.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "ui/base/l10n/l10n_util.h"
@@ -188,19 +187,10 @@
}
}
- // Strings should not be loaded from a data pack that contains binary data.
- DCHECK(locale_resources_data_->GetTextEncodingType() == DataPack::UTF16 ||
- locale_resources_data_->GetTextEncodingType() == DataPack::UTF8)
- << "requested localized string from binary pack file";
-
- // Data pack encodes strings as either UTF8 or UTF16.
- string16 msg;
- if (locale_resources_data_->GetTextEncodingType() == DataPack::UTF16) {
- msg = string16(reinterpret_cast<const char16*>(data.data()),
- data.length() / 2);
- } else if (locale_resources_data_->GetTextEncodingType() == DataPack::UTF8) {
- msg = UTF8ToUTF16(data);
- }
+ // Data pack encodes strings as UTF16.
+ DCHECK_EQ(data.length() % 2, 0U);
+ string16 msg(reinterpret_cast<const char16*>(data.data()),
+ data.length() / 2);
return msg;
}
« no previous file with comments | « ui/base/resource/data_pack_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698