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 "chrome/common/chrome_content_client.h" | 5 #include "chrome/common/chrome_content_client.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <memory> | 10 #include <memory> |
(...skipping 25 matching lines...) Expand all Loading... |
36 #include "components/dom_distiller/core/url_constants.h" | 36 #include "components/dom_distiller/core/url_constants.h" |
37 #include "components/version_info/version_info.h" | 37 #include "components/version_info/version_info.h" |
38 #include "content/public/common/cdm_info.h" | 38 #include "content/public/common/cdm_info.h" |
39 #include "content/public/common/content_constants.h" | 39 #include "content/public/common/content_constants.h" |
40 #include "content/public/common/content_switches.h" | 40 #include "content/public/common/content_switches.h" |
41 #include "content/public/common/url_constants.h" | 41 #include "content/public/common/url_constants.h" |
42 #include "content/public/common/user_agent.h" | 42 #include "content/public/common/user_agent.h" |
43 #include "extensions/common/constants.h" | 43 #include "extensions/common/constants.h" |
44 #include "extensions/features/features.h" | 44 #include "extensions/features/features.h" |
45 #include "gpu/config/gpu_info.h" | 45 #include "gpu/config/gpu_info.h" |
| 46 #include "gpu/config/gpu_util.h" |
46 #include "media/media_features.h" | 47 #include "media/media_features.h" |
47 #include "net/http/http_util.h" | 48 #include "net/http/http_util.h" |
48 #include "pdf/features.h" | 49 #include "pdf/features.h" |
49 #include "ppapi/features/features.h" | 50 #include "ppapi/features/features.h" |
50 #include "ui/base/l10n/l10n_util.h" | 51 #include "ui/base/l10n/l10n_util.h" |
51 #include "ui/base/layout.h" | 52 #include "ui/base/layout.h" |
52 #include "ui/base/resource/resource_bundle.h" | 53 #include "ui/base/resource/resource_bundle.h" |
53 #include "url/url_constants.h" | 54 #include "url/url_constants.h" |
54 #include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR. | 55 #include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR. |
55 | 56 |
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
442 g_pdf_shutdown_module = shutdown_module; | 443 g_pdf_shutdown_module = shutdown_module; |
443 } | 444 } |
444 #endif | 445 #endif |
445 | 446 |
446 void ChromeContentClient::SetActiveURL(const GURL& url) { | 447 void ChromeContentClient::SetActiveURL(const GURL& url) { |
447 base::debug::SetCrashKeyValue(crash_keys::kActiveURL, | 448 base::debug::SetCrashKeyValue(crash_keys::kActiveURL, |
448 url.possibly_invalid_spec()); | 449 url.possibly_invalid_spec()); |
449 } | 450 } |
450 | 451 |
451 void ChromeContentClient::SetGpuInfo(const gpu::GPUInfo& gpu_info) { | 452 void ChromeContentClient::SetGpuInfo(const gpu::GPUInfo& gpu_info) { |
452 #if !defined(OS_ANDROID) | 453 gpu::SetKeysForCrashLogging(gpu_info); |
453 base::debug::SetCrashKeyValue(crash_keys::kGPUVendorID, | |
454 base::StringPrintf("0x%04x", gpu_info.gpu.vendor_id)); | |
455 base::debug::SetCrashKeyValue(crash_keys::kGPUDeviceID, | |
456 base::StringPrintf("0x%04x", gpu_info.gpu.device_id)); | |
457 #endif | |
458 base::debug::SetCrashKeyValue(crash_keys::kGPUDriverVersion, | |
459 gpu_info.driver_version); | |
460 base::debug::SetCrashKeyValue(crash_keys::kGPUPixelShaderVersion, | |
461 gpu_info.pixel_shader_version); | |
462 base::debug::SetCrashKeyValue(crash_keys::kGPUVertexShaderVersion, | |
463 gpu_info.vertex_shader_version); | |
464 #if defined(OS_MACOSX) | |
465 base::debug::SetCrashKeyValue(crash_keys::kGPUGLVersion, gpu_info.gl_version); | |
466 #elif defined(OS_POSIX) | |
467 base::debug::SetCrashKeyValue(crash_keys::kGPUVendor, gpu_info.gl_vendor); | |
468 base::debug::SetCrashKeyValue(crash_keys::kGPURenderer, gpu_info.gl_renderer); | |
469 #endif | |
470 } | 454 } |
471 | 455 |
472 #if BUILDFLAG(ENABLE_PLUGINS) | 456 #if BUILDFLAG(ENABLE_PLUGINS) |
473 // static | 457 // static |
474 content::PepperPluginInfo* ChromeContentClient::FindMostRecentPlugin( | 458 content::PepperPluginInfo* ChromeContentClient::FindMostRecentPlugin( |
475 const std::vector<std::unique_ptr<content::PepperPluginInfo>>& plugins) { | 459 const std::vector<std::unique_ptr<content::PepperPluginInfo>>& plugins) { |
476 if (plugins.empty()) | 460 if (plugins.empty()) |
477 return nullptr; | 461 return nullptr; |
478 | 462 |
479 using PluginSortKey = std::tuple<base::Version, bool>; | 463 using PluginSortKey = std::tuple<base::Version, bool>; |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
709 if (!origin_trial_policy_) | 693 if (!origin_trial_policy_) |
710 origin_trial_policy_ = base::MakeUnique<ChromeOriginTrialPolicy>(); | 694 origin_trial_policy_ = base::MakeUnique<ChromeOriginTrialPolicy>(); |
711 return origin_trial_policy_.get(); | 695 return origin_trial_policy_.get(); |
712 } | 696 } |
713 | 697 |
714 #if defined(OS_ANDROID) | 698 #if defined(OS_ANDROID) |
715 media::MediaDrmBridgeClient* ChromeContentClient::GetMediaDrmBridgeClient() { | 699 media::MediaDrmBridgeClient* ChromeContentClient::GetMediaDrmBridgeClient() { |
716 return new ChromeMediaDrmBridgeClient(); | 700 return new ChromeMediaDrmBridgeClient(); |
717 } | 701 } |
718 #endif // OS_ANDROID | 702 #endif // OS_ANDROID |
OLD | NEW |