Skip to content

Instantly share code, notes, and snippets.

import json
class pathdict(dict):
def get(self, path, default=None):
return get(self, path, default=default)
def get(data, path, default=None):
cur, _, rest = path.partition(".")
# -*- coding: utf-8 -*-
import six
class FooException(Exception):
def __init__(self, message):
if six.PY2 and isinstance(message, six.text_type):
super(FooException, self).__init__(message.encode("utf-8"))
else:
super(FooException, self).__init__(message)
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
var EXPORTED_SYMBOLS = ["IPC"];
const { XPCOMUtils } = ChromeUtils.import(
"resource://gre/modules/XPCOMUtils.jsm"
"use strict";
var EXPORTED_SYMBOLS = ["StreamHandleCache"];
var singleton;
class StreamHandleCache extends Map {
constructor() {
super();
Services.obs.addObserver(this, "xpcom-will-shutdown");
% ./mach lint --fix remote/
error: problem with lint setup, skipping android-api-lint, android-checkstyle, android-javadoc, android-lint, android-test
An error occurred running eslint. Please check the following error messages:
TypeError: CLIEngine is not a constructor
at Object.execute (/home/ato/src/gecko/node_modules/eslint/lib/cli.js:208:28)
at Object.<anonymous> (/home/ato/src/gecko/node_modules/eslint/bin/eslint.js:81:28)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
% ./mach lint -funix remote/
Using base prefix '/usr'
/home/ato/src/gecko/third_party/python/virtualenv/virtualenv.py:1047: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
import imp
New python executable in /home/ato/src/gecko/obj-x86_64-pc-linux-gnu/_virtualenvs/init_py3/bin/python3
Also creating executable in /home/ato/src/gecko/obj-x86_64-pc-linux-gnu/_virtualenvs/init_py3/bin/python
Installing setuptools, pip, wheel...done.
Error processing command. Ignoring because optional. (optional:setup.py:third_party/python/psutil:build_ext:--inplace)
Error processing command. Ignoring because optional. (optional:packages.txt:comm/build/virtualenv_packages.txt)
error: problem with lint setup, skipping android-api-lint, android-checkstyle, android-javadoc, android-lint, android-test
diff --git a/toolkit/library/rust/Cargo.toml b/toolkit/library/rust/Cargo.toml
index 786645106085..69969f87a191 100644
--- a/toolkit/library/rust/Cargo.toml
+++ b/toolkit/library/rust/Cargo.toml
@@ -30,6 +30,7 @@ fuzzing_interfaces = ["gkrust-shared/fuzzing_interfaces"]
webrtc = ["gkrust-shared/webrtc"]
wasm_library_sandboxing = ["gkrust-shared/wasm_library_sandboxing"]
webgpu = ["gkrust-shared/webgpu"]
+remote_agent = ["gkrust-shared/remote"]
diff --git a/remote/RemoteAgent.jsm b/remote/RemoteAgent.jsm
index 4387879dd5b4..73a4206b42b6 100644
--- a/remote/RemoteAgent.jsm
+++ b/remote/RemoteAgent.jsm
@@ -14,10 +14,12 @@ const { XPCOMUtils } = ChromeUtils.import(
XPCOMUtils.defineLazyModuleGetters(this, {
HttpServer: "chrome://remote/content/server/HTTPD.jsm",
JSONHandler: "chrome://remote/content/JSONHandler.jsm",
+ Log: "chrome://remote/content/Log.jsm",
Preferences: "resource://gre/modules/Preferences.jsm",
% curl -LO https://github.com/mozilla/geckodriver/releases/download/v0.26.0/geckodriver-v0.26.0-macos.tar.gz
% tar xf geckodriver-v0.26.0-macos.tar.gz
% ./geckodriver
^C
impl<'a> Iterator for Lexer<'a> {
type Item = Token;
fn next(&mut self) -> Option<Token> {
if let Some(ch) = self.chars.next() {
match ch {
ch if ch.is_digit(Self::RADIX) => Some(Token::Num(self.read_number(ch))),
ch if ch.is_alphabetic() => {
if let Some(peek_ch) = self.chars.peek() {
if peek_ch.is_alphabetic() {