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

Side by Side Diff: chrome/browser/metrics/metrics_service.cc

Issue 9572001: Do cookie checks in NetworkDelegate instead of the URLRequest::Delegate. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: clang fix Created 8 years, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 //------------------------------------------------------------------------------ 5 //------------------------------------------------------------------------------
6 // Description of the life cycle of a instance of MetricsService. 6 // Description of the life cycle of a instance of MetricsService.
7 // 7 //
8 // OVERVIEW 8 // OVERVIEW
9 // 9 //
10 // A MetricsService instance is typically created at application startup. It 10 // A MetricsService instance is typically created at application startup. It
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 #include "chrome/common/chrome_switches.h" 174 #include "chrome/common/chrome_switches.h"
175 #include "chrome/common/guid.h" 175 #include "chrome/common/guid.h"
176 #include "chrome/common/metrics/metrics_log_manager.h" 176 #include "chrome/common/metrics/metrics_log_manager.h"
177 #include "chrome/common/pref_names.h" 177 #include "chrome/common/pref_names.h"
178 #include "chrome/common/render_messages.h" 178 #include "chrome/common/render_messages.h"
179 #include "content/browser/load_notification_details.h" 179 #include "content/browser/load_notification_details.h"
180 #include "content/public/browser/child_process_data.h" 180 #include "content/public/browser/child_process_data.h"
181 #include "content/public/browser/notification_service.h" 181 #include "content/public/browser/notification_service.h"
182 #include "content/public/browser/plugin_service.h" 182 #include "content/public/browser/plugin_service.h"
183 #include "content/public/browser/render_process_host.h" 183 #include "content/public/browser/render_process_host.h"
184 #include "content/public/common/content_url_request_user_data.h"
184 #include "content/public/common/url_fetcher.h" 185 #include "content/public/common/url_fetcher.h"
185 #include "net/base/load_flags.h" 186 #include "net/base/load_flags.h"
186 #include "webkit/plugins/webplugininfo.h" 187 #include "webkit/plugins/webplugininfo.h"
187 188
188 // TODO(port): port browser_distribution.h. 189 // TODO(port): port browser_distribution.h.
189 #if !defined(OS_POSIX) 190 #if !defined(OS_POSIX)
190 #include "chrome/installer/util/browser_distribution.h" 191 #include "chrome/installer/util/browser_distribution.h"
191 #endif 192 #endif
192 193
193 #if defined(OS_CHROMEOS) 194 #if defined(OS_CHROMEOS)
(...skipping 890 matching lines...) Expand 10 before | Expand all | Expand 10 after
1084 DCHECK(!log_manager_.staged_log_text().empty()); 1085 DCHECK(!log_manager_.staged_log_text().empty());
1085 1086
1086 // Prepare the XML version. 1087 // Prepare the XML version.
1087 DCHECK(!current_fetch_xml_.get()); 1088 DCHECK(!current_fetch_xml_.get());
1088 current_fetch_xml_.reset(content::URLFetcher::Create( 1089 current_fetch_xml_.reset(content::URLFetcher::Create(
1089 GURL(server_url_xml_), content::URLFetcher::POST, this)); 1090 GURL(server_url_xml_), content::URLFetcher::POST, this));
1090 current_fetch_xml_->SetRequestContext( 1091 current_fetch_xml_->SetRequestContext(
1091 g_browser_process->system_request_context()); 1092 g_browser_process->system_request_context());
1092 current_fetch_xml_->SetUploadData(kMetricsTypeXml, 1093 current_fetch_xml_->SetUploadData(kMetricsTypeXml,
1093 log_manager_.staged_log_text().xml); 1094 log_manager_.staged_log_text().xml);
1095 // No user data, as the request will be cookie-less.
1096 current_fetch_xml_->SetContentURLRequestUserData(
1097 new content::ContentURLRequestUserData());
1094 // We already drop cookies server-side, but we might as well strip them out 1098 // We already drop cookies server-side, but we might as well strip them out
1095 // client-side as well. 1099 // client-side as well.
1096 current_fetch_xml_->SetLoadFlags(net::LOAD_DO_NOT_SAVE_COOKIES | 1100 current_fetch_xml_->SetLoadFlags(net::LOAD_DO_NOT_SAVE_COOKIES |
1097 net::LOAD_DO_NOT_SEND_COOKIES); 1101 net::LOAD_DO_NOT_SEND_COOKIES);
1098 1102
1099 // Prepare the protobuf version. 1103 // Prepare the protobuf version.
1100 DCHECK(!current_fetch_proto_.get()); 1104 DCHECK(!current_fetch_proto_.get());
1101 if (log_manager_.has_staged_log_proto()) { 1105 if (log_manager_.has_staged_log_proto()) {
1102 current_fetch_proto_.reset(content::URLFetcher::Create( 1106 current_fetch_proto_.reset(content::URLFetcher::Create(
1103 GURL(server_url_proto_), content::URLFetcher::POST, this)); 1107 GURL(server_url_proto_), content::URLFetcher::POST, this));
1104 current_fetch_proto_->SetRequestContext( 1108 current_fetch_proto_->SetRequestContext(
1105 g_browser_process->system_request_context()); 1109 g_browser_process->system_request_context());
1106 current_fetch_proto_->SetUploadData(kMetricsTypeProto, 1110 current_fetch_proto_->SetUploadData(kMetricsTypeProto,
1107 log_manager_.staged_log_text().proto); 1111 log_manager_.staged_log_text().proto);
1112 // No user data, as the request will be cookie-less.
1113 current_fetch_proto_->SetContentURLRequestUserData(
1114 new content::ContentURLRequestUserData());
1108 // We already drop cookies server-side, but we might as well strip them out 1115 // We already drop cookies server-side, but we might as well strip them out
1109 // client-side as well. 1116 // client-side as well.
1110 current_fetch_proto_->SetLoadFlags(net::LOAD_DO_NOT_SAVE_COOKIES | 1117 current_fetch_proto_->SetLoadFlags(net::LOAD_DO_NOT_SAVE_COOKIES |
1111 net::LOAD_DO_NOT_SEND_COOKIES); 1118 net::LOAD_DO_NOT_SEND_COOKIES);
1112 1119
1113 // Discard the protobuf version of the staged log, so that we will avoid 1120 // Discard the protobuf version of the staged log, so that we will avoid
1114 // re-uploading it even if we need to re-upload the XML version. 1121 // re-uploading it even if we need to re-upload the XML version.
1115 // TODO(isherman): Handle protobuf upload failures more gracefully once we 1122 // TODO(isherman): Handle protobuf upload failures more gracefully once we
1116 // transition away from the XML-based pipeline. 1123 // transition away from the XML-based pipeline.
1117 log_manager_.DiscardStagedLogProto(); 1124 log_manager_.DiscardStagedLogProto();
(...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after
1651 if (local_state) { 1658 if (local_state) {
1652 const PrefService::Preference* uma_pref = 1659 const PrefService::Preference* uma_pref =
1653 local_state->FindPreference(prefs::kMetricsReportingEnabled); 1660 local_state->FindPreference(prefs::kMetricsReportingEnabled);
1654 if (uma_pref) { 1661 if (uma_pref) {
1655 bool success = uma_pref->GetValue()->GetAsBoolean(&result); 1662 bool success = uma_pref->GetValue()->GetAsBoolean(&result);
1656 DCHECK(success); 1663 DCHECK(success);
1657 } 1664 }
1658 } 1665 }
1659 return result; 1666 return result;
1660 } 1667 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698