| <!DOCTYPE html> |
| <!-- |
| Copyright (c) 2015 The Chromium Authors. All rights reserved. |
| Use of this source code is governed by a BSD-style license that can be |
| found in the LICENSE file. |
| --> |
| <link rel="import" href="/tracing/extras/chrome/chrome_process_helper.html"> |
| |
| <script> |
| 'use strict'; |
| |
| /** |
| * @fileoverview Utilities for accessing the Chrome GPU Process. |
| */ |
| tr.exportTo('tr.e.audits', function() { |
| function ChromeGpuHelper(modelHelper, process) { |
| tr.e.audits.ChromeProcessHelper.call(this, modelHelper, process); |
| this.mainThread_ = process.findAtMostOneThreadNamed('CrGpuMain'); |
| }; |
| |
| ChromeGpuHelper.isGpuProcess = function(process) { |
| // In some android builds the GPU thread is not in a separate process. |
| if (process.findAtMostOneThreadNamed('CrBrowserMain') || |
| process.findAtMostOneThreadNamed('CrRendererMain')) |
| return false; |
| return process.findAtMostOneThreadNamed('CrGpuMain'); |
| }; |
| |
| ChromeGpuHelper.prototype = { |
| __proto__: tr.e.audits.ChromeProcessHelper.prototype, |
| |
| get mainThread() { |
| return this.mainThread_; |
| } |
| }; |
| |
| return { |
| ChromeGpuHelper: ChromeGpuHelper |
| }; |
| }); |
| </script> |