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

Side by Side Diff: components/safe_json/safe_json_parser_android.cc

Issue 1550383002: Convert Pass()→std::move() in //components (Android edition) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/safe_json/safe_json_parser_android.h" 5 #include "components/safe_json/safe_json_parser_android.h"
6 6
7 #include <utility>
8
7 #include "base/bind.h" 9 #include "base/bind.h"
8 #include "base/json/json_reader.h" 10 #include "base/json/json_reader.h"
9 #include "base/values.h" 11 #include "base/values.h"
10 #include "components/safe_json/json_sanitizer.h" 12 #include "components/safe_json/json_sanitizer.h"
11 13
12 namespace safe_json { 14 namespace safe_json {
13 15
14 SafeJsonParserAndroid::SafeJsonParserAndroid( 16 SafeJsonParserAndroid::SafeJsonParserAndroid(
15 const std::string& unsafe_json, 17 const std::string& unsafe_json,
16 const SuccessCallback& success_callback, 18 const SuccessCallback& success_callback,
(...skipping 21 matching lines...) Expand all
38 int error_code; 40 int error_code;
39 std::string error; 41 std::string error;
40 scoped_ptr<base::Value> value = base::JSONReader::ReadAndReturnError( 42 scoped_ptr<base::Value> value = base::JSONReader::ReadAndReturnError(
41 sanitized_json, base::JSON_PARSE_RFC, &error_code, &error); 43 sanitized_json, base::JSON_PARSE_RFC, &error_code, &error);
42 44
43 if (!value) { 45 if (!value) {
44 error_callback_.Run(error); 46 error_callback_.Run(error);
45 return; 47 return;
46 } 48 }
47 49
48 success_callback_.Run(value.Pass()); 50 success_callback_.Run(std::move(value));
49 } 51 }
50 52
51 void SafeJsonParserAndroid::OnSanitizationError(const std::string& error) { 53 void SafeJsonParserAndroid::OnSanitizationError(const std::string& error) {
52 error_callback_.Run(error); 54 error_callback_.Run(error);
53 delete this; 55 delete this;
54 } 56 }
55 57
56 } // namespace safe_json 58 } // namespace safe_json
OLDNEW
« no previous file with comments | « components/policy/core/browser/android/policy_converter.cc ('k') | components/sessions/core/in_memory_tab_restore_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698