| Index: chrome/browser/metrics/metrics_service.cc
|
| ===================================================================
|
| --- chrome/browser/metrics/metrics_service.cc (revision 106795)
|
| +++ chrome/browser/metrics/metrics_service.cc (working copy)
|
| @@ -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 @@
|
| }
|
| }
|
|
|
| -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 @@
|
| "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 @@
|
|
|
| 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;
|
| + CHECK(source->GetResponseAsString(&data));
|
| VLOG(1) << "METRICS RESPONSE DATA: " << data;
|
| switch (state_) {
|
| case INITIAL_LOG_READY:
|
| @@ -1138,7 +1136,7 @@
|
|
|
| // 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());
|
|
|