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

Side by Side Diff: content/browser/tracing/tracing_controller_impl.cc

Issue 2068843002: [Tracing] Set os-name to CrOS in trace metadata, and get the correct version for it (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix a typo and address comment Created 3 years, 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 #include "content/browser/tracing/tracing_controller_impl.h" 4 #include "content/browser/tracing/tracing_controller_impl.h"
5 5
6 #include <algorithm> 6 #include <algorithm>
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 819 matching lines...) Expand 10 before | Expand all | Expand 10 after
830 // need filtering in some cases. 830 // need filtering in some cases.
831 std::unique_ptr<base::DictionaryValue> metadata_dict( 831 std::unique_ptr<base::DictionaryValue> metadata_dict(
832 new base::DictionaryValue()); 832 new base::DictionaryValue());
833 833
834 metadata_dict->SetString("network-type", GetNetworkTypeString()); 834 metadata_dict->SetString("network-type", GetNetworkTypeString());
835 metadata_dict->SetString("product-version", GetContentClient()->GetProduct()); 835 metadata_dict->SetString("product-version", GetContentClient()->GetProduct());
836 metadata_dict->SetString("v8-version", V8_VERSION_STRING); 836 metadata_dict->SetString("v8-version", V8_VERSION_STRING);
837 metadata_dict->SetString("user-agent", GetContentClient()->GetUserAgent()); 837 metadata_dict->SetString("user-agent", GetContentClient()->GetUserAgent());
838 838
839 // OS 839 // OS
840 #if defined(OS_CHROMEOS)
841 metadata_dict->SetString("os-name", "CrOS");
842 int32_t major_version;
843 int32_t minor_version;
844 int32_t bugfix_version;
845 // OperatingSystemVersion on has a POSIX implementation which returns the
oystein (OOO til 10th of July) 2017/04/27 21:05:16 -on?
fmeawad 2017/04/27 21:17:25 Done.
846 // wrong versions for CrOS.
847 base::SysInfo::OperatingSystemVersionNumbers(&major_version, &minor_version,
848 &bugfix_version);
849 metadata_dict->SetString(
850 "os-version", base::StringPrintf("%d.%d.%d", major_version, minor_version,
851 bugfix_version));
852 #else
840 metadata_dict->SetString("os-name", base::SysInfo::OperatingSystemName()); 853 metadata_dict->SetString("os-name", base::SysInfo::OperatingSystemName());
841 metadata_dict->SetString("os-version", 854 metadata_dict->SetString("os-version",
842 base::SysInfo::OperatingSystemVersion()); 855 base::SysInfo::OperatingSystemVersion());
856 #endif
843 metadata_dict->SetString("os-arch", 857 metadata_dict->SetString("os-arch",
844 base::SysInfo::OperatingSystemArchitecture()); 858 base::SysInfo::OperatingSystemArchitecture());
845 859
846 // CPU 860 // CPU
847 base::CPU cpu; 861 base::CPU cpu;
848 metadata_dict->SetInteger("cpu-family", cpu.family()); 862 metadata_dict->SetInteger("cpu-family", cpu.family());
849 metadata_dict->SetInteger("cpu-model", cpu.model()); 863 metadata_dict->SetInteger("cpu-model", cpu.model());
850 metadata_dict->SetInteger("cpu-stepping", cpu.stepping()); 864 metadata_dict->SetInteger("cpu-stepping", cpu.stepping());
851 metadata_dict->SetInteger("num-cpus", base::SysInfo::NumberOfProcessors()); 865 metadata_dict->SetInteger("num-cpus", base::SysInfo::NumberOfProcessors());
852 metadata_dict->SetInteger("physical-memory", 866 metadata_dict->SetInteger("physical-memory",
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
916 void TracingControllerImpl::RemoveTraceMessageFilterObserver( 930 void TracingControllerImpl::RemoveTraceMessageFilterObserver(
917 TraceMessageFilterObserver* observer) { 931 TraceMessageFilterObserver* observer) {
918 DCHECK_CURRENTLY_ON(BrowserThread::UI); 932 DCHECK_CURRENTLY_ON(BrowserThread::UI);
919 trace_message_filter_observers_.RemoveObserver(observer); 933 trace_message_filter_observers_.RemoveObserver(observer);
920 934
921 for (auto& filter : trace_message_filters_) 935 for (auto& filter : trace_message_filters_)
922 observer->OnTraceMessageFilterRemoved(filter.get()); 936 observer->OnTraceMessageFilterRemoved(filter.get());
923 } 937 }
924 938
925 } // namespace content 939 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698