code stringlengths 1 1.05M | repo_name stringlengths 6 83 | path stringlengths 3 242 | language stringclasses 222
values | license stringclasses 20
values | size int64 1 1.05M |
|---|---|---|---|---|---|
// Copyright 2021 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// This file provides samples for testing the extractor.py script.
/**
* Example class that contains a NetworkTrafficAnnotationTag definition.
*/
public class ValidFile {
... | Zhao-PengFei35/chromium_src_4 | tools/traffic_annotation/scripts/test_data/ValidFile.java | Java | unknown | 2,787 |
// Copyright 2023 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// File should not be added in safe list.
// Incomplete annotation
net::NetworkTrafficAnnotationTag traffic_annotation =
net::DefineNetworkTrafficAnnotation("missing_new_f... | Zhao-PengFei35/chromium_src_4 | tools/traffic_annotation/scripts/test_data/missing_new_field_sample_data/sample_new_field_not_safelisted.cc | C++ | unknown | 3,207 |
// Copyright 2023 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// File is added in safe list.
// An annotation with last_reviewed date but
// missing email address, unspecified user_data
net::NetworkTrafficAnnotationTag traffic_annotation... | Zhao-PengFei35/chromium_src_4 | tools/traffic_annotation/scripts/test_data/missing_new_field_sample_data/test_new_field_safelisted.cc | C++ | unknown | 3,154 |
// Copyright 2017 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// This is a sample file that has relevant file extension and includes
// some keywords relevant to network traffic annotation and should be included
// in tests.
#include "ne... | Zhao-PengFei35/chromium_src_4 | tools/traffic_annotation/scripts/test_data/objective_cpp.mm | Objective-C++ | unknown | 370 |
// Copyright 2020 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// An OK annotation
net::NetworkTrafficAnnotationTag traffic_annotation =
net::DefineNetworkTrafficAnnotation("ok_annotation", R"(
semantics {
sender: "Cloud Policy"
... | Zhao-PengFei35/chromium_src_4 | tools/traffic_annotation/scripts/test_data/test_sample_annotations.cc | C++ | unknown | 3,847 |
// Copyright 2019 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "net/traffic_annotation/network_traffic_annotation.h"
net::NetworkTrafficAnnotationTag kTrafficAnnotation =
net::DefineNetworkTrafficAnnotation("id1");
| Zhao-PengFei35/chromium_src_4 | tools/traffic_annotation/scripts/test_data/too_few_args.cc | C++ | unknown | 310 |
// Copyright 2019 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "net/traffic_annotation/network_traffic_annotation.h"
#include "dummy_classes.h"
// This file provides samples for testing the extractor.py script.
namespace {
net... | Zhao-PengFei35/chromium_src_4 | tools/traffic_annotation/scripts/test_data/valid_file.cc | C++ | unknown | 4,108 |
// Copyright 2019 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "net/traffic_annotation/network_traffic_annotation.h"
net::NetworkTrafficAnnotationTag kTrafficAnnotation =
net::DefineNetworkTrafficAnnotation(
should_be... | Zhao-PengFei35/chromium_src_4 | tools/traffic_annotation/scripts/test_data/wrong_arg_type.cc | C++ | unknown | 375 |
#!/usr/bin/env vpython3
# Copyright 2018 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Runs tests to ensure annotation tests are working as expected.
"""
from __future__ import print_function
import os
import argparse
import sys
import t... | Zhao-PengFei35/chromium_src_4 | tools/traffic_annotation/scripts/traffic_annotation_auditor_tests.py | Python | unknown | 5,978 |
#!/usr/bin/env vpython3
# Copyright 2020 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""This script updates the Chrome Browser Network Traffic Annotations document.
To run the script, you should first generate annotations.tsv using
traffic_a... | Zhao-PengFei35/chromium_src_4 | tools/traffic_annotation/scripts/update_annotations_doc.py | Python | unknown | 19,204 |
#!/usr/bin/env vpython3
# Copyright 2020 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Unit tests for update_annotations_doc.py
"""
import os
import sys
import unittest
from mock import MagicMock
# Mock some imports which aren't necessa... | Zhao-PengFei35/chromium_src_4 | tools/traffic_annotation/scripts/update_annotations_doc_tests.py | Python | unknown | 6,314 |
#!/usr/bin/env vpython3
# Copyright 2017 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""This script updates network traffic annotations sheet. To run the script, you
should first generate annotations.tsv using traffic_annotation_auditor, an... | Zhao-PengFei35/chromium_src_4 | tools/traffic_annotation/scripts/update_annotations_sheet.py | Python | unknown | 17,000 |
# Copyright 2018 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
USE_PYTHON3 = True
def _CommonChecks(input_api, output_api):
results = []
# Run Pylint over the files in the directory.
pylint_checks = input_api.canned_checks.GetPylint(... | Zhao-PengFei35/chromium_src_4 | tools/translation/PRESUBMIT.py | Python | unknown | 1,523 |
# Copyright 2019 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import subprocess
import sys
if sys.platform.startswith('win'):
# Use the |git.bat| in the depot_tools/ on Windows.
GIT = 'git.bat'
else:
GIT = 'git'
def list_grds_in_rep... | Zhao-PengFei35/chromium_src_4 | tools/translation/helper/git_helper.py | Python | unknown | 1,274 |
# Copyright 2019 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import sys
import tempfile
here = os.path.dirname(os.path.realpath(__file__))
repo_root = os.path.normpath(os.path.join(here, '..', '..', '..'))
try:
old_sys_path = ... | Zhao-PengFei35/chromium_src_4 | tools/translation/helper/grd_helper.py | Python | unknown | 3,367 |
# Copyright 2019 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Unit tests for grd_helper.py."""
import io
import os
import sys
import unittest
# Add the parent dir so that we can import from "helper".
sys.path.insert(0, os.path.dirname(os... | Zhao-PengFei35/chromium_src_4 | tools/translation/helper/grd_helper_unittest.py | Python | unknown | 1,610 |
# Copyright 2019 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Sanity checking for grd_helper.py. Run manually before uploading a CL."""
import io
import os
import subprocess
import sys
# Add the parent dir so that we can import from "hel... | Zhao-PengFei35/chromium_src_4 | tools/translation/helper/sanity_check.py | Python | unknown | 3,250 |
# Copyright 2018 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Helpers for dealing with translation files."""
from __future__ import print_function
import ast
import os
import re
import sys
import xml.etree.cElementTree as ElementTree
i... | Zhao-PengFei35/chromium_src_4 | tools/translation/helper/translation_helper.py | Python | unknown | 9,461 |
# Copyright 2018 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Unit tests for translation_helper.py."""
import unittest
import os
import sys
import translation_helper
here = os.path.realpath(__file__)
testdata_path = os.path.normpath(os.p... | Zhao-PengFei35/chromium_src_4 | tools/translation/helper/translation_helper_unittest.py | Python | unknown | 4,507 |
#!/usr/bin/env python
# Copyright 2018 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""A tool to upload translation screenshots to Google Cloud Storage.
This tool searches the current repo for .png files associated with .grd or
.grdp files.... | Zhao-PengFei35/chromium_src_4 | tools/translation/upload_screenshots.py | Python | unknown | 8,212 |
#!/usr/bin/env python
# Copyright 2018 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import unittest
import os
import sys
here = os.path.realpath(__file__)
testdata_path = os.path.normpath(os.path.join(here, '..', 'testdata'))
import upload... | Zhao-PengFei35/chromium_src_4 | tools/translation/upload_screenshots_unittest.py | Python | unknown | 884 |
# Copyright 2021 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Presubmit script for files in tools/typescript/
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details about the presubmit API built into ... | Zhao-PengFei35/chromium_src_4 | tools/typescript/PRESUBMIT.py | Python | unknown | 1,551 |
# Copyright 2023 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from os import path
def _add_ui_webui_resources_mappings(path_mappings, root_gen_dir):
# Calculate mappings for ui/webui/resources/ sub-folders that have a dedicated
# ts_li... | Zhao-PengFei35/chromium_src_4 | tools/typescript/path_mappings.py | Python | unknown | 2,925 |
// Copyright 2021 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
export function foo(): string {
return 17;
}
| Zhao-PengFei35/chromium_src_4 | tools/typescript/tests/project1/errors.ts | TypeScript | unknown | 191 |
// Copyright 2021 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
export function foo(): string {
return 'foo';
}
export function num(): number {
return 17;
}
| Zhao-PengFei35/chromium_src_4 | tools/typescript/tests/project1/foo.ts | TypeScript | unknown | 242 |
// Copyright 2021 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
/** @return {string} */
export function bar() {
return 'bar';
}
| Zhao-PengFei35/chromium_src_4 | tools/typescript/tests/project1/legacy_file.js | JavaScript | unknown | 210 |
// Copyright 2021 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import {foo} from '../project1/foo.js';
import {baz} from '../project3/baz.js';
import {bar} from 'chrome://some-other-source/legacy_file.js';
// Importing from chrome://reso... | Zhao-PengFei35/chromium_src_4 | tools/typescript/tests/project2/bar.ts | TypeScript | unknown | 755 |
// Copyright 2022 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import {hello} from './include.js';
function sayHello(): void {
console.info(hello());
}
sayHello();
| Zhao-PengFei35/chromium_src_4 | tools/typescript/tests/project4/exclude.ts | TypeScript | unknown | 249 |
// Copyright 2022 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
export function hello(): string {
return 'hello';
}
| Zhao-PengFei35/chromium_src_4 | tools/typescript/tests/project4/include.ts | TypeScript | unknown | 199 |
// Copyright 2022 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
export function foo(): string {
return 'foo';
}
| Zhao-PengFei35/chromium_src_4 | tools/typescript/tests/project5/bar.ts | TypeScript | unknown | 194 |
// Copyright 2022 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import {foo} from './bar.js';
export function testFoo(): boolean {
return foo() == 'foo';
}
| Zhao-PengFei35/chromium_src_4 | tools/typescript/tests/project5/bar_test.ts | TypeScript | unknown | 239 |
// Copyright 2023 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
export function assert<T>(value: T): asserts value {
if (value) {
return;
}
throw new Error('Assertion failed');
}
| Zhao-PengFei35/chromium_src_4 | tools/typescript/tests/ui/webui/resources/js/assert.ts | TypeScript | unknown | 270 |
# Copyright 2021 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import argparse
import collections
import json
import os
import re
import sys
_CWD = os.getcwd()
_HERE_DIR = os.path.dirname(__file__)
_SRC_DIR = os.path.normpath(os.path.join(_H... | Zhao-PengFei35/chromium_src_4 | tools/typescript/ts_definitions.py | Python | unknown | 4,093 |
# Copyright 2021 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import argparse
import collections
import json
import os
import re
import sys
import io
_CWD = os.getcwd()
_HERE_DIR = os.path.dirname(__file__)
_SRC_DIR = os.path.normpath(os.pa... | Zhao-PengFei35/chromium_src_4 | tools/typescript/ts_library.py | Python | unknown | 11,004 |
#!/usr/bin/env python3
# Copyright 2021 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import json
import ts_library
import ts_definitions
import os
import shutil
import tempfile
import unittest
_HERE_DIR = os.path.dirname(__file__)
_CWD = os... | Zhao-PengFei35/chromium_src_4 | tools/typescript/ts_library_test.py | Python | unknown | 14,970 |
# Copyright 2023 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# Overview: ts_library() supports only a small subset of all possible tsconfig
# configurations. Some options cannot be used in general, and some options
# should only be set thro... | Zhao-PengFei35/chromium_src_4 | tools/typescript/validate_tsconfig.py | Python | unknown | 8,486 |
#!/usr/bin/env python3
# Copyright 2017 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import argparse
import colorsys
import difflib
import html
import random
import os
import re
import subprocess
import sys
import tempfile
import textwrap
im... | Zhao-PengFei35/chromium_src_4 | tools/uberblame.py | Python | unknown | 22,571 |
#!/usr/bin/env python
# Copyright 2011 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Prints a report of symbols stripped by the linker due to being unused.
To use, build with these linker flags:
-Wl,--gc-sections
-Wl,--print-gc-sectio... | Zhao-PengFei35/chromium_src_4 | tools/unused-symbols-report.py | Python | unknown | 4,790 |
#!/usr/bin/env python
# Copyright 2020 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Downloads pgo profiles for optimizing official Chrome.
This script has the following responsibilities:
1. Download a requested profile if necessary.
2. Re... | Zhao-PengFei35/chromium_src_4 | tools/update_pgo_profiles.py | Python | unknown | 4,987 |
# Copyright 2014 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
| Zhao-PengFei35/chromium_src_4 | tools/usb_gadget/__init__.py | Python | unknown | 140 |
# Copyright 2014 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Package entry-point."""
from __future__ import print_function
import argparse
import netifaces
from tornado import ioloop
import composite_echo_gadget
import echo_gadget
im... | Zhao-PengFei35/chromium_src_4 | tools/usb_gadget/__main__.py | Python | unknown | 1,789 |
# Copyright 2015 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import uuid
import composite_gadget
import echo_gadget
import hid_echo_gadget
import hid_gadget
import usb_constants
import usb_descriptors
class CompositeEchoGadget(composite_... | Zhao-PengFei35/chromium_src_4 | tools/usb_gadget/composite_echo_gadget.py | Python | unknown | 2,293 |
# Copyright 2014 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""A composite USB gadget is built from multiple USB features.
"""
import gadget
import usb_constants
import usb_descriptors
class CompositeGadget(gadget.Gadget):
"""Basic fu... | Zhao-PengFei35/chromium_src_4 | tools/usb_gadget/composite_gadget.py | Python | unknown | 9,378 |
# Copyright 2014 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Default gadget configuration."""
import gadget
import usb_constants
import usb_descriptors
class DefaultGadget(gadget.Gadget):
def __init__(self):
device_desc = usb_d... | Zhao-PengFei35/chromium_src_4 | tools/usb_gadget/default_gadget.py | Python | unknown | 1,189 |
# Copyright 2014 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""USB echo gadget module.
This gadget has pairs of IN/OUT endpoints that echo packets back to the host.
"""
import uuid
import composite_gadget
import usb_constants
import usb... | Zhao-PengFei35/chromium_src_4 | tools/usb_gadget/echo_gadget.py | Python | unknown | 8,412 |
#!/usr/bin/env python
# Copyright 2015 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import unittest
import mock
import echo_gadget
import usb_constants
class EchoGadgetTest(unittest.TestCase):
def test_bulk_echo(self):
g = echo_ga... | Zhao-PengFei35/chromium_src_4 | tools/usb_gadget/echo_gadget_test.py | Python | unknown | 543 |
# Copyright 2014 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Generic USB gadget functionality.
"""
from __future__ import print_function
import struct
import msos20_descriptors
import usb_constants
import usb_descriptors
class Gadge... | Zhao-PengFei35/chromium_src_4 | tools/usb_gadget/gadget.py | Python | unknown | 21,231 |
#!/usr/bin/env python
# Copyright 2014 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import unittest
import uuid
import mock
import gadget
import usb_constants
import usb_descriptors
device_desc = usb_descriptors.DeviceDescriptor(
idV... | Zhao-PengFei35/chromium_src_4 | tools/usb_gadget/gadget_test.py | Python | unknown | 12,730 |
# Copyright 2014 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""HID constant definitions.
"""
import usb_constants
class DescriptorType(object):
"""Class descriptors.
See Device Class Definition for Human Interface Devices (HID) Ver... | Zhao-PengFei35/chromium_src_4 | tools/usb_gadget/hid_constants.py | Python | unknown | 3,385 |
# Copyright 2014 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Utility functions for constructing HID report descriptors.
"""
import struct
import hid_constants
def ReportDescriptor(*items):
return ''.join(items)
def _PackItem(tag... | Zhao-PengFei35/chromium_src_4 | tools/usb_gadget/hid_descriptors.py | Python | unknown | 4,909 |
#!/usr/bin/env python
# Copyright 2014 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import unittest
import hid_descriptors
import keyboard_gadget
import mouse_gadget
class HidTest(unittest.TestCase):
def test_keyboard_example(self):
... | Zhao-PengFei35/chromium_src_4 | tools/usb_gadget/hid_descriptors_test.py | Python | unknown | 1,864 |
# Copyright 2014 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""A HID-class echo device.
This module provides a HID feature and HID device that can be used as an
echo test for HID drivers. The device exposes vendor-specific input, output
a... | Zhao-PengFei35/chromium_src_4 | tools/usb_gadget/hid_echo_gadget.py | Python | unknown | 3,389 |
# Copyright 2014 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Human Interface Device gadget module.
This gadget emulates a USB Human Interface Device. Multiple logical components
of a device can be composed together as separate "features... | Zhao-PengFei35/chromium_src_4 | tools/usb_gadget/hid_gadget.py | Python | unknown | 14,413 |
#!/usr/bin/env python
# Copyright 2014 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import unittest
import mock
import hid_constants
import hid_descriptors
import hid_gadget
import usb_constants
report_desc = hid_descriptors.ReportDescri... | Zhao-PengFei35/chromium_src_4 | tools/usb_gadget/hid_gadget_test.py | Python | unknown | 9,428 |
# Copyright 2014 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Implementation of a USB HID keyboard.
Two classes are provided by this module. The KeyboardFeature class implements
the core functionality of a HID keyboard and can be include... | Zhao-PengFei35/chromium_src_4 | tools/usb_gadget/keyboard_gadget.py | Python | unknown | 6,397 |
#!/usr/bin/env python
# Copyright 2014 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import unittest
import mock
import hid_constants
import keyboard_gadget
import usb_constants
class KeyboardGadgetTest(unittest.TestCase):
def test_key... | Zhao-PengFei35/chromium_src_4 | tools/usb_gadget/keyboard_gadget_test.py | Python | unknown | 2,191 |
# Copyright 2014 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Linux gadgetfs glue.
Exposes a USB gadget using a USB peripheral controller on Linux. The userspace
ABI is documented here:
https://github.com/torvalds/linux/blob/master/driv... | Zhao-PengFei35/chromium_src_4 | tools/usb_gadget/linux_gadgetfs.py | Python | unknown | 10,960 |
# Copyright 2014 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Implementation of a USB HID mouse.
Two classes are provided by this module. The MouseFeature class implements
the core functionality of a HID mouse and can be included in any ... | Zhao-PengFei35/chromium_src_4 | tools/usb_gadget/mouse_gadget.py | Python | unknown | 5,043 |
#!/usr/bin/env python
# Copyright 2014 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import unittest
import mock
import hid_constants
import mouse_gadget
import usb_constants
class MouseGadgetTest(unittest.TestCase):
def test_click(sel... | Zhao-PengFei35/chromium_src_4 | tools/usb_gadget/mouse_gadget_test.py | Python | unknown | 1,383 |
# Copyright 2015 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Microsoft OS 2.0 Descriptor generation utilities.
Classes to help generate Microsoft OS 2.0 descriptors.
Based on documentation here:
https://msdn.microsoft.com/en-us/library... | Zhao-PengFei35/chromium_src_4 | tools/usb_gadget/msos20_descriptors.py | Python | unknown | 3,385 |
#!/usr/bin/env python
# Copyright 2014 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Utility to package and upload the USB gadget framework.
"""
import argparse
import hashlib
import io
import os
import zipfile
try:
from urllib.reques... | Zhao-PengFei35/chromium_src_4 | tools/usb_gadget/package.py | Python | unknown | 2,905 |
# Copyright 2014 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""WSGI application to manage a USB gadget.
"""
from __future__ import print_function
import datetime
import hashlib
import re
import subprocess
import sys
import time
import ur... | Zhao-PengFei35/chromium_src_4 | tools/usb_gadget/server.py | Python | unknown | 3,904 |
# Copyright 2014 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""USB constant definitions.
"""
class DescriptorType(object):
"""Descriptor Types.
See Universal Serial Bus Specification Revision 2.0 Table 9-5.
"""
DEVICE = 1
CONF... | Zhao-PengFei35/chromium_src_4 | tools/usb_gadget/usb_constants.py | Python | unknown | 3,424 |
# Copyright 2014 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""USB descriptor generation utilities.
Classes to represent and generate USB descriptors.
"""
import struct
import hid_constants
import usb_constants
class Field(object):
... | Zhao-PengFei35/chromium_src_4 | tools/usb_gadget/usb_descriptors.py | Python | unknown | 15,614 |
#!/usr/bin/env python
# Copyright 2014 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import unittest
import hid_constants
import usb_descriptors
class DescriptorWithField(usb_descriptors.Descriptor):
pass
DescriptorWithField.AddField('b... | Zhao-PengFei35/chromium_src_4 | tools/usb_gadget/usb_descriptors_test.py | Python | unknown | 6,799 |
include_rules = [
"+base",
"+v8",
"+third_party/blink/public",
"+gin/v8_initializer.h",
"+mojo/core/embedder",
"+mojo/public",
]
| Zhao-PengFei35/chromium_src_4 | tools/v8_context_snapshot/DEPS | Python | unknown | 141 |
// Copyright 2017 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/at_exit.h"
#include "base/command_line.h"
#include "base/files/file_util.h"
#include "base/task/single_thread_task_executor.h"
#include "base/task/single_thread_... | Zhao-PengFei35/chromium_src_4 | tools/v8_context_snapshot/v8_context_snapshot_generator.cc | C++ | unknown | 2,731 |
#!/usr/bin/env python3
# Copyright 2012 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from third_party import asan_symbolize
import argparse
import base64
import json
import os
import platform
import re
import subprocess
import sys
class L... | Zhao-PengFei35/chromium_src_4 | tools/valgrind/asan/asan_symbolize.py | Python | unknown | 10,142 |
#!/usr/bin/env python3
# Copyright 2019 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""A script to bisect field trials to pin point a culprit for certain behavior.
Chrome runs with many experiments and variations (field trials) that are
ra... | Zhao-PengFei35/chromium_src_4 | tools/variations/bisect_variations.py | Python | unknown | 12,159 |
# Copyright 2021 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Simple script for cleaning up stale configs from fieldtrial_testing_config.
Methodology:
Scan for all study names that appear in fieldtrial config file,
and removes ones th... | Zhao-PengFei35/chromium_src_4 | tools/variations/cleanup_stale_fieldtrial_configs.py | Python | unknown | 5,384 |
#!/usr/bin/env python
# Copyright 2015 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import json
import os.path
import sys
import optparse
_script_path = os.path.realpath(__file__)
sys.path.insert(0, os.path.normpath(_script_path + "/../../... | Zhao-PengFei35/chromium_src_4 | tools/variations/fieldtrial_to_struct.py | Python | unknown | 8,111 |
# Copyright 2015 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import unittest
import fieldtrial_to_struct
import os
class FieldTrialToStruct(unittest.TestCase):
def FullRelativePath(self, relative_path):
base_path = os.path.dirname... | Zhao-PengFei35/chromium_src_4 | tools/variations/fieldtrial_to_struct_unittest.py | Python | unknown | 15,078 |
# Copyright 2015 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from __future__ import print_function
import json
import sys
import fieldtrial_to_struct
def _hex(ch):
hv = hex(ord(ch)).replace('0x', '')
hv.zfill(2)
return hv.upper()
... | Zhao-PengFei35/chromium_src_4 | tools/variations/fieldtrial_util.py | Python | unknown | 8,213 |
# Copyright 2015 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import unittest
import fieldtrial_util
import os
import tempfile
class FieldTrialUtilUnittest(unittest.TestCase):
def runGenerateArgs(self, config, platform, override_args=N... | Zhao-PengFei35/chromium_src_4 | tools/variations/fieldtrial_util_unittest.py | Python | unknown | 6,797 |
# Copyright 2019 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""A script to split Chrome variations into two sets.
Chrome runs with many experiments and variations (field trials) that are
randomly selected based on a configuration from a s... | Zhao-PengFei35/chromium_src_4 | tools/variations/split_variations_cmd.py | Python | unknown | 17,554 |
# Copyright 2019 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import unittest
import os
import split_variations_cmd
_ENABLE_FEATURES_SWITCH_NAME = 'enable-features'
_DISABLE_FEATURES_SWITCH_NAME = 'disable-features'
_FORCE_FIELD_TRIALS_SWI... | Zhao-PengFei35/chromium_src_4 | tools/variations/split_variations_cmd_unittest.py | Python | unknown | 5,528 |
specific_include_rules = {
"expected_output.h": [
"+components/variations/proto/study.pb.h"
]
}
| Zhao-PengFei35/chromium_src_4 | tools/variations/unittest_data/DEPS | Python | unknown | 106 |
# Copyright 2015 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Presubmit tests for /tools/vim.
Runs Python unit tests in /tools/vim/tests on upload.
"""
USE_PYTHON3 = True
def CheckChangeOnUpload(input_api, output_api):
results = []
... | Zhao-PengFei35/chromium_src_4 | tools/vim/PRESUBMIT.py | Python | unknown | 1,313 |
# Copyright 2012 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# Autocompletion config for YouCompleteMe in Chromium.
#
# USAGE:
#
# 1. Install YCM [https://github.com/Valloric/YouCompleteMe]
# (Googlers should check out [go/ycm])
... | Zhao-PengFei35/chromium_src_4 | tools/vim/chromium.ycm_extra_conf.py | Python | unknown | 14,526 |
" Copyright 2014 The Chromium Authors
" Use of this source code is governed by a BSD-style license that can be
" found in the LICENSE file.
" Binds cmd-shift-i (on Mac) or ctrl-i (elsewhere) to invoke clang-format.py.
" It will format the current selection (and if there's no selection, the
" current line.)
let s:scri... | Zhao-PengFei35/chromium_src_4 | tools/vim/clang-format.vim | Vim Script | unknown | 611 |
" To get syntax highlighting and tab settings for gyp(i), DEPS, and 'git cl'
" changelist description files, add the following to your .vimrc file:
" so /path/to/src/tools/vim/filetypes.vim
"
augroup filetype
au! BufRead,BufNewFile *.gyp set filetype=python expandtab tabstop=2 shiftwidth=2
au! Bu... | Zhao-PengFei35/chromium_src_4 | tools/vim/filetypes.vim | Vim Script | unknown | 574 |
" Copyright 2015 The Chromium Authors
" Use of this source code is governed by a BSD-style license that can be
" found in the LICENSE file.
" We take care to preserve the user's fileencodings and fileformats,
" because those settings are global (not buffer local), yet we want
" to override them for loading mojom files... | Zhao-PengFei35/chromium_src_4 | tools/vim/mojom/ftdetect/mojomfiletype.vim | Vim Script | unknown | 1,040 |
" Copyright 2015 The Chromium Authors
" Use of this source code is governed by a BSD-style license that can be
" found in the LICENSE file.
" Vim syntax file
" Language: Mojom
" To get syntax highlighting for .mojom files, add the following to your .vimrc
" file:
" set runtimepath+=/path/to/src/tools/vim/mojom
if... | Zhao-PengFei35/chromium_src_4 | tools/vim/mojom/syntax/mojom.vim | Vim Script | unknown | 2,301 |
" Copyright 2012 The Chromium Authors
" Use of this source code is governed by a BSD-style license that can be
" found in the LICENSE file.
"
" Adds a "Compile this file" function, using ninja. On Mac, binds Cmd-k to
" this command. On Windows, Ctrl-F7 (which is the same as the VS default).
" On Linux, <Leader>o, which... | Zhao-PengFei35/chromium_src_4 | tools/vim/ninja-build.vim | Vim Script | unknown | 3,911 |
# Copyright 2014 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from __future__ import print_function
import sys
import os
import itertools
import re
try:
from exceptions import RuntimeError
except ImportError:
pass
def GetNinjaOutputD... | Zhao-PengFei35/chromium_src_4 | tools/vim/ninja_output.py | Python | unknown | 2,446 |
#!/usr/bin/env python3
# Copyright 2015 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Tests for chromium.ycm_extra_conf.
These tests should be getting picked up by the PRESUBMIT.py in /tools/vim.
Currently the tests only run on Linux and ... | Zhao-PengFei35/chromium_src_4 | tools/vim/tests/chromium.ycm_extra_conf_unittest.py | Python | unknown | 14,911 |
<!DOCTYPE html>
<html lang="en">
<!--
Copyright 2022 The Chromium Authors
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
<head>
<style>
#scrubberframe::-webkit-slider-thumb {
appearance: none;
width: 20px;
height: 20px;
backgroun... | Zhao-PengFei35/chromium_src_4 | tools/visual_debugger/app.html | HTML | unknown | 16,711 |
// Copyright 2022 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
/**
* @fileoverview Keeps the websocket connection and allows sending messages
*/
const Connection = {
async getUrl() {
let url = document.querySelector("#url").value... | Zhao-PengFei35/chromium_src_4 | tools/visual_debugger/connection.js | JavaScript | unknown | 4,840 |
// Copyright 2022 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
const MDCMenu = mdc.menu.MDCMenu;
const MDCMenuFoundation = mdc.menu.MDCMenuFoundation;
const maxZIndex = 999;
class FilterUI extends HTMLElement {
constructor() {
super... | Zhao-PengFei35/chromium_src_4 | tools/visual_debugger/filter-ui.js | JavaScript | unknown | 15,705 |
// Copyright 2022 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Represents a source for a draw call, or a log, etc.
//
class Source {
static instances = [];
constructor(json) {
this.file_ = json.file;
this.func_ = json.func;... | Zhao-PengFei35/chromium_src_4 | tools/visual_debugger/filter.js | JavaScript | unknown | 7,907 |
// Copyright 2022 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Enum class to identify horizontal or vertical flips
//
class FlipEnum {
static HorizontalFlip = new FlipEnum(1);
static VerticalFlip = new FlipEnum(2);
constructor(id... | Zhao-PengFei35/chromium_src_4 | tools/visual_debugger/frame.js | JavaScript | unknown | 15,963 |
#!/usr/bin/env python3
# Copyright 2022 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import json
import sys
if (sys.version_info < (3, )):
print("FAILURE. Python 3 or greater required. Please run with \"python3\".")
sys.exit(7)
from ht... | Zhao-PengFei35/chromium_src_4 | tools/visual_debugger/server.py | Python | unknown | 2,717 |
/* Copyright 2022 The Chromium Authors
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file. */
.sectionTitle {
margin-left: 10px;
padding-left: 5px;
padding-right: 5px;
margin-right: 10px;
background-color: white;
display: inline-block;
font-family: Robo... | Zhao-PengFei35/chromium_src_4 | tools/visual_debugger/style.css | CSS | unknown | 1,686 |
// Copyright 2022 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// This class represent the UI for Thread drawing filter.
//
class ThreadUI extends HTMLElement {
constructor() {
super();
}
connectedCallback() {
this... | Zhao-PengFei35/chromium_src_4 | tools/visual_debugger/thread-ui.js | JavaScript | unknown | 6,008 |
// Copyright 2022 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Represents a thread making a debug call to
// the visual debugger.
//
class Thread {
// Keeps track of all threads that debug calls came in from
// while the app is ... | Zhao-PengFei35/chromium_src_4 | tools/visual_debugger/thread.js | JavaScript | unknown | 1,332 |
#!/usr/bin/env python
# Copyright 2016 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Script for converting the Web Bluetooth GATT blocklist into the format
expected by ContentBrowserClient#GetWebBluetoothBlocklist.
See:
https://github.com... | Zhao-PengFei35/chromium_src_4 | tools/web_bluetooth/compact_blocklist.py | Python | unknown | 2,757 |
#!/usr/bin/env python
# Copyright 2016 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import collections
import compact_blocklist as cb
import unittest
class CompactBlocklistTest(unittest.TestCase):
def TestValidUUID(self):
self.assert... | Zhao-PengFei35/chromium_src_4 | tools/web_bluetooth/compact_blocklist_unittest.py | Python | unknown | 2,868 |
# Copyright 2017 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
USE_PYTHON3 = True
def CheckChangeOnUpload(*args):
return _CommonChecks(*args)
def CheckChangeOnCommit(*args):
return _CommonChecks(*args)
def _CommonChecks(input_api, o... | Zhao-PengFei35/chromium_src_4 | tools/web_dev_style/PRESUBMIT.py | Python | unknown | 597 |
# Copyright 2022 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Checks for new additions of JS (rather than TS) files.
"""
def AddedJsFilesCheck(input_api, output_api, file_filter=lambda f: True):
results = []
def AddedJsFilesFilter(a... | Zhao-PengFei35/chromium_src_4 | tools/web_dev_style/added_js_files_check.py | Python | unknown | 1,065 |
# Copyright 2012 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Presubmit script for Chromium WebUI resources.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details about the presubmit API built into ... | Zhao-PengFei35/chromium_src_4 | tools/web_dev_style/css_checker.py | Python | unknown | 21,679 |