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

Side by Side Diff: chrome/common/child_process_logging_posix.cc

Issue 15745014: Move GPU device/driver info related code from content to gpu. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: rebase Created 7 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 | Annotate | Revision Log
« no previous file with comments | « chrome/common/child_process_logging_mac.mm ('k') | chrome/common/child_process_logging_win.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) 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 #include "chrome/common/child_process_logging.h" 5 #include "chrome/common/child_process_logging.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/format_macros.h" 8 #include "base/format_macros.h"
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
11 #include "base/strings/string_split.h" 11 #include "base/strings/string_split.h"
12 #include "base/utf_string_conversions.h" 12 #include "base/utf_string_conversions.h"
13 #include "chrome/common/metrics/variations/variations_util.h" 13 #include "chrome/common/metrics/variations/variations_util.h"
14 #include "chrome/installer/util/google_update_settings.h" 14 #include "chrome/installer/util/google_update_settings.h"
15 #include "content/public/common/gpu_info.h"
16 #include "googleurl/src/gurl.h" 15 #include "googleurl/src/gurl.h"
16 #include "gpu/config/gpu_info.h"
17 17
18 namespace child_process_logging { 18 namespace child_process_logging {
19 19
20 // Account for the terminating null character. 20 // Account for the terminating null character.
21 static const size_t kMaxActiveURLSize = 1024 + 1; 21 static const size_t kMaxActiveURLSize = 1024 + 1;
22 static const size_t kClientIdSize = 32 + 1; 22 static const size_t kClientIdSize = 32 + 1;
23 static const size_t kChannelSize = 32; 23 static const size_t kChannelSize = 32;
24 24
25 // We use static strings to hold the most recent active url and the client 25 // We use static strings to hold the most recent active url and the client
26 // identifier. If we crash, the crash handler code will send the contents of 26 // identifier. If we crash, the crash handler code will send the contents of
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 std::set<std::string>::const_iterator iter = extension_ids.begin(); 88 std::set<std::string>::const_iterator iter = extension_ids.begin();
89 for (size_t i = 0; 89 for (size_t i = 0;
90 i < kMaxReportedActiveExtensions && iter != extension_ids.end(); 90 i < kMaxReportedActiveExtensions && iter != extension_ids.end();
91 ++i, ++iter) { 91 ++i, ++iter) {
92 extension_str += *iter; 92 extension_str += *iter;
93 } 93 }
94 base::strlcpy(g_extension_ids, extension_str.c_str(), 94 base::strlcpy(g_extension_ids, extension_str.c_str(),
95 arraysize(g_extension_ids)); 95 arraysize(g_extension_ids));
96 } 96 }
97 97
98 void SetGpuInfo(const content::GPUInfo& gpu_info) { 98 void SetGpuInfo(const gpu::GPUInfo& gpu_info) {
99 snprintf(g_gpu_vendor_id, arraysize(g_gpu_vendor_id), "0x%04x", 99 snprintf(g_gpu_vendor_id, arraysize(g_gpu_vendor_id), "0x%04x",
100 gpu_info.gpu.vendor_id); 100 gpu_info.gpu.vendor_id);
101 snprintf(g_gpu_device_id, arraysize(g_gpu_device_id), "0x%04x", 101 snprintf(g_gpu_device_id, arraysize(g_gpu_device_id), "0x%04x",
102 gpu_info.gpu.device_id); 102 gpu_info.gpu.device_id);
103 base::strlcpy(g_gpu_gl_vendor, gpu_info.gl_vendor.c_str(), 103 base::strlcpy(g_gpu_gl_vendor, gpu_info.gl_vendor.c_str(),
104 arraysize(g_gpu_gl_vendor)); 104 arraysize(g_gpu_gl_vendor));
105 base::strlcpy(g_gpu_gl_renderer, gpu_info.gl_renderer.c_str(), 105 base::strlcpy(g_gpu_gl_renderer, gpu_info.gl_renderer.c_str(),
106 arraysize(g_gpu_gl_renderer)); 106 arraysize(g_gpu_gl_renderer));
107 base::strlcpy(g_gpu_driver_ver, gpu_info.driver_version.c_str(), 107 base::strlcpy(g_gpu_driver_ver, gpu_info.driver_version.c_str(),
108 arraysize(g_gpu_driver_ver)); 108 arraysize(g_gpu_driver_ver));
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 // simultaneously. 169 // simultaneously.
170 snprintf(g_num_variations, arraysize(g_num_variations), "%" PRIuS, 170 snprintf(g_num_variations, arraysize(g_num_variations), "%" PRIuS,
171 experiments.size()); 171 experiments.size());
172 } 172 }
173 173
174 void SetChannel(const std::string& channel) { 174 void SetChannel(const std::string& channel) {
175 base::strlcpy(g_channel, channel.c_str(), arraysize(g_channel)); 175 base::strlcpy(g_channel, channel.c_str(), arraysize(g_channel));
176 } 176 }
177 177
178 } // namespace child_process_logging 178 } // namespace child_process_logging
OLDNEW
« no previous file with comments | « chrome/common/child_process_logging_mac.mm ('k') | chrome/common/child_process_logging_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698