OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/spellchecker/feedback_sender.h" | 5 #include "chrome/browser/spellchecker/feedback_sender.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <iterator> | 8 #include <iterator> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 std::sort(known_renderers.begin(), known_renderers.end()); | 250 std::sort(known_renderers.begin(), known_renderers.end()); |
251 std::vector<int> dead_renderers; | 251 std::vector<int> dead_renderers; |
252 std::set_difference(known_renderers.begin(), | 252 std::set_difference(known_renderers.begin(), |
253 known_renderers.end(), | 253 known_renderers.end(), |
254 alive_renderers.begin(), | 254 alive_renderers.begin(), |
255 alive_renderers.end(), | 255 alive_renderers.end(), |
256 std::back_inserter(dead_renderers)); | 256 std::back_inserter(dead_renderers)); |
257 for (std::vector<int>::const_iterator it = dead_renderers.begin(); | 257 for (std::vector<int>::const_iterator it = dead_renderers.begin(); |
258 it != dead_renderers.end(); | 258 it != dead_renderers.end(); |
259 ++it) { | 259 ++it) { |
260 MessageLoop::current()->PostTask( | 260 base::MessageLoop::current()->PostTask( |
261 FROM_HERE, | 261 FROM_HERE, |
262 base::Bind(&FeedbackSender::OnReceiveDocumentMarkers, | 262 base::Bind(&FeedbackSender::OnReceiveDocumentMarkers, |
263 AsWeakPtr(), | 263 AsWeakPtr(), |
264 *it, | 264 *it, |
265 std::vector<uint32>())); | 265 std::vector<uint32>())); |
266 } | 266 } |
267 } | 267 } |
268 | 268 |
269 void FeedbackSender::FlushFeedback() { | 269 void FeedbackSender::FlushFeedback() { |
270 if (feedback_.Empty()) | 270 if (feedback_.Empty()) |
(...skipping 26 matching lines...) Expand all Loading... |
297 senders_.push_back(sender); | 297 senders_.push_back(sender); |
298 | 298 |
299 // Request context is NULL in testing. | 299 // Request context is NULL in testing. |
300 if (request_context_.get()) { | 300 if (request_context_.get()) { |
301 sender->SetRequestContext(request_context_.get()); | 301 sender->SetRequestContext(request_context_.get()); |
302 sender->Start(); | 302 sender->Start(); |
303 } | 303 } |
304 } | 304 } |
305 | 305 |
306 } // namespace spellcheck | 306 } // namespace spellcheck |
OLD | NEW |