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

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

Issue 2658013002: Remove ScopedVector in components/spellcheck (Closed)
Patch Set: code rebase Created 3 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 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 5d7e8d00bd8c8c8747c3896f32ce9a7664210b14..ba5bffc99fd0fba31248ec63ec673c0e383ea9d8 100644
--- a/components/spellcheck/browser/feedback_sender.cc
+++ b/components/spellcheck/browser/feedback_sender.cc
@@ -376,10 +376,9 @@ void FeedbackSender::RandBytes(void* p, size_t len) {
}
void FeedbackSender::OnURLFetchComplete(const net::URLFetcher* source) {
- for (ScopedVector<net::URLFetcher>::iterator sender_it = senders_.begin();
- sender_it != senders_.end();
+ for (auto sender_it = senders_.begin(); sender_it != senders_.end();
++sender_it) {
- if (*sender_it == source) {
+ if ((*sender_it).get() == source) {
senders_.erase(sender_it);
return;
}
@@ -441,15 +440,14 @@ void FeedbackSender::SendFeedback(const std::vector<Misspelling>& feedback_data,
// The tests use this identifier to mock the URL fetcher.
static const int kUrlFetcherId = 0;
- net::URLFetcher* sender =
- net::URLFetcher::Create(kUrlFetcherId, feedback_service_url_,
- net::URLFetcher::POST, this).release();
+ auto sender = net::URLFetcher::Create(kUrlFetcherId, feedback_service_url_,
+ net::URLFetcher::POST, this);
data_use_measurement::DataUseUserData::AttachToFetcher(
- sender, data_use_measurement::DataUseUserData::SPELL_CHECKER);
+ sender.get(), 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(sender);
+ senders_.push_back(std::move(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