1<!DOCTYPE html> 2<!-- 3Copyright (c) 2015 The Chromium Authors. All rights reserved. 4Use of this source code is governed by a BSD-style license that can be 5found in the LICENSE file. 6--> 7<link rel="import" href="/tracing/model/helpers/chrome_process_helper.html"> 8 9<script> 10'use strict'; 11 12/** 13 * @fileoverview Utilities for accessing the Chrome GPU Process. 14 */ 15tr.exportTo('tr.model.helpers', function() { 16 function ChromeGpuHelper(modelHelper, process) { 17 tr.model.helpers.ChromeProcessHelper.call(this, modelHelper, process); 18 this.mainThread_ = process.findAtMostOneThreadNamed('CrGpuMain'); 19 }; 20 21 ChromeGpuHelper.isGpuProcess = function(process) { 22 // In some android builds the GPU thread is not in a separate process. 23 if (process.findAtMostOneThreadNamed('CrBrowserMain') || 24 process.findAtMostOneThreadNamed('CrRendererMain')) 25 return false; 26 return process.findAtMostOneThreadNamed('CrGpuMain'); 27 }; 28 29 ChromeGpuHelper.prototype = { 30 __proto__: tr.model.helpers.ChromeProcessHelper.prototype, 31 32 get mainThread() { 33 return this.mainThread_; 34 } 35 }; 36 37 return { 38 ChromeGpuHelper: ChromeGpuHelper 39 }; 40}); 41</script> 42