forked from Floorp-Projects/Floorp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 1688452 - Retrofit nsExpatDriver to use RLBoxed libexpat r=tjr,pe…
…terv,bholley,glandium Differential Revision: https://phabricator.services.mozilla.com/D104658
- Loading branch information
Showing
18 changed files
with
807 additions
and
218 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ | ||
/* 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/. */ | ||
|
||
#ifndef __expat_config_moz_h__ | ||
#define __expat_config_moz_h__ | ||
|
||
#define MOZ_UNICODE | ||
#include "nspr.h" | ||
|
||
#ifdef IS_LITTLE_ENDIAN | ||
#define BYTEORDER 1234 | ||
#else | ||
#define BYTEORDER 4321 | ||
#endif /* IS_LITTLE_ENDIAN */ | ||
|
||
#if PR_BYTES_PER_INT != 4 | ||
#define int int32_t | ||
#endif /* PR_BYTES_PER_INT != 4 */ | ||
|
||
#endif /* __expat_config_moz_h__ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ | ||
/* 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/. */ | ||
|
||
#ifndef __expat_config_rlbox_h__ | ||
#define __expat_config_rlbox_h__ | ||
|
||
/* Wasm is little endian */ | ||
#define BYTEORDER 1234 | ||
|
||
/* We don't redefine int as int32_t for our 32-bit Wasm machine. */ | ||
#ifdef __cplusplus | ||
static_assert(sizeof(int) == sizeof(int32_t), "Expected int and int32_t to be of same size."); | ||
#endif | ||
|
||
/* We don't need to nor want to expose getpid() to expat */ | ||
#define getpid() 0 | ||
|
||
#endif /* __expat_config_rlbox_h__ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- | ||
# vim: set filetype=python: | ||
# 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/. | ||
|
||
expat_sources = [ | ||
'xmlparse.c', | ||
'xmlrole.c', | ||
'xmltok.c', | ||
] | ||
|
||
expat_defines = [ | ||
('HAVE_EXPAT_CONFIG_H', True) | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ | ||
/* 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/. */ | ||
|
||
#ifndef PARSER_HTML_RLBOX_EXPAT_H_ | ||
#define PARSER_HTML_RLBOX_EXPAT_H_ | ||
|
||
#include "rlbox_expat_types.h" | ||
|
||
// Load general firefox configuration of RLBox | ||
#include "mozilla/rlbox/rlbox_config.h" | ||
|
||
#ifdef MOZ_WASM_SANDBOXING_EXPAT | ||
// Include the generated header file so that we are able to resolve the symbols | ||
// in the wasm binary | ||
# include "rlbox.wasm.h" | ||
# define RLBOX_USE_STATIC_CALLS() rlbox_wasm2c_sandbox_lookup_symbol | ||
# include "mozilla/rlbox/rlbox_wasm2c_sandbox.hpp" | ||
#else | ||
// Extra configuration for no-op sandbox | ||
# define RLBOX_USE_STATIC_CALLS() rlbox_noop_sandbox_lookup_symbol | ||
# include "mozilla/rlbox/rlbox_noop_sandbox.hpp" | ||
#endif | ||
|
||
#include "mozilla/rlbox/rlbox.hpp" | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ | ||
/* 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/. */ | ||
|
||
#ifndef PARSER_HTML_RLBOX_EXPAT_TYPES_H_ | ||
#define PARSER_HTML_RLBOX_EXPAT_TYPES_H_ | ||
|
||
#include <stddef.h> | ||
#include "mozilla/rlbox/rlbox_types.hpp" | ||
|
||
#ifdef MOZ_WASM_SANDBOXING_EXPAT | ||
RLBOX_DEFINE_BASE_TYPES_FOR(expat, wasm2c) | ||
#else | ||
RLBOX_DEFINE_BASE_TYPES_FOR(expat, noop) | ||
#endif | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.