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

Side by Side Diff: content/browser/gpu/gpu_data_manager_impl_private.cc

Issue 2772193006: gpu: Replace GpuMsg_GpuSwitched with mojom api. (Closed)
Patch Set: Created 3 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 | « no previous file | content/browser/gpu/gpu_process_host.h » ('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) 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 4
5 #include "content/browser/gpu/gpu_data_manager_impl_private.h" 5 #include "content/browser/gpu/gpu_data_manager_impl_private.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <iterator> 8 #include <iterator>
9 #include <memory> 9 #include <memory>
10 #include <utility> 10 #include <utility>
(...skipping 1010 matching lines...) Expand 10 before | Expand all | Expand 10 after
1021 value->Append(std::move(dict)); 1021 value->Append(std::move(dict));
1022 } 1022 }
1023 return value; 1023 return value;
1024 } 1024 }
1025 1025
1026 void GpuDataManagerImplPrivate::HandleGpuSwitch() { 1026 void GpuDataManagerImplPrivate::HandleGpuSwitch() {
1027 GpuDataManagerImpl::UnlockedSession session(owner_); 1027 GpuDataManagerImpl::UnlockedSession session(owner_);
1028 // Notify observers in the browser process. 1028 // Notify observers in the browser process.
1029 ui::GpuSwitchingManager::GetInstance()->NotifyGpuSwitched(); 1029 ui::GpuSwitchingManager::GetInstance()->NotifyGpuSwitched();
1030 // Pass the notification to the GPU process to notify observers there. 1030 // Pass the notification to the GPU process to notify observers there.
1031 GpuProcessHost::SendOnIO(GpuProcessHost::GPU_PROCESS_KIND_SANDBOXED, 1031 GpuProcessHost::CallOnIO(GpuProcessHost::GPU_PROCESS_KIND_SANDBOXED,
1032 false /* force_create */, new GpuMsg_GpuSwitched); 1032 false /* force_create */,
1033 base::Bind([](GpuProcessHost* host) {
1034 if (host)
1035 host->gpu_service()->GpuSwitched();
1036 }));
1033 } 1037 }
1034 1038
1035 bool GpuDataManagerImplPrivate::UpdateActiveGpu(uint32_t vendor_id, 1039 bool GpuDataManagerImplPrivate::UpdateActiveGpu(uint32_t vendor_id,
1036 uint32_t device_id) { 1040 uint32_t device_id) {
1037 const base::CommandLine* command_line = 1041 const base::CommandLine* command_line =
1038 base::CommandLine::ForCurrentProcess(); 1042 base::CommandLine::ForCurrentProcess();
1039 1043
1040 // For tests, only the gpu process is allowed to detect the active gpu device 1044 // For tests, only the gpu process is allowed to detect the active gpu device
1041 // using information on the actual loaded GL driver. 1045 // using information on the actual loaded GL driver.
1042 if (command_line->HasSwitch(switches::kGpuTestingVendorId) && 1046 if (command_line->HasSwitch(switches::kGpuTestingVendorId) &&
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after
1379 gpu_info_.context_info_state = gpu::kCollectInfoFatalFailure; 1383 gpu_info_.context_info_state = gpu::kCollectInfoFatalFailure;
1380 #if defined(OS_WIN) 1384 #if defined(OS_WIN)
1381 gpu_info_.dx_diagnostics_info_state = gpu::kCollectInfoFatalFailure; 1385 gpu_info_.dx_diagnostics_info_state = gpu::kCollectInfoFatalFailure;
1382 #endif 1386 #endif
1383 complete_gpu_info_already_requested_ = true; 1387 complete_gpu_info_already_requested_ = true;
1384 // Some observers might be waiting. 1388 // Some observers might be waiting.
1385 NotifyGpuInfoUpdate(); 1389 NotifyGpuInfoUpdate();
1386 } 1390 }
1387 1391
1388 } // namespace content 1392 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/gpu/gpu_process_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698