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

Unified Diff: chrome/browser/chromeos/system_logs/scrubbed_system_logs_fetcher.cc

Issue 22532012: Use scrubbed logs for sending with feedback reports. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 4 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
Index: chrome/browser/chromeos/system_logs/scrubbed_system_logs_fetcher.cc
diff --git a/chrome/browser/chromeos/system_logs/system_logs_fetcher.cc b/chrome/browser/chromeos/system_logs/scrubbed_system_logs_fetcher.cc
similarity index 51%
copy from chrome/browser/chromeos/system_logs/system_logs_fetcher.cc
copy to chrome/browser/chromeos/system_logs/scrubbed_system_logs_fetcher.cc
index e34c06dd11cf4fccffc73bc24cccd26c4f20e28a..1a096c9ed5c9f9cf56b524dcdcd81b56ede51a2b 100644
--- a/chrome/browser/chromeos/system_logs/system_logs_fetcher.cc
+++ b/chrome/browser/chromeos/system_logs/scrubbed_system_logs_fetcher.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/chromeos/system_logs/system_logs_fetcher.h"
+#include "chrome/browser/chromeos/system_logs/scrubbed_system_logs_fetcher.h"
#include "base/bind.h"
#include "base/bind_helpers.h"
@@ -20,12 +20,9 @@ using content::BrowserThread;
namespace chromeos {
-SystemLogsFetcher::SystemLogsFetcher()
- : response_(new SystemLogsResponse),
- num_pending_requests_(0),
- weak_ptr_factory_(this) {
+ScrubbedSystemLogsFetcher::ScrubbedSystemLogsFetcher() {
// Debug Daemon data source.
- data_sources_.push_back(new DebugDaemonLogSource());
+ data_sources_.push_back(new DebugDaemonLogSource(true));
stevenjb 2013/08/09 02:18:51 Is this the only difference between Scrubbed and A
rkc 2013/08/09 18:24:18 Currently this is the only difference, but scrubbi
stevenjb 2013/08/09 18:52:44 OK, fair enough. Maybe add as a TODO here? Also, d
rkc 2013/08/09 20:17:36 Added the TODO to the class header itself. Done.
// Chrome data sources.
data_sources_.push_back(new ChromeInternalLogSource());
@@ -39,37 +36,10 @@ SystemLogsFetcher::SystemLogsFetcher()
num_pending_requests_ = data_sources_.size();
}
-SystemLogsFetcher::~SystemLogsFetcher() {}
+ScrubbedSystemLogsFetcher::~ScrubbedSystemLogsFetcher() {}
stevenjb 2013/08/09 02:18:51 nit: } on next line
rkc 2013/08/09 18:24:18 Done.
-void SystemLogsFetcher::Fetch(const SysLogsFetcherCallback& callback) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
- DCHECK(callback_.is_null());
- DCHECK(!callback.is_null());
-
- callback_ = callback;
- for (size_t i = 0; i < data_sources_.size(); ++i) {
- data_sources_[i]->Fetch(base::Bind(&SystemLogsFetcher::AddResponse,
- weak_ptr_factory_.GetWeakPtr()));
- }
-}
-
-void SystemLogsFetcher::AddResponse(SystemLogsResponse* response) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
-
- for (SystemLogsResponse::const_iterator it = response->begin();
- it != response->end();
- ++it) {
- // It is an error to insert an element with a pre-existing key.
- bool ok = response_->insert(*it).second;
- DCHECK(ok) << "Duplicate key found: " << it->first;
- }
-
- --num_pending_requests_;
- if (num_pending_requests_ > 0)
- return;
-
- callback_.Run(response_.Pass());
- BrowserThread::DeleteSoon(BrowserThread::UI, FROM_HERE, this);
+base::WeakPtr<SystemLogsFetcherBase> ScrubbedSystemLogsFetcher::GetWeakPtr() {
+ return AsWeakPtr();
}
} // namespace chromeos

Powered by Google App Engine
This is Rietveld 408576698