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

Side by Side Diff: extensions/browser/script_executor.cc

Issue 2323993004: Remove use of deprecated base::ListValue::Append(Value*) overload in extensions. (Closed)
Patch Set: ... I hate C++ Created 4 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 unified diff | Download patch
« no previous file with comments | « extensions/browser/event_router.cc ('k') | extensions/common/event_filter_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "extensions/browser/script_executor.h" 5 #include "extensions/browser/script_executor.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 bool is_root_frame = root_rfh_ == render_frame_host; 136 bool is_root_frame = root_rfh_ == render_frame_host;
137 137
138 // Set the result, if there is one. 138 // Set the result, if there is one.
139 const base::Value* script_value = nullptr; 139 const base::Value* script_value = nullptr;
140 if (result_list.Get(0u, &script_value)) { 140 if (result_list.Get(0u, &script_value)) {
141 // If this is the main result, we put it at index 0. Otherwise, we just 141 // If this is the main result, we put it at index 0. Otherwise, we just
142 // append it at the end. 142 // append it at the end.
143 if (is_root_frame && !results_.empty()) 143 if (is_root_frame && !results_.empty())
144 CHECK(results_.Insert(0u, script_value->DeepCopy())); 144 CHECK(results_.Insert(0u, script_value->DeepCopy()));
145 else 145 else
146 results_.Append(script_value->DeepCopy()); 146 results_.Append(script_value->CreateDeepCopy());
147 } 147 }
148 148
149 if (is_root_frame) { // Only use the root frame's error and url. 149 if (is_root_frame) { // Only use the root frame's error and url.
150 root_frame_error_ = error; 150 root_frame_error_ = error;
151 root_frame_url_ = on_url; 151 root_frame_url_ = on_url;
152 } 152 }
153 153
154 // Wait until the final request finishes before reporting back. 154 // Wait until the final request finishes before reporting back.
155 if (pending_render_frames_.empty()) 155 if (pending_render_frames_.empty())
156 Finish(); 156 Finish();
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 params.file_url = file_url; 269 params.file_url = file_url;
270 params.wants_result = (result_type == JSON_SERIALIZED_RESULT); 270 params.wants_result = (result_type == JSON_SERIALIZED_RESULT);
271 params.user_gesture = user_gesture; 271 params.user_gesture = user_gesture;
272 272
273 // Handler handles IPCs and deletes itself on completion. 273 // Handler handles IPCs and deletes itself on completion.
274 new Handler(script_observers_, web_contents_, params, frame_scope, frame_id, 274 new Handler(script_observers_, web_contents_, params, frame_scope, frame_id,
275 callback); 275 callback);
276 } 276 }
277 277
278 } // namespace extensions 278 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/event_router.cc ('k') | extensions/common/event_filter_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698