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

Side by Side Diff: components/dom_distiller/ios/distiller_page_ios.mm

Issue 2664753002: Remove base::StringValue (Closed)
Patch Set: Rebase Created 3 years, 9 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 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/dom_distiller/ios/distiller_page_ios.h" 5 #include "components/dom_distiller/ios/distiller_page_ios.h"
6 6
7 #import <UIKit/UIKit.h> 7 #import <UIKit/UIKit.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 43
44 std::unique_ptr<base::Value> result; 44 std::unique_ptr<base::Value> result;
45 45
46 if (max_depth < 0) { 46 if (max_depth < 0) {
47 DLOG(WARNING) << "JS maximum recursion depth exceeded."; 47 DLOG(WARNING) << "JS maximum recursion depth exceeded.";
48 return result; 48 return result;
49 } 49 }
50 50
51 CFTypeID result_type = CFGetTypeID(wk_result); 51 CFTypeID result_type = CFGetTypeID(wk_result);
52 if (result_type == CFStringGetTypeID()) { 52 if (result_type == CFStringGetTypeID()) {
53 result.reset(new base::StringValue(base::SysNSStringToUTF16(wk_result))); 53 result.reset(new base::Value(base::SysNSStringToUTF16(wk_result)));
54 DCHECK(result->IsType(base::Value::Type::STRING)); 54 DCHECK(result->IsType(base::Value::Type::STRING));
55 } else if (result_type == CFNumberGetTypeID()) { 55 } else if (result_type == CFNumberGetTypeID()) {
56 // Different implementation is here. 56 // Different implementation is here.
57 if ([wk_result intValue] != [wk_result doubleValue]) { 57 if ([wk_result intValue] != [wk_result doubleValue]) {
58 result.reset(new base::Value([wk_result doubleValue])); 58 result.reset(new base::Value([wk_result doubleValue]));
59 DCHECK(result->IsType(base::Value::Type::DOUBLE)); 59 DCHECK(result->IsType(base::Value::Type::DOUBLE));
60 } else { 60 } else {
61 result.reset(new base::Value([wk_result intValue])); 61 result.reset(new base::Value([wk_result intValue]));
62 DCHECK(result->IsType(base::Value::Type::INTEGER)); 62 DCHECK(result->IsType(base::Value::Type::INTEGER));
63 } 63 }
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 } 238 }
239 OnDistillationDone(url_, resultValue.get()); 239 OnDistillationDone(url_, resultValue.get());
240 } 240 }
241 241
242 std::unique_ptr<base::Value> DistillerPageIOS::ValueResultFromScriptResult( 242 std::unique_ptr<base::Value> DistillerPageIOS::ValueResultFromScriptResult(
243 id wk_result) { 243 id wk_result) {
244 return ::ValueResultFromScriptResult(wk_result, 244 return ::ValueResultFromScriptResult(wk_result,
245 kMaximumParsingRecursionDepth); 245 kMaximumParsingRecursionDepth);
246 } 246 }
247 } // namespace dom_distiller 247 } // namespace dom_distiller
OLDNEW
« no previous file with comments | « components/dom_distiller/core/viewer.cc ('k') | components/json_schema/json_schema_validator_unittest_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698