当前位置: 首页 > news >正文

常见的电子商务网站网址网站转移空间备案是不是就没有了

常见的电子商务网站网址,网站转移空间备案是不是就没有了,网站建设论坛报告,战事新闻最新接前一篇文章:Chromium源码由浅入深(二) 上一回说到了关键的“钥匙”:browserBridge.gpuInfo,本文就针对其进行深入探究。 先来看前半部分,browserBridge。 在content/browser/resources/gpu/gpu_interna…

接前一篇文章:Chromium源码由浅入深(二)

上一回说到了关键的“钥匙”:browserBridge.gpuInfo,本文就针对其进行深入探究。

先来看前半部分,browserBridge。

在content/browser/resources/gpu/gpu_internals.js中有以下代码:

import './info_view.js';import {BrowserBridge} from './browser_bridge.js';// Injected script from C++ or test environments may reference `browserBridge`
// as a property of the global object.
window.browserBridge = new BrowserBridge();/*** Main entry point. called once the page has loaded.*/
function onLoad() {// Create the views.document.querySelector('info-view').addBrowserBridgeListeners(window.browserBridge);// Because of inherent raciness (between the deprecated DevTools API which// telemtry uses to drive the relevant tests, and the asynchronous loading of// JS modules like this one) it's possible for telemetry tests to inject code// *before* `browserBridge` is set and the DOM is populated. This flag is used// to synchronize script injection by tests to prevent such races.window.gpuPagePopulated = true;
}document.addEventListener('DOMContentLoaded', onLoad);

代码注释说得清楚:从C++或测试环境注入的脚本可能引用“browserBridge”作为全局对象的属性。

BrowserBridge类的定义在Cromium源码中一共有两处,一处在chrome/browser/resources/net_internals/browser_bridge.js中,另一处在content/browser/resources/gpu/browser_bridge.js中。由于上边代码中是“import {BrowserBridge} from './browser_bridge.js';”,也就是引用的是当前路径下的browser_bridge.js,即content/browser/resources/gpu/下的browser_bridge.js,也就是第二处定义。

代码如下:

/*** This class provides a 'bridge' for communicating between javascript and the* browser. When run outside of WebUI, e.g. as a regular webpage, it provides* synthetic data to assist in testing.*/
export class BrowserBridge extends EventTarget {constructor() {super();this.nextRequestId_ = 0;this.pendingCallbacks_ = [];this.logMessages_ = [];// Tell c++ code that we are ready to receive GPU Info.chrome.send('browserBridgeInitialized');this.beginRequestClientInfo_();this.beginRequestLogMessages_();}dispatchEvent_(eventName) {this.dispatchEvent(new CustomEvent(eventName, {bubbles: true, composed: true}));}applySimulatedData_(data) {// set up things according to the simulated datathis.gpuInfo_ = data.gpuInfo;this.clientInfo_ = data.clientInfo;this.logMessages_ = data.logMessages;this.dispatchEvent_('gpuInfoUpdate');this.dispatchEvent_('clientInfoChange');this.dispatchEvent_('logMessagesChange');}/*** Sends a message to the browser with specified args. The* browser will reply asynchronously via the provided callback.*/callAsync(submessage, args, callback) {const requestId = this.nextRequestId_;this.nextRequestId_ += 1;this.pendingCallbacks_[requestId] = callback;if (!args) {chrome.send('callAsync', [requestId.toString(), submessage]);} else {const allArgs = [requestId.toString(), submessage].concat(args);chrome.send('callAsync', allArgs);}}/*** Called by gpu c++ code when client info is ready.*/onCallAsyncReply(requestId, args) {if (this.pendingCallbacks_[requestId] === undefined) {throw new Error('requestId ' + requestId + ' is not pending');}const callback = this.pendingCallbacks_[requestId];callback(args);delete this.pendingCallbacks_[requestId];}/*** Get gpuInfo data.*/get gpuInfo() {return this.gpuInfo_;}/*** Called from gpu c++ code when GPU Info is updated.*/onGpuInfoUpdate(gpuInfo) {this.gpuInfo_ = gpuInfo;this.dispatchEvent_('gpuInfoUpdate');}/*** This function begins a request for the ClientInfo. If it comes back* as undefined, then we will issue the request again in 250ms.*/beginRequestClientInfo_() {this.callAsync('requestClientInfo', undefined,(function(data) {if (data === undefined) {  // try again in 250 mswindow.setTimeout(this.beginRequestClientInfo_.bind(this), 250);} else {this.clientInfo_ = data;this.dispatchEvent_('clientInfoChange');}}).bind(this));}/*** Returns information about the currently running Chrome build.*/get clientInfo() {return this.clientInfo_;}/*** This function checks for new GPU_LOG messages.* If any are found, a refresh is triggered.*/beginRequestLogMessages_() {this.callAsync('requestLogMessages', undefined,(function(messages) {if (messages.length !== this.logMessages_.length) {this.logMessages_ = messages;this.dispatchEvent_('logMessagesChange');}// check again in 250 mswindow.setTimeout(this.beginRequestLogMessages_.bind(this), 250);}).bind(this));}/*** Returns an array of log messages issued by the GPU process, if any.*/get logMessages() {return this.logMessages_;}/*** Returns the value of the "Sandboxed" row.*/isSandboxedForTesting() {for (const info of this.gpuInfo_.basicInfo) {if (info.description === 'Sandboxed') {return info.value;}}return false;}
}

再来看后半部分,gpuInfo。

在上边content/browser/resources/gpu/gpu_internals.js的代码中有以下一段:

/*** Main entry point. called once the page has loaded.*/
function onLoad() {// Create the views.document.querySelector('info-view').addBrowserBridgeListeners(window.browserBridge);

addBrowserBridgeListeners函数在content/browser/resources/gpu/info_view.js中,代码如下:

addBrowserBridgeListeners(browserBridge) {browserBridge.addEventListener('gpuInfoUpdate', this.refresh.bind(this, browserBridge));browserBridge.addEventListener('logMessagesChange', this.refresh.bind(this, browserBridge));browserBridge.addEventListener('clientInfoChange', this.refresh.bind(this, browserBridge));this.refresh(browserBridge);}

而'gpuInfoUpdate'这个关键字则有两处相关调用。一处在content/browser/resources/gpu/browser_bridge.js中,代码如下:

applySimulatedData_(data) {// set up things according to the simulated datathis.gpuInfo_ = data.gpuInfo;this.clientInfo_ = data.clientInfo;this.logMessages_ = data.logMessages;this.dispatchEvent_('gpuInfoUpdate');this.dispatchEvent_('clientInfoChange');this.dispatchEvent_('logMessagesChange');}

另一处也是在同文件中,代码如下:

 /*** Called from gpu c++ code when GPU Info is updated.*/onGpuInfoUpdate(gpuInfo) {this.gpuInfo_ = gpuInfo;this.dispatchEvent_('gpuInfoUpdate');}

显然后者更为关键和常用。再次查找调用onGpuInfoUpdate函数的地方,只有一处,在content/browser/gpu/gpu_internals_ui.cc中,代码如下:

void GpuMessageHandler::OnGpuInfoUpdate() {// Get GPU Info.const gpu::GPUInfo gpu_info = GpuDataManagerImpl::GetInstance()->GetGPUInfo();const gfx::GpuExtraInfo gpu_extra_info =GpuDataManagerImpl::GetInstance()->GetGpuExtraInfo();base::Value::Dict gpu_info_val = GetGpuInfo();// Add in blocklisting featuresbase::Value::Dict feature_status;feature_status.Set("featureStatus", GetFeatureStatus());feature_status.Set("problems", GetProblems());base::Value::List workarounds;for (const auto& workaround : GetDriverBugWorkarounds())workarounds.Append(workaround);feature_status.Set("workarounds", std::move(workarounds));gpu_info_val.Set("featureStatus", std::move(feature_status));if (!GpuDataManagerImpl::GetInstance()->IsGpuProcessUsingHardwareGpu()) {const gpu::GPUInfo gpu_info_for_hardware_gpu =GpuDataManagerImpl::GetInstance()->GetGPUInfoForHardwareGpu();if (gpu_info_for_hardware_gpu.IsInitialized()) {base::Value::Dict feature_status_for_hardware_gpu;feature_status_for_hardware_gpu.Set("featureStatus",GetFeatureStatusForHardwareGpu());feature_status_for_hardware_gpu.Set("problems",GetProblemsForHardwareGpu());base::Value::List workarounds_for_hardware_gpu;for (const auto& workaround : GetDriverBugWorkaroundsForHardwareGpu())workarounds_for_hardware_gpu.Append(workaround);feature_status_for_hardware_gpu.Set("workarounds", std::move(workarounds_for_hardware_gpu));gpu_info_val.Set("featureStatusForHardwareGpu",std::move(feature_status_for_hardware_gpu));const gpu::GpuFeatureInfo gpu_feature_info_for_hardware_gpu =GpuDataManagerImpl::GetInstance()->GetGpuFeatureInfoForHardwareGpu();base::Value::List gpu_info_for_hardware_gpu_val = GetBasicGpuInfo(gpu_info_for_hardware_gpu, gpu_feature_info_for_hardware_gpu,gfx::GpuExtraInfo{});gpu_info_val.Set("basicInfoForHardwareGpu",std::move(gpu_info_for_hardware_gpu_val));}}gpu_info_val.Set("compositorInfo", CompositorInfo());gpu_info_val.Set("gpuMemoryBufferInfo", GpuMemoryBufferInfo(gpu_extra_info));gpu_info_val.Set("displayInfo", GetDisplayInfo());gpu_info_val.Set("videoAcceleratorsInfo", GetVideoAcceleratorsInfo());gpu_info_val.Set("ANGLEFeatures", GetANGLEFeatures());gpu_info_val.Set("devicePerfInfo", GetDevicePerfInfo());gpu_info_val.Set("dawnInfo", GetDawnInfo());// Send GPU Info to javascript.web_ui()->CallJavascriptFunctionUnsafe("browserBridge.onGpuInfoUpdate",std::move(gpu_info_val));
}

这个函数就是接下来要花大力气探究的核心函数。

欲知后事如何,且看下回分解。

http://www.yayakq.cn/news/830810/

相关文章:

  • 南通优化网站排名建游戏网站
  • 江苏省交通建设局网站首页成都市房产管理局官网
  • 彩票的网站怎么做备案网站可以做卡盟么
  • 湖南门户网站设计公司微信微网站教程
  • 个人网站免费制作wordpress 用户密码
  • 揭阳手机网站建设专业搜索引擎seo服务商
  • 网站项目建设流程帝国cms 网站地图标签
  • 西部数据网站管理助手v3.0dw做的上传网站打不开
  • 网站备案关站双公示网站专栏建设
  • 品牌网站建设工作室响应式网页制作教程
  • 北京网站备案核验单南京门户网站制作
  • 济阳网站建设公司网站移动端适配怎么做
  • 网站建设需求怎么提沧州建设工程信息网
  • 微信端的网站开发pythonapp软件定制研发
  • 南宁企业网站制作模板公众号平台小程序
  • 石家庄网站建设案例tk免费域名注册网站
  • 如何让我们的网站新闻被百度新闻收录珠宝购物网站的建设
  • 济南网站建设推荐q479185700上快甘肃省两学一做专题网站
  • 绵阳市城乡建设和规划局网站环球旅行卡怎么用
  • 深圳交易网站建设个人博客网站建设预算
  • 做网站互联互通免费登记照制作app
  • 怎样维护公司网站烟台专业做网站公司有哪些
  • php 外贸商城网站建设定制网站平台的安全设计
  • 康桥网站建设网店logo设计图片免费
  • 常州网站建设哪儿好薇注册网站费用
  • 网站备案正常多久手机购物网站模板
  • 任务网站建设全球最新数据消息
  • 做外贸网站需要营业执照wordpress新建页面是空白的
  • 网站加搜索框广州有什么好玩的景点
  • 网站建设分为几类广州软件合作中心