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

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

Issue 1560027: Refactor FileVersionInfo into an interface with platform implementations. (Closed)
Patch Set: comments Created 10 years, 8 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 | « chrome/browser/memory_details_win.cc ('k') | chrome/browser/safe_browsing/protocol_manager.cc » ('j') | 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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 "chrome/browser/metrics/metrics_log.h" 5 #include "chrome/browser/metrics/metrics_log.h"
6 6
7 #include "base/base64.h" 7 #include "base/base64.h"
8 #include "base/time.h" 8 #include "base/time.h"
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
11 #include "base/file_version_info.h" 11 #include "base/file_version_info.h"
12 #include "base/md5.h" 12 #include "base/md5.h"
13 #include "base/scoped_ptr.h" 13 #include "base/scoped_ptr.h"
14 #include "base/string_util.h" 14 #include "base/string_util.h"
15 #include "base/sys_info.h" 15 #include "base/sys_info.h"
16 #include "base/utf_string_conversions.h" 16 #include "base/utf_string_conversions.h"
17 #include "base/third_party/nspr/prtime.h" 17 #include "base/third_party/nspr/prtime.h"
18 #include "chrome/app/chrome_version_info.h"
18 #include "chrome/browser/autocomplete/autocomplete.h" 19 #include "chrome/browser/autocomplete/autocomplete.h"
19 #include "chrome/browser/browser_process.h" 20 #include "chrome/browser/browser_process.h"
20 #include "chrome/browser/pref_service.h" 21 #include "chrome/browser/pref_service.h"
21 #include "chrome/common/logging_chrome.h" 22 #include "chrome/common/logging_chrome.h"
22 #include "chrome/common/pref_names.h" 23 #include "chrome/common/pref_names.h"
23 #include "googleurl/src/gurl.h" 24 #include "googleurl/src/gurl.h"
24 25
25 #define OPEN_ELEMENT_FOR_SCOPE(name) ScopedElement scoped_element(this, name) 26 #define OPEN_ELEMENT_FOR_SCOPE(name) ScopedElement scoped_element(this, name)
26 27
27 using base::Time; 28 using base::Time;
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 void MetricsLog::EndElement() { 296 void MetricsLog::EndElement() {
296 DCHECK(!locked_); 297 DCHECK(!locked_);
297 298
298 int result = xmlTextWriterEndElement(writer_); 299 int result = xmlTextWriterEndElement(writer_);
299 DCHECK_GE(result, 0); 300 DCHECK_GE(result, 0);
300 } 301 }
301 302
302 // static 303 // static
303 std::string MetricsLog::GetVersionString() { 304 std::string MetricsLog::GetVersionString() {
304 scoped_ptr<FileVersionInfo> version_info( 305 scoped_ptr<FileVersionInfo> version_info(
305 FileVersionInfo::CreateFileVersionInfoForCurrentModule()); 306 chrome_app::GetChromeVersionInfo());
306 if (version_info.get()) { 307 if (version_info.get()) {
307 std::string version = WideToUTF8(version_info->product_version()); 308 std::string version = WideToUTF8(version_info->product_version());
308 if (!version_extension_.empty()) 309 if (!version_extension_.empty())
309 version += version_extension_; 310 version += version_extension_;
310 if (!version_info->is_official_build()) 311 if (!version_info->is_official_build())
311 version.append("-devel"); 312 version.append("-devel");
312 return version; 313 return version;
313 } else { 314 } else {
314 NOTREACHED() << "Unable to retrieve version string."; 315 NOTREACHED() << "Unable to retrieve version string.";
315 } 316 }
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after
734 735
735 for (size_t i = 0; i < histogram.bucket_count(); i++) { 736 for (size_t i = 0; i < histogram.bucket_count(); i++) {
736 if (snapshot.counts(i)) { 737 if (snapshot.counts(i)) {
737 OPEN_ELEMENT_FOR_SCOPE("histogrambucket"); 738 OPEN_ELEMENT_FOR_SCOPE("histogrambucket");
738 WriteIntAttribute("min", histogram.ranges(i)); 739 WriteIntAttribute("min", histogram.ranges(i));
739 WriteIntAttribute("max", histogram.ranges(i + 1)); 740 WriteIntAttribute("max", histogram.ranges(i + 1));
740 WriteIntAttribute("count", snapshot.counts(i)); 741 WriteIntAttribute("count", snapshot.counts(i));
741 } 742 }
742 } 743 }
743 } 744 }
OLDNEW
« no previous file with comments | « chrome/browser/memory_details_win.cc ('k') | chrome/browser/safe_browsing/protocol_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698