From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Qiantan Hong Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] Add user content APIs for WebKit Xwidgets Date: Sun, 23 Oct 2022 22:16:39 +0000 Message-ID: <392D5A0E-AC2D-4582-8B81-777CB7C85D7A@stanford.edu> References: <763B89A7-AF82-4AAB-A0E9-A04D9958CAE8@stanford.edu> <878rlianx4.fsf@yahoo.com> <9FF9464C-1369-423E-A581-A900D132845F@stanford.edu> <87zgdy97t1.fsf@yahoo.com> <63F00459-018C-4634-9B52-A89A3ED1AA36@stanford.edu> <0F1442C8-45E2-408C-B310-448B4A26496E@stanford.edu> <87ilklnxei.fsf@yahoo.com> <0583C9C0-9953-414E-9F51-2AEFDF225BD9@stanford.edu> <87edv8mlr5.fsf@yahoo.com> <264D17C0-1FD6-44BA-B8BE-28249374F7A2@stanford.edu> <877d10mfsw.fsf@yahoo.com> <874jvu6c3h.fsf@yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14196"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Andrew De Angelis , "emacs-devel@gnu.org" To: Po Lu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Oct 24 07:31:58 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1omq45-0003Sg-Qf for ged-emacs-devel@m.gmane-mx.org; Mon, 24 Oct 2022 07:31:58 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1omnc5-0003Bo-I1; Sun, 23 Oct 2022 22:54:54 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1omjH4-0007x5-Ar for emacs-devel@gnu.org; Sun, 23 Oct 2022 18:16:54 -0400 Original-Received: from mx0b-00000d04.pphosted.com ([148.163.153.235]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1omjH0-0007Gz-TD for emacs-devel@gnu.org; Sun, 23 Oct 2022 18:16:54 -0400 Original-Received: from pps.filterd (m0102894.ppops.net [127.0.0.1]) by mx0a-00000d04.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 29NBtYYq021153; Sun, 23 Oct 2022 15:16:44 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=stanford.edu; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-id : content-transfer-encoding : mime-version; s=pps05272020; bh=OVSrc7++xM+gVj8XqpsDNKp/29c4pNPqco0xcYuKs5A=; b=jKkyRBIhideKEuvTFzd843F3EAO8Nl9V3D7Z1nGm18kKI9kQ880+EAAf884opC8XIH6H SO4c7i5gNIQh1RdaYuSieAmcXER3ep+Ktl4Zg3DfP1oQBEofdGSGtC0XRI4yUmE9utrU vjRI6rTXQMu7IMqvpLkqlJjfeqGw0JlpDtLJo9UHz+fM3QxHAt5NaFAE1vfFNiQwVrC8 PELpajgzaiIA3tqlBInzU+8unS7xpxsrbWZIQxshFZ0UkeQWnJsmm4qFyLrFJyAJ5jci EltoOifH/gQebwGIFolNgZIzp7ZzEtUkgEXa2eYg7sJdgIM2upKENKnOFxX9rzplgUpV hQ== Original-Received: from mx0a-00000d03.pphosted.com (mx0a-00000d03.pphosted.com [148.163.149.244]) by mx0a-00000d04.pphosted.com (PPS) with ESMTPS id 3kd04v1wbe-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sun, 23 Oct 2022 15:16:43 -0700 Original-Received: from pps.filterd (m0102881.ppops.net [127.0.0.1]) by mx0a-00000d03.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 29NBB2Px028877; Sun, 23 Oct 2022 15:16:42 -0700 Original-Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-00000d03.pphosted.com (PPS) with ESMTPS id 3kcdey5867-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sun, 23 Oct 2022 15:16:42 -0700 Original-Received: from m0102881.ppops.net (m0102881.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 29NMGgYk017551; Sun, 23 Oct 2022 15:16:42 -0700 Original-Received: from mx0a-00000d06.pphosted.com (mx0a-00000d06.pphosted.com [148.163.135.119]) by mx0a-00000d03.pphosted.com (PPS) with ESMTPS id 3kcdey5864-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sun, 23 Oct 2022 15:16:42 -0700 Original-Received: from pps.filterd (m0195434.ppops.net [127.0.0.1]) by mx0a-00000d06.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 29NLcjlX017084; Sun, 23 Oct 2022 15:16:42 -0700 Original-Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2172.outbound.protection.outlook.com [104.47.56.172]) by mx0a-00000d06.pphosted.com (PPS) with ESMTPS id 3kcbrws9un-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sun, 23 Oct 2022 15:16:42 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WD9vHUbsNfBoOvJFzZtp4NhPxQ3RSsRyd4xiaKuiqrD4XwRCDhhL63+6cQXr6046cT0ZFctNjnAnJr3lUsYouAGzdHfQaQLYdNYrP2cffjwHISHz4O7RNVanOE3BsesUA0nbeqluUbEp4yE2PO83wM7kPl8VwLn1QafqBdhJuIUzsPe6i0FrlNJrUbbxhVBuE1Hhz7R5QzHb05j4MUPiVp9tcA4nicxJa8Xcw0/z0qXBfskkioLZuwvJ3hMXIdZbJB3JWIt11DjgFtwMA/VnxjyAAiYmsS+jWjVYjuCzOf8O8N4A+yB2pwc+dlWPEjjLWEwTHqrcM92BCDDnkyTlfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=OVSrc7++xM+gVj8XqpsDNKp/29c4pNPqco0xcYuKs5A=; b=NqmoC6yq0GIUcTmHp6UIRTT/ej0Arx3TEeNLj9TY5vyOgyHlkIC8bR1reXjd94eCNvTy2sm+IliK6U44dG+1P9r8xl4/IncHfWNJQnw1uFq1EK74C7QeveydnqvPbHgdjM4aETrW17A7GPiuYm39padh8FAl7ZmQhMZk77hNFg7UE5w1Oe5Rbne5BAV1v7wl+74RS/nRrQaCMRZRPVTP0RPXFvKfQJY/EmIQMOhduDK+uzC0XA+49WUjBVoQ3x8FdyQTFDgA5dK+geXbjf8FGqa74qjUiQBDpKSwFV5Rehc9QKpBkepTdmmXVLldGNi0hHhdh68kbynscdwgfUR46A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=stanford.edu; dmarc=pass action=none header.from=stanford.edu; dkim=pass header.d=stanford.edu; arc=none Original-Received: from BY5PR02MB6771.namprd02.prod.outlook.com (2603:10b6:a03:200::10) by BL3PR02MB8299.namprd02.prod.outlook.com (2603:10b6:208:346::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.35; Sun, 23 Oct 2022 22:16:39 +0000 Original-Received: from BY5PR02MB6771.namprd02.prod.outlook.com ([fe80::3671:4788:7f6a:e30c]) by BY5PR02MB6771.namprd02.prod.outlook.com ([fe80::3671:4788:7f6a:e30c%7]) with mapi id 15.20.5746.021; Sun, 23 Oct 2022 22:16:39 +0000 Thread-Topic: [PATCH] Add user content APIs for WebKit Xwidgets Thread-Index: AQHY35b+ISYWRDJ9PkKWpJcMREJMA64NdpqagAAC6wCAAAZiuoAA5JIAgABJuICAAGkDAIAAOsDygADL8ACAAFObloAAIKuAgAADXkSACyozAIAAHdangAC9fgA= In-Reply-To: <874jvu6c3h.fsf@yahoo.com> Accept-Language: en-US Content-Language: en-US x-ms-publictraffictype: Email x-ms-traffictypediagnostic: BY5PR02MB6771:EE_|BL3PR02MB8299:EE_ x-ms-office365-filtering-correlation-id: 55e65a75-d1f4-4b58-da22-08dab54441c0 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: jXN7XrOkWZSBAA4JMlxBpzDeK6RBqjSQcGx1pkKKb2jyA6n4sgRqz0U+KFhz/jmM0+f2mRFktRC2+ak8FWAP3P4OBPJlsDgJNN0T9ZEZcpitXJEU9+4pht5Xcc4XDj2HFRr8jt3MCTTWuinv+tcd+e7xWjkFK7h8W+u+vR5IRPqzS+y8hcT1D8P/juiuvNEdKxmyJUt1ZO7aVdi/ZhIV2FQy5LgImqklYHH2gCgXl9st24ZPy2FP1SmsKUYnMqC3ezsoLVbCQoK0KWBxnEErxZOJekakZRDzYz2tc8C7GbsE0HgbhWu+e8kuCtihnMAZ4naQhN0PWY6Qsqh5R9do4QipvPI9ChuoKzJXySofvcvSrPrx/p+CpwebaSa+S9apCeieJi/ugTPP9FihzjSY3MEcKSLT56WxODSt25cJdDiz+mCxr6hkaRmdpRYYLQf0VB0Y6gE+ghnltUHyF5F0Q+oJXU0oAsf6+lgonc7Zozu9SPLIukDnfgGP+B6+mnDXn2uqOMF8d1JpplBmVCwlyukEDEBErNLAVXTS8yv1bbFmUNrrf748Ric3hJaYesyli4h7LCQ5Z5A6ELZEA/Op3OVHFLBcabnwosAzk8Vp1EqmZvvhDcxS6xXZF5NS+TqwNuxhrb5yb3Hfd3PC2scDwqUEJHeeEW+LT2YFtJ4ucZbGrtJWy6u+lgvIjEItg2O+N7vxEEGy0VCf37kEpEqTmu96D1ZcRpdg55TFDcpAnYCnfZEEolJDX+2eOtSTI Y9uMh3KMyQC7ufI8X9YN+6NL9q7rGTicQ/bqA3ImiZnrxY= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BY5PR02MB6771.namprd02.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(39860400002)(366004)(376002)(136003)(346002)(396003)(451199015)(66556008)(786003)(6506007)(316002)(33656002)(91956017)(38100700002)(38070700005)(122000001)(71200400001)(41300700001)(66446008)(8676002)(2616005)(5660300002)(66946007)(64756008)(186003)(8936002)(66476007)(6486002)(75432002)(2906002)(54906003)(478600001)(86362001)(76116006)(26005)(6512007)(41320700001)(4326008)(36756003)(6916009)(45980500001); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?dYNsidavzOykf7/5iuTldTfUXO+/x42Ka7cszEUDzkB0vh8Ap0jxqy2PGm/4?= =?us-ascii?Q?vg9HaJu0VPbXzpCRo+ZHd/U5/7BXBTg4mfDg8sYfW5Y2e+W2pnIfHF/Cb3V0?= =?us-ascii?Q?XI8aBc0J8SpHVUaWUP2bg2zQIK+Cf6oqFeLTBT6rO2dOBCTgSkCKtSgGrkUN?= =?us-ascii?Q?sf2hqNP1AegpKsVHgVRqCTv6xuiNBtH/OZH/IBwfKgYfMCsArIfP14QoAFsM?= =?us-ascii?Q?DFfnfyHcdw8lMZ4zh5dXl0Jl9NnCLdScOFnc3JAtjEJ+03kCDpXIT1t+lCDZ?= =?us-ascii?Q?ElD41oSszmTbXZgFVx8xdF52XudwsK+LK9uvqJqP+gS+NJtgigZbE8jTs+C8?= =?us-ascii?Q?KGhJqYLkQQqdK3Cgru2MDfYnGnLWNSTPzQLw25pcJ4xuiet285Qxcz1tnRF7?= =?us-ascii?Q?/lYU2e6fOXEKAuFJw0zGOoHVfiBMn0F2+M7xnEiWOBjzq5bMKRGpnfmZXf9u?= =?us-ascii?Q?Qt4qEDpHFlEBhNm5gazauO4W2KTeNzDV8KCv6Bj3e6rd5DMi6Mzc57RS7n9W?= =?us-ascii?Q?JGC5mqlkz7Zxg4Er/zkniEbhQhjAro1IrUsNqYo6MEG6vHsgNhXzuySjGhq7?= =?us-ascii?Q?bb9M9BqljpVwVq3Z+l/on0/dTWYEEy330XislfDB7WkEyslxwvjEmHYHEqqT?= =?us-ascii?Q?Lw Content-ID: X-OriginatorOrg: stanford.edu X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BY5PR02MB6771.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 55e65a75-d1f4-4b58-da22-08dab54441c0 X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Oct 2022 22:16:39.1282 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 396573cb-f378-4b68-9bc8-15755c0c51f3 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: PWCvNG5L9bCdfK+g427IyZedWRdfg0/X6Vw08uU1uswPsdlC2GktAi0i1HHerjay04Xi7vBjB97pfjWlipCh1Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL3PR02MB8299 x-proofpoint-stanford-dir: outbound X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-10-21_04,2022-10-21_01,2022-06-22_01 X-Proofpoint-GUID: QQWBA9kUdw0PfbBFYL6rHwI83TlfNll3 X-Proofpoint-ORIG-GUID: QQWBA9kUdw0PfbBFYL6rHwI83TlfNll3 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-10-21_04,2022-10-21_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 suspectscore=0 priorityscore=1501 impostorscore=0 spamscore=0 adultscore=100 bulkscore=0 phishscore=0 clxscore=1015 mlxscore=0 lowpriorityscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210230142 Received-SPF: pass client-ip=148.163.153.235; envelope-from=qthong@stanford.edu; helo=mx0b-00000d04.pphosted.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Sun, 23 Oct 2022 22:21:59 -0400 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: "Emacs-devel" Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:298328 Archived-At: >> 1. I think that connecting signal to scriptor (now called manager) >> doesn't require xw to be marked, because it is also destroyed when xw >> is killed? Suppose that now I reference count correctly, manager >> should be owned by xw, just like the WebKitWebContext at line 363. >=20 > No, because webkit_web_view_new_with_related_view is used to create > WebKitWebView objects when an existing live xwidget is specified as the > related argument to `make-xwidget', and those will hold further > references to the content manager beyond the lifetime of the > WebKitWebView holding the initial reference to said content manager. In > fact, won't userscripts apply to every WebKitWebView with the same > content manager? >=20 > I think I would prefer documenting and implementing userscripts as > applying to all related xwidgets: you could link each related xwidget > onto a circular queue, designate one as the "head", and hold a reference > to the head, replacing it with a different xwidget on the queue each > time the head is killed, until there are no more xwidgets on that queue, > at which point it becomes safe to free the userscript data. Applying to all related Xwidgets sound like a good idea. I think we should formalize the "group of related Xwidgets" as some kind of object? Maybe a record type implemented in Lisp, or a pseudo vector (which I don't know much about how to implement). An alternative is to expose content manager as a pseudovector, which will in fact have 1-to-1 correspondence with "rela= ted group", but I like related group more because it feels like a nicer abstrac= tion. What do you think? If that is implemented I believe we also don't need extra marking, as the manager will hold a reference to the related group object, but the related group object will be collected only all related xwdigets are already killed= . Best, Qiantan