mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-10-30 15:41:48 +00:00
Cleaner merge
Switch to non-blocking sockets. Fix TLS handshake/receive/send ordering
This commit is contained in:
@@ -73,13 +73,13 @@ pub fn CDPT(comptime TypeProvider: type) type {
|
||||
pub const Browser = TypeProvider.Browser;
|
||||
pub const Session = TypeProvider.Session;
|
||||
|
||||
pub fn init(app: *App, client: TypeProvider.Client) !Self {
|
||||
pub fn init(app: *App, client: TypeProvider.Client) Self {
|
||||
const allocator = app.allocator;
|
||||
return .{
|
||||
.client = client,
|
||||
.allocator = allocator,
|
||||
.browser_context = null,
|
||||
.browser = try Browser.init(app),
|
||||
.browser = Browser.init(app),
|
||||
.message_arena = std.heap.ArenaAllocator.init(allocator),
|
||||
.browser_context_pool = std.heap.MemoryPool(BrowserContext(Self)).init(allocator),
|
||||
};
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
// Copyright (C) 2023-2024 Lightpanda (Selecy SAS)
|
||||
//
|
||||
// Francis Bouvier <francis@lightpanda.io>
|
||||
// Pierre Tachoire <pierre@lightpanda.io>
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
const std = @import("std");
|
||||
|
||||
const json = std.json;
|
||||
@@ -17,7 +35,7 @@ const Browser = struct {
|
||||
session: ?*Session = null,
|
||||
arena: std.heap.ArenaAllocator,
|
||||
|
||||
pub fn init(app: *App) !Browser {
|
||||
pub fn init(app: *App) Browser {
|
||||
return .{
|
||||
.arena = std.heap.ArenaAllocator.init(app.allocator),
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user