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

Unified Diff: components/spellcheck/browser/feedback_sender.cc

Issue 2680563002: Revert of Remove ScopedVector in components/spellcheck (Closed)
Patch Set: Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/spellcheck/browser/feedback_sender.h ('k') | components/spellcheck/renderer/spellcheck.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/spellcheck/browser/feedback_sender.cc
diff --git a/components/spellcheck/browser/feedback_sender.cc b/components/spellcheck/browser/feedback_sender.cc
index ba5bffc99fd0fba31248ec63ec673c0e383ea9d8..5d7e8d00bd8c8c8747c3896f32ce9a7664210b14 100644
--- a/components/spellcheck/browser/feedback_sender.cc
+++ b/components/spellcheck/browser/feedback_sender.cc
@@ -376,9 +376,10 @@
}
void FeedbackSender::OnURLFetchComplete(const net::URLFetcher* source) {
- for (auto sender_it = senders_.begin(); sender_it != senders_.end();
+ for (ScopedVector<net::URLFetcher>::iterator sender_it = senders_.begin();
+ sender_it != senders_.end();
++sender_it) {
- if ((*sender_it).get() == source) {
+ if (*sender_it == source) {
senders_.erase(sender_it);
return;
}
@@ -440,14 +441,15 @@
// The tests use this identifier to mock the URL fetcher.
static const int kUrlFetcherId = 0;
- auto sender = net::URLFetcher::Create(kUrlFetcherId, feedback_service_url_,
- net::URLFetcher::POST, this);
+ net::URLFetcher* sender =
+ net::URLFetcher::Create(kUrlFetcherId, feedback_service_url_,
+ net::URLFetcher::POST, this).release();
data_use_measurement::DataUseUserData::AttachToFetcher(
- sender.get(), data_use_measurement::DataUseUserData::SPELL_CHECKER);
+ sender, data_use_measurement::DataUseUserData::SPELL_CHECKER);
sender->SetLoadFlags(net::LOAD_DO_NOT_SEND_COOKIES |
net::LOAD_DO_NOT_SAVE_COOKIES);
sender->SetUploadData("application/json", feedback);
- senders_.push_back(std::move(sender));
+ senders_.push_back(sender);
// Request context is nullptr in testing.
if (request_context_.get()) {
« no previous file with comments | « components/spellcheck/browser/feedback_sender.h ('k') | components/spellcheck/renderer/spellcheck.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698