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

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

Issue 1548203002: Convert Pass()→std::move() in //components/[n-z]* (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix bad headers Created 4 years, 12 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_message_filter.h" 5 #include "components/safe_json/safe_json_parser_message_filter.h"
6 6
7 #include <utility>
8
7 #include "base/json/json_reader.h" 9 #include "base/json/json_reader.h"
8 #include "base/values.h" 10 #include "base/values.h"
9 #include "components/safe_json/safe_json_parser_messages.h" 11 #include "components/safe_json/safe_json_parser_messages.h"
10 #include "content/public/utility/utility_thread.h" 12 #include "content/public/utility/utility_thread.h"
11 #include "ipc/ipc_message.h" 13 #include "ipc/ipc_message.h"
12 14
13 namespace { 15 namespace {
14 16
15 bool Send(IPC::Message* message) { 17 bool Send(IPC::Message* message) {
16 return content::UtilityThread::Get()->Send(message); 18 return content::UtilityThread::Get()->Send(message);
(...skipping 19 matching lines...) Expand all
36 return handled; 38 return handled;
37 } 39 }
38 40
39 void SafeJsonParserMessageFilter::OnParseJSON(const std::string& json) { 41 void SafeJsonParserMessageFilter::OnParseJSON(const std::string& json) {
40 int error_code; 42 int error_code;
41 std::string error; 43 std::string error;
42 scoped_ptr<base::Value> value = base::JSONReader::ReadAndReturnError( 44 scoped_ptr<base::Value> value = base::JSONReader::ReadAndReturnError(
43 json, base::JSON_PARSE_RFC, &error_code, &error); 45 json, base::JSON_PARSE_RFC, &error_code, &error);
44 if (value) { 46 if (value) {
45 base::ListValue wrapper; 47 base::ListValue wrapper;
46 wrapper.Append(value.Pass()); 48 wrapper.Append(std::move(value));
47 Send(new SafeJsonParserHostMsg_ParseJSON_Succeeded(wrapper)); 49 Send(new SafeJsonParserHostMsg_ParseJSON_Succeeded(wrapper));
48 } else { 50 } else {
49 Send(new SafeJsonParserHostMsg_ParseJSON_Failed(error)); 51 Send(new SafeJsonParserHostMsg_ParseJSON_Failed(error));
50 } 52 }
51 53
52 content::UtilityThread::Get()->ReleaseProcessIfNeeded(); 54 content::UtilityThread::Get()->ReleaseProcessIfNeeded();
53 } 55 }
54 56
55 } // namespace safe_json 57 } // namespace safe_json
OLDNEW
« no previous file with comments | « components/safe_json/safe_json_parser_impl.cc ('k') | components/scheduler/base/task_queue_manager_delegate_for_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698