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

Unified Diff: base/json/json_parser.cc

Issue 10831322: Fix the failed case ValueStoreTest.DotsInKeyNamesWithDicts for Android (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Refine it according to rsesek's comments Created 8 years, 4 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
Index: base/json/json_parser.cc
diff --git a/base/json/json_parser.cc b/base/json/json_parser.cc
index 0cb59ee4947e42da3e5c60f7a85c08b21ddbf17b..00a6a63f21fa748b99cd9afa9d83eef138187113 100644
--- a/base/json/json_parser.cc
+++ b/base/json/json_parser.cc
@@ -208,7 +208,10 @@ JSONParser::~JSONParser() {
Value* JSONParser::Parse(const StringPiece& input) {
// TODO(rsesek): Windows has problems with StringPiece/hidden roots. Fix
// <http://crbug.com/126107> when my Windows box arrives.
-#if defined(OS_WIN)
+ // For Android, swapping string doesn't mean swapping internal pointers
+ // but swapping contents. Since it can't provide the performance gain,
+ // set the below flag to disable the optimization and make it work.
+#if defined(OS_WIN) || defined(OS_ANDROID)
options_ |= JSON_DETACHABLE_CHILDREN;
#endif
« no previous file with comments | « no previous file | build/android/gtest_filter/unit_tests_disabled » ('j') | build/android/gtest_filter/unit_tests_disabled » ('J')

Powered by Google App Engine
This is Rietveld 408576698