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

Side by Side Diff: chrome/browser/extensions/api/activity_log_private/activity_log_private_api.cc

Issue 2153243003: [Extensions] Clean up unnecessary copy (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "chrome/browser/extensions/api/activity_log_private/activity_log_privat e_api.h" 5 #include "chrome/browser/extensions/api/activity_log_private/activity_log_privat e_api.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 return RespondNow(NoArguments()); 202 return RespondNow(NoArguments());
203 } 203 }
204 204
205 ExtensionFunction::ResponseAction ActivityLogPrivateDeleteUrlsFunction::Run() { 205 ExtensionFunction::ResponseAction ActivityLogPrivateDeleteUrlsFunction::Run() {
206 std::unique_ptr<activity_log_private::DeleteUrls::Params> params( 206 std::unique_ptr<activity_log_private::DeleteUrls::Params> params(
207 activity_log_private::DeleteUrls::Params::Create(*args_)); 207 activity_log_private::DeleteUrls::Params::Create(*args_));
208 EXTENSION_FUNCTION_VALIDATE(params.get()); 208 EXTENSION_FUNCTION_VALIDATE(params.get());
209 209
210 // Put the arguments in the right format. 210 // Put the arguments in the right format.
211 std::vector<GURL> gurls; 211 std::vector<GURL> gurls;
212 std::vector<std::string> urls = *params->urls.get(); 212 const std::vector<std::string>& urls = *params->urls;
213 for (std::vector<std::string>::iterator it = urls.begin(); 213 for (const std::string& url : urls)
214 it != urls.end(); 214 gurls.push_back(GURL(url));
215 ++it) {
216 gurls.push_back(GURL(*it));
217 }
218 215
219 ActivityLog* activity_log = ActivityLog::GetInstance(browser_context()); 216 ActivityLog* activity_log = ActivityLog::GetInstance(browser_context());
220 DCHECK(activity_log); 217 DCHECK(activity_log);
221 activity_log->RemoveURLs(gurls); 218 activity_log->RemoveURLs(gurls);
222 return RespondNow(NoArguments()); 219 return RespondNow(NoArguments());
223 } 220 }
224 221
225 } // namespace extensions 222 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698