summaryrefslogtreecommitdiffstats
path: root/chrome/browser/metrics
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/metrics')
-rw-r--r--chrome/browser/metrics/metrics_service.cc22
-rw-r--r--chrome/browser/metrics/metrics_service.h13
2 files changed, 14 insertions, 21 deletions
diff --git a/chrome/browser/metrics/metrics_service.cc b/chrome/browser/metrics/metrics_service.cc
index 66a8eb6..d19f20d 100644
--- a/chrome/browser/metrics/metrics_service.cc
+++ b/chrome/browser/metrics/metrics_service.cc
@@ -179,6 +179,7 @@
#include "content/browser/plugin_service.h"
#include "content/browser/renderer_host/render_process_host.h"
#include "content/common/child_process_info.h"
+#include "content/common/net/url_fetcher.h"
#include "content/public/browser/notification_service.h"
#include "webkit/plugins/npapi/plugin_list.h"
#include "webkit/plugins/webplugininfo.h"
@@ -1068,22 +1069,17 @@ static const char* StatusToString(const net::URLRequestStatus& status) {
}
}
-void MetricsService::OnURLFetchComplete(const URLFetcher* source,
- const GURL& url,
- const net::URLRequestStatus& status,
- int response_code,
- const net::ResponseCookies& cookies,
- const std::string& data) {
+void MetricsService::OnURLFetchComplete(const URLFetcher* source) {
DCHECK(waiting_for_asynchronus_reporting_step_);
waiting_for_asynchronus_reporting_step_ = false;
DCHECK(current_fetch_.get());
current_fetch_.reset(NULL); // We're not allowed to re-use it.
// Confirm send so that we can move on.
- VLOG(1) << "METRICS RESPONSE CODE: " << response_code
- << " status=" << StatusToString(status);
+ VLOG(1) << "METRICS RESPONSE CODE: " << source->response_code()
+ << " status=" << StatusToString(source->status());
- bool upload_succeeded = response_code == 200;
+ bool upload_succeeded = source->response_code() == 200;
// Provide boolean for error recovery (allow us to ignore response_code).
bool discard_log = false;
@@ -1095,7 +1091,7 @@ void MetricsService::OnURLFetchComplete(const URLFetcher* source,
"UMA.Large Rejected Log was Discarded",
static_cast<int>(log_manager_.staged_log_text().length()));
discard_log = true;
- } else if (response_code == 400) {
+ } else if (source->response_code() == 400) {
// Bad syntax. Retransmission won't work.
UMA_HISTOGRAM_COUNTS("UMA.Unacceptable_Log_Discarded", state_);
discard_log = true;
@@ -1103,9 +1099,11 @@ void MetricsService::OnURLFetchComplete(const URLFetcher* source,
if (!upload_succeeded && !discard_log) {
VLOG(1) << "METRICS: transmission attempt returned a failure code: "
- << response_code << ". Verify network connectivity";
+ << source->response_code() << ". Verify network connectivity";
LogBadResponseCode();
} else { // Successful receipt (or we are discarding log).
+ std::string data;
+ source->GetResponseAsString(&data);
VLOG(1) << "METRICS RESPONSE DATA: " << data;
switch (state_) {
case INITIAL_LOG_READY:
@@ -1138,7 +1136,7 @@ void MetricsService::OnURLFetchComplete(const URLFetcher* source,
// Error 400 indicates a problem with the log, not with the server, so
// don't consider that a sign that the server is in trouble.
- bool server_is_healthy = upload_succeeded || response_code == 400;
+ bool server_is_healthy = upload_succeeded || source->response_code() == 400;
scheduler_->UploadFinished(server_is_healthy,
log_manager_.has_unsent_logs());
diff --git a/chrome/browser/metrics/metrics_service.h b/chrome/browser/metrics/metrics_service.h
index fc91621..75bff65 100644
--- a/chrome/browser/metrics/metrics_service.h
+++ b/chrome/browser/metrics/metrics_service.h
@@ -19,7 +19,7 @@
#include "base/process_util.h"
#include "chrome/browser/io_thread.h"
#include "chrome/common/metrics_helpers.h"
-#include "content/common/net/url_fetcher.h"
+#include "content/public/common/url_fetcher_delegate.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
@@ -52,7 +52,7 @@ struct WebPluginInfo;
class MetricsService : public content::NotificationObserver,
- public URLFetcher::Delegate,
+ public content::URLFetcherDelegate,
public MetricsServiceBase {
public:
MetricsService();
@@ -229,14 +229,9 @@ class MetricsService : public content::NotificationObserver,
// copy of the staged log.
void PrepareFetchWithStagedLog();
- // Implementation of URLFetcher::Delegate. Called after transmission
+ // Implementation of content::URLFetcherDelegate. Called after transmission
// completes (either successfully or with failure).
- virtual void OnURLFetchComplete(const URLFetcher* source,
- const GURL& url,
- const net::URLRequestStatus& status,
- int response_code,
- const net::ResponseCookies& cookies,
- const std::string& data);
+ virtual void OnURLFetchComplete(const URLFetcher* source);
// Logs debugging details, for the case where the server returns a response
// code other than 200.