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

Unified Diff: net/socket/client_socket.cc

Issue 6339012: More net/ method ordering. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More done while waiting for previous patch to clear Created 9 years, 11 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
« no previous file with comments | « net/proxy/proxy_list.cc ('k') | net/socket/client_socket_factory.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/socket/client_socket.cc
diff --git a/net/socket/client_socket.cc b/net/socket/client_socket.cc
index 6b12841ee842238544fee8720e72b94360f4ce50..3792c5c8007ff1becd6fafc1cf112d134a5a3dab 100644
--- a/net/socket/client_socket.cc
+++ b/net/socket/client_socket.cc
@@ -66,42 +66,6 @@ void ClientSocket::UseHistory::Reset() {
// are intentionally preserved.
}
-void ClientSocket::UseHistory::EmitPreconnectionHistograms() const {
- DCHECK(!subresource_speculation_ || !omnibox_speculation_);
- // 0 ==> non-speculative, never connected.
- // 1 ==> non-speculative never used (but connected).
- // 2 ==> non-speculative and used.
- // 3 ==> omnibox_speculative never connected.
- // 4 ==> omnibox_speculative never used (but connected).
- // 5 ==> omnibox_speculative and used.
- // 6 ==> subresource_speculative never connected.
- // 7 ==> subresource_speculative never used (but connected).
- // 8 ==> subresource_speculative and used.
- int result;
- if (was_used_to_convey_data_)
- result = 2;
- else if (was_ever_connected_)
- result = 1;
- else
- result = 0; // Never used, and not really connected.
-
- if (omnibox_speculation_)
- result += 3;
- else if (subresource_speculation_)
- result += 6;
- UMA_HISTOGRAM_ENUMERATION("Net.PreconnectUtilization2", result, 9);
-
- static const bool connect_backup_jobs_fieldtrial =
- base::FieldTrialList::Find("ConnnectBackupJobs") &&
- !base::FieldTrialList::Find("ConnnectBackupJobs")->group_name().empty();
- if (connect_backup_jobs_fieldtrial) {
- UMA_HISTOGRAM_ENUMERATION(
- base::FieldTrial::MakeName("Net.PreconnectUtilization2",
- "ConnnectBackupJobs"),
- result, 9);
- }
-}
-
void ClientSocket::UseHistory::set_was_ever_connected() {
DCHECK(!was_used_to_convey_data_);
was_ever_connected_ = true;
@@ -144,6 +108,42 @@ bool ClientSocket::UseHistory::was_used_to_convey_data() const {
return was_used_to_convey_data_;
}
+void ClientSocket::UseHistory::EmitPreconnectionHistograms() const {
+ DCHECK(!subresource_speculation_ || !omnibox_speculation_);
+ // 0 ==> non-speculative, never connected.
+ // 1 ==> non-speculative never used (but connected).
+ // 2 ==> non-speculative and used.
+ // 3 ==> omnibox_speculative never connected.
+ // 4 ==> omnibox_speculative never used (but connected).
+ // 5 ==> omnibox_speculative and used.
+ // 6 ==> subresource_speculative never connected.
+ // 7 ==> subresource_speculative never used (but connected).
+ // 8 ==> subresource_speculative and used.
+ int result;
+ if (was_used_to_convey_data_)
+ result = 2;
+ else if (was_ever_connected_)
+ result = 1;
+ else
+ result = 0; // Never used, and not really connected.
+
+ if (omnibox_speculation_)
+ result += 3;
+ else if (subresource_speculation_)
+ result += 6;
+ UMA_HISTOGRAM_ENUMERATION("Net.PreconnectUtilization2", result, 9);
+
+ static const bool connect_backup_jobs_fieldtrial =
+ base::FieldTrialList::Find("ConnnectBackupJobs") &&
+ !base::FieldTrialList::Find("ConnnectBackupJobs")->group_name().empty();
+ if (connect_backup_jobs_fieldtrial) {
+ UMA_HISTOGRAM_ENUMERATION(
+ base::FieldTrial::MakeName("Net.PreconnectUtilization2",
+ "ConnnectBackupJobs"),
+ result, 9);
+ }
+}
+
void ClientSocket::LogByteTransfer(const BoundNetLog& net_log,
NetLog::EventType event_type,
int byte_count,
« no previous file with comments | « net/proxy/proxy_list.cc ('k') | net/socket/client_socket_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698