| OLD | NEW |
| 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 "gpu/config/gpu_info_collector.h" | 5 #include "gpu/config/gpu_info_collector.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 // Return a version string in the format of "major.minor". | 62 // Return a version string in the format of "major.minor". |
| 63 std::string GetVersionFromString(const std::string& version_string) { | 63 std::string GetVersionFromString(const std::string& version_string) { |
| 64 size_t begin = version_string.find_first_of("0123456789"); | 64 size_t begin = version_string.find_first_of("0123456789"); |
| 65 if (begin != std::string::npos) { | 65 if (begin != std::string::npos) { |
| 66 size_t end = version_string.find_first_not_of("01234567890.", begin); | 66 size_t end = version_string.find_first_not_of("01234567890.", begin); |
| 67 std::string sub_string; | 67 std::string sub_string; |
| 68 if (end != std::string::npos) | 68 if (end != std::string::npos) |
| 69 sub_string = version_string.substr(begin, end - begin); | 69 sub_string = version_string.substr(begin, end - begin); |
| 70 else | 70 else |
| 71 sub_string = version_string.substr(begin); | 71 sub_string = version_string.substr(begin); |
| 72 std::vector<std::string> pieces; | 72 std::vector<std::string> pieces = base::SplitString( |
| 73 base::SplitString(sub_string, '.', &pieces); | 73 sub_string, ".", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); |
| 74 if (pieces.size() >= 2) | 74 if (pieces.size() >= 2) |
| 75 return pieces[0] + "." + pieces[1]; | 75 return pieces[0] + "." + pieces[1]; |
| 76 } | 76 } |
| 77 return std::string(); | 77 return std::string(); |
| 78 } | 78 } |
| 79 | 79 |
| 80 } // namespace anonymous | 80 } // namespace anonymous |
| 81 | 81 |
| 82 namespace gpu { | 82 namespace gpu { |
| 83 | 83 |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 basic_gpu_info->sandboxed = context_gpu_info.sandboxed; | 157 basic_gpu_info->sandboxed = context_gpu_info.sandboxed; |
| 158 basic_gpu_info->direct_rendering = context_gpu_info.direct_rendering; | 158 basic_gpu_info->direct_rendering = context_gpu_info.direct_rendering; |
| 159 basic_gpu_info->context_info_state = context_gpu_info.context_info_state; | 159 basic_gpu_info->context_info_state = context_gpu_info.context_info_state; |
| 160 basic_gpu_info->initialization_time = context_gpu_info.initialization_time; | 160 basic_gpu_info->initialization_time = context_gpu_info.initialization_time; |
| 161 basic_gpu_info->video_encode_accelerator_supported_profiles = | 161 basic_gpu_info->video_encode_accelerator_supported_profiles = |
| 162 context_gpu_info.video_encode_accelerator_supported_profiles; | 162 context_gpu_info.video_encode_accelerator_supported_profiles; |
| 163 } | 163 } |
| 164 | 164 |
| 165 } // namespace gpu | 165 } // namespace gpu |
| 166 | 166 |
| OLD | NEW |