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

Side by Side Diff: components/domain_reliability/beacon.cc

Issue 1728033002: components: Add out-of-line copy ctors for complex classes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #include "components/domain_reliability/beacon.h" 5 #include "components/domain_reliability/beacon.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/values.h" 9 #include "base/values.h"
10 #include "components/domain_reliability/util.h" 10 #include "components/domain_reliability/util.h"
11 #include "net/base/net_errors.h" 11 #include "net/base/net_errors.h"
12 12
13 namespace domain_reliability { 13 namespace domain_reliability {
14 14
15 using base::Value; 15 using base::Value;
16 using base::DictionaryValue; 16 using base::DictionaryValue;
17 17
18 DomainReliabilityBeacon::DomainReliabilityBeacon() {} 18 DomainReliabilityBeacon::DomainReliabilityBeacon() {}
19 DomainReliabilityBeacon::DomainReliabilityBeacon(
20 const DomainReliabilityBeacon& other) = default;
19 DomainReliabilityBeacon::~DomainReliabilityBeacon() {} 21 DomainReliabilityBeacon::~DomainReliabilityBeacon() {}
20 22
21 scoped_ptr<Value> DomainReliabilityBeacon::ToValue( 23 scoped_ptr<Value> DomainReliabilityBeacon::ToValue(
22 base::TimeTicks upload_time, 24 base::TimeTicks upload_time,
23 base::TimeTicks last_network_change_time, 25 base::TimeTicks last_network_change_time,
24 const GURL& collector_url, 26 const GURL& collector_url,
25 const ScopedVector<std::string>& path_prefixes) const { 27 const ScopedVector<std::string>& path_prefixes) const {
26 scoped_ptr<DictionaryValue> beacon_value(new DictionaryValue()); 28 scoped_ptr<DictionaryValue> beacon_value(new DictionaryValue());
27 DCHECK(url.is_valid()); 29 DCHECK(url.is_valid());
28 GURL sanitized_url = SanitizeURLForReport(url, collector_url, path_prefixes); 30 GURL sanitized_url = SanitizeURLForReport(url, collector_url, path_prefixes);
(...skipping 17 matching lines...) Expand all
46 beacon_value->SetInteger("request_elapsed_ms", elapsed.InMilliseconds()); 48 beacon_value->SetInteger("request_elapsed_ms", elapsed.InMilliseconds());
47 base::TimeDelta request_age = upload_time - start_time; 49 base::TimeDelta request_age = upload_time - start_time;
48 beacon_value->SetInteger("request_age_ms", request_age.InMilliseconds()); 50 beacon_value->SetInteger("request_age_ms", request_age.InMilliseconds());
49 bool network_changed = last_network_change_time > start_time; 51 bool network_changed = last_network_change_time > start_time;
50 beacon_value->SetBoolean("network_changed", network_changed); 52 beacon_value->SetBoolean("network_changed", network_changed);
51 beacon_value->SetDouble("sample_rate", sample_rate); 53 beacon_value->SetDouble("sample_rate", sample_rate);
52 return std::move(beacon_value); 54 return std::move(beacon_value);
53 } 55 }
54 56
55 } // namespace domain_reliability 57 } // namespace domain_reliability
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698