| OLD | NEW |
| 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/feedback/system_logs/system_logs_fetcher_base.h" | 5 #include "chrome/browser/feedback/system_logs/system_logs_fetcher_base.h" |
| 6 | 6 |
| 7 #include <utility> |
| 8 |
| 7 #include "base/bind.h" | 9 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| 9 #include "content/public/browser/browser_thread.h" | 11 #include "content/public/browser/browser_thread.h" |
| 10 | 12 |
| 11 using content::BrowserThread; | 13 using content::BrowserThread; |
| 12 | 14 |
| 13 namespace system_logs { | 15 namespace system_logs { |
| 14 | 16 |
| 15 SystemLogsSource::SystemLogsSource(const std::string& source_name) | 17 SystemLogsSource::SystemLogsSource(const std::string& source_name) |
| 16 : source_name_(source_name) { | 18 : source_name_(source_name) { |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 ++it) { | 53 ++it) { |
| 52 // It is an error to insert an element with a pre-existing key. | 54 // It is an error to insert an element with a pre-existing key. |
| 53 bool ok = response_->insert(*it).second; | 55 bool ok = response_->insert(*it).second; |
| 54 DCHECK(ok) << "Duplicate key found: " << it->first; | 56 DCHECK(ok) << "Duplicate key found: " << it->first; |
| 55 } | 57 } |
| 56 | 58 |
| 57 --num_pending_requests_; | 59 --num_pending_requests_; |
| 58 if (num_pending_requests_ > 0) | 60 if (num_pending_requests_ > 0) |
| 59 return; | 61 return; |
| 60 | 62 |
| 61 callback_.Run(response_.Pass()); | 63 callback_.Run(std::move(response_)); |
| 62 BrowserThread::DeleteSoon(BrowserThread::UI, FROM_HERE, this); | 64 BrowserThread::DeleteSoon(BrowserThread::UI, FROM_HERE, this); |
| 63 } | 65 } |
| 64 | 66 |
| 65 } // namespace system_logs | 67 } // namespace system_logs |
| OLD | NEW |