HELLO·Android
系统源代码
IT资讯
技术文章
我的收藏
注册
登录
-
我收藏的文章
创建代码块
我的代码块
我的账号
Android 10
|
10.0.0_r6
下载
查看原文件
收藏
根目录
external
libchrome
mojo
public
js
base.js
// Copyright 2017 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. 'use strict'; if ((typeof mojo !== 'undefined') && mojo.bindingsLibraryInitialized) { throw new Error('The Mojo bindings library has been initialized.'); } var mojo = mojo || {}; mojo.bindingsLibraryInitialized = true; mojo.internal = mojo.internal || {}; mojo.config = mojo.config || {}; if (typeof mojo.config.global === 'undefined') { mojo.config.global = this; } if (typeof mojo.config.autoLoadMojomDeps === 'undefined') { // Whether to automatically load mojom dependencies. // For example, if foo.mojom imports bar.mojom, |autoLoadMojomDeps| set to // true means that loading foo.mojom.js will insert a // // No duplicate loading, although unnecessary: // // // // Load bar.mojom.js twice; should be avoided: // // // // --> mojo.config.autoLoadMojomDeps = true; } (function() { var internal = mojo.internal; var config = mojo.config; var LoadState = { PENDING_LOAD: 1, LOADED: 2 }; var mojomRegistry = new Map(); function exposeNamespace(namespace) { var current = config.global; var parts = namespace.split('.'); for (var part; parts.length && (part = parts.shift());) { if (!current[part]) { current[part] = {}; } current = current[part]; } return current; } function isMojomPendingLoad(id) { return mojomRegistry.get(id) === LoadState.PENDING_LOAD; } function isMojomLoaded(id) { return mojomRegistry.get(id) === LoadState.LOADED; } function markMojomPendingLoad(id) { if (isMojomLoaded(id)) { throw new Error('The following mojom file has been loaded: ' + id); } mojomRegistry.set(id, LoadState.PENDING_LOAD); } function markMojomLoaded(id) { mojomRegistry.set(id, LoadState.LOADED); } function loadMojomIfNecessary(id, relativePath) { if (mojomRegistry.has(id)) { return; } if (config.global.document === undefined) { throw new Error( 'Mojom dependency autoloading is not implemented in workers. ' + 'Please see config variable mojo.config.autoLoadMojomDeps for more ' + 'details.'); } markMojomPendingLoad(id); var url = new URL(relativePath, document.currentScript.src).href; config.global.document.write('
登录后可以享受更多权益
您还没有登录,登录后您可以:
收藏Android系统代码
收藏喜欢的文章
多个平台共享账号
去登录
首次使用?从这里
注册